Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect node is behind #3373

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Commits on Oct 16, 2024

  1. Detect if our node is behind the majority

    This commit adds a mechanism that detects that our node is behind the majority of the stake.
    The intent is to later have this mechanism be the trigger for the bootstrapping mechanism.
    Currently, the bootstrapping mechanism is only active upon node boot, but not at a later point.
    
    The mechanism works in the following manner:
    
    - It intercepts the snowman engine's Chits message handling, and upon every reception of the Chits message,
      the mechanism that detects if the node is a straggler (a node with a ledger height behind the rest) may be invoked,
      if it wasn't invoked too recently.
    - The mechanism draws statistics from the validators known to it, and computes the latest accepted block for each validator.
    - The mechanism then proceeds to determine which blocks are pending to be processed (a block pending to be processed was not accepted).
    - The mechanism then collects a snapshot of all blocks it hasn't accepted yet, and the amount of stake that has accepted this block.
    - The mechanism then waits for its next invocation, in order to see if it has accepted blocks correlated with enough stake.
    - If there is too much stake that has accepted blocks by other nodes correlated to it that the node hasn't accepted,
      then the mechanism announces the node is behind, and returns the time period between the two invocations.
    - The mechanism sums the total time it has detected the node is behind, until a sampling concludes it is not behind, and then
      the total time is nullified.
    
    Signed-off-by: Yacov Manevich <[email protected]>
    yacovm committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    77ff361 View commit details
    Browse the repository at this point in the history
  2. Address code review comments

    Signed-off-by: Yacov Manevich <[email protected]>
    yacovm committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    dac0382 View commit details
    Browse the repository at this point in the history
  3. Address code review comments II

    Signed-off-by: Yacov Manevich <[email protected]>
    yacovm committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    4d014c0 View commit details
    Browse the repository at this point in the history
  4. Address code review comments III

    Signed-off-by: Yacov Manevich <[email protected]>
    yacovm committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    0228a65 View commit details
    Browse the repository at this point in the history
  5. Address code review comments IV

    Signed-off-by: Yacov Manevich <[email protected]>
    yacovm committed Oct 16, 2024
    Configuration menu
    Copy the full SHA
    eb68c75 View commit details
    Browse the repository at this point in the history

Commits on Oct 17, 2024

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