op-deployer
simplifies the process of deploying and upgrading the OP Stack. Using the upgrade
command, you can upgrade a chain from one version to the next.
It consists of several subcommands, one for each upgrade version. Think of it like a database migration: each upgrade command upgrades a chain from exactly one previous version to the next. A chain that is several versions behind can be upgraded to the latest version by running multiple upgrade commands in sequence.
Unlike the bootstrap or apply commands, upgrade does not directly interact with the chain. Instead, it generates calldata. You can then use this calldata with cast, Gnosis SAFE, or whatever tooling you use to manage your L1.
Limitations of upgrade
There are a few limitations to upgrade
:
Using the standard OP Contracts Manager currently requires you to be using the standard shared SuperchainConfig contract. If you’re not using this, you will need to utilize the bootstrap
command to deploy your own Superchain target, including your own opcm
instance.
Using upgrade
1
Install `op-deployer`
Install
op-deployer
from source or pre-built binary.2
Create a `config.json` file
Create a The standard OPCM instances (
config.json
file using the following example:opcm
in the example above) and absolute prestates (absolutePrestate
) are found in the superchain registry:opcm
: underop_contracts_manager
for Mainnet and Sepolia.absolutePrestate
: thehash
under your chosen upgrade
3
Generate calldata
Run the following command:Now you have the calldata that can be executed onchain to perform the L1 contract upgrade. You should simulate this upgrade and make sure the changes are expected. You can reference the validation files of previously executed upgrade tasks in the superchain-ops repo to see what the expected changes are. Once you’re confident the state changes are expected, you can sign and execute the upgrade.
version
must be either major release 2.0
or higher.The output should look like: