Page MenuHomePhabricator

[backport PR12653] Allow to optional specify the directory for the blocks storage
ClosedPublic

Authored by markblundeberg on May 6 2019, 04:02.

Details

Summary

from: https://github.com/bitcoin/bitcoin/pull/12653/files
a1926362e -blocksdir: keep blockindex leveldb database in datadir
f38e4fdb0 QA: Add -blocksdir test
386a6b62a Allow to optional specify the directory for the blocks storage

also includes bugfix PR15124 (Ben Woosley)
ba8c8b2227 Fail if either disk space check fails

Test Plan

make check
test_runner.py

  • manual testing on testnet

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

markblundeberg created this revision.May 6 2019, 04:02
Herald added a reviewer: Restricted Project. · View Herald TranscriptMay 6 2019, 04:02

Note, there are some future backports that should be done relating to this (but can't be done yet), see T636 description.

markblundeberg edited the test plan for this revision. (Show Details)May 6 2019, 22:40

On further thought I think manual testing would be a good idea here, since /in theory/ it's possible that some codebase divergence means there could be a GetDataDir() somewhere else that needs to be changed over.

markblundeberg planned changes to this revision.May 7 2019, 14:11
markblundeberg updated this revision to Diff 8528.May 8 2019, 21:16
markblundeberg edited the test plan for this revision. (Show Details)

rebase & did test on testnet

markblundeberg added a comment.EditedMay 8 2019, 21:18

On further thought I think manual testing would be a good idea here, since /in theory/ it's possible that some codebase divergence means there could be a GetDataDir() somewhere else that needs to be changed over.

I checked for other GetDataDir invocations and none are relevant to blocks. + tested on regtest / testnet

BTW how this works: if you specify -blocksdir=/home/mark/spam then:

  • mainnet blocks will be under /home/mark/spam/blocks
  • testnet blocks will be under /home/mark/spam/testnet3/blocks

But index is still under the datadir, ie by default:

  • mainnet blockindex will be under /home/mark/.bitcoin/blocks/index
  • testnet blockindex will be under /home/mark/.bitcoin/testnet3/blocks/index
jasonbcox requested changes to this revision.May 9 2019, 20:52
jasonbcox added inline comments.
src/init.cpp
2264 ↗(On Diff #8528)

In the future, please don't do this unless the fix is strictly necessary. You can have two separate diffs get reviewed and wait to land them around the same time after they are both green'd.

src/util.cpp
693 ↗(On Diff #8528)

brackets

704 ↗(On Diff #8528)

brackets

This revision now requires changes to proceed.May 9 2019, 20:52
markblundeberg marked 3 inline comments as done.

rebase ; braces

markblundeberg added inline comments.May 10 2019, 00:11
src/init.cpp
2264 ↗(On Diff #8528)

OK, recalibrating. :-)

jasonbcox accepted this revision.May 10 2019, 01:12
This revision is now accepted and ready to land.May 10 2019, 01:12