From 797bfd608d932751152e4f3d227ad5aaddf73eda Mon Sep 17 00:00:00 2001 From: Ganesh Vanahalli Date: Wed, 11 Sep 2024 16:12:13 +0530 Subject: [PATCH] Get rid of the hardcoded list of chains in config_arbitrum.go (geth) instead use arbitrum_chain_info.json (nitro) --- params/config_arbitrum.go | 213 -------------------------------------- 1 file changed, 213 deletions(-) diff --git a/params/config_arbitrum.go b/params/config_arbitrum.go index 8acda118b1..a079a8ef3c 100644 --- a/params/config_arbitrum.go +++ b/params/config_arbitrum.go @@ -79,66 +79,6 @@ func (c *ChainConfig) checkArbitrumCompatible(newcfg *ChainConfig, head *big.Int return nil } -func ArbitrumOneParams() ArbitrumChainParams { - return ArbitrumChainParams{ - EnableArbOS: true, - AllowDebugPrecompiles: false, - DataAvailabilityCommittee: false, - InitialArbOSVersion: 6, - InitialChainOwner: common.HexToAddress("0xd345e41ae2cb00311956aa7109fc801ae8c81a52"), - } -} - -func ArbitrumNovaParams() ArbitrumChainParams { - return ArbitrumChainParams{ - EnableArbOS: true, - AllowDebugPrecompiles: false, - DataAvailabilityCommittee: true, - InitialArbOSVersion: 1, - InitialChainOwner: common.HexToAddress("0x9C040726F2A657226Ed95712245DeE84b650A1b5"), - } -} - -func ArbitrumRollupGoerliTestnetParams() ArbitrumChainParams { - return ArbitrumChainParams{ - EnableArbOS: true, - AllowDebugPrecompiles: false, - DataAvailabilityCommittee: false, - InitialArbOSVersion: 2, - InitialChainOwner: common.HexToAddress("0x186B56023d42B2B4E7616589a5C62EEf5FCa21DD"), - } -} - -func ArbitrumDevTestParams() ArbitrumChainParams { - return ArbitrumChainParams{ - EnableArbOS: true, - AllowDebugPrecompiles: true, - DataAvailabilityCommittee: false, - InitialArbOSVersion: 31, - InitialChainOwner: common.Address{}, - } -} - -func ArbitrumDevTestDASParams() ArbitrumChainParams { - return ArbitrumChainParams{ - EnableArbOS: true, - AllowDebugPrecompiles: true, - DataAvailabilityCommittee: true, - InitialArbOSVersion: 31, - InitialChainOwner: common.Address{}, - } -} - -func ArbitrumAnytrustGoerliTestnetParams() ArbitrumChainParams { - return ArbitrumChainParams{ - EnableArbOS: true, - AllowDebugPrecompiles: false, - DataAvailabilityCommittee: true, - InitialArbOSVersion: 2, - InitialChainOwner: common.HexToAddress("0x186B56023d42B2B4E7616589a5C62EEf5FCa21DD"), - } -} - func DisableArbitrumParams() ArbitrumChainParams { return ArbitrumChainParams{ EnableArbOS: false, @@ -148,156 +88,3 @@ func DisableArbitrumParams() ArbitrumChainParams { InitialChainOwner: common.Address{}, } } - -func ArbitrumOneChainConfig() *ChainConfig { - return &ChainConfig{ - ChainID: big.NewInt(42161), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(0), - ArbitrumChainParams: ArbitrumOneParams(), - Clique: &CliqueConfig{ - Period: 0, - Epoch: 0, - }, - } -} - -func ArbitrumNovaChainConfig() *ChainConfig { - return &ChainConfig{ - ChainID: big.NewInt(42170), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(0), - ArbitrumChainParams: ArbitrumNovaParams(), - Clique: &CliqueConfig{ - Period: 0, - Epoch: 0, - }, - } -} - -func ArbitrumRollupGoerliTestnetChainConfig() *ChainConfig { - return &ChainConfig{ - ChainID: big.NewInt(421613), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(0), - ArbitrumChainParams: ArbitrumRollupGoerliTestnetParams(), - Clique: &CliqueConfig{ - Period: 0, - Epoch: 0, - }, - } -} - -func ArbitrumDevTestChainConfig() *ChainConfig { - return &ChainConfig{ - ChainID: big.NewInt(412346), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(0), - ArbitrumChainParams: ArbitrumDevTestParams(), - Clique: &CliqueConfig{ - Period: 0, - Epoch: 0, - }, - } -} - -func ArbitrumDevTestDASChainConfig() *ChainConfig { - return &ChainConfig{ - ChainID: big.NewInt(412347), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(0), - ArbitrumChainParams: ArbitrumDevTestDASParams(), - Clique: &CliqueConfig{ - Period: 0, - Epoch: 0, - }, - } -} - -func ArbitrumAnytrustGoerliTestnetChainConfig() *ChainConfig { - return &ChainConfig{ - ChainID: big.NewInt(421703), - HomesteadBlock: big.NewInt(0), - DAOForkBlock: nil, - DAOForkSupport: true, - EIP150Block: big.NewInt(0), - EIP155Block: big.NewInt(0), - EIP158Block: big.NewInt(0), - ByzantiumBlock: big.NewInt(0), - ConstantinopleBlock: big.NewInt(0), - PetersburgBlock: big.NewInt(0), - IstanbulBlock: big.NewInt(0), - MuirGlacierBlock: big.NewInt(0), - BerlinBlock: big.NewInt(0), - LondonBlock: big.NewInt(0), - ArbitrumChainParams: ArbitrumAnytrustGoerliTestnetParams(), - Clique: &CliqueConfig{ - Period: 0, - Epoch: 0, - }, - } -} - -var ArbitrumSupportedChainConfigs = []*ChainConfig{ - ArbitrumOneChainConfig(), - ArbitrumNovaChainConfig(), - ArbitrumRollupGoerliTestnetChainConfig(), - ArbitrumDevTestChainConfig(), - ArbitrumDevTestDASChainConfig(), - ArbitrumAnytrustGoerliTestnetChainConfig(), -}