Longer term workaround for chainstate corruption from negative versions. #2982

pull gmaxwell wants to merge 1 commits into bitcoin:master from gmaxwell:20130908_ccoins_corrupt changing 1 files +6 −1
  1. gmaxwell commented at 9:19 AM on September 9, 2013: contributor

    This also makes negative transaction versions non-standard.

    This avoids an issue triggered in block 256818 where transactions with negative version numbers were incorrectly serialized into the UTXO set.

    On restart nodes detect the inconsistency and refuse to start so long as a block with these transactions is inside the self-consistency check window, logging "coin database inconsistencies found". The software recommends reindexing, but reindexing does not correct the problem.

    This should be fixed by changing the chainstate serialization, but working around it seems harmless for now because the version is not used by any network rule currently.

    A patch free workaround is to start with -checklevel=2 which skips the consistency checks, but the IsStandard change is important for miners in order to protect unpatched nodes.

  2. Longer term workaround for chainstate corruption from negative versions.
    This also makes negative transaction versions non-standard.
    
    This avoids an issue triggered in block 256818 where transactions with
    negative version numbers were incorrectly serialized into the UTXO set.
    
    On restart nodes detect the inconsistency and refuse to start so long as
    a block with these transactions is inside the self-consistency check
    window, logging "coin database inconsistencies found". The software
    recommends reindexing, but reindexing does not correct the problem.
    
    This should be fixed by changing the chainstate serialization, but
    working around it seems harmless for now because the version is not
    used by any network rule currently.
    
    A patch free workaround is to start with -checklevel=2 which skips
    the consistency checks, but the IsStandard change is important for
    miners in order to protect unpatched nodes.
    f8b7aa8625
  3. BitcoinPullTester commented at 9:53 AM on September 9, 2013: none

    Automatic sanity-testing: PASSED, see http://jenkins.bluematt.me/pull-tester/f8b7aa862519ab2efd1ce327d2ed4bea1325dc11 for binaries and test log. This test script verifies pulls every time they are updated. It, however, dies sometimes and fails to test properly. If you are waiting on a test, please check timestamps to verify that the test.log is moving at http://jenkins.bluematt.me/pull-tester/current/ Contact BlueMatt on freenode if something looks broken.

  4. gavinandresen commented at 10:03 AM on September 9, 2013: contributor

    ACK: tested on OSX.

  5. laanwj commented at 10:43 AM on September 9, 2013: member

    ACK: works for me on Ubuntu 12.04 64 bit

  6. wtogami commented at 10:57 AM on September 9, 2013: contributor

    https://github.com/gmaxwell/bitcoin/commit/f8b7aa862519ab2efd1ce327d2ed4bea1325dc11 Testing backport to litecoin-0.8.4.1. Assuming I did it correctly, your bitcoin-0.8.x backport will be slightly different from this.

  7. jgarzik commented at 11:35 AM on September 9, 2013: contributor

    ACK

  8. wtogami commented at 11:57 AM on September 9, 2013: contributor

    ACK

  9. runeksvendsen commented at 2:41 PM on September 9, 2013: contributor

    I can confirm that this patch fixes the issue for me, and tests run without errors.

  10. sipa commented at 3:18 PM on September 9, 2013: member

    ACK code changes; didn't test.

  11. gmaxwell referenced this in commit 85311c1ef8 on Sep 10, 2013
  12. gmaxwell merged this on Sep 10, 2013
  13. gmaxwell closed this on Sep 10, 2013

  14. DrahtBot 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-18 21:16 UTC

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