Skip to main content

Module justification

Module justification 

Source
Expand description

§Fault attributability

When two ConfirmedBlock certificates exist for different blocks at the same height, the protocol must be able to attribute the fault: name validators that provably misbehaved, using only data the certificates carry. This module provides that data — the JustificationChain — and the algorithm that extracts a proof from it.

Each ValidatedBlock vote signs an unlocking round (see VoteValue), asserting that the voter has not voted to confirm a different block in any round at or above it. A vote only counts if its unlocking round is 0 (no justification needed) or it is justified by a quorum of ValidatedBlock votes for the same block in a round at or above the unlocking round and below r. That quorum is itself justified, so the justifications form a chain of quorums with strictly increasing rounds, rising from the round where the block was first validated (where the unlocking round is 0, represented as None) up to the certifying round.

Votes also sign a justification commitment: the hash of the quorum they cite, as a CommittedQuorum — which itself contains the hash of the quorum below it, and so on down to the fresh proposal. The chain is thus hash-linked, and by signing its head a voter attests that they verified the cited quorum, whose voters in turn attested the quorum below. A certificate is therefore verified with a single signature check over its top quorum plus a hash walk down the carried chain: any quorum contains honest voters, so an invalid link can only sit beneath a quorum whose signers all lied — and signing over an invalid quorum is itself an attributable fault.

A confirmation in a chain’s first round needs no chain: its ConfirmedBlock votes instead carry a first-round attestation (see VoteValue), asserting that no lower round exists at this height. A vote in a lower round together with an attestation in a higher one is therefore itself an attributable fault.

Because every certificate carries this chain (or attestation), two conflicting certificates are self-contained evidence: walking one block’s chain against the other block’s confirmation quorum reaches validators whose unlocking-round claims are contradicted by their own confirmation votes, or the two confirmation quorums intersect in validators that contradicted themselves. See extract_equivocations.

Structs§

CommittedQuorum
A quorum of ValidatedBlock votes as the votes built on top of it commit to it: the block and round it validated, the payload fields its own voters signed — their unlocking round and their commitment to the quorum below — and its signatures.
JustificationChain
The chain of ValidatedBlock quorums that justifies a validated or confirmed block, from the round where the block was first validated up to the certifying round.
JustificationLink
One link in a justification chain: a quorum of validators that all voted to validate the same block in round.
JustifiedConfirmation
A confirmed block’s header together with the justification that makes it self-contained evidence: the round and quorum of ConfirmedBlock votes that finalized it, and the chain of ValidatedBlock quorums for the same block, with its top link in the round the block was confirmed. Only the header travels, never the block body. The header hashes to the value the votes sign (CryptoHash::new(&header)) and carries the chain ID and height that scope the fault. This is the shape a ConfirmedBlockCertificate reduces to for fault attribution.
ValidatedQuorum
A quorum of ValidatedBlock votes for one block, cast in one round under one unlocking round. This is the top of a ValidatedBlockCertificate; comparing two of them in the same round attributes a double-validation fault.

Enums§

EquivocationProof
A self-contained proof that a single validator misbehaved.

Functions§

audit_confirmation
Audits a justified confirmation by re-checking every link of its carried chain — the work certificate verification skips, because each link’s validity is attested by the signatures above it. If a link is not a genuine quorum, returns one InvalidJustification proof per signer of the level above it (the next link, or the confirmation quorum for the top link): they all signed the invalid quorum’s commitment. Returns an empty list if the chain is sound.
extract_double_validations
Extracts proofs that validators validated two different blocks in the same round, which is illegal regardless of the locks: a validator may vote to validate at most one block per round. One proof per validator that signed both quorums; empty if the quorums are for the same block or different rounds (validating conflicting blocks in different rounds is not itself a fault — only confirming is locked).
extract_equivocations
Extracts proofs of equivocation from two ConfirmedBlock certificates that finalize different blocks at the same height: one proof for every validator whose own signatures on the two certificates (including their justification chains) contradict each other.