CanDirectFetch degrades HB compact block relay if blocks are rare #33578

issue Crypt-iQ openend this issue on October 8, 2025
  1. Crypt-iQ commented at 7:30 pm on October 8, 2025: contributor

    CanDirectFetch returns true when a node’s local time is within 200 minutes of that node’s tip time. When receiving a CMPCTBLOCK message from a peer, the node will first check if there is an in-flight block request for the block hash. If the block is not already requested, then the node calls CanDirectFetch to see if we’re close to tip. If CanDirectFetch is false, then the node won’t process the compact block. In the extreme case of no blocks being found on the network for 200 minutes (infinitesimally small), high-bandwidth compact block relay will be degraded. Also possible is if miners set nTime to the minimum that MTP would allow, but honest miners would be able to march MTP forward more. @instagibbs pointed out offline that instead of checking if the tip time is recent, the node could check whether the time in the header is recent. This change would allow a miner to send compact blocks to a node that is not synced and hasn’t requested the block by setting the nTime artificially high, but they would need to produce a valid header with enough PoW while this node is likely also advancing their height at the same time (making this unlikely). This has the nice benefit of not degrading high-bandwidth compact block relay though.

    Motivated by #31962 (comment) and #31962 (comment).

  2. fanquake added the label P2P on Oct 9, 2025


Crypt-iQ

Labels
P2P


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: 2025-10-10 15:13 UTC

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