You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a workaround it is possible to start a node with the datadir on one hard drive and another one with the datadir on the other hard drive using -connect=localhost to import the blocks
@MarcoFalke I was just looking at this because I've been looking at issues related to re-indexing. Please re-open this issue if you agree with my thoughts below.
I think that -prune=N plus -loadblock=path could be made to work. That seems to make sense. An example use case is like what you were doing in your issue report above, where you have a clean set of block files and you want to create a pruned node from them, but you don't want to change the input set of block files.
I think that -prune=N plus -reindex makes potentially less sense together and should not be made to work.
Enabling this combo could be dangerous by being destructive of the input blk files. If a problem occurs during re-indexing, then this combo may increase the chance of having to re-download lots of block data. If we leave them as a non-effective combo, then many re-indexing failures can be overcome by simply staring over with the original blk files still intact.
A case where this combo may not make sense has to do with out of order blocks in blk files. The -reindex process can process blocks out of order. We wouldn't want to prune a blk file that contains a block that was encountered out of order because when an out of order block is processed during re-indexing, its location is saved for a later re-read from the blk file after its parent is processed. If we pruned the blk file containing it, then we'd lose it and all of its ancestor blocks. We'd have to re-download them because the re-index process would consider all of its ancestors as being encountered out of order and not connectable. Therefore, we would not prune those blk files and thus the -prune=N would be a potentially meaningless suggestion (depending on how out of order a block was in a set of input block files) rather than a limit set by the node operator that will be generally adhered too. A worst case would have the last/best block inserted after genesis in the first blk file (dumb, but possible). No pruning would be possible until after everything is re-indexed.
Activity
maflcko commentedon Dec 24, 2021
As a workaround it is possible to start a node with the datadir on one hard drive and another one with the datadir on the other hard drive using
-connect=localhostto import the blocksmruddy commentedon Apr 20, 2022
@MarcoFalke I was just looking at this because I've been looking at issues related to re-indexing. Please re-open this issue if you agree with my thoughts below.
I think that
-prune=Nplus-loadblock=pathcould be made to work. That seems to make sense. An example use case is like what you were doing in your issue report above, where you have a clean set of block files and you want to create a pruned node from them, but you don't want to change the input set of block files.I think that
-prune=Nplus-reindexmakes potentially less sense together and should not be made to work.-reindexprocess can process blocks out of order. We wouldn't want to prune a blk file that contains a block that was encountered out of order because when an out of order block is processed during re-indexing, its location is saved for a later re-read from the blk file after its parent is processed. If we pruned the blk file containing it, then we'd lose it and all of its ancestor blocks. We'd have to re-download them because the re-index process would consider all of its ancestors as being encountered out of order and not connectable. Therefore, we would not prune those blk files and thus the-prune=Nwould be a potentially meaningless suggestion (depending on how out of order a block was in a set of input block files) rather than a limit set by the node operator that will be generally adhered too. A worst case would have the last/best block inserted after genesis in the first blk file (dumb, but possible). No pruning would be possible until after everything is re-indexed.prune, import: fixes bitcoin#23852
prune, import: fixes bitcoin#23852
Merge #24957: prune, import: allow pruning to work during loadblock i…
prune, import: fixes bitcoin#23852
prune, import: fixes bitcoin#23852
Merge bitcoin#24957: prune, import: allow pruning to work during load…
Merge bitcoin#24957: prune, import: allow pruning to work during load…