-stopatheight is imprecise #13477

issue Sjors openend this issue on June 15, 2018
  1. Sjors commented at 12:59 pm on June 15, 2018: member

    As of latest master (2b770080a49f282e51b7e4d176b2d9fbe0f8f5db).

     0src/bitcoind -testnet -stopatheight=100000
     1
     2...
     3
     42018-06-15T12:49:59Z UpdateTip: new best=000000000086a985696447c96c8a3520dbe5536287ef9fbf5b220b66fdb684c7 height=100208 version=0x00000002 log2_work=54.043471 tx=599130 date='2013-08-11T14:57:43Z' progress=0.032961 cache=43.5MiB(302489txo)
     52018-06-15T12:49:59Z UpdateTip: new best=000000000060c93d2cf7a5cd5ce510c31cf96b983ee64ec5c627cf2055249500 height=100209 version=0x00000002 log2_work=54.043562 tx=599131 date='2013-08-11T15:01:20Z' progress=0.032961 cache=43.5MiB(302490txo)
     62018-06-15T12:49:59Z Shutdown: In progress...
     72018-06-15T12:49:59Z addcon thread exit
     82018-06-15T12:49:59Z net thread exit
     92018-06-15T12:49:59Z UpdateTip: new best=000000000075b13f384b05ac740b776593dc4f53d2d92cf9c2a81475335a3cef height=100210 version=0x00000002 log2_work=54.043653 tx=599136 date='2013-08-11T15:09:42Z' progress=0.032961 cache=43.5MiB(302495txo)
    102018-06-15T12:49:59Z msghand thread exit
    112018-06-15T12:50:01Z opencon thread exit
    122018-06-15T12:50:01Z scheduler thread interrupt
    132018-06-15T12:50:01Z Dumped mempool: 7e-06s to copy, 0.00237s to dump
    142018-06-15T12:50:07Z Shutdown: done
    

    Having precise control can be useful for generating a deterministic blockchain snapshot. That in turn could be useful when bootstrapping a low performance device (though hopefully #9483 will make that unnecessary), as well as for validating the chain in parallel on multiple machines.

    One easy solution might be to just roll back to the target.

  2. laanwj added the label Validation on Jun 15, 2018
  3. Sjors commented at 3:13 pm on September 8, 2018: member
    See discussion at #13713 and #13490 for whether this is a good idea or not.
  4. Sjors commented at 8:52 am on October 29, 2019: member

    It’s still imprecise as of master @ 4c1090c882ea15ba4d10a2f7f320f3c0eb490ebd.

    An alternative way to create a blockchain snapshot is to call invalidateblock on the next height. This approach is used in #16899. I don’t think that’s an ideal solution though; if there’s forks you have to invalidate all of them, and if you don’t shutdown p2p it starts disconnecting peers. So I’d prefer a more robust RPC call for this purpose like rollbacktoheight, which also requires fixing this precision issue.

  5. Sjors commented at 12:21 pm on January 6, 2021: member
    @jamesob do you think this issue is still relevant for the way you generate UTXO snapshots?
  6. Sjors commented at 12:48 pm on September 6, 2022: member
    Closing this because utxo_snapshot.sh uses invalidateblock to wind back.
  7. Sjors closed this on Sep 6, 2022

  8. bitcoin locked this on Sep 6, 2023


Sjors

Labels
Validation


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: 2024-12-19 03:12 UTC

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