Skip to content
This repository has been archived by the owner on Aug 16, 2024. It is now read-only.

Commit

Permalink
naive snark circuit and pow bits for compression wrapper
Browse files Browse the repository at this point in the history
  • Loading branch information
saitima committed Aug 8, 2024
1 parent a6dff2e commit d3ae2d1
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ 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
19 changes: 14 additions & 5 deletions circuit_definitions/src/circuit_definitions/aux_layer/mod.rs
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;

Check failure on line 19 in circuit_definitions/src/circuit_definitions/aux_layer/mod.rs

View workflow job for this annotation

GitHub Actions / cargo build

unresolved import `snark_wrapper::verifier::WrapperCircuitWidth3NoLookupNoCustomGate`

use crate::ProofConfig;

Expand Down Expand Up @@ -422,19 +423,19 @@ impl ZkSyncCompressionForWrapperCircuit {
use crate::boojum::cs::traits::circuit::CircuitBuilder;
match &self {
Self::CompressionMode1Circuit(..) => {
<CompressionMode1Circuit as CircuitBuilder<GoldilocksField>>::geometry()
<CompressionMode1ForWrapperCircuit as CircuitBuilder<GoldilocksField>>::geometry()
}
Self::CompressionMode2Circuit(..) => {
<CompressionMode2Circuit as CircuitBuilder<GoldilocksField>>::geometry()
<CompressionMode2ForWrapperCircuit as CircuitBuilder<GoldilocksField>>::geometry()
}
Self::CompressionMode3Circuit(..) => {
<CompressionMode3Circuit as CircuitBuilder<GoldilocksField>>::geometry()
<CompressionMode3ForWrapperCircuit as CircuitBuilder<GoldilocksField>>::geometry()
}
Self::CompressionMode4Circuit(..) => {
<CompressionMode4Circuit as CircuitBuilder<GoldilocksField>>::geometry()
<CompressionMode4ForWrapperCircuit as CircuitBuilder<GoldilocksField>>::geometry()
}
Self::CompressionMode5Circuit(..) => {
<CompressionMode5Circuit as CircuitBuilder<GoldilocksField>>::geometry()
<CompressionMode5ForWrapperCircuit as CircuitBuilder<GoldilocksField>>::geometry()
}
}
}
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

0 comments on commit d3ae2d1

Please sign in to comment.