pub trait SequencerPersistence:
Sized
+ Send
+ Sync
+ Clone
+ 'static
+ MembershipPersistence
+ StateCertPersistence {
Show 39 methods
// Required methods
fn load_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<NetworkConfig>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn save_config<'life0, 'life1, 'async_trait>(
&'life0 self,
cfg: &'life1 NetworkConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_latest_acted_view<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_restart_view<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_quorum_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<ViewNumber, Proposal<SeqTypes, QuorumProposalWrapper<SeqTypes>>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_quorum_proposal<'life0, 'async_trait>(
&'life0 self,
view: ViewNumber,
) -> Pin<Box<dyn Future<Output = Result<Proposal<SeqTypes, QuorumProposalWrapper<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_vid_share<'life0, 'async_trait>(
&'life0 self,
view: ViewNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Proposal<SeqTypes, VidDisperseShare<SeqTypes>>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_da_proposal<'life0, 'async_trait>(
&'life0 self,
view: ViewNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Proposal<SeqTypes, DaProposal2<SeqTypes>>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_upgrade_certificate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<UpgradeCertificate<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_start_epoch_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<InitializerEpochInfo<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_state_cert<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<LightClientStateUpdateCertificateV2<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn persist_decided_leaves<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
leaf_chain: impl 'async_trait + IntoIterator<Item = (&'life1 LeafInfo<SeqTypes>, CertificatePair<SeqTypes>)> + Send,
cert2: Option<&'life2 Certificate2<SeqTypes>>,
consumer: &'life3 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn load_anchor_leaf<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(Leaf2, CertificatePair<SeqTypes>)>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn append_vid<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<SeqTypes, VidDisperseShare<SeqTypes>>,
) -> 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<SeqTypes, DaProposal<SeqTypes>>,
vid_commit: VidCommitment,
) -> 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: ViewNumber,
action: HotShotAction,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn append_quorum_proposal2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<SeqTypes, QuorumProposalWrapper<SeqTypes>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn store_eqc<'life0, 'async_trait>(
&'life0 self,
_high_qc: QuorumCertificate2<SeqTypes>,
_next_epoch_high_qc: NextEpochQuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_eqc<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(QuorumCertificate2<SeqTypes>, NextEpochQuorumCertificate2<SeqTypes>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn store_upgrade_certificate<'life0, 'async_trait>(
&'life0 self,
decided_upgrade_certificate: Option<UpgradeCertificate<SeqTypes>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn append_da2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<SeqTypes, DaProposal2<SeqTypes>>,
vid_commit: VidCommitment,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn store_drb_result<'life0, 'async_trait>(
&'life0 self,
epoch: EpochNumber,
drb_result: DrbResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn store_drb_input<'life0, 'async_trait>(
&'life0 self,
drb_input: DrbInput,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_drb_input<'life0, 'async_trait>(
&'life0 self,
epoch: u64,
) -> Pin<Box<dyn Future<Output = Result<DrbInput>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn add_state_cert<'life0, 'async_trait>(
&'life0 self,
state_cert: LightClientStateUpdateCertificateV2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn enable_metrics(&mut self, metrics: &dyn Metrics);
// Provided methods
fn into_catchup_provider(
self,
_backoff: BackoffParams,
) -> Result<Arc<dyn StateCatchup>> { ... }
fn load_consensus_state<'life0, 'async_trait>(
&'life0 self,
state: NodeState,
upgrade: Upgrade,
) -> Pin<Box<dyn Future<Output = Result<(HotShotInitializer<SeqTypes>, Option<ViewNumber>)>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn persist_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event: &'life1 CoordinatorEvent<SeqTypes>,
consumer: &'life2 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Option<ViewNumber>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn append_decided_leaves<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
decided_view: ViewNumber,
leaf_chain: impl 'async_trait + IntoIterator<Item = (&'life1 LeafInfo<SeqTypes>, CertificatePair<SeqTypes>)> + Send,
consumer: &'life2 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait { ... }
fn process_decided_events<'life0, 'life1, 'async_trait>(
&'life0 self,
decided_view: ViewNumber,
_consumer: &'life1 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn append_cert2<'life0, 'async_trait>(
&'life0 self,
_view: ViewNumber,
_cert2: Certificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn load_cert2<'life0, 'async_trait>(
&'life0 self,
_view: ViewNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Certificate2<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn append_high_qc2<'life0, 'async_trait>(
&'life0 self,
_high_qc: QuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn load_high_qc2<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QuorumCertificate2<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn append_boundary_qc2<'life0, 'async_trait>(
&'life0 self,
_qc: QuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn load_boundary_qc2<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QuorumCertificate2<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn load_anchor_view<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ViewNumber>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn append_next_epoch_high_qc2<'life0, 'async_trait>(
&'life0 self,
_next_epoch_high_qc: NextEpochQuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Required Methods§
Sourcefn load_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<NetworkConfig>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_config<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<NetworkConfig>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the orchestrator config from storage.
Returns None if no config exists (we are joining a network for the first time). Fails with
Err if it could not be determined whether a config exists or not.
Sourcefn save_config<'life0, 'life1, 'async_trait>(
&'life0 self,
cfg: &'life1 NetworkConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_config<'life0, 'life1, 'async_trait>(
&'life0 self,
cfg: &'life1 NetworkConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Save the orchestrator config to storage.
Sourcefn load_latest_acted_view<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_latest_acted_view<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the highest view saved with save_voted_view.
Sourcefn load_restart_view<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_restart_view<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the view to restart from.
Sourcefn load_quorum_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<ViewNumber, Proposal<SeqTypes, QuorumProposalWrapper<SeqTypes>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_quorum_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<ViewNumber, Proposal<SeqTypes, QuorumProposalWrapper<SeqTypes>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the proposals saved by consensus
fn load_quorum_proposal<'life0, 'async_trait>(
&'life0 self,
view: ViewNumber,
) -> Pin<Box<dyn Future<Output = Result<Proposal<SeqTypes, QuorumProposalWrapper<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_da_proposal<'life0, 'async_trait>(
&'life0 self,
view: ViewNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Proposal<SeqTypes, DaProposal2<SeqTypes>>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_upgrade_certificate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<UpgradeCertificate<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_start_epoch_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<InitializerEpochInfo<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_state_cert<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<LightClientStateUpdateCertificateV2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn persist_decided_leaves<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
leaf_chain: impl 'async_trait + IntoIterator<Item = (&'life1 LeafInfo<SeqTypes>, CertificatePair<SeqTypes>)> + Send,
cert2: Option<&'life2 Certificate2<SeqTypes>>,
consumer: &'life3 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn persist_decided_leaves<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
leaf_chain: impl 'async_trait + IntoIterator<Item = (&'life1 LeafInfo<SeqTypes>, CertificatePair<SeqTypes>)> + Send,
cert2: Option<&'life2 Certificate2<SeqTypes>>,
consumer: &'life3 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Persist decided leaves only (the critical, must-not-lag half of a decide; also the
anchor for restart recovery). Query-service ingestion and GC are deferred to
process_decided_events. Backends with no replayable storage
(e.g. NoStorage) may instead forward decide events to consumer here.
cert2 finalizes the newest leaf of leaf_chain. It is persisted atomically with the
leaves, so process_decided_events never sees that leaf
without it.
fn load_anchor_leaf<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(Leaf2, CertificatePair<SeqTypes>)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_vid<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<SeqTypes, VidDisperseShare<SeqTypes>>,
) -> 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<SeqTypes, DaProposal<SeqTypes>>,
vid_commit: VidCommitment,
) -> 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: ViewNumber,
action: HotShotAction,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_quorum_proposal2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<SeqTypes, QuorumProposalWrapper<SeqTypes>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Sourcefn store_eqc<'life0, 'async_trait>(
&'life0 self,
_high_qc: QuorumCertificate2<SeqTypes>,
_next_epoch_high_qc: NextEpochQuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_eqc<'life0, 'async_trait>(
&'life0 self,
_high_qc: QuorumCertificate2<SeqTypes>,
_next_epoch_high_qc: NextEpochQuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the current eQC in storage.
Sourcefn load_eqc<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(QuorumCertificate2<SeqTypes>, NextEpochQuorumCertificate2<SeqTypes>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_eqc<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<(QuorumCertificate2<SeqTypes>, NextEpochQuorumCertificate2<SeqTypes>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the current eQC from storage.
fn store_upgrade_certificate<'life0, 'async_trait>(
&'life0 self,
decided_upgrade_certificate: Option<UpgradeCertificate<SeqTypes>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_da2<'life0, 'life1, 'async_trait>(
&'life0 self,
proposal: &'life1 Proposal<SeqTypes, DaProposal2<SeqTypes>>,
vid_commit: VidCommitment,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn store_drb_result<'life0, 'async_trait>(
&'life0 self,
epoch: EpochNumber,
drb_result: DrbResult,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_drb_input<'life0, 'async_trait>(
&'life0 self,
drb_input: DrbInput,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_drb_input<'life0, 'async_trait>(
&'life0 self,
epoch: u64,
) -> Pin<Box<dyn Future<Output = Result<DrbInput>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_state_cert<'life0, 'async_trait>(
&'life0 self,
state_cert: LightClientStateUpdateCertificateV2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn enable_metrics(&mut self, metrics: &dyn Metrics)
Provided Methods§
Sourcefn into_catchup_provider(
self,
_backoff: BackoffParams,
) -> Result<Arc<dyn StateCatchup>>
fn into_catchup_provider( self, _backoff: BackoffParams, ) -> Result<Arc<dyn StateCatchup>>
Use this storage as a state catchup backend, if supported.
Sourcefn load_consensus_state<'life0, 'async_trait>(
&'life0 self,
state: NodeState,
upgrade: Upgrade,
) -> Pin<Box<dyn Future<Output = Result<(HotShotInitializer<SeqTypes>, Option<ViewNumber>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_consensus_state<'life0, 'async_trait>(
&'life0 self,
state: NodeState,
upgrade: Upgrade,
) -> Pin<Box<dyn Future<Output = Result<(HotShotInitializer<SeqTypes>, Option<ViewNumber>)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the latest known consensus state.
Returns an initializer to resume HotShot from the latest saved state (or start from genesis, if there is no saved state). Also returns the anchor view number, which can be used as a reference point to process any events which were not processed before a previous shutdown, if applicable,.
Sourcefn persist_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event: &'life1 CoordinatorEvent<SeqTypes>,
consumer: &'life2 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Option<ViewNumber>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn persist_event<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
event: &'life1 CoordinatorEvent<SeqTypes>,
consumer: &'life2 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Option<ViewNumber>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Decode a consensus decide event and persist its leaves, for the consensus event loop.
Returns the decided view on a decide so the caller can wake a background task to run
process_decided_events; None otherwise.
This is the persist-only half of a decide: query-service ingestion and GC are deferred to
process_decided_events. Tests that want the synchronous
persist-then-process behavior use append_decided_leaves.
Sourcefn append_decided_leaves<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
decided_view: ViewNumber,
leaf_chain: impl 'async_trait + IntoIterator<Item = (&'life1 LeafInfo<SeqTypes>, CertificatePair<SeqTypes>)> + Send,
consumer: &'life2 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn append_decided_leaves<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
decided_view: ViewNumber,
leaf_chain: impl 'async_trait + IntoIterator<Item = (&'life1 LeafInfo<SeqTypes>, CertificatePair<SeqTypes>)> + Send,
consumer: &'life2 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Append decided leaves to persistent storage and emit a corresponding event.
consumer will be sent a Decide event containing all decided leaves in persistent storage
up to and including view. If available in persistent storage, full block payloads and VID
info will also be included for each leaf.
Once the new decided leaves have been processed, old data up to view will be garbage
collected The consumer’s handling of this event is a prerequisite for the completion of
garbage collection: if the consumer fails to process the event, no data is deleted. This
ensures that, if called repeatedly, all decided leaves ever recorded in consensus storage
will eventually be passed to the consumer.
Note that the converse is not true: if garbage collection fails, it is not guaranteed that the consumer hasn’t processed the decide event. Thus, in rare cases, some events may be processed twice, or the consumer may get two events which share a subset of their data. Thus, it is the consumer’s responsibility to make sure its handling of each leaf is idempotent.
If the consumer fails to handle the new decide event, it may be retried, or simply postponed until the next decide, at which point all persisted leaves from the failed GC run will be included in the event along with subsequently decided leaves.
This functionality is useful for keeping a separate view of the blockchain in sync with the
consensus storage. For example, the consumer could be used for moving data from consensus
storage to long-term archival storage.
Convenience combinator: persist_decided_leaves then
process_decided_events. Production drives the two halves on
separate tasks; tests and back-compat callers use this synchronous form.
Sourcefn process_decided_events<'life0, 'life1, 'async_trait>(
&'life0 self,
decided_view: ViewNumber,
_consumer: &'life1 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn process_decided_events<'life0, 'life1, 'async_trait>(
&'life0 self,
decided_view: ViewNumber,
_consumer: &'life1 (impl 'async_trait + EventConsumer + 'static),
) -> Pin<Box<dyn Future<Output = Result<Option<ViewNumber>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Generate decide events for consumer from persisted leaves, then GC processed data.
Cursor-driven (e.g. last_processed_view): advances only on success, so it may lag
consensus without losing data.
Returns the highest view confirmed processed (the cursor), or None if nothing was
processed, so the caller can track real progress. Errors are propagated; the failed range
is retried on the next call.
Default returns Some(decided_view): backends with no replayable storage (e.g. NoStorage)
forward events synchronously in persist_decided_leaves and are always caught up here.
Sourcefn append_cert2<'life0, 'async_trait>(
&'life0 self,
_view: ViewNumber,
_cert2: Certificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_cert2<'life0, 'async_trait>(
&'life0 self,
_view: ViewNumber,
_cert2: Certificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist cert2 for the given view.
Sourcefn load_cert2<'life0, 'async_trait>(
&'life0 self,
_view: ViewNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Certificate2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_cert2<'life0, 'async_trait>(
&'life0 self,
_view: ViewNumber,
) -> Pin<Box<dyn Future<Output = Result<Option<Certificate2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load a persisted cert2 by view, if any.
Sourcefn append_high_qc2<'life0, 'async_trait>(
&'life0 self,
_high_qc: QuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_high_qc2<'life0, 'async_trait>(
&'life0 self,
_high_qc: QuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist the new protocol’s locked QC, written before each phase-2 vote.
Implementations must apply this as an atomic monotonic compare-and-set: a write whose view is not newer than the stored one is a no-op. This lets concurrent, retried writes race without ever regressing the persisted lock.
Sourcefn load_high_qc2<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QuorumCertificate2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_high_qc2<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QuorumCertificate2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the persisted locked QC, if any.
Sourcefn append_boundary_qc2<'life0, 'async_trait>(
&'life0 self,
_qc: QuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_boundary_qc2<'life0, 'async_trait>(
&'life0 self,
_qc: QuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Persist the new protocol’s latest epoch boundary certificate: the own
Certificate1 of the last block of an epoch, at the block’s view.
Implementations must apply this as an atomic monotonic compare-and-set,
ordered by epoch, then view, like Self::append_high_qc2.
Sourcefn load_boundary_qc2<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QuorumCertificate2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_boundary_qc2<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<QuorumCertificate2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Load the persisted boundary certificate, if any.
fn load_anchor_view<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<ViewNumber>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn append_next_epoch_high_qc2<'life0, 'async_trait>(
&'life0 self,
_next_epoch_high_qc: NextEpochQuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".