Module restore

Module restore 

Source
Expand description

Entry point for bulk-loading the RpcStoreSchema’s derived-index CFs from a [RestoreSource].

Registers the three live-object-derivable index pipelines (ObjectByOwner, ObjectByType, Balance) plus the ObjectVersionByCheckpoint and PackageVersions floor rows — and, when the caller’s RestoreLayer opts in, the raw Objects CF — against a single [RestoreDriver] and returns a Service driving the restore through to completion. Once finished, every registered pipeline’s __restore row is Complete and its __watermark row is set to the source’s target, so the regular Indexer::add_pipelines path will accept them for tip indexing.

Restoration is run separately from tip indexing — open the database, call restore_indexes to populate the indexes, then construct an Indexer over the same store to start tip-following.

Constants§

HISTORY_COHORT
The embedded fullnode’s history cohort: the pipelines seeded to the lowest available checkpoint L and backfilled upward from the perpetual store, then followed live.
LIVE_COHORT
The embedded fullnode’s live cohort: the pipelines that restore_indexes bulk-loads and that are restored to the perpetual store’s tip T, then follow live from there. They are bounded by the live object set, so a snapshot restore reproduces them exactly.

Functions§

floor_unrestored_pipelines
After restore_indexes returns, prime the framework state of every pipeline that the restore did not cover so tip indexing resumes from target_watermark.checkpoint_hi_inclusive + 1 across the board instead of replaying from genesis for the raw-chain-data and bitmap pipelines.
restore_indexes
Register every Restore-implementing pipeline opted in by layer on a [RestoreDriver] bound to db / schema and source, then run the resulting Service.
seed_current_epoch_start
Stage a start record for the epoch reflected by the on-chain SuiSystemState in objects, keyed by that epoch.
seed_history_cohort
Seed the framework state for the embedded fullnode’s HISTORY_COHORT after restore_indexes has bulk-loaded the LIVE_COHORT.