Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltea committed Dec 11, 2023
1 parent a25cbfa commit 96663d8
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 20 deletions.
6 changes: 4 additions & 2 deletions contract-tests/tests/rotation_input_encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ where
let poseidon_commitment = poseidon_committee_commitment_from_compressed(
&args.pubkeys_compressed.iter().cloned().collect_vec(),
);
let sync_committee_poseidon = ethers::prelude::U256::from_little_endian(&poseidon_commitment.to_bytes());
let sync_committee_poseidon =
ethers::prelude::U256::from_little_endian(&poseidon_commitment.to_bytes());

let mut pk_vector: Vector<Vector<u8, 48>, { Spec::SYNC_COMMITTEE_SIZE }> = args
.pubkeys_compressed
Expand Down Expand Up @@ -91,7 +92,8 @@ mod tests {
let (_, witness) = read_test_files_and_gen_witness(&path);
let accumulator = [bn256::Fr::zero(); 12]; // this can be anything.. The test is just checking it gets correctly concatenated to the start of the encoded input

let instance = CommitteeUpdateCircuit::<Minimal, bn256::Fr>::get_instances(&witness, LIMB_BITS);
let instance =
CommitteeUpdateCircuit::<Minimal, bn256::Fr>::get_instances(&witness, LIMB_BITS);
let finalized_block_root = witness
.finalized_header
.clone()
Expand Down
19 changes: 7 additions & 12 deletions lightclient-circuits/src/committee_update_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,18 +163,13 @@ impl<S: Spec, F: Field> CommitteeUpdateCircuit<S, F> {
where
[(); S::SYNC_COMMITTEE_SIZE]:,
{
let pubkeys_x = args
.pubkeys_compressed
.iter()
.cloned()
.map(|mut bytes| {
bytes[0] &= 0b00011111;
bls12_381::Fq::from_bytes_be(&bytes.try_into().unwrap())
.expect("bad bls12_381::Fq encoding")
});

let poseidon_commitment =
fq_array_poseidon_native::<bn256::Fr>(pubkeys_x, limb_bits);
let pubkeys_x = args.pubkeys_compressed.iter().cloned().map(|mut bytes| {
bytes[0] &= 0b00011111;
bls12_381::Fq::from_bytes_be(&bytes.try_into().unwrap())
.expect("bad bls12_381::Fq encoding")
});

let poseidon_commitment = fq_array_poseidon_native::<bn256::Fr>(pubkeys_x, limb_bits);

let mut pk_vector: Vector<Vector<u8, 48>, { S::SYNC_COMMITTEE_SIZE }> = args
.pubkeys_compressed
Expand Down
7 changes: 5 additions & 2 deletions lightclient-circuits/src/gadget/crypto/sha256_wide/gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ use crate::util::{CommonGateManager, GateBuilderConfig};
use eth_types::Field;
use getset::CopyGetters;
use halo2_base::{
gates::circuit::{CircuitBuilderStage, BaseCircuitParams},
halo2_proofs::{circuit::Region, plonk::{Error, ConstraintSystem}},
gates::circuit::{BaseCircuitParams, CircuitBuilderStage},
halo2_proofs::{
circuit::Region,
plonk::{ConstraintSystem, Error},
},
virtual_region::{
copy_constraints::SharedCopyConstraintManager, manager::VirtualRegionManager,
},
Expand Down
2 changes: 1 addition & 1 deletion lightclient-circuits/src/util/common.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#![allow(dead_code)]
use eth_types::*;
use halo2_base::{
gates::circuit::{CircuitBuilderStage, BaseCircuitParams},
gates::circuit::{BaseCircuitParams, CircuitBuilderStage},
halo2_proofs::{
circuit::{Layouter, Region},
plonk::{ConstraintSystem, Error},
Expand Down
1 change: 0 additions & 1 deletion prover/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ pub(crate) async fn gen_evm_proof_sync_step_handler(
})
}


fn gen_committee_update_snark<S: eth_types::Spec>(
config_path: PathBuf,
pk_path: PathBuf,
Expand Down
4 changes: 2 additions & 2 deletions test-utils/src/conversions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ where
let poseidon_commitment = poseidon_committee_commitment_from_compressed(
&args.pubkeys_compressed.iter().cloned().collect_vec(),
);
let sync_committee_poseidon = ethers::prelude::U256::from_little_endian(&poseidon_commitment.to_bytes());

let sync_committee_poseidon =
ethers::prelude::U256::from_little_endian(&poseidon_commitment.to_bytes());

let mut pk_vector: Vector<Vector<u8, 48>, { Spec::SYNC_COMMITTEE_SIZE }> = args
.pubkeys_compressed
Expand Down

0 comments on commit 96663d8

Please sign in to comment.