ethereum.homestead.blocksethereum.dao_fork.blocks
A Block
is a single link in the chain that is Ethereum. Each Block
contains
a Header
and zero or more transactions. Each Header
contains associated
metadata like the block number, parent block hash, and how much gas was
consumed by its transactions.
Together, these blocks form a cryptographically secure journal recording the history of all state transitions that have happened since the genesis of the chain.
Header
Header portion of a block on the chain, containing metadata and cryptographic commitments to the block's contents.
23 | @slotted_freezable |
---|
24 | @dataclass |
---|
class Header:
parent_hash
31 | parent_hash: Hash32 |
---|
ommers_hash
39 | ommers_hash: Hash32 |
---|
coinbase
48 | coinbase: Address |
---|
state_root
56 | state_root: Root |
---|
transactions_root
69 | transactions_root: Root |
---|
receipt_root
81 | receipt_root: Root |
---|
bloom
92 | bloom: Bloom |
---|
difficulty
100 | difficulty: Uint |
---|
number
111 | number: Uint |
---|
gas_limit
116 | gas_limit: Uint |
---|
gas_used
124 | gas_used: Uint |
---|
timestamp
129 | timestamp: U256 |
---|
extra_data
134 | extra_data: Bytes |
---|
mix_digest
139 | mix_digest: Bytes32 |
---|
nonce
148 | nonce: Bytes8 |
---|
Block
A complete block on Ethereum, which is composed of a block header
,
a list of transactions, and a list of ommers (also known as uncle blocks).
The block header
includes PoW-specific fields such as difficulty
,
nonce
, and ommersHash
, which relate to the mining process. The
coinbase
field denotes the address receiving mining and transaction
fees.
The header also contains commitments to the current state (stateRoot
),
the transactions (transactionsRoot
), and the transaction receipts
(receiptsRoot
). It also includes a bloom filter which summarizes log
data from the transactions.
Ommers are used to provide rewards for near-valid mined blocks that didn't become part of the canonical chain.
158 | @slotted_freezable |
---|
159 | @dataclass |
---|
class Block:
header
181 | header: Header |
---|
transactions
189 | transactions: Tuple[Transaction, ...] |
---|
ommers
194 | ommers: Tuple[Header, ...] |
---|
Log
202 | @slotted_freezable |
---|
203 | @dataclass |
---|
class Log:
address
218 | address: Address |
---|
topics
223 | topics: Tuple[Hash32, ...] |
---|
data
228 | data: Bytes |
---|
Receipt
Result of a transaction execution. Receipts are included in the receipts trie.
234 | @slotted_freezable |
---|
235 | @dataclass |
---|
class Receipt:
post_state
242 | post_state: Root |
---|
cumulative_gas_used
247 | cumulative_gas_used: Uint |
---|
bloom
252 | bloom: Bloom |
---|
logs
258 | logs: Tuple[Log, ...] |
---|