Skip to content

feat(ethereum): check VK tree root and protocol contracts hash in rollup compatibility#21537

Merged
aminsammara merged 2 commits intomerge-train/spartanfrom
am/update-rollup-compatibility-check
Mar 13, 2026
Merged

feat(ethereum): check VK tree root and protocol contracts hash in rollup compatibility#21537
aminsammara merged 2 commits intomerge-train/spartanfrom
am/update-rollup-compatibility-check

Conversation

@aminsammara
Copy link
Contributor

Summary

  • Adds getVkTreeRoot() and getProtocolContractsHash() methods to RollupContract that read immutable config from L1 storage slots (stfStorageSlot + 3 and + 4)
  • Extends waitForCompatibleRollup to verify all three values (genesis archive root, VK tree root, protocol contracts hash) before allowing the node to proceed
  • Prevents nodes from starting against a rollup deployed with incompatible circuits or protocol contracts

Test plan

  • Added unit tests for getVkTreeRoot and getProtocolContractsHash in rollup.test.ts that verify storage slot arithmetic against values set during deployment
  • Existing waitForCompatibleRollup behavior preserved: enters standby mode on mismatch, polls until compatible rollup found

…lup compatibility

Extends waitForCompatibleRollup to verify VK tree root and protocol contracts hash
in addition to genesis archive root, preventing nodes from starting against a rollup
with incompatible circuits or protocol contracts.
@aminsammara aminsammara requested a review from alexghr March 13, 2026 17:31
@aminsammara aminsammara changed the base branch from next to merge-train/spartan March 13, 2026 17:34

@memoize
async getVkTreeRoot(): Promise<Fr> {
const slot = BigInt(RollupContract.stfStorageSlot) + 3n;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Having to do this is ugly. :-(

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess there is no other way. I wonder if a future version of the rollup contract can have functions to return the values.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If ethereum can increase the contract bytecode limit, it would make Lasse very happy

@aminsammara aminsammara merged commit d223512 into merge-train/spartan Mar 13, 2026
11 checks passed
@aminsammara aminsammara deleted the am/update-rollup-compatibility-check branch March 13, 2026 19:18
AztecBot pushed a commit that referenced this pull request Mar 13, 2026
…lup compatibility (#21537)

## Summary

- Adds `getVkTreeRoot()` and `getProtocolContractsHash()` methods to
`RollupContract` that read immutable config from L1 storage slots
(stfStorageSlot + 3 and + 4)
- Extends `waitForCompatibleRollup` to verify all three values (genesis
archive root, VK tree root, protocol contracts hash) before allowing the
node to proceed
- Prevents nodes from starting against a rollup deployed with
incompatible circuits or protocol contracts

## Test plan

- Added unit tests for `getVkTreeRoot` and `getProtocolContractsHash` in
`rollup.test.ts` that verify storage slot arithmetic against values set
during deployment
- Existing `waitForCompatibleRollup` behavior preserved: enters standby
mode on mismatch, polls until compatible rollup found
@AztecBot
Copy link
Collaborator

✅ Successfully backported to backport-to-v4-staging #21477.

AztecBot added a commit that referenced this pull request Mar 14, 2026
BEGIN_COMMIT_OVERRIDE
fix: orchestrator enqueue yield (#21286)
chore: default multiplier (#21482)
chore: update yarn.lock (#21479)
chore: backport #21231 feat!: improve L2ToL1MessageWitness API to v4
(#21463)
feat(rpc): add package version to RPC response headers (#21526)
feat(ethereum): check VK tree root and protocol contracts hash in rollup
compatibility (#21537)
feat: add public log filtering by tag (#21561)
END_COMMIT_OVERRIDE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants