Repository navigation
contracts-bedrock: search fork-safe start in findLatestGames fuzz test - #23780
Merged
Merged
Conversation
testFuzz_findLatestGames_correctAmount_succeeds searched from index _numGames - 1. On a fork the factory already holds the chain's own games, so that index points at a historical game, not one the test created. On ink-mainnet games 0-4 are all type 1, so any input with _n > 0 returned no type-0 games and failed (counterexample [29, 43, 9]). OP Mainnet's first games are type 0, which hid the bug there. Search from the factory's newest game instead. Without a fork the start index is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 6, 2026
einar-oplabs
approved these changes
Nov 10, 2026
wwared
approved these changes
Nov 10, 2026
mds1
approved these changes
Nov 10, 2026
Contributor
Agent approval checkHead branch claude/findlatestgames-fork-safe-fuzz matches agent prefix claude/ Current head: |
3 of 5 tasks
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.
Fixes a fuzz test that fails on some forked chains for most inputs. CircleCI passes today only because its single fixed-seed input happens to miss the failure. Test-only change, one file.
The problem.
testFuzz_findLatestGames_correctAmount_succeedscreates_numGamesgames, then searches backwards from index_numGames - 1. On a fork, the factory already holds the chain's own games, so that index can point at a historical game instead of one the test created. On ink-mainnet, games 0–4 are all type 1, so inputs with_n > 0find no type-0 games and fail (counterexample[29, 43, 9]). OP Mainnet's first games are type 0, which hides the bug there.What changes. The test searches from the factory's newest game. Without a fork,
gameCountequals_numGames, so the start index is the same as before.Effect. No contract changes. A seed or run-count change can no longer make the ink-mainnet upgrade job fail on this test.
Testing. All 92 CI checks pass on this PR. The same commit also ran through every CircleCI contracts job on #23151's green head pipeline, including the heavy-fuzz and mainnet-fork upgrade variants.
Context. This is one of four small PRs that change code CircleCI runs, found while reviewing the RWX pilot (#23151): #23772, #23775, #23776 and #23780. Each stands alone. The additive RWX shadow is #23783.
Tracked in #24044.
🤖 Generated with Claude Code