mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
A node was discarding 948 builds every ten minutes on a HEALTHY chain, and had spent 41 hours doing it on a halted one. The cause was a barrier this fork dropped. Upstream holds the builder until the transaction pool has finished resetting onto the accepted head: `for !needToBuild() || pendingPoolUpdate()`, where pendingPoolUpdate is chainHeadHash != mempoolHeadHash. We kept the loop and deleted the second half, along with both hashes and the two setters that maintain them. Without it the builder wakes in the window between a block being accepted and the pool reorganising onto it. The pool still lists what that block just mined, so needToBuild says there is work; the miner assembles against the new head, finds nothing left, and returns an empty block; the anti-empty policy discards it. Nothing changed, so the builder wakes again — immediately, and forever, until the pool happens to reset. Restored rather than reinvented: the same two hashes, the same comparison, the same loop condition, fed by the pool's own reorg event on one side and Accept on the other. Both are initialised to the current head so a fresh or restarting node starts converged instead of gated shut. This also removes proposeEmptyBuild, added earlier today. It built whenever the pool was non-empty, which is exactly the spin state — it would have turned 948 discarded builds into 948 empty blocks on chain. The barrier removes the condition it was guarding against, so the guard goes. Co-authored-by: Hanzo Dev <[email protected]>