0

When synchronising a new full node, the first step is to download all the available blocks, it's interesting to note that the node is not usable right away as it needs to pull from the network all the states the blockchain needs to be in the actual "state".

The question is, does all this new data take up space or it simply rewrites data in each block leaving the chain data size unchanged?

Thank you

4
  • It takes up space
    – zmy
    Commented Jul 23, 2021 at 6:28
  • How can I know the actual number of states in the mainnet ?
    – Cristofor
    Commented Jul 23, 2021 at 6:35
  • How can I know the actual number of states in the mainnet ?
    – Cristofor
    Commented Jul 23, 2021 at 6:35
  • I am not sure of my answer, I am just expressing my opinion, and I would like to know the correct answer to this question.
    – zmy
    Commented Jul 23, 2021 at 6:52

2 Answers 2

2

The question is, does all this new data take up space or it simply rewrites data in each block leaving the chain data size unchanged?

There are two normal operating modes for Ethereum nodes: full node and archive node.

The full node automatically prunes the old state as you say. The full node is the default mode. The disk space requirements for the archive node are much higher, several terabytes.

More information about the state scaling issues here.

4
  • So lets say all the blocks are 400GB, syncing the state of the chain makes it always 400GB right?
    – Cristofor
    Commented Jul 23, 2021 at 9:30
  • No, because there is Merkle Tree overhead on the state. Please see the post I linked. Commented Jul 23, 2021 at 9:31
  • 1
    Does it add significat space respective to the actual size of the blocks?
    – Cristofor
    Commented Jul 23, 2021 at 9:36
  • 1
    A good question: it was discussed by Vitalik here vitalik.ca/general/2021/06/18/verkle.html - but I guess no one has run the figures against the production data Commented Jul 24, 2021 at 8:47
0

Each account fits within 128 bytes, there are 160 million of accounts so the state takes up about 19 Gigs if we extract only the info that matters. However there are supporting data structures to hold this , like Patricia Merkle Trie and frozen chain data (blocks, transactions) which take up about 400 GB on disk as of 23 Jul 2021.

The data will keep growing with time, so if you want to "compress" it, re-download the chain periodically as it is the best way to compact it.

3
  • 1
    It is no longer necessary to re-download the chain since snap sync and pruning has been implemented (Geth 1.10.0).
    – Undead8
    Commented Jul 23, 2021 at 14:12
  • @Undead8 and Level DB also defragments its files when keys are deleted?
    – Nulik
    Commented Jul 24, 2021 at 0:18
  • @Undead8 yeah thats much more efficient!
    – Cristofor
    Commented Jul 24, 2021 at 11:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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