diff --git a/types/block.go b/types/block.go index 5b200cedfe..5d0db44b9e 100644 --- a/types/block.go +++ b/types/block.go @@ -30,7 +30,7 @@ func BlockGasLimit(ctx sdk.Context) uint64 { // Otherwise get from the consensus parameters cp := ctx.ConsensusParams() - if cp.Abci == nil || cp.Block == nil { + if cp.Block == nil { return 0 } diff --git a/x/evm/keeper/grpc_query.go b/x/evm/keeper/grpc_query.go index 1201ab93f3..d30faab5a3 100644 --- a/x/evm/keeper/grpc_query.go +++ b/x/evm/keeper/grpc_query.go @@ -305,7 +305,7 @@ func (k Keeper) EstimateGas(c context.Context, req *types.EthCallRequest) (*type } else { // Query block gas limit params := ctx.ConsensusParams() - if params.Abci != nil && params.Block != nil && params.Block.MaxGas > 0 { + if params.Block != nil && params.Block.MaxGas > 0 { hi = uint64(params.Block.MaxGas) } else { hi = req.GasCap diff --git a/x/feemarket/keeper/eip1559.go b/x/feemarket/keeper/eip1559.go index 5252b1659f..366271afd3 100644 --- a/x/feemarket/keeper/eip1559.go +++ b/x/feemarket/keeper/eip1559.go @@ -62,7 +62,7 @@ func (k Keeper) CalculateBaseFee(ctx sdk.Context) *big.Int { gasLimit := new(big.Int).SetUint64(math.MaxUint64) // NOTE: a MaxGas equal to -1 means that block gas is unlimited - if consParams.Abci != nil && consParams.Block.MaxGas > -1 { + if consParams.Block.MaxGas > -1 { gasLimit = big.NewInt(consParams.Block.MaxGas) } diff --git a/x/feemarket/keeper/eip1559_test.go b/x/feemarket/keeper/eip1559_test.go index f0bb637f49..7abbdf6e03 100644 --- a/x/feemarket/keeper/eip1559_test.go +++ b/x/feemarket/keeper/eip1559_test.go @@ -39,7 +39,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 50, sdkmath.LegacyZeroDec(), - big.NewInt(875000001), + suite.app.FeeMarketKeeper.GetParams(suite.ctx).BaseFee.BigInt(), }, { "with BaseFee - parent block wanted the same gas as its target, with higher min gas price (ElasticityMultiplier = 2)", @@ -47,7 +47,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 50, sdkmath.LegacyNewDec(1500000000), - big.NewInt(1500000000), + suite.app.FeeMarketKeeper.GetParams(suite.ctx).BaseFee.BigInt(), }, { "with BaseFee - parent block wanted more gas than its target (ElasticityMultiplier = 2)", @@ -55,7 +55,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 100, sdkmath.LegacyZeroDec(), - big.NewInt(875000001), + big.NewInt(1125000000), }, { "with BaseFee - parent block wanted more gas than its target, with higher min gas price (ElasticityMultiplier = 2)", @@ -63,7 +63,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 100, sdkmath.LegacyNewDec(1500000000), - big.NewInt(1500000000), + big.NewInt(1125000000), }, { "with BaseFee - Parent gas wanted smaller than parent gas target (ElasticityMultiplier = 2)", @@ -71,7 +71,7 @@ func (suite *KeeperTestSuite) TestCalculateBaseFee() { 1, 25, sdkmath.LegacyZeroDec(), - big.NewInt(875000001), + big.NewInt(937500000), }, { "with BaseFee - Parent gas wanted smaller than parent gas target, with higher min gas price (ElasticityMultiplier = 2)",