From ae81b4947bdf34ce317664a7d0cf225c4e57d492 Mon Sep 17 00:00:00 2001 From: Nick DeLuca Date: Thu, 5 May 2022 16:58:04 -0700 Subject: [PATCH] disable london fork for kava 10 evm and dev chain (#1240) --- contrib/devnet/init-new-chain.sh | 8 ++++++++ migrate/v0_17/kava.go | 7 ++++++- migrate/v0_17/migrate_test.go | 12 +++++++++--- migrate/v0_17/testdata/genesis-v17.json | 6 +++--- 4 files changed, 26 insertions(+), 7 deletions(-) diff --git a/contrib/devnet/init-new-chain.sh b/contrib/devnet/init-new-chain.sh index a09664b3..521faf24 100755 --- a/contrib/devnet/init-new-chain.sh +++ b/contrib/devnet/init-new-chain.sh @@ -76,6 +76,14 @@ sed -in-place='' 's/aphoton/akava/g' $DATA/config/genesis.json # Zero out the total supply so it gets recalculated during InitGenesis jq '.app_state.bank.supply = []' $DATA/config/genesis.json|sponge $DATA/config/genesis.json +# Disable fee market +jq '.app_state.feemarket.params.no_base_fee = true' $DATA/config/genesis.json|sponge $DATA/config/genesis.json + +# Disable london fork +jq '.app_state.evm.params.chain_config.london_block = null' $DATA/config/genesis.json|sponge $DATA/config/genesis.json +jq '.app_state.evm.params.chain_config.arrow_glacier_block = null' $DATA/config/genesis.json|sponge $DATA/config/genesis.json +jq '.app_state.evm.params.chain_config.merge_fork_block = null' $DATA/config/genesis.json|sponge $DATA/config/genesis.json + # Enable bridge jq '.app_state.bridge.params.bridge_enabled = true' $DATA/config/genesis.json | sponge $DATA/config/genesis.json diff --git a/migrate/v0_17/kava.go b/migrate/v0_17/kava.go index 212cf0c6..2de00933 100644 --- a/migrate/v0_17/kava.go +++ b/migrate/v0_17/kava.go @@ -36,13 +36,18 @@ func migrateAppState(appState genutiltypes.AppMap, clientCtx client.Context) { appState[evmutiltypes.ModuleName] = codec.MustMarshalJSON(evmUtilGenState) // x/evm + evmChainConfig := evmtypes.DefaultChainConfig() + evmChainConfig.LondonBlock = nil + evmChainConfig.ArrowGlacierBlock = nil + evmChainConfig.MergeForkBlock = nil + evmGenState := &evmtypes.GenesisState{ Accounts: []evmtypes.GenesisAccount{}, Params: evmtypes.Params{ EvmDenom: "akava", EnableCreate: true, EnableCall: true, - ChainConfig: evmtypes.DefaultChainConfig(), + ChainConfig: evmChainConfig, ExtraEIPs: nil, }, } diff --git a/migrate/v0_17/migrate_test.go b/migrate/v0_17/migrate_test.go index ad44214f..49cb7e04 100644 --- a/migrate/v0_17/migrate_test.go +++ b/migrate/v0_17/migrate_test.go @@ -51,15 +51,21 @@ func TestMigrateEvm(t *testing.T) { appMap, ctx := migrateToV17AndGetAppMap(t) var genstate evmtypes.GenesisState err := ctx.Codec.UnmarshalJSON(appMap[evmtypes.ModuleName], &genstate) + + expectedChainConfig := evmtypes.DefaultChainConfig() + expectedChainConfig.LondonBlock = nil + expectedChainConfig.ArrowGlacierBlock = nil + expectedChainConfig.MergeForkBlock = nil + assert.NoError(t, err) assert.Len(t, genstate.Accounts, 0) - assert.Equal(t, genstate.Params, evmtypes.Params{ + assert.Equal(t, evmtypes.Params{ EvmDenom: "akava", EnableCreate: true, EnableCall: true, - ChainConfig: evmtypes.DefaultChainConfig(), + ChainConfig: expectedChainConfig, ExtraEIPs: []int64{}, - }) + }, genstate.Params) } func TestMigrateAuction(t *testing.T) { diff --git a/migrate/v0_17/testdata/genesis-v17.json b/migrate/v0_17/testdata/genesis-v17.json index 0cf4bcbf..342b7b4d 100644 --- a/migrate/v0_17/testdata/genesis-v17.json +++ b/migrate/v0_17/testdata/genesis-v17.json @@ -1557,9 +1557,9 @@ "istanbul_block": "0", "muir_glacier_block": "0", "berlin_block": "0", - "london_block": "0", - "arrow_glacier_block": "0", - "merge_fork_block": "0" + "london_block": null, + "arrow_glacier_block": null, + "merge_fork_block": null } } },