"Where" is a contract's state stored?

I've read over the yellowpaper and Appendix E, yet the specific format of the state is not yet clear to me.

Suppose in some block, a contract with address A stores a key value pair, denoted (K, V). What is the key in the modified Merkle Patricia tree?

Does the top level tree store the mapping of { address -> account_tuple } where account_tuple has the contract state root key? In that case, does the top level tree also store { contract_state_root -> ??? } key-value pairs, relying on the hash function to avoid collisions between addresses and account state roots?

Can anyone point me to the relevant part of the code in either the cpp or python implementation?

Best Answer

Sign In or Register to comment.