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

Implement Lean BEEFY #10882

Merged
merged 59 commits into from
Mar 25, 2022
Merged

Implement Lean BEEFY #10882

merged 59 commits into from
Mar 25, 2022

Commits on Feb 16, 2022

  1. Configuration menu
    Copy the full SHA
    e47067a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f0fc691 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    26887ed View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f56eb0b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f5eab4a View commit details
    Browse the repository at this point in the history

Commits on Feb 17, 2022

  1. beefy voting logic - wip 2

    acatangiu committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    606a5fa View commit details
    Browse the repository at this point in the history
  2. beefy voting logic - wip 3

    acatangiu committed Feb 17, 2022
    Configuration menu
    Copy the full SHA
    e956de9 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    02e85f7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    38c1b48 View commit details
    Browse the repository at this point in the history

Commits on Feb 18, 2022

  1. beefy voting logic - wip 4

    acatangiu committed Feb 18, 2022
    Configuration menu
    Copy the full SHA
    bbd3487 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d236c7f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9d1cbca View commit details
    Browse the repository at this point in the history

Commits on Feb 21, 2022

  1. Configuration menu
    Copy the full SHA
    81b61d7 View commit details
    Browse the repository at this point in the history
  2. fix beefy-gadged tests

    acatangiu committed Feb 21, 2022
    Configuration menu
    Copy the full SHA
    28e0c3d View commit details
    Browse the repository at this point in the history
  3. Apply suggestions from code review

    Co-authored-by: Tomasz Drwięga <tomusdrw@users.noreply.github.com>
    acatangiu and tomusdrw committed Feb 21, 2022
    Configuration menu
    Copy the full SHA
    db02909 View commit details
    Browse the repository at this point in the history

Commits on Feb 22, 2022

  1. Configuration menu
    Copy the full SHA
    d5e84ab View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0a045b1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5b3f28f View commit details
    Browse the repository at this point in the history
  4. fix tests

    acatangiu committed Feb 22, 2022
    Configuration menu
    Copy the full SHA
    ef28ce3 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    6a55e9a View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e35faf0 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    92b4813 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    baab53d View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    5ca12fe View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5e1bf9c View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2022

  1. impl review suggestions

    acatangiu committed Feb 23, 2022
    Configuration menu
    Copy the full SHA
    5664dd9 View commit details
    Browse the repository at this point in the history
  2. beefy gossip: add tests

    acatangiu committed Feb 23, 2022
    Configuration menu
    Copy the full SHA
    0107be0 View commit details
    Browse the repository at this point in the history
  3. beefy rounds: add tests

    acatangiu committed Feb 23, 2022
    Configuration menu
    Copy the full SHA
    8642cba View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2022

  1. Configuration menu
    Copy the full SHA
    adfcd71 View commit details
    Browse the repository at this point in the history
  2. remove async ticker, use specialized sync functions

    split `tick()` coarse function in `handle_finality`, `handle_vote` and
    `do_vote`. The latter is called by the any of the former when the worker
    has to also produce a vote.
    acatangiu committed Feb 25, 2022
    Configuration menu
    Copy the full SHA
    bbfd8b6 View commit details
    Browse the repository at this point in the history

Commits on Feb 28, 2022

  1. Lean BEEFY - simplify beefy worker logic

    Simplified BEEFY worker logic based on the invariant that GRANDPA
    will always finalize 1st block of each new session, meaning BEEFY
    worker is guaranteed to receive finality notification for the
    BEEFY mandatory blocks.
    
    Under these conditions the current design is as follows:
    - session changes are detected based on BEEFY Digest present in
      BEEFY mandatory blocks,
    - on each new session new `Rounds` of voting is created, with old
      rounds being dropped (for gossip rounds, last 3 are still alive
      so votes are still being gossiped),
    - after processing finality for a block, the worker votes if
      a new voting target has become available as a result of said
      block finality processing,
    - incoming votes as well as self-created votes are processed
      and signed commitments are created for completed BEEFY voting
      rounds,
    - the worker votes if a new voting target becomes available
      once a round successfully completes.
    
    On worker startup, the current validator set is retrieved from
    the BEEFY pallet. If it is the genesis validator set, worker
    starts voting right away considering Block #1 as session start.
    
    Otherwise (not genesis), the worker will vote starting with
    mandatory block of the next session.
    
    Later on when we add the BEEFY initial-sync (catch-up) logic,
    the worker will sync all past mandatory blocks Signed Commitments
    and will be able to start voting right away.
    acatangiu committed Feb 28, 2022
    Configuration menu
    Copy the full SHA
    6893234 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d633ce2 View commit details
    Browse the repository at this point in the history

