From b1d932ab2b5b06ed1f98282ff086a206b9924ca5 Mon Sep 17 00:00:00 2001 From: Sina Mahmoodi Date: Tue, 12 Mar 2024 18:25:14 +0100 Subject: [PATCH] add comment --- eth/tracers/api.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eth/tracers/api.go b/eth/tracers/api.go index 9327f29ee9..0add06c8f6 100644 --- a/eth/tracers/api.go +++ b/eth/tracers/api.go @@ -654,6 +654,10 @@ func (api *API) traceBlockParallel(ctx context.Context, block *types.Block, stat TxIndex: task.index, TxHash: txs[task.index].Hash(), } + // Reconstruct the block context for each transaction + // as the GetHash function of BlockContext is not safe for + // concurrent use. + // See: https://github.com/ethereum/go-ethereum/issues/29114 blockCtx := core.NewEVMBlockContext(block.Header(), api.chainContext(ctx), nil) res, err := api.traceTx(ctx, msg, txctx, blockCtx, task.statedb, config) if err != nil {