Introducing a new way to review your PRs.

Read the announcement

celestiaorg / celestia-core

A fork of CometBFT

View on GitHub

20 documents · Updated Nov 23, 2026

docs / evidence-and-accountability

Evidence and accountability

Evidence is the node's way to carry a proof of validator misbehavior from detection to the application. It lets nodes verify and share faults, give them priority in a block, and report the result so the application can decide whether to punish the validator. The transaction admission and indexing page covers transaction flow; this page covers the separate evidence path.

Accountability model

Evidence supports network accountability without making the node the judge or the punisher. CometBFT detects and verifies faults, commits the proof on chain, and sends a reduced report to the application. The application owns the policy that turns that report into a penalty such as slashing.

The system aims to provide two properties:

  • Safety: only evidence that matches the chain state and its signatures can enter a block.
  • Timeliness: evidence must reach a block while the offending validator can still be held accountable.

Evidence is best-effort. A group with at least one-third of voting power can censor evidence, so its absence does not prove that no fault occurred.

Evidence forms

The system carries two proof forms. DuplicateVoteEvidence proves that one validator signed two different blocks for the same height, round, and vote type. LightClientAttackEvidence carries a conflicting light block and can identify validators involved in a lunatic or equivocation attack; an amnesia attack can be detected without identifying which validators were at fault.

Both forms have a stable height, time, byte form, and hash. The hash gives the pool a way to recognize one proof, while the byte form allows the proof to cross the network and be stored in a block.

References: types/evidence.go• L20-30 types/evidence.go• L34-43 types/evidence.go• L204-217 proto/…/evidence.proto• L11-38

Detection and verification

Detection sources

Consensus detects duplicate votes while it observes validator votes. It reports the conflicting pair to the evidence service instead of immediately broadcasting it, because the final block time and the historical validator set must be attached after the height is committed.

The light client detector compares a primary provider with witness providers. When it finds a verified divergence, it forms a light-client attack proof and sends it to the provider that can submit it to a full node. This protects the light client while giving a full node enough data to verify the fault itself.

References: consensus/state.go• L80-86 consensus/state.go• L2460-2476 evidence/pool.go• L252-268 evidence/pool.go• L758-850 light/detector.go• L225-291 light/detector.go• L424-441

Verification boundary

The evidence pool is the trust boundary for incoming proof. Local detection, RPC submission, peer gossip, and evidence found in a block all reach the pool before the node treats the proof as valid.

Verification first checks the proof's time against the stored block and rejects proof that is too old. It then applies rules for the proof form:

ProofMain verification question
Duplicate voteDid the same validator sign two different blocks with valid signatures at one height, round, and vote type?
Light-client attackDoes the conflicting block pass the required light-block checks while differing from the node's trusted history, and do its signatures support the claimed attack?

The pool also checks the validator set and voting power at the offense height. For light-client proof, it rebuilds the expected set of Byzantine validators and checks the supplied list. For duplicate votes, it keeps one canonical proof per validator and offense height. Valid variants that differ only in unsigned fields are normalized rather than treated as invalid; a variant with a bad signature or inconsistent signed data still fails verification.

Fuzz coverage exercises the same boundary with valid and altered duplicate-vote and light-client proofs. It checks that malformed wire data is rejected, valid proof is independently accepted, repeated proof and same-validator-height variants do not enlarge the pending set, and pending proof names only validators whose signatures support the claim. It also checks the peer-message boundary: an edited timestamp before year one cannot be encoded as wire data, so that input cannot arrive from a peer. The saved fuzz cases preserve these boundary inputs for later runs.

References: evidence/pool.go• L187-249 evidence/pool.go• L270-322 evidence/pool.go• L428-531 evidence/verify.go• L13-98 evidence/verify.go• L100-160 evidence/verify.go• L162-289 evidence/pool_test.go• L575-710 evidence/pool_test.go• L714-748 evidence/pool_fuzz_test.go• L542-576 evidence/pool_fuzz_test.go• L584-677 evidence/pool_fuzz_test.go• L709-834 evidence/…/edited-vote-time-before-year-one• L1-3 evidence/…/edited-vote-time-before-year-one-2• L1-3 evidence/…/edited-vote-time-before-year-one-3• L1-3 evidence/…/same-validator-height-variants• L1-3

Evidence pool

Pool states

The evidence pool is the shared holding area between detection, peer propagation, block proposal, and application reporting. It keeps pending proof available for proposal and keeps a smaller committed marker so the same proof cannot be committed again.

The main state transitions are:

  1. A source submits proof to the pool.
  2. The pool verifies it and stores it as pending.
  3. Consensus reads pending proof for a proposal.
  4. A committed block moves the proof to the committed set.
  5. Later state updates remove proof that has expired.

