Skip to content

Commit 2a6cc04

Browse files
noel2004lispc
andauthored
[Feat] make supercircuit test applying l2trace (#767)
* 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]>
1 parent 3783df7 commit 2a6cc04

File tree

26 files changed

+1107
-293
lines changed

26 files changed

+1107
-293
lines changed

Diff for: Cargo.lock

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: bus-mapping/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ license = "MIT OR Apache-2.0"
99
eth-types = { path = "../eth-types" }
1010
gadgets = { path = "../gadgets" }
1111
keccak256 = { path = "../keccak256" }
12+
mpt-zktrie = {path = "../zktrie"}
1213
mock = { path = "../mock", optional = true }
1314

1415
ethers-core = "0.17.0"

Diff for: bus-mapping/src/circuit_input_builder.rs

+9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ mod block;
66
mod call;
77
mod execution;
88
mod input_state_ref;
9+
#[cfg(feature = "scroll")]
10+
mod l2;
911
#[cfg(test)]
1012
mod tracer_tests;
1113
mod transaction;
@@ -46,6 +48,8 @@ use ethers_core::utils::keccak256;
4648
pub use input_state_ref::CircuitInputStateRef;
4749
use itertools::Itertools;
4850
use log::warn;
51+
#[cfg(feature = "scroll")]
52+
use mpt_zktrie::state::ZktrieState;
4953
use std::{
5054
collections::{BTreeMap, HashMap},
5155
iter,
@@ -175,6 +179,9 @@ pub struct CircuitInputBuilder {
175179
pub block: Block,
176180
/// Block Context
177181
pub block_ctx: BlockContext,
182+
#[cfg(feature = "scroll")]
183+
/// Initial Zktrie Status for a incremental updating
184+
pub mpt_init_state: ZktrieState,
178185
}
179186

180187
impl<'a> CircuitInputBuilder {
@@ -186,6 +193,8 @@ impl<'a> CircuitInputBuilder {
186193
code_db,
187194
block: block.clone(),
188195
block_ctx: BlockContext::new(),
196+
#[cfg(feature = "scroll")]
197+
mpt_init_state: Default::default(),
189198
}
190199
}
191200
/// Create a new CircuitInputBuilder from the given `eth_block` and

0 commit comments

Comments
 (0)