Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nulltea committed Feb 26, 2024
1 parent 53daf7f commit 07ee5ca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lightclient-circuits/config/sync_step_testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
},
"break_points": [
[
2097142,
2097142,
2097141,
2097141,
2097142,
2097140,
2097142,
2097140
2097141
]
]
}
8 changes: 6 additions & 2 deletions lightclient-circuits/src/sync_step_circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ use halo2_ecc::{
use halo2curves::bls12_381::{G1Affine, G2Affine};
use itertools::Itertools;
use num_bigint::BigUint;
use rayon::iter::IntoParallelRefIterator;
use ssz_rs::Merkleized;
use std::{env::var, marker::PhantomData, vec};

Expand Down Expand Up @@ -378,11 +379,14 @@ impl<S: Spec, F: Field> StepCircuit<S, F> {
let rand_point = g1_chip.load_random_point::<G1Affine>(ctx);
let mut acc = rand_point.clone();
for (bit, point) in participation_bits
.iter()
.par_iter()
.copied()
.zip(assigned_affines.iter_mut())
{
let sum = g1_chip.add_unequal(ctx, acc.clone(), point.clone(), true);
let is_equal = g1_chip.is_equal(ctx, acc.clone(), point.clone());
let add = g1_chip.add_unequal(ctx, acc.clone(), point.clone(), true);
let doub = g1_chip.double(ctx, acc.clone());
let sum = g1_chip.select(ctx, doub, add, is_equal);
acc = g1_chip.select(ctx, sum, acc, bit);
}
let agg_pubkey = g1_chip.sub_unequal(ctx, acc, rand_point, false);
Expand Down

0 comments on commit 07ee5ca

Please sign in to comment.