Skip to content

contracts-bedrock: search fork-safe start in findLatestGames fuzz test - #23780

Merged
teddyknox merged 3 commits into
developfrom
claude/findlatestgames-fork-safe-fuzz
Nov 10, 2026
Merged

teddyknox merged 3 commits into
developfrom
claude/findlatestgames-fork-safe-fuzz

Conversation

@teddyknox

@teddyknox teddyknox commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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_succeeds creates _numGames games, 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 > 0 find 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, gameCount equals _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

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>
@teddyknox
teddyknox requested a review from wwared November 10, 2026 16:42
@teddyknox teddyknox self-assigned this Nov 10, 2026
@teddyknox
teddyknox requested review from maurelian and mds1 November 10, 2026 17:20
@github-actions

Copy link
Copy Markdown
Contributor

Agent approval check

Head branch claude/findlatestgames-fork-safe-fuzz matches agent prefix claude/

Current head: 457bc1630cfb458b6d368afc5c0afd6688195183
Human approvals: 3/2
Approvers: @einar-oplabs, @mds1, @wwared

@teddyknox
teddyknox added this pull request to the merge queue Nov 10, 2026
Merged via the queue into develop with commit a352977 Nov 10, 2026
82 checks passed
@teddyknox
teddyknox deleted the claude/findlatestgames-fork-safe-fuzz branch November 10, 2026 19:54
@teddyknox teddyknox mentioned this pull request Nov 10, 2026
3 of 5 tasks
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.

4 participants