From 64bd2de950f6362c4e4b1b8152f23bb7e8e1ac61 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 12 Nov 2024 18:45:54 +0800 Subject: [PATCH] Problem: different maxGasWanted config leads hash mismatch (#560) this bug was introduced in https://github.com/crypto-org-chain/ethermint/commit/773438f47b95c4db11a4b90f7747a7ee5705c935 --- CHANGELOG.md | 1 + app/ante/eth.go | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e59663687d..6e82638a44 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -76,6 +76,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [#545](https://github.com/crypto-org-chain/ethermint/pull/545) Fix state overwrite in debug trace APIs. * (rpc) [#554](https://github.com/crypto-org-chain/ethermint/pull/554) No trace detail on insufficient balance. * (rpc) [#558](https://github.com/crypto-org-chain/ethermint/pull/558) New tracer in predecessors to trace balance correctly when `debug_traceTransaction`. +* (ante) [#560](https://github.com/crypto-org-chain/ethermint/pull/560) Check gasWanted only in checkTx mode. ### Improvements diff --git a/app/ante/eth.go b/app/ante/eth.go index 67a95113e0..ca608777a7 100644 --- a/app/ante/eth.go +++ b/app/ante/eth.go @@ -146,7 +146,7 @@ func CheckEthGasConsume( // We can't trust the tx gas limit, because we'll refund the unused gas. gasLimit := msgEthTx.GetGas() - if maxGasWanted != 0 { + if ctx.IsCheckTx() && maxGasWanted != 0 { gasLimit = min(gasLimit, maxGasWanted) } if gasWanted > math.MaxInt64-gasLimit {