From ec3cf6be2ae93560130341b5b1eda8005a31f7fc Mon Sep 17 00:00:00 2001 From: HuangYi Date: Thu, 23 Dec 2021 18:07:31 +0800 Subject: [PATCH] tx result report block gas used as tx gas used Closes: #10832 Solution: Return empty GasInfo. --- CHANGELOG.md | 4 ++++ baseapp/baseapp.go | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2976caac4b75..4aa811a7cad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### State Machine Breaking + +- [#10833](https://github.com/cosmos/cosmos-sdk/pull/10833) fix reported tx gas used when block gas limit exceeded. + ## [v0.45.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.45.0) - 2021-12-07 ### State Machine Breaking diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index b36d06702990..93a57c7565e2 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -583,7 +583,6 @@ func (app *BaseApp) runTx(mode runTxMode, txBytes []byte) (gInfo sdk.GasInfo, re // only run the tx if there is block gas remaining if mode == runTxModeDeliver && ctx.BlockGasMeter().IsOutOfGas() { - gInfo = sdk.GasInfo{GasUsed: ctx.BlockGasMeter().GasConsumed()} return gInfo, nil, nil, sdkerrors.Wrap(sdkerrors.ErrOutOfGas, "no block gas left to run tx") }