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§
Sourcefn get_accounts(
&self,
_instance: &NodeState,
_height: u64,
_view: ViewNumber,
_accounts: &[FeeAccount],
) -> impl Send + Future<Output = Result<(FeeMerkleTree, Leaf2)>>
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.
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)>>
Sourcefn get_frontier(
&self,
_instance: &NodeState,
_height: u64,
_view: ViewNumber,
) -> impl Send + Future<Output = Result<BlocksFrontier>>
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.
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>>>
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.