From a56dfde35ddb9a64f8b6a584aa5bf2d987fdf6d1 Mon Sep 17 00:00:00 2001 From: Alexey Sharov Date: Fri, 7 Aug 2026 17:56:01 +0700 Subject: [PATCH] execution/stagedsync: hand the trace sets to the apply result instead 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. --- execution/stagedsync/exec3_parallel.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/execution/stagedsync/exec3_parallel.go b/execution/stagedsync/exec3_parallel.go index bc0853c3d18..a2129001bf8 100644 --- a/execution/stagedsync/exec3_parallel.go +++ b/execution/stagedsync/exec3_parallel.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "maps" "os" "runtime" "runtime/pprof" @@ -2920,8 +2919,8 @@ func (be *blockExecutor) nextResult(ctx context.Context, pe *parallelExecutor, r applyResult := txResult{ blockNum: be.blockNum, blockHash: be.blockHash, - traceFroms: map[accounts.Address]struct{}{}, - traceTos: map[accounts.Address]struct{}{}, + traceFroms: result.TraceFroms, + traceTos: result.TraceTos, txNum: task.Version().TxNum, rules: task.Rules(), cumulativeBlobGasUsed: result.cumulativeBlobGasUsed, @@ -2948,8 +2947,6 @@ func (be *blockExecutor) nextResult(ctx context.Context, pe *parallelExecutor, r pe.executedGas.Add(int64(applyResult.blockGasUsed)) } - maps.Copy(applyResult.traceFroms, result.TraceFroms) - maps.Copy(applyResult.traceTos, result.TraceTos) be.cntFinalized++ be.publishTasks.markComplete(tx)