diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e33562358..f755cabf26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [tharsis#878](https://github.com/tharsis/ethermint/pull/878) Workaround to make GetBlock RPC api report correct block gas used. * (rpc) [tharsis#900](https://github.com/tharsis/ethermint/pull/900) newPendingTransactions filter return ethereum tx hash. * (rpc) [tharsis#933](https://github.com/tharsis/ethermint/pull/933) Fix newPendingTransactions subscription deadlock when a Websocket client exits without unsubscribing and the node errors. +* (evm) [tharsis#932](https://github.com/tharsis/ethermint/pull/932) Fix base fee check logic in state transition. ## [v0.9.0] - 2021-12-01 diff --git a/x/evm/keeper/state_transition.go b/x/evm/keeper/state_transition.go index 749fd2d080..f2cb09d02e 100644 --- a/x/evm/keeper/state_transition.go +++ b/x/evm/keeper/state_transition.go @@ -92,14 +92,17 @@ func (k *Keeper) NewEVM( if tracer == nil { tracer = k.Tracer(ctx, msg, cfg.ChainConfig) } - vmConfig := k.VMConfig(ctx, msg, cfg.Params, tracer) + vmConfig := k.VMConfig(ctx, msg, cfg, tracer) return vm.NewEVM(blockCtx, txCtx, stateDB, cfg.ChainConfig, vmConfig) } // VMConfig creates an EVM configuration from the debug setting and the extra EIPs enabled on the // module parameters. The config generated uses the default JumpTable from the EVM. -func (k Keeper) VMConfig(ctx sdk.Context, msg core.Message, params types.Params, tracer vm.EVMLogger) vm.Config { - fmParams := k.feeMarketKeeper.GetParams(ctx) +func (k Keeper) VMConfig(ctx sdk.Context, msg core.Message, cfg *types.EVMConfig, tracer vm.EVMLogger) vm.Config { + noBaseFee := true + if types.IsLondon(cfg.ChainConfig, ctx.BlockHeight()) { + noBaseFee = k.feeMarketKeeper.GetParams(ctx).NoBaseFee + } var debug bool if _, ok := tracer.(types.NoOpTracer); !ok { @@ -109,8 +112,8 @@ func (k Keeper) VMConfig(ctx sdk.Context, msg core.Message, params types.Params, return vm.Config{ Debug: debug, Tracer: tracer, - NoBaseFee: fmParams.NoBaseFee, - ExtraEips: params.EIPs(), + NoBaseFee: noBaseFee, + ExtraEips: cfg.Params.EIPs(), } }