Skip to content

Fix v3 invariant handler deployment and fuzz target discovery - #239

Merged
ryanio merged 1 commit into
v3from
ryan/v3-invariant-handler-fix
Nov 17, 2026
Merged

ryanio merged 1 commit into
v3from
ryan/v3-invariant-handler-fix

Conversation

@ryanio

@ryanio ryanio commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

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 deployCodeTo and targetInterface, 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 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 deployCodeTo and targetInterface, 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

@ryanio

ryanio commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

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.

@ryanio
ryanio merged commit b5a69de into v3 Nov 17, 2026
6 checks passed
@ryanio
ryanio deleted the ryan/v3-invariant-handler-fix branch November 17, 2026 19:41
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.

2 participants