mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
Decomplect the build-pacing decision out of waitForEvent into a pure nextBuildTime(earliestBuild, lastBuildTime) function (no clock read), so the logic the network-halt fix depends on is deterministically testable. The wall-clock comparison stays in waitForEvent. TestNextBuildTime covers all 5 cases (first-build paces to target rate; past earliestBuild builds immediately; target rate dominates retry floor; retry floor prevents hot-loop; boundary tie-break). TestNextBuildTime_NeverEarlier ThanTargetRate locks the invariant the fix relies on: the next build is NEVER scheduled before parent.Time+TargetBlockRate, so a too-early high-fee block can never re-introduce the small-tip stall.