op-deployer: fix missing Superchain Deployment after prepare - #22082
op-deployer: fix missing Superchain Deployment after prepare#220820xiamflux wants to merge 2 commits into
Conversation
| *intent.SuperchainConfigProxy, | ||
| ) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to read superchain deployment: %w", err) | ||
| } | ||
| if superDeployment.SuperchainConfigProxy != *intent.SuperchainConfigProxy { | ||
| return fmt.Errorf( | ||
| "superchain config proxy mismatch: read %s, intent %s", | ||
| superDeployment.SuperchainConfigProxy, | ||
| *intent.SuperchainConfigProxy, | ||
| ) | ||
| } |
There was a problem hiding this comment.
Claude pointed out to me that PopulateSuperchainState just copies the SuperchainConfigProxy from input to output via ReadSuperChainDeployment.
So this check is just dead code.
There is no longer an opcm.superchainConfig(), so the only possible source is the intent. Given that, I'm not sure this PR is still needed?
There was a problem hiding this comment.
Just checked the script used under the hood and the check can be removed.
There was a problem hiding this comment.
But can you elaborate a little bit more on the second point?
There was a problem hiding this comment.
Just for context: some consumers do an address lookup from this SuperchainDeployment object. The rationale for fixing this here and making sure SuperchainDeployment gets populated, is that if we left it unfixed in op-deployer and instead handled it in the consumer, we'd end up with two different lookup paths for no reason other than that the prepare pipeline doesn't set SuperchainDeployment while apply does.
Context
Some consumers read
State.SuperchainDeploymentfrom the preparedstate.json, butpreparedoes not set it as it resolves theSuperchainConfigProxyonly in the intent, where it feeds the prediction dry-run.Fix
preparereads the live Superchain off the fork it already creates, using the same script apply's live init uses, and commitsSuperchainDeploymentandSuperchainRolesinto the state. IfSuperchainConfigProxyread from the intent is not the same as the one on-chain, the whole step reverts.