diff --git a/mp2-common/src/digest.rs b/mp2-common/src/digest.rs index 76821c62b..a876ab92a 100644 --- a/mp2-common/src/digest.rs +++ b/mp2-common/src/digest.rs @@ -184,17 +184,14 @@ mod test { use crate::{types::CBuilder, utils::FromFields, C, D, F}; use super::{ - Digest, DigestTarget, SplitDigest, SplitDigestPoint, SplitDigestTarget, TableDimension, + Digest, DigestTarget, SplitDigestPoint, SplitDigestTarget, TableDimension, TableDimensionWire, }; use crate::utils::TryIntoBool; use mp2_test::circuit::{run_circuit, UserCircuit}; use plonky2::{ field::types::Sample, - iop::{ - target::BoolTarget, - witness::{PartialWitness, WitnessWrite}, - }, + iop::witness::PartialWitness, }; use plonky2_ecgfp5::{ curve::curve::Point, diff --git a/mp2-common/src/group_hashing/mod.rs b/mp2-common/src/group_hashing/mod.rs index c79fcb2f7..57d061952 100644 --- a/mp2-common/src/group_hashing/mod.rs +++ b/mp2-common/src/group_hashing/mod.rs @@ -236,25 +236,23 @@ mod test { use plonky2::{ field::types::Sample, - iop::{target::Target, witness::PartialWitness}, + iop::witness::PartialWitness, }; - use plonky2_ecdsa::curve::curve_types::base_to_scalar; + use plonky2_ecgfp5::{ curve::curve::{Point, WeierstrassPoint}, gadgets::curve::{CircuitBuilderEcGFp5, CurveTarget, PartialWitnessCurve}, }; use crate::{ - digest::DigestTarget, types::CBuilder, - utils::{FromFields, FromTargets, ToFields, ToTargets}, + utils::{FromFields, ToFields}, C, D, F, }; use mp2_test::circuit::{run_circuit, UserCircuit}; use super::{ circuit_hashed_scalar_mul, field_hashed_scalar_mul, weierstrass_to_point, - CircuitBuilderGroupHashing, }; #[derive(Clone, Debug)] diff --git a/mp2-v1/tests/common/cases/indexing.rs b/mp2-v1/tests/common/cases/indexing.rs index 634574f59..d867d6c46 100644 --- a/mp2-v1/tests/common/cases/indexing.rs +++ b/mp2-v1/tests/common/cases/indexing.rs @@ -23,7 +23,7 @@ use crate::common::{ identifier_single_var_column, table_source::{ LengthExtractionArgs, MappingIndex, MappingValuesExtractionArgs, MergeSource, - SingleValuesExtractionArgs, UniqueMappingEntry, DEFAULT_ADDRESS, + SingleValuesExtractionArgs, DEFAULT_ADDRESS, }, }, proof_storage::{ProofKey, ProofStorage}, diff --git a/mp2-v1/tests/common/cases/mod.rs b/mp2-v1/tests/common/cases/mod.rs index d7be3a23e..4df2cffff 100644 --- a/mp2-v1/tests/common/cases/mod.rs +++ b/mp2-v1/tests/common/cases/mod.rs @@ -1,30 +1,13 @@ //! Define test cases -use alloy::primitives::{Address, U256}; use contract::Contract; -use indexing::{TableRowUpdate, TableRowValues}; -use log::debug; -use mp2_common::eth::StorageSlot; -use mp2_v1::{ - indexing::{ - block::BlockPrimaryIndex, - cell::Cell, - row::{RowTreeKey, ToNonce}, - ColumnID, - }, - values_extraction::{ +use mp2_v1::values_extraction::{ identifier_for_mapping_key_column, identifier_for_mapping_value_column, identifier_single_var_column, - }, -}; -use serde::{Deserialize, Serialize}; + }; use table_source::{ContractExtractionArgs, TableSource}; -use super::{ - rowtree::SecondaryIndexCell, - table::{CellsUpdate, Table}, - TableInfo, -}; +use super::table::Table; pub mod contract; pub mod indexing; diff --git a/mp2-v1/tests/common/cases/query.rs b/mp2-v1/tests/common/cases/query.rs index 50617255d..e875cffbf 100644 --- a/mp2-v1/tests/common/cases/query.rs +++ b/mp2-v1/tests/common/cases/query.rs @@ -25,7 +25,7 @@ use super::{ }; use alloy::primitives::U256; use anyhow::{bail, Context, Result}; -use futures::{future::BoxFuture, stream, FutureExt, StreamExt}; +use futures::{stream, FutureExt, StreamExt}; use super::TableSource; use itertools::Itertools; @@ -76,7 +76,6 @@ use verifiable_db::{ }, }, revelation::PublicInputs, - row_tree, }; pub const MAX_NUM_RESULT_OPS: usize = 20; diff --git a/mp2-v1/tests/common/cases/table_source.rs b/mp2-v1/tests/common/cases/table_source.rs index b8be0b7e0..fedbf3556 100644 --- a/mp2-v1/tests/common/cases/table_source.rs +++ b/mp2-v1/tests/common/cases/table_source.rs @@ -10,7 +10,7 @@ use alloy::{ providers::Provider, }; use anyhow::{bail, Result}; -use futures::{future::BoxFuture, stream, FutureExt, StreamExt}; +use futures::{future::BoxFuture, FutureExt, StreamExt}; use log::{debug, info}; use mp2_common::{ digest::TableDimension, diff --git a/verifiable-db/src/cells_tree/api.rs b/verifiable-db/src/cells_tree/api.rs index c05935a10..d2b4de1ab 100644 --- a/verifiable-db/src/cells_tree/api.rs +++ b/verifiable-db/src/cells_tree/api.rs @@ -2,9 +2,9 @@ use super::{ empty_node::{EmptyNodeCircuit, EmptyNodeWires}, - full_node::{FullNodeCircuit, FullNodeWires}, + full_node::FullNodeWires, leaf::{LeafCircuit, LeafWires}, - partial_node::{PartialNodeCircuit, PartialNodeWires}, + partial_node::PartialNodeWires, public_inputs::PublicInputs, Cell, }; diff --git a/verifiable-db/src/cells_tree/full_node.rs b/verifiable-db/src/cells_tree/full_node.rs index 4cf298047..2f523ba72 100644 --- a/verifiable-db/src/cells_tree/full_node.rs +++ b/verifiable-db/src/cells_tree/full_node.rs @@ -4,8 +4,7 @@ use super::{public_inputs::PublicInputs, Cell, CellWire}; use anyhow::Result; use derive_more::{From, Into}; use mp2_common::{ - group_hashing::CircuitBuilderGroupHashing, public_inputs::PublicInputCommon, types::CBuilder, - u256::CircuitBuilderU256, utils::ToTargets, CHasher, D, F, + public_inputs::PublicInputCommon, types::CBuilder, utils::ToTargets, CHasher, D, F, }; use plonky2::{ iop::{target::Target, witness::PartialWitness}, diff --git a/verifiable-db/src/cells_tree/partial_node.rs b/verifiable-db/src/cells_tree/partial_node.rs index 72a416bb5..32497b889 100644 --- a/verifiable-db/src/cells_tree/partial_node.rs +++ b/verifiable-db/src/cells_tree/partial_node.rs @@ -1,26 +1,16 @@ //! Module handling the intermediate node with 1 child inside a cells tree use super::{public_inputs::PublicInputs, Cell, CellWire}; -use alloy::primitives::U256; use anyhow::Result; use derive_more::{From, Into}; use mp2_common::{ - group_hashing::CircuitBuilderGroupHashing, - poseidon::empty_poseidon_hash, - public_inputs::PublicInputCommon, - types::CBuilder, - u256::{CircuitBuilderU256, UInt256Target, WitnessWriteU256}, - utils::ToTargets, - CHasher, D, F, + poseidon::empty_poseidon_hash, public_inputs::PublicInputCommon, types::CBuilder, + utils::ToTargets, CHasher, D, F, }; use plonky2::{ - iop::{ - target::{BoolTarget, Target}, - witness::{PartialWitness, WitnessWrite}, - }, + iop::{target::Target, witness::PartialWitness}, plonk::proof::ProofWithPublicInputsTarget, }; -use plonky2_ecgfp5::gadgets::curve::CircuitBuilderEcGFp5; use recursion_framework::circuit_builder::CircuitLogicWires; use serde::{Deserialize, Serialize}; use std::iter; @@ -96,6 +86,7 @@ impl CircuitLogicWires for PartialNodeWires { #[cfg(test)] mod tests { use super::*; + use alloy::primitives::U256; use mp2_common::{ group_hashing::{add_curve_point, map_to_curve_point}, poseidon::H, diff --git a/verifiable-db/src/row_tree/full_node.rs b/verifiable-db/src/row_tree/full_node.rs index d672e6145..fd4ad588d 100644 --- a/verifiable-db/src/row_tree/full_node.rs +++ b/verifiable-db/src/row_tree/full_node.rs @@ -1,7 +1,6 @@ use derive_more::{From, Into}; use mp2_common::{ default_config, - group_hashing::{cond_circuit_hashed_scalar_mul, CircuitBuilderGroupHashing}, poseidon::H, proof::ProofWithVK, public_inputs::PublicInputCommon, diff --git a/verifiable-db/src/row_tree/leaf.rs b/verifiable-db/src/row_tree/leaf.rs index 4d6e0a4d9..d791c8c91 100644 --- a/verifiable-db/src/row_tree/leaf.rs +++ b/verifiable-db/src/row_tree/leaf.rs @@ -1,7 +1,6 @@ use derive_more::{From, Into}; use mp2_common::{ default_config, - group_hashing::{cond_circuit_hashed_scalar_mul, CircuitBuilderGroupHashing}, poseidon::{empty_poseidon_hash, H}, proof::ProofWithVK, public_inputs::PublicInputCommon, @@ -10,7 +9,7 @@ use mp2_common::{ }; use plonky2::{ iop::{ - target::{BoolTarget, Target}, + target::Target, witness::PartialWitness, }, plonk::{circuit_builder::CircuitBuilder, proof::ProofWithPublicInputsTarget}, diff --git a/verifiable-db/src/row_tree/mod.rs b/verifiable-db/src/row_tree/mod.rs index c45a72292..bd209fe19 100644 --- a/verifiable-db/src/row_tree/mod.rs +++ b/verifiable-db/src/row_tree/mod.rs @@ -1,20 +1,3 @@ -use alloy::primitives::U256; -use derive_more::Constructor; -use mp2_common::{ - group_hashing::CircuitBuilderGroupHashing, - u256::{CircuitBuilderU256, UInt256Target, WitnessWriteU256}, - utils::{ToFields, ToTargets}, - D, F, -}; -use plonky2::{ - iop::{ - target::{BoolTarget, Target}, - witness::{PartialWitness, WitnessWrite}, - }, - plonk::circuit_builder::CircuitBuilder, -}; -use plonky2_ecgfp5::gadgets::curve::CurveTarget; -use serde::{Deserialize, Serialize}; mod api; mod full_node; diff --git a/verifiable-db/src/row_tree/partial_node.rs b/verifiable-db/src/row_tree/partial_node.rs index 00af074c8..e9056826e 100644 --- a/verifiable-db/src/row_tree/partial_node.rs +++ b/verifiable-db/src/row_tree/partial_node.rs @@ -2,7 +2,6 @@ use plonky2::plonk::proof::ProofWithPublicInputsTarget; use mp2_common::{ default_config, - group_hashing::{cond_circuit_hashed_scalar_mul, CircuitBuilderGroupHashing}, hash::hash_maybe_first, poseidon::empty_poseidon_hash, proof::ProofWithVK,