Questions tagged [state-trie]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
77
votes
6answers
53k views

Ethereum block architecture

Where can I find a description (preferably a diagram like below) showing the block structure in an Ethereum blockchain? Credits: Wikipedia
25
votes
3answers
15k views

Where is the state data stored?

This question was asked on Reddit a while ago: Where is the state data actually stored though? On the hard drive of each node? Separate from or within the blockchain? — Reddit: Basic ...
29
votes
3answers
11k views

Ethereum Merkle Tree Explanation

Here is my basic understanding about how Ethereum stores transactions A hash is generated for each transaction Then pairs are selected and a hash is generated for each pair This way the last ...
8
votes
1answer
764 views

Getting complete state of a smart contract

From the yellow paper, I figured out that a contract has 4 components 1. nonce, 2. balance, 3. code, 4. storage. To know about the current state of a smart contract we need to know the all these ...
7
votes
2answers
2k views

Is it possible to access storage history from a contract in solidity?

With web3, I can access the history of the blockchain like this: web3.eth.getBalance('0x1234') // returns current balance at address 0x1234 web3.eth.getBalance('0x1234', 1000) // returns balance at ...
12
votes
3answers
1k views

is there an easy way to get the full state of a contract?

I'm developing a quite complex contract with many state variables of all kinds. (mappings, arrays, uint, strings, bytes, etc). For testing, it would be very useful to get a JSON (or similar) with the ...
8
votes
1answer
1k views

How many trie's does Ethereum have?

Did I miss any trie below and get things right? Transaction tries, one per block, root hash included in the block header Transaction receipt tries, one per block, root hash included in the block ...
2
votes
1answer
242 views

Ethereum storage implementation at the database level - how is it stored

I have read the yellow paper many times as well as various articles, I suppose if I cannot find the answer here - I will look into the code. My understanding is that each contract account contains a ...
6
votes
1answer
679 views

Full node sync only preserve the last 128 history states

While researching on the different sync modes and their behaviors, I learned that geth full sync will replay all transactions from the genesis and preserve all history states, while fast sync will ...
3
votes
1answer
811 views

How Ethereum state tree is formed?

As we know each block contains a state-root. Following image is taken from https://blog.ethereum.org/2015/11/15/merkling-in-ethereum/. Ethereum Wiki: Constant light client reference: light ...
5
votes
2answers
1k views

How to access Geth's state trie

Using Geth, how can I extract a snapshot of the network state for a given block? My Geth node runs a full sync (~300 gb) which means the state trie should already be saved down. I've tried accessing ...
4
votes
1answer
889 views

Getting current full state

In my quest to understand ethereum in depth, I ended up in this article, which contains the following image: If the image above is correct, only the changes in state are taken in account to create ...
9
votes
1answer
285 views

How was the state-bloat attack that led to the EIP 150 hardfork performed?

I understand that SELFDESTRUCT and mispricing of opcodes allowed many empty accounts to be created cheaply as explained in Why were empty accounts allowed to be on the blockchain? The answer to that ...
4
votes
1answer
268 views

How can empty accounts with a nonce of zero appear on the blockchain?

Recently I have heard about zero balance accounts with a nonce of zero appearing on the blockchain. My understanding is that any account that has been used in a transaction must have a nonce greater ...
4
votes
1answer
344 views

How to collect all contract instantiations and count the bytecode redundancies?

I want to traverse the Ethereum blockchain, collect all contract instantiations, and count how often which bytecode has been instantiated. As result I want to have a map with key:hash(bytecode) -> ...
3
votes
1answer
763 views

Does geth --syncmode light download the State Trie?

I'd like to download some recent version of the Ethereum State Trie. I read here that geth --syncmode light downloads the current state. But does that only encompass the most recent blocks or also a ...
2
votes
2answers
253 views

Storage trie - are trie nodes reused for two contract instances with the same storage content?

Reading geth code and various posts here, I think I have now a good understanding of how the data is stored in Ethereum (please correct me if I am wrong at some point). At the lowest level we have a ...
2
votes
1answer
60 views

Leaf node with encodedPath containing only Hex-Prefix in Merkle Patricia Trie

A leaf node is defined as the tuple [encodedPath, value], and encodedPath uses the Hex-Prefix encoding. Is it possible we have a leaf node with encodedPath having only the prefix and no partial path ...
2
votes
0answers
80 views

What is an empty account if the state root is not empty?

"State-bloat" attacks led to an empty account being defined as an account that has zero balance, nonce and code. There was a disagreement on EIP 161: I disagree. An account should be considered ...