Post
Topic
Board Development & Technical Discussion
Re: Different sites report different blockchain sizes?
by
bob123
on 16/06/2018, 17:48:48 UTC
There's no way to tell it's "no longer needed" though.
There's no central arbiter that decides whether a block is needed/valid or not.

Each node can decide for his own whether a block is need (e.g. part of longest chain) or valid (has to be validated anyways).
Okay, that came out wrong.
I meant no node can tell if its block (the block it has received) is not going to be orphaned in the future for a block with a higher POW.

I understand that. But after the block got orphaned, the node definitely knows that it is not part of the longest chain and (theoretically) can be discarded.



Quote
Theoretically it still would not be necessary to store this block. In case of a reorganisation the block(s) can easily be broadcasted / received via the network.
If no one stores blocks where do nodes get blocks to bootstrap from? Huh
Obviously for a node to receive a block from a peer, another node has to have stored it then sent it.
If you don't store it, you can't send it.

I was not refering to blocks which are included in the longest chain. I was refering to orphaned blocks.
In your statement you were talking about reorganization of the latest X blocks.

Nodes do not need to store blocks which are currently not in the longest PoW chain.
If my node is up to sync and someone else broadcasts a new block whose heigt is 1 above the 'current' height, with different 'previous' blocks, i do not need to have those previous blocks (which weren't part of the blockchain until this newest block got broadcasted. I could easily just request the block information from this node (who definitely has the information since a miner built upon it). 



Quote
Do most clients (bitcoin core?) really store those orphaned blocks (especially from years ago)? If so, is there a specific reason why it has been decided to keep them ? Or are they just kept because there is no real reason to delete them?
AFAIK, orphaned blocks are stored in the node's blockchain forever, iff it received it when it wasn't orphaned yet.
No node would upload a block that wasn't part of the canonical chain (ie a new node in the network won't receive old orphaned blocks)

If you, with 'nodes blockchain' refer to the block files (blk*.dat), then this answers my question. Thanks.