From 8e77ddbaa02476228a420188997e2e869d831435 Mon Sep 17 00:00:00 2001 From: 0xSHKWON Date: Thu, 6 Aug 2026 11:21:22 +0900 Subject: [PATCH] core: fail fast on transaction error in parallel block execution (#35465) --- core/state_processor_parallel.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/core/state_processor_parallel.go b/core/state_processor_parallel.go index 9e70fadf7e..4df1899f2a 100644 --- a/core/state_processor_parallel.go +++ b/core/state_processor_parallel.go @@ -283,10 +283,8 @@ func (p *StateProcessor) executeTransactionsParallel(block *types.Block, parentR if workers > len(txs) { workers = len(txs) } - var ( - cursor atomic.Int64 - group errgroup.Group - ) + var cursor atomic.Int64 + group, gctx := errgroup.WithContext(context.Background()) for w := 0; w < workers; w++ { group.Go(func() error { context := NewEVMBlockContext(header, p.chain, nil) @@ -300,6 +298,11 @@ func (p *StateProcessor) executeTransactionsParallel(block *types.Block, parentR defer evm.Release() for { + select { + case <-gctx.Done(): + return gctx.Err() + default: + } i := int(cursor.Add(1)) - 1 if i >= len(txs) { return nil