referrerpolicy=no-referrer-when-downgrade

Trait sc_network_sync::strategy::warp::WarpSyncProvider

source ·
pub trait WarpSyncProvider<Block: BlockT>: Send + Sync {
    // Required methods
    fn generate(
        &self,
        start: Block::Hash,
    ) -> Result<EncodedProof, Box<dyn Error + Send + Sync>>;
    fn verify(
        &self,
        proof: &EncodedProof,
        set_id: SetId,
        authorities: AuthorityList,
    ) -> Result<VerificationResult<Block>, Box<dyn Error + Send + Sync>>;
    fn current_authorities(&self) -> AuthorityList;
}
Expand description

Warp sync backend. Handles retrieving and verifying warp sync proofs.

Required Methods§

source

fn generate( &self, start: Block::Hash, ) -> Result<EncodedProof, Box<dyn Error + Send + Sync>>

Generate proof starting at given block hash. The proof is accumulated until maximum proof size is reached.

source

fn verify( &self, proof: &EncodedProof, set_id: SetId, authorities: AuthorityList, ) -> Result<VerificationResult<Block>, Box<dyn Error + Send + Sync>>

Verify warp proof against current set of authorities.

source

fn current_authorities(&self) -> AuthorityList

Get current list of authorities. This is supposed to be genesis authorities when starting sync.

Implementors§