Skip to content

Reserve gas per reporter callback and combine settlement loops - #80

Draft
md0x wants to merge 1 commit into
pablo/reporters-under-root-srcfrom
pablo/reporter-callback-gas-reserve
Draft

Reserve gas per reporter callback and combine settlement loops#80
md0x wants to merge 1 commit into
pablo/reporters-under-root-srcfrom
pablo/reporter-callback-gas-reserve

Conversation

@md0x

@md0x md0x commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

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 --check passes.

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.

1 participant