Skip to content
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
- (deps) [#8](https://github.com/EscanBE/evermint/pull/8) Bump cosmos-sdk v0.47.5 and ibc v7.3.1
- (evm) [#25](https://github.com/EscanBE/evermint/pull/25) Enable [EIP-3855](https://eips.ethereum.org/EIPS/eip-3855) by default
- (deps) [#36](https://github.com/EscanBE/evermint/pull/36) Bump CometBFT to v0.37.4
- (evm) [#39](https://github.com/EscanBE/evermint/pull/39) Consume all gas upon `ApplyTransaction` failure without VM error

# Evermint changelog

Expand Down
6 changes: 6 additions & 0 deletions x/evm/keeper/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ func (k *Keeper) ApplyTransaction(ctx sdk.Context, tx *ethtypes.Transaction) (*t
// pass true to commit the StateDB
res, err := k.ApplyMessageWithConfig(tmpCtx, msg, nil, true, cfg, txConfig)
if err != nil {
// Refer to EIP-140 https://eips.ethereum.org/EIPS/eip-140
// Opcode REVERT provides a way to stop execution and revert state changes, without consuming all provided gas.
// Thus, all the other failure will consume all gas.
// That why we are going to consume all gas here because this is not caused-by-REVERT-opcode.
k.ResetGasMeterAndConsumeGas(ctx, ctx.GasMeter().Limit())

return nil, errorsmod.Wrap(err, "failed to apply ethereum core message")
}

Expand Down
Loading