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
utils and libraries: Make 'blocksdir' always net specific #14409
utils and libraries: Make 'blocksdir' always net specific #14409
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
Concept ACK. This seem to require a release note. |
Needs tests before merge |
Concept ACK, so this only affects the case where the user has explicitly specified a directory with the |
Thank you for your review.
This PR works regardless of the |
Does this risk breaking any existing configurations? |
@sipa that was my concern, the actual behaviour looks unchanged but I think now if you specify a base directory with |
Test of this PR:
Test of master be99270:
The behaviour is unchanged. If you specify a base directory with |
The blocks directory is net specific by definition. Also this prevents the side effect of calling GetBlocksDir(false) in the non-mainnet environment.
c1a60d4
to
c3f1821
Compare
Rebased. |
This absolutely needs testing in a functional test. Also to make it clear what behavior is failing right now, and which will pass after this. |
A new node should not create an unused `blocks` directory in the root of the data directory when `-testnet` or `-regtest` is specified.
@laanwj Thank you for your review.
The existed |
utACK e4a0c35 |
1 similar comment
utACK e4a0c35 |
e4a0c35 Improve blocksdir functional test. (Hennadii Stepanov) c3f1821 Make blockdir always net specific (Hennadii Stepanov) Pull request description: The blocks directory is net specific by definition. Also this prevents the side effect of calling `GetBlocksDir(false)` in the non-mainnet environment. Currently a new node creates an unused `blocks\` directory in the root of the data directory when `-testnet` or `-regtest` is specified. Refs: - #12653 - #12653 (comment) by @laanwj - #14595 (comment) Tree-SHA512: c9957a68a4a200ebd2010823a56db7e61563afedcb7c9828e86b13f3af2990e07854b622c1f3374756f94574acb3ea32de7d2a399eef6c0623f0e11265155627
The blocks directory is net specific by definition. Also this prevents the side effect of calling GetBlocksDir(false) in the non-mainnet environment. Github-Pull: bitcoin#14409 Rebased-From: c3f1821
A new node should not create an unused `blocks` directory in the root of the data directory when `-testnet` or `-regtest` is specified. Github-Pull: bitcoin#14409 Rebased-From: e4a0c35
Being backported in #15445. |
… Allow to specify blocks storage directory b0e0d55 doc: add '-blocksdir' option to release-notes (furszy) 50e66c2 Turn TryCreateDirectory() into TryCreateDirectories() (Marko Bencun) 035d3c2 util: Simplify path argument for CBlockTreeDB ctor (Hennadii Stepanov) a571d24 Fail if either disk space check fails (Ben Woosley) e567003 Improve blocksdir functional test. (Hennadii Stepanov) ff0ae45 Make blockdir always net specific (Hennadii Stepanov) 13a4119 doc: Clarify -blocksdir usage (Daniel McNally) a4ff899 -blocksdir: keep blockindex leveldb database in datadir (Jonas Schnelli) 3054076 QA: Add -blocksdir test (Jonas Schnelli) 39b8127 Allow to optional specify the directory for the blocks storage (Jonas Schnelli) a821b0b BugFix: Move TestingSetup::ECCVerifyHandle member to BasicTestingSetup. (furszy) 5844452 Remove unneeded GetTempPath, only use temp directory in unit tests (furszy) 7fc893b [Test] BasicTestingSetup constructor receiving the network param. (furszy) Pull request description: Grouped two different, zero risk, modifications here to not have to create two/three small and straightforward PRs: #### 1) Unit Tests: * Fixing basic unit test setup issue, was not initializing the libsecp256k1 context. Thus why we have been forced to use the extended unit testing setup for almost every test case (which includes CConnman, scheduler, validation interface, etc.. that are not needed so often). * Refactor: `BasicTestingSetup` receiving the network in the constructor. #### 2) Back ported the ability to specify a custom directory for the blocks storage. > Since the actual block files taking up more and more space, it may be desirable to have them stored in a different location then the data directory (use case: SSD for chainstate, etc., HD for blocks). This PR adds a -blocksdir option that allows one to keep the blockfiles external from the data directory (instead of creating symlinks). * bitcoin#9895. * bitcoin#12653. * bitcoin#14364. * bitcoin#14409. * bitcoin#15124. * bitcoin#17059. ACKs for top commit: Fuzzbawls: re-ACK b0e0d55 random-zebra: utACK b0e0d55 and merging... Tree-SHA512: 289e5b826c8fc23a5933a5b30e6c043f82bad827b10f3093cbc5869a9e278d7ad0a325dd19b5ad3c97f23a3dee69f5b0bee3869e486eeed5e8d8342a39919cf5
… specific e4a0c35 Improve blocksdir functional test. (Hennadii Stepanov) c3f1821 Make blockdir always net specific (Hennadii Stepanov) Pull request description: The blocks directory is net specific by definition. Also this prevents the side effect of calling `GetBlocksDir(false)` in the non-mainnet environment. Currently a new node creates an unused `blocks\` directory in the root of the data directory when `-testnet` or `-regtest` is specified. Refs: - bitcoin#12653 - bitcoin#12653 (comment) by @laanwj - bitcoin#14595 (comment) Tree-SHA512: c9957a68a4a200ebd2010823a56db7e61563afedcb7c9828e86b13f3af2990e07854b622c1f3374756f94574acb3ea32de7d2a399eef6c0623f0e11265155627
… specific e4a0c35 Improve blocksdir functional test. (Hennadii Stepanov) c3f1821 Make blockdir always net specific (Hennadii Stepanov) Pull request description: The blocks directory is net specific by definition. Also this prevents the side effect of calling `GetBlocksDir(false)` in the non-mainnet environment. Currently a new node creates an unused `blocks\` directory in the root of the data directory when `-testnet` or `-regtest` is specified. Refs: - bitcoin#12653 - bitcoin#12653 (comment) by @laanwj - bitcoin#14595 (comment) Tree-SHA512: c9957a68a4a200ebd2010823a56db7e61563afedcb7c9828e86b13f3af2990e07854b622c1f3374756f94574acb3ea32de7d2a399eef6c0623f0e11265155627
… specific e4a0c35 Improve blocksdir functional test. (Hennadii Stepanov) c3f1821 Make blockdir always net specific (Hennadii Stepanov) Pull request description: The blocks directory is net specific by definition. Also this prevents the side effect of calling `GetBlocksDir(false)` in the non-mainnet environment. Currently a new node creates an unused `blocks\` directory in the root of the data directory when `-testnet` or `-regtest` is specified. Refs: - bitcoin#12653 - bitcoin#12653 (comment) by @laanwj - bitcoin#14595 (comment) Tree-SHA512: c9957a68a4a200ebd2010823a56db7e61563afedcb7c9828e86b13f3af2990e07854b622c1f3374756f94574acb3ea32de7d2a399eef6c0623f0e11265155627
The blocks directory is net specific by definition.
Also this prevents the side effect of calling
GetBlocksDir(false)
in the non-mainnet environment.Currently a new node creates an unused
blocks\
directory in the root of the data directory when-testnet
or-regtest
is specified.Refs: