diff --git a/cmd/state/exec3/historical_trace_worker.go b/cmd/state/exec3/historical_trace_worker.go index 92164cd09bc..b617f76984d 100644 --- a/cmd/state/exec3/historical_trace_worker.go +++ b/cmd/state/exec3/historical_trace_worker.go @@ -324,7 +324,9 @@ func NewHistoricalTraceWorkers(consumer TraceConsumer, cfg *ExecArgs, ctx contex cancel() g.Wait() rws.Close() - reducerGroup.Wait() + if err := reducerGroup.Wait(); err != nil { + panic(err) + } for _, w := range workers { w.ResetTx(nil) } @@ -342,7 +344,7 @@ func processResultQueueHistorical(consumer TraceConsumer, rws *state.ResultsQueu for rwsIt.HasNext(outputTxNum) { txTask := rwsIt.PopNext() if txTask.Error != nil { - return outputTxNum, false, err + return outputTxNum, false, txTask.Error } if txTask.TxIndex >= 0 && !txTask.Final { diff --git a/eth/stagedsync/stage_custom_trace.go b/eth/stagedsync/stage_custom_trace.go index fec16caddab..95c9d78d673 100644 --- a/eth/stagedsync/stage_custom_trace.go +++ b/eth/stagedsync/stage_custom_trace.go @@ -173,9 +173,9 @@ func customTraceBatch(ctx context.Context, cfg *exec3.ExecArgs, tx kv.TemporalRw var m runtime.MemStats if err := exec3.CustomTraceMapReduce(fromBlock, toBlock, exec3.TraceConsumer{ NewTracer: func() exec3.GenericTracer { return nil }, - Reduce: func(txTask *state.TxTask, tx kv.Tx) (err error) { + Reduce: func(txTask *state.TxTask, tx kv.Tx) error { if txTask.Error != nil { - return err + return txTask.Error } if txTask.Tx != nil {