invalidateblock during background validation #30958

issue fanquake openend this issue on September 24, 2024
  1. fanquake commented at 1:20 pm on September 24, 2024: member

    If you call invalidateblock (on the tip) during background validation, the node will currently do the following:

    bitcoin-cli invalidateblock 00000000000000000000f5752e9599f03a7b3a3e2356af91faaf74e41fdf58fe

     02024-09-24T13:01:15Z [background validation] UpdateTip: new best=0000000000000000008dd2857255b2e5fc0c3955740c74dac6bafd0de09c344e height=482000 version=0x20000000 log2_work=86.991735 tx=249395394 date='2017-08-25T19:52:51Z' progress=0.230269 cache=238.7MiB(1748399txo)
     12024-09-24T13:02:42Z Saw new header hash=00000000000000000000f5752e9599f03a7b3a3e2356af91faaf74e41fdf58fe height=862671
     22024-09-24T13:02:45Z UpdateTip: new best=00000000000000000000f5752e9599f03a7b3a3e2356af91faaf74e41fdf58fe height=862671 version=0x2be3a000 log2_work=95.172229 tx=1085328468 date='2024-09-24T13:02:21Z' progress=1.000000 cache=11.6MiB(81087txo)
     32024-09-24T13:02:52Z [background validation] UpdateTip: new best=000000000000000000b7738efb4c4acbc841c032294d2e6ab09295f4117c7b3a height=484000 version=0x20000002 log2_work=87.061771 tx=252628356 date='2017-09-07T11:50:44Z' progress=0.233253 cache=688.5MiB(5222117txo)
     42024-09-24T13:02:58Z UpdateTip: new best=000000000000000000029f913a20c71e01321ec8b320418b6fe7c38e708a0eec height=862670 version=0x3fff0000 log2_work=95.172216 tx=1085323202 date='2024-09-24T13:00:39Z' progress=0.999999 cache=11.8MiB(77967txo)
     52024-09-24T13:02:58Z InvalidChainFound: invalid block=00000000000000000000f5752e9599f03a7b3a3e2356af91faaf74e41fdf58fe  height=862671  log2_work=95.172229  date=2024-09-24T13:02:21Z
     62024-09-24T13:02:58Z InvalidChainFound:  current best=000000000000000000029f913a20c71e01321ec8b320418b6fe7c38e708a0eec  height=862670  log2_work=95.172216  date=2024-09-24T13:00:39Z
     72024-09-24T13:02:58Z CheckForkWarningConditions: Warning: Found invalid chain at least ~6 blocks longer than our best chain.
     8Chain state database corruption likely.
     92024-09-24T13:02:58Z CheckForkWarningConditions: Warning: Found invalid chain at least ~6 blocks longer than our best chain.
    10Chain state database corruption likely.
    112024-09-24T13:02:58Z CheckForkWarningConditions: Warning: Found invalid chain at least ~6 blocks longer than our best chain.
    12Chain state database corruption likely.
    132024-09-24T13:02:58Z CheckForkWarningConditions: Warning: Found invalid chain at least ~6 blocks longer than our best chain.
    14<repeat for every new block processed in the background validation>
    

    bitcoin-cli reconsiderblock 00000000000000000000f5752e9599f03a7b3a3e2356af91faaf74e41fdf58fe

    02024-09-24T13:03:10Z CheckForkWarningConditions: Warning: Found invalid chain at least ~6 blocks longer than our best chain.
    1Chain state database corruption likely.
    22024-09-24T13:03:10Z CheckForkWarningConditions: Warning: Found invalid chain at least ~6 blocks longer than our best chain.
    3Chain state database corruption likely.
    42024-09-24T13:03:10Z UpdateTip: new best=00000000000000000000f5752e9599f03a7b3a3e2356af91faaf74e41fdf58fe height=862671 version=0x2be3a000 log2_work=95.172229 tx=1085328468 date='2024-09-24T13:02:21Z' progress=1.000000 cache=11.6MiB(81332txo)
    52024-09-24T13:03:16Z New outbound-full-relay v2 peer connected: version: 70016, blocks=862671, peer=69
    62024-09-24T13:04:44Z [background validation] UpdateTip: new best=000000000000000000a2a8104d61651f76c666b70754d6e9346176385f7afa24 height=486000 version=0x20000000 log2_work=87.131847 tx=255540060 date='2017-09-19T09:09:00Z' progress=0.235942 cache=1014.2MiB(7475508txo)
    72024-09-24T13:06:42Z [background validation] UpdateTip: new best=000000000000000000f980eebec0616501eead146975f1df5ca9a1db40309547 height=488000 version=0x20000000 log2_work=87.210415 tx=258791302 date='2017-10-02T21:02:34Z' progress=0.238943 cache=1284.3MiB(9681780txo)
    82024-09-24T13:08:01Z [background validation] UpdateTip: new best=000000000000000000de069137b17b8d5a3dfbd5b145b2dcfb203f15d0c4de90 height=490000 version=0x20000000 log2_work=87.286453 tx=262368718 date='2017-10-15T17:57:17Z' progress=0.242246 cache=1521.0MiB(11621530txo)
    

    Printing these warning messages does not seem useful, or even the correct thing to do during a background sync; as the chain being warned about, is still our best, active chain?

  2. mzumsande commented at 6:23 pm on September 24, 2024: contributor
    I agree that these messages make no sense and think that the check should just be skipped for the background chainstate, see #30962.
  3. achow101 closed this on Sep 25, 2024


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-22 00:12 UTC

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