0

Is there Blocks pruning in ethereum clients such as geth and how does that work? by pruning I meant, does the blocks information whether stored in DB like in cpp-ethereum are deleted if the blockheight is beyond a certain block height range? This question is related to saving storage space.

If so, how does it happen? does it just straightforward delete the blocks beyond the range or is there any other computation going on there to make sure the integrity of the chain?

0

Blocks aren't pruned. They are stored in geth/chaindata/ancient directory and you can't delete them because your Geth is serving this information to other nodes that at any point in time would need to sync just like you.

The only pruning that takes places is State pruning, old state objects are deleted from Merkle Trie as new blocks are added.

The latest addition in space saving implemented in geth was transaction unindexing, as a part of 1.10 version. Now old transactions are deleted saving about 40GB of space. This is the default.

So, if any option to save disk would exist, it would be implemented, but currently the space is as optimal as it can be.

There is another project that has a goal of optimizing resources called Erigon, so you might to check it

https://github.com/ledgerwatch/erigon

3
  • Thanks for your answer, so the "Full node" performs this State Pruning on blocks that is behind some range right? Where can I get more/detailed implementation of this state pruning? we have forked cpp-ethereum and continued implementation, we just updated it to support latest EVM and webscoket, we are doing the updates to support fast sync and this state pruning as well. Aug 1 at 2:15
  • cpp ethereum is dead, I don't think it is even supporting London fork
    – Nulik
    Aug 1 at 18:26
  • exactly what i said, it is dead and we have forked it to continue implementation ourselves. Aug 2 at 2:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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