contrib: support reading XORed blocks in linearize-data.py script #30607

pull theStack wants to merge 1 commits into bitcoin:master from theStack:202408-contrib-block_xor_support_for_linearize-data changing 2 files +23 −9
  1. theStack commented at 9:45 pm on August 7, 2024: contributor

    This PR is a small follow-up for #28052, adding support for the block linearization script to handle XORed blocksdir *.dat files. Note that if no xor.dat file exists, the XOR pattern is set to all-zeros, in order to still support blockdirs that have been created with versions earlier than 28.x.

    Partly fixes issue #30599.

  2. DrahtBot commented at 9:45 pm on August 7, 2024: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage

    For detailed information about the code coverage, see the test coverage report.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK tdb3, hodlinator, achow101

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  3. DrahtBot added the label Scripts and tools on Aug 7, 2024
  4. contrib: support reading XORed blocks in linearize-data.py script
    Partly fixes issue #30599.
    77ff0ec1f1
  5. theStack force-pushed on Aug 7, 2024
  6. DrahtBot commented at 9:54 pm on August 7, 2024: contributor

    🚧 At least one of the CI tasks failed. Debug: https://github.com/bitcoin/bitcoin/runs/28486114479

    Make sure to run all tests locally, according to the documentation.

    The failure may happen due to a number of reasons, for example:

    • Possibly due to a silent merge conflict (the changes in this pull request being incompatible with the current code in the target branch). If so, make sure to rebase on the latest commit of the target branch.

    • A sanitizer issue, which can only be found by compiling with the sanitizer and running the affected test.

    • An intermittent issue.

    Leave a comment here, if you need help tracking down a confusing failure.

  7. DrahtBot added the label CI failed on Aug 7, 2024
  8. DrahtBot removed the label CI failed on Aug 7, 2024
  9. tdb3 approved
  10. tdb3 commented at 1:26 am on August 9, 2024: contributor

    ACK 77ff0ec1f185b818b30877de2bedc1750319e6c4 Nice work. Simplifies the test and enhances chain archive capability.

    In addition to running unit/functionals locally (passed) and light code review, performed some sanity checks:

    1. Created a regtest chain (~11k transactions in 411 blocks)
    2. Confirmed that xor.dat had a non-zero key, created hashlist, then stopped bitcoind
    3. Created a bootstrap.dat with linearize-data.py (successful)
    4. Deleted the regtest datadir
    5. Started bitcoind with -loadblock=/path/to/bootstrap.dat -blocksxor=0 (successful restore), then stopped bitcoind
    6. Deleted xor.dat from the regtest/blocks/
    7. Created another bootstrap.dat with linearize-data.py (successful)
    8. Started bitcoind with -loadblock=/path/to/bootstrap.dat (successful restore), then stopped bitcoind
  11. hodlinator approved
  12. hodlinator commented at 1:17 pm on August 12, 2024: contributor

    ACK 77ff0ec1f185b818b30877de2bedc1750319e6c4

    Good to see follow-up work for #28052 being carried out.

    1cbc5ae87a8efe44226080ceaaaf10c5575d629d explains purpose of linearize-scripts (as it was not immediately apparent to me). Could be cherry-picked into this PR, or left for a further follow-up.

    1. bitcoind -regtest &
    2. bitcoin-cli -regtest getblockcount returns height=120.
    3. contrib/linearize/linearize-hashes.py contrib/linearize/example-linearize.cfg > hashlist.txt (with modified .cfg).
    4. pkill bitcoind
    5. contrib/linearize/linearize-data.py contrib/linearize/example-linearize.cfg
    6. mv ~/.bitcoin/regtest/ ~/regtest_old
    7. bitcoind -regtest &
    8. bitcoin-cli -regtest getblockcount returns height=0.
    9. pkill bitcoind
    10. bitcoind -regtest -loadblock=/home/hodlinator/bootstrap.dat
    11. bitcoin-cli -regtest getblockcount returns the original height=120.

    Edit: Also passed unit & functional tests locally.

  13. achow101 added this to the milestone 28.0 on Aug 12, 2024
  14. achow101 commented at 6:55 pm on August 12, 2024: member
    ACK 77ff0ec1f185b818b30877de2bedc1750319e6c4
  15. achow101 merged this on Aug 12, 2024
  16. achow101 closed this on Aug 12, 2024

  17. theStack deleted the branch on Aug 12, 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-09-28 22:12 UTC

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