Skip to main content

Module sync

Module sync 

Source
Expand description

Entrypoint for sync engine

Modules§

truncate
The truncation contract: two pure decision rules, applied where the data lives.

Structs§

ScanRange
A range of blocks to be scanned, along with its associated priority.
SyncResult
Returned when crate::sync::sync successfully completes.
SyncStatus
A snapshot of the current state of sync. Useful for displaying the status of sync to a user / consumer.

Enums§

ScanPriority
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 transaction of a given status, adding to the wallet and updating output spend statuses.
set_transactions_failed
Sets transactions associated with list of failed_txids in wallet_transactions to Failed status.
sync
Syncs a wallet to the latest state of the blockchain.
sync_status
Creates a self::SyncStatus from the wallet’s current crate::wallet::SyncState.