Repository navigation
Fix v3 invariant handler deployment and fuzz target discovery - #239
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
CI on pinned Foundry must confirm nonzero randomized handler calls, since static review cannot establish that runtime artifact association and fuzz-target discovery now allow the campaign to start.
No open issues 🎉
What changed in this PR
Fixes v3 invariant campaign startup by deploying the handler normally so Forge can discover its fuzz targets.
Changes:
- Moves fixture deployment to the outer test and passes the minter and tokens to the handler.
- Transfers fixture ownership to the handler, which accepts it during setup.
- Removes
deployCodeToandtargetInterface, preserving all ten randomized actions, assertions, and production size limits.
| File | Description |
|---|---|
test/v3/SeaDropMinterInvariant.t.sol |
Updates fixture deployment, ownership handoff, and handler registration for fuzz target discovery. |
Review effort: Balanced
|
Pinned Foundry CI confirms the campaign now runs: 128 sequences, 8,192 randomized handler calls, zero unexpected reverts and zero discards. All ten selectors ran, including 885 mint calls and 839 withdrawal calls. The full test job passed 606 tests with zero failures and two skipped fork tests. Evidence: https://github.com/ProjectOpenSea/seadrop/actions/runs/44160853683/job/134313950803 . This validates runtime target discovery requested by the review; call counts include actions that return when no mint or withdrawal is available. |
The v3 invariant suite merged in #237 cannot start its randomized campaign: Forge reports that the etched handler address has no associated contract for
targetSelectors. The seeded setup calls succeed, but the campaign runs zero calls.Deploy the existing minter/token fixture in the outer test and pass those references to a normally deployed handler. The handler still reuses the shared signing helpers, but its setup does not embed the fixture's deployment code. This removes
deployCodeToandtargetInterface, preserves all ten randomized actions and every assertion, and keeps production size limits unchanged.Validation: pinned formatting and lint pass. Test execution and coverage run in CI only, with no Docker or local test suite.