Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(l2): initial state pruned trie in zkVM program #1133

Merged
merged 48 commits into from
Nov 22, 2024
Merged

Conversation

xqft
Copy link
Contributor

@xqft xqft commented Nov 11, 2024

Motivation

To validate the initial and final state values after the execution of a block in the prover, we introduce state and storage tries into the zkVM program to verify the initial values and then to apply account updates and compute the new state hash.

Description

  • moved zkVM program input structure into interface and modified it into ProgramInput (because the zkvm program fails to build when importing the prover crate)
  • created ProgramOutput also
  • introduced NullDB database for tries (tries whose nodes are cached)
  • removed trie verification logic in favor of "pruned trie" logic (functions from_nodes(), get_pruned_state(), build_tries(), update_tries() and use them when creating the ExecutionDB and in the zkVM program)
  • added execution program documentation

github-merge-queue bot pushed a commit that referenced this pull request Nov 19, 2024
**Motivation**

The function does not return any account update when the state is
represented by an `ExecutionDB`. Needed for #1133

**Description**
- correctly implements the fn
@xqft xqft marked this pull request as ready for review November 19, 2024 19:39
@xqft xqft requested a review from a team as a code owner November 19, 2024 19:39
Copy link
Contributor

@fborello-lambda fborello-lambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, left 1 comment

crates/l2/docs/program.md Outdated Show resolved Hide resolved
@jrchatruc jrchatruc added this pull request to the merge queue Nov 22, 2024
Merged via the queue into main with commit b9ec164 Nov 22, 2024
21 checks passed
@jrchatruc jrchatruc deleted the l2/zkvm_trie branch November 22, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants