Skip to content

Commit

Permalink
refactor: remove AddressAdmin config (#1220)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vcastellm authored Sep 26, 2024
1 parent 701f4d2 commit 6c55925
Show file tree
Hide file tree
Showing 17 changed files with 7 additions and 27 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ var (
}
AddressAdminFlag = cli.StringFlag{
Name: "zkevm.address-admin",
Usage: "Admin address",
Usage: "Admin address (Deprecated)",
Value: "",
}
AddressRollupFlag = cli.StringFlag{
Expand Down
10 changes: 3 additions & 7 deletions eth/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -1556,20 +1556,16 @@ 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 {
log.Warn("L1 contract address check failed (AddressRollup)", "expected", cfg.AddressRollup, "actual", l1AddrRollup)
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)
Expand Down
3 changes: 1 addition & 2 deletions hermezconfig-bali.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
ws: true
3 changes: 1 addition & 2 deletions hermezconfig-cardona.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
ws: true
1 change: 0 additions & 1 deletion hermezconfig-dev.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion hermezconfig-estest-syncer.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion hermezconfig-mainnet-shadowfork.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion hermezconfig-mainnet.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion turbo/cli/flags_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions xlayerconfig-mainnet.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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
http.port: 8545
1 change: 0 additions & 1 deletion xlayerconfig-testnet.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion zk/tests/nightly-l1-recovery/network5-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion zk/tests/nightly-l1-recovery/network5-sync-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion zk/tests/nightly-l1-recovery/network8-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion zk/tests/nightly-l1-recovery/network8-sync-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
1 change: 0 additions & 1 deletion zk/tests/unwinds/config/dynamic-integration8.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 6c55925

Please sign in to comment.