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

feat(circuit_definitions): naive snark-wrapper circuit for fflonk #50

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ zkevm_test_harness = { version = "=0.150.8", path = "crates/zkevm_test_harness"
zkevm-assembly = { version = "=0.150.8", path = "crates/zkEVM-assembly" }

# `zksync-crypto` repository
snark_wrapper = "=0.30.2"
bellman = { package = "zksync_bellman", version = "=0.30.2" }
boojum = "=0.30.2"
cs_derive = { package = "zksync_cs_derive", version = "=0.30.2" }
snark_wrapper = "=0.30.3"
bellman = { package = "zksync_bellman", version = "=0.30.3" }
boojum = "=0.30.3"
cs_derive = { package = "zksync_cs_derive", version = "=0.30.3" }

Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type R = Poseidon2Goldilocks;
type EXT = GoldilocksExt2;
type H = GoldilocksPoseidon2Sponge<AbsorptionModeOverwrite>;

pub type CompressionPoWForWrapper = Poseidon2Sponge<Bn256, F, AbsorptionModeReplacement<Fr>, 2, 3>;
pub type CompressionTreeHasherForWrapper =
Poseidon2Sponge<Bn256, F, AbsorptionModeReplacement<Fr>, 2, 3>;
pub type CompressionTranscriptForWrapper =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl ProofCompressionFunction for CompressionMode5ForWrapper {
type PreviousLayerPoW = NoPow;

// no PoW on this step too
type ThisLayerPoW = NoPow;
type ThisLayerPoW = CompressionPoWForWrapper;
type ThisLayerHasher = CompressionTreeHasherForWrapper;
type ThisLayerTranscript = CompressionTranscriptForWrapper;

Expand Down Expand Up @@ -100,7 +100,7 @@ impl ProofCompressionFunction for CompressionMode5ForWrapper {
merkle_tree_cap_size: 8,
fri_folding_schedule: None,
security_level: crate::L1_SECURITY_BITS,
pow_bits: 0,
pow_bits: 8,
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ use crate::zkevm_circuits::recursion::compression::CompressionRecursionConfig;
use snark_wrapper::boojum::config::CSConfig;
use snark_wrapper::boojum::dag::CircuitResolver;
use snark_wrapper::boojum::dag::StCircuitResolver;
use snark_wrapper::verifier::WrapperCircuitWidth3NoLookupNoCustomGate;

use crate::ProofConfig;

Expand Down Expand Up @@ -657,6 +658,14 @@ pub type ZkSyncSnarkWrapperCircuit = WrapperCircuit<
ZkSyncCompressionWrapper,
>;

pub type ZkSyncSnarkWrapperCircuitNoLookupCustomGate = WrapperCircuitWidth3NoLookupNoCustomGate<
Bn256,
Poseidon2Sponge<Bn256, GoldilocksField, AbsorptionModeReplacement<Fr>, 2, 3>,
CircuitPoseidon2Sponge<Bn256, 2, 3, 3, true>,
CircuitPoseidon2Transcript<Bn256, 2, 3, 3, true>,
ZkSyncCompressionWrapper,
>;

use std::sync::Arc;
pub type ZkSyncSnarkWrapperProof =
ZkSyncCompressionLayerStorage<SnarkProof<Bn256, ZkSyncSnarkWrapperCircuit>>;
Expand Down
1 change: 1 addition & 0 deletions crates/zkevm_test_harness/src/snark_wrapper_test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ mod test {
_,
_,
CircuitPoseidon2Transcript<Bn256, 2, 3, 3, true>,
crate::snark_wrapper::traits::pow::NoCircuitPow,
>(
&mut assembly,
(),
Expand Down
Loading