-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added save option for updated commitment state file
updated naming, added test scripts
- Loading branch information
Showing
13 changed files
with
202 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
|
||
if [ "x$1" = "x" ] ; then | ||
echo "Circuit not defined" | ||
exit 1 | ||
fi | ||
|
||
CIRCUIT=$1 | ||
|
||
echo "Preprocessing circuit: [1;31m$CIRCUIT[0m" | ||
|
||
bin/proof-producer/proof-producer-single-threaded \ | ||
--circuit circuits-and-assignments/$CIRCUIT/circuit.crct \ | ||
--assignment-table circuits-and-assignments/$CIRCUIT/assignment.tbl \ | ||
--common-data $CIRCUIT-common_data.dat \ | ||
--preprocessed-data $CIRCUIT-preprocessed.dat \ | ||
--commitment-state-file $CIRCUIT-commitment_state.dat \ | ||
--assignment-description-file $CIRCUIT-assignment-description.dat \ | ||
--stage preprocess \ | ||
--grind-param 16 \ | ||
--max-quotient-chunks 10 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/sh | ||
|
||
if [ "x$1" = "x" ] ; then | ||
echo "Circuit not defined" | ||
exit 1 | ||
fi | ||
|
||
CIRCUIT=$1 | ||
|
||
echo "Partial proof for circuit: [1;31m$CIRCUIT[0m" | ||
|
||
bin/proof-producer/proof-producer-single-threaded \ | ||
--stage generate-partial-proof \ | ||
--grind-param 16 \ | ||
--max-quotient-chunks 10 \ | ||
--circuit circuits-and-assignments/$CIRCUIT/circuit.crct \ | ||
--assignment-table circuits-and-assignments/$CIRCUIT/assignment.tbl \ | ||
--common-data $CIRCUIT-common_data.dat \ | ||
--preprocessed-data $CIRCUIT-preprocessed.dat \ | ||
--commitment-state-file $CIRCUIT-commitment_state.dat \ | ||
--updated-commitment-state-file $CIRCUIT-updated_commitment_state.dat \ | ||
--assignment-description-file $CIRCUIT-assignment-description.dat \ | ||
--challenge-file $CIRCUIT-challenge.dat \ | ||
--theta-power-file $CIRCUIT-theta-power.txt \ | ||
--proof $CIRCUIT-proof.dat \ | ||
--json $CIRCUIT-proof.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/sh | ||
|
||
echo "Generating challenges" | ||
|
||
bin/proof-producer/proof-producer-single-threaded \ | ||
--stage generate-aggregated-challenge \ | ||
-u "fri_array_swap-challenge.dat" \ | ||
-u "merkle_tree_poseidon_cpp_example-challenge.dat" \ | ||
--aggregated-challenge-file "challenge-aggregated.dat" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/sh | ||
|
||
if [ "x$1" = "x" ] ; then | ||
echo "Circuit not defined" | ||
exit 1 | ||
fi | ||
|
||
if [ "x$2" = "x" ] ; then | ||
echo "Starting power not defined" | ||
exit 1 | ||
fi | ||
|
||
|
||
CIRCUIT=$1 | ||
|
||
echo "Computing combined Q for circuit: [1;31m$CIRCUIT[0m, starting power: $2" | ||
|
||
bin/proof-producer/proof-producer-single-threaded \ | ||
--stage compute-combined-Q \ | ||
--aggregated-challenge-file "challenge-aggregated.dat" \ | ||
--combined-Q-starting-power=$2 \ | ||
--commitment-state-file $CIRCUIT-commitment_state.dat \ | ||
--combined-Q-polynomial-file $CIRCUIT-combined-Q.dat | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
CIRCUIT1=fri_array_swap | ||
CIRCUIT2=merkle_tree_poseidon_cpp_example | ||
|
||
echo "Computing aggregated FRI" | ||
|
||
bin/proof-producer/proof-producer-single-threaded \ | ||
--stage aggregated-FRI \ | ||
--assignment-description-file $CIRCUIT1-assignment-description.dat \ | ||
--aggregated-challenge-file "challenge-aggregated.dat" \ | ||
--input-combined-Q-polynomial-files "$CIRCUIT1-combined-Q.dat" \ | ||
--input-combined-Q-polynomial-files "$CIRCUIT2-combined-Q.dat" \ | ||
--proof="aggregated_FRI_proof.bin" \ | ||
--proof-of-work-file="POW.dat" \ | ||
--consistency-checks-challenges-file="challenges.dat" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
if [ "x$1" = "x" ] ; then | ||
echo "Circuit not defined" | ||
exit 1 | ||
fi | ||
|
||
CIRCUIT=$1 | ||
|
||
echo "Consistency chacks for circuit: [1;31m$CIRCUIT[0m" | ||
|
||
bin/proof-producer/proof-producer-single-threaded \ | ||
--stage consistency-checks \ | ||
--commitment-state-file $CIRCUIT-updated_commitment_state.dat \ | ||
--combined-Q-polynomial-file $CIRCUIT-combined-Q.dat \ | ||
--consistency-checks-challenges-file "challenges.dat" \ | ||
--proof $CIRCUIT-LPC_consistency_check_proof.bin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
|
||
CIRCUIT1=fri_array_swap | ||
CIRCUIT2=merkle_tree_poseidon_cpp_example | ||
|
||
echo "Merging proofs" | ||
|
||
bin/proof-producer/proof-producer-single-threaded \ | ||
--stage merge-proofs \ | ||
--partial-proof $CIRCUIT1-proof.dat \ | ||
--partial-proof $CIRCUIT2-proof.dat \ | ||
--initial-proof $CIRCUIT1-LPC_consistency_check_proof.bin \ | ||
--initial-proof $CIRCUIT2-LPC_consistency_check_proof.bin \ | ||
--aggregated-FRI-proof aggregated_FRI_proof.bin \ | ||
--proof final-proof.dat | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/bin/sh | ||
|
||
# This suite expects that circuits are extracted into "circuits-and-assignments" directory | ||
# You can get these from https://github.com/NilFoundation/zkLLVM/actions | ||
# Pick latest pipeline run from master, scroll down to "Artifacts" section and | ||
# download zip. The size (10Gb) is of unpacked data, downloaded archive is 100Mb or so. | ||
|
||
CIRCUIT1=fri_array_swap | ||
CIRCUIT2=merkle_tree_poseidon_cpp_example | ||
|
||
echo "[33;1m === STAGE 00 === [0m" | ||
./00-preprocessor.sh $CIRCUIT1 | ||
./00-preprocessor.sh $CIRCUIT2 | ||
|
||
echo "[33;1m === STAGE 01 === [0m" | ||
./01-partial-proof.sh $CIRCUIT1 | ||
./01-partial-proof.sh $CIRCUIT2 | ||
|
||
echo "[33;1m === STAGE 02 === [0m" | ||
./02-gen-challenges.sh | ||
|
||
echo "[33;1m === STAGE 03 === [0m" | ||
./03-compute-combined-Q.sh $CIRCUIT1 0 | ||
./03-compute-combined-Q.sh $CIRCUIT2 `cat $CIRCUIT1-theta-power.txt` | ||
|
||
echo "[33;1m === STAGE 04 === [0m" | ||
./04-aggregated-FRI.sh | ||
|
||
echo "[33;1m === STAGE 05 === [0m" | ||
./05-consistency-checks.sh $CIRCUIT1 | ||
./05-consistency-checks.sh $CIRCUIT2 | ||
|
||
echo "[33;1m === STAGE 06 === [0m" | ||
./06-merge-proofs.sh | ||
|
||
|
||
|