-
|
https://github.com/ethereum/yellowpaper/blob/f41ec9a6785374c1d9b9e9a064e3ceae1413805a/Paper.tex#L272
Is the storageRoot not included because it is unnecessary duplication since the trie can be referenced directly with an Address? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Answer from @ajsutton: Formally the Account is nonce, balance, storageRoot and codeHash and I think it’s encoded just as an RLP list of those values. I think https://github.com/hyperledger/besu/blob/110052c9f3990dce7e3035579a692ab9bb75daec/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/StateTrieAccountValue.java#L99 is the relevant code in besu. Given the way the executable specs are storing the storage trie by Account rather than it’s root hash then yeah I think you’re right that they can not actually store the storage root in the account but generate it when needed from the stored trie which is looked up by Address. There seems to be some confusion between the storage trie root hash and the storage trie itself. The root hash is part of the account serialization but the storage trie itself is not. σ[a]s is defined as the root hash but an equivalence is defined in equation 7 which says the trie itself is equivalent to σ[a]s. |
Beta Was this translation helpful? Give feedback.
Answer from @ajsutton:
Formally the Account is nonce, balance, storageRoot and codeHash and I think it’s encoded just as an RLP list of those values. I think https://github.com/hyperledger/besu/blob/110052c9f3990dce7e3035579a692ab9bb75daec/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/worldstate/StateTrieAccountValue.java#L99 is the relevant code in besu.
Given the way the executable specs are storing the storage trie by Account rather than it’s root hash then yeah I think you’re right that they can not actually store the storage root in the account but generate it when needed from the stored trie which is looked up by Address.
There seems to be some confusion between the stor…