mirror of
https://github.com/luxfi/coreth.git
synced 2026-07-27 13:54:46 +00:00
The startup --import-chain-data path (importRLPBlocks) updated the on-disk
acceptedBlockDB to the imported tip but never refreshed the in-memory consensus
chain.State, which initChainState() had already set to the pre-import genesis
tip. Result: on the FIRST import boot the consensus layer stays at height 0
while the EVM head is the imported tip, and the proposervm wedges
("BuildBlock: preferred block not fetchable", preferred=empty id) until a
restart re-reads acceptedBlockDB.
The admin_importChain RPC path already calls the post-import callback
(eth/api_admin.go) which refreshes chain.State.lastAcceptedBlock and notifies
the consensus engine. The startup path now calls the same tested, nil-safe
callback (CallPostImportCallback).
Empirically proven on lux-testnet 96368 / node v1.36.17: first import boot
wedged at tip 251; with this the first boot finalizes past the import tip with
no restart. Imported-state execution / block-251 stateRoot is unchanged.
Co-authored-by: Hanzo Dev <dev@hanzo.ai>