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

Fix tiebreak when loading blocks from disk (and add tests for comparing chain ties) #29640

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

Commits on Mar 25, 2024

  1. Configuration menu
    Copy the full SHA
    2336fd3 View commit details
    Browse the repository at this point in the history
  2. test: add functional test for complex reorgs

    sipa authored and sr-gi committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    b9bebd0 View commit details
    Browse the repository at this point in the history
  3. Set the same best tip on restart if two candidates have the same work

    Before this, if we had two (or more) same work tip candidates and restarted our node,
    it could be the case that the block set as tip after bootstrap didn't match the one
    before stopping. That's because the work and `nSequenceId` of both block will be the same
    (the latter is only kept in memory), so the active chain after restart would have depended
    on what tip candidate was loaded first.
    
    This makes sure that we are consistent over reboots.
    sr-gi committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    c7e663d View commit details
    Browse the repository at this point in the history
  4. test: Adds block tiebreak over restarts tests

    Adds tests to make sure we are consistent on activating the same chain over
    a node restart if two or more candidates have the same work when the node is shutdown
    sr-gi committed Mar 25, 2024
    Configuration menu
    Copy the full SHA
    e4cf8d0 View commit details
    Browse the repository at this point in the history