From 6c5592521d923783829948b46d467bef325a2702 Mon Sep 17 00:00:00 2001 From: Victor Castell Date: Thu, 26 Sep 2024 11:23:26 +0200 Subject: [PATCH] refactor: remove AddressAdmin config (#1220) * refactor: remove AddressAdmin config * refactor: remove from configs * refactor: restore param and deprecate * refactor: restore flag * refactor: do not check for admin address flag * refactor: better log message --- README.md | 2 -- cmd/utils/flags.go | 2 +- eth/backend.go | 10 +++------- hermezconfig-bali.yaml.example | 3 +-- hermezconfig-cardona.yaml.example | 3 +-- hermezconfig-dev.yaml.example | 1 - hermezconfig-estest-syncer.yaml.example | 1 - hermezconfig-mainnet-shadowfork.yaml.example | 1 - hermezconfig-mainnet.yaml.example | 1 - turbo/cli/flags_zkevm.go | 1 - xlayerconfig-mainnet.yaml.example | 3 +-- xlayerconfig-testnet.yaml.example | 1 - zk/tests/nightly-l1-recovery/network5-config.yaml | 1 - zk/tests/nightly-l1-recovery/network5-sync-config.yaml | 1 - zk/tests/nightly-l1-recovery/network8-config.yaml | 1 - zk/tests/nightly-l1-recovery/network8-sync-config.yaml | 1 - zk/tests/unwinds/config/dynamic-integration8.yaml | 1 - 17 files changed, 7 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index 7dc8cb797a4..55b567116ab 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,6 @@ base and run `go run cmd/hack/allocs/main.go [your-file-name]` to convert it to **Tip**: the contract addresses in the `dynamic-{network}.yaml` can be found in the files output when launching the network: - zkevm.address-sequencer => create_rollup_output.json => `sequencer` - zkevm.address-zkevm => create_rollup_output.json => `rollupAddress` -- zkevm.address-admin => deploy_output.json => `admin` - zkevm.address-rollup => deploy_output.json => `polygonRollupManagerAddress` - zkevm.address-ger-manager => deploy_output.json => `polygonZkEVMGlobalExitRootAddress` @@ -192,7 +191,6 @@ For a full explanation of the config options, see below: - `zkevm.l1-rpc-url`: L1 Ethereum RPC URL. - `zkevm.address-sequencer`: The contract address for the sequencer - `zkevm.address-zkevm`: The address for the zkevm contract -- `zkevm.address-admin`: The address for the admin contract - `zkevm.address-rollup`: The address for the rollup contract - `zkevm.address-ger-manager`: The address for the GER manager contract - `zkevm.rpc-ratelimit`: Rate limit for RPC calls. diff --git a/cmd/utils/flags.go b/cmd/utils/flags.go index d10edd10854..f10bd0ab063 100644 --- a/cmd/utils/flags.go +++ b/cmd/utils/flags.go @@ -407,7 +407,7 @@ var ( } AddressAdminFlag = cli.StringFlag{ Name: "zkevm.address-admin", - Usage: "Admin address", + Usage: "Admin address (Deprecated)", Value: "", } AddressRollupFlag = cli.StringFlag{ diff --git a/eth/backend.go b/eth/backend.go index d2c42810c87..1f066e7c071 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -1556,6 +1556,7 @@ func checkPortIsFree(addr string) (free bool) { func l1ContractAddressCheck(ctx context.Context, cfg *ethconfig.Zk, l1BlockSyncer *syncer.L1Syncer) (bool, error) { l1AddrRollup, err := l1BlockSyncer.CallRollupManager(ctx, &cfg.AddressZkevm) if err != nil { + log.Warn("L1 contract address check failed (RollupManager)", "err", err) return false, err } if l1AddrRollup != cfg.AddressRollup { @@ -1563,13 +1564,8 @@ func l1ContractAddressCheck(ctx context.Context, cfg *ethconfig.Zk, l1BlockSynce return false, nil } - l1AddrAdmin, err := l1BlockSyncer.CallAdmin(ctx, &cfg.AddressZkevm) - if err != nil { - return false, err - } - if l1AddrAdmin != cfg.AddressAdmin { - log.Warn("L1 contract address check failed (AddressAdmin)", "expected", cfg.AddressAdmin, "actual", l1AddrAdmin) - return false, nil + if cfg.AddressAdmin != (libcommon.Address{}) { + log.Warn("🚨 zkevm.address-admin configuration parameter is deprecated and it will be removed in upcoming releases") } l1AddrGerManager, err := l1BlockSyncer.CallGlobalExitRootManager(ctx, &cfg.AddressZkevm) diff --git a/hermezconfig-bali.yaml.example b/hermezconfig-bali.yaml.example index ab619354838..84ecf06d856 100644 --- a/hermezconfig-bali.yaml.example +++ b/hermezconfig-bali.yaml.example @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: https://rpc.sepolia.org zkevm.address-sequencer: "0x9aeCf44E36f20DC407d1A580630c9a2419912dcB" zkevm.address-zkevm: "0x89BA0Ed947a88fe43c22Ae305C0713eC8a7Eb361" -zkevm.address-admin: "0x229A5bDBb09d8555f9214F7a6784804999BA4E0D" zkevm.address-rollup: "0xE2EF6215aDc132Df6913C8DD16487aBF118d1764" zkevm.address-ger-manager: "0x2968D6d736178f8FE7393CC33C87f29D9C287e78" @@ -32,4 +31,4 @@ http.api: [eth, debug, net, trace, web3, erigon, zkevm] http.addr: 0.0.0.0 http.vhosts: any http.corsdomain: any -ws: true \ No newline at end of file +ws: true diff --git a/hermezconfig-cardona.yaml.example b/hermezconfig-cardona.yaml.example index 69236d04898..4840fe005b1 100644 --- a/hermezconfig-cardona.yaml.example +++ b/hermezconfig-cardona.yaml.example @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: https://rpc.sepolia.org zkevm.address-sequencer: "0x761d53b47334bee6612c0bd1467fb881435375b2" zkevm.address-zkevm: "0xA13Ddb14437A8F34897131367ad3ca78416d6bCa" -zkevm.address-admin: "0xff6250d0e86a2465b0c1bf8e36409503d6a26963" zkevm.address-rollup: "0x32d33d5137a7cffb54c5bf8371172bcec5f310ff" zkevm.address-ger-manager: "0xAd1490c248c5d3CbAE399Fd529b79B42984277DF" @@ -34,4 +33,4 @@ http.api: [eth, debug, net, trace, web3, erigon, zkevm] http.addr: 0.0.0.0 http.vhosts: any http.corsdomain: any -ws: true \ No newline at end of file +ws: true diff --git a/hermezconfig-dev.yaml.example b/hermezconfig-dev.yaml.example index a2fa2d9d944..d41f711ba82 100644 --- a/hermezconfig-dev.yaml.example +++ b/hermezconfig-dev.yaml.example @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: https://rpc.eu-central-1.gateway.fm/v4/ethereum/non-archival/s zkevm.address-sequencer: "0xfa3b44587990f97ba8b6ba7e230a5f0e95d14b3d" zkevm.address-zkevm: "0x31A6ae85297DD0EeBD66D7556941c33Bd41d565C" -zkevm.address-admin: "0x9EA9db6af0FEfd30d22F813bE32E4E17A3189E6a" zkevm.address-rollup: "0x9fB0B4A5d4d60aaCfa8DC20B8DF5528Ab26848d3" zkevm.address-ger-manager: "0x76216E45Bdd20022eEcC07999e50228d7829534B" diff --git a/hermezconfig-estest-syncer.yaml.example b/hermezconfig-estest-syncer.yaml.example index 2822c9f671f..eda029d1d12 100644 --- a/hermezconfig-estest-syncer.yaml.example +++ b/hermezconfig-estest-syncer.yaml.example @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: "https://rpc.eu-central-1.gateway.fm/v4/ethereum/non-archival/ zkevm.address-sequencer: "0x7597b12b953bffe1457d89e7e4fe3da149b45d88" zkevm.address-zkevm: "0x9b2e7dC74B5a1Ecb894F0BAAe99a9F3CB60FC455" -zkevm.address-admin: "0xa0ee057f2746d3282a10b8cd26a351b5ca121e8d" zkevm.address-rollup: "0x7DFba61a337741a3d2F99Cc73069c9D0De8aa933" zkevm.address-ger-manager: "0x0FE6A2FcF455b9B8004fd625909857933d3c7494" diff --git a/hermezconfig-mainnet-shadowfork.yaml.example b/hermezconfig-mainnet-shadowfork.yaml.example index 43dba526f9b..f50e69102ec 100644 --- a/hermezconfig-mainnet-shadowfork.yaml.example +++ b/hermezconfig-mainnet-shadowfork.yaml.example @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: https://rpc.eu-central-1.gateway.fm/v4/ethereum/non-archival/s zkevm.address-sequencer: "" zkevm.address-zkevm: "" -zkevm.address-admin: "0x9fB0B4A5d4d60aaCfa8DC20B8DF5528Ab26848d3" zkevm.address-rollup: "0x31A6ae85297DD0EeBD66D7556941c33Bd41d565C" zkevm.address-ger-manager: "0x76216E45Bdd20022eEcC07999e50228d7829534B" diff --git a/hermezconfig-mainnet.yaml.example b/hermezconfig-mainnet.yaml.example index 8342b11d755..f5ec1540a45 100644 --- a/hermezconfig-mainnet.yaml.example +++ b/hermezconfig-mainnet.yaml.example @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: https://rpc.eth.gateway.fm/ zkevm.address-sequencer: "0x148Ee7dAF16574cD020aFa34CC658f8F3fbd2800" zkevm.address-zkevm: "0x519E42c24163192Dca44CD3fBDCEBF6be9130987" -zkevm.address-admin: "0x242daE44F5d8fb54B198D03a94dA45B5a4413e21" zkevm.address-rollup: "0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2" zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb" diff --git a/turbo/cli/flags_zkevm.go b/turbo/cli/flags_zkevm.go index 39c529d5b9d..1014e76abc5 100644 --- a/turbo/cli/flags_zkevm.go +++ b/turbo/cli/flags_zkevm.go @@ -216,7 +216,6 @@ func ApplyFlagsForZkConfig(ctx *cli.Context, cfg *ethconfig.Config) { } checkFlag(utils.AddressSequencerFlag.Name, cfg.AddressSequencer) - checkFlag(utils.AddressAdminFlag.Name, cfg.AddressAdmin) checkFlag(utils.AddressRollupFlag.Name, cfg.AddressRollup) checkFlag(utils.AddressZkevmFlag.Name, cfg.AddressZkevm) checkFlag(utils.AddressGerManagerFlag.Name, cfg.AddressGerManager) diff --git a/xlayerconfig-mainnet.yaml.example b/xlayerconfig-mainnet.yaml.example index fd68f5f6e85..9d92556b800 100644 --- a/xlayerconfig-mainnet.yaml.example +++ b/xlayerconfig-mainnet.yaml.example @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: https://rpc.ankr.com/eth/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx zkevm.address-sequencer: "0xAF9d27ffe4d51eD54AC8eEc78f2785D7E11E5ab1" zkevm.address-zkevm: "0x2B0ee28D4D51bC9aDde5E58E295873F61F4a0507" -zkevm.address-admin: "0x491619874b866c3cDB7C8553877da223525ead01" zkevm.address-rollup: "0x5132A183E9F3CB7C848b0AAC5Ae0c4f0491B7aB2" zkevm.address-ger-manager: "0x580bda1e7A0CFAe92Fa7F6c20A3794F169CE3CFb" @@ -24,4 +23,4 @@ zkevm.datastream-version: 3 externalcl: true http.api: [eth, debug, net, trace, web3, erigon, zkevm] http.addr: 0.0.0.0 -http.port: 8545 \ No newline at end of file +http.port: 8545 diff --git a/xlayerconfig-testnet.yaml.example b/xlayerconfig-testnet.yaml.example index 91f0bfc2fc6..cb9a07a510e 100644 --- a/xlayerconfig-testnet.yaml.example +++ b/xlayerconfig-testnet.yaml.example @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: https://rpc.ankr.com/eth_sepolia/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx zkevm.address-sequencer: "0xD6DdA5AA7749142B7fDa3Fe4662C9f346101B8A6" zkevm.address-zkevm: "0x01469dACfDDA885D68Ff0f8628F2629c14F95a20" -zkevm.address-admin: "0xC432168eF74A83c6E6C76f2c1b42F875E1A223CD" zkevm.address-rollup: "0x6662621411A8DACC3cA7049C8BddABaa9a999ce3" zkevm.address-ger-manager: "0x66E61bA00F58b857A9DD2C500F3aBc424A46BD20" diff --git a/zk/tests/nightly-l1-recovery/network5-config.yaml b/zk/tests/nightly-l1-recovery/network5-config.yaml index 5078674c4a1..82cf74f727e 100644 --- a/zk/tests/nightly-l1-recovery/network5-config.yaml +++ b/zk/tests/nightly-l1-recovery/network5-config.yaml @@ -11,7 +11,6 @@ zkevm.l1-rpc-url: "http://cache:6969?endpoint=https://rpc.sepolia.org&chainid=82 zkevm.address-sequencer: "0xC9c0DDBAD778A58ac078975Cc7847dD1DEaF2B0A" zkevm.address-zkevm: "0x1FAC2D008A7987ED9Eb3eBCd2d95791cC341AB6f" -zkevm.address-admin: "0x406C6e412895f32573442365d0BA5027ae369cC7" zkevm.address-rollup: "0xBFA50869D87f5Fdee35F60ab31Dc5a347ab6d7f4" zkevm.address-ger-manager: "0x3134D060b2b2B47477e8f75537B2047606c5a8cc" diff --git a/zk/tests/nightly-l1-recovery/network5-sync-config.yaml b/zk/tests/nightly-l1-recovery/network5-sync-config.yaml index 602d435bca2..648303c2b50 100644 --- a/zk/tests/nightly-l1-recovery/network5-sync-config.yaml +++ b/zk/tests/nightly-l1-recovery/network5-sync-config.yaml @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: "http://cache:6969?endpoint=https://rpc.sepolia.org&chainid=82 zkevm.address-sequencer: "0xC9c0DDBAD778A58ac078975Cc7847dD1DEaF2B0A" zkevm.address-zkevm: "0x1FAC2D008A7987ED9Eb3eBCd2d95791cC341AB6f" -zkevm.address-admin: "0x406C6e412895f32573442365d0BA5027ae369cC7" zkevm.address-rollup: "0xBFA50869D87f5Fdee35F60ab31Dc5a347ab6d7f4" zkevm.address-ger-manager: "0x3134D060b2b2B47477e8f75537B2047606c5a8cc" diff --git a/zk/tests/nightly-l1-recovery/network8-config.yaml b/zk/tests/nightly-l1-recovery/network8-config.yaml index 4d035185ee2..b38c7a3b45f 100644 --- a/zk/tests/nightly-l1-recovery/network8-config.yaml +++ b/zk/tests/nightly-l1-recovery/network8-config.yaml @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: "http://cache:6969?endpoint=https://rpc.sepolia.org&chainid=77 zkevm.address-sequencer: "0x153724F17B1eb206e31CAbA82f6b45E865879D94" zkevm.address-zkevm: "0xA24686d989DCd70fBb4D8311694820d74872f061" -zkevm.address-admin: "0xe859276098f208D003ca6904C6cC26629Ee364Ce" zkevm.address-rollup: "0xeE6F5B532b67ee594B372f7a3eBD276A45Ea6777" zkevm.address-ger-manager: "0x33ff0546a9ce00D9b2B43Fe52Eab336D919eAD36" diff --git a/zk/tests/nightly-l1-recovery/network8-sync-config.yaml b/zk/tests/nightly-l1-recovery/network8-sync-config.yaml index 5a5a7aee8b9..98a80e3747d 100644 --- a/zk/tests/nightly-l1-recovery/network8-sync-config.yaml +++ b/zk/tests/nightly-l1-recovery/network8-sync-config.yaml @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: "http://cache:6969?endpoint=https://rpc.sepolia.org&chainid=77 zkevm.address-sequencer: "0x153724F17B1eb206e31CAbA82f6b45E865879D94" zkevm.address-zkevm: "0xA24686d989DCd70fBb4D8311694820d74872f061" -zkevm.address-admin: "0xe859276098f208D003ca6904C6cC26629Ee364Ce" zkevm.address-rollup: "0xeE6F5B532b67ee594B372f7a3eBD276A45Ea6777" zkevm.address-ger-manager: "0x33ff0546a9ce00D9b2B43Fe52Eab336D919eAD36" diff --git a/zk/tests/unwinds/config/dynamic-integration8.yaml b/zk/tests/unwinds/config/dynamic-integration8.yaml index 2d958c822b9..afba2cd46a8 100644 --- a/zk/tests/unwinds/config/dynamic-integration8.yaml +++ b/zk/tests/unwinds/config/dynamic-integration8.yaml @@ -10,7 +10,6 @@ zkevm.l1-rpc-url: "https://rpc.eu-central-1.gateway.fm/v4/ethereum/non-archival/ zkevm.address-sequencer: "0x153724F17B1eb206e31CAbA82f6b45E865879D94" zkevm.address-zkevm: "0xA24686d989DCd70fBb4D8311694820d74872f061" -zkevm.address-admin: "0xe859276098f208D003ca6904C6cC26629Ee364Ce" zkevm.address-rollup: "0xeE6F5B532b67ee594B372f7a3eBD276A45Ea6777" zkevm.address-ger-manager: "0x33ff0546a9ce00D9b2B43Fe52Eab336D919eAD36"