feat(archive): add state archive with historical query serving
What does this PR do?
Introduces the state archive feature: append-file state archive with catalog serving, geth-style archive index, checkpoint-bound recovery, path-state snapshot pipeline, historical query RPC/VM context wiring, and related performance and metrics attribution work. Rebuilt as a fully GPG-signed (Verified) history from feature/archive_block2; content is tree-identical to that branch.
Why are these changes required?
Provides bounded historical state storage and point-query serving for archive data, with recovery semantics aligned to checkpoints.
This PR has been tested by:
- Unit Tests
- Manual Testing
Follow up
Extra details
174 commits, all GPG signed. Branch is based on an older develop point and shows divergence from current develop; reconcile (merge/rebase) before merge if required.
Summary by cubic
Adds an opt-in state archive that persists bounded historical state and serves exact point-in-time and range queries, enabling historical RPC and VM execution without changing current chain processing.
- Stores append-only history body, index, and commit records with checkpoint-bound crash recovery and WAL validation, recovering truncation and restart authorities on boot.
- Publishes immutable serving generations with an incremental exact-27 serving index and a bounded range index from committed history.
- Acquires native LevelDB/RocksDB snapshot leases and engine identities, with request-owned historical read sessions that fail closed.
- Rebuilds a non-consensus path-state root on startup, tracks it through blocks and reorgs, and publishes it in block headers; the rebuild is streamed, parallelized, and memory-bounded.
- Historical VM execution rejects state-changing opcodes and unsupported precompiles via
HistoricalExecutionGuard, with fail-closed fork gates, deadline-bounded pairing checks, and TRC10 balance resolution at the queried state. - Adds offline block replay, resumable HTTP export, archive startup diagnostics, and a proposal for the TVM storage optimization.
- Fixes archive CI regressions, including a
rocksdbVersionbuild property for pinned validation candidates, isolated shared VM request configuration, and legacy tail cache retirement. - Archive is default-off; existing nodes need no migration.