Duplicate pending proof is ignored. Duplicate-vote proof is also limited to one pending entry for each validator and offense height, even when variants use another round, vote type, block pair, or hash. A block proposal is stricter: it rejects proof that is repeated in the same block or was already committed. Once any duplicate-vote proof for that validator and height is committed, later variants are ignored and other pending variants are removed.

References: evidence/pool.go• L28-78 evidence/pool.go• L139-185 evidence/pool.go• L187-249 evidence/pool.go• L533-623 evidence/pool_test.go• L714-878 evidence/pool_test.go• L967-996

Consensus handoff

Consensus reports conflicting votes before the block time is final. The pool holds those pairs until the next state update, then uses the correct block time and validator set to form complete duplicate-vote proof. This keeps the proof tied to the historical chain state rather than to the time when a node first observed the fault.

The pool canonicalizes the resulting proof and applies the same one-entry rule used for peer evidence. Other proof sources can enter the same pool directly through the node's evidence interface. The common pool gives all sources the same verification, storage, proposal, and expiry rules.

References: evidence/pool.go• L98-130 evidence/pool.go• L170-186 evidence/pool.go• L252-268 evidence/pool.go• L758-850 state/services.go• L53-62 rpc/…/evidence.go• L12-29

Propagation

Peer gossip

The evidence reactor gives verified pending proof a dedicated peer path. When a peer connects, the reactor walks the pool and sends proof that is newer than the peer's height and still inside the configured age window.

The reactor repeats the pending set at a fixed interval until a proof is committed or expires. It does not send proof to a peer that is behind the offense height, and it skips proof that is too old for that peer. A peer that sends invalid proof is treated differently from one that sends a storage or processing error: invalid proof can cause the peer to be stopped.

Incoming evidence lists are processed as a trust boundary as well. Undecodable lists stop the peer before any proof is stored. Decoded proof is added in order until the first invalid item, while duplicates and already handled proof do not add new pending entries. Valid non-canonical duplicate-vote proof is accepted and stored in canonical form. A valid variant for a validator and height is verified but does not create a second pending entry. Fuzz coverage checks both raw lists and edited, re-encoded lists. An edit that creates a timestamp before year one fails before transmission, so the reactor only handles evidence that can exist on the peer wire. Every item left pending must still be supported by the implicated validators' signatures.

Integration tests model several connected reactors and confirm that pending proof reaches peers, proof is withheld from peers that are behind, valid duplicate-vote variants do not disconnect the sender, and committed proof is not sent again when a peer catches up. They also check that a stopped peer ends its broadcast routine.

This diagram shows how verified pending proof reaches both peer pools and block proposals before commitment removes it from gossip.

flowchart LR
    D[Detection source] --> P[Evidence pool]
    P --> V[Verify and store pending proof]
    V --> G[Evidence reactor]
    G --> N[Peer evidence pools]
    P --> C[Consensus proposal]
    C --> B[Committed block]
    B --> P

This diagram shows that gossip and block inclusion use the same verified pending set. A proof does not become accountable only because it was received from a peer; it must pass the receiving node's pool checks.

References: evidence/reactor.go• L16-30 evidence/reactor.go• L32-45 evidence/reactor.go• L68-97 evidence/reactor.go• L104-165 evidence/reactor.go• L167-214 evidence/reactor_test.go• L36-39 evidence/reactor_test.go• L70-115 evidence/reactor_test.go• L111-190 evidence/reactor_test.go• L193-278 evidence/pool_fuzz_test.go• L519-576 evidence/pool_fuzz_test.go• L637-671 evidence/pool_fuzz_test.go• L709-834 evidence/…/edited-vote-time-before-year-one• L1-3 evidence/…/edited-vote-time-before-year-one-2• L1-3 evidence/…/edited-vote-time-before-year-one-3• L1-3 evidence/…/same-validator-height-variants• L1-3

Block inclusion

Proposal priority

Block creation reserves space for pending evidence before it selects transactions. The evidence byte limit comes from consensus parameters, and the remaining block space is available to transaction data. This priority makes a valid proof compete with transactions only for the space that remains after evidence is considered.

When a node receives a block, it checks the evidence list before it accepts the block for voting or execution. A cached pending proof can make this check faster, but the block still must satisfy the pool's uniqueness and proof rules.

References: state/execution.go• L126-176 state/execution.go• L278-329 state/validation.go• L177-180 types/block.go• L304-343

Application report

After a block is executed and committed, the block executor updates the evidence pool. The pool marks the block's proof as committed, removes it from pending gossip, and creates the application-facing report.

The application receives one simplified misbehavior record per identified validator. The record includes the evidence type, validator data, offense height, offense time, and total voting power. It does not include the full proof. For an amnesia attack, the current evidence form identifies no malicious validator, so it produces no validator-level report for punishment.

