From 1d091e226a7e633363c4fabf8f31a9923c16e02f Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 26 Nov 2024 20:58:38 +0800 Subject: [PATCH 01/10] refactor: move hardcoded value to config --- scripts/config.ts.example | 2 ++ scripts/rollupCreation.ts | 2 ++ src/rollup/BOLDUpgradeAction.sol | 2 ++ src/rollup/Config.sol | 2 ++ test/Rollup.t.sol | 2 ++ test/e2e/orbitChain.ts | 2 ++ test/foundry/RollupCreator.t.sol | 6 ++++++ test/stakingPool/AssertionStakingPool.t.sol | 2 ++ 8 files changed, 20 insertions(+) diff --git a/scripts/config.ts.example b/scripts/config.ts.example index a1187ed37..7a57d93ff 100644 --- a/scripts/config.ts.example +++ b/scripts/config.ts.example @@ -19,6 +19,8 @@ export const config = { chainId: ethers.BigNumber.from('13331370'), chainConfig: '{"chainId":13331370,"homesteadBlock":0,"daoForkBlock":null,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0,"istanbulBlock":0,"muirGlacierBlock":0,"berlinBlock":0,"londonBlock":0,"clique":{"period":0,"epoch":0},"arbitrum":{"EnableArbOS":true,"AllowDebugPrecompiles":false,"DataAvailabilityCommittee":false,"InitialArbOSVersion":10,"InitialChainOwner":"0x1234123412341234123412341234123412341234","GenesisBlockNum":0}}', + minimumAssertionPeriod: ethers.BigNumber.from('75'), + validatorAfkBlocks: ethers.BigNumber.from('201600'), genesisBlockNum: ethers.BigNumber.from('0'), sequencerInboxMaxTimeVariation: { delayBlocks: ethers.BigNumber.from('7200'), diff --git a/scripts/rollupCreation.ts b/scripts/rollupCreation.ts index 14ac66b63..fb59517eb 100644 --- a/scripts/rollupCreation.ts +++ b/scripts/rollupCreation.ts @@ -303,6 +303,8 @@ async function _getDevRollupConfig( loserStakeEscrow: ethers.constants.AddressZero, chainId: JSON.parse(chainConfig)['chainId'], chainConfig: chainConfig, + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, genesisAssertionState: {}, // AssertionState genesisInboxCount: 0, miniStakeValues: [ diff --git a/src/rollup/BOLDUpgradeAction.sol b/src/rollup/BOLDUpgradeAction.sol index f908120b0..49112d16a 100644 --- a/src/rollup/BOLDUpgradeAction.sol +++ b/src/rollup/BOLDUpgradeAction.sol @@ -373,6 +373,8 @@ contract BOLDUpgradeAction { loserStakeEscrow: EXCESS_STAKE_RECEIVER, // additional funds get sent to the l1 timelock chainId: CHAIN_ID, chainConfig: "", // we can use an empty chain config it wont be used in the rollup initialization because we check if the rei is already connected there + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, miniStakeValues: ConstantArrayStorage(MINI_STAKE_AMOUNTS_STORAGE).array(), sequencerInboxMaxTimeVariation: maxTimeVariation, layerZeroBlockEdgeHeight: BLOCK_LEAF_SIZE, diff --git a/src/rollup/Config.sol b/src/rollup/Config.sol index 86dc94d22..b76333cf3 100644 --- a/src/rollup/Config.sol +++ b/src/rollup/Config.sol @@ -23,6 +23,8 @@ struct Config { address loserStakeEscrow; uint256 chainId; string chainConfig; + uint256 minimumAssertionPeriod; + uint64 validatorAfkBlocks; uint256[] miniStakeValues; ISequencerInbox.MaxTimeVariation sequencerInboxMaxTimeVariation; uint256 layerZeroBlockEdgeHeight; diff --git a/test/Rollup.t.sol b/test/Rollup.t.sol index 7316b0187..753761e26 100644 --- a/test/Rollup.t.sol +++ b/test/Rollup.t.sol @@ -154,6 +154,8 @@ contract RollupTest is Test { baseStake: BASE_STAKE, chainId: 0, chainConfig: "{}", + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, confirmPeriodBlocks: uint64(CONFIRM_PERIOD_BLOCKS), owner: owner, sequencerInboxMaxTimeVariation: ISequencerInbox.MaxTimeVariation({ diff --git a/test/e2e/orbitChain.ts b/test/e2e/orbitChain.ts index cb835ed8e..dbc185412 100644 --- a/test/e2e/orbitChain.ts +++ b/test/e2e/orbitChain.ts @@ -834,6 +834,8 @@ describe('Orbit Chain', () => { chainId: ethers.BigNumber.from('433333'), chainConfig: '{"chainId":433333,"homesteadBlock":0,"daoForkBlock":null,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0,"istanbulBlock":0,"muirGlacierBlock":0,"berlinBlock":0,"londonBlock":0,"clique":{"period":0,"epoch":0},"arbitrum":{"EnableArbOS":true,"AllowDebugPrecompiles":false,"DataAvailabilityCommittee":false,"InitialArbOSVersion":10,"InitialChainOwner":"0x72f7EEedF02C522242a4D3Bdc8aE6A8583aD7c5e","GenesisBlockNum":0}}', + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, genesisAssertionState: genesisAssertionState, // AssertionState genesisInboxCount: 0, miniStakeValues: [ diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index 7e2af3deb..10cf62021 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -111,6 +111,8 @@ contract RollupCreatorTest is Test { baseStake: 1000, chainId: 1337, chainConfig: "abc", + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, confirmPeriodBlocks: 20, owner: rollupOwner, sequencerInboxMaxTimeVariation: timeVars, @@ -270,6 +272,8 @@ contract RollupCreatorTest is Test { baseStake: 1000, chainId: 1337, chainConfig: "abc", + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, confirmPeriodBlocks: 20, owner: rollupOwner, sequencerInboxMaxTimeVariation: timeVars, @@ -429,6 +433,8 @@ contract RollupCreatorTest is Test { baseStake: 1000, chainId: 1337, chainConfig: "abc", + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, confirmPeriodBlocks: 20, owner: rollupOwner, sequencerInboxMaxTimeVariation: timeVars, diff --git a/test/stakingPool/AssertionStakingPool.t.sol b/test/stakingPool/AssertionStakingPool.t.sol index 7b58ec4b6..011a5df12 100644 --- a/test/stakingPool/AssertionStakingPool.t.sol +++ b/test/stakingPool/AssertionStakingPool.t.sol @@ -154,6 +154,8 @@ contract AssertionPoolTest is Test { baseStake: BASE_STAKE, chainId: 0, chainConfig: "{}", + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, confirmPeriodBlocks: uint64(CONFIRM_PERIOD_BLOCKS), owner: owner, sequencerInboxMaxTimeVariation: ISequencerInbox.MaxTimeVariation({ From fa91157d7475491130bccb8d9bbd352847a1468c Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 26 Nov 2024 21:02:50 +0800 Subject: [PATCH 02/10] refactor: minimumAssertionPeriod and validatorAfkBlocks in bold upgrade setting --- scripts/boldUpgradeCommon.ts | 2 ++ scripts/files/configs/arb1.ts | 2 ++ scripts/files/configs/local.ts | 2 ++ scripts/files/configs/nova.ts | 2 ++ scripts/files/configs/sepolia.ts | 2 ++ src/rollup/BOLDUpgradeAction.sol | 11 +++++++++-- 6 files changed, 19 insertions(+), 2 deletions(-) diff --git a/scripts/boldUpgradeCommon.ts b/scripts/boldUpgradeCommon.ts index a9c538a53..057929913 100644 --- a/scripts/boldUpgradeCommon.ts +++ b/scripts/boldUpgradeCommon.ts @@ -68,6 +68,8 @@ export interface Config { stakeAmt: BigNumber miniStakeAmounts: BigNumber[] chainId: number + minimumAssertionPeriod: number + validatorAfkBlocks: number disableValidatorWhitelist: boolean maxDataSize: number blockLeafSize: number diff --git a/scripts/files/configs/arb1.ts b/scripts/files/configs/arb1.ts index aa6c2a17d..11cf730a5 100644 --- a/scripts/files/configs/arb1.ts +++ b/scripts/files/configs/arb1.ts @@ -29,6 +29,8 @@ export const arb1: Config = { stakeAmt: parseEther('3600'), miniStakeAmounts: [parseEther('0'), parseEther('555'), parseEther('79')], chainId: 42161, + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, disableValidatorWhitelist: true, blockLeafSize: 2 ** 26, bigStepLeafSize: 2 ** 19, diff --git a/scripts/files/configs/local.ts b/scripts/files/configs/local.ts index ea102e885..939eb1ecf 100644 --- a/scripts/files/configs/local.ts +++ b/scripts/files/configs/local.ts @@ -35,6 +35,8 @@ export const local: Config = { parseEther('1'), ], chainId: 412346, + minimumAssertionPeriod: 0, + validatorAfkBlocks: 201600, disableValidatorWhitelist: true, blockLeafSize: 1048576, bigStepLeafSize: 512, diff --git a/scripts/files/configs/nova.ts b/scripts/files/configs/nova.ts index 5ed30bdbd..5229875a8 100644 --- a/scripts/files/configs/nova.ts +++ b/scripts/files/configs/nova.ts @@ -30,6 +30,8 @@ export const nova: Config = { stakeAmt: parseEther('1'), miniStakeAmounts: [parseEther('0'), parseEther('1'), parseEther('1')], chainId: 42170, + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, disableValidatorWhitelist: false, blockLeafSize: 2 ** 26, // leaf sizes same as arb1 bigStepLeafSize: 2 ** 19, diff --git a/scripts/files/configs/sepolia.ts b/scripts/files/configs/sepolia.ts index 9c9879f20..952e7fab8 100644 --- a/scripts/files/configs/sepolia.ts +++ b/scripts/files/configs/sepolia.ts @@ -28,6 +28,8 @@ export const sepolia: Config = { stakeAmt: parseEther('36'), // 1/100th of arb1, same for mini stakes miniStakeAmounts: [parseEther('0'), parseEther('5.5'), parseEther('0.79')], chainId: 421614, + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, disableValidatorWhitelist: false, blockLeafSize: 2 ** 26, // leaf sizes same as arb1 bigStepLeafSize: 2 ** 19, diff --git a/src/rollup/BOLDUpgradeAction.sol b/src/rollup/BOLDUpgradeAction.sol index 49112d16a..9283aeef1 100644 --- a/src/rollup/BOLDUpgradeAction.sol +++ b/src/rollup/BOLDUpgradeAction.sol @@ -185,6 +185,9 @@ contract BOLDUpgradeAction { address public immutable STAKE_TOKEN; uint256 public immutable STAKE_AMOUNT; uint256 public immutable CHAIN_ID; + uint256 public immutable MINIMUM_ASSERTION_PERIOD; + uint64 public immutable VALIDATOR_AFK_BLOCKS; + bool public immutable DISABLE_VALIDATOR_WHITELIST; uint64 public immutable CHALLENGE_GRACE_PERIOD_BLOCKS; address public immutable MINI_STAKE_AMOUNTS_STORAGE; @@ -223,6 +226,8 @@ contract BOLDUpgradeAction { uint256 stakeAmt; uint256[] miniStakeAmounts; uint256 chainId; + uint256 minimumAssertionPeriod; + uint64 validatorAfkBlocks; bool disableValidatorWhitelist; uint256 blockLeafSize; uint256 bigStepLeafSize; @@ -296,6 +301,8 @@ contract BOLDUpgradeAction { IMPL_CHALLENGE_MANAGER = implementations.challengeManager; CHAIN_ID = settings.chainId; + MINIMUM_ASSERTION_PERIOD = settings.minimumAssertionPeriod; + VALIDATOR_AFK_BLOCKS = settings.validatorAfkBlocks; CONFIRM_PERIOD_BLOCKS = settings.confirmPeriodBlocks; CHALLENGE_PERIOD_BLOCKS = settings.challengePeriodBlocks; STAKE_TOKEN = settings.stakeToken; @@ -373,8 +380,8 @@ contract BOLDUpgradeAction { loserStakeEscrow: EXCESS_STAKE_RECEIVER, // additional funds get sent to the l1 timelock chainId: CHAIN_ID, chainConfig: "", // we can use an empty chain config it wont be used in the rollup initialization because we check if the rei is already connected there - minimumAssertionPeriod: 75, - validatorAfkBlocks: 201600, + minimumAssertionPeriod: MINIMUM_ASSERTION_PERIOD, + validatorAfkBlocks: VALIDATOR_AFK_BLOCKS, miniStakeValues: ConstantArrayStorage(MINI_STAKE_AMOUNTS_STORAGE).array(), sequencerInboxMaxTimeVariation: maxTimeVariation, layerZeroBlockEdgeHeight: BLOCK_LEAF_SIZE, From 9e6fa3815509d9ed4324e1afcb571bfe99581969 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 2 Dec 2024 14:01:50 -0500 Subject: [PATCH 03/10] perf: remove onchain verification --- src/rollup/BOLDUpgradeAction.sol | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/src/rollup/BOLDUpgradeAction.sol b/src/rollup/BOLDUpgradeAction.sol index 9283aeef1..a805051e9 100644 --- a/src/rollup/BOLDUpgradeAction.sol +++ b/src/rollup/BOLDUpgradeAction.sol @@ -442,17 +442,6 @@ contract BOLDUpgradeAction { PROXY_ADMIN_SEQUENCER_INBOX.upgrade(sequencerInbox, IMPL_SEQUENCER_INBOX); } - // verify - require( - PROXY_ADMIN_SEQUENCER_INBOX.getProxyImplementation(sequencerInbox) - == IMPL_SEQUENCER_INBOX, - "DelayBuffer: new seq inbox implementation not set" - ); - require( - ISequencerInbox(SEQ_INBOX).isDelayBufferable() == IS_DELAY_BUFFERABLE, - "DelayBuffer: isDelayBufferable not set" - ); - (uint256 delayBlocks, uint256 futureBlocks, uint256 delaySeconds, uint256 futureSeconds) = ISequencerInbox(SEQ_INBOX).maxTimeVariation(); @@ -474,14 +463,6 @@ contract BOLDUpgradeAction { }) ); - // verify - (uint256 _delayBlocks, uint256 _futureBlocks, uint256 _delaySeconds, uint256 _futureSeconds) - = ISequencerInbox(SEQ_INBOX).maxTimeVariation(); - require(_delayBlocks == delayBlocks, "DelayBuffer: delayBlocks"); - require(_delaySeconds == delaySeconds, "DelayBuffer: delaySeconds"); - require(_futureBlocks == futureBlocks, "DelayBuffer: futureBlocks"); - require(_futureSeconds == futureSeconds, "DelayBuffer: futureSeconds"); - ISequencerInbox(SEQ_INBOX).updateRollupAddress(); } From d709ef5b46bdf8afb6c5433e29d962aeb2f949b6 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 2 Dec 2024 14:06:53 -0500 Subject: [PATCH 04/10] chore: update sigs --- test/signatures/RollupAdminLogic | 2 +- test/signatures/RollupCreator | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/signatures/RollupAdminLogic b/test/signatures/RollupAdminLogic index a0732e6f9..ded51bc4c 100644 --- a/test/signatures/RollupAdminLogic +++ b/test/signatures/RollupAdminLogic @@ -20,7 +20,7 @@ "getStakerAddress(uint64)": "6ddd3744", "getValidators()": "b7ab4db5", "inbox()": "fb0e722b", - "initialize((uint64,address,uint256,bytes32,address,address,uint256,string,uint256[],(uint256,uint256,uint256,uint256),uint256,uint256,uint256,((bytes32[2],uint64[2]),uint8,bytes32),uint256,address,uint8,uint64,(uint64,uint64,uint64)),(address,address,address,address,address,address,address,address,address))": "9e7e6aa7", + "initialize((uint64,address,uint256,bytes32,address,address,uint256,string,uint256,uint64,uint256[],(uint256,uint256,uint256,uint256),uint256,uint256,uint256,((bytes32[2],uint64[2]),uint8,bytes32),uint256,address,uint8,uint64,(uint64,uint64,uint64)),(address,address,address,address,address,address,address,address,address))": "0ee5ef0c", "isFirstChild(bytes32)": "30836228", "isPending(bytes32)": "e531d8c7", "isStaked(address)": "6177fd18", diff --git a/test/signatures/RollupCreator b/test/signatures/RollupCreator index 9a9e681a7..dbe11f257 100644 --- a/test/signatures/RollupCreator +++ b/test/signatures/RollupCreator @@ -1,7 +1,7 @@ { "bridgeCreator()": "f860cefa", "challengeManagerTemplate()": "9c683d10", - "createRollup(((uint64,address,uint256,bytes32,address,address,uint256,string,uint256[],(uint256,uint256,uint256,uint256),uint256,uint256,uint256,((bytes32[2],uint64[2]),uint8,bytes32),uint256,address,uint8,uint64,(uint64,uint64,uint64)),address[],uint256,address,bool,uint256,address[],address))": "5491abea", + "createRollup(((uint64,address,uint256,bytes32,address,address,uint256,string,uint256,uint64,uint256[],(uint256,uint256,uint256,uint256),uint256,uint256,uint256,((bytes32[2],uint64[2]),uint8,bytes32),uint256,address,uint8,uint64,(uint64,uint64,uint64)),address[],uint256,address,bool,uint256,address[],address))": "a2f454fc", "l2FactoriesDeployer()": "ac0425bc", "osp()": "f26a62c6", "owner()": "8da5cb5b", From 7cafdae215b828325191390eb5220678af96300e Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 9 Dec 2024 16:16:46 +0800 Subject: [PATCH 05/10] refactor: remove hardcode in rollup initialize --- src/rollup/RollupAdminLogic.sol | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rollup/RollupAdminLogic.sol b/src/rollup/RollupAdminLogic.sol index ecdbe9279..6771af861 100644 --- a/src/rollup/RollupAdminLogic.sol +++ b/src/rollup/RollupAdminLogic.sol @@ -53,12 +53,12 @@ contract RollupAdminLogic is RollupCore, IRollupAdmin, DoubleLogicUUPSUpgradeabl chainId = config.chainId; baseStake = config.baseStake; wasmModuleRoot = config.wasmModuleRoot; - // A little over 15 minutes - minimumAssertionPeriod = 75; - // ValidatorAfkBlocks is defaulted to 28 days assuming a 12 seconds block time. + // minimumAssertionPeriod was defaulted to 75 which is a little over 15 minutes + minimumAssertionPeriod = config.minimumAssertionPeriod; + // ValidatorAfkBlocks was defaulted to 201600 which is 28 days assuming a 12 seconds block time. // Since it can take 14 days under normal circumstances to confirm an assertion, this means // the validators will have been inactive for a further 14 days before the whitelist is removed. - validatorAfkBlocks = 201600; + validatorAfkBlocks = config.validatorAfkBlocks; challengeGracePeriodBlocks = config.challengeGracePeriodBlocks; // loser stake is now sent directly to loserStakeEscrow, it must not From f4d06c00981d10595d57adfbd44e2ecce4a93dad Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 9 Dec 2024 16:18:36 +0800 Subject: [PATCH 06/10] chore: update example --- scripts/config.ts.example | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/config.ts.example b/scripts/config.ts.example index 7a57d93ff..ec3b52170 100644 --- a/scripts/config.ts.example +++ b/scripts/config.ts.example @@ -17,6 +17,8 @@ export const config = { owner: '0x1234123412341234123412341234123412341234', loserStakeEscrow: ethers.constants.AddressZero, chainId: ethers.BigNumber.from('13331370'), + minimumAssertionPeriod: 75, + validatorAfkBlocks: 201600, chainConfig: '{"chainId":13331370,"homesteadBlock":0,"daoForkBlock":null,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0,"istanbulBlock":0,"muirGlacierBlock":0,"berlinBlock":0,"londonBlock":0,"clique":{"period":0,"epoch":0},"arbitrum":{"EnableArbOS":true,"AllowDebugPrecompiles":false,"DataAvailabilityCommittee":false,"InitialArbOSVersion":10,"InitialChainOwner":"0x1234123412341234123412341234123412341234","GenesisBlockNum":0}}', minimumAssertionPeriod: ethers.BigNumber.from('75'), From da85e5a06fa34a9d94922af02eb56201af581d90 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 9 Dec 2024 16:39:18 +0800 Subject: [PATCH 07/10] test: new config param --- test/foundry/RollupCreator.t.sol | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index 10cf62021..75e08c6d3 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -112,8 +112,8 @@ contract RollupCreatorTest is Test { chainId: 1337, chainConfig: "abc", minimumAssertionPeriod: 75, - validatorAfkBlocks: 201600, - confirmPeriodBlocks: 20, + validatorAfkBlocks: 1234, + confirmPeriodBlocks: 567, owner: rollupOwner, sequencerInboxMaxTimeVariation: timeVars, stakeToken: address(token), @@ -185,6 +185,8 @@ contract RollupCreatorTest is Test { batchPosterManager, "Invalid batch poster manager" ); + assertEq(rollup.validatorAfkBlocks(), config.validatorAfkBlocks, "Invalid validatorAfkBlocks"); + assertEq(rollup.confirmPeriodBlocks(), config.confirmPeriodBlocks, "Invalid confirmPeriodBlocks"); // check proxy admin for non-rollup contracts address proxyAdminExpectedAddress = computeCreateAddress(address(rollupCreator), 1); @@ -273,8 +275,8 @@ contract RollupCreatorTest is Test { chainId: 1337, chainConfig: "abc", minimumAssertionPeriod: 75, - validatorAfkBlocks: 201600, - confirmPeriodBlocks: 20, + validatorAfkBlocks: 1234, + confirmPeriodBlocks: 567, owner: rollupOwner, sequencerInboxMaxTimeVariation: timeVars, stakeToken: address(token), @@ -348,6 +350,8 @@ contract RollupCreatorTest is Test { batchPosterManager, "Invalid batch poster manager" ); + assertEq(rollup.validatorAfkBlocks(), config.validatorAfkBlocks, "Invalid validatorAfkBlocks"); + assertEq(rollup.confirmPeriodBlocks(), config.confirmPeriodBlocks, "Invalid confirmPeriodBlocks"); // native token check IBridge bridge = RollupCore(address(rollupAddress)).bridge(); @@ -434,8 +438,8 @@ contract RollupCreatorTest is Test { chainId: 1337, chainConfig: "abc", minimumAssertionPeriod: 75, - validatorAfkBlocks: 201600, - confirmPeriodBlocks: 20, + validatorAfkBlocks: 1234, + confirmPeriodBlocks: 567, owner: rollupOwner, sequencerInboxMaxTimeVariation: timeVars, stakeToken: address(token), From 8715541162018c273d37e36aaa280680c5916535 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 9 Dec 2024 16:47:23 +0800 Subject: [PATCH 08/10] fix: format test --- test/foundry/RollupCreator.t.sol | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index 75e08c6d3..2444aa816 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -185,8 +185,12 @@ contract RollupCreatorTest is Test { batchPosterManager, "Invalid batch poster manager" ); - assertEq(rollup.validatorAfkBlocks(), config.validatorAfkBlocks, "Invalid validatorAfkBlocks"); - assertEq(rollup.confirmPeriodBlocks(), config.confirmPeriodBlocks, "Invalid confirmPeriodBlocks"); + assertEq( + rollup.validatorAfkBlocks(), config.validatorAfkBlocks, "Invalid validatorAfkBlocks" + ); + assertEq( + rollup.confirmPeriodBlocks(), config.confirmPeriodBlocks, "Invalid confirmPeriodBlocks" + ); // check proxy admin for non-rollup contracts address proxyAdminExpectedAddress = computeCreateAddress(address(rollupCreator), 1); @@ -350,8 +354,12 @@ contract RollupCreatorTest is Test { batchPosterManager, "Invalid batch poster manager" ); - assertEq(rollup.validatorAfkBlocks(), config.validatorAfkBlocks, "Invalid validatorAfkBlocks"); - assertEq(rollup.confirmPeriodBlocks(), config.confirmPeriodBlocks, "Invalid confirmPeriodBlocks"); + assertEq( + rollup.validatorAfkBlocks(), config.validatorAfkBlocks, "Invalid validatorAfkBlocks" + ); + assertEq( + rollup.confirmPeriodBlocks(), config.confirmPeriodBlocks, "Invalid confirmPeriodBlocks" + ); // native token check IBridge bridge = RollupCore(address(rollupAddress)).bridge(); From 760bca601cb49109f573791647ae2a4240a02804 Mon Sep 17 00:00:00 2001 From: gzeon Date: Mon, 9 Dec 2024 18:05:03 +0800 Subject: [PATCH 09/10] test: fix config --- test/foundry/RollupCreator.t.sol | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/foundry/RollupCreator.t.sol b/test/foundry/RollupCreator.t.sol index 7644ab585..fb7503a6a 100644 --- a/test/foundry/RollupCreator.t.sol +++ b/test/foundry/RollupCreator.t.sol @@ -342,11 +342,12 @@ contract RollupCreatorTest is Test { vm.stopPrank(); _postCreateERC20RollupChecks( - rollupAddress, batchPosterManager, nativeToken, validators, batchPosters + config, rollupAddress, batchPosterManager, nativeToken, validators, batchPosters ); } function _postCreateERC20RollupChecks( + Config memory config, address rollupAddress, address batchPosterManager, address nativeToken, From 37826963b0eebe24850fedcb041dc6dfb31fca1a Mon Sep 17 00:00:00 2001 From: gzeon Date: Tue, 10 Dec 2024 18:27:48 +0800 Subject: [PATCH 10/10] Apply suggestions from code review Co-authored-by: Henry <11198460+godzillaba@users.noreply.github.com> --- scripts/config.ts.example | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/config.ts.example b/scripts/config.ts.example index ec3b52170..90fa5cc56 100644 --- a/scripts/config.ts.example +++ b/scripts/config.ts.example @@ -21,8 +21,6 @@ export const config = { validatorAfkBlocks: 201600, chainConfig: '{"chainId":13331370,"homesteadBlock":0,"daoForkBlock":null,"daoForkSupport":true,"eip150Block":0,"eip150Hash":"0x0000000000000000000000000000000000000000000000000000000000000000","eip155Block":0,"eip158Block":0,"byzantiumBlock":0,"constantinopleBlock":0,"petersburgBlock":0,"istanbulBlock":0,"muirGlacierBlock":0,"berlinBlock":0,"londonBlock":0,"clique":{"period":0,"epoch":0},"arbitrum":{"EnableArbOS":true,"AllowDebugPrecompiles":false,"DataAvailabilityCommittee":false,"InitialArbOSVersion":10,"InitialChainOwner":"0x1234123412341234123412341234123412341234","GenesisBlockNum":0}}', - minimumAssertionPeriod: ethers.BigNumber.from('75'), - validatorAfkBlocks: ethers.BigNumber.from('201600'), genesisBlockNum: ethers.BigNumber.from('0'), sequencerInboxMaxTimeVariation: { delayBlocks: ethers.BigNumber.from('7200'),