Commits on Mar 1, 2022

  1. pause beefy worker while network is on major sync

    Signed-off-by: acatangiu <adrian@parity.io>
    Co-authored-by: David Salami <Wizdave97>
    acatangiu committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    2e0e0ab View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b7cf889 View commit details
    Browse the repository at this point in the history
  3. sign BEEFY mandatory blocks with ending-session's validator set

    BEEFY mandatory block is the block with header containing the BEEFY
    `AuthoritiesChange` Digest, this block is guaranteed to be finalized
    by GRANDPA.
    
    This session-boundary block is signed by the ending-session's
    validator set. Next blocks will be signed by the new session's
    validator set. This behavior is consistent with what GRANDPA does
    as well.
    acatangiu committed Mar 1, 2022
    Configuration menu
    Copy the full SHA
    1085195 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c172b74 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5c3a588 View commit details
    Browse the repository at this point in the history

Commits on Mar 2, 2022

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

Commits on Mar 3, 2022

  1. add BEEFY worker tests infrastructure

    Single test added so far that verifies BEEFY blocks
    are being correctly finalized through voting consensus.
    acatangiu committed Mar 3, 2022
    Configuration menu
    Copy the full SHA
    2f8c052 View commit details
    Browse the repository at this point in the history

Commits on Mar 7, 2022

  1. Configuration menu
    Copy the full SHA
    5f17950 View commit details
    Browse the repository at this point in the history
  2. fix merge damage

    acatangiu committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    62a1d33 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    14b451c View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    45ecdea View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    624df42 View commit details
    Browse the repository at this point in the history
  6. add more beefy unit tests

    acatangiu committed Mar 7, 2022
    Configuration menu
    Copy the full SHA
    01d06db View commit details
    Browse the repository at this point in the history

Commits on Mar 8, 2022

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

Commits on Mar 9, 2022

  1. fix build

    acatangiu committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    533e2a9 View commit details
    Browse the repository at this point in the history
  2. add test for session init

    acatangiu committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    bc2d555 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    636b3cf View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    90a28c5 View commit details
    Browse the repository at this point in the history
  5. fix BEEFY bug where some older valid round would not be gossiped

    Once a new round was noted, `KnownVotes::is_live()` fn would
    incorrectly return `false` for the last concluded round. This led
    to the peer no longer gossiping votes for the concluded round.
    
    Also drop the limit N on active gossip rounds. In an adversarial
    network, a bad actor could create and gossip N invalid votes with
    round numbers larger than the current correct round number. This
    would lead to votes for correct rounds to no longer be gossiped.
    
    Add regression unit-test.
    acatangiu committed Mar 9, 2022
    Configuration menu
    Copy the full SHA
    253007b View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2022

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

Commits on Mar 22, 2022

  1. Configuration menu
    Copy the full SHA
    95ccf07 View commit details
    Browse the repository at this point in the history
  2. address review comments

    acatangiu committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    9a89f87 View commit details
    Browse the repository at this point in the history
  3. fix clippy

    acatangiu committed Mar 22, 2022
    Configuration menu
    Copy the full SHA
    d807c65 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2022

  1. review suggestions

    acatangiu committed Mar 25, 2022
    Configuration menu
    Copy the full SHA
    94f3b2f View commit details
    Browse the repository at this point in the history
  2. fix known votes memory leak

    acatangiu committed Mar 25, 2022
    Configuration menu
    Copy the full SHA
    06f564a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    c04bcfb View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ad5d8ea View commit details
    Browse the repository at this point in the history