Repository navigation
Conversation
AggregateVerifier.claimCredit() has two branches: (A) expectedResolution != max: requires the game to be resolved (B) expectedResolution == max: requires 14 days since createdAt Branch (A) is covered across AggregateVerifier.t.sol, Nullify.t.sol, and Challenge.t.sol. Branch (B) — reached when all proofs are nullified and proofCount drops to zero — had no coverage. Add AggregateVerifierClaimCreditFallbackTest with three cases: - reverts with GameNotOver before 14 days - succeeds (full two-step DelayedWETH bond return) after 14 days - reverts with NoCreditToClaim on a second claim attempt
Collaborator
🟡 Heimdall Review Status
|
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.
Summary
AggregateVerifier.claimCredit()has two distinct execution paths:expectedResolution != type(uint64).max): requires the game to be resolved before credit can be claimed.expectedResolution == type(uint64).max): entered when all submitted proofs are nullified andproofCountdrops back to zero; allows the original proposer to recover the bond after 14 days regardless of resolution state.Path (A) is exercised across
AggregateVerifier.t.sol,Nullify.t.sol, andChallenge.t.sol. Path (B) had no coverage.Changes
Add
AggregateVerifierClaimCreditFallbackTestin a new filetest/L1/proofs/AggregateVerifierClaimCredit.t.solwith three cases:test_claimCredit_noProof_beforeFourteenDays_revertsGameNotOverbefore the 14-day windowtest_claimCredit_noProof_afterFourteenDays_succeedstest_claimCredit_noProof_doubleClaimRevertsNoCreditToClaimon a second claim attemptThe setUp drives the game into the no-proof state using the same shared-verifier nullification pattern from
Nullify.t.sol: a child game nullifies the sharedteeVerifier, and a subsequentresolve()call on the parent triggers the early-return path that zeroesproofCountand resetsexpectedResolutiontotype(uint64).max.Validation
forge test --match-path test/L1/proofs/AggregateVerifierClaimCredit.t.sol: 3 passed, 0 failedforge test --match-path test/L1/proofs/AggregateVerifier.t.sol: 32 passed, 0 failed (no regressions)