Trait hotshot_types::traits::storage::Storage
source · pub trait Storage<TYPES: NodeType>:
Send
+ Sync
+ Clone {
Show 14 methods
// Required methods
fn append_vid<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn append_vid2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn append_da<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, DaProposal<TYPES>>,
vid_commit: <VidSchemeType as VidScheme>::Commit,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn append_da2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, DaProposal2<TYPES>>,
vid_commit: <VidSchemeType as VidScheme>::Commit,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn append_proposal<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn append_proposal2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn record_action<'life0, 'async_trait>(
&'life0 self,
view: TYPES::View,
action: HotShotAction,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_high_qc<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_high_qc2<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_next_epoch_high_qc2<'life0, 'async_trait>(
&'life0 self,
next_epoch_high_qc: NextEpochQuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_undecided_state<'life0, 'async_trait>(
&'life0 self,
leaves: CommitmentMap<Leaf<TYPES>>,
state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_undecided_state2<'life0, 'async_trait>(
&'life0 self,
leaves: CommitmentMap<Leaf2<TYPES>>,
state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_decided_upgrade_certificate<'life0, 'async_trait>(
&'life0 self,
decided_upgrade_certificate: Option<UpgradeCertificate<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn migrate_consensus<'life0, 'async_trait>(
&'life0 self,
convert_leaf: fn(_: Leaf<TYPES>) -> Leaf2<TYPES>,
convert_proposal: fn(_: Proposal<TYPES, QuorumProposal<TYPES>>) -> Proposal<TYPES, QuorumProposal2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
Abstraction for storing a variety of consensus payload datum.
Required Methods§
sourcefn append_vid<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_vid<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a proposal to the stored VID proposals.
sourcefn append_vid2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_vid2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, VidDisperseShare2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a proposal to the stored VID proposals.
sourcefn append_da<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, DaProposal<TYPES>>,
vid_commit: <VidSchemeType as VidScheme>::Commit,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_da<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, DaProposal<TYPES>>,
vid_commit: <VidSchemeType as VidScheme>::Commit,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a proposal to the stored DA proposals.
sourcefn append_da2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, DaProposal2<TYPES>>,
vid_commit: <VidSchemeType as VidScheme>::Commit,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_da2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, DaProposal2<TYPES>>,
vid_commit: <VidSchemeType as VidScheme>::Commit,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a proposal to the stored DA proposals.
sourcefn append_proposal<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_proposal<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a proposal we sent to the store
sourcefn append_proposal2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn append_proposal2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<TYPES, QuorumProposal2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Add a proposal we sent to the store
sourcefn record_action<'life0, 'async_trait>(
&'life0 self,
view: TYPES::View,
action: HotShotAction,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn record_action<'life0, 'async_trait>(
&'life0 self,
view: TYPES::View,
action: HotShotAction,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Record a HotShotAction taken.
sourcefn update_high_qc<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_high_qc<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the current high QC in storage.
sourcefn update_high_qc2<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_high_qc2<'life0, 'async_trait>(
&'life0 self,
high_qc: QuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the current high QC in storage.
sourcefn update_next_epoch_high_qc2<'life0, 'async_trait>(
&'life0 self,
next_epoch_high_qc: NextEpochQuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_next_epoch_high_qc2<'life0, 'async_trait>(
&'life0 self,
next_epoch_high_qc: NextEpochQuorumCertificate2<TYPES>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the current high QC in storage.
sourcefn update_undecided_state<'life0, 'async_trait>(
&'life0 self,
leaves: CommitmentMap<Leaf<TYPES>>,
state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_undecided_state<'life0, 'async_trait>(
&'life0 self,
leaves: CommitmentMap<Leaf<TYPES>>,
state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the currently undecided state of consensus. This includes the undecided leaf chain, and the undecided state.
sourcefn update_undecided_state2<'life0, 'async_trait>(
&'life0 self,
leaves: CommitmentMap<Leaf2<TYPES>>,
state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_undecided_state2<'life0, 'async_trait>(
&'life0 self,
leaves: CommitmentMap<Leaf2<TYPES>>,
state: BTreeMap<TYPES::View, View<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the currently undecided state of consensus. This includes the undecided leaf chain, and the undecided state.
sourcefn update_decided_upgrade_certificate<'life0, 'async_trait>(
&'life0 self,
decided_upgrade_certificate: Option<UpgradeCertificate<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_decided_upgrade_certificate<'life0, 'async_trait>(
&'life0 self,
decided_upgrade_certificate: Option<UpgradeCertificate<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Upgrade the current decided upgrade certificate in storage.
sourcefn migrate_consensus<'life0, 'async_trait>(
&'life0 self,
convert_leaf: fn(_: Leaf<TYPES>) -> Leaf2<TYPES>,
convert_proposal: fn(_: Proposal<TYPES, QuorumProposal<TYPES>>) -> Proposal<TYPES, QuorumProposal2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn migrate_consensus<'life0, 'async_trait>(
&'life0 self,
convert_leaf: fn(_: Leaf<TYPES>) -> Leaf2<TYPES>,
convert_proposal: fn(_: Proposal<TYPES, QuorumProposal<TYPES>>) -> Proposal<TYPES, QuorumProposal2<TYPES>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Migrate leaves from Leaf
to Leaf2
, and proposals from QuorumProposal
to QuorumProposal2