pub trait SequencerPersistence:
Sized
+ Send
+ Sync
+ Clone
+ 'static
+ DhtPersistentStorage
+ MembershipPersistence {
Show 48 methods
// Required methods
fn migrate_reward_merkle_tree_v2<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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;
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 get_state_cert_by_epoch<'life0, 'async_trait>(
&'life0 self,
epoch: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<LightClientStateUpdateCertificateV2<SeqTypes>>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_state_cert<'life0, 'async_trait>(
&'life0 self,
epoch: u64,
cert: LightClientStateUpdateCertificateV2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn persist_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,
deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
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 load_anchor_leaf<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(Leaf2, QuorumCertificate2<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,
epoch: Option<EpochNumber>,
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 migrate_x25519_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn migrate_anchor_leaf<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn migrate_da_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn migrate_vid_shares<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn migrate_quorum_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn migrate_quorum_certificates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn store_next_epoch_quorum_certificate<'life0, 'async_trait>(
&'life0 self,
high_qc: NextEpochQuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn load_next_epoch_quorum_certificate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<NextEpochQuorumCertificate2<SeqTypes>>>> + 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 store_epoch_root<'life0, 'async_trait>(
&'life0 self,
epoch: EpochNumber,
block_header: <SeqTypes as NodeType>::BlockHeader,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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, Option<Arc<CertificatePair<SeqTypes>>>)>> + 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,
deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
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,
_deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
_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 migrate_storage<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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_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 { ... }
}Required Methods§
fn migrate_reward_merkle_tree_v2<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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 get_state_cert_by_epoch<'life0, 'async_trait>(
&'life0 self,
epoch: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<LightClientStateUpdateCertificateV2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_state_cert_by_epoch<'life0, 'async_trait>(
&'life0 self,
epoch: u64,
) -> Pin<Box<dyn Future<Output = Result<Option<LightClientStateUpdateCertificateV2<SeqTypes>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get a state certificate for an epoch.
Sourcefn insert_state_cert<'life0, 'async_trait>(
&'life0 self,
epoch: u64,
cert: LightClientStateUpdateCertificateV2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert_state_cert<'life0, 'async_trait>(
&'life0 self,
epoch: u64,
cert: LightClientStateUpdateCertificateV2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert a state certificate for a given epoch.
Sourcefn persist_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,
deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
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 persist_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,
deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
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,
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.
fn load_anchor_leaf<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<(Leaf2, QuorumCertificate2<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,
epoch: Option<EpochNumber>,
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 migrate_x25519_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn migrate_anchor_leaf<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn migrate_da_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn migrate_quorum_proposals<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn migrate_quorum_certificates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store_next_epoch_quorum_certificate<'life0, 'async_trait>(
&'life0 self,
high_qc: NextEpochQuorumCertificate2<SeqTypes>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn load_next_epoch_quorum_certificate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<NextEpochQuorumCertificate2<SeqTypes>>>> + 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 store_epoch_root<'life0, 'async_trait>(
&'life0 self,
epoch: EpochNumber,
block_header: <SeqTypes as NodeType>::BlockHeader,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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, Option<Arc<CertificatePair<SeqTypes>>>)>> + 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, Option<Arc<CertificatePair<SeqTypes>>>)>> + 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 Some((decided_view, deciding_qc)) 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,
deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
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,
deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
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,
_deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
_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,
_deciding_qc: Option<Arc<CertificatePair<SeqTypes>>>,
_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.
fn migrate_storage<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + 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_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,
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.