Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

GetBlock rpc api report wrong gasUsed #878

Merged
merged 3 commits into from
Jan 5, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions rpc/ethereum/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,11 @@ func (e *EVMBackend) EthBlockFromTendermint(
gasUsed := uint64(0)

for _, txsResult := range txResults {
// workaround for cosmos-sdk bug. https://github.com/tharsis/ethermint/issues/877
yihuang marked this conversation as resolved.
Show resolved Hide resolved
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())
}

Expand Down