From d3ae2d15a8a86297b83b3ef10880e221f6c34f53 Mon Sep 17 00:00:00 2001 From: saitima Date: Thu, 8 Aug 2024 22:33:39 +0300 Subject: [PATCH] naive snark circuit and pow bits for compression wrapper --- .../aux_layer/compression_modes/mod.rs | 2 ++ .../compression_modes/mode_5_for_wrapper.rs | 4 ++-- .../src/circuit_definitions/aux_layer/mod.rs | 19 ++++++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/circuit_definitions/src/circuit_definitions/aux_layer/compression_modes/mod.rs b/circuit_definitions/src/circuit_definitions/aux_layer/compression_modes/mod.rs index f5834965..c5aa533b 100644 --- a/circuit_definitions/src/circuit_definitions/aux_layer/compression_modes/mod.rs +++ b/circuit_definitions/src/circuit_definitions/aux_layer/compression_modes/mod.rs @@ -29,6 +29,8 @@ type R = Poseidon2Goldilocks; type EXT = GoldilocksExt2; type H = GoldilocksPoseidon2Sponge; +pub type CompressionPoWForWrapper = + Poseidon2Sponge, 2, 3>; pub type CompressionTreeHasherForWrapper = Poseidon2Sponge, 2, 3>; pub type CompressionTranscriptForWrapper = diff --git a/circuit_definitions/src/circuit_definitions/aux_layer/compression_modes/mode_5_for_wrapper.rs b/circuit_definitions/src/circuit_definitions/aux_layer/compression_modes/mode_5_for_wrapper.rs index 31b512e8..2a86874b 100644 --- a/circuit_definitions/src/circuit_definitions/aux_layer/compression_modes/mode_5_for_wrapper.rs +++ b/circuit_definitions/src/circuit_definitions/aux_layer/compression_modes/mode_5_for_wrapper.rs @@ -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; @@ -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, } } diff --git a/circuit_definitions/src/circuit_definitions/aux_layer/mod.rs b/circuit_definitions/src/circuit_definitions/aux_layer/mod.rs index 3556ff45..9b56ce6c 100644 --- a/circuit_definitions/src/circuit_definitions/aux_layer/mod.rs +++ b/circuit_definitions/src/circuit_definitions/aux_layer/mod.rs @@ -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; @@ -422,19 +423,19 @@ impl ZkSyncCompressionForWrapperCircuit { use crate::boojum::cs::traits::circuit::CircuitBuilder; match &self { Self::CompressionMode1Circuit(..) => { - >::geometry() + >::geometry() } Self::CompressionMode2Circuit(..) => { - >::geometry() + >::geometry() } Self::CompressionMode3Circuit(..) => { - >::geometry() + >::geometry() } Self::CompressionMode4Circuit(..) => { - >::geometry() + >::geometry() } Self::CompressionMode5Circuit(..) => { - >::geometry() + >::geometry() } } } @@ -657,6 +658,14 @@ pub type ZkSyncSnarkWrapperCircuit = WrapperCircuit< ZkSyncCompressionWrapper, >; +pub type ZkSyncSnarkWrapperCircuitNoLookupCustomGate = WrapperCircuitWidth3NoLookupNoCustomGate< + Bn256, + Poseidon2Sponge, 2, 3>, + CircuitPoseidon2Sponge, + CircuitPoseidon2Transcript, + ZkSyncCompressionWrapper, +>; + use std::sync::Arc; pub type ZkSyncSnarkWrapperProof = ZkSyncCompressionLayerStorage>;