mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
Second fresh-net block-production bug, exposed once WaitForEvent was unblocked. The hand-rolled node notification bridge calls WaitForEvent in a tight loop and builds a block the instant any tx is pending — with no pacing (ava's proposervm, which Lux does not wrap, normally provides it). Two consequences: 1. Block gas cost: cost = parentCost + step·(TargetBlockRate − elapsed). A block built immediately after its parent (elapsed≈0) requires step·TargetBlockRate (e.g. 200000·2 = 400000) of tips to pass verifyBlockFee. A large deploy covers it; a single small transfer (~100000) cannot → BuildBlock fails → the tx never mines. 2. Equivocation: with all 5 validators building instantly off slightly different mempool snapshots, they produce different blocks at the same height; two can each gather an α-of-K cert → conflicting finality certs → Logger.Crit → the node exits(1) and crash-loops. Fix: pace waitForEvent to parent.Time + TargetBlockRate (the point at which the block gas cost decays back to the parent's level, 0 from genesis), mirroring the timing ava's coreth builder applies. Small-tip txs now mine, and the ~rate-long window lets the mempool gossip-converge so validators build the IDENTICAL block (same ID, one cert) instead of racing to finalize conflicting blocks. Retry floor 1ms→100ms so a failed BuildBlock cannot hot-loop.