-
Notifications
You must be signed in to change notification settings - Fork 37.7k
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.dat
from 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.
1cbc5ae 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 getblockcount
returns height=120.contrib/linearize/linearize-hashes.py contrib/linearize/example-linearize.cfg > hashlist.txt
(with modified .cfg).pkill bitcoind
contrib/linearize/linearize-data.py contrib/linearize/example-linearize.cfg
mv ~/.bitcoin/regtest/ ~/regtest_old
bitcoind -regtest &
bitcoin-cli -regtest getblockcount
returns height=0.pkill bitcoind
bitcoind -regtest -loadblock=/home/hodlinator/bootstrap.dat
bitcoin-cli -regtest getblockcount
returns 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.
…ze-data.py script 77ff0ec contrib: support reading XORed blocks in linearize-data.py script (Sebastian Falbesoner) Pull request description: This PR is a small follow-up for bitcoin#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 bitcoin#30599. ACKs for top commit: achow101: ACK 77ff0ec tdb3: ACK 77ff0ec hodlinator: ACK 77ff0ec Tree-SHA512: 011eb02e2411de373cbbf4b26db4640fc693a20be8c2430529fba6e36a3a3abfdfdc3b005d330f9ec2846bfad9bfbf34231c574ba99289ef37dd51a68e6e7f3d
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.