Skip to content

Commit aff094e

Browse files
workspace,starknet_proof_verifier: bump privacy-{prove,circuit-verify} to 039e52c, add v0/v1 aliases
Picks up the keccak builtin simulation in the privacy bootloader (starkware-libs/proving-utils#342 by @yuvalg), allowing virtual-OS proofs that exercise the keccak builtin to be generated and verified. Renames the workspace alias `privacy-circuit-verify` to `privacy-circuit-verify-v1` (with `package = "privacy-circuit-verify"`) to match the existing `privacy-circuit-verify-v0` sibling and the `ProofVersion::{V0, V1}` enum naming; the proof verifier dispatches on proof version and uses the corresponding alias. Regenerates the example proof fixtures (`apollo_transaction_converter/resources/example_proof.bin` and the `0.14.3` regression copy in `starknet_proof_verifier/resources/regression_test/0.14.3/`) against the new prover output. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent ec3cbda commit aff094e

8 files changed

Lines changed: 348 additions & 101 deletions

File tree

Cargo.lock

Lines changed: 317 additions & 87 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ paste = "1.0.15"
334334
phf = "0.11"
335335
pretty_assertions = "1.4.0"
336336
primitive-types = "0.12.1"
337-
privacy-circuit-verify = { git = "https://github.com/starkware-libs/proving-utils", rev = "580135e" }
338-
privacy-prove = { git = "https://github.com/starkware-libs/proving-utils", rev = "580135e" }
337+
privacy-circuit-verify-v0 = { package = "privacy-circuit-verify", git = "https://github.com/starkware-libs/proving-utils", rev = "580135e" }
338+
privacy-circuit-verify-v1 = { package = "privacy-circuit-verify", git = "https://github.com/starkware-libs/proving-utils", rev = "039e52c" }
339+
privacy-prove = { git = "https://github.com/starkware-libs/proving-utils", rev = "039e52c" }
339340
proc-macro2 = "1.0"
340341
prometheus-parse = "0.2.4"
341342
prost = "0.12.1"
2.23 KB
Binary file not shown.

crates/starknet_proof_verifier/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ workspace = true
1111

1212
[dependencies]
1313
apollo_sizeof.workspace = true
14-
privacy-circuit-verify.workspace = true
14+
privacy-circuit-verify-v0.workspace = true
15+
privacy-circuit-verify-v1.workspace = true
1516
serde = { workspace = true, features = ["derive"] }
1617
starknet-types-core.workspace = true
1718
starknet_api.workspace = true
Binary file not shown.

crates/starknet_proof_verifier/src/proof_verifier.rs

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
use std::sync::Arc;
44

55
use apollo_sizeof::SizeOf;
6-
use privacy_circuit_verify::{verify_recursive_circuit, PrivacyProofOutput};
76
use serde::{Deserialize, Serialize};
87
use starknet_api::transaction::fields::{Proof, ProofFacts, ProofVersion};
98
use starknet_types_core::felt::Felt;
@@ -124,25 +123,41 @@ pub fn reconstruct_output_preimage(
124123

125124
/// Verifies a submitted proof against the proof facts using the circuit verifier.
126125
///
127-
/// Accepts either V0 (legacy) or V1 (current) proof versions. Both currently resolve to the same
128-
/// upstream circuit revision. When the V1 circuit revision is bumped, V0 verification should be
129-
/// routed to a `privacy-circuit-verify-legacy` alias pinned to the old revision.
126+
/// Dispatches on the first element of `proof_facts`:
127+
/// - V0 → `privacy-circuit-verify-v0` (pinned to the previous upstream revision).
128+
/// - V1 → `privacy-circuit-verify-v1` (current upstream revision).
130129
pub fn verify_proof(proof_facts: ProofFacts, proof: Proof) -> Result<(), VerifyProofError> {
131130
// Reject empty proof payloads before running the verifier.
132131
if proof.is_empty() {
133132
return Err(VerifyProofError::EmptyProof);
134133
}
135134

136135
let proof_version_felt = proof_facts.0.first().copied().unwrap_or_default();
137-
let _proof_version = ProofVersion::try_from(proof_version_felt)
136+
let proof_version = ProofVersion::try_from(proof_version_felt)
138137
.map_err(|()| VerifyProofError::InvalidProofVersion { actual: proof_version_felt })?;
139138

140-
// Reconstruct the output preimage from proof facts and verify the proof.
141139
let output_preimage = reconstruct_output_preimage(&proof_facts)?;
142140
// TODO(Avi): Avoid cloning the proof.
143-
let proof_output = PrivacyProofOutput { proof: proof.0.to_vec(), output_preimage };
144-
verify_recursive_circuit(&proof_output)
145-
.map_err(|e| VerifyProofError::Verification(e.to_string()))?;
141+
let proof_bytes = proof.0.to_vec();
142+
143+
match proof_version {
144+
ProofVersion::V0 => {
145+
let proof_output = privacy_circuit_verify_v0::PrivacyProofOutput {
146+
proof: proof_bytes,
147+
output_preimage,
148+
};
149+
privacy_circuit_verify_v0::verify_recursive_circuit(&proof_output)
150+
.map_err(|e| VerifyProofError::Verification(e.to_string()))?;
151+
}
152+
ProofVersion::V1 => {
153+
let proof_output = privacy_circuit_verify_v1::PrivacyProofOutput {
154+
proof: proof_bytes,
155+
output_preimage,
156+
};
157+
privacy_circuit_verify_v1::verify_recursive_circuit(&proof_output)
158+
.map_err(|e| VerifyProofError::Verification(e.to_string()))?;
159+
}
160+
}
146161

147162
Ok(())
148163
}

crates/starknet_transaction_prover/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ blockifier_test_utils.workspace = true
6767
flate2.workspace = true
6868
jsonschema.workspace = true
6969
mockito.workspace = true
70-
privacy-circuit-verify.workspace = true
70+
privacy-circuit-verify-v1.workspace = true
7171
reqwest.workspace = true
7272
rstest.workspace = true
7373
serde = { workspace = true, features = ["derive"] }

crates/starknet_transaction_prover/src/proving/prover_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::sync::Arc;
33

44
use apollo_infra_utils::path::resolve_project_relative_path;
55
use cairo_vm::vm::runners::cairo_pie::CairoPie;
6-
use privacy_circuit_verify::{verify_recursive_circuit, PrivacyProofOutput};
6+
use privacy_circuit_verify_v1::{verify_recursive_circuit, PrivacyProofOutput};
77
use privacy_prove::{prepare_recursive_prover_precomputes, RecursiveProverPrecomputes};
88
use starknet_api::transaction::fields::VIRTUAL_SNOS;
99
use starknet_proof_verifier::ProgramOutput;

0 commit comments

Comments
 (0)