1

In the Etherem Blog

Vitalik says: "but we do not store history older than 5000 blocks.".

1) Is it to be understood that the state Trie does not contain the state of accounts which were not in use during the last 5000 blocks?

2)Let's say a guy awakeness from a hibernation after 50 years and he wants to make a transaction referencing a block which happened years ago. Taking into account all the current blockchain pruning algorithms implemented or to be soon implemented into Ethereum; how would the protocol go about that? I assume most of the typical full nodes wouldn't even contain the blocks containing transactions mentioning that particular account on their HDDs (again are there any blockchain (not the Trie State) pruning algorithms in place right now?) Probably it would be contained on a few of the archival nodes. How would the protocol go about that?

So the question spans a little across the architecture of Ethereum itself (it suggests that we actually do have a few types of full-nodes, ones that store all the data and others who decided to use some pruning algorithms.) Not that it threatens cryptographic security, as the recent hashes would be enough to verify whether those placed 50 years ago are correct but that would require verifying all the blocks again once we deleted them from the state Trie.Other option would be to TRUST an archival node right-away but then not the cryptographic security BUT, the decentralized nature of services suffers greatly.

Curious am I.

1
  1. This is incorrect. I think the disconnect is that the block doesn't just contain changes to the state, it also contains the state root itself, which is generated using the entire current state. Essentially this means that, for the last 5000 blocks, the entire state is stored for each of those blocks, but discarded for blocks before that. So you have the state of every account at blocks n to n-5000, but not before that.

  2. Again, see #1. The person wouldn't have issues because their account would still exist in the current state. Not quite sure what you mean by "referencing a block which happened years ago" though. You don't reference a block when making a transaction. They may be confused though since in 10 years the Ethereum blockchain will likely look pretty different with sharding, plasma, casper, etc.

  • I know that each block contains a state root. Blocks contain transactions which alter/update the current state. That's clear. – Vega4 Feb 27 '18 at 14:25
  • I think what you wrote is to a large extent wrong. It suggests Ethereum stores the entire copy of a trie for each of the past 5000 blocks, whereas the Vitalik's blogs and logic suggest non-modified nodes are simply referenced in the new instance of the Trie. – Vega4 Feb 27 '18 at 14:32
  • My only trouble is; how does network process a transaction which references an account whose state is no longer part of the State Trie. As I understand after 5000 blocks it is no longer part of the State Trie has been pruned and now it needs to be recalculated from the transaction history. Wrong? – Vega4 Feb 27 '18 at 14:35
  • It doesn't need to store an entire copy of the state trie for each of the 5000 blocks. Much of the data is unchanged, so it doesn't re-store it. But the state root is the merkle patricia tree of the entire state. It still stores the complete state of the last 5000 blocks, even though much of it is unchanged in those blocks and references the oldest block that the state is still stored for. It isn't actually a reference to the old block. – flygoing Feb 27 '18 at 14:38
  • For example: a contract that is unchanged from block 1 to block 2 and to block 3 will have the same hash, so the state of that contract is only stored once in the database, and lookups of the hashes all point to the same data. – flygoing Feb 27 '18 at 14:38

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.