-
Notifications
You must be signed in to change notification settings - Fork 19
3.2.0 action #76
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
Merged
3.2.0 action #76
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
66a6358
scaffold
godzillaba 0f01143
implement 3.2.0 action
godzillaba d0b3214
deploy action script
godzillaba ba17299
execute script
godzillaba a082f44
add versioner route to 3.2.0
godzillaba f0c81bf
versioner works post 3.2.0
godzillaba 5bbd8d9
fix deployment script for create2
godzillaba c1c968c
deterministic action address
godzillaba bd0f6b7
add verification script and update readme
godzillaba dce1920
fix
godzillaba 7263590
Merge remote-tracking branch 'origin/main' into ha/3.2.0
godzillaba 8acc128
require rollup impls deployed
godzillaba a86127b
fix readme mistake
godzillaba fdab5b8
Merge branch 'main' into ha/3.2.0
godzillaba File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
contracts/parent-chain/contract-upgrades/NitroContracts3Point2Point0UpgradeAction.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity ^0.8.16; | ||
|
|
||
| interface IRollupAdminLogic { | ||
| function upgradeSecondaryTo(address newImplementation) external; | ||
| function upgradeTo(address newImplementation) external; | ||
| } | ||
|
|
||
| /** | ||
| * @title NitroContracts3Point2Point0UpgradeAction | ||
| * @notice Upgrade action for nitro contracts v3.2.0 | ||
| * @dev Only upgrades Rollup contract, other diff between v3.2.0 and v3.1.0 are irrelevant. | ||
| */ | ||
| contract NitroContracts3Point2Point0UpgradeAction { | ||
| address public immutable newRollupAdminLogicImpl; | ||
| address public immutable newRollupUserLogicImpl; | ||
|
|
||
| constructor(address _newRollupAdminLogicImpl, address _newRollupUserLogicImpl) { | ||
| require(_newRollupAdminLogicImpl.code.length > 0, "invalid rollup admin logic impl"); | ||
| require(_newRollupUserLogicImpl.code.length > 0, "invalid rollup user logic impl"); | ||
| newRollupAdminLogicImpl = _newRollupAdminLogicImpl; | ||
| newRollupUserLogicImpl = _newRollupUserLogicImpl; | ||
| } | ||
|
|
||
| function perform(address rollup) external { | ||
| // skip sequencer inbox upgrade since it only adds custom DA header support | ||
| // skip OSP upgrade since it only adds custom DA validation support | ||
|
|
||
| // RollupAdminLogic is the primary implementation | ||
| // RollupUserLogic is the secondary implementation | ||
| // see: https://github.com/OffchainLabs/nitro-contracts/blob/d9a2f3353ff13c706b7807b097e7ba591d970d85/src/libraries/AdminFallbackProxy.sol#L141-L143 | ||
|
|
||
| IRollupAdminLogic(rollup).upgradeTo(newRollupAdminLogicImpl); | ||
| IRollupAdminLogic(rollup).upgradeSecondaryTo(newRollupUserLogicImpl); | ||
| } | ||
| } |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| "v3.2.0": { | ||
| "eth": { | ||
| "Inbox": [ | ||
| "0x2c358843740dB38a40f96FD627D4DA1dd859E554", | ||
| "0x8D3b93dfFFf4842E7B61FB553b383db2C6BC91c6" | ||
| ], | ||
| "Outbox": ["0x396765AEbE540575ef927F769b0d7b89594f931c"], | ||
| "SequencerInbox": [ | ||
| "0xDA2e941cc4C7D8166Ec207CB7f7B09bA4f94406c", | ||
| "0x3636c0bB4Cfd072d06cbf59754A2830D05fD3419", | ||
| "0x17d9a7f836cB3A97aCcf96E59f56504457044945", | ||
| "0xF6995BDC439B27deEA5d5d08e95E92451a7d36F5", | ||
| "0x41e2B560F0B41FBc4A063Eac5298da4C246BEA1B", | ||
| "0xb015D78fb9B890e96FD3E23819b2C8D9fffA3cC5" | ||
| ], | ||
| "Bridge": ["0xC678f7B95A7D1F77c6024c0086301D21402854b1"], | ||
| "RollupEventInbox": ["0x796FeE4adceD1cb47a3e3d1B6925472F8fC8f1f9"] | ||
| }, | ||
| "erc20": { | ||
| "Inbox": [ | ||
| "0x02E5bFcF09Cc317EDDCaca72a1b1265A57197Db5", | ||
| "0xBfd8916b9DCB60B3b437D2B3a6FF56F78DcD9Ff2" | ||
| ], | ||
| "Outbox": ["0x5128805C5331A3D445B72545d2461B2C3B05218c"], | ||
| "SequencerInbox": [ | ||
| "0xB8594C833f519126B614979867216EB4BAE82B6d", | ||
| "0x5Bf5D77bed887dC32beE7852920A6C93A3D950f1", | ||
| "0xD5396bCeE766352B4f87E75708E35E4844883Fb5", | ||
| "0xC7FeB25D44D87F753C4ecCb974426Aea8c817f72", | ||
| "0xE3E3A0EeFe4f3388eaf4AAA9A77Df0D0d489b776", | ||
| "0x2D721E1704c48c9F16353a3b346Aa1EFEc9aA86c" | ||
| ], | ||
| "Bridge": ["0x0124687D1F2869b0C2335B98ddc7FCf59DA2CEa1"], | ||
| "RollupEventInbox": ["0x2706682dD3bD709b055E0266D98BA380FE22B807"] | ||
| }, | ||
| "RollupProxy": [], | ||
| "RollupAdminLogic": ["0xAb7A44CE7e66963d2116dCe74AB63eeF88266C82"], | ||
| "RollupUserLogic": ["0xedC23dFC7D1e57EC07eA5ff7419634DbAe08Ed2C"], | ||
| "ChallengeManager": ["0xCAaa9332F940362aEAAADD1B0A59c229C4fD8f79"] | ||
| } | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| ## Forge configuration (uncomment/adjust as needed) | ||
| ## All FOUNDRY_* env vars are supported: https://book.getfoundry.sh/reference/config/ | ||
| # FOUNDRY_BROADCAST=true | ||
| # ETH_PRIVATE_KEY=0x... | ||
|
|
||
| ## Chain and contract addresses | ||
| PARENT_CHAIN_RPC= | ||
| ROLLUP_ADDRESS= | ||
| UPGRADE_ACTION_ADDRESS=0x352b46fc500757e07a7e6063870c3a2b2c72da90 | ||
| PARENT_UPGRADE_EXECUTOR_ADDRESS= |
29 changes: 29 additions & 0 deletions
29
scripts/foundry/contract-upgrades/3.2.0/DeployNitroContracts3Point2Point0UpgradeAction.s.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,29 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity 0.8.16; | ||
|
|
||
| import {DeploymentHelpersScript} from "../../helper/DeploymentHelpers.s.sol"; | ||
| import { | ||
| NitroContracts3Point2Point0UpgradeAction | ||
| } from "../../../../contracts/parent-chain/contract-upgrades/NitroContracts3Point2Point0UpgradeAction.sol"; | ||
| import {MockArbSys} from "../../helper/MockArbSys.sol"; | ||
|
|
||
| /** | ||
| * @title DeployNitroContracts3Point2Point0UpgradeActionScript | ||
| * @notice Deploys implementation contracts and the NitroContracts3Point2Point0UpgradeAction contract. | ||
| */ | ||
| contract DeployNitroContracts3Point2Point0UpgradeActionScript is DeploymentHelpersScript { | ||
| function run() public { | ||
| vm.startBroadcast(); | ||
|
|
||
| // see scripts/orbit-versioner/referentContractAddresses.json | ||
| // there is only one address shared across all chains | ||
| address newAdminLogic = 0xAb7A44CE7e66963d2116dCe74AB63eeF88266C82; | ||
|
yahgwai marked this conversation as resolved.
|
||
| address newUserLogic = 0xedC23dFC7D1e57EC07eA5ff7419634DbAe08Ed2C; | ||
|
|
||
| // Deploy the action contract last. The CLI identifies the deployed action | ||
| // by taking the last CREATE from the broadcast file. | ||
| new NitroContracts3Point2Point0UpgradeAction{salt: 0}(newAdminLogic, newUserLogic); | ||
|
|
||
| vm.stopBroadcast(); | ||
| } | ||
| } | ||
34 changes: 34 additions & 0 deletions
34
scripts/foundry/contract-upgrades/3.2.0/ExecuteNitroContracts3Point2Point0Upgrade.s.sol
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| // SPDX-License-Identifier: Apache-2.0 | ||
| pragma solidity 0.8.16; | ||
|
|
||
| import "forge-std/Script.sol"; | ||
| import { | ||
| NitroContracts3Point2Point0UpgradeAction | ||
| } from "../../../../contracts/parent-chain/contract-upgrades/NitroContracts3Point2Point0UpgradeAction.sol"; | ||
| import {IUpgradeExecutor} from "@offchainlabs/upgrade-executor/src/IUpgradeExecutor.sol"; | ||
|
|
||
| /** | ||
| * @title ExecuteNitroContracts3Point2Point0UpgradeScript | ||
| * @notice Executes nitro contracts 3.2.0 upgrade through UpgradeExecutor | ||
| */ | ||
| contract ExecuteNitroContracts3Point2Point0UpgradeScript is Script { | ||
| function run() public { | ||
| NitroContracts3Point2Point0UpgradeAction upgradeAction = | ||
| NitroContracts3Point2Point0UpgradeAction(vm.envAddress("UPGRADE_ACTION_ADDRESS")); | ||
|
|
||
| require( | ||
| address(upgradeAction).code.length > 0, | ||
| "Upgrade action contract not found at provided address, run deployment script first" | ||
| ); | ||
|
|
||
| // prepare upgrade calldata | ||
| bytes memory upgradeCalldata = | ||
| abi.encodeCall(NitroContracts3Point2Point0UpgradeAction.perform, (vm.envAddress("ROLLUP_ADDRESS"))); | ||
|
|
||
| // execute the upgrade | ||
| IUpgradeExecutor executor = IUpgradeExecutor(vm.envAddress("PARENT_UPGRADE_EXECUTOR_ADDRESS")); | ||
| vm.startBroadcast(); | ||
| executor.execute(address(upgradeAction), upgradeCalldata); | ||
| vm.stopBroadcast(); | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.