Skip to content

Commit

Permalink
Move trace ID generation outside the concurrent path
Browse files Browse the repository at this point in the history
  • Loading branch information
m-Peter committed Nov 7, 2024
1 parent b929eea commit f011757
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fvm/evm/debug/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ func (t *CallTracer) Collect(txID gethCommon.Hash) {
// remove the result
delete(t.resultsByTxID, txID)

// generate the trace ID, outside the go-routine
traceID := TraceID(txID, t.blockID)

// upload is concurrent and it doesn't produce any errors, as the
// client doesn't expect it, we don't want to break execution flow,
// in case there are errors we retry, and if we fail after retries
Expand All @@ -107,7 +110,7 @@ func (t *CallTracer) Collect(txID gethCommon.Hash) {
Msg("failed to collect EVM traces")
}
}()
if err := t.uploader.Upload(TraceID(txID, t.blockID), res); err != nil {
if err := t.uploader.Upload(traceID, res); err != nil {
l.Error().Err(err).
Str("traces", string(res)).
Msg("failed to upload trace results, no more retries")
Expand Down

0 comments on commit f011757

Please sign in to comment.