pub async fn sync<DB, R>(
config: Config<DB, R>,
) -> Result<DB, Error<DB::Family, R::Error, DB::Digest>>where
DB: Database,
R: CompactDbResolver<DB>,Expand description
Create/open a compact-storage database and initialize it from compact authenticated state.
Unlike streaming sync, compact sync jumps directly to target.leaf_count. This path
authenticates the final commit and frontier state for the target root rather than replaying a
retained operation range.
Verification order:
- Fetch the proposed compact state for
target. - Verify the final commit proof against
target.root. - Rebuild the compact frontier in memory and compare its root against
target.root. - Build the compact db from that already-validated state.
- Assert the db root still matches and persist the state.
Any failure leaves the local compact db unopened or unchanged on disk.