1

I understand that ethereum uses Trie to track the state, transactions, receipts. and each trie has key-value pair that is stored in the database.

Each blockheader also has the root has of stateRoot, transactionRoot and reciepts root. my question now is, how is the blocks and its header stored/saved? is it stored in multiple files or in leveldb? if it is stored in level db, how is it stored? is it thru Trie as well using the blockhash?

My main purpose is I want to understand how all of these are connected, say for example, i want to retrieve the balance of a certain account in height 100, but current height is already at 100k, as I read that states are "updated" and changed the value, so how does the node store the blocks information?

As I can see that blockheight are not stored in world state tries so I am confuse on how this is done.

I understand that it is specific per implementation of client like go-ethereum or cpp-ethereum. Any answer is ok i just want to have an idea. but I am more interested in cpp-ethereum.

0

Your Answer

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

Browse other questions tagged or ask your own question.