forked from cerc-io/laconicd-deprecated
fix: GetBlock rpc api reports wrong gasUsed (#878)
* GetBlock rpc api report wrong gasUsed Closes: #877 Solution: - workaround at rpc side, ignore the gasUsed in such cases. * Update rpc/ethereum/backend/backend.go * changelog
This commit is contained in:
@@ -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())
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user