Skip to main content

StateCatchup

Trait StateCatchup 

Source
pub trait StateCatchup: Send + Sync {
Show 17 methods // Required methods fn try_fetch_leaf<'life0, 'async_trait>( &'life0 self, retry: usize, coordinator: EpochMembershipCoordinator<SeqTypes>, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Leaf2>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn try_fetch_accounts<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, fee_merkle_tree_root: FeeMerkleCommitment, accounts: &'life2 [FeeAccount], ) -> Pin<Box<dyn Future<Output = Result<Vec<FeeAccountProof>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn try_remember_blocks_merkle_tree<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, mt: &'life2 mut BlockMerkleTree, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn try_fetch_chain_config<'life0, 'async_trait>( &'life0 self, retry: usize, commitment: Commitment<ChainConfig>, ) -> Pin<Box<dyn Future<Output = Result<ChainConfig>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn try_fetch_reward_merkle_tree_v2<'life0, 'async_trait>( &'life0 self, retry: usize, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV2, accounts: Arc<Vec<RewardAccountV2>>, ) -> Pin<Box<dyn Future<Output = Result<PermittedRewardMerkleTreeV2>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn try_fetch_reward_accounts_v1<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV1, accounts: &'life2 [RewardAccountV1], ) -> Pin<Box<dyn Future<Output = Result<Vec<RewardAccountProofV1>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait; fn try_fetch_state_cert<'life0, 'async_trait>( &'life0 self, retry: usize, epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<LightClientStateUpdateCertificateV2<SeqTypes>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn is_local(&self) -> bool; fn backoff(&self) -> &BackoffParams; fn name(&self) -> String; // Provided methods fn fetch_leaf<'life0, 'async_trait>( &'life0 self, coordinator: EpochMembershipCoordinator<SeqTypes>, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Leaf2>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn fetch_accounts<'life0, 'life1, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, fee_merkle_tree_root: FeeMerkleCommitment, accounts: Vec<FeeAccount>, ) -> Pin<Box<dyn Future<Output = Result<Vec<FeeAccountProof>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn remember_blocks_merkle_tree<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, mt: &'life2 mut BlockMerkleTree, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn fetch_chain_config<'life0, 'async_trait>( &'life0 self, commitment: Commitment<ChainConfig>, ) -> Pin<Box<dyn Future<Output = Result<ChainConfig>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn fetch_reward_merkle_tree_v2<'life0, 'async_trait>( &'life0 self, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV2, accounts: Arc<Vec<RewardAccountV2>>, ) -> Pin<Box<dyn Future<Output = Result<PermittedRewardMerkleTreeV2>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... } fn fetch_reward_accounts_v1<'life0, 'life1, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV1, accounts: Vec<RewardAccountV1>, ) -> Pin<Box<dyn Future<Output = Result<Vec<RewardAccountProofV1>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn fetch_state_cert<'life0, 'async_trait>( &'life0 self, epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<LightClientStateUpdateCertificateV2<SeqTypes>>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait { ... }
}

Required Methods§

Source

