go-ethereum/miner
Jonny Rhea 4f75049ea0
miner: avoid unnecessary work after payload resolution (#33943)
In `buildPayload()`, the background goroutine uses a `select` to wait on
the recommit timer, the stop channel, and the end timer. When both
`timer.C` and `payload.stop` are ready simultaneously, Go's `select`
picks a case non-deterministically. This means the loop can enter the
`timer.C` case and perform an unnecessary `generateWork` call even after
the payload has been resolved.

Add a non-blocking check of `payload.stop` at the top of the `timer.C`
case to exit immediately when the payload has already been delivered.
2026-03-04 11:58:51 +08:00
..
miner.go cmd/utils: fix dumpconfig (#33302) 2025-11-28 10:13:01 +01:00
miner_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
ordering.go core/txpool, eth, miner: retrieve plain and blob txs separately (#29026) 2024-02-20 11:37:23 +02:00
ordering_test.go core/txpool, miner: speed up blob pool pending retrievals (#29008) 2024-02-19 15:59:40 +02:00
payload_building.go miner: avoid unnecessary work after payload resolution (#33943) 2026-03-04 11:58:51 +08:00
payload_building_test.go core: consolidate BlockChain constructor options (#31925) 2025-06-19 12:21:15 +02:00
pending.go all: update license comments and AUTHORS (#31133) 2025-02-05 23:01:17 +01:00
worker.go miner: enable trie prefetcher in block builder (#33945) 2026-03-04 10:17:07 +08:00