mirror of
https://github.com/luxfi/evm.git
synced 2026-09-24 00:27:44 +00:00
The first cut registered the cevm checkpoint store over init.DB before initializeDBs ran. That is wrong in standalone-database mode: initializeDBs points the chain state at a separate standalone DB (vm.db), so checkpoints would land in the base avaDB, not alongside the chain state. It also predated vm.db being set. Fix: register AFTER initializeDBs, over vm.db — the RAW durable base DB (NOT the versiondb), standalone-DB-aware (vm.db == the standalone chain-state DB when UseStandaloneDatabase is set). This is exactly the pattern warpDB / validatorsDB use (prefixdb.New(prefix, db) over the raw base) for state that need not commit atomically with the last accepted block: cevm checkpoints now persist on WRITE and survive a restart, with no versiondb pending-commit dependency — the durability gap noted when the feature landed. Still opt-in (cevm-resident-store, default false), inert without -tags cevm, and safe by construction (a missing/stale checkpoint falls back to the Go-dump seed; every root is verified). Default plugin build green; resident lazy-reload test green. Co-authored-by: Hanzo Dev <[email protected]>