Trait CatchupStorage

Source
pub(crate) trait CatchupStorage: Sync {
    // Provided methods
    fn get_accounts(
        &self,
        _instance: &NodeState,
        _height: u64,
        _view: ViewNumber,
        _accounts: &[FeeAccount],
    ) -> impl Send + Future<Output = Result<(FeeMerkleTree, Leaf2)>> { ... }
    fn get_reward_accounts_v1(
        &self,
        _instance: &NodeState,
        _height: u64,
        _view: ViewNumber,
        _accounts: &[RewardAccountV1],
    ) -> impl Send + Future<Output = Result<(RewardMerkleTreeV1, Leaf2)>> { ... }
    fn get_reward_accounts_v2(
        &self,
        _instance: &NodeState,
        _height: u64,
        _view: ViewNumber,
        _accounts: &[RewardAccountV2],
    ) -> impl Send + Future<Output = Result<(RewardMerkleTreeV2, Leaf2)>> { ... }
    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>>> { ... }
}

Provided Methods§

Source

fn get_accounts( &self, _instance: &NodeState, _height: u64, _view: ViewNumber, _accounts: &[FeeAccount], ) -> impl Send + Future<Output = Result<(FeeMerkleTree, Leaf2)>>

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.

If successful, this function also returns the leaf from view, if it is available. This can be used to add the recovered state to HotShot’s state map, so that future requests can get the state from memory rather than storage.

Source

fn get_reward_accounts_v1( &self, _instance: &NodeState, _height: u64, _view: ViewNumber, _accounts: &[RewardAccountV1], ) -> impl Send + Future<Output = Result<(RewardMerkleTreeV1, Leaf2)>>

Source

fn get_reward_accounts_v2( &self, _instance: &NodeState, _height: u64, _view: ViewNumber, _accounts: &[RewardAccountV2], ) -> impl Send + Future<Output = Result<(RewardMerkleTreeV2, Leaf2)>>

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>>>

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 CatchupStorage for MetricsDataSource

Source§

impl CatchupStorage for SqlStorage

Source§

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

Source§

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

Source§

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

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§

impl<T, S> CatchupStorage for ExtensibleDataSource<T, S>
where T: CatchupStorage, S: Sync,

Source§

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

Source§

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

Source§

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

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>>

Implementors§

Source§

impl CatchupStorage for sequencer::api::fs::DataSource

Source§

impl CatchupStorage for sequencer::api::sql::DataSource