Trait sc_network::config::WarpSyncProvider
source · pub trait WarpSyncProvider<Block>: Send + Syncwhere
Block: Block,{
// Required methods
fn generate(
&self,
start: <Block as Block>::Hash
) -> Result<EncodedProof, Box<dyn Error + Sync + Send + 'static, Global>>;
fn verify(
&self,
proof: &EncodedProof,
set_id: u64,
authorities: Vec<(Public, u64), Global>
) -> Result<VerificationResult<Block>, Box<dyn Error + Sync + Send + 'static, Global>>;
fn current_authorities(&self) -> Vec<(Public, u64), Global>;
}
Expand description
Warp sync backend. Handles retrieving and verifying warp sync proofs.
Required Methods§
sourcefn generate(
&self,
start: <Block as Block>::Hash
) -> Result<EncodedProof, Box<dyn Error + Sync + Send + 'static, Global>>
fn generate( &self, start: <Block as Block>::Hash ) -> Result<EncodedProof, Box<dyn Error + Sync + Send + 'static, Global>>
Generate proof starting at given block hash. The proof is accumulated until maximum proof size is reached.
sourcefn verify(
&self,
proof: &EncodedProof,
set_id: u64,
authorities: Vec<(Public, u64), Global>
) -> Result<VerificationResult<Block>, Box<dyn Error + Sync + Send + 'static, Global>>
fn verify( &self, proof: &EncodedProof, set_id: u64, authorities: Vec<(Public, u64), Global> ) -> Result<VerificationResult<Block>, Box<dyn Error + Sync + Send + 'static, Global>>
Verify warp proof against current set of authorities.
Get current list of authorities. This is supposed to be genesis authorities when starting sync.