fn try_fetch_leaf<'life0, 'async_trait>( &'life0 self, retry: usize, coordinator: EpochMembershipCoordinator<SeqTypes>, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Leaf2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the leaf at the given height without retrying on transient errors.

coordinator resolves the stake tables used to verify the fetched leaf chain, triggering catchup for epochs whose stake table is not yet available.

Source

fn try_fetch_accounts<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, fee_merkle_tree_root: FeeMerkleCommitment, accounts: &'life2 [FeeAccount], ) -> Pin<Box<dyn Future<Output = Result<Vec<FeeAccountProof>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch the given list of accounts without retrying on transient errors.

Source

fn try_remember_blocks_merkle_tree<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, mt: &'life2 mut BlockMerkleTree, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch and remember the blocks frontier without retrying on transient errors.

Source

fn try_fetch_chain_config<'life0, 'async_trait>( &'life0 self, retry: usize, commitment: Commitment<ChainConfig>, ) -> Pin<Box<dyn Future<Output = Result<ChainConfig>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the chain config without retrying on transient errors.

Source

fn try_fetch_reward_merkle_tree_v2<'life0, 'async_trait>( &'life0 self, retry: usize, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV2, accounts: Arc<Vec<RewardAccountV2>>, ) -> Pin<Box<dyn Future<Output = Result<PermittedRewardMerkleTreeV2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the given reward merkle tree without retrying on transient errors.

Source

fn try_fetch_reward_accounts_v1<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV1, accounts: &'life2 [RewardAccountV1], ) -> Pin<Box<dyn Future<Output = Result<Vec<RewardAccountProofV1>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch the given list of reward accounts without retrying on transient errors.

Source

fn try_fetch_state_cert<'life0, 'async_trait>( &'life0 self, retry: usize, epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<LightClientStateUpdateCertificateV2<SeqTypes>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the state certificate for a given epoch without retrying on transient errors.

Source

fn is_local(&self) -> bool

Returns true if the catchup provider is local (e.g. does not make calls to remote resources).

Source

fn backoff(&self) -> &BackoffParams

Returns the backoff parameters for the catchup provider.

Source

fn name(&self) -> String

Returns the name of the catchup provider.

Provided Methods§

Source

fn fetch_leaf<'life0, 'async_trait>( &'life0 self, coordinator: EpochMembershipCoordinator<SeqTypes>, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Leaf2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the leaf at the given height, retrying on transient errors.

Source

fn fetch_accounts<'life0, 'life1, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, fee_merkle_tree_root: FeeMerkleCommitment, accounts: Vec<FeeAccount>, ) -> Pin<Box<dyn Future<Output = Result<Vec<FeeAccountProof>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the given list of accounts, retrying on transient errors.

Source

fn remember_blocks_merkle_tree<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, mt: &'life2 mut BlockMerkleTree, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetch and remember the blocks frontier, retrying on transient errors.

Source

fn fetch_chain_config<'life0, 'async_trait>( &'life0 self, commitment: Commitment<ChainConfig>, ) -> Pin<Box<dyn Future<Output = Result<ChainConfig>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the chain config, retrying on transient errors.

Source

fn fetch_reward_merkle_tree_v2<'life0, 'async_trait>( &'life0 self, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV2, accounts: Arc<Vec<RewardAccountV2>>, ) -> Pin<Box<dyn Future<Output = Result<PermittedRewardMerkleTreeV2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn fetch_reward_accounts_v1<'life0, 'life1, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV1, accounts: Vec<RewardAccountV1>, ) -> Pin<Box<dyn Future<Output = Result<Vec<RewardAccountProofV1>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch the given list of reward accounts, retrying on transient errors.

Source

fn fetch_state_cert<'life0, 'async_trait>( &'life0 self, epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<LightClientStateUpdateCertificateV2<SeqTypes>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Fetch the state certificate for a given epoch, retrying on transient errors.

Implementations on Foreign Types§

Source§

impl<T: StateCatchup + ?Sized> StateCatchup for Arc<T>

Source§

fn try_fetch_leaf<'life0, 'async_trait>( &'life0 self, retry: usize, coordinator: EpochMembershipCoordinator<SeqTypes>, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Leaf2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn fetch_leaf<'life0, 'async_trait>( &'life0 self, coordinator: EpochMembershipCoordinator<SeqTypes>, height: u64, ) -> Pin<Box<dyn Future<Output = Result<Leaf2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn try_fetch_accounts<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, fee_merkle_tree_root: FeeMerkleCommitment, accounts: &'life2 [FeeAccount], ) -> Pin<Box<dyn Future<Output = Result<Vec<FeeAccountProof>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn fetch_accounts<'life0, 'life1, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, fee_merkle_tree_root: FeeMerkleCommitment, accounts: Vec<FeeAccount>, ) -> Pin<Box<dyn Future<Output = Result<Vec<FeeAccountProof>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn try_remember_blocks_merkle_tree<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, mt: &'life2 mut BlockMerkleTree, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn remember_blocks_merkle_tree<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, mt: &'life2 mut BlockMerkleTree, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn try_fetch_chain_config<'life0, 'async_trait>( &'life0 self, retry: usize, commitment: Commitment<ChainConfig>, ) -> Pin<Box<dyn Future<Output = Result<ChainConfig>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn fetch_chain_config<'life0, 'async_trait>( &'life0 self, commitment: Commitment<ChainConfig>, ) -> Pin<Box<dyn Future<Output = Result<ChainConfig>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn try_fetch_reward_merkle_tree_v2<'life0, 'async_trait>( &'life0 self, retry: usize, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV2, accounts: Arc<Vec<RewardAccountV2>>, ) -> Pin<Box<dyn Future<Output = Result<PermittedRewardMerkleTreeV2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn fetch_reward_merkle_tree_v2<'life0, 'async_trait>( &'life0 self, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV2, accounts: Arc<Vec<RewardAccountV2>>, ) -> Pin<Box<dyn Future<Output = Result<PermittedRewardMerkleTreeV2>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn try_fetch_reward_accounts_v1<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, retry: usize, instance: &'life1 NodeState, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV1, accounts: &'life2 [RewardAccountV1], ) -> Pin<Box<dyn Future<Output = Result<Vec<RewardAccountProofV1>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn fetch_reward_accounts_v1<'life0, 'life1, 'async_trait>( &'life0 self, instance: &'life1 NodeState, height: u64, view: ViewNumber, reward_merkle_tree_root: RewardMerkleCommitmentV1, accounts: Vec<RewardAccountV1>, ) -> Pin<Box<dyn Future<Output = Result<Vec<RewardAccountProofV1>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn try_fetch_state_cert<'life0, 'async_trait>( &'life0 self, retry: usize, epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<LightClientStateUpdateCertificateV2<SeqTypes>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn fetch_state_cert<'life0, 'async_trait>( &'life0 self, epoch: u64, ) -> Pin<Box<dyn Future<Output = Result<LightClientStateUpdateCertificateV2<SeqTypes>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn backoff(&self) -> &BackoffParams

Source§

fn name(&self) -> String

Source§

fn is_local(&self) -> bool

Implementors§