13

Several sources mention the idea of state-trie pruning. What is that, and is it currently being implemented on the network? Is this a manual process or can it be done automatically? If Ethereum is currently processing 1 GB per month under the current volume, and could grow with greater adoption, can state-trie pruning prevent the size of the ethereum blockchain from becoming unwieldy? Some sources seem concerned.

17

It is a similar concept to garbage collection in programming languages and in tree-based version control system like git. When ethereum contracts run, they modify their state. And since the state tree is an immutable append-only structure, it means that every time the state is modified, it gets a new state root. Some elements that were reachable from the old roots may be not be reachable from the new root (due to operations that delete or modify entries). Theoretically, they can be pruned (garbage collected). However, since the Proof-Of-Work consensus as it is does not define when state transitions are final, there is always a theoretical possibility that state will be reverted to older roots and things that were pruned would be needed again. So, pruning is currently a trade-off. We say, that, for example, after 5000 block we assume that the state won't be reverted and prune all unreachable nodes. Someone might still want to disable this feature to keep the entire history of the blockchain for special purposes.

Here is a very detailed description: https://blog.ethereum.org/2015/06/26/state-tree-pruning/

  • 4
    Answers need to be more than just a link. The answer should make sense even if the link breaks. – Tjaden Hess Jan 24 '16 at 20:21
  • 1
    Note that the correct term is state trie but for historical reasons it's correct that this post is referring to state tree. – Afri Mar 28 '16 at 11:45
  • 1
    Trie is a tree. – Erkin Alp Güney Jul 3 '17 at 9:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.