Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [state-trie]

The tag has no usage guidance.

0
votes
0answers
15 views

Ethereum Trie mutation-order-variance

Just to confirm: given a set of non-overlapping key/value tuples, for all possible orderings of it, may constructing the trie by putting each tuple in the order yield different root hashes in the end?
4
votes
0answers
49 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   ...
0
votes
0answers
7 views

Why all stateObjects are merged to the state trie in *StateDB.Finalise function?

In *StateDB.Finalise function, why stateObjectsDirty flags of stateObjects are not reset after merging to the state trie? This leads to handling all stateObjects including some stateObjects not ...
1
vote
1answer
18 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
25 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 ...
2
votes
2answers
144 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 ...
0
votes
1answer
20 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
13 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 ...
0
votes
3answers
163 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 ...
3
votes
1answer
61 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 ...
1
vote
1answer
150 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
50 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
98 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
42 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
60 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
223 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
458 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
31 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
94 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 ...
1
vote
1answer
405 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 ...
0
votes
0answers
27 views

historical background on using secure trie

I know that ether uses secure trie for security issues. However, I wonder if there were any historical events or issues before introducing secure trie.
1
vote
0answers
16 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?
0
votes
0answers
76 views

Geth: Once you've synced a full (non-archive) node, it is possible to go back and regenerate the full state trie history?

I've spent weeks syncing a full Geth node, but for part of the way (about 100k blocks), I mistakenly neglected to set the gcmode=archive flag. So, for these blocks, the state tries are gone and I am ...
0
votes
0answers
18 views

Specified Difference between Patricia Merkle tree and Bitcoin Merkle Tree [duplicate]

What are the specified differences between Patricia Merkle tree and Bitcoin Merkle Tree?
0
votes
1answer
177 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 ...
0
votes
0answers
30 views

Download all the state tries

I want to download all the state tries and for that purpose I am running my geth client in archive mode (--gcmode=archive). But It does not download all the states. Performing eth.syncing returns ...
1
vote
2answers
49 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
77 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
88 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
1answer
42 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
97 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....
0
votes
0answers
235 views

Reading state trie and storage trie

How to read the state trie and storage trie from ethereums leveldb? I tried to follow this https://gist.githubusercontent.com/tpmccallum/bd9e5538346e1defb1234f37cfd33eda/raw/...
0
votes
1answer
26 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
155 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
58 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
287 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
133 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
107 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
303 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) -> ...
2
votes
2answers
201 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 ...
1
vote
1answer
40 views

Reference a long-forgoten account

In the Etherem Blog Vitalik says: "but we do not store history older than 5000 blocks.". 1) Is it to be understood that the state Trie does not contain the state of accounts which were not in use ...
4
votes
1answer
537 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 ...
8
votes
1answer
666 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 ...
1
vote
0answers
49 views

Is it possible to download a existing smart contract state from a blockchain and deploying it in a different blockchain?

Suppose I have independent 2 ethereum blockchain on private net N1 and N2. A smart contract S exists on the blockchain N1. Consider that the smart contract S is self-complete and doesn't depend on any ...
0
votes
1answer
182 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
0answers
63 views

Get root data of smart contract

I am deploying a Smart contract with set of fields. Updating some fields using events.Till here is fine. Now here i need to fetch the root data(data while deploying the contract) Please suggest. ...
4
votes
1answer
710 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 ...
1
vote
0answers
19 views

Why an attacker needs ~2^128 computing power to spoof membership of a key/value pair in a trie?

Ethereum Wiki: Every unique set of key/value pairs maps uniquely to a root hash, and it is not possible to spoof membership of a key/value pair in a trie (unless an attacker has ~2^128 ...
1
vote
1answer
272 views

Access previous state

Let's say I have a uint public myvar in my contract that is initialized to some value. Then, myvar gets set to 3 in the next block. How can I retrieve the old value? Is this possible with web3? ...
2
votes
0answers
109 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 ...