Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

BEEFY: add support for slashing validators signing forking commitments #14744

Draft
wants to merge 44 commits into
base: master
Choose a base branch
from

Commits on Aug 7, 2023

  1. sc-consensus-beefy: add BEEFY fisherman to gossip network

    Signed-off-by: Adrian Catangiu <adrian@parity.io>
    acatangiu authored and Lederstrumpf committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    ee6c180 View commit details
    Browse the repository at this point in the history
  2. sp-consensus-beefy: add invalid fork vote proof and equivalent BeefyApi

    Signed-off-by: Adrian Catangiu <adrian@parity.io>
    acatangiu authored and Lederstrumpf committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    ce03ec8 View commit details
    Browse the repository at this point in the history
  3. pallet-beefy: add stubs for reporting invalid fork votes

    Signed-off-by: Adrian Catangiu <adrian@parity.io>
    acatangiu authored and Lederstrumpf committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    e95e316 View commit details
    Browse the repository at this point in the history
  4. sc-consensus-beefy: fisherman reports invalid votes and justifications

    Signed-off-by: Adrian Catangiu <adrian@parity.io>
    acatangiu authored and Lederstrumpf committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    6651b32 View commit details
    Browse the repository at this point in the history
  5. don't check GRANDPA finality

    GRANDPA finalization proof is not checked, which leads to slashing on
    forks. This is fine since honest validators will not be slashed on the
    chain finalized by GRANDPA, which is the only chain that ultimately
    matters. The only material difference not checking GRANDPA proofs makes
    is that validators are not slashed for signing BEEFY commitments prior
    to the blocks committed to being finalized by GRANDPA. This is fine too,
    since the slashing risk of committing to an incorrect block implies
    validators will only sign blocks they *know* will be finalized by
    GRANDPA.
    Lederstrumpf committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    7f988ef View commit details
    Browse the repository at this point in the history
  6. change primitive: vote -> commitment

    instead of using votes as the underlying primitive, rather use
    commitments since they're a more universal container for signed payloads
    (for instance `SignedCommitment` is also the primitive used by ethereum relayers).
    SignedCommitments are already aggregates of multiple signatures. Will
    use SignedCommitment directly next.
    Lederstrumpf committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    2ab4f5b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    06260f0 View commit details
    Browse the repository at this point in the history
  8. update comments

    Lederstrumpf committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    0642a81 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    c6c36e3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    6078b41 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    5da5631 View commit details
    Browse the repository at this point in the history
  12. EquivocationOffence.{offender->offenders}

    previously assumed equivocation report for singular malicious party.
    With fork equivocations, the expectation should be that most
    equivocation reports will be for multiple simultaneous equivocators.
    Lederstrumpf committed Aug 7, 2023
    Configuration menu
    Copy the full SHA
    98db7cf View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1a45cbe View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    4bd78eb View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    f4496c9 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    61f9a45 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    53a1a88 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2023

  1. Configuration menu
    Copy the full SHA
    7e0ec77 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e8b97b3 View commit details
    Browse the repository at this point in the history
  3. reduce find_mmr_root_digest trait constraint

    reduce from Block to Header: less restrictive.
    Lederstrumpf committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    d5ceb23 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    3b274fa View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8701d7f View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7c2cdfd View commit details
    Browse the repository at this point in the history
  7. remove duplic. in check_{signed_commitment, proof}

    check_signed commitment wasn't complete anyway.
    good to have both interfaces since BeefyVersionedFinalityProof is what's
    passed on the gossip layer, and SignedCommitments are naturally
    reconstructed from multiple sources, for instance submit_initial calls
    on Ethereum.
    Lederstrumpf committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    98eb692 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    91ce777 View commit details
    Browse the repository at this point in the history
  9. remove report_invalid_payload

    redundant vs report_fork_equivocation
    Lederstrumpf committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    3c3fc1c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f2a9745 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    faea8d9 View commit details
    Browse the repository at this point in the history
  12. create_beefy_worker: only push block if at genesis

    No need to trigger first session if chain's already had blocks built,
    such as with generate_blocks_and_sync, which needs to build on genesis.
    If chain is not at genesis and create_beefy_worker, it will panic trying
    to canonicalize an invalid (first) block.
    Lederstrumpf committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    c3df631 View commit details
    Browse the repository at this point in the history
  13. create_beefy_worker: opt. instantiate with TestApi

    can pass in Arc of TestApi now. Required since fisherman reports should be
    pushed to `reported_fork_equivocations`, and should be logged with the
    same instance (see upcoming commit).
    Lederstrumpf committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    f1f2bb0 View commit details
    Browse the repository at this point in the history
  14. push to reported_fork_equivocations

    mock api's `submit_report_fork_equivocation_unsigned_extrinsic` pushes
    reported equivocations to runtime_api.reported_fork_equivocations
    Lederstrumpf committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    b0ed4ae View commit details
    Browse the repository at this point in the history
  15. add generate_fork_equivocation_proof_vote to tests

    Generates fork equivocation proofs from a vote and a header.
    Lederstrumpf committed Aug 9, 2023
    Configuration menu
    Copy the full SHA
    113076c View commit details
    Browse the repository at this point in the history

Commits on Aug 10, 2023

  1. test: Alice snitches on Bob's vote equivocation

    i.e. a fork equivocation triggered by a vote
    Lederstrumpf committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    772e3b8 View commit details
    Browse the repository at this point in the history
  2. store reference to key_store in fisherman

    required for fisherman to *not* report own equivocations - see next commit.
    Lederstrumpf committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    7d21f52 View commit details
    Browse the repository at this point in the history
  3. test: Alice doesn't snitch *own* vote equivocation

    i.e. a fork equivocation triggered by a vote
    Lederstrumpf committed Aug 10, 2023
    Configuration menu
    Copy the full SHA
    6646665 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c97c963 View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2023

  1. Configuration menu
    Copy the full SHA
    e4a39b2 View commit details
    Browse the repository at this point in the history

Commits on Aug 24, 2023

  1. Alice reports Bob & Charlie's signed commitment

    Robert Hambrock authored and Robert Hambrock committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    10540ec View commit details
    Browse the repository at this point in the history
  2. Merge remote-tracking branch 'upstream/master' into rhmb/beefy-slashi…

    …ng-fisherman
    Robert Hambrock authored and Lederstrumpf committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    50cd76e View commit details
    Browse the repository at this point in the history
  3. cleanup

    Lederstrumpf committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    809784b View commit details
    Browse the repository at this point in the history
  4. fmt

    Lederstrumpf committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    37ec6c9 View commit details
    Browse the repository at this point in the history
  5. fixup! cleanup

    Lederstrumpf committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    4c2e0ba View commit details
    Browse the repository at this point in the history
  6. remove superfluous None check

    Co-authored-by: Adrian Catangiu <adrian@parity.io>
    Lederstrumpf and acatangiu committed Aug 24, 2023
    Configuration menu
    Copy the full SHA
    3b655a1 View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2023

  1. Configuration menu
    Copy the full SHA
    a36a01d View commit details
    Browse the repository at this point in the history