Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove unused flag #1273

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,6 @@ Initial SMT build performance can be increased if machine has enough RAM:

## Configuration Files
Config files are the easiest way to configure cdk-erigon, there are examples in the repository for each network e.g. `hermezconfig-mainnet.yaml.example`.

Depending on the RPC provider you are using, you may wish to alter `zkevm.rpc-ratelimit`.

***

## Running CDK-Erigon
Expand Down Expand Up @@ -193,7 +190,6 @@ For a full explanation of the config options, see below:
- `zkevm.address-zkevm`: The address for the zkevm 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.
- `zkevm.data-stream-port`: Port for the data stream. This needs to be set to enable the datastream server
- `zkevm.data-stream-host`: The host for the data stream i.e. `localhost`. This must be set to enable the datastream server
- `zkevm.datastream-version:` Version of the data stream protocol.
Expand Down
10 changes: 8 additions & 2 deletions cmd/cdk-erigon/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,20 @@ func setFlagsFromConfigFile(ctx *cli.Context, filePath string) error {
}
if err := ctx.Set(key, strings.Join(s, ",")); err != nil {
if deprecatedFlag, found := erigoncli.DeprecatedFlags[key]; found {
return fmt.Errorf("failed setting %s flag Flag is deprecated, use %s instead", key, deprecatedFlag)
if deprecatedFlag == "" {
return fmt.Errorf("failed setting %s flag it is deprecated, remove it", key)
}
return fmt.Errorf("failed setting %s flag it is deprecated, use %s instead", key, deprecatedFlag)
}
return fmt.Errorf("failed setting %s flag with values=%s error=%s", key, s, err)
}
} else {
if err := ctx.Set(key, fmt.Sprintf("%v", value)); err != nil {
if deprecatedFlag, found := erigoncli.DeprecatedFlags[key]; found {
return fmt.Errorf("failed setting %s flag Flag is deprecated, use %s instead", key, deprecatedFlag)
if deprecatedFlag == "" {
return fmt.Errorf("failed setting %s flag it is deprecated, remove it", key)
}
return fmt.Errorf("failed setting %s flag it is deprecated, use %s instead", key, deprecatedFlag)
}
return fmt.Errorf("failed setting %s flag with value=%v error=%s", key, value, err)
}
Expand Down
1 change: 0 additions & 1 deletion hermezconfig-bali.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ zkevm.gas-price-factor: 0.12

zkevm.l1-rollup-id: 1
zkevm.l1-first-block: 4794475
zkevm.rpc-ratelimit: 250
txpool.disable: true
torrent.port: 42070
zkevm.datastream-version: 2
Expand Down
1 change: 0 additions & 1 deletion hermezconfig-cardona.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ zkevm.l1-rollup-id: 1
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 4789190
zkevm.rpc-ratelimit: 250
txpool.disable: true
torrent.port: 42070
zkevm.datastream-version: 2
Expand Down
1 change: 0 additions & 1 deletion hermezconfig-dev.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ zkevm.address-ger-manager: "0x76216E45Bdd20022eEcC07999e50228d7829534B"
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 5192000
zkevm.rpc-ratelimit: 250
zkevm.data-stream-port: 6900
zkevm.datastream-version: 2
zkevm.data-stream-host: localhost
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 @@ -16,7 +16,6 @@ zkevm.address-ger-manager: "0x0FE6A2FcF455b9B8004fd625909857933d3c7494"
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 5192000
zkevm.rpc-ratelimit: 250
zkevm.data-stream-port: 6900
zkevm.datastream-version: 2
zkevm.data-stream-host: "127.0.0.1"
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 @@ -16,7 +16,6 @@ zkevm.address-ger-manager: "0x76216E45Bdd20022eEcC07999e50228d7829534B"
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 5192000
zkevm.rpc-ratelimit: 250
zkevm.data-stream-port: 6900
zkevm.datastream-version: 2
zkevm.data-stream-host: localhost
Expand Down
1 change: 0 additions & 1 deletion hermezconfig-mainnet.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ zkevm.l1-rollup-id: 1
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 16896700
zkevm.rpc-ratelimit: 250
zkevm.datastream-version: 2

# debug.timers: true # Uncomment to enable timers
Expand Down
5 changes: 2 additions & 3 deletions turbo/cli/flags_zkevm.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import (
)

var DeprecatedFlags = map[string]string{
"zkevm.gasless": "zkevm.allow-free-transactions",
"zkevm.gasless": "zkevm.allow-free-transactions",
"zkevm.rpc-ratelimit": "",
}

func ApplyFlagsForZkConfig(ctx *cli.Context, cfg *ethconfig.Config) {
Expand Down Expand Up @@ -135,7 +136,6 @@ func ApplyFlagsForZkConfig(ctx *cli.Context, cfg *ethconfig.Config) {
L1FirstBlock: ctx.Uint64(utils.L1FirstBlockFlag.Name),
L1FinalizedBlockRequirement: ctx.Uint64(utils.L1FinalizedBlockRequirementFlag.Name),
L1ContractAddressCheck: ctx.Bool(utils.L1ContractAddressCheckFlag.Name),
RpcRateLimits: ctx.Int(utils.RpcRateLimitsFlag.Name),
RpcGetBatchWitnessConcurrencyLimit: ctx.Int(utils.RpcGetBatchWitnessConcurrencyLimitFlag.Name),
DatastreamVersion: ctx.Int(utils.DatastreamVersionFlag.Name),
RebuildTreeAfter: ctx.Uint64(utils.RebuildTreeAfterFlag.Name),
Expand Down Expand Up @@ -224,7 +224,6 @@ func ApplyFlagsForZkConfig(ctx *cli.Context, cfg *ethconfig.Config) {
checkFlag(utils.L1RpcUrlFlag.Name, cfg.L1RpcUrl)
checkFlag(utils.L1MaticContractAddressFlag.Name, cfg.L1MaticContractAddress.Hex())
checkFlag(utils.L1FirstBlockFlag.Name, cfg.L1FirstBlock)
checkFlag(utils.RpcRateLimitsFlag.Name, cfg.RpcRateLimits)
checkFlag(utils.RpcGetBatchWitnessConcurrencyLimitFlag.Name, cfg.RpcGetBatchWitnessConcurrencyLimit)
checkFlag(utils.RebuildTreeAfterFlag.Name, cfg.RebuildTreeAfter)
checkFlag(utils.L1BlockRangeFlag.Name, cfg.L1BlockRange)
Expand Down
1 change: 0 additions & 1 deletion xlayerconfig-mainnet.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ zkevm.l1-rollup-id: 3
zkevm.l1-first-block: 19218658
zkevm.l1-block-range: 2000
zkevm.l1-query-delay: 1000
zkevm.rpc-ratelimit: 250
zkevm.datastream-version: 3

externalcl: true
Expand Down
1 change: 0 additions & 1 deletion xlayerconfig-testnet.yaml.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ zkevm.l1-rollup-id: 1
zkevm.l1-first-block: 4648290
zkevm.l1-block-range: 2000
zkevm.l1-query-delay: 1000
zkevm.rpc-ratelimit: 250
zkevm.datastream-version: 3

externalcl: true
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 @@ -18,7 +18,6 @@ zkevm.l1-matic-contract-address: "0x0f25eE4CA85Db4362a9749782872c558873566e4"
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 6032365
zkevm.rpc-ratelimit: 250
zkevm.data-stream-port: 6900
zkevm.datastream-version: 2
zkevm.data-stream-host: "127.0.0.1"
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 @@ -17,7 +17,6 @@ zkevm.l1-matic-contract-address: "0x0f25eE4CA85Db4362a9749782872c558873566e4"
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 6032365
zkevm.rpc-ratelimit: 250
zkevm.executor-strict: false
# zkevm.executor-urls: "zkevm2-stateless-executor:50071"
zkevm.witness-full: false
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 @@ -17,7 +17,6 @@ zkevm.l1-matic-contract-address: "0xdC66C280f5E8bBbd2F2d92FaD1489863c8F55915"
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 6411787
zkevm.rpc-ratelimit: 250
zkevm.data-stream-port: 6900
zkevm.datastream-version: 2
zkevm.data-stream-host: "127.0.0.1"
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 @@ -17,7 +17,6 @@ zkevm.l1-matic-contract-address: "0xdC66C280f5E8bBbd2F2d92FaD1489863c8F55915"
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 6411787
zkevm.rpc-ratelimit: 250
#zkevm.data-stream-port: 6900
zkevm.datastream-version: 2
#zkevm.data-stream-host: "127.0.0.1"
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 @@ -17,7 +17,6 @@ zkevm.l1-matic-contract-address: "0xdC66C280f5E8bBbd2F2d92FaD1489863c8F55915"
zkevm.l1-block-range: 20000
zkevm.l1-query-delay: 6000
zkevm.l1-first-block: 6411787
zkevm.rpc-ratelimit: 250
# zkevm.data-stream-port: 6900
zkevm.datastream-version: 2
# zkevm.data-stream-host: "127.0.0.1"
Expand Down
Loading