Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
koloz193 committed Nov 29, 2023
1 parent 68058b9 commit f7e44ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/snark_wrapper_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ pub struct L1BatchProofForL1 {
pub scheduler_proof: Proof<Bn256, ZkSyncSnarkWrapperCircuit>,
}

/// Pulls a SNARK proof from storage and verifies is with the supplied verification key.
pub async fn verify_snark_from_storage(
args: &VerifySnarkWrapperArgs,
) -> Result<(Fr, AuxOutputWitnessWrapper), String> {
Expand Down Expand Up @@ -49,6 +50,7 @@ pub async fn generate_solidity_test(args: &GenerateSolidityTestArgs) -> Result<(
Ok(())
}

/// Verifies a SNARK proof with a given verification key, checking the verification key hash if a value is supplied.
pub async fn verify_snark(
snark_vk_scheduler_key_file: String,
mut proof: L1BatchProofForL1,
Expand Down
1 change: 1 addition & 0 deletions src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use std::{env, fs::File, io};

const VERIFICATION_KEY_FILE_GITHUB: &str = "https://raw.githubusercontent.com/matter-labs/era-contracts/main/tools/data/scheduler_key.json";

/// Checks to see if the verification key exists or an update has been requested and downloads it from github if needed.
pub async fn update_verification_key_if_needed(update_verification_key: Option<bool>) {
let file_path = "src/keys/scheduler_key.json";
let file = env::current_dir().unwrap().join(file_path);
Expand Down

0 comments on commit f7e44ea

Please sign in to comment.