Questions tagged [state-trie]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
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 ...
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&...
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 ...
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 ...
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 ...
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 ...
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 ...
1
vote
0answers
153 views

Obtaining pulledStates from Geth

How to obtain pulledStates from Geth when syncing is false?
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 ?
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 ...
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 ...
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 "/...
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
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 ...
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
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 ...
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
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 ...
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 ...
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 ...
0
votes
1answer
251 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 ...
2
votes
1answer
768 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 ...
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
738 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 ...
2
votes
2answers
91 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
155 views

Are all state key-value pairs saved in a big trie?

I am learning Ethereum from yellow paper, I have some questions. The world state is talked in the paper. It seems that there is only one world state for all accounts in the whole blockchain from ...
2
votes
1answer
187 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 ...
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 ...
0
votes
1answer
362 views

Ethereum account code hash

I've created a contract https://ropsten.etherscan.io/address/0xfaba4475358c1c23e37549f9bd54300261873d41#code And using its createChild() method I've created 3 children https://ropsten.etherscan....
1
vote
1answer
32 views

Can state trie be hacked?

Ethereum's purpose is to decentralize components in the network. There is only one state trie in the network, Can't it be hacked and changed (because there is only one trie) ?
3
votes
2answers
286 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 ...
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 ...
4
votes
0answers
400 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 ...
0
votes
1answer
194 views

Access contract storage from chaindata

I am trying to understand how to retrieve the complete storage of a contract based on chaindata (e.g. geth) of a full node. I have already found how to programmatically access the chaindata (which is ...
2
votes
0answers
147 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 ...
4
votes
1answer
417 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
2answers
344 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 ...