Skip to content

Commit

Permalink
[Feat] make supercircuit test applying l2trace (#767)
Browse files Browse the repository at this point in the history
* induce l2 types for l2trace

* add l2trace entry

* wip: some refactoring

* refactor zktrie for decoupling from bus-mapping

* more refactoring in zktrie

* wip: l2 circuit builder

* use l2 trace in super circuit test

* prune unnecessary sign

* fmt and lint

* missed exportion

* update l2geth util for l1 queue index

* apply zktrie and storage proof

* sdb skip empty value

* update state root in tracing

* more update for state root

* fix tests

* lints

* lint for all-target

* fix memory transfer

* fmt

* disable callee code assert for precompile

* set all difficulity in l2 test to 0

* reroll the difficulity setting in test
apply global difficulity to 0 for l2

* fix deploy tx issue and prune l2geth_util

* revert incorrect fixing

* disable doc test temporarily

* add incremental update for l2 trace
entry in circuitbuilder

* zero coinbase patch for sdb

* rename variables for better self-doc

* re-enable tx storage fiield

* add modexp unittest

* turn ec test to serial

* bump the version of l2geth_util

* make l1 queue index default

* fix an issue in sdb update
add an entry for convenient

* mpt_state: add light_mode for ZktrieState::from_trace_with_additional

---------

Co-authored-by: Zhang Zhuo <[email protected]>
  • Loading branch information
noel2004 and lispc authored Aug 25, 2023
1 parent 3783df7 commit 2a6cc04
Show file tree
Hide file tree
Showing 26 changed files with 1,107 additions and 293 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions bus-mapping/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ license = "MIT OR Apache-2.0"
eth-types = { path = "../eth-types" }
gadgets = { path = "../gadgets" }
keccak256 = { path = "../keccak256" }
mpt-zktrie = {path = "../zktrie"}
mock = { path = "../mock", optional = true }

ethers-core = "0.17.0"
Expand Down
9 changes: 9 additions & 0 deletions bus-mapping/src/circuit_input_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ mod block;
mod call;
mod execution;
mod input_state_ref;
#[cfg(feature = "scroll")]
mod l2;
#[cfg(test)]
mod tracer_tests;
mod transaction;
Expand Down Expand Up @@ -46,6 +48,8 @@ use ethers_core::utils::keccak256;
pub use input_state_ref::CircuitInputStateRef;
use itertools::Itertools;
use log::warn;
#[cfg(feature = "scroll")]
use mpt_zktrie::state::ZktrieState;
use std::{
collections::{BTreeMap, HashMap},
iter,
Expand Down Expand Up @@ -175,6 +179,9 @@ pub struct CircuitInputBuilder {
pub block: Block,
/// Block Context
pub block_ctx: BlockContext,
#[cfg(feature = "scroll")]
/// Initial Zktrie Status for a incremental updating
pub mpt_init_state: ZktrieState,
}

impl<'a> CircuitInputBuilder {
Expand All @@ -186,6 +193,8 @@ impl<'a> CircuitInputBuilder {
code_db,
block: block.clone(),
block_ctx: BlockContext::new(),
#[cfg(feature = "scroll")]
mpt_init_state: Default::default(),
}
}
/// Create a new CircuitInputBuilder from the given `eth_block` and
Expand Down
Loading

0 comments on commit 2a6cc04

Please sign in to comment.