Skip to content

Commit

Permalink
vm: Trace
Browse files Browse the repository at this point in the history
  • Loading branch information
blukat29 committed Jun 20, 2024
1 parent c639563 commit 02039aa
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions blockchain/state_transition.go
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,16 @@ func (st *StateTransition) TransitionDb() (*ExecutionResult, error) {
)
ret, st.gas, vmerr = msg.Execute(st.evm, st.state, st.evm.Context.BlockNumber.Uint64(), st.gas, st.value)

if st.evm.Config.Debug {
txType := msg.Type()
if txType.IsAccountUpdate() || txType.IsCancelTransaction() || txType.IsChainDataAnchoring() {
st.evm.Config.Tracer.CaptureStart(st.evm, msg.ValidatedSender(), msg.ValidatedSender(), true, msg.Data(), st.initialGas, msg.Value())
defer func() {
st.evm.Config.Tracer.CaptureEnd(ret, st.gas, vmerr)
}()
}
}

// time-limit error is not a vm error. This error is returned when the EVM is still running while the
// block proposer's total execution time of txs for a candidate block reached the predefined limit.
if vmerr == vm.ErrTotalTimeLimitReached {
Expand Down

0 comments on commit 02039aa

Please sign in to comment.