diff --git a/CHANGELOG.md b/CHANGELOG.md index a99a1e2159..34e05667fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,9 +42,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (rpc) [crypto-org-chain#42](https://github.com/crypto-org-chain/ethermint/pull/42) Fix `eth_getLogs` when specify blockHash without address/topics, and limit the response size. * (rpc) [tharsis#933](https://github.com/tharsis/ethermint/pull/933) Fix newPendingTransactions subscription deadlock when a Websocket client exits without unsubscribing and the node errors. (backport: #933) -### Bug Fixes - - (rpc) [tharsis#900](https://github.com/tharsis/ethermint/pull/900) newPendingTransactions filter should return ethereum tx hash. +- (rpc) [tharsis#878](https://github.com/tharsis/ethermint/pull/878) Workaround to make GetBlock RPC api report correct block gas used. ## [v0.7.2-cronos-6] - 2021-12-17 diff --git a/rpc/ethereum/backend/backend.go b/rpc/ethereum/backend/backend.go index 0efb24450a..cfbab4d27d 100644 --- a/rpc/ethereum/backend/backend.go +++ b/rpc/ethereum/backend/backend.go @@ -343,6 +343,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()) }