Skip to content

Commit

Permalink
cargo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mason Liang committed Oct 31, 2023
1 parent cd572d4 commit 1950aed
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
22 changes: 5 additions & 17 deletions src/gadgets/mpt_update.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,8 @@ pub use path::PathType;
use segment::SegmentType;

use super::{
byte_representation::BytesLookup,
canonical_representation::{FrHiLoLookup, FrRlcLookup},
is_zero::IsZeroGadget,
key_bit::KeyBitLookup,
one_hot::OneHot,
poseidon::PoseidonLookup,
byte_representation::BytesLookup, canonical_representation::FrHiLoLookup,
is_zero::IsZeroGadget, key_bit::KeyBitLookup, one_hot::OneHot, poseidon::PoseidonLookup,
};
use crate::{
constraint_builder::{
Expand All @@ -21,15 +17,13 @@ use crate::{
trie::{next_domain, TrieRows},
ClaimKind, HashDomain, Proof,
},
util::{
account_key, domain_hash, fr_to_u256, lagrange_polynomial, rlc, u256_hi_lo, u256_to_fr,
},
util::{account_key, domain_hash, fr_to_u256, lagrange_polynomial, u256_hi_lo, u256_to_fr},
MPTProofType,
};
use ethers_core::types::Address;
use halo2_proofs::{
arithmetic::{Field, FieldExt},
circuit::{Region, Value},
circuit::Region,
halo2curves::{bn256::Fr, group::ff::PrimeField},
plonk::ConstraintSystem,
};
Expand Down Expand Up @@ -122,7 +116,6 @@ impl MptUpdateConfig {
poseidon: &impl PoseidonLookup,
key_bit: &impl KeyBitLookup,
bytes: &impl BytesLookup,
fr_rlc: &impl FrRlcLookup,
fr_hi_lo: &impl FrHiLoLookup,
) -> Self {
let proof_type: OneHot<MPTProofType> = OneHot::configure(cs, cb);
Expand Down Expand Up @@ -356,12 +349,7 @@ impl MptUpdateConfig {
}

/// ..
pub fn assign(
&self,
region: &mut Region<'_, Fr>,
proofs: &[Proof],
randomness: Value<Fr>,
) -> usize {
pub fn assign(&self, region: &mut Region<'_, Fr>, proofs: &[Proof]) -> usize {
let mut n_rows = 0;
let mut offset = 1; // selector on first row is disabled.
for proof in proofs {
Expand Down
3 changes: 1 addition & 2 deletions src/mpt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ impl MptCircuitConfig {
&key_bit,
&byte_representation,
&canonical_representation,
&canonical_representation,
);

// This ensures that the final mpt update in the circuit is complete, since the padding
Expand Down Expand Up @@ -158,7 +157,7 @@ impl MptCircuitConfig {
randomness,
);

let n_assigned_rows = self.mpt_update.assign(&mut region, proofs, randomness);
let n_assigned_rows = self.mpt_update.assign(&mut region, proofs);

assert!(
2 + n_assigned_rows <= n_rows,
Expand Down

0 comments on commit 1950aed

Please sign in to comment.