Expand description
An Ethereum Node executes transactions in blocks.
Execution mutates two key data structures:
- The state, which tracks, e.g the account balance.
- The storage, which is a huge array of integers, per-account.
Ethereum nodes expose information about the transactions over RPC, e.g:
The state execution correctness is then asserted by the zkEVM prover in
evm_arithmetization
, relying on starky
and plonky2
.
Prover perfomance is a high priority.
The aformentioned data structures are represented as tries, which may have subtries hashed out. That is, any node (and its children!) may be replaced by its hash, while maintaining provability of its contents:
A A
/ \ / \
B C -> H C
/ \ \ \
D E F F
(where H
is the hash of the D/B\E
subtrie).
The principle concern of this module is to step through the transactions, and reproduce the intermediate tries, while hashing out all possible subtries to minimise prover load (since prover performance is sensitive to the size of the trie). The prover can therefore prove each batch of transactions independently.
§Non-goals
- Performance - this will never be the bottleneck in any proving stack.
- Robustness - this library depends on other libraries that are not robust, so may panic at any time.
Modules§
- observer
- Implementation of the observer for the trace decoder.
Structs§
- Block
Level Data - Data that is specific to a block and is constant for all txns in a given block.
- Block
Trace - Core payload needed to generate proof for a block. Additional data retrievable from the blockchain node (using standard ETH RPC API) may be needed for proof generation.
- Combined
PreImages - A trie pre-image where both state & storage are combined into one payload.
- Other
Block Data - Other data that is needed for proof gen.
- Separate
Trie PreImages - State/Storage trie pre-images that are separate.
- TxnInfo
- Info specific to txns in the block.
- TxnMeta
- Structure holding metadata for one transaction.
- TxnTrace
- A “trace” specific to an account for a txn.
Enums§
- Block
Trace Trie PreImages - Minimal hashed out tries needed by all txns in the block.
- Contract
Code Usage - Contract code access type. Used by txn traces.
- Separate
Storage Tries PreImage - A trie pre-image where state and storage are separate.
- Separate
Trie PreImage - A trie pre-image where state & storage are separate.
- Wire
Disposition - Expected trie type when parsing from binary in a
BlockTrace
.
Functions§
- entrypoint
- TODO(0xaatif): document this after https://github.com/0xPolygonZero/zk_evm/issues/275