op-deployer: add computation of output root to prepare stage - #21963
Merged
Conversation
…nt or live intent.toml
lumoswiz
reviewed
Jul 23, 2026
Conflicts: op-deployer/pkg/deployer/prepare_test.go op-deployer/pkg/deployer/state/state.go
…r rollup artifacts
Calculation of the roots will happen in two passes, the first one calculates each of the chain's v0 root first and temporary stores them for computation of the v1 Super root only if it's needed.
lumoswiz
reviewed
Jul 27, 2026
0xiamflux
marked this pull request as ready for review
July 27, 2026 21:12
Conflicts: op-deployer/pkg/deployer/prepare_test.go
maurelian
reviewed
Jul 28, 2026
maurelian
reviewed
Jul 28, 2026
This was referenced Jul 29, 2026
Co-authored-by: Maurelian <john@oplabs.co>
maurelian
reviewed
Jul 29, 2026
maurelian
reviewed
Jul 29, 2026
maurelian
reviewed
Jul 30, 2026
maurelian
approved these changes
Jul 30, 2026
maurelian
enabled auto-merge
July 30, 2026 19:38
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.
Context
The final step of the PCD prepare stage produces the genesis output root for every chain being
prepared. To get there we need to build each chain's L2 genesis from the L1 addresses returned by
the
OPCM.deploydry run. This step also has to support Super Dispute Games, and because a superroot is computed cluster wide, wrapping the v0 output root of every chain in the deployment, the
anchor can only be derived once every chain's own root exists.
Later stages still rely on
op-deployer inspectto render thegenesis.jsonandrollup.jsonfiles, which is why the rendering path needs to know how to read a prepared (not yet applied)
state.
Changes
op-deployer/pkg/deployer/pipeline/env.go: addsResolveRenderIntent, which picks the intent torender
genesis.jsonandrollup.jsonfrom, for both applied and prepared deployments, and failswhen the state has been through neither pipeline.
op-deployer/pkg/deployer/inspect/genesis.goandinspect/rollup.go: resolve the intent throughthe helper before rendering their artifact.
op-deployer/pkg/deployer/pipeline/opchain.go: adds helpers that decide whether a deployment usessuper roots, by resolving each chain's proof params and checking its dispute game type.
op-deployer/pkg/deployer/pipeline/output_root.go: new file with the output root computation. Itworks in two passes. The first computes each chain's own v0 output root, the second decides what
the AnchorStateRegistry is seeded with, wrapping the v0 roots into a cluster wide SuperV1 root when
super games are used. Note that while super roots are supported, no shared AnchorStateRegistry is
produced: every chain gets its own ASR contract, seeded with the same
startingAnchorRoot.op-deployer/pkg/deployer/state/state.go: recordsGenesisBlockHashper chain, so post-deployvalidation can confirm the on-chain seeding matches the predicted genesis.
op-deployer/pkg/deployer/pipeline/interop_depset.go: extends the depset mismatch error to saythat the prepared chain set also determines every chain's starting anchor under super-root games.
op-deployer/pkg/deployer/prepare.go: wires up the L2 allocs generation and the output rootcomputation.
Tests
Isthmus active at genesis, the per-chain v0 root and its persistence, already deployed chains
being left alone, and the super root path.
mixed and single family intents.
block hash cross-check, the missing start block case, and
inspect genesis/inspect rollupwriting their files after a prepare run.
regeneration after an intent edit, and the full path from a prepared state to a computed anchor
without sending an L1 transaction.
Closes #20909
Closes #20910