go-ethereum/libevm/precompiles/parallel
Furkan Boyraz 312fa38051
fix: parallel.wrapper.beforeWork channel race (#266)
## Why this should be merged

Fixes a potential race in parallel handler where the goroutine that
closes `whenProcessed` could observe a re-assigned channel for the next
block, leading to an incorrect close and possible double-close panic.

## How this works

`finishBlock()` waits for the channel to be closed by the goroutine,
instead of for the `WaitGroup` that closes _just_ before it, which is
what allowed the race.

## How this was tested

It's not possible to include a specific test. This PR therefore also
includes thorough documentation of every per-block goroutine and when it
is guaranteed to complete.

---------

Co-authored-by: Arran Schlosberg <me@arranschlosberg.com>
2026-02-23 16:05:23 +00:00
..
eventual.go feat: parallel package for precompile pre-processing (#228) 2026-02-18 12:02:13 +00:00
handler.go fix: parallel.wrapper.beforeWork channel race (#266) 2026-02-23 16:05:23 +00:00
parallel.go feat: parallel package for precompile pre-processing (#228) 2026-02-18 12:02:13 +00:00
parallel_test.go feat: parallel package for precompile pre-processing (#228) 2026-02-18 12:02:13 +00:00
precompile.go feat: parallel package for precompile pre-processing (#228) 2026-02-18 12:02:13 +00:00