Skip to content

[backports] op-deployer: Support custom OPCM #16546

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

bitwiseguy
Copy link
Contributor

@bitwiseguy bitwiseguy commented Jun 23, 2025

Replacement for #16430. Since the ReadSuperchainDeployments.s.sol script doesn't exist in the op-contracts/v3.0.0 artifacts, those rpc calls are reimplemented in go (using w3) instead of using the script.

Tests

Manually tested deploying a new op chain using the following sequence:

  1. bootstrap superchain
go run ./cmd/op-deployer bootstrap superchain \
  --l1-rpc-url=$SEPOLIA_RPC_URL \
  --private-key=$OP_DEPLOYER_PRIVATE_KEY \
  --artifacts-locator="tag://op-contracts/v3.0.0" \
  --outfile=./.deployer/bootstrap_superchain.json \
  --required-protocol-version="0xbbb0e51eCD7188d2F13769D7B4feE4390e970C7D000000000000000000000000" \
  --recommended-protocol-version="0xbbb0e51eCD7188d2F13769D7B4feE4390e970C7D000000000000000000000000" \
  --superchain-proxy-admin-owner="0x83D4eB702690413a0A1E5819ECc48b62160dFb42" \
  --protocol-versions-owner="0x83D4eB702690413a0A1E5819ECc48b62160dFb42" \
  --guardian="0x83D4eB702690413a0A1E5819ECc48b62160dFb42"
  1. bootstrap implementations
go run ./cmd/op-deployer bootstrap implementations \
  --l1-rpc-url=$SEPOLIA_RPC_URL \
  --l1-contracts-release="dev" \
  --private-key=$OP_DEPLOYER_PRIVATE_KEY \
  --artifacts-locator="tag://op-contracts/v3.0.0" \
  --outfile=./.deployer/bootstrap_implementations.json \
  --superchain-config-proxy="0x8d3b94f7041c87156461e9b652a01e030481ff7f" \
  --protocol-versions-proxy="0xb935a99226b3543755de5a821361d1007be6d052" \
  --superchain-proxy-admin="0x46c7f66170e6b63b2b27ae93c179407069bb2104" \
  --upgrade-controller="0x83D4eB702690413a0A1E5819ECc48b62160dFb42"
  1. create intent/state
go run ./cmd/op-deployer init --l2-chain-ids=336 --workdir=.deployer
  1. edit intent type to be custom, populate opcmAddress from [2]
  2. deploy op-chain
go run ./cmd/op-deployer apply \
  --private-key=$OP_DEPLOYER_PRIVATE_KEY \
  --l1-rpc-url $SEPOLIA_RPC_URL \
  --workdir ./.deployer

mslipper and others added 4 commits June 23, 2025 12:29
* op-deployer: Fix intent validation with pre-deployed OPCM

Previously, users were always required to provide the `SuperchainRoles` in their intent. Now that the intent supports providing an OPCM address, this is no longer necessary since we can look those values up on chain. The lookup was implemented in #15623, however users still had to provide `SuperchainRoles` in their intent to avoid validation errors.

The new logic is as follows:

- `standard` intents **must** specify the correct, standard OPCM address for the specified L1 and contracts version. Anything else is an error.
- All other intent types must **either** specify `SuperchainRoles`, or an OPCM address. Specifying both or neither will result in an error.
- The deployment pipeline will always pull `SuperchainRoles` data from the chain if the OPCM address is specified. Previously, it would only do this if the OPCM address was specified _and_ the L1 locator was a tag.

* cr updates
@bitwiseguy bitwiseguy changed the base branch from develop to backports/op-deployer/v0.3.0 June 23, 2025 18:48
Copy link

codecov bot commented Jun 23, 2025

Codecov Report

Attention: Patch coverage is 51.77305% with 68 lines in your changes missing coverage. Please review.

Project coverage is 41.77%. Comparing base (06265e0) to head (7c1f175).
Report is 1 commits behind head on backports/op-deployer/v0.3.0.

Files with missing lines Patch % Lines
...er/pkg/deployer/opcm/read_superchain_deployment.go 0.00% 42 Missing ⚠️
op-deployer/pkg/deployer/pipeline/init.go 68.57% 7 Missing and 4 partials ⚠️
op-deployer/pkg/deployer/state/intent.go 72.72% 6 Missing and 3 partials ⚠️
op-deployer/pkg/env/host.go 82.35% 2 Missing and 1 partial ⚠️
...-deployer/pkg/deployer/pipeline/implementations.go 0.00% 1 Missing ⚠️
op-deployer/pkg/deployer/pipeline/superchain.go 0.00% 1 Missing ⚠️
op-deployer/pkg/deployer/standard/standard.go 91.66% 1 Missing ⚠️
Additional details and impacted files
@@                       Coverage Diff                        @@
##           backports/op-deployer/v0.3.0   #16546      +/-   ##
================================================================
- Coverage                         46.13%   41.77%   -4.36%     
================================================================
  Files                              1046      876     -170     
  Lines                             90600    80668    -9932     
