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>,
    pub vote_commitment: Commitment<UpgradeProposalData<TYPES>>,
    pub view_number: <TYPES as NodeType>::Time,
    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>::Time

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 fn temp_is_relevant( &self, view_number: TYPES::Time, decided_upgrade_certificate: 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 is_relevant( &self, view_number: TYPES::Time, 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 fn validate( upgrade_certificate: &Option<Self>, quorum_membership: &TYPES::Membership ) -> Result<()>

Validate an upgrade certificate.

§Errors

Returns an error when the upgrade certificate is invalid.

source

pub fn upgrading_in(&self, view: TYPES::Time) -> 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.