From 1f1ff45561f5af16c060985247adb3a80940d998 Mon Sep 17 00:00:00 2001 From: Sagar Dhawan Date: Fri, 23 Aug 2024 14:59:16 -0700 Subject: [PATCH] fix evm-verifier and fmt --- jolt-evm-verifier/script/Cargo.toml | 1 + .../script/src/bin/autogenerate_r1cs.rs | 2 +- .../script/src/bin/grand_product_example.rs | 17 ++++++----------- .../script/src/bin/hyperkzg_batch_example.rs | 2 +- .../script/src/bin/hyperkzg_example.rs | 2 +- .../script/src/bin/transcript_example.rs | 2 +- jolt-sdk/Cargo.toml | 3 ++- jolt-svm-verifier/program/Cargo.toml | 2 -- 8 files changed, 13 insertions(+), 18 deletions(-) diff --git a/jolt-evm-verifier/script/Cargo.toml b/jolt-evm-verifier/script/Cargo.toml index 8ae8ca3ec..b9ab4b2c9 100644 --- a/jolt-evm-verifier/script/Cargo.toml +++ b/jolt-evm-verifier/script/Cargo.toml @@ -16,6 +16,7 @@ ark-serialize = "0.4.2" ark-ec = "0.4.2" ark-std = "0.4.0" jolt-core = { path = "../../jolt-core", package = "jolt-core"} +jolt-types = { path = "../../jolt-types" } rand_core = "0.6.4" rand_chacha = { version = "0.3.0", default-features = false } diff --git a/jolt-evm-verifier/script/src/bin/autogenerate_r1cs.rs b/jolt-evm-verifier/script/src/bin/autogenerate_r1cs.rs index 9137dd56c..aa8ab64e0 100644 --- a/jolt-evm-verifier/script/src/bin/autogenerate_r1cs.rs +++ b/jolt-evm-verifier/script/src/bin/autogenerate_r1cs.rs @@ -1,7 +1,7 @@ use alloy_primitives::hex; -use jolt_core::field::JoltField; use jolt_core::r1cs::key::SparseConstraints; use jolt_core::r1cs::key::SparseEqualityItem; +use jolt_types::field::JoltField; // This code is provided as an example of how to turn the sparse constraints into solidity, and was the base // for the code in R1CSMatrix, however because the key is not expected to change often full auto-generation is not diff --git a/jolt-evm-verifier/script/src/bin/grand_product_example.rs b/jolt-evm-verifier/script/src/bin/grand_product_example.rs index 4989a0eee..d51afb0f2 100644 --- a/jolt-evm-verifier/script/src/bin/grand_product_example.rs +++ b/jolt-evm-verifier/script/src/bin/grand_product_example.rs @@ -1,10 +1,9 @@ use jolt_core::{ - field::JoltField, poly::commitment::hyperkzg::HyperKZG, subprotocols::grand_product::{BatchedDenseGrandProduct, BatchedGrandProduct}, - utils::transcript::ProofTranscript, - utils::sol_types::GrandProductProof + utils::sol_types::GrandProductProof, }; +use jolt_types::{field::JoltField, utils::transcript::ProofTranscript}; use std::env; use alloy_primitives::{hex, U256}; @@ -20,10 +19,9 @@ fn get_proof_data(batched_circuit: &mut BatchedDenseGrandProduct) { Fr, HyperKZG, >>::prove_grand_product(batched_circuit, &mut transcript, None); - let claims = - as BatchedGrandProduct>>::claims( - batched_circuit, - ); + let claims = as BatchedGrandProduct>>::claims( + batched_circuit, + ); //encoding the proof into abi @@ -33,10 +31,7 @@ fn get_proof_data(batched_circuit: &mut BatchedDenseGrandProduct) { uint256[] r_prover; }); - let r_prover = r_prover - .iter() - .map(fr_to_uint256) - .collect::>(); + let r_prover = r_prover.iter().map(fr_to_uint256).collect::>(); let claims = claims.iter().map(fr_to_uint256).collect::>(); diff --git a/jolt-evm-verifier/script/src/bin/hyperkzg_batch_example.rs b/jolt-evm-verifier/script/src/bin/hyperkzg_batch_example.rs index f2dbd349e..27bb4411e 100644 --- a/jolt-evm-verifier/script/src/bin/hyperkzg_batch_example.rs +++ b/jolt-evm-verifier/script/src/bin/hyperkzg_batch_example.rs @@ -9,7 +9,7 @@ use ark_std::UniformRand; use jolt_core::poly::commitment::commitment_scheme::{BatchType, CommitmentScheme}; use jolt_core::poly::commitment::hyperkzg::*; use jolt_core::poly::dense_mlpoly::DensePolynomial; -use jolt_core::utils::transcript::ProofTranscript; +use jolt_types::utils::transcript::ProofTranscript; use rand_core::SeedableRng; use jolt_core::utils::sol_types::{HyperKZGProofSol, VK}; diff --git a/jolt-evm-verifier/script/src/bin/hyperkzg_example.rs b/jolt-evm-verifier/script/src/bin/hyperkzg_example.rs index 8e2ed2147..c3602f10b 100644 --- a/jolt-evm-verifier/script/src/bin/hyperkzg_example.rs +++ b/jolt-evm-verifier/script/src/bin/hyperkzg_example.rs @@ -8,7 +8,7 @@ use ark_ff::PrimeField; use ark_std::UniformRand; use jolt_core::poly::commitment::hyperkzg::*; use jolt_core::poly::dense_mlpoly::DensePolynomial; -use jolt_core::utils::transcript::ProofTranscript; +use jolt_types::utils::transcript::ProofTranscript; use rand_core::SeedableRng; use jolt_core::utils::sol_types::{HyperKZGProofSol, VK}; diff --git a/jolt-evm-verifier/script/src/bin/transcript_example.rs b/jolt-evm-verifier/script/src/bin/transcript_example.rs index 9e2847059..9dd5981ae 100644 --- a/jolt-evm-verifier/script/src/bin/transcript_example.rs +++ b/jolt-evm-verifier/script/src/bin/transcript_example.rs @@ -1,4 +1,4 @@ -use jolt_core::{field::JoltField, utils::transcript::ProofTranscript}; +use jolt_types::{field::JoltField, utils::transcript::ProofTranscript}; use ark_ff::{BigInteger, PrimeField}; diff --git a/jolt-sdk/Cargo.toml b/jolt-sdk/Cargo.toml index 76389d657..9cf6f04d6 100644 --- a/jolt-sdk/Cargo.toml +++ b/jolt-sdk/Cargo.toml @@ -17,6 +17,7 @@ host = [ "dep:tracer", "dep:common", "dep:jolt-core", + "dep:jolt-types", "dep:ark-ec", "dep:ark-ff", "dep:ark-bn254", @@ -42,6 +43,6 @@ ark-serialize = { version = "0.4.2", features = ["derive"], optional = true } jolt-sdk-macros = { path = "./macros" } jolt-core = { path = "../jolt-core", optional = true } -jolt-types = { path = "../jolt-types" } +jolt-types = { path = "../jolt-types", optional = true } tracer = { path = "../tracer", optional = true } common = { path = "../common", optional = true } diff --git a/jolt-svm-verifier/program/Cargo.toml b/jolt-svm-verifier/program/Cargo.toml index 4bdaf9369..f115b5c03 100644 --- a/jolt-svm-verifier/program/Cargo.toml +++ b/jolt-svm-verifier/program/Cargo.toml @@ -5,8 +5,6 @@ description = "SVM program to verify JOLT proofs" edition = "2021" [workspace] -members = [ -] [lib] crate-type = ["cdylib", "lib"]