These scripts empower CelestiaNitroContracts2Point1Point0UpgradeAction
action contract which performs a migration to the Celestia 2.1.0 release of Nitro contracts for existing Orbit chains. Read more to find out how to deploy the upgrade action or use a pre existing one.
CelestiaNitroContracts2Point1Point0UpgradeAction will perform the following action:
- Migrate the SequencerInbox to the celestia-v2.1.0 version
- Set the wasm module root to the new version in order to handle Celestia DA logic
- Set the conditional wasm root and one step proof to handle pre-stylus logic
- Upgrade RollupAdminLogic and RollupUserLogic contracts
Note that contracts without code changes are not upgraded. It is normal to have some contracts still in the old version after the upgrade as they are equivalent to the new version. Additionally note that only the SequencerInbox and OneStepProverHostIo contracts change for the 2.1.0 Celestia DA version of the nitro contracts
Caution
The scripts have logic to deploy a OneStepProverHostIo.sol with the Blobstream address for the given chaind id. However things can change and it is the deployer and script executor's responsability to check they are using a OneStepProverHostIo with the right BLOBSTREAM address set for their parent chain. Deployed instances of SP1 Blobstream can be found here. A new deployment and custom logic in the script is required to properly deploy these contracts to a parent chain not listed above, proceed with caution.
This upgrade only support upgrading from the following nitro-contract release:
- Inbox: v1.1.0 - v1.3.0 inclusive
- Outbox: v1.1.0 - v1.3.0 inclusive
- SequencerInbox: v1.2.1 - v2.1.0 inclusive
- Bridge: v1.1.0 - v1.3.0 inclusive
- RollupProxy: v1.1.0 - v2.1.0 inclusive
- RollupAdminLogic: v1.1.0 - v1.3.0 inclusive
- RollupUserLogic: v1.1.0 - v1.3.0 inclusive
- ChallengeManager: v1.2.1 - v1.3.0 inclusive
Please refer to the top README Check Version and Upgrade Path
on how to determine your current nitro contracts version.
Additionally, note that these contracts can be used to migrate a chain thats already on ArbOS32 to use Celestia DA.
- Setup .env according to the example files, make sure you have everything correctly defined. The script will do some sanity checks but not everything can be checked. The .env file must be in project root for recent foundary versions.
Caution
The .env file must be in project root.
- (Skip this step if you can use the deployed instances of action contract)
DeployCelestiaNitroContracts2Point1Point0UpgradeActionScript.s.sol
script deploys templates, and upgrade action itself. It can be executed in this directory like this:
forge script --sender $DEPLOYER --rpc-url $PARENT_CHAIN_RPC --broadcast --slow DeployCelestiaNitroContracts2Point1Point0UpgradeActionScript -vvv --verify --skip-simulation
# use --account XXX / --private-key XXX / --interactive / --ledger to set the account to send the transaction from
As a result, all templates and upgrade action are deployed. Note the last deployed address - that's the upgrade action.
ExecuteCelestiaNitroContracts2Point1Point0Upgrade.s.sol
script uses previously deployed upgrade action to execute the upgrade. It makes following assumptions - L1UpgradeExecutor is the rollup owner, and there is an EOA which has executor rights on the L1UpgradeExecutor. Proceed with upgrade using the owner account (the one with executor rights on L1UpgradeExecutor):
forge script --sender $EXECUTOR --rpc-url $PARENT_CHAIN_RPC --broadcast ExecuteCelestiaNitroContracts2Point1Point0UpgradeScript -vvv
# use --account XXX / --private-key XXX / --interactive / --ledger to set the account to send the transaction from
If you have a multisig as executor, you can still run the above command without broadcasting to get the payload for the multisig transaction.
- That's it, upgrade has been performed. You can make sure it has successfully executed by checking wasm module root:
cast call --rpc-url $PARENT_CHAIN_RPC $ROLLUP "wasmModuleRoot()"
unable to find validator machine directory for the on-chain WASM module root err="stat /home/user/target/machines/0xe81f986823a85105c5fd91bb53b4493d38c0c26652d23f76a7405ac889908287: no such file or directory"
A: upgrade to celestia nitro-node v3.2.1+
error acting as staker err="error advancing stake from node 0 (hash 0x0000000000000000000000000000000000000000000000000000000000000000): error generating node action: wasmroot doesn't match rollup : 0x260f5fa5c3176a856893642e149cf128b5a8de9f828afec8d11184415dd8dc69, valid: [0x8b104a2e80ac6165dc58b9048de12f301d70b02a0ab51396c22b4b4b802a16a4]"
A: make sure there is activity on the child chain and a new batch is posted after the upgrade
A: try to add -g 1000 to the command