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

netsync: Track peer for requested blocks. #3444

Merged
merged 2 commits into from
Sep 12, 2024

Commits on Sep 11, 2024

  1. netsync: Track best known blocks per peer.

    This reworks the net sync manager block announcement handling to keep
    track of the best known block announced by each peer as determined by
    having the most cumulative proof of work.
    
    The primary motivation is to provide a relatively efficient mechanism to
    discover which blocks are available to download from each peer to
    eventually support downloading multiple blocks in parallel.
    
    It also doubles to increase robustness of best height reporting of each
    peer once the initial headers sync process is complete since the values
    are only updated when the header has more cumulative proof of work
    versus simply having a larger height since, although exceedingly rare in
    practice, it is possible for a chain with fewer blocks to have more
    cumulative work.
    davecgh committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    01dfc85 View commit details
    Browse the repository at this point in the history
  2. netsync: Track peer for requested blocks.

    This modifies the map that tracks requests for blocks to keep track of
    which peer the block was requested from.  This is currently not used
    since blocks are only downloaded from a single sync peer, but it helps
    pave the way to handling downloading blocks from multiple peers in
    parallel.
    davecgh committed Sep 11, 2024
    Configuration menu
    Copy the full SHA
    d2e603b View commit details
    Browse the repository at this point in the history