Skip to content

Tracking Evidence and Including in Blocks #569

@ebuchman

Description

@ebuchman

Initial outline of how to incorporate this. Related to #338

New Types

  • new type Evidence interface
  • new DuplicateVoteEvidence struct contains two conflicting votes (note votes already contain val address and index) and the validator's public key (needed for verifying signature on old votes)
  • possibly other types: invalid proposals, invalid votes, blocks with invalid txs, unjustified votes. Anything else ?
  • Unjustified votes may be left for post-crisis recovery for now, until we move justification into the real-time consensus

Block Changes:

  • new Evidence field in Block is a []types.Evidence and is usually empty
  • new EvidenceHash data.Bytes in block header.

Consensus Changes:

  • new Evidence field in RoundState is a []types.Evidence
  • on ErrVoteConflictingVotes in tryAddVote, append to the evidence list
  • in createProposalBlock, add all current rs.Evidence to the block via newBlock.AddEvidence(rs.Evidence)
  • in finalizeCommit, remove from rs.Evidence anything that was included in the block

ABCI Changes:

  • BeginBlock takes a beginBlockArgs containing a bitarray of validators who voted in the commit, and a list of validator addresses that have misbehaved (should this include types of misbehaviours?)
  • Info response includes a HeightDiffForEvidence which is the number of heights back a validator should accept evidence for (to prevent spam).

Validation Changes:

  • Need access to pubkey to validate the signature (include in evidence)

Storage Changes:

  • Need to persist evidence to disk before its in a block so we dont lose it (perhaps an extra WAL entry in each finalizeCommit containing the remaining evidence in our ConsensusState ?)
  • Need to index evidence so a given piece of evidence is only submitted once

Reactor Changes:

  • evidence needs to be gossiped to peers quickly
  • make a new reactor that copies the structure of the mempool reactor but just for gossiping evidence

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions