Skip to content

test[oz-retainer-07-m-01]: cover overlapping liveness targets - #54

Open
md0x wants to merge 1 commit into
pablo/oz-retainer-07-m-02-liveness-capfrom
pablo/oz-retainer-07-m-01-liveness-range-validation
Open

test[oz-retainer-07-m-01]: cover overlapping liveness targets#54
md0x wants to merge 1 commit into
pablo/oz-retainer-07-m-02-liveness-capfrom
pablo/oz-retainer-07-m-01-liveness-range-validation

Conversation

@md0x

@md0x md0x commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Audit finding

OpenZeppelin Retainer 07 identified the following issue:

M-01 — Incorrect Liveness Range Validation in OOReporter

  • Severity: Medium
  • Status: Open

registerRequest accepts ranges that overlap the current Managed OO bounds, so a caller selecting an endpoint outside those bounds cannot initialize the request.

References: OpenZeppelin audit findings · FRO-97 · audited scope tag

Resolution

This PR is stacked on #53, which makes minimumLiveness the hard onchain floor and maximumLiveness an offchain target rather than a runtime ceiling.

  • Preserve the registration overlap predicate so the target range has a valid normal-path choice under the current Managed OO configuration.
  • Continue relying on Managed OO to enforce its current minimum and exclusive technical maximum at initialization.
  • Cover initialization inside the intersection of a partially overlapping target range and the current Managed OO bounds.
  • Retain fix[oz-retainer-07-m-02]: remove OOReporter runtime liveness cap #53's coverage for initialization and manual recovery above a stale target maximum after configuration drift.

Validation

  • cd pm-v2-oo-reporter && forge fmt --check
  • cd pm-v2-oo-reporter && forge test --match-path test/OOReporter.t.sol — 42 tests passed
  • git diff --check

@md0x
md0x marked this pull request as ready for review July 29, 2026 13:58
@linear

linear Bot commented Jul 29, 2026

Copy link
Copy Markdown

FRO-97

@md0x
md0x requested review from Reinis-FRP and chrismaree July 30, 2026 10:42
Comment thread pm-v2-oo-reporter/src/OOReporter.sol Outdated
Comment on lines +214 to +212
if (minimumLiveness >= MAXIMUM_CUSTOM_LIVENESS || maximumLiveness < oracleMinimumLiveness) {
if (minimumLiveness < oracleMinimumLiveness || maximumLiveness >= MAXIMUM_CUSTOM_LIVENESS) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR #53 intentionally makes maximumLiveness an off-chain target rather than a runtime ceiling, allowing the oracle initializer to exceed it when MOOv2 configuration drift would otherwise brick the request. Under that model, registration only needs to establish that the target range intersects MOOv2’s current valid range.

The previous predicate does exactly that: minimumLiveness < MAXIMUM_CUSTOM_LIVENESS ensures the hard requester floor does not make initialization impossible, while maximumLiveness >= oracleMinimumLiveness ensures the soft target range has a normal-path valid choice at registration. The new containment checks unnecessarily reject partially overlapping ranges and contradict the companion PR’s recovery semantics.

Please retain the overlap predicate and test both paths: initialization within the target intersection under unchanged configuration, and initialization above the soft maximumLiveness after minimumDisputeWindow drifts past it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — with #53, maximumLiveness is a soft offchain target, so registration should require overlap rather than full containment. I’ve stacked this PR on #53, restored the overlap semantics, and reduced #54 to focused coverage for initialization inside a partially overlapping target range. The stacked #53 tests also cover initialization and manual recovery above a stale target maximum after minimumDisputeWindow drifts. forge fmt --check and the 42-test OOReporter suite pass.

@md0x
md0x force-pushed the pablo/oz-retainer-07-m-01-liveness-range-validation branch from b3f8b81 to 7def0a8 Compare July 30, 2026 11:25
@md0x md0x changed the title fix[oz-retainer-07-m-01]: validate registered liveness bounds test[oz-retainer-07-m-01]: cover overlapping liveness targets Jul 30, 2026
@md0x
md0x changed the base branch from unaudited-pm-v2-oo-reporter to pablo/oz-retainer-07-m-02-liveness-cap July 30, 2026 11:25

@chrismaree chrismaree left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed against FRO-97 and the #53/FRO-107 semantic contract. The focused overlap test matches the hard-floor/soft-target model, while Managed OO continues enforcing live protocol bounds. The prior thread is outdated and substantively addressed.

Merge-order note: land #53 first, then retarget #54 to unaudited-pm-v2-oo-reporter before merging it.


Sent from Chris Codex Agent 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants