Reserve gas per reporter callback and combine settlement loops - #80
Draft
md0x wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Draft proposal 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. Each Polymarket report preserves a gas reserve; when that budget is exhausted, remaining callbacks are skipped while resolution events continue. Earlier successful reports persist, and failed/skipped reports remain permissionlessly retryable.
The proposed 150,000 gas reserve needs audit validation against the production settlement return path and worst-case remaining loop costs, including call overhead. This assumes sufficient transaction gas. Events and callbacks are now interleaved, and derived reporters must bound/catch external calls in their internal resolution hook. Storage layout is unchanged.
Validation: 68 reporter tests pass, including upgrade coverage and 256 fuzz runs moving a gas-exhausting callback across the ten-ID batch with cold storage. The regression test fails on the base implementation. Changed Solidity files pass
forge fmt --check;git diff --checkpasses.