Skip to content

fix: close finalized dispute games before claiming bonds#922

Open
fakedev9999 wants to merge 1 commit into
mainfrom
close-finalized-games
Open

fix: close finalized dispute games before claiming bonds#922
fakedev9999 wants to merge 1 commit into
mainfrom
close-finalized-games

Conversation

@fakedev9999

@fakedev9999 fakedev9999 commented May 28, 2026

Copy link
Copy Markdown
Member

Summary

  • Add closeGame() and bondDistributionMode() bindings for fault dispute games.
  • Change proposer/challenger sync so finalized games in BondDistributionMode.UNDECIDED are closed before bond claim or cache eviction decisions.
  • Add bounded in-memory retries for close-game transactions, close-failure metrics, stale retry-counter cleanup, and sync coverage for zero-init-bond and close-before-claim cases.

Motivation

credit == U256::ZERO is not a reliable lifecycle signal before a game is closed. With a zero init bond, a finalized game can still have zero credit while bondDistributionMode remains UNDECIDED, so evicting or skipping it leaves the game unclosed.

Behavior change

This intentionally splits the common nonzero-bond flow from claimCredit() implicitly closing and claiming in one transaction to closeGame() first, then claiming after the mode is known. That adds one extra transaction for eligible games, but avoids using pre-close credit() as a lifecycle oracle.

Review response

  • Added proposer/challenger close-failure Prometheus gauges.
  • Clear close retry counters when sync observes a game has left UNDECIDED.
  • Moved the close retry cap into a shared contract constant to avoid proposer/challenger drift.

Validation

  • cargo fmt --all
  • cargo clippy --all-features --all-targets -- -D warnings -A incomplete-features
  • cargo test -p op-succinct-fp --test backup -- --nocapture
  • git diff --check

Notes

  • The proposer close flag is not persisted; it is re-derived from chain state on sync.
  • Targeted sync integration tests were retried locally after initializing contract submodules, but the run was aborted after remaining CPU-bound in heavy setup before assertions completed.

@github-actions

github-actions Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor
Metric Value
Batch Start 18,497,337
Batch End 18,497,342
Witness Generation (seconds) 0
Execution Duration (seconds) 66
Total Instruction Count 888,648,032
Oracle Verify Cycles 93,351,567
Derivation Cycles 687,412,453
Block Execution Cycles 6,713,100
Blob Verification Cycles 30,696,793
Total SP1 Gas 1,209,332,060
Number of Blocks 5
Number of Transactions 5
Ethereum Gas Used 242,338
Cycles per Block 177,729,606
Cycles per Transaction 177,729,606
Transactions per Block 1
Gas Used per Block 48,467
Gas Used per Transaction 48,467
BN Pair Cycles 0
BN Add Cycles 0
BN Mul Cycles 0
KZG Eval Cycles 0
EC Recover Cycles 0
P256 Verify Cycles 0

@fakedev9999
fakedev9999 force-pushed the close-finalized-games branch from 4497055 to a8601e9 Compare May 28, 2026 01:50
@fakedev9999 fakedev9999 changed the title Close finalized dispute games before claiming bonds fix: close finalized dispute games before claiming bonds May 28, 2026
@fakedev9999
fakedev9999 marked this pull request as ready for review May 28, 2026 01:57
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