Skip to content

Commit 75e91fd

Browse files
minor fixes for ctx
1 parent 0720baa commit 75e91fd

File tree

5 files changed

+9
-5
lines changed

5 files changed

+9
-5
lines changed

crates/proof-compression/src/proof_system/boojum.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,11 @@ where
8686
}
8787

8888
fn init_context(domain_size: Self::ContextConfig) -> anyhow::Result<Self::Context> {
89+
let start = std::time::Instant::now();
8990
let config =
9091
ProverContextConfig::default().with_smallest_supported_domain_size(domain_size);
9192
let context = Self::Context::create_with_config(config).context("gpu prover context");
92-
93+
println!("compression ctx initialization takes {:?}", start.elapsed());
9394
context
9495
}
9596
fn get_context_config_from_hint(hint: &Self::FinalizationHint) -> Self::ContextConfig {

crates/proof-compression/src/proof_system/fflonk.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,14 @@ impl SnarkWrapperProofSystem for FflonkSnarkWrapper {
7878
}
7979

8080
fn init_context(compact_raw_crs: &Self::CRS) -> anyhow::Result<Self::Context> {
81+
let start = std::time::Instant::now();
8182
let domain_size = 1 << ::fflonk::fflonk_cpu::L1_VERIFIER_DOMAIN_SIZE_LOG;
8283
let context = DeviceContextWithSingleDevice::init_from_preloaded_crs::<Self::Allocator>(
8384
domain_size,
8485
compact_raw_crs,
8586
)
8687
.unwrap();
88+
println!("fflonk ctx initialization takes {:?}", start.elapsed());
8789
Ok(context)
8890
}
8991

@@ -143,7 +145,7 @@ impl SnarkWrapperProofSystemExt for FflonkSnarkWrapper {
143145
}
144146

145147
fn generate_precomputation_and_vk(
146-
_ctx: &Self::Context,
148+
ctx: Self::Context,
147149
setup_assembly: Self::SetupAssembly,
148150
_hardcoded_finalization_hint: Self::FinalizationHint,
149151
) -> anyhow::Result<(Self::Precomputation, Self::VK)> {
@@ -158,6 +160,7 @@ impl SnarkWrapperProofSystemExt for FflonkSnarkWrapper {
158160
)
159161
})?;
160162
let vk = device_setup.get_verification_key();
163+
drop(ctx);
161164
Ok((
162165
FflonkSnarkVerifierCircuitDeviceSetupWrapper(device_setup),
163166
vk,

crates/proof-compression/src/proof_system/interface.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ pub trait SnarkWrapperProofSystemExt: SnarkWrapperProofSystem {
107107
type SetupAssembly;
108108
fn synthesize_for_setup(circuit: Self::Circuit) -> Self::SetupAssembly;
109109
fn generate_precomputation_and_vk(
110-
_: &Self::Context,
110+
_: Self::Context,
111111
_: Self::SetupAssembly,
112112
_: Self::FinalizationHint,
113113
) -> anyhow::Result<(Self::Precomputation, Self::VK)>;

crates/proof-compression/src/proof_system/plonk.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ impl SnarkWrapperProofSystemExt for PlonkSnarkWrapper {
274274
}
275275

276276
fn generate_precomputation_and_vk(
277-
_: &Self::Context,
277+
_: Self::Context,
278278
_: Self::SetupAssembly,
279279
_: Self::FinalizationHint,
280280
) -> anyhow::Result<(Self::Precomputation, Self::VK)> {

crates/proof-compression/src/step/snark_wrapper.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pub trait SnarkWrapperStepExt: SnarkWrapperProofSystemExt + SnarkWrapperStep {
134134
let ctx = <Self as SnarkWrapperProofSystem>::init_context(&crs)?;
135135
let (precomputation, vk) =
136136
<Self as SnarkWrapperProofSystemExt>::generate_precomputation_and_vk(
137-
&ctx,
137+
ctx,
138138
setup_assembly,
139139
finalization_hint,
140140
)?;

0 commit comments

Comments
 (0)