Skip to content

Commit

Permalink
fix missed call failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sduchesneau committed Aug 8, 2023
1 parent 87e46b3 commit a97b3c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,10 +210,12 @@ func (evm *EVM) Call(caller ContractRef, addr common.Address, input []byte, gas

// Fail if we're trying to execute above the call depth limit
if evm.depth > int(params.CallCreateDepth) {
err = ErrDepth // important for tracer
return nil, gas, ErrDepth
}
// Fail if we're trying to transfer more than the available balance
if value.Sign() != 0 && !evm.Context.CanTransfer(evm.StateDB, caller.Address(), value) {
err = ErrInsufficientBalance // important for tracer
return nil, gas, ErrInsufficientBalance
}

Expand Down
1 change: 1 addition & 0 deletions eth/tracers/firehose.go
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,7 @@ func (f *Firehose) callEnd(source string, output []byte, gasUsed uint64, err err
// We also treat ErrInsufficientBalance and ErrDepth as reverted in Firehose model
// because they do not cost any gas.
call.StatusReverted = errors.Is(err, vm.ErrExecutionReverted) || errors.Is(err, vm.ErrInsufficientBalance) || errors.Is(err, vm.ErrDepth)
firehoseTrace("call returned error, err=%s, statusReverted=%t, statusFailed=%t", err.Error(), call.StatusReverted, call.StatusFailed)
}

// Known Firehose issue: The EndOrdinal of the genesis block root call is never actually
Expand Down

0 comments on commit a97b3c2

Please sign in to comment.