Skip to content

Commit

Permalink
gen verifier contracts
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2 committed Dec 12, 2023
1 parent 60ab00b commit 342a028
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 18 deletions.
23 changes: 23 additions & 0 deletions contracts/snark-verifiers/sync_step_verifier.sol

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,21 @@ lint: fmt
setup-step network *k='22':
cargo run -r -- circuit sync-step -p ./build/sync_step_$1.pkey -k $2 setup

setup-step-compressed network *k='23':
cargo run -r -- circuit sync-step-compressed -p ./build/sync_step_$1.pkey -k 21 \
--verifier-k $2 --verifier-pk-path ./build/sync_step_verifier_$1.pkey setup

setup-committee-update network *k='25':
cargo run -r -- circuit committee-update -p ./build/committee_update_$1.pkey -k 18 \
--verifier-k $2 --verifier-pk-path ./build/committee_update_verifier_$1.pkey setup

gen-verifier-step network:
cargo run -r -- circuit sync-step -p ./build/sync_step_$1.pkey gen-verifier -o ./contracts/snark-verifiers/sync_step.sol

gen-verifier-step-compressed network:
cargo run -r -- circuit sync-step-compressed -p ./build/sync_step_$1.pkey --verifier-pk-path ./build/sync_step_verifier_$1.pkey \
gen-verifier -o ./contracts/snark-verifiers/sync_step_verifier.sol

gen-verifier-committee-update network:
cargo run -r -- circuit committee-update -p ./build/committee_update_$1.pkey --verifier-pk-path ./build/committee_update_verifier_$1.pkey \
gen-verifier -o ./contracts/snark-verifiers/committee_update_verifier.sol
Expand Down
13 changes: 4 additions & 9 deletions lightclient-circuits/config/committee_update_testnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,25 @@
"params": {
"k": 18,
"num_advice_per_phase": [
12
7
],
"num_fixed": 1,
"num_lookup_advice_per_phase": [
1,
0,
0
],
"lookup_bits": 8,
"lookup_bits": 17,
"num_instance_columns": 1
},
"break_points": [
[
262134,
262132,
262134,
262132,
262133,
262132,
262132,
262134,
262133,
262132,
262134,
262133
262134
]
]
}
13 changes: 8 additions & 5 deletions lightclient-circuits/config/sync_step_testnet.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
{
"params": {
"k": 22,
"k": 21,
"num_advice_per_phase": [
3
6
],
"num_fixed": 1,
"num_lookup_advice_per_phase": [
1,
0,
0
],
"lookup_bits": 21,
"lookup_bits": 20,
"num_instance_columns": 1
},
"break_points": [
[
4194294,
4194294
2097142,
2097142,
2097140,
2097142,
2097142
]
]
}
12 changes: 12 additions & 0 deletions lightclient-circuits/config/sync_step_verifier_testnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"params": {
"degree": 23,
"num_advice": 1,
"num_lookup_advice": 1,
"num_fixed": 1,
"lookup_bits": 8
},
"break_points": [
[]
]
}
6 changes: 2 additions & 4 deletions prover/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,10 @@ where
let gen_dummy_snark = |k: u32| {
let params = gen_srs(k);

let pk = CommitteeUpdateCircuit::<S, Fr>::read_or_create_pk(
let pk = CommitteeUpdateCircuit::<S, Fr>::create_pk(
&params,
&pk_path,
&cfg_path,
true,
&Default::default(),
);

Expand Down Expand Up @@ -157,11 +156,10 @@ where
let gen_dummy_snark = |k: u32| {
let params = gen_srs(k);

let pk = StepCircuit::<S, Fr>::read_or_create_pk(
let pk = StepCircuit::<S, Fr>::create_pk(
&params,
&pk_path,
&cfg_path,
true,
&Default::default(),
);

Expand Down

0 comments on commit 342a028

Please sign in to comment.