Skip to content

Commit

Permalink
Merge tag 'v1.1.22-eigenphi-release' into v1.2.5-eigenphi
Browse files Browse the repository at this point in the history
  • Loading branch information
muyinliu committed Jun 12, 2023
2 parents 53fef9e + c866a27 commit 24ed0b7
Show file tree
Hide file tree
Showing 6 changed files with 1,587 additions and 3 deletions.
4 changes: 4 additions & 0 deletions core/vm/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,10 @@ func (evm *EVM) Reset(txCtx TxContext, statedb StateDB) {
evm.StateDB = statedb
}

func (evm *EVM) Depth() int {
return evm.depth
}

// Cancel cancels any running EVM operation. This may be called concurrently and
// it's safe to be called multiple times.
func (evm *EVM) Cancel() {
Expand Down
19 changes: 18 additions & 1 deletion eth/tracers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ type TraceConfig struct {
// Config specific to given tracer. Note struct logger
// config are historically embedded in main object.
TracerConfig json.RawMessage
Plain bool
}

// TraceCallConfig is the config for traceCall API. It holds one more
Expand Down Expand Up @@ -940,7 +941,23 @@ func (api *API) traceTx(ctx context.Context, message core.Message, txctx *Contex
if _, err = core.ApplyMessage(vmenv, message, new(core.GasPool).AddGas(message.Gas())); err != nil {
return nil, fmt.Errorf("tracing failed: %w", err)
}
return tracer.GetResult()
result, err := tracer.GetResult()
if !config.Plain {
return result, err
}
return PlainTraceByTx{
BlockNumber: vmctx.BlockNumber.Uint64(),
TransactionHash: txctx.TxHash.String(),
TransactionIndex: uint64(txctx.TxIndex),
PlainTraces: result,
}, err
}

type PlainTraceByTx struct {
BlockNumber uint64 `json:"blockNumber"`
TransactionHash string `json:"transactionHash"`
TransactionIndex uint64 `json:"transactionIndex"`
PlainTraces json.RawMessage `json:"plainTraces"`
}

// APIs return the collection of RPC services the tracer package offers.
Expand Down
Loading

0 comments on commit 24ed0b7

Please sign in to comment.