keep a copy of genesis block [0] using pruning mode #9184

issue fflo opened this issue on November 18, 2016
  1. fflo commented at 4:09 AM on November 18, 2016: none

    Hi,

    external applications connecting to bitcoind using rpc calls usually check the details of the genesis block to be sure that bitcoind is serving requests correctly.

    Enabling pruning mode throws out error messages in this case, because the genesis block seems to get pruned, too: like i.e. p2pool.util.jsonrpc.NarrowError: -32603 Block not available (pruned data)

    Is it possible to keep a copy of the genesis block enabling pruning mode?

  2. laanwj added the label RPC/REST/ZMQ on Nov 21, 2016
  3. laanwj commented at 8:07 AM on November 21, 2016: member

    Can you be more specific as to which JSON-RPC calls fail due to a missing genesis block?

    I would say it is acceptable that they fail if you specifically refer to the genesis block after it gets pruned (like for any other block - pruning with discontinuous ranges just isn't supported at the moment), but not otherwise.

  4. fflo commented at 10:21 AM on November 21, 2016: none

    external applications connecting to bitcoin often check some unique details of the genesis block, i.e. p2pool is running a rpc check: getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f on startup [https://github.com/p2pool/p2pool/blob/master/p2pool/bitcoin/networks/bitcoin.py].

    So I guess it's probably a good idea to keep a copy of the genesis block available, even if pruning mode is enabled. This would allow external applications to verify that the rpc connection to bitcoin is working as expected.

  5. laanwj commented at 10:52 AM on November 21, 2016: member

    What details does it need? Wouldn't getblockheader be enough?

    As said, storing non-contiguous block ranges is not supported at the moment. This also applies to the genesis block. It would be useful (so would redownloading individual blocks once they have been pruned) for some other cases too but it is a bit tricky.

  6. fflo commented at 2:03 AM on November 22, 2016: none

    Yes, it's possible to patch p2pool to reduce the genesis block check using getblockheader instead of getblock to support the pruning mode.

    As a quick check I've disabled the genesis block check and p2pool seem to work stable using the pruning mode with reasonable settings, now.

    Nevertheless I think it's a good idea not to prune the genesis block in any case. It's like the source DNA of bitcoin ;)

  7. MarcoFalke commented at 6:41 PM on July 16, 2018: member

    Closing for now, since it has been fixed upstream in p2pool

  8. MarcoFalke closed this on Jul 16, 2018

  9. 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-13 15:15 UTC

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