Skip to content

Commit

Permalink
move mpt witness to zkevm-circuits (#1243)
Browse files Browse the repository at this point in the history
* move mpt witness to zkevm-circuits

* clean deps
  • Loading branch information
lispc authored Apr 30, 2024
1 parent d773efd commit ba844f7
Show file tree
Hide file tree
Showing 15 changed files with 1,818 additions and 1,817 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

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

3 changes: 2 additions & 1 deletion zkevm-circuits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ serde.workspace = true
serde_json.workspace = true

hash-circuit.workspace = true
mpt-circuits = { package = "halo2-mpt-circuits", git = "https://github.com/scroll-tech/mpt-circuit.git", branch = "v0.7", default-features=false }
misc-precompiled-circuit = { package = "misc-precompiled-circuit", git = "https://github.com/scroll-tech/misc-precompiled-circuit.git", branch = "main" }
halo2_gadgets = { git = "https://github.com/scroll-tech/halo2.git", branch = "v1.1", features = ["unstable"] }

Expand Down Expand Up @@ -64,7 +65,7 @@ warn-unimplemented = ["eth-types/warn-unimplemented"]
onephase = [] # debug only
zktrie = []
poseidon-codehash = []
parallel_syn = ["hash-circuit/parallel_syn", "halo2_proofs/parallel_syn", "mpt-zktrie/parallel_syn"]
parallel_syn = ["hash-circuit/parallel_syn", "halo2_proofs/parallel_syn", "mpt-circuits/parallel_syn"]

debug-annotations = []
enable-stack = ["bus-mapping/enable-stack"]
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/mpt_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use halo2_proofs::{
plonk::{Advice, Circuit, Column, ConstraintSystem, Error, Fixed},
};
use itertools::Itertools;
use mpt_zktrie::mpt_circuits::{
use mpt_circuits::{
gadgets::{mpt_update::hash_traces, poseidon::PoseidonLookup},
mpt,
types::Proof,
Expand Down
6 changes: 2 additions & 4 deletions zkevm-circuits/src/poseidon_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@
use crate::{
bytecode_circuit::bytecode_unroller::HASHBLOCK_BYTES_IN_FIELD,
table::PoseidonTable,
util::{Challenges, SubCircuit, SubCircuitConfig},
util::{Challenges, Field, SubCircuit, SubCircuitConfig},
witness::{self},
};
//use bus_mapping::state_db::CodeDB;
use crate::util::Field;
use halo2_proofs::{
circuit::{Layouter, SimpleFloorPlanner, Value},
plonk::{Circuit, ConstraintSystem, Error},
Expand Down Expand Up @@ -242,7 +240,7 @@ fn get_storage_poseidon_witness<F: Field>(
block: &crate::witness::Block<F>,
) -> Vec<([F; 2], F, Option<F>)> {
use itertools::Itertools;
use mpt_zktrie::mpt_circuits::{gadgets::mpt_update::hash_traces, types::Proof};
use mpt_circuits::{gadgets::mpt_update::hash_traces, types::Proof};
hash_traces(
&block
.mpt_updates
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/state_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ mod dev;
mod test;
#[cfg(any(feature = "test", test, feature = "test-circuits"))]
pub use dev::StateCircuit as TestStateCircuit;
use mpt_zktrie::mpt_circuits::MPTProofType;
use mpt_circuits::MPTProofType;

use self::{
constraint_builder::{MptUpdateTableQueries, RwTableQueries},
Expand Down
2 changes: 1 addition & 1 deletion zkevm-circuits/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ impl RwTable {
}
}

pub use mpt_zktrie::mpt_circuits::MPTProofType;
pub use mpt_circuits::MPTProofType;

impl From<AccountFieldTag> for MPTProofType {
fn from(tag: AccountFieldTag) -> Self {
Expand Down
Loading

0 comments on commit ba844f7

Please sign in to comment.