-
Notifications
You must be signed in to change notification settings - Fork 718
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
[Test][Misc] Fix libsecp256k1 init for unit test setup + Allow to specify blocks storage directory #2326
[Test][Misc] Fix libsecp256k1 init for unit test setup + Allow to specify blocks storage directory #2326
Conversation
Based on btc#6702 btc#6701
As the libsecp256k1 context was only initialized in the TestingSetup, we have been forced to use it when sometimes it is not necessary (TestingSetup is a complete setup that includes CConnman, scheduler, validation interface, etc).
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.
Looking good. Couple minor nits/typos in the comments. Otherwise ACK.
This commit attempts to clarify and correct the `-blocksdir` argument description and default value. `-blocksdir` does not refer to the full path to the actual `blocks` directory, but rather the root/parent directory which contains the `blocks` directory. Accordingly, the default value is `<datadir>` and not `<datadir>/blocks`. It also attempts to clarify that only the `.dat` files containing block data are impacted by `-blocksdir`, not the index files.
The blocks directory is net specific by definition. Also this prevents the side effect of calling GetBlocksDir(false) in the non-mainnet environment.
A new node should not create an unused `blocks` directory in the root of the data directory when `-testnet` or `-regtest` is specified.
Rather than both. Introduced in 386a6b6
This commit does not change behavior as GetBlocksDir() with unset "-blocksdir" returns the same path.
Use case: TryCreateDirectory(GetDataDir() / "blocks" / "index") would fail if the blocks directory was not explicitly created before. The line that did so was in a weird location and could be removed as a result.
8b954c6
to
50e66c2
Compare
updated, typos corrected. |
functionally good. might as well document the new option in the release notes template here so it doesn't need to be done later |
Updated per feedback, added |
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.
looks like something went awry when adding to the release notes. minor issue though and can simply be cleaned up later.
otherwise, ACK ff767e1
ff767e1
to
b0e0d55
Compare
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.
re-ACK b0e0d55
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.
utACK b0e0d55 and merging...
bug introduced in PIVX-Project#2326
…tem.h 3e48fc1 Renamed and moved util.h/cpp files to util/system.h & util/system.cpp (furszy) 7954cef Style cleanup. (Jim Posen) 48801a9 Use common SetDataDir method to create temp directory in tests. (winder) 06464d3 flatfile: Unit tests for FlatFileSeq methods. (Jim Posen) bbb9a90 scripted-diff: Rename CBlockDiskPos to FlatFilePos. (Jim Posen) 472857a Move CDiskBlockPos from chain to flatfile. (Jim Posen) 7fa47bb validation: Refactor file flush logic into FlatFileSeq. (Jim Posen) bf09076 validation: Refactor block file pre-allocation into FlatFileSeq. (Jim Posen) c813080 validation: Refactor OpenDiskFile into method on FlatFileSeq. (Jim Posen) 2619fe8 validation: Extract basic block file logic into FlatFileSeq class. (Jim Posen) e65acf0 util: Move CheckDiskSpace to util. (Jim Posen) Pull request description: This is part of the block logic refactoring and encapsulation work coming from upstream (work started in #2326 and #2328 due the possible blocks db corruption issue). Needed for two future works: (1) faster block validation using a new cache structure and (2) the future possible custom BIP157 (new sync protocol that supersedes BIP37 for light clients -- pending research needed after finishing v6.0 priorities --) Essentially, it's encapsulating the sequenced files open/read/write functionalities inside a new `flatfile` module, and extending the unit test coverage to validate its correct behavior. Adapted the following PRs: * bitcoin#15118. * bitcoin#13145. * Plus added `util.h/cpp` files mv to `util/system.h` & `util/system.cpp`. ACKs for top commit: random-zebra: utACK 3e48fc1 Tree-SHA512: c21ffb6ede054a279f9792c1cbe645b948078bd6bc607d32438f0601fd4df3650c0a34b349e46b4ea69b48f9e6c7bb18d258e139c6e1a47452ac9ea4f3bbee25
Grouped two different, zero risk, modifications here to not have to create two/three small and straightforward PRs:
1) Unit Tests:
BasicTestingSetup
receiving the network in the constructor.2) Back ported the ability to specify a custom directory for the blocks storage.