Skip to main content

verify_block_proof

Function verify_block_proof 

Source
pub fn verify_block_proof<'a>(
    proof: &'a TenderdashBlockProof,
    provider: &dyn ContextProvider,
) -> Result<&'a Header, Error>
Expand description

Verify that a quorum committed the block proof describes, and return that block’s header, every field of which the quorum’s signature then covers.

The header must hash to the block hash and the state id of the proof’s block id, and the proof’s signature must be the quorum’s threshold signature over the precommit vote for that block id at the header’s chain, height and the proof’s round. The quorum’s key comes from provider, looked up by the quorum type and hash the proof names and the header’s Core height.

Once the signature verifies, and only then, that Core height is reported to ContextProvider::core_height_verified: the state id covers it, so the quorum signed it.

What this does not show: that the block is recent, or that provider’s quorum was the validator set of that height. Any quorum of the named type whose key provider returns is accepted, as for every other Platform proof.