The application decides what the report means for validator state. The node supplies the verified fact; it does not apply the penalty.

References: evidence/pool.go• L98-130 types/evidence.go• L80-91 types/evidence.go• L221-234 types/evidence.go• L249-297 state/execution.go• L370-378 state/execution.go• L440-461

Evidence expiration

Age limits

Evidence remains useful only while the offense is recent enough to be acted on. Consensus parameters define both a maximum block age and a maximum time age. The pool treats evidence as expired only when it is older than both limits.

Expiration affects each stage of the path:

  • Verification rejects proof with no stored offense block or proof whose time does not match that block.
  • Peer gossip skips proof that is too old for the peer.
  • Pool updates remove expired pending proof and its in-memory duplicate-vote index entry.
  • Pool updates remove expired committed duplicate-vote markers as well as expired pending proof.

The age rules protect validators from late claims while keeping enough time for proof to travel through the network and reach a block.

References: types/params.go• L56-61 types/params.go• L110-116 evidence/verify.go• L26-46 evidence/verify.go• L307-315 evidence/pool.go• L356-366 evidence/pool.go• L670-737 evidence/pool_test.go• L880-901 evidence/pool_test.go• L1094-1114 evidence/pool_test.go• L1212-1232

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to evidence fields or hashes must preserve protobuf decoding, pool uniqueness, block evidence hashes, and peer messages.
  • Changes to duplicate-vote identity must preserve the one-entry rule for a validator and height across rounds, vote types, hashes, restarts, and commit races.
  • Changes to validator history or block retention must preserve the historical data needed to verify the offense height and block time.
  • Changes to evidence age parameters must keep pool pruning, peer eligibility, duplicate-vote commit-marker pruning, and block verification aligned.
  • Changes to evidence composition must keep validator extraction aligned with the reduced report sent to the application.
  • Changes to proposal byte accounting must preserve evidence priority and leave the correct space for transaction data.
  • Changes to evidence reactor handling must preserve the distinction between invalid peer proof and temporary pool or storage errors.

Important failure modes

TriggerConsequenceGuard
The node lacks the offense block metadata or historical validator setIt cannot verify the proof and does not accept itRetain the required block and validator history for the evidence age window
A proof has a time that differs from its offense blockThe pool rejects the proof before type-specific checksBuild application-facing time from the canonical block time
Evidence exceeds the block evidence byte limitThe block is invalid and cannot proceed to voting or executionKeep consensus evidence limits consistent across proposal and validation
The same proof appears twice in a blockThe block is rejected as non-uniqueCheck evidence hashes within the proposed list and against committed markers
A valid duplicate-vote variant arrives for a validator and height that already has evidenceThe variant is ignored, or the existing pending proof is used, so no second punishment entry is createdIdentify duplicate votes by validator and height rather than by proof hash alone
Evidence expires before inclusionThe pool removes it and peers stop relaying itSubmit and propagate proof within both configured age limits
A light-client proof claims the wrong Byzantine validatorsThe pool rejects the accountability report even if the conflicting block is validDerive the validator list from the verified commits and validator set
A peer sends undecodable or invalid evidenceThe reactor stops the peer and does not accept the invalid suffix of the listDecode the full list and process proof through pool verification in order
Edited evidence cannot be encoded because a timestamp is before year oneThe peer message is never sent and the reactor does not process that inputTreat wire encoding as a boundary before peer verification

Key files

FileWhy to read it
types/evidence.goDefines the evidence contract, supported proof forms, hashes, and application conversion.
proto/…/evidence.protoDefines the wire and block representation for evidence.
evidence/pool.goConnects verification, pending and committed state, proposal supply, consensus handoff, canonicalization, and pruning.
evidence/verify.goExplains the trust checks for duplicate votes and light-client attacks.
evidence/reactor.goShows the dedicated peer propagation path and age checks.
evidence/reactor_test.goShows the network-level guarantees for broadcast, peer-height filtering, variant handling, committed-proof suppression, and reactor shutdown.
evidence/pool_fuzz_test.goExercises wire decoding, proof mutation, peer punishment, duplicate handling, block checks, and validator-signature accountability across the evidence path.
evidence/testdata/fuzz/FuzzEvidenceReactorReceive/Preserves reactor inputs that test the boundary between edited evidence, same-validator-height variants, and valid peer wire data.
light/detector.goShows how a light client detects divergence and forms light-client attack proof.
consensus/state.goShows where consensus reports conflicting votes to the evidence service.
state/execution.goShows evidence priority in proposals, block validation, application delivery, and pool updates.
types/params.goDefines the consensus controls for evidence age and block size.
rpc/…/evidence.goShows the external submission path for evidence.