-
Notifications
You must be signed in to change notification settings - Fork 38.8k
contrib: support reading XORed blocks in linearize-data.py script #30607
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
contrib: support reading XORed blocks in linearize-data.py script #30607
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code CoverageFor detailed information about the code coverage, see the test coverage report. ReviewsSee the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update. |
Partly fixes issue bitcoin#30599.
fb5c964 to
77ff0ec
Compare
|
🚧 At least one of the CI tasks failed. HintsMake sure to run all tests locally, according to the documentation. The failure may happen due to a number of reasons, for example:
Leave a comment here, if you need help tracking down a confusing failure. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 77ff0ec
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:
- Created a regtest chain (~11k transactions in 411 blocks)
- Confirmed that xor.dat had a non-zero key, created hashlist, then stopped bitcoind
- Created a bootstrap.dat with
linearize-data.py(successful) - Deleted the regtest datadir
- Started bitcoind with
-loadblock=/path/to/bootstrap.dat -blocksxor=0(successful restore), then stopped bitcoind - Deleted
xor.datfrom theregtest/blocks/ - Created another bootstrap.dat with
linearize-data.py(successful) - Started bitcoind with
-loadblock=/path/to/bootstrap.dat(successful restore), then stopped bitcoind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 77ff0ec
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.
bitcoind -regtest &bitcoin-cli -regtest getblockcountreturns height=120.contrib/linearize/linearize-hashes.py contrib/linearize/example-linearize.cfg > hashlist.txt(with modified .cfg).pkill bitcoindcontrib/linearize/linearize-data.py contrib/linearize/example-linearize.cfgmv ~/.bitcoin/regtest/ ~/regtest_oldbitcoind -regtest &bitcoin-cli -regtest getblockcountreturns height=0.pkill bitcoindbitcoind -regtest -loadblock=/home/hodlinator/bootstrap.datbitcoin-cli -regtest getblockcountreturns the original height=120.
Edit: Also passed unit & functional tests locally.
|
ACK 77ff0ec |
Add information to speed up grokking of purpose of scripts. Prompted by reviewing bitcoin#30607.
Add information to speed up grokking of purpose of scripts. Prompted by reviewing bitcoin#30607.
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.