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.
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).
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.
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? 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.
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)