From 5d64f3b32f7320d1d120d7795439293ff2591053 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Mon, 8 Sep 2025 17:28:18 +0800 Subject: [PATCH] eth/tracers: avoid using blockCtx concurrently #24286 (#1272) --- eth/tracers/api.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index a947ce8c09..978854751c 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -560,8 +560,8 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac threads = len(txs) } blockHash := block.Hash() - blockCtx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil) for th := 0; th < threads; th++ { + blockCtx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil) pend.Add(1) go func() { defer pend.Done() @@ -593,6 +593,7 @@ func (api *API) traceBlock(ctx context.Context, block *types.Block, config *Trac // Feed the transactions into the tracers and return feeCapacity := state.GetTRC21FeeCapacityFromState(statedb) var failed error + blockCtx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil) for i, tx := range txs { // Send the trace task over for execution jobs <- &txTraceTask{statedb: statedb.Copy(), index: i}