160
votes
Ethereum block architecture
Here's my interpretation, based on the yellow paper:
...the Tries should look more like this:
82
votes
Accepted
Ethereum block architecture
Lets first start with my adaptation of this figure illustrating the Bitcoin block structure:
So far so good. All fairly basic.
Enter Ethereum and things get a wee bit more complex. After reading ...
33
votes
Accepted
Where is the state data stored?
Conceptually, there are 2 important components of an account-based blockchain:
transactions represent state transition functions
the result of these functions can be stored
A "full/archival" node ...
23
votes
Ethereum block architecture
Here is a complete structure of a block and where it plays its role in Ethereum's blockchain.
You asked for a diagram but i think this would be more explanatory.
21
votes
Ethereum Merkle Tree Explanation
The state has the information of all accounts in the blockchain, it is not stored in each block. The state is generated processing each block since the genesis block. Each block will only modify parts ...
17
votes
Where is the state data stored?
Technically the states are assembled into a state tree (patricia-tree) linked to the account (balance in case of EAOs and balance and storage in case of contract's account) and to the blocks (figures ...
14
votes
Ethereum Merkle Tree Explanation
Ethereum is said to have an account-based blockchain. The state isn't directly stored in each the block.
To build a better conceptual understanding, we can say that all account states reside locally ...
12
votes
Ethereum block architecture
The description can be found in the Yellow Paper which is the formal specification of the Ethereum protocol.
Here are the main pieces of a block:
4.3. The Block. The block in Ethereum is the ...
eth♦
- 85k
12
votes
Accepted
Getting complete state of a smart contract
There is no way to do it via JSON RPC or with web3 API.
I've created a repository on Github with an example showing how to read all Patricia trie entries in a block and in any contract storage using ...
10
votes
Ethereum block architecture
Vitalik Buterin gives a compact answer:
Every block header in Ethereum contains 3 trees for three kinds of objects:
Transactions, Receipts (essentially, pieces of data showing the effect of each ...
10
votes
Ethereum block architecture
Here's a picture from V's article regarding data structures for light clients:
https://blog.ethereum.org/2014/02/18/ethereum-scalability-and-decentralization-updates/
10
votes
Accepted
How many trie's does Ethereum have?
This sounds correct to me.
Referring to the graphical interpretation of the descriptions in the Yellow Paper, your 4 tries are shown in the "Information required to derive block header" section.
...
8
votes
Accepted
Is it possible to access storage history from a contract in solidity?
No, Solidity code (and EVM code in general) is only able to read the current state at the block at which it is being called. If it were able to read state at previous blocks you would need the entire ...
7
votes
Accepted
Full node sync only preserve the last 128 history states
The behavior has changed with the release of geth v1.8.0
Fromt the release notes
Tracing and pruning: By default, state for the last 128 blocks kept in memory. Most states are garbage collected. ...
6
votes
Accepted
How was the state-bloat attack that led to the EIP 150 hardfork performed?
Ancient history, but here goes :-)
There was one coordinating contract for the initial attack. A later version had a more complex algorithm to generate the empty account addresses, presumably to try ...
6
votes
Ethereum block architecture
Extrapolating from the syntactic block structure, we can also ask what the semantic ethereum world state structure looks like. I use this diagram to explain the relationship between "on-chain&...
5
votes
Where is the state data stored?
Fusing nuggets of information from multiple sources (primarily, this and this):
State data (together with account balances, contract code and account nonce) is stored by every Ethereum ...
5
votes
Accepted
Getting current full state
Each node keeps a complete copy of the current state, and update it with each new block.
New nodes need to reconstruct the state by replaying the state changes in each block, although state-trie ...
5
votes
Accepted
How is a post-transaction state calculated?
The state trie contains the balance of each account. Even transactions that throw an exception result in a reduction in the sender's balance through gas costs, which means that the resulting state is ...
4
votes
Is it possible to access storage history from a contract in solidity?
Yes, it is possible with Web3 at any given block.
If your contract has:
contract ValueStore {
function getValue(uint param) constant returns (uint returnedValue);
}
Then, after instantiating ...
4
votes
Are there multiple instances of Ethereum state or a single latest image?
The ethereum state is stored on disk in a merkle tree separate from the actual data of the blockchain (ie. the blocks of transactions). The state is not included in blocks - only the state root is ...
4
votes
How to access Geth's state trie
Doing this using web3 over RPC will take forever, as you've found. Reading the .ldb files is the way to go, and is something that's come up in similar questions before.
I don't know of any working, ...
4
votes
How Ethereum state tree is formed?
[Q1]
Records in the state trie can exist independently of the state root that references them. Each node is stored in what is essentially a flat hashmap, and nodes have references to allow them to ...
4
votes
Accepted
Does geth --syncmode light download the State Trie?
The light client does not download state data. It downloads the header chain, and verifies the proof-of-work but not the transactions themselves. Each block includes a state root, which allows it to ...
4
votes
Accepted
Why are transaction tries in Ethereum not plain Merkle Tries?
First, it should be noted that there is no such thing as a "plain Merkle Trie". The Merkle tree found in Bitcoin is not a radix tree (trie).
The main reason Ethereum uses a Patricia Trie for ...
4
votes
Where are the Ethereum smart contracts actually stored?
from the ethereum yellow paper
The world state, is a mapping between addresses and account states (a data structure serialised as RLP).
Though not stored on the blockchain, it is assumed that
the ...
3
votes
Reading Ethereum contract state variables
In the context of your question, you can think of the blockchain as a database. A database on its own cannot "send data to the external world" - it requires some script to query the database and then ...
3
votes
Reading Ethereum contract state variables
Yes, this is correct. Everything on the blockchain is public, but only the current state is visible to smart contracts.
Interestingly, using a Merkel proof, you can prove to a contract that another ...
3
votes
Accepted
Do the Ethereum clients store 'historic state' or just 'current state.'
An Ethereum full node does store historic state. In fact, every block contains the root of the state tree, such that it "snapshots" the entire state every block. The reason this is isn't a gargantuan ...
3
votes
Accepted
How can empty accounts with a nonce of zero appear on the blockchain?
When you send a zero value transaction to an account that does not exist. The same works for zero value creates (both through transactions and the CREATE opcode) as well as CALLing in to an account ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
state-trie × 101merkle-patricia-tries × 27
go-ethereum × 26
blockchain × 12
accounts × 10
state-trie-pruning × 10
transactions × 9
synchronization × 9
storage × 9
storage-trie × 9
web3js × 6
yellow-paper × 6
state × 6
solidity × 5
contract-deployment × 5
evm × 5
leveldb × 5
state-transition × 5
blocks × 4
fast-sync × 3
attacks × 3
history × 3
contract-development × 2
contract-design × 2
mining × 2