Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add live chain-aware tracing (single squashed commit) #5

Closed
wants to merge 11 commits into from
Prev Previous commit
Next Next commit
fix missed call failure
  • Loading branch information
sduchesneau committed Aug 8, 2023
commit a97b3c2061de4cb7381c7f911fab569f10cf8c4b
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