From 6d44d7193234113aa550c4f5fbb602f7346fa7b3 Mon Sep 17 00:00:00 2001 From: yihuang Date: Thu, 6 Jan 2022 02:03:31 +0800 Subject: [PATCH] fix!: tx result don't report block gas used as tx gas used (#10833) * tx result report block gas used as tx gas used Closes: #10832 Solution: Return empty GasInfo. * Update CHANGELOG.md Co-authored-by: Amaury <1293565+amaurym@users.noreply.github.com> --- CHANGELOG.md | 1 + baseapp/baseapp.go | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cf4db827..31f8ddc09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### State Machine Breaking +- [#10833](https://github.com/cosmos/cosmos-sdk/pull/10833) fix reported tx gas used when block gas limit exceeded. * (auth) [\#10536](https://github.com/cosmos/cosmos-sdk/pull/10536]) Enable `SetSequence` for `ModuleAccount`. * (store) [#10218](https://github.com/cosmos/cosmos-sdk/pull/10218) Charge gas even when there are no entries while seeking. * (store) [#10247](https://github.com/cosmos/cosmos-sdk/pull/10247) Charge gas for the key length in gas meter. diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index b36d06702..93a57c756 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") }