feat(ethereum): check VK tree root and protocol contracts hash in rollup compatibility#21537
Merged
aminsammara merged 2 commits intomerge-train/spartanfrom Mar 13, 2026
Merged
Conversation
…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.
PhilWindle
reviewed
Mar 13, 2026
|
|
||
| @memoize | ||
| async getVkTreeRoot(): Promise<Fr> { | ||
| const slot = BigInt(RollupContract.stfStorageSlot) + 3n; |
Collaborator
There was a problem hiding this comment.
Having to do this is ugly. :-(
Collaborator
There was a problem hiding this comment.
I guess there is no other way. I wonder if a future version of the rollup contract can have functions to return the values.
Contributor
Author
There was a problem hiding this comment.
If ethereum can increase the contract bytecode limit, it would make Lasse very happy
PhilWindle
approved these changes
Mar 13, 2026
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
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getVkTreeRoot()andgetProtocolContractsHash()methods toRollupContractthat read immutable config from L1 storage slots (stfStorageSlot + 3 and + 4)waitForCompatibleRollupto verify all three values (genesis archive root, VK tree root, protocol contracts hash) before allowing the node to proceedTest plan
getVkTreeRootandgetProtocolContractsHashinrollup.test.tsthat verify storage slot arithmetic against values set during deploymentwaitForCompatibleRollupbehavior preserved: enters standby mode on mismatch, polls until compatible rollup found