mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
The 0x9999 DEX value path is identity-gated: the asset resolver refuses to admit a market unless the running chain's identity matches. core.NewBlockChain re-executes accepted blocks during construction (loadLastState recovery / populateMissingTries backfill), but the identity was only bound onto the chain AFTER eth.New returned (vm.go SetConsensusContext) — so an unclean restart after a 0x9999 swap re-executed that block with networkID 0 / C-Chain Empty, reverted the committed swap, failed ValidateState, and the node could not boot. Fix is purely timing: hand NewBlockChain the *runtime.Runtime the VM already holds (eth.Settings.ChainRuntime -> core.NewBlockChain) and bind the consensus context BEFORE reprocess. No new identity type — networkID/chainID already live on runtime.Runtime; the context is just the last-mile transport to geth's ConsensusContext API. stdlib runtime aliased stdruntime in blockchain.go.