Files
zeekayandHanzo Dev 3cc64df05e fix(evm): restore the startup-import idempotency guard lost on the way to main
The --import-chain-data startup import is re-entered on every boot, because
production pod specs keep the flag set. Once the chain is already at or above
the file's tip, importBlocksFromFile imports 0 blocks and returns
"no blocks imported (parsed=0)"; Initialize treated that as fatal, so the
C-Chain failed to initialise on every restart of an already-imported node —
/v1/bc/C/rpc 404, node contributes no consensus vote.

This was fixed once. Commit c58d307e ("startup RLP-import consensus-wedge +
idempotency") landed BOTH halves on hotfix/v1.104.9. Only the consensus-refresh
half was forward-ported to main (it is here as "FIX (v1.104.11)"); the
idempotency half was not, and isNothingToImportError does not exist on main.
Verified: git merge-base --is-ancestor c58d307e main => false; the commit is
reachable only from hotfix/v1.104.9 and release/v1.104.9-hotfix.4.

Observed live on lux-testnet 96368 today rolling node v1.36.35, which is built
from evm main: two nodes came back with a dead C-Chain on exactly this error.
The v1.36.24 plugin binary in the same cluster still contains the string
"Startup import: chain already at/above import tip; nothing to import"; the
v1.36.35 binary does not.

Restores isNothingToImportError and the guard, unchanged in meaning from
c58d307e: idempotent ONLY when the chain already holds accepted content
(curHead > 0). On a fresh chain the same messages still mean a genuinely
empty or corrupt file and stay fatal.

startup_import_idempotency_test.go locks the contract, both RLP shapes plus the
fresh-chain safety case. Red without the fix (undefined: isNothingToImportError,
build failed); green with it:
  --- PASS: TestStartupImportIdempotency_AlreadyAtTip (0.02s)
  ok  github.com/luxfi/evm/plugin/evm 1.260s

Co-authored-by: Hanzo Dev <dev@hanzo.ai>
2026-07-28 08:53:52 -07:00
..
2026-05-20 16:24:51 -07:00
2026-05-20 16:24:51 -07:00