Reserve gas per reporter callback and combine settlement loops - #80
Conversation
chrismaree
left a comment
There was a problem hiding this comment.
The single-loop approach and explicit forwarded-gas limit look sound, and moving the reserve constant into OOReporter follows Jay's feedback. I am requesting validation before approving removal of the outer isolation boundary; I have not established that 150,000 gas is insufficient.
The added gas-exhaustion regression calls MockOptimisticOracleV2.settle. That mock returns immediately after priceSettled, whereas the real path returns through OptimisticOracleV2._settle's _endReentrantGuardDisabled, the nonReentrant modifier reset, and proxy/ABI return handling. With the outer callback self-call removed, exhausting the reserve during the remaining loop or enclosing return now rolls back settlement and earlier successful reports. The README and PR still describe the reserve as a candidate, and Jay's latest Slack reply explicitly leaves final validation pending.
Please add a regression using the real ManagedOptimisticOracleV2 settlement implementation and proxy arrangement, with ten linked IDs, cold state, a callback consuming its full allowance at each possible position, and bounded transaction gas. Assert settlement, all ten resolution events, persistence of earlier successful reports, and permissionless recovery. Document a conservative budget for the remaining registration writes/events/loop, measurement-to-CALL overhead, and settlement return path under the configured Polygon-compatible gas schedule; select the reserve with explicit headroom from that evidence. This can be a local real-contract integration test without a live-chain transaction.
Reviewed 69efc8d against #76 and the OZ discussion. Static code and existing-test review only; no tests or builds run.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Stacked on #76. Replace the outer callback self-call and batch catch with one bounded loop that emits each resolution event before attempting its callback.
OOReporterdefines the shared gas reserve, applied before each Polymarket report. Earlier successful reports persist; failed or skipped reports remain permissionlessly retryable.Retain the 150,000 reserve with a documented 135,000 completion budget plus 15,000 headroom. This covers nine remaining cold iterations, call setup, the failure event, both proxy returns and the real oracle's completion path, without crediting refunds or enclosing-frame EIP-150 gas retention. Audit confirmation remains pending; sufficient transaction gas and the documented compiler/gas schedule assumptions still apply.
Validation:
Storage layout is unchanged. Derived reporter hooks remain trusted to apply the inherited reserve and catch external failures. The gas breakdown and validation limits are in the reporter README under "Callback gas budget".