Skip to content

Commit 6c9efe3

Browse files
authored
Merge pull request #3011 from ProvableHQ/allow_tests_to_skip_proofs
Skip proof and certificate generation and verification if building with dev_skip_checks
2 parents ea28380 + 88413db commit 6c9efe3

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ dev_skip_checks = [
175175
save_r1cs_hashes = [ "snarkvm-circuit/save_r1cs_hashes" ]
176176
test_exports = [ "snarkvm-algorithms/test_exports" ]
177177
test_targets = [ "snarkvm-console/test_targets" ]
178-
test_consensus_heights = [ "snarkvm-console/test_consensus_heights" ]
178+
test_consensus_heights = [ "snarkvm-console/test_consensus_heights", "snarkvm-synthesizer/test_consensus_heights" ]
179179

180180
[workspace.dependencies.snarkvm-algorithms]
181181
path = "algorithms"

synthesizer/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ wasm = [
6060
]
6161
dev-print = [ "snarkvm-utilities/dev-print" ]
6262
dev_skip_checks = [ "snarkvm-synthesizer-process/dev_skip_checks" ]
63+
test_consensus_heights = [ "snarkvm-synthesizer-process/test_consensus_heights" ]
6364

6465
[[bench]]
6566
name = "kary_merkle_tree"

synthesizer/process/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ test = [ "snarkvm-console/test" ]
4747
timer = [ "aleo-std/timer" ]
4848
dev-print = [ "snarkvm-utilities/dev-print" ]
4949
dev_skip_checks = [ ]
50+
test_consensus_heights = [ ]
5051

5152
[[bench]]
5253
name = "stack_operations"

synthesizer/process/src/stack/deploy.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,18 @@ impl<N: Network> Stack<N> {
6464
) -> Result<()> {
6565
let timer = timer!("Stack::verify_deployment");
6666

67+
// NOTE: As developer, you will likely still want to confirm that your
68+
// deployment is within R1CS constraint and variable limits using
69+
// targeted and parallelized synthesis.
70+
if cfg!(all(feature = "dev_skip_checks", feature = "test_consensus_heights")) {
71+
return Ok(());
72+
}
73+
6774
// Sanity Checks //
6875

6976
// Ensure the deployment is ordered.
7077
deployment.check_is_ordered()?;
78+
7179
// Ensure the program in the stack and deployment matches.
7280
ensure!(&self.program == deployment.program(), "The stack program does not match the deployment program");
7381
// If the deployment contains a checksum, ensure it matches the one computed by the stack.

synthesizer/process/src/trace/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ impl<N: Network> Trace<N> {
237237
verifier_inputs: Vec<(VerifyingKey<N>, Vec<Vec<N::Field>>)>,
238238
execution: &Execution<N>,
239239
) -> Result<()> {
240-
if cfg!(feature = "dev_skip_checks") {
240+
if cfg!(all(feature = "dev_skip_checks", feature = "test_consensus_heights")) {
241241
return Ok(());
242242
}
243243
// Retrieve the global state root.
@@ -271,7 +271,7 @@ impl<N: Network> Trace<N> {
271271
verifier_inputs: (VerifyingKey<N>, Vec<Vec<N::Field>>),
272272
fee: &Fee<N>,
273273
) -> Result<()> {
274-
if cfg!(feature = "dev_skip_checks") {
274+
if cfg!(all(feature = "dev_skip_checks", feature = "test_consensus_heights")) {
275275
return Ok(());
276276
}
277277
// Retrieve the global state root.

0 commit comments

Comments
 (0)