Orphan blocks are not stored to disk. #4154

issue rebroad opened this issue on May 9, 2014
  1. rebroad commented at 1:51 AM on May 9, 2014: contributor

    This is a feature request, which I'm willing to code myself, but wanting to solicit opinion on it first. What do people think about storing the orphan blocks downloaded to disk so that the blocks don't need to be re-requested if bitcoind is shutdown and started again? Currently, due to the way blocks are requested, I am often seeing the number of orphan blocks reaching 300 or so, so it seems pretty wasteful that these are discarded when bitcoin is shutdown and restarted.

    Perhaps this is fixing the problem in the wrong place. I would prefer to see the blocks downloaded in a way that prioritises the earlier blocks so that orphans don't stack up as they currently are doing.

  2. gmaxwell commented at 2:01 AM on May 9, 2014: contributor

    Nak. Trivial disk exhaustion DOS attack. Headers first doesn't ever download orphan blocks.

  3. laanwj commented at 5:41 AM on May 9, 2014: member

    Well in principle it could store the current orphans (up to the allowed maximum) on shutdown and load them back when restarting.

    But indeed, the solution would be the other way around, to not request and store orphans at all.

  4. laanwj closed this on May 9, 2014

  5. sipa commented at 10:21 AM on May 9, 2014: member

    The whole fact that we have orphan blocks is because we cannot validate anything from blocks that are downloaded out of order (=oprhans). With headers-first validation, we will always know the headers for every block we download in advance, so they will be partially validated ahead of time.

    Headers-first won't remove out-of-order blocks, but as their parents' (headers) will be known before, they won't be considered orphans anymore, and we will store them on disk, and process them fully when the data for all their parents is available as well.

    So in a way, headers-first will accomplish what you're asking. Not by storing orphans, but by no longer needing to consider out-of-order blocks as orphans.

  6. MarcoFalke locked this on Sep 8, 2021

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-22 18:15 UTC

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