================================================================
- Hits                              41795    33702    -8093     
+ Misses                            45706    44038    -1668     
+ Partials                           3099     2928     -171     
Flag Coverage Δ
cannon-go-tests-32 ?
cannon-go-tests-64 ?
contracts-bedrock-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
op-deployer/pkg/deployer/state/chain_intent.go 82.35% <ø> (ø)
op-deployer/pkg/deployer/state/state.go 0.00% <ø> (ø)
...-deployer/pkg/deployer/pipeline/implementations.go 0.00% <0.00%> (ø)
op-deployer/pkg/deployer/pipeline/superchain.go 0.00% <0.00%> (ø)
op-deployer/pkg/deployer/standard/standard.go 59.48% <91.66%> (+16.89%) ⬆️
op-deployer/pkg/env/host.go 74.57% <82.35%> (+5.18%) ⬆️
op-deployer/pkg/deployer/state/intent.go 53.50% <72.72%> (-0.05%) ⬇️
op-deployer/pkg/deployer/pipeline/init.go 42.71% <68.57%> (+2.93%) ⬆️
...er/pkg/deployer/opcm/read_superchain_deployment.go 0.00% <0.00%> (ø)

... and 182 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bitwiseguy bitwiseguy requested a review from mslipper June 24, 2025 12:57
@bitwiseguy bitwiseguy marked this pull request as ready for review June 24, 2025 12:57
@bitwiseguy bitwiseguy requested review from a team as code owners June 24, 2025 12:57
@raffaele-oplabs raffaele-oplabs merged commit fed79f5 into backports/op-deployer/v0.3.0 Jun 26, 2025
51 checks passed
@raffaele-oplabs raffaele-oplabs deleted the ss/backport-deployer-custom-opcm branch June 26, 2025 22:35
bitwiseguy added a commit that referenced this pull request Jun 27, 2025
* op-deployer: Support custom OPCM (#15623)

* op-deployer: use w3 instead of ReadSuperchainDeployment script

* op-deployer: Fix intent validation with pre-deployed OPCM (#15712)

* op-deployer: Fix intent validation with pre-deployed OPCM

Previously, users were always required to provide the `SuperchainRoles` in their intent. Now that the intent supports providing an OPCM address, this is no longer necessary since we can look those values up on chain. The lookup was implemented in #15623, however users still had to provide `SuperchainRoles` in their intent to avoid validation errors.

The new logic is as follows:

- `standard` intents **must** specify the correct, standard OPCM address for the specified L1 and contracts version. Anything else is an error.
- All other intent types must **either** specify `SuperchainRoles`, or an OPCM address. Specifying both or neither will result in an error.
- The deployment pipeline will always pull `SuperchainRoles` data from the chain if the OPCM address is specified. Previously, it would only do this if the OPCM address was specified _and_ the L1 locator was a tag.

* cr updates

* op-deployer: fix OPCMImplAddressFor

* remove unused ReadSuperchainDeployment.s.sol script

---------

Co-authored-by: Matthew Slipper <[email protected]>
bitwiseguy added a commit that referenced this pull request Jun 27, 2025
* op-deployer: Support custom OPCM (#15623)

* op-deployer: use w3 instead of ReadSuperchainDeployment script

* op-deployer: Fix intent validation with pre-deployed OPCM (#15712)

* op-deployer: Fix intent validation with pre-deployed OPCM

Previously, users were always required to provide the `SuperchainRoles` in their intent. Now that the intent supports providing an OPCM address, this is no longer necessary since we can look those values up on chain. The lookup was implemented in #15623, however users still had to provide `SuperchainRoles` in their intent to avoid validation errors.

The new logic is as follows:

- `standard` intents **must** specify the correct, standard OPCM address for the specified L1 and contracts version. Anything else is an error.
- All other intent types must **either** specify `SuperchainRoles`, or an OPCM address. Specifying both or neither will result in an error.
- The deployment pipeline will always pull `SuperchainRoles` data from the chain if the OPCM address is specified. Previously, it would only do this if the OPCM address was specified _and_ the L1 locator was a tag.

* cr updates

* op-deployer: fix OPCMImplAddressFor

* remove unused ReadSuperchainDeployment.s.sol script

---------

Co-authored-by: Matthew Slipper <[email protected]>
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.

3 participants