Skip to content

Commit

Permalink
feat: EigenDA v2.1.0 migration action - fix lint and update layr-labs…
Browse files Browse the repository at this point in the history
…/nitro-contracts ref
  • Loading branch information
epociask committed Nov 22, 2024
1 parent 0bc2322 commit 7f1fe23
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ contract NitroContractsEigenDA2Point1Point0UpgradeAction {
address _newRollupUserLogic
) {
require(_newWasmModuleRoot != bytes32(0), "Invalid wasm root hash");
// wasmModuleRoot = _newWasmModuleRoot;

require(Address.isContract(_newSequencerInboxImpl), "Invalid Sequencer Inbox implementation");
seqInboxImpl = _newSequencerInboxImpl;
Expand All @@ -77,7 +76,7 @@ contract NitroContractsEigenDA2Point1Point0UpgradeAction {
osp = _newOsp;
wasmModuleRoot = _newWasmModuleRoot;

require(Address.isContract(address(_condOsp)), 'Invalid conditional OSP contract');
require(Address.isContract(address(_condOsp)), "Invalid conditional OSP contract");
condOsp = _condOsp;
condRoot = _condOspRoot;

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,6 @@
},
"dependencies": {
"@eigenda/eigenda-utils": "^2.0.0",
"@eigenda/nitro-contracts": "2.1.0-pr-1"
"@eigenda/nitro-contracts": "2.1.0-prod"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {console} from "forge-std/console.sol";
*/
contract DeployNitroContractsEigenDA2Point1Point0UpgradeActionScript is DeploymentHelpersScript {
// ArbOS x EigenDA v32 {LINK OFFICIAL RELEASE HERE WHEN READY}
bytes32 public constant WASM_MODULE_ROOT = 0xe8c8b8228ea07ce8fec67d88d7a7f5fd52c104d262f2cca255569b38b183d285;
bytes32 public constant WASM_MODULE_ROOT = 0xfabd74983c0f747eeff0872f38d8cd982e750efb5148572c0f194b6a228ccd73;
// ArbOS v32 https://github.com/OffchainLabs/nitro/releases/tag/consensus-v32
bytes32 public constant COND_WASM_MODULE_ROOT = 0x184884e1eb9fefdc158f6c8ac912bb183bf3cf83f0090317e0bc4ac5860baa39;

Expand Down Expand Up @@ -97,45 +97,47 @@ contract DeployNitroContractsEigenDA2Point1Point0UpgradeActionScript is Deployme

if (parentChainID == 17000 || parentChainID == 1) {
// holesky or ETH
console.log("(SAFE) Deploying EigenDA x Orbit L1 Blob Verifier contract");
rollupManager = deployBytecodeFromJSON(
"/node_modules/@eigenda/nitro-contracts-2.1.0/build/contracts/src/bridge/EigenDABlobVerifierL1.sol/EigenDABlobVerifierL1.json"
);
console.log("(SAFE) Deployed EigenDA x Orbit L1 Blob Verifier contract @", rollupManager);
} else {
console.log("(DANGEROUS) Deploying EigenDA x Orbit L2 Blob Verifier contract");
rollupManager = deployBytecodeFromJSON( // non ETH or L3 deployment - this contract performs no verifications
"/node_modules/@eigenda/nitro-contracts-2.1.0/build/contracts/src/bridge/EigenDABlobVerifierL2.sol/EigenDABlobVerifierL2.json"
);
console.log("(DANGEROUS) Deployed EigenDA x Orbit L2 Blob Verifier contract @", rollupManager);
}

// deploy new challenge manager from v2.1.0
address challengeManager = deployBytecodeFromJSON(
"/node_modules/@eigenda/nitro-contracts-2.1.0/build/contracts/src/challenge/ChallengeManager.sol/ChallengeManager.json"
);

console.log("Successfully deployed EigenDA x Orbit ChallengeManager");
console.log("Successfully deployed EigenDA x Orbit ChallengeManager @", challengeManager);

// deploy new RollupAdminLogic contract from v2.1.0
address newRollupAdminLogic = deployBytecodeFromJSON(
"/node_modules/@eigenda/nitro-contracts-2.1.0/build/contracts/src/rollup/RollupAdminLogic.sol/RollupAdminLogic.json"
);

console.log("Successfully deployed EigenDA x Orbit RollupAdminLogic");
console.log("Successfully deployed EigenDA x Orbit RollupAdminLogic @", newRollupAdminLogic);

// deploy new RollupUserLogic contract from v2.1.0
address newRollupUserLogic = deployBytecodeFromJSON(
"/node_modules/@eigenda/nitro-contracts-2.1.0/build/contracts/src/rollup/RollupUserLogic.sol/RollupUserLogic.json"
);
console.log("Successfully deployed EigenDA x Orbit RollupUserLogic");
console.log("Successfully deployed EigenDA x Orbit RollupUserLogic @", newRollupUserLogic);

// deploy new new sequencer inbox from eigenda v2.1.0
address sequencerInbox = deployBytecodeWithConstructorFromJSON(
"/node_modules/@eigenda/nitro-contracts-2.1.0/build/contracts/src/bridge/SequencerInbox.sol/SequencerInbox.json",
abi.encode(vm.envUint("MAX_DATA_SIZE"), reader4844Address, !vm.envBool("IS_FEE_TOKEN_CHAIN"))
);

console.log("Successfullly deployed EigenDA x Orbit SequencerInbox @", sequencerInbox);

// finally deploy upgrade action
new NitroContractsEigenDA2Point1Point0UpgradeAction({
NitroContractsEigenDA2Point1Point0UpgradeAction action = new NitroContractsEigenDA2Point1Point0UpgradeAction({
_newWasmModuleRoot: WASM_MODULE_ROOT,
_newSequencerInboxImpl: sequencerInbox,
_newChallengeMangerImpl: challengeManager,
Expand All @@ -147,7 +149,7 @@ contract DeployNitroContractsEigenDA2Point1Point0UpgradeActionScript is Deployme
_newRollupUserLogic: newRollupUserLogic
});

console.log("Successfully deployed EigenDA x Orbit 2.1.0 upgrade/migration action");
console.log("Successfully deployed EigenDA x Orbit 2.1.0 upgrade/migration action @", address(action));

vm.stopBroadcast();
}
Expand Down

0 comments on commit 7f1fe23

Please sign in to comment.