Skip to main content

UpgradeCertificate2

Type Alias UpgradeCertificate2 

Source
pub type UpgradeCertificate2<TYPES> = SimpleCertificate<TYPES, UpgradeProposalData2, UpgradeThreshold>;
Expand description

Type alias for an upgrade certificate binding its epoch, a SimpleCertificate of UpgradeProposalData2

Aliased Type§

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

Fields§

§data: UpgradeProposalData2

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

§vote_commitment: Commitment<UpgradeProposalData2>

commitment of all the votes this cert should be signed over

§view_number: ViewNumber

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> UpgradeCertificate2<TYPES>

Source

pub fn strip_epoch(self) -> UpgradeCertificate<TYPES>

The certificate as a Leaf2 carries it, whose UpgradeCertificate field predates the epoch. The epoch leaves data but stays bound in vote_commitment and the signatures, which the leaf commitment covers. Only Self::restore_epoch with the carrier’s epoch makes the certificate verifiable again.

Source

pub fn restore_epoch( cert: UpgradeCertificate<TYPES>, epoch: EpochNumber, ) -> Self

Inverse of Self::strip_epoch: the certificate a Leaf2 carries, restored with the epoch its carrier was proposed in.