diff --git a/CHANGELOG.md b/CHANGELOG.md index 68a2e261..2b64ab2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -68,6 +68,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [tharsis#860](https://github.com/tharsis/ethermint/pull/860) Fix `eth_getLogs` when specify blockHash without address/topics, and limit the response size. * (rpc) [tharsis#865](https://github.com/tharsis/ethermint/pull/865) Fix RPC Filter parameters being ignored * (evm) [tharsis#871](https://github.com/tharsis/ethermint/pull/871) Set correct nonce in `EthCall` and `EstimateGas` grpc query. +* (rpc) [tharsis#878](https://github.com/tharsis/ethermint/pull/878) Workaround to make GetBlock RPC api report correct block gas used. ## [v0.9.0] - 2021-12-01 diff --git a/rpc/ethereum/backend/backend.go b/rpc/ethereum/backend/backend.go index 1924f39a..16063c77 100644 --- a/rpc/ethereum/backend/backend.go +++ b/rpc/ethereum/backend/backend.go @@ -443,6 +443,11 @@ func (e *EVMBackend) EthBlockFromTendermint( gasUsed := uint64(0) for _, txsResult := range txResults { + // workaround for cosmos-sdk bug. https://github.com/cosmos/cosmos-sdk/issues/10832 + if txsResult.GetCode() == 11 && txsResult.GetLog() == "no block gas left to run tx: out of gas" { + // block gas limit has exceeded, other txs must have failed with same reason. + break + } gasUsed += uint64(txsResult.GetGasUsed()) }