Skip tx validation to make initial sync faster #6334

pull ondra-novak wants to merge 3 commits into bitcoin:master from ondra-novak:master changing 3 files +41 −20
  1. ondra-novak commented at 9:30 AM on June 24, 2015: none

    This modification solves my problem with bootstrapping nodes on small and slow virtual servers. It introduces a new command line flag -skiptxcheck that will significantly increase speed of initial synchronization in exchange to rely on trust provided by the miners. Because we can believe that every block in deep history of the Bitcoin is valid and contains valid transactions, it is not necesery to verify them again.

    The flag doesn't affect verifying of block header - so block hash and merkle tree are still checked and they must be valid in the chain.

    Is there any security risk? I don't think so, maybe little. Standard SPV client always rely on neighbour node. It just verifies the headers, never transactions again.

    This feature automatically disables itself when synchronization is done (not tested yet). Also NODE_NETWORK is disabled.

  2. Introduced flag -skiptxcheck - it makes initial synchronization faster in change to rely on miners (verify of hash is sufficient) 02f647c4b1
  3. disable NODE_NETWORK when skiptxcheck is enabled
    disable skiptxcheck when blockchain is synced
    2d7ed34711
  4. some cleanup 37befe410d
  5. luke-jr commented at 9:33 AM on June 24, 2015: member

    You shouldn't relay transactions either. Anyhow, we already skip the script checking up to the last checkpoint, so I don't know this is going to do any good.

  6. jonasschnelli commented at 9:37 AM on June 24, 2015: contributor

    This would break a fundamental value of bitcoin-core: validation. If you build a farm of bitcoin-nodes, this might be helpful. But i think pulling this into master would enforce centralization. NACK territory IMO.

  7. ondra-novak commented at 9:55 AM on June 24, 2015: none

    lure-jr: the flag just affects block acceptance, not mem-pool. Are you sure,that this is skipped up to last checkpoint? It doesn't correspond to my observation. Anyway, the process is slowest at the tail. (on $10 virtual on Vultr one block takes more then 1 minute)

  8. ondra-novak commented at 1:12 PM on June 24, 2015: none

    I have better idea. To define custom checkpoints from the command line. It would be safer solution.

  9. ondra-novak closed this on Jun 24, 2015

  10. sipa commented at 1:14 PM on June 24, 2015: member

    Or even faster and safer: copy the data directory of another node you control.

  11. ondra-novak commented at 1:15 PM on June 24, 2015: none

    sipa not always. Reindex is always slow

  12. sipa commented at 1:15 PM on June 24, 2015: member

    Copying the data directory of another node does not require reindexing.

  13. ondra-novak commented at 1:35 PM on June 24, 2015: none

    To move XX gigabytes accross network is not always without problems. It is faster to copy a few numbers and let the magic flow.

    OK, I will no longer bother you.

  14. sipa commented at 1:39 PM on June 24, 2015: member

    Yes, perfectly possible with -prune too. If you copy the entire database, the copy is already validated. You should only do this if you trust the machine you're copying from, but there is no overhead.

  15. 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-17 09:15 UTC

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