Expand description
Entrypoint for sync engine
Modules§
- truncate
- The truncation contract: two pure decision rules, applied where the data lives.
Structs§
- Scan
Range - A range of blocks to be scanned, along with its associated priority.
- Sync
Result - Returned when
crate::sync::syncsuccessfully completes. - Sync
Status - A snapshot of the current state of sync. Useful for displaying the status of sync to a user / consumer.
Enums§
- Scan
Priority - Scanning range priority levels.
Constants§
- CHECK_
NEW_ BLOCKS_ INTERVAL - Interval in seconds at which continuous sync checks for newly mined blocks if the mempool stream has not signalled one.
- MAX_
REORG_ ALLOWANCE - The deepest chain reorganization the wallet tolerates, and the
repository’s single source of truth for that depth. It mirrors the
validator’s finalization boundary, zebra’s
zebra_chain::parameters::constants::MAX_BLOCK_REORG_HEIGHT(1000 since zebra 5.2.0), the depth below its tip at which zebra finalizes a block and follows no fork beneath it. Zebra crates are not dependencies of this workspace, so the value is pinned to its upstream by documentation rather than import. If zebra ever moves its boundary, this constant is the one place that follows it. - MAX_
SHARDTREE_ CHECKPOINTS - The maximum total number of checkpoints a shard tree persists.
- SHARDTREE_
CHECKPOINT_ ROLLING_ WINDOW_ SIZE - The maximum number of checkpoints in the rolling window for re-org handling and chain tip anchor spends.
Functions§
- add_
scan_ targets - API for targetted scanning.
- reset_
spends - Resets the spending transaction field of all outputs that were previously spent but became unspent due to a spending transactions becoming invalid.
- scan_
pending_ transaction - Scans a pending
transactionof a givenstatus, adding to the wallet and updating output spend statuses. - set_
transactions_ failed - Sets transactions associated with list of
failed_txidsinwallet_transactionstoFailedstatus. - sync
- Syncs a wallet to the latest state of the blockchain.
- sync_
status - Creates a
self::SyncStatusfrom the wallet’s currentcrate::wallet::SyncState.