pub trait Quorum: Sync {
// Required methods
fn verify_static<V: StaticVersionType + 'static>(
&self,
qc: &Certificate,
) -> impl Send + Future<Output = Result<()>>;
fn verify_cert2_static<V: StaticVersionType + 'static>(
&self,
cert2: &Certificate2<SeqTypes>,
) -> impl Send + Future<Output = Result<()>>;
fn epoch_height(&self) -> u64;
// Provided methods
fn verify(
&self,
cert: &Certificate,
version: Version,
) -> impl Send + Future<Output = Result<()>> { ... }
fn verify_cert2(
&self,
cert2: &Certificate2<SeqTypes>,
version: Version,
) -> impl Send + Future<Output = Result<()>> { ... }
fn verify_next_epoch(
&self,
cert: &Certificate,
version: Version,
) -> impl Send + Future<Output = Result<()>> { ... }
fn verify_next_epoch_static<V: StaticVersionType + 'static>(
&self,
qc: &Certificate,
) -> impl Send + Future<Output = Result<()>> { ... }
fn verify_qc_chain_and_get_version<'a>(
&self,
leaf: &Leaf2,
certs: impl Send + IntoIterator<Item = &'a Certificate, IntoIter: Send>,
) -> impl Send + Future<Output = Result<ChainVersions>> { ... }
}Required Methods§
Sourcefn verify_static<V: StaticVersionType + 'static>(
&self,
qc: &Certificate,
) -> impl Send + Future<Output = Result<()>>
fn verify_static<V: StaticVersionType + 'static>( &self, qc: &Certificate, ) -> impl Send + Future<Output = Result<()>>
Same as verify, but with the version as a type-level parameter.
Sourcefn verify_cert2_static<V: StaticVersionType + 'static>(
&self,
cert2: &Certificate2<SeqTypes>,
) -> impl Send + Future<Output = Result<()>>
fn verify_cert2_static<V: StaticVersionType + 'static>( &self, cert2: &Certificate2<SeqTypes>, ) -> impl Send + Future<Output = Result<()>>
Same as verify_cert2, but with the version as a type-level parameter.
Sourcefn epoch_height(&self) -> u64
fn epoch_height(&self) -> u64
The number of blocks in an epoch.
Provided Methods§
Sourcefn verify(
&self,
cert: &Certificate,
version: Version,
) -> impl Send + Future<Output = Result<()>>
fn verify( &self, cert: &Certificate, version: Version, ) -> impl Send + Future<Output = Result<()>>
Check a threshold signature on a quorum certificate.
Sourcefn verify_cert2(
&self,
cert2: &Certificate2<SeqTypes>,
version: Version,
) -> impl Send + Future<Output = Result<()>>
fn verify_cert2( &self, cert2: &Certificate2<SeqTypes>, version: Version, ) -> impl Send + Future<Output = Result<()>>
Verify a new protocol Certificate2 threshold signature.
Sourcefn verify_next_epoch(
&self,
cert: &Certificate,
version: Version,
) -> impl Send + Future<Output = Result<()>>
fn verify_next_epoch( &self, cert: &Certificate, version: Version, ) -> impl Send + Future<Output = Result<()>>
Check a threshold signature on a certificate signed by the epoch after this quorum’s.
Sourcefn verify_next_epoch_static<V: StaticVersionType + 'static>(
&self,
qc: &Certificate,
) -> impl Send + Future<Output = Result<()>>
fn verify_next_epoch_static<V: StaticVersionType + 'static>( &self, qc: &Certificate, ) -> impl Send + Future<Output = Result<()>>
Same as verify_next_epoch, but with the version as a
type-level parameter.
The default delegates to verify_static, which is only appropriate
for quorums that do not distinguish epochs (such as test mocks). Implementations backed by
per-epoch stake tables must override this to verify against the next epoch’s quorum.
Sourcefn verify_qc_chain_and_get_version<'a>(
&self,
leaf: &Leaf2,
certs: impl Send + IntoIterator<Item = &'a Certificate, IntoIter: Send>,
) -> impl Send + Future<Output = Result<ChainVersions>>
fn verify_qc_chain_and_get_version<'a>( &self, leaf: &Leaf2, certs: impl Send + IntoIterator<Item = &'a Certificate, IntoIter: Send>, ) -> impl Send + Future<Output = Result<ChainVersions>>
Verify that QCs are signed, form a chain starting from leaf, with a particular protocol
version.
This check forms the bulk of the commit rule for both HotStuff and HotStuff2.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".