Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: darosior on January 19, 2019, 03:53:19 PM



Title: Disable pruning on a node with a pruned block chain
Post by: darosior on January 19, 2019, 03:53:19 PM
Hi,

I had to prune a bitcoin-core node I run because of the available disk space. I'll manage to get more space in the coming week and I'll disable pruning. I was wondering : what will happen at this stage ? Since blocks were validated and then erased, will the node re-validate all my missing blocks and then every block on top of it ? This would make me revalidate the entire block chain.


Title: Re: Disable pruning on a node with a pruned block chain
Post by: aliashraf on January 19, 2019, 04:19:00 PM
Hi,

I had to prune a bitcoin-core node I run because of the available disk space. I'll manage to get more space in the coming week and I'll disable pruning. I was wondering : what will happen at this stage ? Since blocks were validated and then erased, will the node re-validate all my missing blocks and then every block on top of it ? This would make me revalidate the entire block chain.
I'm not aware of any built in api in bitcoin to help it in a more efficient way than just a clean bootstrap but more importantly, I'm curious what the incentive would be if you are convinced about the validity of the chain your node is committed to and you have long enough chain length? Won't it suffice to just disable more pruning thereafter?


Title: Re: Disable pruning on a node with a pruned block chain
Post by: darosior on January 19, 2019, 04:23:35 PM
Won't it suffice to just disable more pruning thereafter?
I may have misexplained but disable pruning is what I want to do. If you are asking about the incentive of disabling it, I want to be able to set `txindex=1` and then run a transaction explorer.


Title: Re: Disable pruning on a node with a pruned block chain
Post by: darosior on January 19, 2019, 07:25:26 PM
AFAIK bitcoin core will re-download and re-verify all missing blocks

Won't it suffice to just disable more pruning thereafter?
I may have misexplained but disable pruning is what I want to do. If you are asking about the incentive of disabling it, I want to be able to set `txindex=1` and then run a transaction explorer.

I don't get what you're trying to tell. but you can't enable txindex if you enable prune mode
That's exactly my point. I'll describe it step by step :
step 1 -> I have a pruned node
step 2 -> I disable pruning
step 3 -> The block chain is no longer pruned
I was just asking what happened between steps 2 and 3.


Title: Re: Disable pruning on a node with a pruned block chain
Post by: achow101 on January 19, 2019, 07:31:22 PM
That's exactly my point. I'll describe it step by step :
step 1 -> I have a pruned node
step 2 -> I disable pruning
step 3 -> The block chain is no longer pruned
I was just asking what happened between steps 2 and 3.
The blockchain will be redownloaded and reindexed. It is not validated again as the blocks being downloaded have already been validated and that information is stored. Only the blocks themselves will be downloaded and added to the block index.

Since you plan on enabled txindex too, you should disable pruning and enable txindex in the same step. That way the txindex will be built at the same time that the blocks are reindexed after they are downloaded. This will prevent you from having to reindex twice.


Title: Re: Disable pruning on a node with a pruned block chain
Post by: darosior on January 19, 2019, 07:40:20 PM
That's exactly my point. I'll describe it step by step :
step 1 -> I have a pruned node
step 2 -> I disable pruning
step 3 -> The block chain is no longer pruned
I was just asking what happened between steps 2 and 3.
The blockchain will be redownloaded and reindexed. It is not validated again as the blocks being downloaded have already been validated and that information is stored. Only the blocks themselves will be downloaded and added to the block index.

Since you plan on enabled txindex too, you should disable pruning and enable txindex in the same step. That way the txindex will be built at the same time that the blocks are reindexed after they are downloaded. This will prevent you from having to reindex twice.
Thank you for the clear answer and the advice.