Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
full-node: Add info on setting node to prune to reduce storage #1465
Conversation
wbnns
added
the
Merge Scheduled
label
Jan 1, 2017
wbnns
self-assigned this
Jan 1, 2017
|
It might be good to also mention that Does SegWit change the 550 MB limit? Blocks will be bigger after SegWit. I don't object to adding this, but it might become slightly worrisome if nearly everyone starts running with pruning. The P2P network currently doesn't handle this very well. |
|
@theymos Hey, thanks - just pushed an additional commit to add a note regarding I was under the impression that SegWit doesn't have any effect on the minimum pruning configuration but am double-checking. I also reached out to @harding for feedback. He mentioned a separate revision that might need to be made, in that he is able to use Will update that too in this PR, if so. |
| +and `importprivkey`. | ||
| + | ||
| +To enable block pruning set `prune=<N>` on the command line or in `bitcoin.conf`, | ||
| +where `N` is the number of MiB to allot for raw block & undo data. |
harding
Jan 2, 2017
Contributor
Nitpicks: I think either the <> should be removed from the prune=<N> or they should be added to the N so that it's clear that they shouldn't be part of the actual entry. Also I think & should be and in regular paragraph text.
|
Thanks for creating this, @wbnns! I left one comment on the diff and I have some more information below that might be useful. Disabled RPCs in pruned modeThe RPCs listed as disabled were later re-enabled by the following commit which allows them to function if no rescan is requested. As a regular user of a pruned hot wallet that I also use as a watching-only monitor for my cold wallet, I can confirm that
(import|remove)prunedfunds RPCsI think these two RPCs should also be mentioned in the documentation:
550 megabyte minimum block store and segwitI checked the code, and this minimum is unchanged with regard to segwit. Here's the relevant code comment and constant: // Require that user allocate at least 550MB for block & undo files (blk???.dat and rev???.dat)
// At 1MB per block, 288 blocks = 288MB.
// Add 15% for Undo data = 331MB
// Add 20% for Orphan block rate = 397MB
// We want the low water mark after pruning to be at least 397 MB and since we prune in
// full block file chunks, we need the high water mark which triggers the prune to be
// one 128MB block file + added 15% undo data = 147MB greater for a total of 545MB
// Setting the target to > than 550MB will make it likely we can respect the target.
static const uint64_t MIN_DISK_SPACE_FOR_BLOCK_FILES = 550 * 1024 * 1024;The codebase includes an integration test ( Under segwit, the maximum block size is somewhat less than 4 MiB and I'd guess that the undo data is somewhat larger in the typical case (as there will be more tx-per-block in the typical case) and the orphan blocks are also larger, so I'd guess that in the worst case (4 MiB blocks) we're looking at about half a day worth of blocks and in the expected case (~2 MiB blocks) we're looking at a day worth of blocks. Perhaps it would be worth strengthening the language in the final paragraph to encourage more people to run with higher values than the minimal. P2P network concerns@theymos are you aware that pruned nodes do relay new blocks? (I ask because I used to think that they didn't until I was corrected.) Pruned nodes will also relay transactions like any other node. This should mean that an always-on node that enables pruning shouldn't change the network dynamics significantly with regard to other always-on nodes. Pruning then only reduces the capacity available to nodes who are in IBD or who are catching up, but I think it's fair (but not ideal) for those nodes to wait---especially when the alternative to people using pruning is probably them not running a node at all, which likely means fewer economic full nodes and thus less security against dishonest mining. In addition, if there's a disruptive loss of capacity in serving historic blocks that's probably a problem we can fix easily and immediately in the short term by a few Bitcoin supporters buying a bunch of bandwidth (which, though not cheap, is not terribly expensive in data centers) for bolstering network capacity to serve historic blocks. Meanwhile, hopefully that will put the spurs into efforts to allow pruned nodes to each serve a subset of historic blocks. IMO, we should be promoting pruning more because it's a path to more people running economic full nodes. Updating release notes@wbnns Please don't edit the release notes (except for formatting issues) unless the note is changed first in the Bitcoin Core repository. Thanks again for making this PR! |
|
@harding Thanks! I revised the copy as per your suggestions. Also, yeah, not touching the release notes. Was referring to fixing the full node page. |
|
a133c22 LGTM. Thanks! |
wbnns commentedJan 1, 2017
This PR adds additional info to the Running a Full Node page regarding how to configure a node to
prunein order to reduce storage requirements:Unless others object, this will be merged on Wednesday, January 4th.