From 5e72f50380916edf25329fe7f351091003a4308c Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Wed, 27 Jul 2022 21:04:45 -0400 Subject: [PATCH 1/2] change default maxGasWanted --- app/ante/eth.go | 2 +- app/ante/eth_test.go | 2 +- server/config/config.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/ante/eth.go b/app/ante/eth.go index bd0b1440de..d401774ea0 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -192,7 +192,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 3b0a7b2f28..a4ba48a99f 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 From 31951b4eb52fc891ab2e2fda197f0d64f97aa604 Mon Sep 17 00:00:00 2001 From: Freddy Caceres Date: Thu, 28 Jul 2022 14:38:05 -0400 Subject: [PATCH 2/2] update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1ea114c5c..b231abe082 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (feemarket) [\#1165](https://github.com/evmos/ethermint/pull/1165) Add hint in specs about different gas terminology for gas in Cosmos and Ethereum. * (rpc) [\#1169](https://github.com/evmos/ethermint/pull/1169) Remove unnecessary queries from `getBlockNumber` function +* (ante) [1208](https://github.com/evmos/ethermint/pull/1208) Change default `maxGasWanted` value ### Bug Fixes