Skip to content

test: local multi-rollup environment with real contracts#60

Merged
koenmtb1 merged 2 commits intomainfrom
test/multi-rollup-environment
Apr 21, 2026
Merged

test: local multi-rollup environment with real contracts#60
koenmtb1 merged 2 commits intomainfrom
test/multi-rollup-environment

Conversation

@koenmtb1
Copy link
Copy Markdown
Contributor

Summary

Adds a self-contained local test environment that stands up two canonical rollups in the same Registry on anvil, using real production bytecode for every contract (no mocks). Lets us validate multi-rollup behaviour end-to-end against the indexer's /api/rollups endpoint and downstream hooks before we touch the dashboard's claim/withdraw flows in a follow-up.

This is a testing-only PR, no frontend or indexer behaviour changes. Just three scripts + a README under scripts/multi-rollup-test/.

Dependant PR

This PR depends on #59 merging

What's in the box

scripts/multi-rollup-test/deploy-multi-rollup.sh orchestrates:

  1. Phase 0: Multicall3 via anvil_setCode (wagmi useReadContracts needs it; anvil doesn't deploy it).
  2. Phase 1: aztec-packages/l1-contracts DeployAztecL1Contracts.s.sol, Registry, GSE, Governance, Rollup v1, MockVerifier, TestERC20s.
  3. Phase 2: DeployRollupForUpgrade.s.sol with a fresh random GENESIS_ARCHIVE_ROOT to mint a Rollup v2 with a different version hash.
  4. Phase 3: anvil_impersonateAccount Governance and call Registry.addRollup(v2) so the Registry knows about both versions.
  5. Phase 4: deploy the real SplitsWarehouse, PullSplitFactory, StakingRegistry, ATPFactory (with library linking for the LATP/MATP/NCATP factory libs), ATPWithdrawableAndClaimableStaker from ignition-contracts. Wires them up with the staking asset and Registry from Phase 1.
  6. Output: deploy-output.json (every address, for the seed scripts) plus contract_addresses.json in the schema both bootstrap.sh scripts already understand. Drop them in via CONTRACT_ADDRESSES_FILE.

scripts/multi-rollup-test/seed-multi-rollup.ts:

  • Writes sequencer reward amounts directly into the Rollup's ERC-7201 namespaced storage via anvil_setStorageAt (matrix in the README).
  • Flips isRewardsClaimable=true on both rollups without clobbering the packed timestamp at offset 0.
  • Mints fee tokens to both rollups so claimSequencerRewards can pay out.

scripts/multi-rollup-test/seed-providers.ts:

  • Registers 10 providers against the real StakingRegistry.registerProvider(admin, takeRate, recipient) so /api/providers returns non-empty data.

scripts/multi-rollup-test/README.md:

@koenmtb1 koenmtb1 requested a review from a team April 20, 2026 12:35
@koenmtb1 koenmtb1 requested a review from a team as a code owner April 20, 2026 12:35
@koenmtb1 koenmtb1 merged commit 9a9892e into main Apr 21, 2026
2 checks passed
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.

1 participant