Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Committee update circuit #1

Merged
merged 14 commits into from
Aug 26, 2023
8 changes: 6 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,20 @@ halo2curves = { git = "https://github.com/timoftime/halo2curves", branch = "dev/
# halo2curves = { path = "../halo2curves" }

[patch."https://github.com/axiom-crypto/halo2-lib"]
halo2-base = { git = "https://github.com/timoftime/halo2-lib", branch = "dev/bls12_381", default-features = false, features = [
halo2-base = { git = "https://github.com/timoftime/halo2-lib", rev = "7cebe716bb0569a7cb741c44ef8e87b2eadbbafb", default-features = false, features = [
"halo2-pse",
"display",
] }
halo2-ecc = { git = "https://github.com/timoftime/halo2-lib", branch = "dev/bls12_381", default-features = false }
halo2-ecc = { git = "https://github.com/timoftime/halo2-lib",rev = "7cebe716bb0569a7cb741c44ef8e87b2eadbbafb", default-features = false }
poseidon = { git = "https://github.com/timoftime/halo2-lib", rev = "7cebe716bb0569a7cb741c44ef8e87b2eadbbafb", default-features = false }

# halo2-base = { path = "../halo2-lib/halo2-base", default-features = false, features = [
# "halo2-pse",
# "display",
# ] }
# halo2-ecc = { path = "../halo2-lib/halo2-ecc", default-features = false }
# poseidon = { path = "../halo2-lib/hashes/poseidon", default-features = false }


# [patch."https://github.com/timoftime/halo2curves"]
# halo2curves = { path = "../halo2curves" }
12 changes: 2 additions & 10 deletions eth-types/src/spec.rs
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
use core::fmt::Debug;

use crate::Field;

pub trait Spec: 'static + Sized + Copy + Default + Debug {
const SYNC_COMMITTEE_SIZE: usize;
const DST: &'static [u8];

// Number of digits containing the participation bits per committee for a given field element.
// ceil(Self::SYNC_COMMITTEE_SIZE / F::NUM_BITS)
fn participation_digits_len<F: Field>() -> usize {
(Self::SYNC_COMMITTEE_SIZE + F::NUM_BITS as usize - 1) / F::NUM_BITS as usize
}
}

#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
pub struct Test;

impl Spec for Test {
const SYNC_COMMITTEE_SIZE: usize = 10;
const SYNC_COMMITTEE_SIZE: usize = 512;
const DST: &'static [u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_";
}

#[derive(Copy, Clone, PartialEq, Eq, Debug, Default)]
pub struct Mainnet;

impl Spec for Mainnet {
const SYNC_COMMITTEE_SIZE: usize = 2048;
const SYNC_COMMITTEE_SIZE: usize = 512;
const DST: &'static [u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_";
}
6 changes: 5 additions & 1 deletion ligthclient-circuits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@ license = "MIT OR Apache-2.0"
halo2_proofs = { git = "https://github.com/privacy-scaling-explorations/halo2.git", tag = "v2023_02_02", features = [
"dev-graph",
] }
halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "0.3.1" }
halo2-base = { git = "https://github.com/axiom-crypto/halo2-lib", branch = "community-edition", default-features = false, features = [
"halo2-pse",
"display",
] }
halo2-ecc = { git = "https://github.com/axiom-crypto/halo2-lib", branch = "community-edition", default-features = false }
halo2curves = { git = "https://github.com/privacy-scaling-explorations/halo2curves", tag = "0.3.1" }
poseidon = { git = "https://github.com/axiom-crypto/halo2-lib", branch = "community-edition", default-features = false }
poseidon-circuit = { git = "https://github.com/scroll-tech/poseidon-circuit.git", branch = "scroll-dev-0408", features = [
'short',
] }

# aggregation
snark-verifier = { git = "https://github.com/axiom-crypto/snark-verifier.git", tag = "v0.1.1", default-features = false, features = [
Expand Down
Loading
Loading