Questions tagged [state-trie]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
1answer
77 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 ...
1
vote
1answer
104 views

What does State Trie save when pushing into array?

I'm interested/worried about the size of the State Trie over time Lets suppose I have a contract with two vars: uint myNumber; uint[] myArray; As far as I understand, If I change the value of "...
1
vote
1answer
209 views

Merkle proof for Smart Contract mapping field data

I'm trying to get merkle proof for Ethereum Smart Contract mapping field data. I created test smart contract and deployed to test network. Smart Contract Code like following code: contract ...
0
votes
1answer
250 views

Accessing older blocks from Geth: Returned error: missing trie node 94d34

When my Nodejs script uses web3 to query a geth node running in a private Ethereum network for an older block, I encounter the error UnhandledPromiseRejectionWarning: Error: Returned error: missing ...
0
votes
1answer
206 views

Geth syncing - Jan 18, how much time should wait before I call it quits. (First time miner)

After 3 days; current status: > eth.syncing { currentBlock: 4829460, highestBlock: 4829665, knownStates: 19675738, pulledStates: 19646971, startingBlock: 4828906 } Getting ti
1
vote
1answer
81 views

Upgrade a fully synced node to archive node?

Is it possible to upgrade a fully synced node to archive node ? means can i download older states by changing gcmode to archive ? or i will have to start from scratch ?
1
vote
1answer
169 views

How many non-empty accounts are there?

I am researching into the statistics of Ethereum and I an looking for a datum of how many non-zero balance account currently exist in Ethereum? I know that in total 30M of accounts were created but ...
0
votes
0answers
12 views

The state tree uses the Merkel-Patrica (MPT) tree, while the transaction tree and state tree use the Merkel tree?

In some blogs, I have read the theory such as this: The state tree uses the Merkel-Patrica (MPT) tree, while the transaction tree and state tree use the Merkel tree. I want to be sure that this view ...
1
vote
0answers
44 views

the change of storage trie tree when the data in smart contract is changed

As we all know,the data in smart contract is stored in storage trie tree. If the data of a smart contract is modified, will a new storage trie tree be generated, or will the data is modified on the ...
0
votes
0answers
12 views

State size per-contract breakdown

Are there charts for per-contract state size? I came across some blockchain size chart but couldn't find any per-contract breakdown. Suppose I have a full node (geth or parity), is there an "easy&...
3
votes
0answers
58 views

What happens in the account state when we pre-send ethers to a smart contract?

I'm asking this question in relation to this one : pre_sending Ether where the OP asked in a comment of the answer about what happens at the low-level when pre-sending ethers to a smart contract. As ...
1
vote
0answers
30 views

How to convert geth arhive to full node without loosing intermediate state

We have a geth node that runs with --gcmode "archive". However, the recent growth of disk space is unsustainable and we want to change this to a full node. If I stop the node and just re-run ...
7
votes
3answers
1k 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 ...
0
votes
1answer
28 views

in which currency does state trie's balance is stored?

My question is very simple and I couldn't find the answer for it. There's a state trie in ethereum. Each state trie has address as key and value as an object which has balance as one of the keys. I am ...
0
votes
0answers
22 views

how does a new node get state data and where are storage/recepit trees stored?

I know that state data isn't stored on blockchain. Each node stores it separately on hard disk. Question 1) Let's say I am a new node and just joined the network. What will happen is I will sync the ...
0
votes
0answers
13 views

What's the point of keeping historical transactions?

I understand there are a few different sync modes. Archival nodes keep everything and they take ~2TB if not more. geth --fast downloads all historical transactions (besides transaction headers), but ...
3
votes
0answers
43 views

Why using Merkle Patricia trie for keeping transactions and receipts instead of Merkle trie?

Using Merkle Patricia trie for keeping Ethereum states has the advantage of fewer changes in the data structure during the updates in the states compared to Merkle trie. But what is the advantage of ...
0
votes
0answers
21 views

How is the storage trie of a user account which does not belong to any contract?

We know that storage trie (stored in the leaf node of state trie) is storing the contract's data related to an account. Then, what will be stored in the storage trie of a user account which does not ...
1
vote
0answers
153 views

Obtaining pulledStates from Geth

How to obtain pulledStates from Geth when syncing is false?
2
votes
0answers
36 views

Why does Ethereum have nested trie structure that a storage trie is under a account in state trie?

As I understand it, the leaf node of the state trie has account data. The account data has a storage root, and the variables of the contract are stored in the leaf node of the storage root. But ...
4
votes
0answers
127 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 ...
1
vote
1answer
31 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
0answers
111 views

Geth Dump Has Been Running For A Week

For my project I want to dump the full state data of all Eth wallets/balances. I have a fully synced Geth node with all state data (over 2TB). I started a block dump geth dump 7300000 --datadir "/...
2
votes
0answers
67 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 ...
1
vote
1answer
66 views

Is there any way to only find blocks where state changes of a contract occurred?

I'm currently using the ethereumjs libraries (https://github.com/ethereumjs) to iterate over the blockchain, replay transactions and read the state trie of a contract from the geth leveldb. Currently ...
4
votes
1answer
291 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
178 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   ...
1
vote
1answer
69 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
159 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 ...
4
votes
1answer
940 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
2answers
321 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 ...
6
votes
2answers
2k 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 ...
1
vote
0answers
24 views

Would full but not archive node delete old trie node from LVLDB?

Full not archive node would store the nearest 128 block's state in their lvldb. How could they delete old trie state in lvldb? I found they use dereference function in WriteBlockWithState function to ...
88
votes
6answers
65k 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
2
votes
2answers
90 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 ...
2
votes
1answer
767 views

How selfdestruct() works?

I'm wondering about how selfdestruct() actually works. Does it actually delete contract codes from the storage? Or just delete the contract address from state trie? If just deleting the contract ...
31
votes
3answers
12k 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 ...
1
vote
3answers
517 views

how do you check if the account exists in current state?

Currently there is no way to check somehow that an account exists in the trie. I am looking for something like this: > web3.eth.accountExist("0x743623152a53b53be5f3463746726373") true > Is a ...
6
votes
1answer
174 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 ...
2
votes
1answer
422 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
1answer
92 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 ...
1
vote
1answer
113 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
0answers
72 views

Custom Merkle Patricia Tree

One of the requirements of building our company's DApp is to maintain a separate, custom Merkle Patricia Tree that contain's data from our company's platform only. The Tree needs all CRUD operations ...
1
vote
0answers
425 views

Is it possible to download the Ethereum state trie and state database on their own?

I want to download a more or less recent version of the Ethereum state trie and state database, i.e. some version from within the last 1000 or so blocks. I know that I could set up a full node and let ...
3
votes
1answer
1k 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 ...
26
votes
3answers
17k 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 ...
1
vote
0answers
35 views

How to check last block in which storage variable was modified?

I am looking for method to quick chceck in which block variable was modified last. Assuming I have geth database synced in archive mode, that means I have all previous world states tries and accounts ...
1
vote
0answers
20 views

Why do we need to keep state trie? Only for the computation speed?

I'm studying solidity these days and came up with this silly question. Is there any other reason why every node is maintaining state trie?
1
vote
1answer
735 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 ...
3
votes
2answers
284 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 ...