From 8511fdf2aa8fbecdb7278d160a6eb165198e6f2c Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Mon, 7 Aug 2023 03:47:05 -0700 Subject: [PATCH 01/30] Range check address_high --- src/gadgets/mpt_update.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 54a4a0bf..b156a071 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -130,9 +130,14 @@ impl MptUpdateConfig { * (1 << 32); cb.poseidon_lookup( "account mpt key = h(address_high, address_low)", - [address_high.current(), address_low, key.current()], + [address_high.current(), address_low.clone(), key.current()], poseidon, ); + cb.add_lookup( + "address_high is 16 bytes", + [address_high.current(), Query::from(15)], + bytes.lookup(), + ); cb.add_lookup( "rlc_old_root = rlc(old_root)", [old_hash.current(), old_hash_rlc.current(), Query::from(31)], @@ -2051,6 +2056,7 @@ pub fn byte_representations(proofs: &[Proof]) -> (Vec, Vec, Vec) let mut frs = vec![]; for proof in proofs { + u128s.push(address_high(proof.claim.address)); match MPTProofType::from(proof.claim) { MPTProofType::NonceChanged | MPTProofType::CodeSizeExists => { u128s.push(address_high(proof.claim.address)); From b0d5f6fca05285e9f86f12db0da94f9d20bfbb0a Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Wed, 23 Aug 2023 15:20:09 -0700 Subject: [PATCH 02/30] Add check that final mpt update row is padding --- src/mpt.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/mpt.rs b/src/mpt.rs index f0212a7c..074cb090 100644 --- a/src/mpt.rs +++ b/src/mpt.rs @@ -12,6 +12,7 @@ use crate::{ poseidon::PoseidonLookup, rlc_randomness::RlcRandomness, }, + mpt_table::MPTProofType, types::Proof, }; use halo2_proofs::{ @@ -25,6 +26,7 @@ use halo2_proofs::{ #[derive(Clone)] pub struct MptCircuitConfig { selector: SelectorColumn, + is_final_row: SelectorColumn, rlc_randomness: RlcRandomness, mpt_update: MptUpdateConfig, canonical_representation: CanonicalRepresentationConfig, @@ -68,10 +70,30 @@ impl MptCircuitConfig { &canonical_representation, ); + // This ensures that the final mpt update in the circuit is complete, since the padding + // for the mpt update is a valid proof that shows the account with address 0 does not + // exist in an mpt with root = 0 (i.e. the mpt is empty). + let is_final_row = SelectorColumn(cs.fixed_column()); + cb.add_lookup( + "final mpt update is padding", + [ + 1.into(), + 0.into(), + 0.into(), + (MPTProofType::AccountDoesNotExist as u64).into(), + 0.into(), + 0.into(), + 0.into(), + 0.into(), + ], + mpt_update.lookup().map(|q| q * is_final_row.current()), + ); + cb.build(cs); Self { selector, + is_final_row, rlc_randomness, mpt_update, key_bit, @@ -132,6 +154,7 @@ impl MptCircuitConfig { for offset in 1 + n_assigned_rows..n_rows { self.mpt_update.assign_padding_row(&mut region, offset); } + self.is_final_row.enable(&mut region, n_rows - 1); Ok(()) }, From 0e2957049257b56672978ff8cb726c3207e6b49c Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Wed, 23 Aug 2023 15:20:18 -0700 Subject: [PATCH 03/30] fmt --- src/gadgets/is_zero.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gadgets/is_zero.rs b/src/gadgets/is_zero.rs index a4d9a210..9fe7163d 100644 --- a/src/gadgets/is_zero.rs +++ b/src/gadgets/is_zero.rs @@ -57,7 +57,8 @@ impl IsZeroGadget { ); cb.assert_zero( "inverse_or_zero is 0 or inverse_or_zero is inverse of value", - inverse_or_zero.current() * (Query::one() - value.current() * inverse_or_zero.current()), + inverse_or_zero.current() + * (Query::one() - value.current() * inverse_or_zero.current()), ); Self { value, From 34af759e94f4b342507778145e7ae364a6d5566e Mon Sep 17 00:00:00 2001 From: z2trillion Date: Wed, 23 Aug 2023 15:43:16 -0700 Subject: [PATCH 04/30] Constraint BinaryColumn to be binary (#69) Co-authored-by: Mason Liang --- src/constraint_builder/binary_column.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/constraint_builder/binary_column.rs b/src/constraint_builder/binary_column.rs index 8e777d9a..c414850f 100644 --- a/src/constraint_builder/binary_column.rs +++ b/src/constraint_builder/binary_column.rs @@ -28,12 +28,14 @@ impl BinaryColumn { pub fn configure( cs: &mut ConstraintSystem, - _cb: &mut ConstraintBuilder, + cb: &mut ConstraintBuilder, ) -> Self { - let advice_column = cs.advice_column(); - // TODO: constrain to be binary here... - // cb.add_constraint() - Self(advice_column) + let binary_column = Self(cs.advice_column()); + cb.assert( + "binary column is 0 or 1", + binary_column.current().or(!binary_column.current()), + ); + binary_column } pub fn assign(&self, region: &mut Region<'_, F>, offset: usize, value: bool) { From 3ab166a4a62329ec42d44cd63fc9563ff29dea4e Mon Sep 17 00:00:00 2001 From: z2trillion Date: Wed, 23 Aug 2023 15:45:20 -0700 Subject: [PATCH 05/30] Check old hash = new hash for every row of empty storage proofs (#74) Co-authored-by: Mason Liang --- src/gadgets/mpt_update.rs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 04049306..0b223e62 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -1921,19 +1921,14 @@ fn configure_empty_storage( .path_type .current_matches(&[PathType::Start, PathType::Common]), ); + cb.assert_equal( + "hash doesn't change for empty account", + config.old_hash.current(), + config.new_hash.current(), + ); let is_final_segment = config.segment_type.next_matches(&[SegmentType::Start]); cb.condition(is_final_segment, |cb| { - cb.assert_equal( - "old_hash = new_hash", - config.old_hash.current(), - config.new_hash.current(), - ); - cb.assert_equal( - "old value = new value for empty account proof", - config.old_value.current(), - config.new_value.current(), - ); nonexistence_proof::configure( cb, config.old_value, @@ -1960,6 +1955,8 @@ fn configure_empty_storage( } SegmentType::AccountLeaf3 => { cb.assert_zero("direction is 0", config.direction.current()); + // Note that this constraint doesn't apply if the account doesn't exist. This + // is ok, because every storage key for an empty account is empty. configure_word_rlc( cb, [config.key, key_high, key_low], From 004fcddb53a86a62ba94f1f7fe8c04b315f23779 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Wed, 23 Aug 2023 15:45:39 -0700 Subject: [PATCH 06/30] Remove unreachable constraints and redundant condition in configure_code_size (#64) Co-authored-by: Mason Liang --- src/gadgets/mpt_update.rs | 71 ++++++++++----------------------------- 1 file changed, 17 insertions(+), 54 deletions(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 0b223e62..c9ac204e 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -1461,62 +1461,25 @@ fn configure_code_size( - config.old_value.current() * Query::Constant(F::from(1 << 32).square()); let new_nonce = config.new_hash.current() - config.new_value.current() * Query::Constant(F::from(1 << 32).square()); - cb.condition( - config.path_type.current_matches(&[PathType::Common]), - |cb| { - cb.add_lookup( - "old code size is 8 bytes", - [config.old_value.current(), Query::from(7)], - bytes.lookup(), - ); - cb.add_lookup( - "new code size is 8 bytes", - [config.new_value.current(), Query::from(7)], - bytes.lookup(), - ); - cb.assert_equal( - "old nonce = new nonce for code size update", - old_nonce.clone(), - new_nonce.clone(), - ); - cb.add_lookup( - "nonce is 8 bytes", - [old_nonce.clone(), Query::from(7)], - bytes.lookup(), - ); - }, + cb.add_lookup( + "old code size is 8 bytes", + [config.old_value.current(), Query::from(7)], + bytes.lookup(), ); - cb.condition( - config.path_type.current_matches(&[PathType::ExtensionNew]), - |cb| { - cb.add_lookup( - "new nonce is 8 bytes", - [config.old_value.current(), Query::from(7)], - bytes.lookup(), - ); - cb.assert_zero( - "new nonce is 0 for ExtensionNew code size update", - new_nonce, - ); - cb.assert_zero( - "nonce and code size are 0 for ExtensionNew balance update", - config.sibling.current(), - ); - }, + cb.add_lookup( + "new code size is 8 bytes", + [config.new_value.current(), Query::from(7)], + bytes.lookup(), ); - cb.condition( - config.path_type.current_matches(&[PathType::ExtensionOld]), - |cb| { - cb.add_lookup( - "old code size is 8 bytes", - [config.old_value.current(), Query::from(7)], - bytes.lookup(), - ); - cb.assert_zero( - "old nonce is 0 for ExtensionOld code size update", - old_nonce, - ); - }, + cb.assert_equal( + "old nonce = new nonce for code size update", + old_nonce.clone(), + new_nonce, + ); + cb.add_lookup( + "nonce is 8 bytes", + [old_nonce, Query::from(7)], + bytes.lookup(), ); } _ => {} From f9ff6bb56b45da3ad219e4e01c283bedd478ef14 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Wed, 23 Aug 2023 15:46:06 -0700 Subject: [PATCH 07/30] fix constraint name (#72) Co-authored-by: Mason Liang --- src/gadgets/mpt_update.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index c9ac204e..0f193c6e 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -175,7 +175,7 @@ impl MptUpdateConfig { old_value.previous(), ); cb.assert_equal( - "old_value does not change", + "new_value does not change", new_value.current(), new_value.previous(), ); From b8a85285b385b8be68da55c79680c635de899b88 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Wed, 23 Aug 2023 16:00:54 -0700 Subject: [PATCH 08/30] Remove unused file (#71) Co-authored-by: Mason Liang --- src/types.rs | 1 - src/types/account.rs | 166 ------------------------------------------- 2 files changed, 167 deletions(-) delete mode 100644 src/types/account.rs diff --git a/src/types.rs b/src/types.rs index bd06ee90..9536fd23 100644 --- a/src/types.rs +++ b/src/types.rs @@ -13,7 +13,6 @@ use itertools::{EitherOrBoth, Itertools}; use num_bigint::BigUint; use num_traits::identities::Zero; -// mod account; pub mod storage; pub mod trie; use storage::StorageProof; diff --git a/src/types/account.rs b/src/types/account.rs deleted file mode 100644 index 28bc3186..00000000 --- a/src/types/account.rs +++ /dev/null @@ -1,166 +0,0 @@ -use crate::{ - serde::{AccountData as SerdeAccountData, SMTNode, SMTTrace}, - types::{storage::StorageProof, trie::TrieRows}, - util::{account_key, fr, fr_from_biguint, hash, split_word, u256_from_biguint}, -}; -use ethers_core::types::{Address, U256}; -use halo2_proofs::halo2curves::bn256::Fr; - -#[derive(Clone, Debug)] -pub struct AccountProof { - account_key: Fr, - trie_rows: TrieRows, - old_leaf: AccountLeaf, - new_leaf: AccountLeaf, - storage: StorageProof, -} - -#[derive(Clone, Debug)] -pub enum AccountLeaf { - Empty { - account_key: Fr, - }, - Leaf { - account_key: Fr, - account_hash: Fr, - }, - Account { - address: Address, - account_data: AccountData, - }, -} - -#[derive(Clone, Copy, Debug, Default)] -pub struct AccountData { - balance: Fr, // We assume that all account balances can fit into 1 field element. - keccak_codehash: U256, - poseidon_codehash: Fr, - code_size: u64, - nonce: u64, -} - -impl AccountData { - fn hash(&self, storage_root: Fr) -> Fr { - hash( - self.poseidon_codehash_sibling(storage_root), - self.poseidon_codehash, - ) - } - - fn packed_nonce_and_codesize(&self) -> Fr { - Fr::from(self.nonce) + Fr::from(self.code_size) * Fr::from(1 << 32).square() - } - - fn hashed_nonce_codesize_balance(&self) -> Fr { - hash(self.packed_nonce_and_codesize(), self.balance) - } - - fn hashed_keccak_codehash(&self) -> Fr { - let (high, low) = split_word(self.keccak_codehash); - hash(high, low) - } - - fn hashed_storage_root_keccak_codehash(&self, storage_root: Fr) -> Fr { - hash(storage_root, self.hashed_keccak_codehash()) - } - - fn poseidon_codehash_sibling(&self, storage_root: Fr) -> Fr { - hash( - self.hashed_nonce_codesize_balance(), - self.hashed_storage_root_keccak_codehash(storage_root), - ) - } -} - -impl AccountProof { - pub fn old_root(&self) -> Fr { - self.trie_rows - .old_root(|| self.old_leaf.hash(self.storage.new_root())) - } - - pub fn new_root(&self) -> Fr { - self.trie_rows - .new_root(|| self.new_leaf.hash(self.storage.old_root())) - } -} - -impl AccountLeaf { - fn new(address: Address, node: &Option, data: &Option) -> Self { - let account_key = account_key(address); - match (node, data) { - (None, None) => Self::Empty { account_key }, - (Some(node), Some(data)) => { - assert_eq!(account_key, fr(node.sibling)); - Self::Account { - address, - account_data: AccountData { - balance: fr_from_biguint(&data.balance), - keccak_codehash: u256_from_biguint(&data.code_hash), - poseidon_codehash: fr_from_biguint(&data.poseidon_code_hash), - code_size: data.code_size, - nonce: data.nonce, - }, - } - } - (Some(node), None) => { - assert_eq!(account_key, fr(node.sibling)); - Self::Leaf { - account_key, - account_hash: fr(node.value), - } - } - (None, Some(_)) => { - unreachable!(); - } - } - } - - fn hash(&self, storage_root: Fr) -> Fr { - match self { - Self::Empty { .. } => Fr::zero(), - Self::Leaf { - account_key, - account_hash, - } => hash(hash(Fr::one(), *account_key), *account_hash), - Self::Account { - address, - account_data, - } => hash( - hash(Fr::one(), account_key(*address)), - account_data.hash(storage_root), - ), - } - } -} - -impl From<&SMTTrace> for AccountProof { - fn from(trace: &SMTTrace) -> Self { - let address = Address::from(trace.address.0); - - let [old_path, new_path] = &trace.account_path; - let old_leaf = old_path.leaf; - let new_leaf = new_path.leaf; - let trie_rows = TrieRows::new( - account_key(address), - &new_path.path, - &new_path.path, - old_path.leaf, - new_path.leaf, - ); - - let [old_entry, new_entry] = &trace.account_update; - let old_leaf = AccountLeaf::new(address, &old_leaf, old_entry); - let new_leaf = AccountLeaf::new(address, &new_leaf, new_entry); - - let account_proof = Self { - account_key: account_key(address), - trie_rows, - old_leaf, - new_leaf, - storage: StorageProof::from(trace), - }; - assert_eq!(account_proof.old_root(), fr(old_path.root)); - assert_eq!(account_proof.new_root(), fr(new_path.root)); - account_proof - } -} From f89e2d58990377299e17cca45bf1c280ff708b5f Mon Sep 17 00:00:00 2001 From: z2trillion Date: Wed, 23 Aug 2023 16:06:20 -0700 Subject: [PATCH 09/30] Fix constraint names (#86) Co-authored-by: Mason Liang --- src/gadgets/byte_representation.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gadgets/byte_representation.rs b/src/gadgets/byte_representation.rs index a60dd835..2dd4323b 100644 --- a/src/gadgets/byte_representation.rs +++ b/src/gadgets/byte_representation.rs @@ -65,12 +65,12 @@ impl ByteRepresentationConfig { index.current() * (index.current() - index.previous() - 1), ); cb.assert_equal( - "current value = previous value * 256 * (index == 0) + byte", + "current value = previous value * 256 * (index != 0) + byte", value.current(), value.previous() * 256 * !index_is_zero.current() + byte.current(), ); cb.assert_equal( - "current rlc = previous rlc * randomness * (index == 0) + byte", + "current rlc = previous rlc * randomness * (index != 0) + byte", rlc.current(), rlc.previous() * randomness.query() * !index_is_zero.current() + byte.current(), ); From ef64eb52548946a0dd7f0ee83ce71ed8d460c405 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Thu, 24 Aug 2023 22:39:30 -0700 Subject: [PATCH 10/30] [ZK 42] Fix configure_balance constraints (#87) * Check that nonce and code size are 0 new account leaf * Remove unreachable condition --------- Co-authored-by: Mason Liang --- src/gadgets/mpt_update.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 0f193c6e..7faaab84 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -1570,9 +1570,7 @@ fn configure_balance( SegmentType::AccountLeaf3 => { cb.assert_equal("direction is 1", config.direction.current(), Query::one()); cb.condition( - config - .path_type - .current_matches(&[PathType::Common, PathType::ExtensionOld]), + config.path_type.current_matches(&[PathType::Common]), |cb| { cb.add_lookup( "old balance is rlc(old_hash) and fits into 31 bytes", @@ -1601,6 +1599,15 @@ fn configure_balance( ); }, ); + cb.condition( + config.path_type.current_matches(&[PathType::ExtensionNew]), + |cb| { + cb.assert_zero( + "nonce and code size are 0 for new account", + config.sibling.current(), + ); + }, + ); } _ => {} }; From c8f9c7f39d476e48b2712f5caaf3a98327ee2098 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Thu, 24 Aug 2023 22:55:37 -0700 Subject: [PATCH 11/30] [ZK 35] add is_first selector to handle wraparound for .previous (#81) * Add is_first selector to handle wraparound for .previous * Remove unneeded condition * Correct constraint name --------- Co-authored-by: Mason Liang --- src/gadgets/byte_representation.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/gadgets/byte_representation.rs b/src/gadgets/byte_representation.rs index 2dd4323b..1f761bb9 100644 --- a/src/gadgets/byte_representation.rs +++ b/src/gadgets/byte_representation.rs @@ -1,5 +1,7 @@ use super::{byte_bit::RangeCheck256Lookup, is_zero::IsZeroGadget, rlc_randomness::RlcRandomness}; -use crate::constraint_builder::{AdviceColumn, ConstraintBuilder, Query, SecondPhaseAdviceColumn}; +use crate::constraint_builder::{ + AdviceColumn, ConstraintBuilder, Query, SecondPhaseAdviceColumn, SelectorColumn, +}; use ethers_core::types::{Address, H256}; use halo2_proofs::{ arithmetic::FieldExt, @@ -27,6 +29,7 @@ pub struct ByteRepresentationConfig { index: AdviceColumn, // internal columns + is_first: SelectorColumn, byte: AdviceColumn, index_is_zero: IsZeroGadget, } @@ -56,12 +59,16 @@ impl ByteRepresentationConfig { range_check: &impl RangeCheck256Lookup, randomness: &RlcRandomness, ) -> Self { + let is_first = SelectorColumn(cs.fixed_column()); let [value, index, byte] = cb.advice_columns(cs); let [rlc] = cb.second_phase_advice_columns(cs); let index_is_zero = IsZeroGadget::configure(cs, cb, index); + cb.condition(is_first.current(), |cb| { + cb.assert_zero("index is 0 for first row", index.current()) + }); cb.assert_zero( - "index increases by 1 or resets to 0", + "index is 0 or increases by 1", index.current() * (index.current() - index.previous() - 1), ); cb.assert_equal( @@ -82,6 +89,7 @@ impl ByteRepresentationConfig { index, index_is_zero, byte, + is_first, } } @@ -94,6 +102,7 @@ impl ByteRepresentationConfig { frs: &[Fr], randomness: Value, ) { + self.is_first.enable(region, 0); let byte_representations = u64s .iter() .map(u64_to_big_endian) From 7c3f35e8609263bd4c55a76ced2f088e3ecdd534 Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Thu, 24 Aug 2023 23:05:24 -0700 Subject: [PATCH 12/30] Use constraints instead of lookups --- src/mpt.rs | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/mpt.rs b/src/mpt.rs index 074cb090..adb51c76 100644 --- a/src/mpt.rs +++ b/src/mpt.rs @@ -21,6 +21,7 @@ use halo2_proofs::{ halo2curves::bn256::Fr, plonk::{Challenge, ConstraintSystem, Error, Expression, VirtualCells}, }; +use itertools::Itertools; /// Config for MptCircuit #[derive(Clone)] @@ -74,20 +75,28 @@ impl MptCircuitConfig { // for the mpt update is a valid proof that shows the account with address 0 does not // exist in an mpt with root = 0 (i.e. the mpt is empty). let is_final_row = SelectorColumn(cs.fixed_column()); - cb.add_lookup( - "final mpt update is padding", - [ - 1.into(), - 0.into(), - 0.into(), - (MPTProofType::AccountDoesNotExist as u64).into(), - 0.into(), - 0.into(), - 0.into(), - 0.into(), - ], - mpt_update.lookup().map(|q| q * is_final_row.current()), - ); + let padding_row_expressions = [ + 1.into(), + 0.into(), + 0.into(), + (MPTProofType::AccountDoesNotExist as u64).into(), + 0.into(), + 0.into(), + 0.into(), + 0.into(), + ]; + cb.condition(is_final_row.current(), |cb| { + for (padding_row_expression, lookup_expression) in padding_row_expressions + .into_iter() + .zip_eq(mpt_update.lookup()) + { + cb.assert_equal( + "final mpt update is padding", + padding_row_expression, + lookup_expression, + ) + } + }); cb.build(cs); From 63a8416191550f6220a052d32c9a4b8d3a91f9a9 Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Thu, 24 Aug 2023 23:10:40 -0700 Subject: [PATCH 13/30] Fix assert --- src/mpt.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mpt.rs b/src/mpt.rs index adb51c76..aca1d7d0 100644 --- a/src/mpt.rs +++ b/src/mpt.rs @@ -156,8 +156,9 @@ impl MptCircuitConfig { let n_assigned_rows = self.mpt_update.assign(&mut region, proofs, randomness); assert!( - n_assigned_rows <= n_rows, - "mpt circuit requires {n_assigned_rows} rows > limit of {n_rows} rows" + 2 + n_assigned_rows <= n_rows, + "mpt circuit requires {n_assigned_rows} rows for mpt updates + 1 initial \ + all-zero row + at least 1 final padding row. Only {n_rows} rows available." ); for offset in 1 + n_assigned_rows..n_rows { From a0691430c5dca97013659b8fc3848beb13c9af94 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Tue, 29 Aug 2023 20:06:26 -0700 Subject: [PATCH 14/30] Handle proofs for empty and singleton MPT's (#89) * Add failing tests * Add failing empty mpt empty account proof test * Handle case of singleton and empty mpt's --------- Co-authored-by: Mason Liang --- src/gadgets/mpt_update.rs | 2 +- src/tests.rs | 59 +++++++++++++++++++++++++++++++++++++++ src/types.rs | 9 ++++++ 3 files changed, 69 insertions(+), 1 deletion(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index a4e94532..780225b3 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -440,7 +440,7 @@ impl MptUpdateConfig { }) .unwrap_or(PathType::Common); let (final_old_hash, final_new_hash) = match proof.address_hash_traces.first() { - None => unimplemented!("single account mpt not handled"), + None => (proof.old.hash(), proof.new.hash()), Some((_, _, old_hash, new_hash, _, _, _)) => (*old_hash, *new_hash), }; diff --git a/src/tests.rs b/src/tests.rs index d8d460a3..7ef7f0c3 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -903,3 +903,62 @@ fn empty_storage_type_2() { mock_prove(vec![(MPTProofType::StorageDoesNotExist, trace)]); } + +#[test] +fn empty_mpt() { + assert!(*HASH_SCHEME_DONE); + let mut generator = WitnessGenerator::from(&ZktrieState::default()); + let trace = generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::BalanceChanged, + Address::repeat_byte(2), + U256::from(1231412), + U256::zero(), + None, + ); + let json = serde_json::to_string_pretty(&trace).unwrap(); + let trace: SMTTrace = serde_json::from_str(&json).unwrap(); + + mock_prove(vec![(MPTProofType::BalanceChanged, trace)]); +} + +#[test] +fn empty_mpt_empty_account() { + assert!(*HASH_SCHEME_DONE); + let mut generator = WitnessGenerator::from(&ZktrieState::default()); + let trace = generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::AccountDoesNotExist, + Address::repeat_byte(232), + U256::zero(), + U256::zero(), + None, + ); + let json = serde_json::to_string_pretty(&trace).unwrap(); + let trace: SMTTrace = serde_json::from_str(&json).unwrap(); + + mock_prove(vec![(MPTProofType::AccountDoesNotExist, trace)]); +} + +#[test] +fn singleton_mpt() { + assert!(*HASH_SCHEME_DONE); + let mut generator = WitnessGenerator::from(&ZktrieState::default()); + generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::BalanceChanged, + Address::repeat_byte(1), + U256::from(23), + U256::zero(), + None, + ); + + let trace = generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::BalanceChanged, + Address::repeat_byte(2), + U256::from(15), + U256::zero(), + None, + ); + let json = serde_json::to_string_pretty(&trace).unwrap(); + let trace: SMTTrace = serde_json::from_str(&json).unwrap(); + + mock_prove(vec![(MPTProofType::BalanceChanged, trace)]); +} diff --git a/src/types.rs b/src/types.rs index 9536fd23..47dbf8c6 100644 --- a/src/types.rs +++ b/src/types.rs @@ -229,6 +229,15 @@ pub struct Path { pub leaf_data_hash: Option, // leaf data hash for type 0 and type 1, None for type 2. } +impl Path { + pub fn hash(&self) -> Fr { + match self.leaf_data_hash { + None => Fr::zero(), + Some(data_hash) => domain_hash(self.key, data_hash, HashDomain::Leaf), + } + } +} + impl From<(&MPTProofType, &SMTTrace)> for Claim { fn from((proof_type, trace): (&MPTProofType, &SMTTrace)) -> Self { let [old_root, new_root] = trace.account_path.clone().map(|path| fr(path.root)); From c5cd0dab4a242d7077bf9cad051119dafaa4d6e9 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Tue, 29 Aug 2023 22:26:51 -0700 Subject: [PATCH 15/30] Fix failing testool cases (#90) * Handle case for proving 0 balance, nonce, keccak code hash, code size, and empty storage updates in an empty mpt * Add singleton_mpt_empty_account test * Fix documentation --------- Co-authored-by: Mason Liang --- src/gadgets/mpt_update.rs | 8 +- src/gadgets/mpt_update/segment.rs | 2 + src/tests.rs | 84 ++++ ...egistratorPerTxsNotEnoughGas_d0_g0_v0.json | 463 ++++++++++++++++++ 4 files changed, 553 insertions(+), 4 deletions(-) create mode 100644 src/traces/createNameRegistratorPerTxsNotEnoughGas_d0_g0_v0.json diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 780225b3..d33fea72 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -1288,7 +1288,7 @@ fn configure_nonce( ); for variant in SegmentType::iter() { let conditional_constraints = |cb: &mut ConstraintBuilder| match variant { - SegmentType::AccountTrie => { + SegmentType::Start | SegmentType::AccountTrie => { cb.condition( config.segment_type.next_matches(&[SegmentType::Start]), |cb| { @@ -1420,7 +1420,7 @@ fn configure_code_size( ); for variant in SegmentType::iter() { let conditional_constraints = |cb: &mut ConstraintBuilder| match variant { - SegmentType::AccountTrie => { + SegmentType::Start | SegmentType::AccountTrie => { cb.condition( config.segment_type.next_matches(&[SegmentType::Start]), |cb| { @@ -1504,7 +1504,7 @@ fn configure_balance( ) { for variant in SegmentType::iter() { let conditional_constraints = |cb: &mut ConstraintBuilder| match variant { - SegmentType::AccountTrie => { + SegmentType::Start | SegmentType::AccountTrie => { cb.condition( config.segment_type.next_matches(&[SegmentType::Start]), |cb| { @@ -1690,7 +1690,7 @@ fn configure_keccak_code_hash( ); for variant in SegmentType::iter() { let conditional_constraints = |cb: &mut ConstraintBuilder| match variant { - SegmentType::AccountTrie => { + SegmentType::Start | SegmentType::AccountTrie => { cb.condition( config.segment_type.next_matches(&[SegmentType::Start]), |cb| { diff --git a/src/gadgets/mpt_update/segment.rs b/src/gadgets/mpt_update/segment.rs index eb28a491..011c42ef 100644 --- a/src/gadgets/mpt_update/segment.rs +++ b/src/gadgets/mpt_update/segment.rs @@ -25,6 +25,7 @@ pub fn transitions(proof: MPTProofType) -> HashMap ( SegmentType::Start, vec![ + SegmentType::Start, // empty account proof in an empty mpt SegmentType::AccountTrie, // mpt has > 1 account SegmentType::AccountLeaf0, // mpt has <= 1 account ], @@ -106,6 +107,7 @@ pub fn transitions(proof: MPTProofType) -> HashMap ( SegmentType::Start, vec![ + SegmentType::Start, // empty account proof in an empty mpt SegmentType::AccountTrie, // mpt has > 1 account SegmentType::AccountLeaf0, // mpt has 1 account ], diff --git a/src/tests.rs b/src/tests.rs index 7ef7f0c3..46094e34 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -194,12 +194,59 @@ fn empty_account_proofs_for_zero_value_updates() { MPTProofType::NonceChanged, MPTProofType::CodeSizeExists, MPTProofType::CodeHashExists, + // poseidon code hash is not in this list because the state (rw) circuit will + // translate mpt lookups where the old and new poseidon code hash = 0 in account + // nonexistence proof lookups. ] { mock_prove(vec![(proof_type, trace.clone())]); } } } +#[test] +fn empty_mpt_empty_account_proofs_for_zero_value_updates() { + assert!(*HASH_SCHEME_DONE); + let mut generator = WitnessGenerator::from(&ZktrieState::default()); + let trace = generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::AccountDoesNotExist, + Address::repeat_byte(232), + U256::zero(), + U256::zero(), + None, + ); + let json = serde_json::to_string_pretty(&trace).unwrap(); + let type_1_trace: SMTTrace = serde_json::from_str(&json).unwrap(); + + let mut generator = WitnessGenerator::from(&ZktrieState::default()); + generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::BalanceChanged, + Address::repeat_byte(1), + U256::from(23), + U256::zero(), + None, + ); + + let trace = generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::AccountDoesNotExist, + Address::repeat_byte(2), + U256::zero(), + U256::zero(), + None, + ); + let json = serde_json::to_string_pretty(&trace).unwrap(); + let type_2_trace: SMTTrace = serde_json::from_str(&json).unwrap(); + + for proof_type in [ + MPTProofType::BalanceChanged, + MPTProofType::NonceChanged, + MPTProofType::CodeSizeExists, + MPTProofType::CodeHashExists, + ] { + mock_prove(vec![(proof_type, type_1_trace.clone())]); + mock_prove(vec![(proof_type, type_2_trace.clone())]); + } +} + #[test] fn empty_account_proofs_for_empty_storage_updates() { let type_1_address = Address::zero(); @@ -962,3 +1009,40 @@ fn singleton_mpt() { mock_prove(vec![(MPTProofType::BalanceChanged, trace)]); } + +#[test] +fn singleton_mpt_empty_account() { + assert!(*HASH_SCHEME_DONE); + let mut generator = WitnessGenerator::from(&ZktrieState::default()); + generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::BalanceChanged, + Address::repeat_byte(1), + U256::from(23), + U256::zero(), + None, + ); + + let trace = generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::AccountDoesNotExist, + Address::repeat_byte(2), + U256::zero(), + U256::zero(), + None, + ); + let json = serde_json::to_string_pretty(&trace).unwrap(); + let trace: SMTTrace = serde_json::from_str(&json).unwrap(); + + mock_prove(vec![(MPTProofType::AccountDoesNotExist, trace)]); +} + +#[test] +fn createNameRegistratorPerTxsNotEnoughGas_d0_g0_v0() { + // These mpt updates are by the test case at + // https://github.com/ethereum/tests/blob/747a4828f36c5fc8ab4f288d1cf4f1fe6662f3d6/src/GeneralStateTestsFiller/stCallCreateCallCodeTest/createNameRegistratorPerTxsNotEnoughGasFiller.json + mock_prove( + serde_json::from_str(&include_str!( + "traces/createNameRegistratorPerTxsNotEnoughGas_d0_g0_v0.json" + )) + .unwrap(), + ); +} diff --git a/src/traces/createNameRegistratorPerTxsNotEnoughGas_d0_g0_v0.json b/src/traces/createNameRegistratorPerTxsNotEnoughGas_d0_g0_v0.json new file mode 100644 index 00000000..33a88d07 --- /dev/null +++ b/src/traces/createNameRegistratorPerTxsNotEnoughGas_d0_g0_v0.json @@ -0,0 +1,463 @@ +[ + [ + "AccountDoesNotExist", + { + "address": "0x2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "accountKey": "0x0c2b7a2233683ca3fdf4cb670d06fffdeb11ad0592b1e7cad87e3e3cc7bcf805", + "accountPath": [ + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + [ + "NonceChanged", + { + "address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "accountKey": "0x293ccdc4280a75784fbdf8c7ae69b76e0852a88b140a7f330f49783d1347f626", + "accountPath": [ + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + [ + "BalanceChanged", + { + "address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "accountKey": "0x293ccdc4280a75784fbdf8c7ae69b76e0852a88b140a7f330f49783d1347f626", + "accountPath": [ + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + [ + "CodeHashExists", + { + "address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "accountKey": "0x293ccdc4280a75784fbdf8c7ae69b76e0852a88b140a7f330f49783d1347f626", + "accountPath": [ + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + [ + "AccountDoesNotExist", + { + "address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "accountKey": "0x293ccdc4280a75784fbdf8c7ae69b76e0852a88b140a7f330f49783d1347f626", + "accountPath": [ + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + [ + "NonceChanged", + { + "address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "accountKey": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "accountPath": [ + { + "root": "0x252e31fcfd8f15f35cf1db8a250dc2f9920414047047f8263f509b2ec9d7dd03", + "leaf": { + "value": "0x0fd348b83e56090b7525967291ba6ae3c06f43cb926a41018b279747d702d329", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0x21c93afa043be744e054aa90a3021bc3c28df7eb73686826fdb1af882db68d00", + "leaf": { + "value": "0x01a0cb636f821145c93f3fe1c01ef770710634b11442e684e9b2a3a5661ea11c", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + { + "nonce": 0, + "balance": "0xde0b6b3a7640000", + "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", + "codeSize": 0 + }, + { + "nonce": 1, + "balance": "0xde0b6b3a7640000", + "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", + "codeSize": 0 + } + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + [ + "BalanceChanged", + { + "address": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "accountKey": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "accountPath": [ + { + "root": "0x21c93afa043be744e054aa90a3021bc3c28df7eb73686826fdb1af882db68d00", + "leaf": { + "value": "0x01a0cb636f821145c93f3fe1c01ef770710634b11442e684e9b2a3a5661ea11c", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + { + "nonce": 1, + "balance": "0xde0b6b3a7640000", + "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", + "codeSize": 0 + }, + { + "nonce": 1, + "balance": "0xde0b6b3a75b6e5e", + "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", + "poseidonCodeHash": "0x2098f5fb9e239eab3ceac3f27b81e481dc3124d55ffed523a839ee8446b64864", + "codeSize": 0 + } + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + [ + "StorageDoesNotExist", + { + "address": "0x5300000000000000000000000000000000000000", + "accountKey": "0x0e246ded53daafa183c0d7b6ff1427e8318b63f416ac264dd3ea5ff3dc9b3808", + "accountPath": [ + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "stateKey": "0x0000000000000000000000000000000000000000000000000000000000000000" + } + ], + [ + "StorageDoesNotExist", + { + "address": "0x5300000000000000000000000000000000000002", + "accountKey": "0xc964ea4804d91b686d3213d75187b806cca56a03a8e669c905fbd1e415689a13", + "accountPath": [ + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "stateKey": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + ], + [ + "StorageDoesNotExist", + { + "address": "0x5300000000000000000000000000000000000002", + "accountKey": "0xc964ea4804d91b686d3213d75187b806cca56a03a8e669c905fbd1e415689a13", + "accountPath": [ + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "stateKey": "0x0000000000000000000000000000000000000000000000000000000000000002" + } + ], + [ + "StorageDoesNotExist", + { + "address": "0x5300000000000000000000000000000000000002", + "accountKey": "0xc964ea4804d91b686d3213d75187b806cca56a03a8e669c905fbd1e415689a13", + "accountPath": [ + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "stateKey": "0x0000000000000000000000000000000000000000000000000000000000000003" + } + ], + [ + "StorageDoesNotExist", + { + "address": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "accountKey": "0x293ccdc4280a75784fbdf8c7ae69b76e0852a88b140a7f330f49783d1347f626", + "accountPath": [ + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + }, + { + "root": "0xb6a81800a5caa2576fc916d7b53dd7abc0439a6b80d177394b3fe0e00b8bbf2e", + "leaf": { + "value": "0xf90e9fb8011123e5fe020cd4d65c150902658a2ef051090d46c6f48de6d2d405", + "sibling": "0x44ef89daadd3a70d440f9af05579a1f73d2d9407710c524f21903ee56f3f3f1a", + "node_type": 4 + }, + "pathPart": "0x0" + } + ], + "accountUpdate": [ + null, + null + ], + "statePath": [ + null, + null + ], + "commonStateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000", + "stateKey": "0x0000000000000000000000000000000000000000000000000000000000000001" + } + ] +] From cafcdeb2c7fd6602d0ddac183c1fb5396a135f9e Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Fri, 1 Sep 2023 09:10:52 +0800 Subject: [PATCH 16/30] upgrade poseidon circuit --- Cargo.lock.current | 3199 ++++++++++++++++++++++++++++++++++++++++++++ Cargo.toml | 2 +- 2 files changed, 3200 insertions(+), 1 deletion(-) create mode 100644 Cargo.lock.current diff --git a/Cargo.lock.current b/Cargo.lock.current new file mode 100644 index 00000000..9e171af9 --- /dev/null +++ b/Cargo.lock.current @@ -0,0 +1,3199 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if 1.0.0", + "cipher", + "cpufeatures", + "opaque-debug 0.3.0", +] + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +dependencies = [ + "memchr", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anyhow" +version = "1.0.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" + +[[package]] +name = "ark-std" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[package]] +name = "async-trait" +version = "0.1.73" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + +[[package]] +name = "auto_impl" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base58" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" + +[[package]] +name = "base58check" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ee2fe4c9a0c84515f136aaae2466744a721af6d63339c18689d9e995d74d99b" +dependencies = [ + "base58", + "sha2 0.8.2", +] + +[[package]] +name = "base64" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64ct" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" + +[[package]] +name = "bech32" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" + +[[package]] +name = "bencher" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dfdb4953a096c551ce9ace855a604d702e6e62d77fac690575ae347571717f5" + +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "0.17.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" +dependencies = [ + "either", + "radium 0.3.0", +] + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium 0.7.0", + "tap", + "wyz", +] + +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "blake2b_simd" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +dependencies = [ + "arrayref", + "arrayvec", + "constant_time_eq", +] + +[[package]] +name = "block-buffer" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" +dependencies = [ + "block-padding 0.1.5", + "byte-tools", + "byteorder", + "generic-array 0.12.4", +] + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "block-padding 0.2.1", + "generic-array 0.14.7", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "block-padding" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" +dependencies = [ + "byte-tools", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + +[[package]] +name = "borsh" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" +dependencies = [ + "borsh-derive", + "hashbrown 0.13.2", +] + +[[package]] +name = "borsh-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" +dependencies = [ + "borsh-derive-internal", + "borsh-schema-derive-internal", + "proc-macro-crate 0.1.5", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "borsh-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "borsh-schema-derive-internal" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bumpalo" +version = "3.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" + +[[package]] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" + +[[package]] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" + +[[package]] +name = "bytecheck" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "bytemuck" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +dependencies = [ + "serde", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ed24df0632f708f5f6d8082675bef2596f7084dee3dd55f632290bf35bfe0f" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "time", + "wasm-bindgen", + "windows-targets", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] + +[[package]] +name = "coins-bip32" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634c509653de24b439672164bbf56f5f582a2ab0e313d3b0f6af0b7345cf2560" +dependencies = [ + "bincode", + "bs58", + "coins-core", + "digest 0.10.7", + "getrandom", + "hmac 0.12.1", + "k256", + "lazy_static", + "serde", + "sha2 0.10.7", + "thiserror", +] + +[[package]] +name = "coins-bip39" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a11892bcac83b4c6e95ab84b5b06c76d9d70ad73548dd07418269c5c7977171" +dependencies = [ + "bitvec 0.17.4", + "coins-bip32", + "getrandom", + "hex", + "hmac 0.12.1", + "pbkdf2 0.11.0", + "rand", + "sha2 0.10.7", + "thiserror", +] + +[[package]] +name = "coins-core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c94090a6663f224feae66ab01e41a2555a8296ee07b5f20dab8888bdefc9f617" +dependencies = [ + "base58check", + "base64 0.12.3", + "bech32", + "blake2", + "digest 0.10.7", + "generic-array 0.14.7", + "hex", + "ripemd", + "serde", + "serde_derive", + "sha2 0.10.7", + "sha3 0.10.8", + "thiserror", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "const-cstr" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3d0b5ff30645a68f35ece8cea4556ca14ef8a1651455f789a099a0513532a6" + +[[package]] +name = "const-oid" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" + +[[package]] +name = "constant_time_eq" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" + +[[package]] +name = "core-graphics" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" +dependencies = [ + "bitflags", + "core-foundation", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" +dependencies = [ + "bitflags", + "core-foundation", + "libc", +] + +[[package]] +name = "core-text" +version = "19.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" +dependencies = [ + "core-foundation", + "core-graphics", + "foreign-types", + "libc", +] + +[[package]] +name = "cpufeatures" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if 1.0.0", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array 0.14.7", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.7", + "typenum", +] + +[[package]] +name = "crypto-mac" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" +dependencies = [ + "generic-array 0.14.7", + "subtle", +] + +[[package]] +name = "ctr" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +dependencies = [ + "cipher", +] + +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core 0.10.2", + "darling_macro 0.10.2", +] + +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.9.3", + "syn 1.0.109", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core 0.10.2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derive_builder" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2658621297f2cf68762a6f7dc0bb7e1ff2cfd6583daef8ee0fed6f7ec468ec0" +dependencies = [ + "darling 0.10.2", + "derive_builder_core", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2791ea3e372c8495c0bc2033991d76b512cd799d07491fbd6890124db9458bef" +dependencies = [ + "darling 0.10.2", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +dependencies = [ + "generic-array 0.12.4", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.7", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dlib" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" +dependencies = [ + "libloading", +] + +[[package]] +name = "dwrote" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +dependencies = [ + "lazy_static", + "libc", + "winapi", + "wio", +] + +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "digest 0.10.7", + "ff", + "generic-array 0.14.7", + "group", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "env_logger" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "eth-keystore" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f65b750ac950f2f825b36d08bef4cda4112e19a7b1a68f6e2bb499413e12440" +dependencies = [ + "aes", + "ctr", + "digest 0.10.7", + "hex", + "hmac 0.12.1", + "pbkdf2 0.11.0", + "rand", + "scrypt", + "serde", + "serde_json", + "sha2 0.10.7", + "sha3 0.10.8", + "thiserror", + "uuid 0.8.2", +] + +[[package]] +name = "eth-types" +version = "0.1.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git#e7d4c104c0affc74dd6c1e0a52e7ca941e6cbadd" +dependencies = [ + "ethers-core", + "ethers-signers", + "halo2_proofs", + "hex", + "itertools", + "lazy_static", + "libsecp256k1", + "num", + "num-bigint", + "poseidon-circuit 0.1.0 (git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0723)", + "regex", + "serde", + "serde_json", + "serde_with", + "sha3 0.10.8", + "strum", + "strum_macros", + "subtle", + "uint", +] + +[[package]] +name = "ethabi" +version = "17.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4966fba78396ff92db3b817ee71143eccd98acf0f876b8d600e585a670c5d1b" +dependencies = [ + "ethereum-types", + "hex", + "once_cell", + "regex", + "serde", + "serde_json", + "sha3 0.10.8", + "thiserror", + "uint", +] + +[[package]] +name = "ethbloom" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" +dependencies = [ + "crunchy", + "fixed-hash", + "impl-rlp", + "impl-serde", + "tiny-keccak", +] + +[[package]] +name = "ethereum-types" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" +dependencies = [ + "ethbloom", + "fixed-hash", + "impl-rlp", + "impl-serde", + "primitive-types", + "uint", +] + +[[package]] +name = "ethers-core" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ebdd63c828f58aa067f40f9adcbea5e114fb1f90144b3a1e2858e0c9b1ff4e8" +dependencies = [ + "arrayvec", + "bytes", + "chrono", + "convert_case", + "elliptic-curve", + "ethabi", + "fastrlp", + "generic-array 0.14.7", + "hex", + "k256", + "proc-macro2", + "rand", + "rlp", + "rlp-derive", + "rust_decimal", + "serde", + "serde_json", + "strum", + "syn 1.0.109", + "thiserror", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "ethers-signers" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73a72ecad124e8ccd18d6a43624208cab0199e59621b1f0fa6b776b2e0529107" +dependencies = [ + "async-trait", + "coins-bip32", + "coins-bip39", + "elliptic-curve", + "eth-keystore", + "ethers-core", + "hex", + "rand", + "sha2 0.10.7", + "thiserror", +] + +[[package]] +name = "fake-simd" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" + +[[package]] +name = "fastrlp" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "089263294bb1c38ac73649a6ad563dd9a5142c8dc0482be15b8b9acb22a1611e" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types", + "fastrlp-derive", +] + +[[package]] +name = "fastrlp-derive" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0f9d074ab623d1b388c12544bfeed759c7df36dc5c300cda053df9ba1232075" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "fdeflate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d329bdeac514ee06249dabc27877490f17f5d371ec693360768b838e19f3ae10" +dependencies = [ + "simd-adler32", +] + +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "bitvec 1.0.1", + "rand_core", + "subtle", +] + +[[package]] +name = "fixed-hash" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] + +[[package]] +name = "flate2" +version = "1.0.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "float-ord" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bad48618fdb549078c333a7a8528acb57af271d0433bdecd523eb620628364e" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "font-kit" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21fe28504d371085fae9ac7a3450f0b289ab71e07c8e57baa3fb68b9e57d6ce5" +dependencies = [ + "bitflags", + "byteorder", + "core-foundation", + "core-graphics", + "core-text", + "dirs-next", + "dwrote", + "float-ord", + "freetype", + "lazy_static", + "libc", + "log", + "pathfinder_geometry", + "pathfinder_simd", + "walkdir", + "winapi", + "yeslogic-fontconfig-sys", +] + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "freetype" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee38378a9e3db1cc693b4f88d166ae375338a0ff75cb8263e1c601d51f35dc6" +dependencies = [ + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "generic-array" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" +dependencies = [ + "typenum", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", +] + +[[package]] +name = "gobuild" +version = "0.1.0-alpha.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e156a4ddbf3deb5e8116946c111413bd9a5679bdc1536c78a60618a7a9ac9e" +dependencies = [ + "cc", +] + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "halo2-mpt-circuits" +version = "0.1.0" +dependencies = [ + "bencher", + "ethers-core", + "halo2_proofs", + "hex", + "itertools", + "lazy_static", + "log", + "mpt-zktrie", + "num-bigint", + "num-traits", + "plotters", + "poseidon-circuit 0.1.0 (git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0901)", + "rand", + "rand_chacha", + "serde", + "serde_json", + "strum", + "strum_macros", + "subtle", + "thiserror", +] + +[[package]] +name = "halo2-mpt-circuits" +version = "0.1.0" +source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.1#c5cd0dab4a242d7077bf9cad051119dafaa4d6e9" +dependencies = [ + "ethers-core", + "halo2_proofs", + "hex", + "itertools", + "lazy_static", + "log", + "num-bigint", + "num-traits", + "poseidon-circuit 0.1.0 (git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0723)", + "rand", + "serde", + "serde_json", + "strum", + "strum_macros", + "thiserror", +] + +[[package]] +name = "halo2_proofs" +version = "0.2.0" +source = "git+https://github.com/scroll-tech/halo2.git?branch=develop#aa86c107aeb62282d81ebce5c4930ec0c0aa540b" +dependencies = [ + "ark-std", + "blake2b_simd", + "cfg-if 0.1.10", + "crossbeam", + "env_logger", + "ff", + "group", + "halo2curves 0.3.1 (git+https://github.com/scroll-tech/halo2curves.git?branch=0.3.1-derive-serde)", + "log", + "num-bigint", + "num-integer", + "plotters", + "poseidon", + "rand_core", + "rayon", + "sha3 0.9.1", + "subtle", + "tabbycat", + "tracing", +] + +[[package]] +name = "halo2curves" +version = "0.3.1" +source = "git+https://github.com/privacy-scaling-explorations/halo2curves?tag=0.3.1#9b67e19bca30a35208b0c1b41c1723771e2c9f49" +dependencies = [ + "ff", + "group", + "lazy_static", + "num-bigint", + "num-traits", + "pasta_curves", + "rand", + "rand_core", + "static_assertions", + "subtle", +] + +[[package]] +name = "halo2curves" +version = "0.3.1" +source = "git+https://github.com/scroll-tech/halo2curves.git?branch=0.3.1-derive-serde#969f1e44d9713ee4cd552563bd0c762c5d53b56e" +dependencies = [ + "ff", + "group", + "lazy_static", + "num-bigint", + "num-traits", + "pasta_curves", + "paste", + "rand", + "rand_core", + "serde", + "static_assertions", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.6", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.3", +] + +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hermit-abi" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" +dependencies = [ + "crypto-mac", + "digest 0.9.0", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "hmac-drbg" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" +dependencies = [ + "digest 0.9.0", + "generic-array 0.14.7", + "hmac 0.8.1", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "iana-time-zone" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "image" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "jpeg-decoder", + "num-rational", + "num-traits", + "png", +] + +[[package]] +name = "impl-codec" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" +dependencies = [ + "parity-scale-codec", +] + +[[package]] +name = "impl-rlp" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" +dependencies = [ + "rlp", +] + +[[package]] +name = "impl-serde" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" +dependencies = [ + "serde", +] + +[[package]] +name = "impl-trait-for-tuples" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" + +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" + +[[package]] +name = "js-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa", + "elliptic-curve", + "sha2 0.10.7", + "sha3 0.10.8", +] + +[[package]] +name = "keccak" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "libc" +version = "0.2.147" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + +[[package]] +name = "libloading" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +dependencies = [ + "cfg-if 1.0.0", + "windows-sys", +] + +[[package]] +name = "libsecp256k1" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95b09eff1b35ed3b33b877ced3a691fc7a481919c7e29c53c906226fcf55e2a1" +dependencies = [ + "arrayref", + "base64 0.13.1", + "digest 0.9.0", + "hmac-drbg", + "libsecp256k1-core", + "libsecp256k1-gen-ecmult", + "libsecp256k1-gen-genmult", + "rand", + "serde", + "sha2 0.9.9", + "typenum", +] + +[[package]] +name = "libsecp256k1-core" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" +dependencies = [ + "crunchy", + "digest 0.9.0", + "subtle", +] + +[[package]] +name = "libsecp256k1-gen-ecmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3038c808c55c87e8a172643a7d87187fc6c4174468159cb3090659d55bcb4809" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "libsecp256k1-gen-genmult" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3db8d6ba2cec9eacc40e6e8ccc98931840301f1006e95647ceb2dd5c3aa06f7c" +dependencies = [ + "libsecp256k1-core", +] + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "memchr" +version = "2.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + +[[package]] +name = "mpt-zktrie" +version = "0.1.0" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git#e7d4c104c0affc74dd6c1e0a52e7ca941e6cbadd" +dependencies = [ + "eth-types", + "halo2-mpt-circuits 0.1.0 (git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.1)", + "halo2_proofs", + "hex", + "lazy_static", + "log", + "num-bigint", + "poseidon-circuit 0.1.0 (git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0723)", + "zktrie", +] + +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", + "rand", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi 0.3.2", + "libc", +] + +[[package]] +name = "once_cell" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" + +[[package]] +name = "opaque-debug" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "parity-scale-codec" +version = "3.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +dependencies = [ + "arrayvec", + "bitvec 1.0.1", + "byte-slice-cast", + "impl-trait-for-tuples", + "parity-scale-codec-derive", + "serde", +] + +[[package]] +name = "parity-scale-codec-derive" +version = "3.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "password-hash" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "pasta_curves" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" +dependencies = [ + "blake2b_simd", + "ff", + "group", + "lazy_static", + "rand", + "static_assertions", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pathfinder_geometry" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b7e7b4ea703700ce73ebf128e1450eb69c3a8329199ffbfb9b2a0418e5ad3" +dependencies = [ + "log", + "pathfinder_simd", +] + +[[package]] +name = "pathfinder_simd" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff" +dependencies = [ + "rustc_version", +] + +[[package]] +name = "pbkdf2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", + "hmac 0.12.1", + "password-hash 0.4.2", + "sha2 0.10.7", +] + +[[package]] +name = "pest" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" +dependencies = [ + "memchr", + "thiserror", + "ucd-trie", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + +[[package]] +name = "plotters" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" +dependencies = [ + "chrono", + "font-kit", + "image", + "lazy_static", + "num-traits", + "pathfinder_geometry", + "plotters-backend", + "plotters-bitmap", + "plotters-svg", + "ttf-parser", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "plotters-backend" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" + +[[package]] +name = "plotters-bitmap" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cebbe1f70205299abc69e8b295035bb52a6a70ee35474ad10011f0a4efb8543" +dependencies = [ + "gif", + "image", + "plotters-backend", +] + +[[package]] +name = "plotters-svg" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" +dependencies = [ + "plotters-backend", +] + +[[package]] +name = "png" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +dependencies = [ + "bitflags", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + +[[package]] +name = "poseidon" +version = "0.2.0" +source = "git+https://github.com/scroll-tech/poseidon.git?branch=scroll-dev-0220#2fb4a2385bada39b50dce12fe50cb80d2fd33476" +dependencies = [ + "group", + "halo2curves 0.3.1 (git+https://github.com/privacy-scaling-explorations/halo2curves?tag=0.3.1)", + "subtle", +] + +[[package]] +name = "poseidon-circuit" +version = "0.1.0" +source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0723#1652d54bf7ca9d8f286b53fe077d9efefdcf6d5f" +dependencies = [ + "bitvec 1.0.1", + "halo2_proofs", + "lazy_static", + "log", + "rand", + "rand_xorshift", + "thiserror", +] + +[[package]] +name = "poseidon-circuit" +version = "0.1.0" +source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0901#69524f42bdc55c581088c2fe64c2ab9a2921146b" +dependencies = [ + "bitvec 1.0.1", + "halo2_proofs", + "lazy_static", + "log", + "rand", + "rand_xorshift", + "thiserror", +] + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primitive-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +dependencies = [ + "fixed-hash", + "impl-codec", + "impl-rlp", + "impl-serde", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn 1.0.109", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core", +] + +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall", + "thiserror", +] + +[[package]] +name = "regex" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" + +[[package]] +name = "rend" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint", + "hmac 0.12.1", + "zeroize", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "rkyv" +version = "0.7.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" +dependencies = [ + "bitvec 1.0.1", + "bytecheck", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid 1.4.1", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.42" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rustc-hex", +] + +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rust_decimal" +version = "1.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd" +dependencies = [ + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand", + "rkyv", + "serde", + "serde_json", +] + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" + +[[package]] +name = "salsa20" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scrypt" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e73d6d7c6311ebdbd9184ad6c4447b2f36337e327bda107d3ba9e3c374f9d325" +dependencies = [ + "hmac 0.12.1", + "password-hash 0.3.2", + "pbkdf2 0.10.1", + "salsa20", + "sha2 0.10.7", +] + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct", + "der", + "generic-array 0.14.7", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +dependencies = [ + "semver-parser", +] + +[[package]] +name = "semver-parser" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" +dependencies = [ + "pest", +] + +[[package]] +name = "serde" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.188" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "serde_json" +version = "1.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "serde", + "serde_with_macros", +] + +[[package]] +name = "serde_with_macros" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling 0.13.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sha2" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" +dependencies = [ + "block-buffer 0.7.3", + "digest 0.8.1", + "fake-simd", + "opaque-debug 0.2.3", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.9.0", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.7", +] + +[[package]] +name = "sha3" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug 0.3.0", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros", +] + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "tabbycat" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c45590f0f859197b4545be1b17b2bc3cc7bb075f7d1cc0ea1dc6521c0bf256a3" +dependencies = [ + "anyhow", + "derive_builder", + "regex", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_datetime" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" + +[[package]] +name = "toml_edit" +version = "0.19.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tracing" +version = "0.1.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + +[[package]] +name = "tracing-core" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "ttf-parser" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "375812fa44dab6df41c195cd2f7fecb488f6c09fbaafb62807488cefab642bff" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "ucd-trie" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-ident" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +dependencies = [ + "getrandom", + "serde", +] + +[[package]] +name = "uuid" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.29", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.87" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" + +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" + +[[package]] +name = "winnow" +version = "0.5.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +dependencies = [ + "memchr", +] + +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "yeslogic-fontconfig-sys" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2bbd69036d397ebbff671b1b8e4d918610c181c5a16073b96f984a38d08c386" +dependencies = [ + "const-cstr", + "dlib", + "once_cell", + "pkg-config", +] + +[[package]] +name = "zeroize" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" + +[[package]] +name = "zktrie" +version = "0.2.0" +source = "git+https://github.com/scroll-tech/zktrie.git?branch=v0.6#83318659773604fa565e2ebeb810a6d3746f0af4" +dependencies = [ + "gobuild", +] diff --git a/Cargo.toml b/Cargo.toml index fb04fc42..7eee374e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] ethers-core = "0.17.0" itertools = "0.10.5" -hash-circuit = { package = "poseidon-circuit", git = "https://github.com/scroll-tech/poseidon-circuit.git", branch = "scroll-dev-0723"} +hash-circuit = { package = "poseidon-circuit", git = "https://github.com/scroll-tech/poseidon-circuit.git", branch = "scroll-dev-0901"} halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2022_09_10" } rand = "0.8" lazy_static = "1.4.0" From e4f5df31e9b3005bb5977c11aa0c3b262cfe3269 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Mon, 11 Sep 2023 21:57:56 -0400 Subject: [PATCH 17/30] [ZK 38] range check address_high and address_low (#78) * Add comment explaining why we don't need to range check address_low * [ZK 2-23] add check that final mpt update row is padding (#85) * Add check that final mpt update row is padding * fmt * Use constraints instead of lookups * Fix assert --------- Co-authored-by: Mason Liang * Add range check for address_low * camel case test name --------- Co-authored-by: naure Co-authored-by: Mason Liang --- src/gadgets/byte_representation.rs | 12 +++++++-- src/gadgets/mpt_update.rs | 39 ++++++++++++++++++------------ src/mpt.rs | 12 ++++++--- src/tests.rs | 2 +- 4 files changed, 44 insertions(+), 21 deletions(-) diff --git a/src/gadgets/byte_representation.rs b/src/gadgets/byte_representation.rs index 1f761bb9..20485787 100644 --- a/src/gadgets/byte_representation.rs +++ b/src/gadgets/byte_representation.rs @@ -97,15 +97,17 @@ impl ByteRepresentationConfig { pub fn assign( &self, region: &mut Region<'_, F>, + u32s: &[u32], u64s: &[u64], u128s: &[u128], frs: &[Fr], randomness: Value, ) { self.is_first.enable(region, 0); - let byte_representations = u64s + let byte_representations = u32s .iter() - .map(u64_to_big_endian) + .map(u32_to_big_endian) + .chain(u64s.iter().map(u64_to_big_endian)) .chain(u128s.iter().map(u128_to_big_endian)) .chain(frs.iter().map(fr_to_big_endian)); @@ -133,6 +135,9 @@ impl ByteRepresentationConfig { } } +fn u32_to_big_endian(x: &u32) -> Vec { + x.to_be_bytes().to_vec() +} fn u64_to_big_endian(x: &u64) -> Vec { x.to_be_bytes().to_vec() } @@ -173,6 +178,7 @@ mod test { #[derive(Clone, Default, Debug)] struct TestCircuit { + u32s: Vec, u64s: Vec, u128s: Vec, frs: Vec, @@ -219,6 +225,7 @@ mod test { byte_bit.assign(&mut region); byte_representation.assign( &mut region, + &self.u32s, &self.u64s, &self.u128s, &self.frs, @@ -233,6 +240,7 @@ mod test { #[test] fn test_byte_representation() { let circuit = TestCircuit { + u32s: vec![0, 1, u32::MAX], u64s: vec![u64::MAX], u128s: vec![0, 1, u128::MAX], frs: vec![Fr::from(2342)], diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index d33fea72..06004cf6 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -83,7 +83,9 @@ impl MptUpdateLookup for MptUpdateConfig { let proof_type = self.proof_type.current() * is_start(); let old_value = self.old_value.current() * is_start(); let new_value = self.new_value.current() * is_start(); - let address = self.intermediate_values[0].current() * is_start(); + let [address_high, address_low, ..] = self.intermediate_values; + let address = + address_high.current() + address_low.current() * Query::Constant(F::from_u128(1 << 96)); let storage_key_rlc = self.storage_key_rlc.current() * is_start(); [ is_start().into(), @@ -131,17 +133,13 @@ impl MptUpdateConfig { path_type.current_matches(&[PathType::Start]).into(), ); cb.condition(is_start.clone().and(cb.every_row_selector()), |cb| { - let [address, address_high, ..] = intermediate_values; + let [address_high, address_low, ..] = intermediate_values; let [old_hash_rlc, new_hash_rlc, ..] = second_phase_intermediate_values; - let address_low: Query = (address.current() - address_high.current() * (1 << 32)) - * (1 << 32) - * (1 << 32) - * (1 << 32); cb.poseidon_lookup( - "account mpt key = h(address_high, address_low)", + "account mpt key = h(address_high, address_low << 96)", [ address_high.current(), - address_low, + address_low.current() * Query::Constant(F::from_u128(1 << 96)), Query::from(u64::from(HashDomain::Pair)), key.current(), ], @@ -152,6 +150,11 @@ impl MptUpdateConfig { [address_high.current(), Query::from(15)], bytes.lookup(), ); + cb.add_lookup( + "address_low is 4 bytes", + [address_low.current(), Query::from(3)], + bytes.lookup(), + ); cb.add_lookup( "rlc_old_root = rlc(old_root)", [old_hash.current(), old_hash_rlc.current(), Query::from(31)], @@ -393,12 +396,16 @@ impl MptUpdateConfig { self.other_key.assign(region, offset, other_key); self.domain.assign(region, offset, HashDomain::Pair); - self.intermediate_values[0].assign(region, offset, address_to_fr(proof.claim.address)); - self.intermediate_values[1].assign( + self.intermediate_values[0].assign( region, offset, Fr::from_u128(address_high(proof.claim.address)), ); + self.intermediate_values[1].assign( + region, + offset, + u64::from(address_low(proof.claim.address)), + ); let rlc_fr = |x: Fr| { let mut bytes = x.to_bytes(); @@ -2013,9 +2020,9 @@ fn address_high(a: Address) -> u128 { u128::from_be_bytes(high_bytes) } -fn address_low(a: Address) -> u128 { +fn address_low(a: Address) -> u32 { let low_bytes: [u8; 4] = a.0[16..].try_into().unwrap(); - u128::from(u32::from_be_bytes(low_bytes)) << 96 + u32::from_be_bytes(low_bytes) } // ... the return traces: ([inp;2], domain, hash) @@ -2042,7 +2049,7 @@ pub fn hash_traces(proofs: &[Proof]) -> Vec<([Fr; 2], Fr, Fr)> { hash_traces.push(( [ Fr::from_u128(address_high(proof.claim.address)), - Fr::from_u128(address_low(proof.claim.address)), + Fr::from_u128(u128::from(address_low(proof.claim.address)) << 96), ], HashDomain::Pair.into(), key, @@ -2113,13 +2120,15 @@ pub fn key_bit_lookups(proofs: &[Proof]) -> Vec<(Fr, usize, bool)> { } /// ... -pub fn byte_representations(proofs: &[Proof]) -> (Vec, Vec, Vec) { +pub fn byte_representations(proofs: &[Proof]) -> (Vec, Vec, Vec, Vec) { + let mut u32s = vec![]; let mut u64s = vec![]; let mut u128s = vec![0]; let mut frs = vec![]; for proof in proofs { u128s.push(address_high(proof.claim.address)); + u32s.push(address_low(proof.claim.address)); match MPTProofType::from(proof.claim) { MPTProofType::NonceChanged | MPTProofType::CodeSizeExists => { u128s.push(address_high(proof.claim.address)); @@ -2188,7 +2197,7 @@ pub fn byte_representations(proofs: &[Proof]) -> (Vec, Vec, Vec) _ => {} } } - (u64s, u128s, frs) + (u32s, u64s, u128s, frs) } /// .. diff --git a/src/mpt.rs b/src/mpt.rs index aca1d7d0..08c8c50c 100644 --- a/src/mpt.rs +++ b/src/mpt.rs @@ -119,7 +119,7 @@ impl MptCircuitConfig { n_rows: usize, ) -> Result<(), Error> { let randomness = self.rlc_randomness.value(layouter); - let (u64s, u128s, frs) = byte_representations(proofs); + let (u32s, u64s, u128s, frs) = byte_representations(proofs); layouter.assign_region( || "mpt circuit", @@ -150,8 +150,14 @@ impl MptCircuitConfig { ); self.key_bit.assign(&mut region, &key_bit_lookups(proofs)); self.byte_bit.assign(&mut region); - self.byte_representation - .assign(&mut region, &u64s, &u128s, &frs, randomness); + self.byte_representation.assign( + &mut region, + &u32s, + &u64s, + &u128s, + &frs, + randomness, + ); let n_assigned_rows = self.mpt_update.assign(&mut region, proofs, randomness); diff --git a/src/tests.rs b/src/tests.rs index 46094e34..5601076b 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -1036,7 +1036,7 @@ fn singleton_mpt_empty_account() { } #[test] -fn createNameRegistratorPerTxsNotEnoughGas_d0_g0_v0() { +fn create_name_registrator_per_txs_not_enough_gas_d0_g0_v0() { // These mpt updates are by the test case at // https://github.com/ethereum/tests/blob/747a4828f36c5fc8ab4f288d1cf4f1fe6662f3d6/src/GeneralStateTestsFiller/stCallCreateCallCodeTest/createNameRegistratorPerTxsNotEnoughGasFiller.json mock_prove( From a42263eeb38f48b3008abea95993423604497c6a Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Wed, 13 Sep 2023 10:27:36 +0800 Subject: [PATCH 18/30] upgrade ethers-rs --- Cargo.lock.current | 914 ++++++++++++++++++++------------ Cargo.toml | 4 +- src/constraint_builder/query.rs | 3 +- src/gadgets/mpt_update.rs | 4 +- src/util.rs | 7 +- 5 files changed, 584 insertions(+), 348 deletions(-) diff --git a/Cargo.lock.current b/Cargo.lock.current index 9e171af9..1fe44df4 100644 --- a/Cargo.lock.current +++ b/Cargo.lock.current @@ -10,14 +10,13 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aes" -version = "0.7.5" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" dependencies = [ "cfg-if 1.0.0", "cipher", "cpufeatures", - "opaque-debug 0.3.0", ] [[package]] @@ -102,7 +101,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -141,44 +140,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" [[package]] -name = "base58" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5024ee8015f02155eee35c711107ddd9a9bf3cb689cf2a9089c97e79b6e1ae83" - -[[package]] -name = "base58check" -version = "0.1.0" +name = "base16ct" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ee2fe4c9a0c84515f136aaae2466744a721af6d63339c18689d9e995d74d99b" -dependencies = [ - "base58", - "sha2 0.8.2", -] +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] name = "base64" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.13.1" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "base64ct" -version = "1.0.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bech32" -version = "0.7.3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" [[package]] name = "bencher" @@ -186,15 +175,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dfdb4953a096c551ce9ace855a604d702e6e62d77fac690575ae347571717f5" -[[package]] -name = "bincode" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" -dependencies = [ - "serde", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -202,14 +182,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] -name = "bitvec" -version = "0.17.4" +name = "bitflags" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" -dependencies = [ - "either", - "radium 0.3.0", -] +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "bitvec" @@ -218,51 +194,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", - "radium 0.7.0", + "radium", "tap", "wyz", ] -[[package]] -name = "blake2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" -dependencies = [ - "digest 0.10.7", -] - [[package]] name = "blake2b_simd" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" +checksum = "23285ad32269793932e830392f2fe2f83e26488fd3ec778883a93c8323735780" dependencies = [ "arrayref", "arrayvec", "constant_time_eq", ] -[[package]] -name = "block-buffer" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b" -dependencies = [ - "block-padding 0.1.5", - "byte-tools", - "byteorder", - "generic-array 0.12.4", -] - [[package]] name = "block-buffer" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" dependencies = [ - "block-padding 0.2.1", - "generic-array 0.14.7", + "block-padding", + "generic-array", ] [[package]] @@ -271,16 +226,7 @@ version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ - "generic-array 0.14.7", -] - -[[package]] -name = "block-padding" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5" -dependencies = [ - "byte-tools", + "generic-array", ] [[package]] @@ -336,9 +282,13 @@ dependencies = [ [[package]] name = "bs58" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "sha2 0.10.7", + "tinyvec", +] [[package]] name = "bumpalo" @@ -352,12 +302,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - [[package]] name = "bytecheck" version = "0.6.11" @@ -382,9 +326,9 @@ dependencies = [ [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" @@ -394,9 +338,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" dependencies = [ "serde", ] @@ -424,26 +368,26 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.28" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ed24df0632f708f5f6d8082675bef2596f7084dee3dd55f632290bf35bfe0f" +checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", - "time", "wasm-bindgen", "windows-targets", ] [[package]] name = "cipher" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ - "generic-array 0.14.7", + "crypto-common", + "inout", ] [[package]] @@ -457,18 +401,15 @@ dependencies = [ [[package]] name = "coins-bip32" -version = "0.7.0" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634c509653de24b439672164bbf56f5f582a2ab0e313d3b0f6af0b7345cf2560" +checksum = "3b6be4a5df2098cd811f3194f64ddb96c267606bffd9689ac7b0160097b01ad3" dependencies = [ - "bincode", "bs58", "coins-core", "digest 0.10.7", - "getrandom", "hmac 0.12.1", - "k256", - "lazy_static", + "k256 0.13.1", "serde", "sha2 0.10.7", "thiserror", @@ -476,16 +417,15 @@ dependencies = [ [[package]] name = "coins-bip39" -version = "0.7.0" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a11892bcac83b4c6e95ab84b5b06c76d9d70ad73548dd07418269c5c7977171" +checksum = "3db8fba409ce3dc04f7d804074039eb68b960b0829161f8e06c95fea3f122528" dependencies = [ - "bitvec 0.17.4", + "bitvec", "coins-bip32", - "getrandom", - "hex", "hmac 0.12.1", - "pbkdf2 0.11.0", + "once_cell", + "pbkdf2 0.12.2", "rand", "sha2 0.10.7", "thiserror", @@ -493,16 +433,15 @@ dependencies = [ [[package]] name = "coins-core" -version = "0.7.0" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c94090a6663f224feae66ab01e41a2555a8296ee07b5f20dab8888bdefc9f617" +checksum = "5286a0843c21f8367f7be734f89df9b822e0321d8bcce8d6e735aadff7d74979" dependencies = [ - "base58check", - "base64 0.12.3", + "base64 0.21.4", "bech32", - "blake2", + "bs58", "digest 0.10.7", - "generic-array 0.14.7", + "generic-array", "hex", "ripemd", "serde", @@ -532,15 +471,9 @@ checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" - -[[package]] -name = "convert_case" -version = "0.5.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "core-foundation" @@ -564,7 +497,7 @@ version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-graphics-types", "foreign-types", @@ -577,7 +510,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bb142d41022986c1d8ff29103a1411c8a3dfad3552f87a4f8dc50d61d4f4e33" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "libc", ] @@ -691,7 +624,19 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ - "generic-array 0.14.7", + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "740fe28e594155f10cfc383984cbefd529d7396050557148f79cb0f621204124" +dependencies = [ + "generic-array", "rand_core", "subtle", "zeroize", @@ -703,7 +648,7 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ - "generic-array 0.14.7", + "generic-array", "typenum", ] @@ -713,15 +658,15 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array 0.14.7", + "generic-array", "subtle", ] [[package]] name = "ctr" -version = "0.8.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049bb91fb4aaf0e3c7efa6cd5ef877dbbbd15b39dad06d9948de4ec8a75761ea" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" dependencies = [ "cipher", ] @@ -806,6 +751,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "derive_builder" version = "0.9.0" @@ -832,12 +787,14 @@ dependencies = [ ] [[package]] -name = "digest" -version = "0.8.1" +name = "derive_more" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ - "generic-array 0.12.4", + "proc-macro2", + "quote", + "syn 1.0.109", ] [[package]] @@ -846,7 +803,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" dependencies = [ - "generic-array 0.14.7", + "generic-array", ] [[package]] @@ -856,6 +813,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", "subtle", ] @@ -908,10 +866,24 @@ version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" dependencies = [ - "der", - "elliptic-curve", - "rfc6979", - "signature", + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + +[[package]] +name = "ecdsa" +version = "0.16.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" +dependencies = [ + "der 0.7.8", + "digest 0.10.7", + "elliptic-curve 0.13.5", + "rfc6979 0.4.0", + "signature 2.1.0", + "spki 0.7.2", ] [[package]] @@ -926,16 +898,34 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" dependencies = [ - "base16ct", - "crypto-bigint", - "der", + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", "digest 0.10.7", - "ff", - "generic-array 0.14.7", - "group", - "pkcs8", + "ff 0.12.1", + "generic-array", + "group 0.12.1", "rand_core", - "sec1", + "sec1 0.3.0", + "subtle", + "zeroize", +] + +[[package]] +name = "elliptic-curve" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +dependencies = [ + "base16ct 0.2.0", + "crypto-bigint 0.5.3", + "digest 0.10.7", + "ff 0.13.0", + "generic-array", + "group 0.13.0", + "pkcs8 0.10.2", + "rand_core", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -959,11 +949,32 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "eth-keystore" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f65b750ac950f2f825b36d08bef4cda4112e19a7b1a68f6e2bb499413e12440" +checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" dependencies = [ "aes", "ctr", @@ -984,9 +995,9 @@ dependencies = [ [[package]] name = "eth-types" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git#e7d4c104c0affc74dd6c1e0a52e7ca941e6cbadd" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git#9626d87efff1ce00914f8a556d884e023f62259b" dependencies = [ - "ethers-core", + "ethers-core 2.0.7", "ethers-signers", "halo2_proofs", "hex", @@ -995,7 +1006,7 @@ dependencies = [ "libsecp256k1", "num", "num-bigint", - "poseidon-circuit 0.1.0 (git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0723)", + "poseidon-circuit", "regex", "serde", "serde_json", @@ -1013,7 +1024,24 @@ version = "17.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4966fba78396ff92db3b817ee71143eccd98acf0f876b8d600e585a670c5d1b" dependencies = [ - "ethereum-types", + "ethereum-types 0.13.1", + "hex", + "once_cell", + "regex", + "serde", + "serde_json", + "sha3 0.10.8", + "thiserror", + "uint", +] + +[[package]] +name = "ethabi" +version = "18.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +dependencies = [ + "ethereum-types 0.14.1", "hex", "once_cell", "regex", @@ -1031,9 +1059,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" dependencies = [ "crunchy", - "fixed-hash", + "fixed-hash 0.7.0", "impl-rlp", - "impl-serde", + "impl-serde 0.3.2", + "tiny-keccak", +] + +[[package]] +name = "ethbloom" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +dependencies = [ + "crunchy", + "fixed-hash 0.8.0", + "impl-codec", + "impl-rlp", + "impl-serde 0.4.0", + "scale-info", "tiny-keccak", ] @@ -1043,11 +1086,27 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" dependencies = [ - "ethbloom", - "fixed-hash", + "ethbloom 0.12.1", + "fixed-hash 0.7.0", "impl-rlp", - "impl-serde", - "primitive-types", + "impl-serde 0.3.2", + "primitive-types 0.11.1", + "uint", +] + +[[package]] +name = "ethereum-types" +version = "0.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +dependencies = [ + "ethbloom 0.13.0", + "fixed-hash 0.8.0", + "impl-codec", + "impl-rlp", + "impl-serde 0.4.0", + "primitive-types 0.12.1", + "scale-info", "uint", ] @@ -1060,14 +1119,12 @@ dependencies = [ "arrayvec", "bytes", "chrono", - "convert_case", - "elliptic-curve", - "ethabi", + "elliptic-curve 0.12.3", + "ethabi 17.2.0", "fastrlp", - "generic-array 0.14.7", + "generic-array", "hex", - "k256", - "proc-macro2", + "k256 0.11.6", "rand", "rlp", "rlp-derive", @@ -1075,7 +1132,32 @@ dependencies = [ "serde", "serde_json", "strum", - "syn 1.0.109", + "thiserror", + "tiny-keccak", + "unicode-xid", +] + +[[package]] +name = "ethers-core" +version = "2.0.7" +source = "git+https://github.com/scroll-tech/ethers-rs.git?branch=v2.0.7#e32dfd62e7cdec31160b91c5a646883594a586ba" +dependencies = [ + "arrayvec", + "bytes", + "chrono", + "elliptic-curve 0.13.5", + "ethabi 18.0.0", + "generic-array", + "hex", + "k256 0.13.1", + "num_enum", + "open-fastrlp", + "rand", + "rlp", + "serde", + "serde_json", + "strum", + "tempfile", "thiserror", "tiny-keccak", "unicode-xid", @@ -1083,27 +1165,28 @@ dependencies = [ [[package]] name = "ethers-signers" -version = "0.17.0" +version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a72ecad124e8ccd18d6a43624208cab0199e59621b1f0fa6b776b2e0529107" +checksum = "02c4b7e15f212fa7cc2e1251868320221d4ff77a3d48068e69f47ce1c491df2d" dependencies = [ "async-trait", "coins-bip32", "coins-bip39", - "elliptic-curve", + "elliptic-curve 0.13.5", "eth-keystore", - "ethers-core", + "ethers-core 2.0.7", "hex", "rand", "sha2 0.10.7", "thiserror", + "tracing", ] [[package]] -name = "fake-simd" -version = "0.1.2" +name = "fastrand" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "fastrlp" @@ -1114,7 +1197,7 @@ dependencies = [ "arrayvec", "auto_impl", "bytes", - "ethereum-types", + "ethereum-types 0.13.1", "fastrlp-derive", ] @@ -1145,7 +1228,17 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ - "bitvec 1.0.1", + "bitvec", + "rand_core", + "subtle", +] + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ "rand_core", "subtle", ] @@ -1162,6 +1255,18 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "byteorder", + "rand", + "rustc-hex", + "static_assertions", +] + [[package]] name = "flate2" version = "1.0.27" @@ -1190,7 +1295,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21fe28504d371085fae9ac7a3450f0b289ab71e07c8e57baa3fb68b9e57d6ce5" dependencies = [ - "bitflags", + "bitflags 1.3.2", "byteorder", "core-foundation", "core-graphics", @@ -1251,15 +1356,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "generic-array" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffdf9f34f1447443d37393cc6c2b8313aebddcd96906caf34e54c68d8e57d7bd" -dependencies = [ - "typenum", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1268,6 +1364,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -1277,10 +1374,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if 1.0.0", - "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "wasm-bindgen", + "wasi", ] [[package]] @@ -1308,7 +1403,18 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ - "ff", + "ff 0.12.1", + "rand_core", + "subtle", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff 0.13.0", "rand_core", "subtle", ] @@ -1318,7 +1424,7 @@ name = "halo2-mpt-circuits" version = "0.1.0" dependencies = [ "bencher", - "ethers-core", + "ethers-core 2.0.7", "halo2_proofs", "hex", "itertools", @@ -1328,7 +1434,7 @@ dependencies = [ "num-bigint", "num-traits", "plotters", - "poseidon-circuit 0.1.0 (git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0901)", + "poseidon-circuit", "rand", "rand_chacha", "serde", @@ -1342,9 +1448,9 @@ dependencies = [ [[package]] name = "halo2-mpt-circuits" version = "0.1.0" -source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.1#c5cd0dab4a242d7077bf9cad051119dafaa4d6e9" +source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.2#cafcdeb2c7fd6602d0ddac183c1fb5396a135f9e" dependencies = [ - "ethers-core", + "ethers-core 0.17.0", "halo2_proofs", "hex", "itertools", @@ -1352,7 +1458,7 @@ dependencies = [ "log", "num-bigint", "num-traits", - "poseidon-circuit 0.1.0 (git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0723)", + "poseidon-circuit", "rand", "serde", "serde_json", @@ -1371,8 +1477,8 @@ dependencies = [ "cfg-if 0.1.10", "crossbeam", "env_logger", - "ff", - "group", + "ff 0.12.1", + "group 0.12.1", "halo2curves 0.3.1 (git+https://github.com/scroll-tech/halo2curves.git?branch=0.3.1-derive-serde)", "log", "num-bigint", @@ -1392,8 +1498,8 @@ name = "halo2curves" version = "0.3.1" source = "git+https://github.com/privacy-scaling-explorations/halo2curves?tag=0.3.1#9b67e19bca30a35208b0c1b41c1723771e2c9f49" dependencies = [ - "ff", - "group", + "ff 0.12.1", + "group 0.12.1", "lazy_static", "num-bigint", "num-traits", @@ -1409,8 +1515,8 @@ name = "halo2curves" version = "0.3.1" source = "git+https://github.com/scroll-tech/halo2curves.git?branch=0.3.1-derive-serde#969f1e44d9713ee4cd552563bd0c762c5d53b56e" dependencies = [ - "ff", - "group", + "ff 0.12.1", + "group 0.12.1", "lazy_static", "num-bigint", "num-traits", @@ -1500,7 +1606,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" dependencies = [ "digest 0.9.0", - "generic-array 0.14.7", + "generic-array", "hmac 0.8.1", ] @@ -1581,6 +1687,15 @@ dependencies = [ "serde", ] +[[package]] +name = "impl-serde" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" +dependencies = [ + "serde", +] + [[package]] name = "impl-trait-for-tuples" version = "0.2.2" @@ -1602,6 +1717,15 @@ dependencies = [ "hashbrown 0.14.0", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1639,12 +1763,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" dependencies = [ "cfg-if 1.0.0", - "ecdsa", - "elliptic-curve", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", "sha2 0.10.7", "sha3 0.10.8", ] +[[package]] +name = "k256" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa 0.16.8", + "elliptic-curve 0.13.5", + "once_cell", + "sha2 0.10.7", + "signature 2.1.0", +] + [[package]] name = "keccak" version = "0.1.4" @@ -1724,6 +1862,12 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" + [[package]] name = "log" version = "0.4.20" @@ -1732,9 +1876,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.2" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memoffset" @@ -1758,16 +1902,16 @@ dependencies = [ [[package]] name = "mpt-zktrie" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git#e7d4c104c0affc74dd6c1e0a52e7ca941e6cbadd" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git#9626d87efff1ce00914f8a556d884e023f62259b" dependencies = [ "eth-types", - "halo2-mpt-circuits 0.1.0 (git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.1)", + "halo2-mpt-circuits 0.1.0 (git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.2)", "halo2_proofs", "hex", "lazy_static", "log", "num-bigint", - "poseidon-circuit 0.1.0 (git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0723)", + "poseidon-circuit", "zktrie", ] @@ -1858,6 +2002,27 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.32", +] + [[package]] name = "once_cell" version = "1.18.0" @@ -1866,15 +2031,34 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "opaque-debug" -version = "0.3.0" +name = "open-fastrlp" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types 0.14.1", + "open-fastrlp-derive", +] + +[[package]] +name = "open-fastrlp-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "parity-scale-codec" @@ -1883,7 +2067,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" dependencies = [ "arrayvec", - "bitvec 1.0.1", + "bitvec", "byte-slice-cast", "impl-trait-for-tuples", "parity-scale-codec-derive", @@ -1902,28 +2086,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "password-hash" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - -[[package]] -name = "password-hash" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - [[package]] name = "pasta_curves" version = "0.4.1" @@ -1931,8 +2093,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5cc65faf8e7313b4b1fbaa9f7ca917a0eed499a9663be71477f87993604341d8" dependencies = [ "blake2b_simd", - "ff", - "group", + "ff 0.12.1", + "group 0.12.1", "lazy_static", "rand", "static_assertions", @@ -1966,23 +2128,21 @@ dependencies = [ [[package]] name = "pbkdf2" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ "digest 0.10.7", ] [[package]] name = "pbkdf2" -version = "0.11.0" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", "hmac 0.12.1", - "password-hash 0.4.2", - "sha2 0.10.7", ] [[package]] @@ -2008,8 +2168,18 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" dependencies = [ - "der", - "spki", + "der 0.6.1", + "spki 0.6.0", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der 0.7.8", + "spki 0.7.2", ] [[package]] @@ -2070,7 +2240,7 @@ version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" dependencies = [ - "bitflags", + "bitflags 1.3.2", "crc32fast", "fdeflate", "flate2", @@ -2082,31 +2252,17 @@ name = "poseidon" version = "0.2.0" source = "git+https://github.com/scroll-tech/poseidon.git?branch=scroll-dev-0220#2fb4a2385bada39b50dce12fe50cb80d2fd33476" dependencies = [ - "group", + "group 0.12.1", "halo2curves 0.3.1 (git+https://github.com/privacy-scaling-explorations/halo2curves?tag=0.3.1)", "subtle", ] -[[package]] -name = "poseidon-circuit" -version = "0.1.0" -source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0723#1652d54bf7ca9d8f286b53fe077d9efefdcf6d5f" -dependencies = [ - "bitvec 1.0.1", - "halo2_proofs", - "lazy_static", - "log", - "rand", - "rand_xorshift", - "thiserror", -] - [[package]] name = "poseidon-circuit" version = "0.1.0" source = "git+https://github.com/scroll-tech/poseidon-circuit.git?branch=scroll-dev-0901#69524f42bdc55c581088c2fe64c2ab9a2921146b" dependencies = [ - "bitvec 1.0.1", + "bitvec", "halo2_proofs", "lazy_static", "log", @@ -2127,10 +2283,24 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" dependencies = [ - "fixed-hash", + "fixed-hash 0.7.0", "impl-codec", "impl-rlp", - "impl-serde", + "impl-serde 0.3.2", + "uint", +] + +[[package]] +name = "primitive-types" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +dependencies = [ + "fixed-hash 0.8.0", + "impl-codec", + "impl-rlp", + "impl-serde 0.4.0", + "scale-info", "uint", ] @@ -2215,12 +2385,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" - [[package]] name = "radium" version = "0.7.0" @@ -2294,7 +2458,16 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", +] + +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags 1.3.2", ] [[package]] @@ -2304,15 +2477,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] [[package]] name = "regex" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" dependencies = [ "aho-corasick", "memchr", @@ -2322,9 +2495,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" dependencies = [ "aho-corasick", "memchr", @@ -2352,11 +2525,21 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" dependencies = [ - "crypto-bigint", + "crypto-bigint 0.4.9", "hmac 0.12.1", "zeroize", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac 0.12.1", + "subtle", +] + [[package]] name = "ripemd" version = "0.1.3" @@ -2372,7 +2555,7 @@ version = "0.7.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" dependencies = [ - "bitvec 1.0.1", + "bitvec", "bytecheck", "hashbrown 0.12.3", "ptr_meta", @@ -2401,6 +2584,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" dependencies = [ "bytes", + "rlp-derive", "rustc-hex", ] @@ -2446,6 +2630,19 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -2460,9 +2657,9 @@ checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "salsa20" -version = "0.9.0" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0fbb5f676da676c260ba276a8f43a8dc67cf02d1438423aeb1c677a7212686" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" dependencies = [ "cipher", ] @@ -2476,6 +2673,30 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scale-info" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" +dependencies = [ + "cfg-if 1.0.0", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "scopeguard" version = "1.2.0" @@ -2484,13 +2705,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scrypt" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e73d6d7c6311ebdbd9184ad6c4447b2f36337e327bda107d3ba9e3c374f9d325" +checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" dependencies = [ "hmac 0.12.1", - "password-hash 0.3.2", - "pbkdf2 0.10.1", + "pbkdf2 0.11.0", "salsa20", "sha2 0.10.7", ] @@ -2507,10 +2727,24 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" dependencies = [ - "base16ct", - "der", - "generic-array 0.14.7", - "pkcs8", + "base16ct 0.1.1", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct 0.2.0", + "der 0.7.8", + "generic-array", + "pkcs8 0.10.2", "subtle", "zeroize", ] @@ -2550,14 +2784,14 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" dependencies = [ "itoa", "ryu", @@ -2586,18 +2820,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug 0.2.3", -] - [[package]] name = "sha2" version = "0.9.9" @@ -2608,7 +2830,7 @@ dependencies = [ "cfg-if 1.0.0", "cpufeatures", "digest 0.9.0", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -2631,7 +2853,7 @@ dependencies = [ "block-buffer 0.9.0", "digest 0.9.0", "keccak", - "opaque-debug 0.3.0", + "opaque-debug", ] [[package]] @@ -2654,6 +2876,16 @@ dependencies = [ "rand_core", ] +[[package]] +name = "signature" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + [[package]] name = "simd-adler32" version = "0.3.7" @@ -2673,7 +2905,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ "base64ct", - "der", + "der 0.6.1", +] + +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der 0.7.8", ] [[package]] @@ -2718,9 +2960,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -2735,9 +2977,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" dependencies = [ "proc-macro2", "quote", @@ -2761,6 +3003,19 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" +[[package]] +name = "tempfile" +version = "3.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +dependencies = [ + "cfg-if 1.0.0", + "fastrand", + "redox_syscall 0.3.5", + "rustix", + "windows-sys", +] + [[package]] name = "termcolor" version = "1.2.0" @@ -2772,33 +3027,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", -] - -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", + "syn 2.0.32", ] [[package]] @@ -2842,9 +3086,9 @@ checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", "toml_datetime", @@ -2871,7 +3115,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.32", ] [[package]] @@ -2949,20 +3193,14 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2990,7 +3228,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.32", "wasm-bindgen-shared", ] @@ -3012,7 +3250,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.32", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/Cargo.toml b/Cargo.toml index 7eee374e..65f5f3e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -ethers-core = "0.17.0" +ethers-core = "2.0.7" itertools = "0.10.5" hash-circuit = { package = "poseidon-circuit", git = "https://github.com/scroll-tech/poseidon-circuit.git", branch = "scroll-dev-0901"} halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2022_09_10" } @@ -24,6 +24,8 @@ log = "0.4" [patch."https://github.com/privacy-scaling-explorations/halo2.git"] halo2_proofs = { git = "https://github.com/scroll-tech/halo2.git", branch = "develop" } +[patch.crates-io] +ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = "v2.0.7" } [features] # printout the layout of circuits for demo and some unittests diff --git a/src/constraint_builder/query.rs b/src/constraint_builder/query.rs index 670c852a..c7b24c4c 100644 --- a/src/constraint_builder/query.rs +++ b/src/constraint_builder/query.rs @@ -1,8 +1,7 @@ use super::BinaryQuery; -use ethers_core::k256::elliptic_curve::PrimeField; use halo2_proofs::{ arithmetic::{Field, FieldExt}, - halo2curves::bn256::Fr, + halo2curves::{bn256::Fr, group::ff::PrimeField}, plonk::{Advice, Challenge, Column, Expression, Fixed, VirtualCells}, poly::Rotation, }; diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 06004cf6..365868f0 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -26,11 +26,11 @@ use crate::{ util::{account_key, domain_hash, lagrange_polynomial, rlc, u256_hi_lo, u256_to_big_endian}, MPTProofType, }; -use ethers_core::{k256::elliptic_curve::PrimeField, types::Address}; +use ethers_core::types::Address; use halo2_proofs::{ arithmetic::{Field, FieldExt}, circuit::{Region, Value}, - halo2curves::bn256::Fr, + halo2curves::{bn256::Fr, group::ff::PrimeField}, plonk::ConstraintSystem, }; use itertools::izip; diff --git a/src/util.rs b/src/util.rs index 93eafb46..33fb3360 100644 --- a/src/util.rs +++ b/src/util.rs @@ -1,11 +1,8 @@ use crate::{constraint_builder::Query, serde::HexBytes, types::HashDomain}; -use ethers_core::{ - k256::elliptic_curve::PrimeField, - types::{Address, U256}, -}; +use ethers_core::types::{Address, U256}; use halo2_proofs::{ arithmetic::{Field, FieldExt}, - halo2curves::bn256::Fr, + halo2curves::{bn256::Fr, group::ff::PrimeField}, }; use hash_circuit::hash::Hashable; use num_bigint::BigUint; From 6b8b568f111b9499abd9d7738c0b46a83a5f06fc Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Wed, 13 Sep 2023 10:33:20 +0800 Subject: [PATCH 19/30] prune Cargo.lock --- Cargo.lock.current | 565 ++++----------------------------------------- 1 file changed, 46 insertions(+), 519 deletions(-) diff --git a/Cargo.lock.current b/Cargo.lock.current index 1fe44df4..cf31c6e0 100644 --- a/Cargo.lock.current +++ b/Cargo.lock.current @@ -19,28 +19,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if 1.0.0", - "once_cell", - "version_check", -] - [[package]] name = "aho-corasick" version = "1.0.5" @@ -133,12 +111,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "base16ct" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" - [[package]] name = "base16ct" version = "0.2.0" @@ -235,51 +207,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "borsh" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" -dependencies = [ - "borsh-derive", - "hashbrown 0.13.2", -] - -[[package]] -name = "borsh-derive" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" -dependencies = [ - "borsh-derive-internal", - "borsh-schema-derive-internal", - "proc-macro-crate 0.1.5", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "borsh-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "borsh-schema-derive-internal" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "bs58" version = "0.5.0" @@ -302,28 +229,6 @@ version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" -[[package]] -name = "bytecheck" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" -dependencies = [ - "bytecheck_derive", - "ptr_meta", - "simdutf8", -] - -[[package]] -name = "bytecheck_derive" -version = "0.6.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "bytemuck" version = "1.14.0" @@ -409,7 +314,7 @@ dependencies = [ "coins-core", "digest 0.10.7", "hmac 0.12.1", - "k256 0.13.1", + "k256", "serde", "sha2 0.10.7", "thiserror", @@ -618,18 +523,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" -[[package]] -name = "crypto-bigint" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - [[package]] name = "crypto-bigint" version = "0.5.3" @@ -741,16 +634,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "der" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" -dependencies = [ - "const-oid", - "zeroize", -] - [[package]] name = "der" version = "0.7.8" @@ -860,30 +743,18 @@ dependencies = [ "wio", ] -[[package]] -name = "ecdsa" -version = "0.14.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" -dependencies = [ - "der 0.6.1", - "elliptic-curve 0.12.3", - "rfc6979 0.3.1", - "signature 1.6.4", -] - [[package]] name = "ecdsa" version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "der 0.7.8", + "der", "digest 0.10.7", - "elliptic-curve 0.13.5", - "rfc6979 0.4.0", - "signature 2.1.0", - "spki 0.7.2", + "elliptic-curve", + "rfc6979", + "signature", + "spki", ] [[package]] @@ -892,40 +763,21 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" -[[package]] -name = "elliptic-curve" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" -dependencies = [ - "base16ct 0.1.1", - "crypto-bigint 0.4.9", - "der 0.6.1", - "digest 0.10.7", - "ff 0.12.1", - "generic-array", - "group 0.12.1", - "rand_core", - "sec1 0.3.0", - "subtle", - "zeroize", -] - [[package]] name = "elliptic-curve" version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" dependencies = [ - "base16ct 0.2.0", - "crypto-bigint 0.5.3", + "base16ct", + "crypto-bigint", "digest 0.10.7", "ff 0.13.0", "generic-array", "group 0.13.0", - "pkcs8 0.10.2", + "pkcs8", "rand_core", - "sec1 0.7.3", + "sec1", "subtle", "zeroize", ] @@ -989,15 +841,15 @@ dependencies = [ "sha2 0.10.7", "sha3 0.10.8", "thiserror", - "uuid 0.8.2", + "uuid", ] [[package]] name = "eth-types" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git#9626d87efff1ce00914f8a556d884e023f62259b" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git#0afa0d9e148b914eda1d1a701547f62ee1844b24" dependencies = [ - "ethers-core 2.0.7", + "ethers-core", "ethers-signers", "halo2_proofs", "hex", @@ -1018,30 +870,13 @@ dependencies = [ "uint", ] -[[package]] -name = "ethabi" -version = "17.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4966fba78396ff92db3b817ee71143eccd98acf0f876b8d600e585a670c5d1b" -dependencies = [ - "ethereum-types 0.13.1", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3 0.10.8", - "thiserror", - "uint", -] - [[package]] name = "ethabi" version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" dependencies = [ - "ethereum-types 0.14.1", + "ethereum-types", "hex", "once_cell", "regex", @@ -1052,19 +887,6 @@ dependencies = [ "uint", ] -[[package]] -name = "ethbloom" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11da94e443c60508eb62cf256243a64da87304c2802ac2528847f79d750007ef" -dependencies = [ - "crunchy", - "fixed-hash 0.7.0", - "impl-rlp", - "impl-serde 0.3.2", - "tiny-keccak", -] - [[package]] name = "ethbloom" version = "0.13.0" @@ -1072,71 +894,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ "crunchy", - "fixed-hash 0.8.0", + "fixed-hash", "impl-codec", "impl-rlp", - "impl-serde 0.4.0", + "impl-serde", "scale-info", "tiny-keccak", ] -[[package]] -name = "ethereum-types" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2827b94c556145446fcce834ca86b7abf0c39a805883fe20e72c5bfdb5a0dc6" -dependencies = [ - "ethbloom 0.12.1", - "fixed-hash 0.7.0", - "impl-rlp", - "impl-serde 0.3.2", - "primitive-types 0.11.1", - "uint", -] - [[package]] name = "ethereum-types" version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ - "ethbloom 0.13.0", - "fixed-hash 0.8.0", + "ethbloom", + "fixed-hash", "impl-codec", "impl-rlp", - "impl-serde 0.4.0", - "primitive-types 0.12.1", + "impl-serde", + "primitive-types", "scale-info", "uint", ] -[[package]] -name = "ethers-core" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ebdd63c828f58aa067f40f9adcbea5e114fb1f90144b3a1e2858e0c9b1ff4e8" -dependencies = [ - "arrayvec", - "bytes", - "chrono", - "elliptic-curve 0.12.3", - "ethabi 17.2.0", - "fastrlp", - "generic-array", - "hex", - "k256 0.11.6", - "rand", - "rlp", - "rlp-derive", - "rust_decimal", - "serde", - "serde_json", - "strum", - "thiserror", - "tiny-keccak", - "unicode-xid", -] - [[package]] name = "ethers-core" version = "2.0.7" @@ -1145,11 +926,11 @@ dependencies = [ "arrayvec", "bytes", "chrono", - "elliptic-curve 0.13.5", - "ethabi 18.0.0", + "elliptic-curve", + "ethabi", "generic-array", "hex", - "k256 0.13.1", + "k256", "num_enum", "open-fastrlp", "rand", @@ -1172,9 +953,9 @@ dependencies = [ "async-trait", "coins-bip32", "coins-bip39", - "elliptic-curve 0.13.5", + "elliptic-curve", "eth-keystore", - "ethers-core 2.0.7", + "ethers-core", "hex", "rand", "sha2 0.10.7", @@ -1188,31 +969,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" -[[package]] -name = "fastrlp" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "089263294bb1c38ac73649a6ad563dd9a5142c8dc0482be15b8b9acb22a1611e" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types 0.13.1", - "fastrlp-derive", -] - -[[package]] -name = "fastrlp-derive" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0f9d074ab623d1b388c12544bfeed759c7df36dc5c300cda053df9ba1232075" -dependencies = [ - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "fdeflate" version = "0.3.0" @@ -1243,18 +999,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "fixed-hash" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" -dependencies = [ - "byteorder", - "rand", - "rustc-hex", - "static_assertions", -] - [[package]] name = "fixed-hash" version = "0.8.0" @@ -1424,7 +1168,7 @@ name = "halo2-mpt-circuits" version = "0.1.0" dependencies = [ "bencher", - "ethers-core 2.0.7", + "ethers-core", "halo2_proofs", "hex", "itertools", @@ -1448,9 +1192,9 @@ dependencies = [ [[package]] name = "halo2-mpt-circuits" version = "0.1.0" -source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.2#cafcdeb2c7fd6602d0ddac183c1fb5396a135f9e" +source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.3#a42263eeb38f48b3008abea95993423604497c6a" dependencies = [ - "ethers-core 0.17.0", + "ethers-core", "halo2_proofs", "hex", "itertools", @@ -1529,24 +1273,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.3", -] - [[package]] name = "hashbrown" version = "0.14.0" @@ -1678,15 +1404,6 @@ dependencies = [ "rlp", ] -[[package]] -name = "impl-serde" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4551f042f3438e64dbd6226b20527fc84a6e1fe65688b58746a2f53623f25f5c" -dependencies = [ - "serde", -] - [[package]] name = "impl-serde" version = "0.4.0" @@ -1714,7 +1431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown", ] [[package]] @@ -1756,19 +1473,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "k256" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" -dependencies = [ - "cfg-if 1.0.0", - "ecdsa 0.14.8", - "elliptic-curve 0.12.3", - "sha2 0.10.7", - "sha3 0.10.8", -] - [[package]] name = "k256" version = "0.13.1" @@ -1776,11 +1480,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" dependencies = [ "cfg-if 1.0.0", - "ecdsa 0.16.8", - "elliptic-curve 0.13.5", + "ecdsa", + "elliptic-curve", "once_cell", "sha2 0.10.7", - "signature 2.1.0", + "signature", ] [[package]] @@ -1902,10 +1606,10 @@ dependencies = [ [[package]] name = "mpt-zktrie" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git#9626d87efff1ce00914f8a556d884e023f62259b" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git#0afa0d9e148b914eda1d1a701547f62ee1844b24" dependencies = [ "eth-types", - "halo2-mpt-circuits 0.1.0 (git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.2)", + "halo2-mpt-circuits 0.1.0 (git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.3)", "halo2_proofs", "hex", "lazy_static", @@ -2017,7 +1721,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 2.0.32", @@ -2044,7 +1748,7 @@ dependencies = [ "arrayvec", "auto_impl", "bytes", - "ethereum-types 0.14.1", + "ethereum-types", "open-fastrlp-derive", ] @@ -2080,7 +1784,7 @@ version = "3.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -2162,24 +1866,14 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" -[[package]] -name = "pkcs8" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" -dependencies = [ - "der 0.6.1", - "spki 0.6.0", -] - [[package]] name = "pkcs8" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.8", - "spki 0.7.2", + "der", + "spki", ] [[package]] @@ -2277,42 +1971,20 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "primitive-types" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" -dependencies = [ - "fixed-hash 0.7.0", - "impl-codec", - "impl-rlp", - "impl-serde 0.3.2", - "uint", -] - [[package]] name = "primitive-types" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" dependencies = [ - "fixed-hash 0.8.0", + "fixed-hash", "impl-codec", "impl-rlp", - "impl-serde 0.4.0", + "impl-serde", "scale-info", "uint", ] -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -2356,26 +2028,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "ptr_meta" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" -dependencies = [ - "ptr_meta_derive", -] - -[[package]] -name = "ptr_meta_derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "quote" version = "1.0.33" @@ -2510,26 +2162,6 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" -[[package]] -name = "rend" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581008d2099240d37fb08d77ad713bcaec2c4d89d50b5b21a8bb1996bbab68ab" -dependencies = [ - "bytecheck", -] - -[[package]] -name = "rfc6979" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" -dependencies = [ - "crypto-bigint 0.4.9", - "hmac 0.12.1", - "zeroize", -] - [[package]] name = "rfc6979" version = "0.4.0" @@ -2549,34 +2181,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "rkyv" -version = "0.7.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200c8230b013893c0b2d6213d6ec64ed2b9be2e0e016682b7224ff82cff5c58" -dependencies = [ - "bitvec", - "bytecheck", - "hashbrown 0.12.3", - "ptr_meta", - "rend", - "rkyv_derive", - "seahash", - "tinyvec", - "uuid 1.4.1", -] - -[[package]] -name = "rkyv_derive" -version = "0.7.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2e06b915b5c230a17d7a736d1e2e63ee753c256a8614ef3f5147b13a4f5541d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "rlp" version = "0.5.2" @@ -2599,22 +2203,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "rust_decimal" -version = "1.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c4216490d5a413bc6d10fa4742bd7d4955941d062c0ef873141d6b0e7b30fd" -dependencies = [ - "arrayvec", - "borsh", - "bytes", - "num-traits", - "rand", - "rkyv", - "serde", - "serde_json", -] - [[package]] name = "rustc-hex" version = "2.1.0" @@ -2691,7 +2279,7 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate", "proc-macro2", "quote", "syn 1.0.109", @@ -2715,36 +2303,16 @@ dependencies = [ "sha2 0.10.7", ] -[[package]] -name = "seahash" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" - -[[package]] -name = "sec1" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" -dependencies = [ - "base16ct 0.1.1", - "der 0.6.1", - "generic-array", - "pkcs8 0.9.0", - "subtle", - "zeroize", -] - [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct 0.2.0", - "der 0.7.8", + "base16ct", + "der", "generic-array", - "pkcs8 0.10.2", + "pkcs8", "subtle", "zeroize", ] @@ -2866,16 +2434,6 @@ dependencies = [ "keccak", ] -[[package]] -name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" -dependencies = [ - "digest 0.10.7", - "rand_core", -] - [[package]] name = "signature" version = "2.1.0" @@ -2892,22 +2450,6 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" -[[package]] -name = "simdutf8" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" - -[[package]] -name = "spki" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" -dependencies = [ - "base64ct", - "der 0.6.1", -] - [[package]] name = "spki" version = "0.7.2" @@ -2915,7 +2457,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", - "der 0.7.8", + "der", ] [[package]] @@ -3069,15 +2611,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml_datetime" version = "0.6.3" @@ -3179,12 +2712,6 @@ dependencies = [ "serde", ] -[[package]] -name = "uuid" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" - [[package]] name = "version_check" version = "0.9.4" From c257a9357dbecea157715ff3f7b5227ac6b7b3a3 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Wed, 13 Sep 2023 14:31:14 +0800 Subject: [PATCH 20/30] fix mpt table lookup --- src/gadgets/mpt_update.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 365868f0..1dd45a77 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -84,8 +84,9 @@ impl MptUpdateLookup for MptUpdateConfig { let old_value = self.old_value.current() * is_start(); let new_value = self.new_value.current() * is_start(); let [address_high, address_low, ..] = self.intermediate_values; - let address = - address_high.current() + address_low.current() * Query::Constant(F::from_u128(1 << 96)); + let address = (address_high.current() + + address_low.current() * Query::Constant(F::from_u128(1 << 96))) + * is_start(); let storage_key_rlc = self.storage_key_rlc.current() * is_start(); [ is_start().into(), From 0bae9eeb813583c11f6db1f961a7e92f8c9bda82 Mon Sep 17 00:00:00 2001 From: Zhang Zhuo Date: Wed, 13 Sep 2023 14:48:57 +0800 Subject: [PATCH 21/30] fix mpt circuit --- src/gadgets/mpt_update.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 1dd45a77..d422d20c 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -84,8 +84,8 @@ impl MptUpdateLookup for MptUpdateConfig { let old_value = self.old_value.current() * is_start(); let new_value = self.new_value.current() * is_start(); let [address_high, address_low, ..] = self.intermediate_values; - let address = (address_high.current() - + address_low.current() * Query::Constant(F::from_u128(1 << 96))) + let address = (address_high.current() * Query::Constant(F::from_u128(1 << 32)) + + address_low.current()) * is_start(); let storage_key_rlc = self.storage_key_rlc.current() * is_start(); [ From b5ea508b6100f487185fc0ae35aa5bc8e61175a0 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Sat, 23 Sep 2023 20:23:40 -0400 Subject: [PATCH 22/30] Disambiguate between rlc lookups (#76) Co-authored-by: Mason Liang --- src/gadgets/canonical_representation.rs | 30 ++++++++++++++----------- src/gadgets/mpt_update.rs | 7 +++--- 2 files changed, 21 insertions(+), 16 deletions(-) diff --git a/src/gadgets/canonical_representation.rs b/src/gadgets/canonical_representation.rs index 149d6d9b..98383cc9 100644 --- a/src/gadgets/canonical_representation.rs +++ b/src/gadgets/canonical_representation.rs @@ -2,10 +2,7 @@ use super::super::constraint_builder::{ AdviceColumn, BinaryColumn, ConstraintBuilder, FixedColumn, Query, SecondPhaseAdviceColumn, SelectorColumn, }; -use super::{ - byte_bit::RangeCheck256Lookup, byte_representation::RlcLookup, is_zero::IsZeroGadget, - rlc_randomness::RlcRandomness, -}; +use super::{byte_bit::RangeCheck256Lookup, is_zero::IsZeroGadget, rlc_randomness::RlcRandomness}; use ethers_core::types::U256; use halo2_proofs::{ arithmetic::{Field, FieldExt}, @@ -20,6 +17,11 @@ pub trait CanonicalRepresentationLookup { fn lookup(&self) -> [Query; 3]; } +// Lookup to prove that Rlc(x: Fr) = y +pub trait FrRlcLookup { + fn lookup(&self) -> [Query; 2]; +} + #[derive(Clone)] pub struct CanonicalRepresentationConfig { // Lookup columns @@ -30,9 +32,9 @@ pub struct CanonicalRepresentationConfig { // Witness columns index_is_zero: SelectorColumn, // (0..32).repeat().map(|i| i == 0) - // index_is_31: SelectorColumn, // (0..32).repeat().map(|i| i == 31) - modulus_byte: FixedColumn, // (0..32).repeat().map(|i| Fr::MODULUS.to_be_bytes()[i]) - difference: AdviceColumn, // modulus_byte - byte + index_is_31: SelectorColumn, // (0..32).repeat().map(|i| i == 31) + modulus_byte: FixedColumn, // (0..32).repeat().map(|i| Fr::MODULUS.to_be_bytes()[i]) + difference: AdviceColumn, // modulus_byte - byte difference_is_zero: IsZeroGadget, differences_are_zero_so_far: BinaryColumn, // difference[0] ... difference[index - 1] are all 0. } @@ -44,7 +46,7 @@ impl CanonicalRepresentationConfig { range_check: &impl RangeCheck256Lookup, randomness: &RlcRandomness, ) -> Self { - let ([index_is_zero], [index, modulus_byte], [value, byte, difference]) = + let ([index_is_zero, index_is_31], [index, modulus_byte], [value, byte, difference]) = cb.build_columns(cs); let [rlc] = cb.second_phase_advice_columns(cs); @@ -120,6 +122,7 @@ impl CanonicalRepresentationConfig { byte, rlc, index_is_zero, + index_is_31, modulus_byte, difference, difference_is_zero, @@ -153,6 +156,8 @@ impl CanonicalRepresentationConfig { .assign(region, offset, u64::try_from(index).unwrap()); if index.is_zero() { self.index_is_zero.enable(region, offset); + } else if index == 31 { + self.index_is_31.enable(region, offset); } let difference = Fr::from(u64::from(*modulus_byte)) - Fr::from(u64::from(*byte)); @@ -187,12 +192,11 @@ impl CanonicalRepresentationLookup for CanonicalRepresentationConfig { } } -impl RlcLookup for CanonicalRepresentationConfig { - fn lookup(&self) -> [Query; 3] { +impl FrRlcLookup for CanonicalRepresentationConfig { + fn lookup(&self) -> [Query; 2] { [ - self.value.current(), - self.rlc.current(), - self.index.current(), + self.value.current() * self.index_is_31.current(), + self.rlc.current() * self.index_is_31.current(), ] } } diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index d422d20c..500537e7 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -8,6 +8,7 @@ use word_rlc::{assign as assign_word_rlc, configure as configure_word_rlc}; use super::{ byte_representation::{BytesLookup, RlcLookup}, + canonical_representation::FrRlcLookup, is_zero::IsZeroGadget, key_bit::KeyBitLookup, one_hot::OneHot, @@ -110,7 +111,7 @@ impl MptUpdateConfig { rlc: &impl RlcLookup, bytes: &impl BytesLookup, rlc_randomness: &RlcRandomness, - fr_rlc: &impl RlcLookup, + fr_rlc: &impl FrRlcLookup, ) -> Self { let proof_type: OneHot = OneHot::configure(cs, cb); let [storage_key_rlc, old_value, new_value] = cb.second_phase_advice_columns(cs); @@ -158,12 +159,12 @@ impl MptUpdateConfig { ); cb.add_lookup( "rlc_old_root = rlc(old_root)", - [old_hash.current(), old_hash_rlc.current(), Query::from(31)], + [old_hash.current(), old_hash_rlc.current()], fr_rlc.lookup(), ); cb.add_lookup( "rlc_new_root = rlc(new_root)", - [new_hash.current(), new_hash_rlc.current(), Query::from(31)], + [new_hash.current(), new_hash_rlc.current()], fr_rlc.lookup(), ); }); From 9613b2cb1df35ca2e9177823fd891f9d1d7b6c5d Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Mon, 25 Sep 2023 21:07:52 -0400 Subject: [PATCH 23/30] Remove unused function --- src/constraint_builder.rs | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/constraint_builder.rs b/src/constraint_builder.rs index 7b146ddb..d4272488 100644 --- a/src/constraint_builder.rs +++ b/src/constraint_builder.rs @@ -83,27 +83,6 @@ impl ConstraintBuilder { self.lookups.push((name, lookup)) } - pub fn add_lookup_with_default( - &mut self, - name: &'static str, - left: [Query; N], - right: [Query; N], - default: [Query; N], - ) { - let condition = self - .conditions - .iter() - .skip(1) // Save a degree by skipping every row selector - .fold(BinaryQuery::one(), |a, b| a.and(b.clone())); - let lookup = left - .into_iter() - .zip(default.into_iter()) - .map(|(a, b)| condition.select(a, b)) - .zip(right.into_iter()) - .collect(); - self.lookups.push((name, lookup)) - } - pub fn build_columns( &self, cs: &mut ConstraintSystem, From 3667289cb46e69bfb3075b9fccaa2e3f58693f10 Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Mon, 25 Sep 2023 21:12:36 -0400 Subject: [PATCH 24/30] Move poseidon lookup to constraint builder --- src/constraint_builder.rs | 35 ++++++++++++++++++++++++++++++ src/gadgets/poseidon.rs | 45 ++++----------------------------------- 2 files changed, 39 insertions(+), 41 deletions(-) diff --git a/src/constraint_builder.rs b/src/constraint_builder.rs index d4272488..f2f881d2 100644 --- a/src/constraint_builder.rs +++ b/src/constraint_builder.rs @@ -1,3 +1,4 @@ +use crate::gadgets::poseidon::PoseidonLookup; use halo2_proofs::{ arithmetic::FieldExt, plonk::{ConstraintSystem, SecondPhase}, @@ -83,6 +84,40 @@ impl ConstraintBuilder { self.lookups.push((name, lookup)) } + pub fn poseidon_lookup( + &mut self, + name: &'static str, + [left, right, domain, hash]: [Query; 4], + poseidon: &impl PoseidonLookup, + ) { + let extended_queries = [ + Query::one(), + hash, + left, + right, + Query::zero(), + domain, + Query::one(), + ]; + + let (q_enable, [hash, left, right, control, domain_spec, head_mark]) = + poseidon.lookup_columns(); + + self.add_lookup( + name, + extended_queries, + [ + q_enable.current(), + hash.current(), + left.current(), + right.current(), + control.current(), + domain_spec.current(), + head_mark.current(), + ], + ) + } + pub fn build_columns( &self, cs: &mut ConstraintSystem, diff --git a/src/gadgets/poseidon.rs b/src/gadgets/poseidon.rs index 0d5ed41c..2586490e 100644 --- a/src/gadgets/poseidon.rs +++ b/src/gadgets/poseidon.rs @@ -1,11 +1,10 @@ -use crate::constraint_builder::{AdviceColumn, ConstraintBuilder, FixedColumn, Query}; +use crate::constraint_builder::{AdviceColumn, FixedColumn}; +use halo2_proofs::plonk::{Advice, Column, Fixed}; +#[cfg(test)] use halo2_proofs::{ - arithmetic::FieldExt, - plonk::{Advice, Column, Fixed}, + arithmetic::FieldExt, circuit::Region, halo2curves::bn256::Fr, plonk::ConstraintSystem, }; #[cfg(test)] -use halo2_proofs::{circuit::Region, halo2curves::bn256::Fr, plonk::ConstraintSystem}; -#[cfg(test)] use hash_circuit::hash::Hashable; /// Lookup represent the poseidon table in zkevm circuit @@ -20,42 +19,6 @@ pub trait PoseidonLookup { } } -impl ConstraintBuilder { - pub fn poseidon_lookup( - &mut self, - name: &'static str, - [left, right, domain, hash]: [Query; 4], - poseidon: &impl PoseidonLookup, - ) { - let extended_queries = [ - Query::one(), - hash, - left, - right, - Query::zero(), - domain, - Query::one(), - ]; - - let (q_enable, [hash, left, right, control, domain_spec, head_mark]) = - poseidon.lookup_columns(); - - self.add_lookup( - name, - extended_queries, - [ - q_enable.current(), - hash.current(), - left.current(), - right.current(), - control.current(), - domain_spec.current(), - head_mark.current(), - ], - ) - } -} - #[cfg(test)] #[derive(Clone, Copy)] pub struct PoseidonTable { From bcf16365c4730a5ba6434d879f17dc07ca0d2ce5 Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Mon, 25 Sep 2023 21:20:53 -0400 Subject: [PATCH 25/30] Ensure row is enabled for non-poseidon lookups --- src/constraint_builder.rs | 41 +++++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/src/constraint_builder.rs b/src/constraint_builder.rs index f2f881d2..b653a5f7 100644 --- a/src/constraint_builder.rs +++ b/src/constraint_builder.rs @@ -3,6 +3,7 @@ use halo2_proofs::{ arithmetic::FieldExt, plonk::{ConstraintSystem, SecondPhase}, }; +use itertools::Itertools; mod binary_column; mod binary_query; @@ -74,13 +75,14 @@ impl ConstraintBuilder { let condition = self .conditions .iter() - .skip(1) // Save a degree by skipping every row selector .fold(BinaryQuery::one(), |a, b| a.and(b.clone())); - let lookup = left + let mut lookup: Vec<_> = left .into_iter() .map(|q| q * condition.clone()) .zip(right.into_iter()) .collect(); + // If condition is true, every_row_selector must be enabled. + lookup.push((condition.into(), self.every_row_selector().into())); self.lookups.push((name, lookup)) } @@ -90,6 +92,11 @@ impl ConstraintBuilder { [left, right, domain, hash]: [Query; 4], poseidon: &impl PoseidonLookup, ) { + let condition = self + .conditions + .iter() + .skip(1) // Save a degree by skipping every row selector + .fold(BinaryQuery::one(), |a, b| a.and(b.clone())); let extended_queries = [ Query::one(), hash, @@ -98,24 +105,28 @@ impl ConstraintBuilder { Query::zero(), domain, Query::one(), - ]; + ] + .map(|q| q * condition.clone()); let (q_enable, [hash, left, right, control, domain_spec, head_mark]) = poseidon.lookup_columns(); + let poseidon_lookup_queries = [ + q_enable.current(), + hash.current(), + left.current(), + right.current(), + control.current(), + domain_spec.current(), + head_mark.current(), + ]; - self.add_lookup( + self.lookups.push(( name, - extended_queries, - [ - q_enable.current(), - hash.current(), - left.current(), - right.current(), - control.current(), - domain_spec.current(), - head_mark.current(), - ], - ) + extended_queries + .into_iter() + .zip_eq(poseidon_lookup_queries) + .collect(), + )) } pub fn build_columns( From 578c210ceb88d3c143ee2a013ad836d19285d9c1 Mon Sep 17 00:00:00 2001 From: Mason Liang Date: Mon, 25 Sep 2023 21:28:40 -0400 Subject: [PATCH 26/30] Use enough rows to allow tests to pass --- src/gadgets/byte_representation.rs | 2 +- src/gadgets/canonical_representation.rs | 2 +- src/gadgets/key_bit.rs | 2 +- src/tests.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gadgets/byte_representation.rs b/src/gadgets/byte_representation.rs index 20485787..4ce4a331 100644 --- a/src/gadgets/byte_representation.rs +++ b/src/gadgets/byte_representation.rs @@ -219,7 +219,7 @@ mod test { layouter.assign_region( || "", |mut region| { - for offset in 0..1024 { + for offset in 0..(8 * 256) { selector.enable(&mut region, offset); } byte_bit.assign(&mut region); diff --git a/src/gadgets/canonical_representation.rs b/src/gadgets/canonical_representation.rs index 98383cc9..7e2ae9b5 100644 --- a/src/gadgets/canonical_representation.rs +++ b/src/gadgets/canonical_representation.rs @@ -250,7 +250,7 @@ mod test { layouter.assign_region( || "", |mut region| { - for offset in 0..256 { + for offset in 0..(8 * 256) { selector.enable(&mut region, offset); } byte_bit.assign(&mut region); diff --git a/src/gadgets/key_bit.rs b/src/gadgets/key_bit.rs index cc2299d3..8891665d 100644 --- a/src/gadgets/key_bit.rs +++ b/src/gadgets/key_bit.rs @@ -191,7 +191,7 @@ mod test { layouter.assign_region( || "", |mut region| { - for offset in 0..32 { + for offset in 0..(8 * 256) { selector.enable(&mut region, offset); } diff --git a/src/tests.rs b/src/tests.rs index 5601076b..91855616 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -11,7 +11,7 @@ use halo2_proofs::{ }; use mpt_zktrie::state::{builder::HASH_SCHEME_DONE, witness::WitnessGenerator, ZktrieState}; -const N_ROWS: usize = 1024; +const N_ROWS: usize = 8 * 256 + 1; const STORAGE_ADDRESS: Address = Address::repeat_byte(1); fn initial_generator() -> WitnessGenerator { From 6232ff4e91ee2e55a8e5ab96b6e360bdd3037c67 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Tue, 31 Oct 2023 09:56:56 +0800 Subject: [PATCH 27/30] Add n_rows_required method to MptCircuit (#93) * fix column annotation * Implement n_rows_required for internal gadgets * Add n_rows_required implementation for MptUpdateGadget * clippy and add 1 to account for disabled row in MptUpdateConfig * Start assignment from second row * Remove panic * Add comments explaining where +1 comes from * Add test for fixed vk * Dedup hash traces and add comment explaining +1 in n_rows_required * Fix comment * Fix build * Track Cargo.lock --------- Co-authored-by: Mason Liang --- .gitignore | 3 +- Cargo.lock.current => Cargo.lock | 278 ++++++++++-------------- Cargo.toml | 2 +- src/constraint_builder/column.rs | 2 +- src/gadgets/byte_bit.rs | 13 +- src/gadgets/byte_representation.rs | 14 +- src/gadgets/canonical_representation.rs | 52 ++++- src/gadgets/key_bit.rs | 11 +- src/gadgets/mpt_update.rs | 32 +++ src/gadgets/poseidon.rs | 12 + src/mpt.rs | 27 ++- src/tests.rs | 66 +++++- 12 files changed, 318 insertions(+), 194 deletions(-) rename Cargo.lock.current => Cargo.lock (91%) diff --git a/.gitignore b/.gitignore index 31a5ddfa..21ad0a9e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,4 @@ /layouts .vscode .cargo -Cargo.lock -*.png \ No newline at end of file +*.png diff --git a/Cargo.lock.current b/Cargo.lock similarity index 91% rename from Cargo.lock.current rename to Cargo.lock index cf31c6e0..cab9efe6 100644 --- a/Cargo.lock.current +++ b/Cargo.lock @@ -21,9 +21,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.5" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" dependencies = [ "memchr", ] @@ -73,13 +73,13 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.38", ] [[package]] @@ -88,7 +88,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi", "libc", "winapi", ] @@ -155,9 +155,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "bitvec" @@ -213,15 +213,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" dependencies = [ - "sha2 0.10.7", + "sha2 0.10.8", "tinyvec", ] [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byte-slice-cast" @@ -237,9 +237,9 @@ checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" @@ -273,9 +273,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd4e7873dbddba6c7c91e199c7fcb946abc4a6a4ac3195400bcfb01b5de877" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" dependencies = [ "android-tzdata", "iana-time-zone", @@ -316,7 +316,7 @@ dependencies = [ "hmac 0.12.1", "k256", "serde", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", ] @@ -332,7 +332,7 @@ dependencies = [ "once_cell", "pbkdf2 0.12.2", "rand", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", ] @@ -351,7 +351,7 @@ dependencies = [ "ripemd", "serde", "serde_derive", - "sha2 0.10.7", + "sha2 0.10.8", "sha3 0.10.8", "thiserror", ] @@ -765,9 +765,9 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "elliptic-curve" -version = "0.13.5" +version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "d97ca172ae9dc9f9b779a6e3a65d308f2af74e5b8c921299075bdb4a0370e914" dependencies = [ "base16ct", "crypto-bigint", @@ -803,25 +803,14 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys", ] -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "eth-keystore" version = "0.5.0" @@ -838,7 +827,7 @@ dependencies = [ "scrypt", "serde", "serde_json", - "sha2 0.10.7", + "sha2 0.10.8", "sha3 0.10.8", "thiserror", "uuid", @@ -847,7 +836,7 @@ dependencies = [ [[package]] name = "eth-types" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git#0afa0d9e148b914eda1d1a701547f62ee1844b24" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?rev=7d9bc181953cfc6e7baf82ff0ce651281fd70a8a#7d9bc181953cfc6e7baf82ff0ce651281fd70a8a" dependencies = [ "ethers-core", "ethers-signers", @@ -858,6 +847,7 @@ dependencies = [ "libsecp256k1", "num", "num-bigint", + "once_cell", "poseidon-circuit", "regex", "serde", @@ -958,16 +948,16 @@ dependencies = [ "ethers-core", "hex", "rand", - "sha2 0.10.7", + "sha2 0.10.8", "thiserror", "tracing", ] [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fdeflate" @@ -1013,9 +1003,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "miniz_oxide", @@ -1192,7 +1182,7 @@ dependencies = [ [[package]] name = "halo2-mpt-circuits" version = "0.1.0" -source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.3#a42263eeb38f48b3008abea95993423604497c6a" +source = "git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.7.0#578c210ceb88d3c143ee2a013ad836d19285d9c1" dependencies = [ "ethers-core", "halo2_proofs", @@ -1214,7 +1204,7 @@ dependencies = [ [[package]] name = "halo2_proofs" version = "0.2.0" -source = "git+https://github.com/scroll-tech/halo2.git?branch=develop#aa86c107aeb62282d81ebce5c4930ec0c0aa540b" +source = "git+https://github.com/scroll-tech/halo2.git?branch=develop#e3fe25eadd714fd991f35190d17ff0b8fb031188" dependencies = [ "ark-std", "blake2b_simd", @@ -1275,9 +1265,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -1294,12 +1284,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - [[package]] name = "hex" version = "0.4.3" @@ -1426,9 +1410,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", "hashbrown", @@ -1483,7 +1467,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", - "sha2 0.10.7", + "sha2 0.10.8", "signature", ] @@ -1504,15 +1488,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libloading" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d580318f95776505201b28cf98eb1fa5e4be3b689633ba6a3e6cd880ff22d8cb" +checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" dependencies = [ "cfg-if 1.0.0", "windows-sys", @@ -1568,9 +1552,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "log" @@ -1580,9 +1564,9 @@ checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memoffset" @@ -1606,10 +1590,10 @@ dependencies = [ [[package]] name = "mpt-zktrie" version = "0.1.0" -source = "git+https://github.com/scroll-tech/zkevm-circuits.git#0afa0d9e148b914eda1d1a701547f62ee1844b24" +source = "git+https://github.com/scroll-tech/zkevm-circuits.git?rev=7d9bc181953cfc6e7baf82ff0ce651281fd70a8a#7d9bc181953cfc6e7baf82ff0ce651281fd70a8a" dependencies = [ "eth-types", - "halo2-mpt-circuits 0.1.0 (git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.6.3)", + "halo2-mpt-circuits 0.1.0 (git+https://github.com/scroll-tech/mpt-circuit.git?tag=v0.7.0)", "halo2_proofs", "hex", "lazy_static", @@ -1689,23 +1673,13 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi 0.3.2", - "libc", -] - [[package]] name = "num_enum" version = "0.6.1" @@ -1724,7 +1698,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.38", ] [[package]] @@ -1823,9 +1797,9 @@ dependencies = [ [[package]] name = "pathfinder_simd" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39fe46acc5503595e5949c17b818714d26fdf9b4920eacf3b2947f0199f4a6ff" +checksum = "0444332826c70dc47be74a7c6a5fc44e23a7905ad6858d4162b658320455ef93" dependencies = [ "rustc_version", ] @@ -1849,17 +1823,6 @@ dependencies = [ "hmac 0.12.1", ] -[[package]] -name = "pest" -version = "2.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a4d085fd991ac8d5b05a147b437791b4260b76326baf0fc60cf7c9c27ecd33" -dependencies = [ - "memchr", - "thiserror", - "ucd-trie", -] - [[package]] name = "pin-project-lite" version = "0.2.13" @@ -1973,9 +1936,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "primitive-types" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", @@ -2021,9 +1984,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2084,9 +2047,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -2094,14 +2057,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -2135,9 +2096,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.5" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697061221ea1b4a94a624f67d0ae2bfe4e22b8a17b6a192afb11046542cc8c47" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ "aho-corasick", "memchr", @@ -2147,9 +2108,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" dependencies = [ "aho-corasick", "memchr", @@ -2158,9 +2119,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.5" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "rfc6979" @@ -2211,20 +2172,20 @@ checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno", "libc", "linux-raw-sys", @@ -2300,7 +2261,7 @@ dependencies = [ "hmac 0.12.1", "pbkdf2 0.11.0", "salsa20", - "sha2 0.10.7", + "sha2 0.10.8", ] [[package]] @@ -2319,47 +2280,35 @@ dependencies = [ [[package]] name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.38", ] [[package]] name = "serde_json" -version = "1.0.106" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -2403,9 +2352,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if 1.0.0", "cpufeatures", @@ -2519,9 +2468,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.32" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -2560,31 +2509,31 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +checksum = "6093bad37da69aab9d123a8091e4be0aa4a03e4d601ec641c327398315f62b64" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.38", ] [[package]] @@ -2630,11 +2579,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" dependencies = [ - "cfg-if 1.0.0", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -2642,20 +2590,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.38", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] @@ -2668,15 +2616,9 @@ checksum = "375812fa44dab6df41c195cd2f7fecb488f6c09fbaafb62807488cefab642bff" [[package]] name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "ucd-trie" -version = "0.1.6" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed646292ffc8188ef8ea4d1e0e0150fb15a5c2e12ad9b8fc191ae7a8a7f3c4b9" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uint" @@ -2692,9 +2634,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-xid" @@ -2755,7 +2697,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -2777,7 +2719,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.32", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2822,9 +2764,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -2912,9 +2854,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" dependencies = [ "memchr", ] @@ -2958,7 +2900,7 @@ checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" [[package]] name = "zktrie" version = "0.2.0" -source = "git+https://github.com/scroll-tech/zktrie.git?branch=v0.6#83318659773604fa565e2ebeb810a6d3746f0af4" +source = "git+https://github.com/scroll-tech/zktrie.git?branch=v0.7#a130ea543d291d4b71724f91cb8a49745c593a0c" dependencies = [ "gobuild", ] diff --git a/Cargo.toml b/Cargo.toml index 65f5f3e1..18cecdd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ ethers-core = { git = "https://github.com/scroll-tech/ethers-rs.git", branch = " print_layout = ["halo2_proofs/dev-graph"] [dev-dependencies] -mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git" } +mpt-zktrie = { git = "https://github.com/scroll-tech/zkevm-circuits.git", rev = "7d9bc181953cfc6e7baf82ff0ce651281fd70a8a" } # mpt-zktrie = { path = "../scroll-circuits/zktrie" } rand_chacha = "0.3.0" plotters = "0.3" diff --git a/src/constraint_builder/column.rs b/src/constraint_builder/column.rs index b3dbfa03..45351e16 100644 --- a/src/constraint_builder/column.rs +++ b/src/constraint_builder/column.rs @@ -51,7 +51,7 @@ impl FixedColumn { { region .assign_fixed( - || "asdfasdfawe", + || "fixed", self.0, offset, || Value::known(value.try_into().unwrap()), diff --git a/src/gadgets/byte_bit.rs b/src/gadgets/byte_bit.rs index 60474732..471fa2f8 100644 --- a/src/gadgets/byte_bit.rs +++ b/src/gadgets/byte_bit.rs @@ -31,7 +31,7 @@ impl ByteBitGadget { } pub fn assign(&self, region: &mut Region<'_, F>) { - let mut offset = 0; + let mut offset = 1; for byte in 0..256 { for index in 0..8 { self.byte.assign(region, offset, byte); @@ -40,6 +40,17 @@ impl ByteBitGadget { offset += 1; } } + + let expected_offset = Self::n_rows_required(); + debug_assert!( + offset == expected_offset, + "assign used {offset} rows but {expected_offset} rows expected from `n_rows_required`", + ); + } + + pub fn n_rows_required() -> usize { + // +1 because assigment starts on offset = 1 instead of offset = 0. + 256 * 8 + 1 } } diff --git a/src/gadgets/byte_representation.rs b/src/gadgets/byte_representation.rs index 4ce4a331..aa8b2904 100644 --- a/src/gadgets/byte_representation.rs +++ b/src/gadgets/byte_representation.rs @@ -93,7 +93,6 @@ impl ByteRepresentationConfig { } } - // can this we done with an Iterator instead? pub fn assign( &self, region: &mut Region<'_, F>, @@ -111,7 +110,7 @@ impl ByteRepresentationConfig { .chain(u128s.iter().map(u128_to_big_endian)) .chain(frs.iter().map(fr_to_big_endian)); - let mut offset = 0; + let mut offset = 1; for byte_representation in byte_representations { let mut value = F::zero(); let mut rlc = Value::known(F::zero()); @@ -132,6 +131,17 @@ impl ByteRepresentationConfig { offset += 1; } } + + let expected_offset = Self::n_rows_required(u32s, u64s, u128s, frs); + debug_assert!( + offset == expected_offset, + "assign used {offset} rows but {expected_offset} rows expected from `n_rows_required`", + ); + } + + pub fn n_rows_required(u32s: &[u32], u64s: &[u64], u128s: &[u128], frs: &[Fr]) -> usize { + // +1 because assigment starts on offset = 1 instead of offset = 0. + 1 + u32s.len() * 4 + u64s.len() * 8 + u128s.len() * 16 + frs.len() * 31 } } diff --git a/src/gadgets/canonical_representation.rs b/src/gadgets/canonical_representation.rs index 7e2ae9b5..e98f0132 100644 --- a/src/gadgets/canonical_representation.rs +++ b/src/gadgets/canonical_representation.rs @@ -130,19 +130,19 @@ impl CanonicalRepresentationConfig { } } - pub fn assign<'a>( + pub fn assign( &self, region: &mut Region<'_, Fr>, randomness: Value, - values: impl IntoIterator, + values: &[Fr], + n_rows: usize, ) { let modulus = U256::from_str_radix(Fr::MODULUS, 16).unwrap(); let mut modulus_bytes = [0u8; 32]; modulus.to_big_endian(&mut modulus_bytes); - let mut offset = 0; - // TODO: we add a final Fr::zero() to handle the always enabled selector. Add a default assignment instead? - for value in values.into_iter().copied().chain([Fr::zero()]) { + let mut offset = 1; + for value in values.iter() { let mut bytes = value.to_bytes(); bytes.reverse(); let mut differences_are_zero_so_far = true; @@ -171,7 +171,7 @@ impl CanonicalRepresentationConfig { ); differences_are_zero_so_far &= difference.is_zero_vartime(); - self.value.assign(region, offset, value); + self.value.assign(region, offset, *value); rlc = rlc * randomness + Value::known(Fr::from(u64::from(*byte))); self.rlc.assign(region, offset, rlc); @@ -179,6 +179,42 @@ impl CanonicalRepresentationConfig { offset += 1 } } + + let expected_offset = Self::n_rows_required(values); + debug_assert!( + offset == expected_offset, + "assign used {offset} rows but {expected_offset} rows expected from `n_rows_required`", + ); + + let n_padding_values = n_rows / 32 - values.len(); + for _ in 0..n_padding_values { + for (index, modulus_byte) in modulus_bytes.iter().enumerate() { + self.modulus_byte + .assign(region, offset, u64::from(*modulus_byte)); + + self.index + .assign(region, offset, u64::try_from(index).unwrap()); + if index.is_zero() { + self.index_is_zero.enable(region, offset); + } else if index == 31 { + self.index_is_31.enable(region, offset); + } + + let difference = Fr::from(u64::from(*modulus_byte)); + self.difference.assign(region, offset, difference); + self.difference_is_zero.assign(region, offset, difference); + + self.differences_are_zero_so_far + .assign(region, offset, index == 0); + + offset += 1 + } + } + } + + pub fn n_rows_required(values: &[Fr]) -> usize { + // +1 because assigment starts on offset = 1 instead of offset = 0. + values.len() * 32 + 1 } } @@ -250,11 +286,11 @@ mod test { layouter.assign_region( || "", |mut region| { - for offset in 0..(8 * 256) { + for offset in 1..(1 + 8 * 256) { selector.enable(&mut region, offset); } byte_bit.assign(&mut region); - canonical_representation.assign(&mut region, randomness, &self.values); + canonical_representation.assign(&mut region, randomness, &self.values, 256); Ok(()) }, ) diff --git a/src/gadgets/key_bit.rs b/src/gadgets/key_bit.rs index 8891665d..5d4b2581 100644 --- a/src/gadgets/key_bit.rs +++ b/src/gadgets/key_bit.rs @@ -89,6 +89,8 @@ impl KeyBitConfig { pub fn assign(&self, region: &mut Region<'_, Fr>, lookups: &[(Fr, usize, bool)]) { // TODO; dedup lookups for (offset, (value, index, bit)) in lookups.iter().enumerate() { + // TODO: either move the disabled row to the end of the assigment or get rid of it entirely. + let offset = offset + 1; // Start assigning at offet = 1 because the first row is disabled. let bytes = value.to_bytes(); let index_div_8 = index / 8; // index = (31 - index/8) * 8 @@ -108,6 +110,11 @@ impl KeyBitConfig { self.byte.assign(region, offset, u64::from(byte)); } } + + pub fn n_rows_required(lookups: &[(Fr, usize, bool)]) -> usize { + // +1 because assigment starts on offset = 1 instead of offset = 0. + 1 + lookups.len() + } } impl KeyBitLookup for KeyBitConfig { @@ -191,13 +198,13 @@ mod test { layouter.assign_region( || "", |mut region| { - for offset in 0..(8 * 256) { + for offset in 1..(1 + 8 * 256) { selector.enable(&mut region, offset); } key_bit.assign(&mut region, &self.lookups); byte_bit.assign(&mut region); - canonical_representation.assign(&mut region, randomness, &keys); + canonical_representation.assign(&mut region, randomness, &keys, 256); Ok(()) }, ) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 500537e7..cedd72c4 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -594,9 +594,21 @@ impl MptUpdateConfig { n_rows += proof.n_rows(); offset = 1 + n_rows; } + + let expected_offset = Self::n_rows_required(proofs); + debug_assert!( + offset == expected_offset, + "assign used {offset} rows but {expected_offset} rows expected from `n_rows_required`", + ); + n_rows } + pub fn n_rows_required(proofs: &[Proof]) -> usize { + // +1 because assigment starts on offset = 1 instead of offset = 0. + proofs.iter().map(Proof::n_rows).sum::() + 1 + } + fn assign_account_trie_rows( &self, region: &mut Region<'_, Fr>, @@ -2086,6 +2098,8 @@ pub fn hash_traces(proofs: &[Proof]) -> Vec<([Fr; 2], Fr, Fr)> { } } } + hash_traces.sort(); + hash_traces.dedup(); hash_traces } @@ -2118,6 +2132,9 @@ pub fn key_bit_lookups(proofs: &[Proof]) -> Vec<(Fr, usize, bool)> { } lookups.extend(proof.storage.key_bit_lookups()); } + + lookups.sort(); + lookups.dedup(); lookups } @@ -2199,6 +2216,19 @@ pub fn byte_representations(proofs: &[Proof]) -> (Vec, Vec, Vec, _ => {} } } + + u32s.sort(); + u32s.dedup(); + + u64s.sort(); + u64s.dedup(); + + u128s.sort(); + u128s.dedup(); + + frs.sort(); + frs.dedup(); + (u32s, u64s, u128s, frs) } @@ -2213,5 +2243,7 @@ pub fn mpt_update_keys(proofs: &[Proof]) -> Vec { keys.push(proof.claim.old_root); keys.push(proof.claim.new_root); } + keys.sort(); + keys.dedup(); keys } diff --git a/src/gadgets/poseidon.rs b/src/gadgets/poseidon.rs index 2586490e..c216643e 100644 --- a/src/gadgets/poseidon.rs +++ b/src/gadgets/poseidon.rs @@ -7,6 +7,9 @@ use halo2_proofs::{ #[cfg(test)] use hash_circuit::hash::Hashable; +#[cfg(test)] +const MAX_POSEIDON_ROWS: usize = 200; + /// Lookup represent the poseidon table in zkevm circuit pub trait PoseidonLookup { fn lookup_columns(&self) -> (FixedColumn, [AdviceColumn; 6]) { @@ -48,6 +51,9 @@ impl PoseidonTable { } pub fn load(&self, region: &mut Region<'_, Fr>, hash_traces: &[([Fr; 2], Fr, Fr)]) { + // The test poseidon table starts assigning from the first row, which has a disabled + // selector, but this is fine because the poseidon_lookup in the ConstraintBuilder + // doesn't include the mpt circuit's selector column. for (offset, hash_trace) in hash_traces.iter().enumerate() { assert!( Hashable::hash_with_domain([hash_trace.0[0], hash_trace.0[1]], hash_trace.1) @@ -67,6 +73,12 @@ impl PoseidonTable { } self.q_enable.assign(region, offset, Fr::one()); } + + // We need to do this so that the fixed columns in the tests will not depend on the + // number of poseidon hashes that are looked up. + for offset in hash_traces.len()..MAX_POSEIDON_ROWS { + self.q_enable.assign(region, offset, Fr::one()); + } } } diff --git a/src/mpt.rs b/src/mpt.rs index 08c8c50c..12ce206c 100644 --- a/src/mpt.rs +++ b/src/mpt.rs @@ -141,13 +141,8 @@ impl MptCircuitConfig { keys.len() ); - self.canonical_representation.assign( - &mut region, - randomness, - keys.iter() - .chain(std::iter::repeat(&Fr::zero())) - .take(total_rep_size), - ); + self.canonical_representation + .assign(&mut region, randomness, &keys, n_rows); self.key_bit.assign(&mut region, &key_bit_lookups(proofs)); self.byte_bit.assign(&mut region); self.byte_representation.assign( @@ -180,4 +175,22 @@ impl MptCircuitConfig { pub fn lookup_exprs(&self, meta: &mut VirtualCells<'_, F>) -> [Expression; 8] { self.mpt_update.lookup().map(|q| q.run(meta)) } + + /// The number of minimum number of rows required for the mpt circuit. + pub fn n_rows_required(proofs: &[Proof]) -> usize { + let (u32s, u64s, u128s, frs) = byte_representations(proofs); + + // +1 for the final padding row to satisfy the "final mpt update is padding" constraint. + 1 + *[ + MptUpdateConfig::n_rows_required(proofs), + CanonicalRepresentationConfig::n_rows_required(&mpt_update_keys(proofs)), + KeyBitConfig::n_rows_required(&key_bit_lookups(proofs)), + // TODO: move rlc lookup for frs into CanonicalRepresentationConfig. + ByteRepresentationConfig::n_rows_required(&u32s, &u64s, &u128s, &frs), + ByteBitGadget::n_rows_required(), + ] + .iter() + .max() + .unwrap() + } } diff --git a/src/tests.rs b/src/tests.rs index 91855616..0ea9df52 100644 --- a/src/tests.rs +++ b/src/tests.rs @@ -6,10 +6,12 @@ use ethers_core::types::{Address, U256}; use halo2_proofs::{ circuit::{Layouter, SimpleFloorPlanner}, dev::MockProver, - halo2curves::bn256::Fr, - plonk::{Circuit, ConstraintSystem, Error, FirstPhase}, + halo2curves::bn256::{Bn256, Fr}, + plonk::{keygen_vk, Circuit, ConstraintSystem, Error, FirstPhase}, + poly::kzg::commitment::ParamsKZG, }; use mpt_zktrie::state::{builder::HASH_SCHEME_DONE, witness::WitnessGenerator, ZktrieState}; +use rand_chacha::rand_core::SeedableRng; const N_ROWS: usize = 8 * 256 + 1; const STORAGE_ADDRESS: Address = Address::repeat_byte(1); @@ -115,6 +117,34 @@ fn degree() { assert_eq!(meta.degree(), 9); } +#[test] +fn verifying_key_constant() { + let params = ParamsKZG::::setup(17, rand_chacha::ChaCha20Rng::seed_from_u64(2)); + + let no_updates = TestCircuit::new(N_ROWS, vec![]); + let one_update = TestCircuit::new( + N_ROWS, + vec![( + MPTProofType::BalanceChanged, + serde_json::from_str(&include_str!( + "traces/empty_account_type_1_balance_update.json" + )) + .unwrap(), + )], + ); + let vk_no_updates = keygen_vk(¶ms, &no_updates).unwrap(); + let vk_one_update = keygen_vk(¶ms, &one_update).unwrap(); + + assert_eq!( + vk_no_updates.fixed_commitments(), + vk_one_update.fixed_commitments() + ); + assert_eq!( + vk_no_updates.permutation().commitments(), + vk_one_update.permutation().commitments() + ); +} + #[test] fn all_padding() { mock_prove(vec![]); @@ -1046,3 +1076,35 @@ fn create_name_registrator_per_txs_not_enough_gas_d0_g0_v0() { .unwrap(), ); } + +#[test] +fn test_n_rows_required() { + assert!(*HASH_SCHEME_DONE); + let mut generator = WitnessGenerator::from(&ZktrieState::default()); + generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::BalanceChanged, + Address::repeat_byte(1), + U256::from(23), + U256::zero(), + None, + ); + + let trace = generator.handle_new_state( + mpt_zktrie::mpt_circuits::MPTProofType::AccountDoesNotExist, + Address::repeat_byte(2), + U256::zero(), + U256::zero(), + None, + ); + let json = serde_json::to_string_pretty(&trace).unwrap(); + let trace: SMTTrace = serde_json::from_str(&json).unwrap(); + + let witness = vec![(MPTProofType::AccountDoesNotExist, trace); 3000]; + let proofs: Vec<_> = witness.clone().into_iter().map(Proof::from).collect(); + + let n_rows_required = MptCircuitConfig::n_rows_required(&proofs); + + let circuit = TestCircuit::new(n_rows_required, witness); + let prover = MockProver::::run(14, &circuit, vec![]).unwrap(); + assert_eq!(prover.verify(), Ok(())); +} From ef0656a79d97cf7b31d012a31d5075ae024fd2fe Mon Sep 17 00:00:00 2001 From: z2trillion Date: Tue, 14 Nov 2023 08:06:12 +0800 Subject: [PATCH 28/30] Remove disallow dead code and remove it (#103) * deny warnings for clippy * don't allow dead code * fix clippy --------- Co-authored-by: Mason Liang --- Makefile | 2 +- src/constraint_builder/query.rs | 7 ------- src/gadgets/byte_representation.rs | 9 --------- src/gadgets/key_bit.rs | 9 +++------ src/gadgets/mpt_update.rs | 9 +-------- src/lib.rs | 1 - src/types.rs | 31 ------------------------------ src/util.rs | 17 +--------------- 8 files changed, 6 insertions(+), 79 deletions(-) diff --git a/Makefile b/Makefile index beb636f4..cf38b795 100644 --- a/Makefile +++ b/Makefile @@ -5,4 +5,4 @@ fmt: @cargo fmt clippy: - @cargo clippy --all-features + @cargo clippy --all-features -- -D warnings diff --git a/src/constraint_builder/query.rs b/src/constraint_builder/query.rs index c7b24c4c..11437fe1 100644 --- a/src/constraint_builder/query.rs +++ b/src/constraint_builder/query.rs @@ -6,13 +6,6 @@ use halo2_proofs::{ poly::Rotation, }; -#[derive(Clone, Copy)] -pub enum ColumnType { - Advice, - Fixed, - Challenge, -} - #[derive(Clone)] pub enum Query { Constant(F), diff --git a/src/gadgets/byte_representation.rs b/src/gadgets/byte_representation.rs index aa8b2904..f7ff1047 100644 --- a/src/gadgets/byte_representation.rs +++ b/src/gadgets/byte_representation.rs @@ -2,7 +2,6 @@ use super::{byte_bit::RangeCheck256Lookup, is_zero::IsZeroGadget, rlc_randomness use crate::constraint_builder::{ AdviceColumn, ConstraintBuilder, Query, SecondPhaseAdviceColumn, SelectorColumn, }; -use ethers_core::types::{Address, H256}; use halo2_proofs::{ arithmetic::FieldExt, circuit::{Region, Value}, @@ -156,14 +155,6 @@ fn u128_to_big_endian(x: &u128) -> Vec { x.to_be_bytes().to_vec() } -fn address_to_big_endian(x: &Address) -> Vec { - x.0.to_vec() -} - -fn h256_to_big_endian(x: &H256) -> Vec { - x.0.to_vec() -} - fn fr_to_big_endian(x: &Fr) -> Vec { let mut bytes = x.to_bytes(); bytes.reverse(); diff --git a/src/gadgets/key_bit.rs b/src/gadgets/key_bit.rs index 5d4b2581..abeece53 100644 --- a/src/gadgets/key_bit.rs +++ b/src/gadgets/key_bit.rs @@ -2,7 +2,7 @@ use super::{ byte_bit::{ByteBitLookup, RangeCheck256Lookup, RangeCheck8Lookup}, canonical_representation::CanonicalRepresentationLookup, }; -use crate::constraint_builder::{AdviceColumn, ConstraintBuilder, Query, SelectorColumn}; +use crate::constraint_builder::{AdviceColumn, ConstraintBuilder, Query}; use halo2_proofs::{ arithmetic::FieldExt, circuit::Region, halo2curves::bn256::Fr, plonk::ConstraintSystem, }; @@ -13,8 +13,6 @@ pub trait KeyBitLookup { #[derive(Clone)] pub struct KeyBitConfig { - selector: SelectorColumn, // always enabled selector for constraints we want always enabled. - // Lookup columns value: AdviceColumn, // We're proving value.bit(i) = bit in this gadget index: AdviceColumn, // 0 <= index < 256 @@ -35,8 +33,7 @@ impl KeyBitConfig { range_check_256: &impl RangeCheck256Lookup, byte_bit: &impl ByteBitLookup, ) -> Self { - let ([selector], [], [value, index, bit, index_div_8, index_mod_8, byte]) = - cb.build_columns(cs); + let ([], [], [value, index, bit, index_div_8, index_mod_8, byte]) = cb.build_columns(cs); cb.add_lookup( "0 <= index < 256", @@ -76,7 +73,6 @@ impl KeyBitConfig { ); Self { - selector, value, index, bit, @@ -134,6 +130,7 @@ mod test { rlc_randomness::RlcRandomness, }; use super::*; + use crate::constraint_builder::SelectorColumn; use halo2_proofs::{ circuit::{Layouter, SimpleFloorPlanner}, dev::MockProver, diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index cedd72c4..268da6cc 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -31,7 +31,7 @@ use ethers_core::types::Address; use halo2_proofs::{ arithmetic::{Field, FieldExt}, circuit::{Region, Value}, - halo2curves::{bn256::Fr, group::ff::PrimeField}, + halo2curves::bn256::Fr, plonk::ConstraintSystem, }; use itertools::izip; @@ -902,13 +902,6 @@ fn new_right(config: &MptUpdateConfig) -> Query { + (Query::one() - config.direction.current()) * config.sibling.current() } -fn address_to_fr(a: Address) -> Fr { - let mut bytes = [0u8; 32]; - bytes[32 - 20..].copy_from_slice(a.as_bytes()); - bytes.reverse(); - Fr::from_repr(bytes).unwrap() -} - fn configure_segment_transitions( cb: &mut ConstraintBuilder, segment: &OneHot, diff --git a/src/lib.rs b/src/lib.rs index aa76d409..4c353b6b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,3 @@ -#![allow(dead_code)] #![allow(clippy::too_many_arguments)] #![deny(unsafe_code)] diff --git a/src/types.rs b/src/types.rs index 47dbf8c6..0c9d3fca 100644 --- a/src/types.rs +++ b/src/types.rs @@ -185,7 +185,6 @@ pub struct Proof { pub struct EthAccount { pub nonce: u64, pub code_size: u64, - poseidon_codehash: Fr, pub balance: Fr, pub keccak_codehash: U256, pub storage_root: Fr, @@ -196,7 +195,6 @@ impl From for EthAccount { Self { nonce: account_data.nonce, code_size: account_data.code_size, - poseidon_codehash: fr_from_biguint(&account_data.poseidon_code_hash), balance: fr_from_biguint(&account_data.balance), keccak_codehash: u256_from_biguint(&account_data.code_hash), storage_root: Fr::zero(), // TODO: fixmeeee!!! @@ -957,39 +955,10 @@ fn check_hash_traces_new(traces: &[(bool, HashDomain, Fr, Fr, Fr, bool, bool)]) } } -fn bits(x: usize, len: usize) -> Vec { - let mut bits = vec![]; - let mut x = x; - while x != 0 { - bits.push(x % 2 == 1); - x /= 2; - } - bits.resize(len, false); - bits.reverse(); - bits -} - fn fr(x: HexBytes<32>) -> Fr { Fr::from_bytes(&x.0).unwrap() } -fn split_word(x: U256) -> (Fr, Fr) { - let mut bytes = [0; 32]; - x.to_big_endian(&mut bytes); - let high_bytes: [u8; 16] = bytes[..16].try_into().unwrap(); - let low_bytes: [u8; 16] = bytes[16..].try_into().unwrap(); - - let high = Fr::from_u128(u128::from_be_bytes(high_bytes)); - let low = Fr::from_u128(u128::from_be_bytes(low_bytes)); - (high, low) - - // TODO: what's wrong with this? - // let [limb_0, limb_1, limb_2, limb_3] = key.0; - // let key_high = Fr::from_u128(u128::from(limb_2) + u128::from(limb_3) << 64); - // let key_low = Fr::from_u128(u128::from(limb_0) + u128::from(limb_1) << 64); - // hash(key_high, key_low) -} - fn big_uint_to_fr(i: &BigUint) -> Fr { i.to_u64_digits() .iter() diff --git a/src/util.rs b/src/util.rs index 33fb3360..9a366b38 100644 --- a/src/util.rs +++ b/src/util.rs @@ -2,7 +2,7 @@ use crate::{constraint_builder::Query, serde::HexBytes, types::HashDomain}; use ethers_core::types::{Address, U256}; use halo2_proofs::{ arithmetic::{Field, FieldExt}, - halo2curves::{bn256::Fr, group::ff::PrimeField}, + halo2curves::bn256::Fr, }; use hash_circuit::hash::Hashable; use num_bigint::BigUint; @@ -50,15 +50,6 @@ pub(crate) fn split_word(x: U256) -> (Fr, Fr) { // hash(key_high, key_low) } -pub(crate) fn hi_lo(x: &BigUint) -> (Fr, Fr) { - let mut u64_digits = x.to_u64_digits(); - u64_digits.resize(4, 0); - ( - Fr::from_u128((u128::from(u64_digits[3]) << 64) + u128::from(u64_digits[2])), - Fr::from_u128((u128::from(u64_digits[1]) << 64) + u128::from(u64_digits[0])), - ) -} - pub(crate) fn u256_hi_lo(x: &U256) -> (u128, u128) { let u64_digits = x.0; ( @@ -86,12 +77,6 @@ pub fn u256_from_biguint(x: &BigUint) -> U256 { U256::from_big_endian(&x.to_bytes_be()) } -pub fn u256_to_fr(x: U256) -> Fr { - let mut bytes = [0u8; 32]; - x.to_little_endian(&mut bytes); - Fr::from_repr(bytes).unwrap() -} - pub fn u256_to_big_endian(x: &U256) -> Vec { let mut bytes = [0; 32]; x.to_big_endian(&mut bytes); From ee6e4a339414a6d75efa13068617c0fd9dd5a003 Mon Sep 17 00:00:00 2001 From: z2trillion Date: Tue, 14 Nov 2023 08:06:59 +0800 Subject: [PATCH 29/30] Expand and correct comment explaining why account must already exist (#80) Co-authored-by: Mason Liang --- src/types.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/types.rs b/src/types.rs index 0c9d3fca..55c34b4d 100644 --- a/src/types.rs +++ b/src/types.rs @@ -260,7 +260,11 @@ impl From<(&MPTProofType, &SMTTrace)> for ClaimKind { match update { [None, None] => (), [Some(old), Some(new)] => { - // The account must exist, because only contracts with bytecode can modify their own storage slots. + // Accesses to the MPT happen in the order defined in the state (aka rw) circuit, which is not the + // same as the order they occur in the EVM. In the state circuit, nonce and balance modifications + // will precede storage modifications for a given address, which means that the MPT circuit only + // needs to handle storage modifications for existing accounts, even though this is not true in the + // EVM, where the storage of an account can be modified during its construction. if !(account_old == account_new || (account_old.is_none() && account_new == &Some(Default::default()))) { From 757675b77f77f2ad9e0227a38c844ddbbf90301c Mon Sep 17 00:00:00 2001 From: z2trillion Date: Tue, 14 Nov 2023 08:07:18 +0800 Subject: [PATCH 30/30] [ZK 37] only check path_type in configure_extension_old and configure_extension_new (#79) * Only check path_type in configure_extension_old and configure_extension_new * Remove always satisfied conditions for poseidon code hash updates * Remove always satisfied condition for code size and delete unreachable constraints * Remove duplicated constraint * fmt * Remove always satisfied condition * Check that code size and nonce are 0 for new account --------- Co-authored-by: Mason Liang Co-authored-by: z2trillion --- src/gadgets/mpt_update.rs | 111 ++++++++++++-------------------------- 1 file changed, 33 insertions(+), 78 deletions(-) diff --git a/src/gadgets/mpt_update.rs b/src/gadgets/mpt_update.rs index 268da6cc..9e1b014e 100644 --- a/src/gadgets/mpt_update.rs +++ b/src/gadgets/mpt_update.rs @@ -1127,10 +1127,15 @@ fn configure_extension_old( poseidon: &impl PoseidonLookup, ) { cb.assert( - "can only delete existing nodes for storage proofs", + "can only delete existing storage trie nodes for storage proofs", config .proof_type - .current_matches(&[MPTProofType::StorageChanged]), + .current_matches(&[MPTProofType::StorageChanged]) + .and( + config + .segment_type + .current_matches(&[SegmentType::StorageTrie, SegmentType::StorageLeaf0]), + ), ); cb.assert_zero( "new value is 0 when deleting node", @@ -1353,10 +1358,10 @@ fn configure_nonce( config.path_type.current_matches(&[PathType::ExtensionNew]), |cb| { cb.assert_equal( - "sibling is hash(0, hash(0, 0)) for nonce extension new at AccountLeaf2", - config.sibling.current(), - Query::from(*ZERO_STORAGE_ROOT_KECCAK_CODEHASH_HASH), - ); + "sibling is hash(0, hash(0, 0)) for nonce extension new at AccountLeaf2", + config.sibling.current(), + Query::from(*ZERO_STORAGE_ROOT_KECCAK_CODEHASH_HASH), + ); }, ); } @@ -1426,12 +1431,6 @@ fn configure_code_size( bytes: &impl BytesLookup, poseidon: &impl PoseidonLookup, ) { - cb.assert( - "new accounts have balance or nonce set first", - config - .path_type - .current_matches(&[PathType::Start, PathType::Common]), - ); for variant in SegmentType::iter() { let conditional_constraints = |cb: &mut ConstraintBuilder| match variant { SegmentType::Start | SegmentType::AccountTrie => { @@ -1602,19 +1601,21 @@ fn configure_balance( ); }, ); + cb.add_lookup( + "new balance is rlc(new_hash) and fits into 31 bytes", + [ + config.new_hash.current(), + Query::from(30), + config.new_value.current(), + ], + rlc.lookup(), + ); cb.condition( - config - .path_type - .current_matches(&[PathType::Common, PathType::ExtensionNew]), + config.path_type.current_matches(&[PathType::ExtensionNew]), |cb| { - cb.add_lookup( - "new balance is rlc(new_hash) and fits into 31 bytes", - [ - config.new_hash.current(), - Query::from(30), - config.new_value.current(), - ], - rlc.lookup(), + cb.assert_zero( + "sibling (code_size + nonce << 64) is 0 for new account)", + config.sibling.current(), ); }, ); @@ -1641,12 +1642,6 @@ fn configure_poseidon_code_hash( cb: &mut ConstraintBuilder, config: &MptUpdateConfig, ) { - cb.assert( - "new accounts have balance or nonce set first", - config - .path_type - .current_matches(&[PathType::Start, PathType::Common]), - ); for variant in SegmentType::iter() { let conditional_constraints = |cb: &mut ConstraintBuilder| match variant { SegmentType::AccountLeaf0 => { @@ -1654,29 +1649,15 @@ fn configure_poseidon_code_hash( } SegmentType::AccountLeaf1 => { cb.assert_equal("direction is 1", config.direction.current(), Query::one()); - cb.condition( - config - .path_type - .current_matches(&[PathType::Common, PathType::ExtensionOld]), - |cb| { - cb.assert_equal( - "old_hash is old poseidon code hash", - config.old_value.current(), - config.old_hash.current(), - ); - }, + cb.assert_equal( + "old_hash is old poseidon code hash", + config.old_value.current(), + config.old_hash.current(), ); - cb.condition( - config - .path_type - .current_matches(&[PathType::Common, PathType::ExtensionNew]), - |cb| { - cb.assert_equal( - "new_hash is new poseidon code hash", - config.new_value.current(), - config.new_hash.current(), - ); - }, + cb.assert_equal( + "new_hash is new poseidon code hash", + config.new_value.current(), + config.new_hash.current(), ); } _ => {} @@ -1696,12 +1677,6 @@ fn configure_keccak_code_hash( rlc: &impl RlcLookup, randomness: Query, ) { - cb.assert( - "new accounts have balance or nonce set first", - config - .path_type - .current_matches(&[PathType::Start, PathType::Common]), - ); for variant in SegmentType::iter() { let conditional_constraints = |cb: &mut ConstraintBuilder| match variant { SegmentType::Start | SegmentType::AccountTrie => { @@ -1797,10 +1772,6 @@ fn configure_storage( cb.assert_equal("direction is 1", config.direction.current(), Query::one()); } SegmentType::AccountLeaf3 => { - cb.assert( - "storage modifications must be on an existing account", - config.path_type.current_matches(&[PathType::Common]), - ); cb.assert_zero("direction is 0", config.direction.current()); let [key_high, key_low, ..] = config.intermediate_values; let [rlc_key_high, rlc_key_low, ..] = config.second_phase_intermediate_values; @@ -1820,11 +1791,8 @@ fn configure_storage( let [old_high, old_low, new_high, new_low, ..] = config.intermediate_values; let [rlc_old_high, rlc_old_low, rlc_new_high, rlc_new_low, ..] = config.second_phase_intermediate_values; - cb.condition( - config - .path_type - .current_matches(&[PathType::Common, PathType::ExtensionOld]), + config.path_type.current_matches(&[PathType::Common]), |cb| { configure_word_rlc( cb, @@ -1835,13 +1803,6 @@ fn configure_storage( rlc, randomness.clone(), ); - }, - ); - cb.condition( - config - .path_type - .current_matches(&[PathType::Common, PathType::ExtensionNew]), - |cb| { configure_word_rlc( cb, [config.new_hash, new_high, new_low], @@ -1970,12 +1931,6 @@ fn configure_empty_account( config: &MptUpdateConfig, poseidon: &impl PoseidonLookup, ) { - cb.assert( - "path type is start or common for empty account proof", - config - .path_type - .current_matches(&[PathType::Start, PathType::Common]), - ); cb.assert_zero("old value is 0", config.old_value.current()); cb.assert_zero("new value is 0", config.new_value.current()); cb.assert_equal(