[Draft] net: introduce block tracker to retry to download blocks after failure #35079

pull optout21 wants to merge 6 commits into bitcoin:master from optout21:block-dl changing 8 files +330 −10
  1. optout21 commented at 3:46 AM on April 15, 2026: contributor
  2. net: FetchBlock, disallow requesting blocks from network limited peers
    This is in preparation for block tracker.
    a7fa33dca2
  3. net: FetchBlock, disallow requesting block to the same peer multiple times bd8da8129f
  4. net: introduce BlockRequestTracker b9b3677bf8
  5. rpc: getblockfrompeer, connect block tracking mechanism and add coverage
    If the initial block fetching process fails, the p2p layer will be in
    charge of fetching the block from 'any' connected peer.
    Re-trying to download the block from different peers until it is
    received.
    9371fa57a2
  6. rpc: getblockfrompeer, introduce fetch from "any" peer functionality
    If no 'peer_id' is provided, 'getblockfrompeer' will delegate
    the peer selection to the internal block downloading logic.
    d216f8ea18
  7. rpc: getblockfrompeer, add one-shot block requests capability
    Allowing what we had before, a single block request with no automatic
    retry nor tracking mechanism.
    1e36bbf6cd
  8. optout21 closed this on Apr 15, 2026

  9. DrahtBot commented at 3:46 AM on April 15, 2026: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

    <!--5faf32d7da4f0f540f40219e4f7537a3-->

    LLM Linter (✨ experimental)

    Possible typos and grammar issues:

    • on-demamnd -> on-demand [Misspelling in the comment “Used to track on-demamnd block downloads …”, which harms clarity.]

    Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):

    • pruned_node.getblockfrompeer(pruned_block_9, not_responding_peer_id, False) in test/functional/rpc_getblockfrompeer.py

    <sup>2026-04-15 03:46:53</sup>

  10. optout21 commented at 3:50 AM on April 15, 2026: contributor

    Opened here by mistake (still private work-in-progress in my fork repo for now, https://github.com/optout21/bitcoin/pull/4).


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-21 09:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me