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

Ec2/rotation merkle instances #23

Merged
merged 23 commits into from
Oct 10, 2023
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions eth-types/src/spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ use core::fmt::Debug;

pub trait Spec: 'static + Sized + Copy + Default + Debug {
const SYNC_COMMITTEE_SIZE: usize;
const SYNC_COMMITTEE_ROOT_INDEX: usize;
const SYNC_COMMITTEE_DEPTH: usize;
const SYNC_COMMITTEE_PUBKEYS_ROOT_INDEX: usize;
const SYNC_COMMITTEE_PUBKEYS_DEPTH: usize;

const DST: &'static [u8];
const EXECUTION_STATE_ROOT_INDEX: usize;
const EXECUTION_STATE_ROOT_DEPTH: usize;
Expand All @@ -14,6 +19,11 @@ pub struct Minimal;

impl Spec for Minimal {
const SYNC_COMMITTEE_SIZE: usize = 32;
const SYNC_COMMITTEE_DEPTH: usize = 5;
const SYNC_COMMITTEE_ROOT_INDEX: usize = 55;
const SYNC_COMMITTEE_PUBKEYS_ROOT_INDEX: usize = Self::SYNC_COMMITTEE_ROOT_INDEX * 2;
const SYNC_COMMITTEE_PUBKEYS_DEPTH: usize = Self::SYNC_COMMITTEE_DEPTH + 1;

const DST: &'static [u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_";
const EXECUTION_STATE_ROOT_INDEX: usize = 9;
const EXECUTION_STATE_ROOT_DEPTH: usize = 4;
Expand All @@ -26,6 +36,10 @@ pub struct Testnet;

impl Spec for Testnet {
const SYNC_COMMITTEE_SIZE: usize = 512;
const SYNC_COMMITTEE_DEPTH: usize = 5;
const SYNC_COMMITTEE_ROOT_INDEX: usize = 55;
const SYNC_COMMITTEE_PUBKEYS_ROOT_INDEX: usize = Self::SYNC_COMMITTEE_ROOT_INDEX * 2;
const SYNC_COMMITTEE_PUBKEYS_DEPTH: usize = Self::SYNC_COMMITTEE_DEPTH + 1;
const DST: &'static [u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_";
const EXECUTION_STATE_ROOT_INDEX: usize = 25;
const EXECUTION_STATE_ROOT_DEPTH: usize = 4;
Expand All @@ -38,6 +52,10 @@ pub struct Mainnet;

impl Spec for Mainnet {
const SYNC_COMMITTEE_SIZE: usize = 512;
const SYNC_COMMITTEE_DEPTH: usize = 5;
const SYNC_COMMITTEE_ROOT_INDEX: usize = 55;
const SYNC_COMMITTEE_PUBKEYS_ROOT_INDEX: usize = Self::SYNC_COMMITTEE_ROOT_INDEX * 2;
const SYNC_COMMITTEE_PUBKEYS_DEPTH: usize = Self::SYNC_COMMITTEE_DEPTH + 1;
const DST: &'static [u8] = b"BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_POP_";
const EXECUTION_STATE_ROOT_INDEX: usize = 25;
const EXECUTION_STATE_ROOT_DEPTH: usize = 4;
Expand Down
8 changes: 6 additions & 2 deletions lightclient-circuits/config/committee_update.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"strategy": "Vertical",
"k": 18,
"num_advice_per_phase": [
11,
15,
0,
0
],
Expand All @@ -18,13 +18,17 @@
[
262132,
262132,
262132,
262130,
262130,
262130,
262132,
262132,
262130,
262132,
262132,
262130,
262132,
262130,
262131
],
[],
Expand Down
218 changes: 7 additions & 211 deletions lightclient-circuits/config/committee_update_aggregation.json
Original file line number Diff line number Diff line change
@@ -1,228 +1,24 @@
{
"params": {
"strategy": "Vertical",
"k": 17,
"k": 23,
"num_advice_per_phase": [
208,
4,
0,
0
],
"num_lookup_advice_per_phase": [
25,
1,
0,
0
],
"num_fixed": 4
"num_fixed": 1
},
"break_points": [
[
131060,
131062,
131062,
131062,
131060,
131062,
131062,
131062,
131060,
131062,
131062,
131062,
131060,
131061,
131062,
131062,
131060,
131061,
131061,
131060,
131062,
131060,
131062,
131062,
131062,
131062,
131062,
131061,
131062,
131062,
131062,
131062,
131062,
131062,
131061,
131060,
131062,
131062,
131062,
131060,
131061,
131062,
131062,
131062,
131062,
131061,
131060,
131061,
131062,
131062,
131062,
131060,
131061,
131061,
131062,
131060,
131060,
131060,
131060,
131062,
131062,
131062,
131062,
131062,
131062,
131061,
131060,
131060,
131061,
131062,
131061,
131061,
131061,
131062,
131062,
131060,
131061,
131062,
131061,
131060,
131062,
131060,
131062,
131061,
131062,
131060,
131060,
131062,
131061,
131060,
131062,
131061,
131061,
131061,
131062,
131060,
131062,
131062,
131062,
131062,
131062,
131062,
131060,
131062,
131062,
131062,
131062,
131061,
131062,
131060,
131062,
131062,
131060,
131060,
131062,
131060,
131060,
131060,
131060,
131062,
131062,
131060,
131060,
131062,
131061,
131061,
131062,
131060,
131062,
131062,
131062,
131062,
131062,
131062,
131062,
131062,
131062,
131060,
131061,
131060,
131060,
131061,
131061,
131061,
131061,
131062,
131061,
131060,
131062,
131060,
131061,
131060,
131061,
131061,
131060,
131060,
131062,
131060,
131062,
131061,
131062,
131060,
131061,
131062,
131062,
131060,
131061,
131060,
131060,
131061,
131061,
131061,
131061,
131062,
131061,
131060,
131062,
131060,
131061,
131060,
131061,
131061,
131060,
131060,
131062,
131060,
131062,
131061,
131062,
131060,
131061,
131062,
131062,
131060,
131061,
131060,
131060,
131061,
131061,
131061,
131061,
131062,
131062,
131062,
131060,
131061,
131061
8388596,
8388597,
8388598
],
[],
[]
Expand Down
26 changes: 26 additions & 0 deletions lightclient-circuits/config/committee_update_aggregation_1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"params": {
"strategy": "Vertical",
"k": 23,
"num_advice_per_phase": [
4,
0,
0
],
"num_lookup_advice_per_phase": [
1,
0,
0
],
"num_fixed": 1
},
"break_points": [
[
8388596,
8388597,
8388598
],
[],
[]
]
}
22 changes: 22 additions & 0 deletions lightclient-circuits/config/committee_update_aggregation_2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"params": {
"strategy": "Vertical",
"k": 23,
"num_advice_per_phase": [
1,
0,
0
],
"num_lookup_advice_per_phase": [
1,
0,
0
],
"num_fixed": 1
},
"break_points": [
[],
[],
[]
]
}
1 change: 1 addition & 0 deletions lightclient-circuits/src/aggregation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ impl AppCircuit for AggregationCircuit {
circuit.expose_previous_instances(false);
}
_ => {
circuit.expose_previous_instances(false);
circuit.config(k, Some(10));
set_var("LOOKUP_BITS", lookup_bits.to_string());
}
Expand Down
Loading
Loading