diff --git a/app/ante/eth.go b/app/ante/eth.go index 66ac465c5d..8fcabb587c 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -193,7 +193,7 @@ func (egcd EthGasConsumeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simula return ctx, sdkerrors.Wrap(err, "failed to unpack tx data") } - if ctx.IsCheckTx() { + if ctx.IsCheckTx() && egcd.maxGasWanted != 0 { // We can't trust the tx gas limit, because we'll refund the unused gas. if txData.GetGas() > egcd.maxGasWanted { gasWanted += egcd.maxGasWanted diff --git a/app/ante/eth_test.go b/app/ante/eth_test.go index 1e8b9c1fe2..9edf55d4db 100644 --- a/app/ante/eth_test.go +++ b/app/ante/eth_test.go @@ -279,7 +279,7 @@ func (suite AnteTestSuite) TestEthGasConsumeDecorator() { { "success", tx2, - config.DefaultMaxTxGasWanted, // it's capped + tx2GasLimit, // it's capped func() { vmdb.AddBalance(addr, big.NewInt(1000000)) diff --git a/server/config/config.go b/server/config/config.go index 060e9decdb..70432b7f4f 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -28,7 +28,7 @@ const ( // DefaultEVMTracer is the default vm.Tracer type DefaultEVMTracer = "" - DefaultMaxTxGasWanted = 500000 + DefaultMaxTxGasWanted = 0 DefaultGasCap uint64 = 25000000