Skip to content

[r3.6] execution/stagedsync: hand the trace sets to the apply result instead of copying - #23093

Merged
awskii merged 1 commit into
release/3.6from
alex/traces_no_copy_36
Aug 7, 2026
Merged

[r3.6] execution/stagedsync: hand the trace sets to the apply result instead of copying#23093
awskii merged 1 commit into
release/3.6from
alex/traces_no_copy_36

Conversation

@AskAlexSharov

Copy link
Copy Markdown
Collaborator

Cherry-pick of #23092 to release/3.6. Applied cleanly.

Every premise the change rests on was re-checked against this branch rather than assumed from main:

  • Worker has no CallTracer field; the tracer is a local in RunTxTaskNoLock built per transaction (execution/exec/state.go:533), handing its maps to the result at 561-562.
  • TxResult is not pooled — the only sync.Pool in txtask.go is queuePool.
  • applyLogsAndTraces4 only ranges over the two maps.
  • finalizedResults[tx-1] is read again at 2747, but only for .Receipt.
  • The block-end result at 3131 already assigns the maps directly.

Green: execution/stagedsync, execution/tests, rpc/jsonrpc.

… of copying

The publish path allocated two empty maps and copied every entry of the tx's
trace sets into them. The tracer is built per tx inside Worker.RunTxTaskNoLock
and nothing else keeps a reference, so the result already owns those maps, and
the consumer only ranges over them. The block-end result four hundred lines
below already assigns them directly.
@awskii
awskii added this pull request to the merge queue Aug 7, 2026
Merged via the queue into release/3.6 with commit 771989c Aug 7, 2026
95 checks passed
@awskii
awskii deleted the alex/traces_no_copy_36 branch August 7, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants