Type Alias hotshot_types::simple_certificate::UpgradeCertificate

source ·
pub type UpgradeCertificate<TYPES> = SimpleCertificate<TYPES, UpgradeProposalData<TYPES>, UpgradeThreshold>;
Expand description

Type alias for a UpgradeCertificate, which is a SimpleCertificate of UpgradeProposalData

Aliased Type§

struct UpgradeCertificate<TYPES> {
    pub data: UpgradeProposalData<TYPES>,
    vote_commitment: Commitment<UpgradeProposalData<TYPES>>,
    pub view_number: <TYPES as NodeType>::View,
    pub signatures: Option<<<TYPES as NodeType>::SignatureKey as SignatureKey>::QcType>,
    pub _pd: PhantomData<(TYPES, UpgradeThreshold)>,
}

Fields§

§data: UpgradeProposalData<TYPES>

The data this certificate is for. I.e the thing that was voted on to create this Certificate

§vote_commitment: Commitment<UpgradeProposalData<TYPES>>

commitment of all the votes this cert should be signed over

§view_number: <TYPES as NodeType>::View

Which view this QC relates to

§signatures: Option<<<TYPES as NodeType>::SignatureKey as SignatureKey>::QcType>

assembled signature for certificate aggregation

§_pd: PhantomData<(TYPES, UpgradeThreshold)>

phantom data for THRESHOLD and TYPES

Implementations§

source§

impl<TYPES: NodeType> UpgradeCertificate<TYPES>

source

pub async fn is_relevant( &self, view_number: TYPES::View, decided_upgrade_certificate: Arc<RwLock<Option<Self>>>, ) -> Result<()>

Determines whether or not a certificate is relevant (i.e. we still have time to reach a decide)

§Errors

Returns an error when the certificate is no longer relevant

source

pub async fn validate<V: Versions>( upgrade_certificate: &Option<Self>, membership: &RwLock<TYPES::Membership>, epoch: TYPES::Epoch, upgrade_lock: &UpgradeLock<TYPES, V>, ) -> Result<()>

Validate an upgrade certificate.

§Errors

Returns an error when the upgrade certificate is invalid.

source

pub fn upgrading_in(&self, view: TYPES::View) -> bool

Given an upgrade certificate and a view, tests whether the view is in the period where we are upgrading, which requires that we propose with null blocks.