Verkle Readiness Tracker
gabrocheleau opened this issue · comments
This meta-issue tracks the TODOs for a complete (i.e. stateful) verkle implementation. I've tried ordering the todo by priority. This has been inpart inspired by this article from Ignacio: https://ihagopian.com/posts/anatomy-of-a-verkle-proof
- Block execution from witness
- Validate that all key-value pairs are present
- Validate that no extra key-value pair is present . #3419
Milestone 1 - Unsecure Stateless Execution.
The EthereumJS client can now successfully run blocks from the provided witness. However it blindly trusts that the provided witness is correct, as it does not have the ability to verify the verkle proof yet.
- Block execution verification from post-state (verify that computed post-state matches provided post-state). Not necessary for secure stateless execution, but very useful in the context of testnets to spot discrepencies and other execution or block-building related issues.
Milestone 2 - Secure Stateless Execution
The EthereumJS client can now successfully run blocks from the provided witness, and can verify that the provided witness is correct. It can therefore serve as a full validator and contribute to the security of the network.
- Verkle proof verification. Relevant src: https://ihagopian.com/posts/anatomy-of-a-verkle-proof#block-c8ab2d56dc0e4a6bae9712596e1aaa3f - done with this release of
verkle-cryptography-wasm
Milestone 3 - Verkle Trie Implementation
The EthereumJS monorepo has a functioning verkle trie implementation.
- Verkle tree implementation. The implementation should allow building a persistent verkle trie locally (putting and getting values).
- #3430 begins this process - implements
findPath
,get
, and cleans up existing API. - Build generalized
put
following logic outlined in this test. There are also edge cases tests created by Ignacio here: https://hackmd.io/@jsign/verkle-test-vectors #3473 - Optimize handling of children/values in internal and leaf nodes (currently uses full 32 byte
uint8Arrays
to represent empty values - should be replaced with simple 0/1 to indicate empty or overwritten values) - Change db keys to something like the output of
hashCommitment
or the node commitment itself, add the partial path as a property onVerkleNode
, and updatefindPath
andput
to use this revised schema for walking the trie #3472
- #3430 begins this process - implements
Milestone 4 - Stateful Execution
The EthereumJS client can now successfully run blocks from the local verkle state trie, and verify that the computed state root matches that of the block.
- Preimage saving.
- Preimage distribution (being able to export and import a flat binary file containing all the pre-images)
- Merkle->Verkle Tree transition. The client should be able to transition from using the Merkle tree for state, to using Verkle tree for state, and perform the conversion according to the spec.
Milestone 4 - Ready for the transition
The EthereumJS client can now statefully run and validate blocks through the merkle->verkle transition.
- Witness (pre-state) generation. From a list of txs, we can build a Witness that can be used to run the block statelessly.
- Witness (post-state) generation. From an executed block, we can build the post-state that can be used to validate the block execution.
- Verkle proof generation. We are able to generate a verkle proof that proves that the key/value pairs of the pre-state witness belong to the previous block's stateRoot.
Milestone 5 - Block proposal
The EthereumJS client can now propose complete verkle blocks containing pre-state, post-state and verkle proof.