The Stack Overflow podcast is back! Listen to an interview with our new CEO.

Questions tagged [state-trie]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
77
votes
6answers
52k 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
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 ...
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 ...
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 ...
9
votes
1answer
272 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 ...
8
votes
1answer
754 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 ...
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 ...
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 ...
7
votes
1answer
99 views

Are there multiple instances of Ethereum state or a single latest image?

Are there multiple instances of Ethereum's state? That is, is there one per mined block? Or a single latest image? Does Ethereum maintain a state snapshot, for every block since genesis, so that ...
6
votes
2answers
894 views

Reading Ethereum contract state variables

Is this assumption correct ? There is absolutely no way an ethereum contract can send data to the external world. It can only modify its state variables (later stored in the new block)and send ...
5
votes
1answer
665 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 ...
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 ...
5
votes
4answers
2k views

How Ethereum transaction tree is formed

I am looking for clarity on transaction tree structure. Below I have listed my understanding If I am not wrong the state changes are tracked in a single state tree. Each block has a state root hash ...
4
votes
1answer
881 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 ...
4
votes
1answer
337 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) -> ...
4
votes
1answer
265 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
573 views

Do the Ethereum clients store 'historic state' or just 'current state.'

I assume, given the recent state clearing, that the Ethereum clients must only store the current state of each account as opposed to all historic state. (Otherwise, if it stored a record of all past ...
4
votes
1answer
253 views

Exploring Ethereum's state trie with golang

Exploring Ethereum's state trie with Node.js It is a nice article to explore ethereum internal storage, but the code is Node.js. Does anyone have a golang version?
4
votes
0answers
98 views

How to generate a state root

I am trying to implement a Simplified World State Trie based on Merkle Patricia Tree. Take the following image for example there are four accounts address  value a711355   ...
4
votes
0answers
323 views

What is the current size of the Ethereum State?

What is the current size of Ethereum's state in bytes? I am not asking about the size of the blockchain with blocks headers, transactions and receipts. I am looking for the size of all the structure ...
3
votes
2answers
222 views

Why are transaction tries in Ethereum not plain Merkle Tries?

I understand the Ethereum block header contains a Merkle Patricia Trie (MPT) root for the global state, one for receipts (which I don't understand but am not focussed on for now), and one for all the ...
3
votes
1answer
793 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 ...
3
votes
1answer
721 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 ...
3
votes
1answer
91 views

How does knowing the root hash of a past world state help me to revert to this world state?

In section 4.1 of the Ethereum yellow-paper (http://gavwood.com/Paper.pdf) the following is written: The world state (state), is a mapping between addresses (160-bit identifiers) and account ...
3
votes
1answer
647 views

How much time until the state data is PoW validated when using parity warp?

Ethcore claims parity --warp only takes one minute to sync the chain. I tried myself and it indeed takes around 2-3 minutes on my machine with a slightly bad connection. 0 ✓ user@hoster ~ $ parity -...
3
votes
2answers
180 views

reading contract bytecode from leveldb

Is there a way to read a deployed contract's bytecode from leveldb? From what I understand, within each account in the state tree, there exists the nonce, the balance, the codehash, and the storage ...
3
votes
0answers
835 views

Questions about geth state tree pruning [closed]

In current geth, how long (in terms of blocks) will a state tree node put into the death row before being pruned? Does this vary among different sync mode? And can we configure it? Besides state ...
2
votes
1answer
103 views

Reason for World State

All Ethereum blocks contain a stateRoot field - That is, the root hash of the world state trie. I have two questions about that. From what I've understood through all the reading I've done on Casper ...
2
votes
2answers
561 views

In the Ethereum Modified Merkle-Particia tree, what do the prefix, key and value signify?

What does the prefix '3☐' mean in the leaf nodes?
2
votes
1answer
105 views

Why does the blockchain store multiple copies of the same code?

Based on joeykrug's questions on Github: Is there any reason we need to store multiple copies of code if the same contracts use the same code? For example, if a contract is deployed and another ...
2
votes
1answer
301 views

How to calculate a root node in a Merkle Patricia tree?

I'm trying to understand a Merkle Patricia tree. For example there are two accounts: x00: {balance: 1} x01: {balance: 2} I can't understand how to begin building my trie. RLP and HP encoding are ...
2
votes
1answer
227 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 ...
2
votes
2answers
249 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
266 views

Merkle tree child hashing process

Each non leaf node of a Merkle tree is just the hash of the concatenation of it's children. Does this literally mean stick the 2 hashes together or is there a more intricate process involved? i.e. ...
2
votes
2answers
145 views

Full Synchronisation with Geth Repeated Tree Node Error

I am doing a university project on the functionality of the EVM. I need to use debug.traceTransaction() function which requires a fully synchronized node. I have tried to sync Geth on a university VM ...
2
votes
2answers
148 views

Do state tree key/vaue maps reference state trees from other blocks?

Each block includes both a state root and the whole state tree. In the state trees, do key/value maps reference state trees from other blocks ?
2
votes
0answers
15 views

Question on initial sync and Freezer (SSD and HDD)

I've kicked off a fresh fast sync of Geth v1.9.2 and after 3 weeks it's still pulling states (state trie). As per the documentation you can use the Freezer with a HDD as it references old data so ...
2
votes
0answers
37 views

when syncing state trie of an Ethereum node, why not start from a recent block to reduce syncing time

as explained in this issue: https://github.com/ethereum/go-ethereum/issues/16218#issuecomment-371454280 when we are syncing an eth node, firstly it downloads the blocks, then the states, the first ...
2
votes
1answer
59 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
1answer
49 views

mining requires access to the entire blockchain?

I am reading the white paper and confused by two sentences bellow: In the Section of Mining Centralization: ... miners are required to fetch random data from the state, compute some randomly ...
2
votes
0answers
118 views

Succinct contract state/storage root of a smart contract

In the yellow paper, it is mentioned(at section 4.1) that storageRoot: A 256-bit hash of the root node of a Merkle Patricia tree that encodes the storage contents of the account (a mapping between ...
2
votes
0answers
115 views

How get public address from State Root leaf node (code inside)?

In article "Understanding the ethereum trie"is written that: For the state trie, the keys are ethereum addresses. So i obtain State Trie and in that trie I got Merkle Leaf node: ['9:', ' LEAF ...
2
votes
0answers
962 views

Geth traceTransaction: missing trie node [duplicate]

I have a fully synced Geth node and am trying to run the debug.traceTransaction() method, but it keeps giving me this error: Error: missing trie node ...
2
votes
0answers
78 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 ...
1
vote
1answer
63 views

Which node to use in Merkle Patricia Tree when there are single and shared nibbles at the same point?

If I understood well, extension and leaf nodes should be used when there are shared nibbles, and branch nodes when there are differences. Which type of node should be used when storing a different ...
1
vote
2answers
56 views

If the World State only Stores Hashes of the Code, Where Is the Underlying Actual Code Stored?

Apologies in advance if it's a silly question. I'm slowly making my way through the ethereum yellow paper. Am I correct in saying that the ethereum world state does not contain any EVM code? It only ...
1
vote
1answer
26 views

Why do Merckle trees use nibbles

In Appendix D of the yellow paper for Ethereum, it describes the Modified Merkle Patricia Tree, and states: Any series of bytes may also trivially be viewed as a series of nibbles, given an endian-...
1
vote
2answers
36 views

How are transactions stored in a block?

In State, use Merkle Patricia Trie for storing data. "key value" is account address(hash value). And also, Ethereum block uses MPT for storing transactions. However, Additionally Ethereum Block use ...
1
vote
1answer
26 views

What is “w”, the permission to make modifications?

As per chapter 9 of the yellow paper: However, I find it vaguely defined. Who gives this permission? Is it dependent on each machine or is there an objective algo to follow? What is the type of "w"? ...
1
vote
1answer
272 views

eth.getBalance(<account>, <block>) returns “Error: missing trie node”

I have used --gcmode=archive to download all the state tries and eth.syncing returns false meaning my node is in sync. When I execute eth.getBalance for blocks closer to the current block I obtain the ...