mirror of
https://github.com/luxfi/vm.git
synced 2026-08-07 13:41:24 +00:00
BlockWrapper.Accept mutated the wrapper's caches and lastAcceptedBlock and only then called bw.Block.Accept(ctx). If the inner VM refused or failed to commit, the wrapper had already recorded the block as decided and moved lastAcceptedBlock to it — a wrapper-vs-inner split that survives the process and reads on the next boot as: proposervm finality index (height N) is BEHIND the inner VM tip (height M) ... This cannot be repaired locally which is precisely the wedge that killed the C-Chain on mainnet luxd-0 and luxd-2. Reject had the same ordering. Present in BOTH wrappers: chain/block.go and components/chain/block.go. Both now accept/reject the underlying block first and mutate only on success, so a failed inner Accept leaves the block merely verified and the engine free to retry or re-decide. Tests (chain/block_accept_ordering_test.go), fault-injecting an inner Accept failure and asserting lastAcceptedBlock, verifiedBlocks and decidedBlocks are ALL untouched, plus a positive control that a clean Accept advances all three, plus the Reject mirror. Proven in both directions: the test FAILS against the original ordering and PASSES with the fix. Reported by the owner from a review of the public mirrors; confirmed present in this tree. Co-authored-by: Hanzo Dev <dev@hanzo.ai>