Trait CatchupDataSource

Source
pub(crate) trait CatchupDataSource: Sync {
    // Required methods
    fn get_accounts(
        &self,
        instance: &NodeState,
        height: u64,
        view: ViewNumber,
        accounts: &[FeeAccount],
    ) -> impl Send + Future<Output = Result<FeeMerkleTree>>;
    fn get_frontier(
        &self,
        instance: &NodeState,
        height: u64,
        view: ViewNumber,
    ) -> impl Send + Future<Output = Result<BlocksFrontier>>;
    fn get_chain_config(
        &self,
        commitment: Commitment<ChainConfig>,
    ) -> impl Send + Future<Output = Result<ChainConfig>>;
    fn get_leaf_chain(
        &self,
        height: u64,
    ) -> impl Send + Future<Output = Result<Vec<Leaf2>>>;
    fn get_reward_accounts_v2(
        &self,
        instance: &NodeState,
        height: u64,
        view: ViewNumber,
        accounts: &[RewardAccountV2],
    ) -> impl Send + Future<Output = Result<RewardMerkleTreeV2>>;
    fn get_reward_accounts_v1(
        &self,
        instance: &NodeState,
        height: u64,
        view: ViewNumber,
        accounts: &[RewardAccountV1],
    ) -> impl Send + Future<Output = Result<RewardMerkleTreeV1>>;

    // Provided methods
    fn get_account(
        &self,
        instance: &NodeState,
        height: u64,
        view: ViewNumber,
        account: FeeAccount,
    ) -> impl Send + Future<Output = Result<AccountQueryData>> { ... }
    fn get_reward_account_v2(
        &self,
        instance: &NodeState,
        height: u64,
        view: ViewNumber,
        account: RewardAccountV2,
    ) -> impl Send + Future<Output = Result<RewardAccountQueryDataV2>> { ... }
    fn get_reward_account_v1(
        &self,
        instance: &NodeState,
        height: u64,
        view: ViewNumber,
        account: RewardAccountV1,
    ) -> impl Send + Future<Output = Result<RewardAccountQueryDataV1>> { ... }
}

Required Methods§

Source

fn get_accounts( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[FeeAccount], ) -> impl Send + Future<Output = Result<FeeMerkleTree>>

Get the state of the requested accounts.

The state is fetched from a snapshot at the given height and view, which must correspond! height is provided to simplify lookups for backends where data is not indexed by view. This function is intended to be used for catchup, so view should be no older than the last decided view.

Source

fn get_frontier( &self, instance: &NodeState, height: u64, view: ViewNumber, ) -> impl Send + Future<Output = Result<BlocksFrontier>>

Get the blocks Merkle tree frontier.

The state is fetched from a snapshot at the given height and view, which must correspond! height is provided to simplify lookups for backends where data is not indexed by view. This function is intended to be used for catchup, so view should be no older than the last decided view.

Source

fn get_chain_config( &self, commitment: Commitment<ChainConfig>, ) -> impl Send + Future<Output = Result<ChainConfig>>

Source

fn get_leaf_chain( &self, height: u64, ) -> impl Send + Future<Output = Result<Vec<Leaf2>>>

Source

fn get_reward_accounts_v2( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[RewardAccountV2], ) -> impl Send + Future<Output = Result<RewardMerkleTreeV2>>

Source

fn get_reward_accounts_v1( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[RewardAccountV1], ) -> impl Send + Future<Output = Result<RewardMerkleTreeV1>>

Provided Methods§

Source

fn get_account( &self, instance: &NodeState, height: u64, view: ViewNumber, account: FeeAccount, ) -> impl Send + Future<Output = Result<AccountQueryData>>

Get the state of the requested account.

The state is fetched from a snapshot at the given height and view, which must correspond! height is provided to simplify lookups for backends where data is not indexed by view. This function is intended to be used for catchup, so view should be no older than the last decided view.

Source

fn get_reward_account_v2( &self, instance: &NodeState, height: u64, view: ViewNumber, account: RewardAccountV2, ) -> impl Send + Future<Output = Result<RewardAccountQueryDataV2>>

Get the state of the requested account.

The state is fetched from a snapshot at the given height and view, which must correspond! height is provided to simplify lookups for backends where data is not indexed by view. This function is intended to be used for catchup, so view should be no older than the last decided view.

Source

fn get_reward_account_v1( &self, instance: &NodeState, height: u64, view: ViewNumber, account: RewardAccountV1, ) -> impl Send + Future<Output = Result<RewardAccountQueryDataV1>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<N: ConnectedNetwork<PubKey>, V: Versions, P: SequencerPersistence, D: CatchupStorage + Send + Sync> CatchupDataSource for ExtensibleDataSource<D, ApiState<N, P, V>>

Source§

async fn get_accounts( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[FeeAccount], ) -> Result<FeeMerkleTree>

Source§

async fn get_frontier( &self, instance: &NodeState, height: u64, view: ViewNumber, ) -> Result<BlocksFrontier>

Source§

async fn get_chain_config( &self, commitment: Commitment<ChainConfig>, ) -> Result<ChainConfig>

Source§

async fn get_leaf_chain(&self, height: u64) -> Result<Vec<Leaf2>>

Source§

async fn get_reward_accounts_v2( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[RewardAccountV2], ) -> Result<RewardMerkleTreeV2>

Source§

async fn get_reward_accounts_v1( &self, instance: &NodeState, height: u64, view: ViewNumber, accounts: &[RewardAccountV1], ) -> Result<RewardMerkleTreeV1>

Implementors§