From a2e93a4bbd85ec1acf9caa1484053cb6a3589946 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 18 Dec 2024 17:33:00 +0100 Subject: [PATCH 1/3] rm final_pc check --- crates/air/src/layout/dex/mod.rs | 2 +- crates/air/src/layout/dynamic/mod.rs | 2 +- crates/air/src/layout/recursive/mod.rs | 2 +- crates/air/src/layout/recursive_with_poseidon/mod.rs | 2 +- crates/air/src/layout/small/mod.rs | 2 +- crates/air/src/layout/starknet/mod.rs | 2 +- crates/air/src/layout/starknet_with_keccak/mod.rs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/crates/air/src/layout/dex/mod.rs b/crates/air/src/layout/dex/mod.rs index 38aa76e..2307134 100644 --- a/crates/air/src/layout/dex/mod.rs +++ b/crates/air/src/layout/dex/mod.rs @@ -395,7 +395,7 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); + // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/dynamic/mod.rs b/crates/air/src/layout/dynamic/mod.rs index b6b1bd7..5f40d39 100644 --- a/crates/air/src/layout/dynamic/mod.rs +++ b/crates/air/src/layout/dynamic/mod.rs @@ -768,7 +768,7 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); + // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/recursive/mod.rs b/crates/air/src/layout/recursive/mod.rs index c49abd7..734aad2 100644 --- a/crates/air/src/layout/recursive/mod.rs +++ b/crates/air/src/layout/recursive/mod.rs @@ -395,7 +395,7 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); + // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/recursive_with_poseidon/mod.rs b/crates/air/src/layout/recursive_with_poseidon/mod.rs index 8ca2f3e..f846a8a 100644 --- a/crates/air/src/layout/recursive_with_poseidon/mod.rs +++ b/crates/air/src/layout/recursive_with_poseidon/mod.rs @@ -452,7 +452,7 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); + // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/small/mod.rs b/crates/air/src/layout/small/mod.rs index 57ce80a..cb61719 100644 --- a/crates/air/src/layout/small/mod.rs +++ b/crates/air/src/layout/small/mod.rs @@ -395,7 +395,7 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); + // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/starknet/mod.rs b/crates/air/src/layout/starknet/mod.rs index 8542fec..b3caa41 100644 --- a/crates/air/src/layout/starknet/mod.rs +++ b/crates/air/src/layout/starknet/mod.rs @@ -522,7 +522,7 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); + // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/starknet_with_keccak/mod.rs b/crates/air/src/layout/starknet_with_keccak/mod.rs index a199264..d1e7bac 100644 --- a/crates/air/src/layout/starknet_with_keccak/mod.rs +++ b/crates/air/src/layout/starknet_with_keccak/mod.rs @@ -571,7 +571,7 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); + // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; From c139c32c07f97262f4b141bb301e2af2d5a192fb Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 18 Dec 2024 17:35:00 +0100 Subject: [PATCH 2/3] fmt&clippy --- crates/air/src/layout/dex/mod.rs | 5 +---- crates/air/src/layout/dynamic/mod.rs | 5 +---- crates/air/src/layout/recursive/mod.rs | 5 +---- crates/air/src/layout/recursive_with_poseidon/mod.rs | 5 +---- crates/air/src/layout/small/mod.rs | 5 +---- crates/air/src/layout/starknet/mod.rs | 5 +---- crates/air/src/layout/starknet_with_keccak/mod.rs | 5 +---- 7 files changed, 7 insertions(+), 28 deletions(-) diff --git a/crates/air/src/layout/dex/mod.rs b/crates/air/src/layout/dex/mod.rs index 2307134..0a9eaa4 100644 --- a/crates/air/src/layout/dex/mod.rs +++ b/crates/air/src/layout/dex/mod.rs @@ -360,10 +360,7 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let final_pc = public_segments - .get(segments::PROGRAM) - .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? - .stop_ptr; + let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? diff --git a/crates/air/src/layout/dynamic/mod.rs b/crates/air/src/layout/dynamic/mod.rs index 5f40d39..5d090eb 100644 --- a/crates/air/src/layout/dynamic/mod.rs +++ b/crates/air/src/layout/dynamic/mod.rs @@ -733,10 +733,7 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let final_pc = public_segments - .get(segments::PROGRAM) - .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? - .stop_ptr; + let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? diff --git a/crates/air/src/layout/recursive/mod.rs b/crates/air/src/layout/recursive/mod.rs index 734aad2..5db26ec 100644 --- a/crates/air/src/layout/recursive/mod.rs +++ b/crates/air/src/layout/recursive/mod.rs @@ -360,10 +360,7 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let final_pc = public_segments - .get(segments::PROGRAM) - .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? - .stop_ptr; + let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? diff --git a/crates/air/src/layout/recursive_with_poseidon/mod.rs b/crates/air/src/layout/recursive_with_poseidon/mod.rs index f846a8a..126345b 100644 --- a/crates/air/src/layout/recursive_with_poseidon/mod.rs +++ b/crates/air/src/layout/recursive_with_poseidon/mod.rs @@ -417,10 +417,7 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let final_pc = public_segments - .get(segments::PROGRAM) - .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? - .stop_ptr; + let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? diff --git a/crates/air/src/layout/small/mod.rs b/crates/air/src/layout/small/mod.rs index cb61719..161ddf2 100644 --- a/crates/air/src/layout/small/mod.rs +++ b/crates/air/src/layout/small/mod.rs @@ -360,10 +360,7 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let final_pc = public_segments - .get(segments::PROGRAM) - .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? - .stop_ptr; + let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? diff --git a/crates/air/src/layout/starknet/mod.rs b/crates/air/src/layout/starknet/mod.rs index b3caa41..30aab2b 100644 --- a/crates/air/src/layout/starknet/mod.rs +++ b/crates/air/src/layout/starknet/mod.rs @@ -487,10 +487,7 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let final_pc = public_segments - .get(segments::PROGRAM) - .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? - .stop_ptr; + let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? diff --git a/crates/air/src/layout/starknet_with_keccak/mod.rs b/crates/air/src/layout/starknet_with_keccak/mod.rs index d1e7bac..8609878 100644 --- a/crates/air/src/layout/starknet_with_keccak/mod.rs +++ b/crates/air/src/layout/starknet_with_keccak/mod.rs @@ -536,10 +536,7 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let final_pc = public_segments - .get(segments::PROGRAM) - .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? - .stop_ptr; + let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? From 742f301d0db7401ed31ed96d02fc95b1a8a44a08 Mon Sep 17 00:00:00 2001 From: Bartosz Nowak Date: Wed, 18 Dec 2024 17:42:38 +0100 Subject: [PATCH 3/3] cleanup --- crates/air/src/layout/dex/mod.rs | 2 -- crates/air/src/layout/dynamic/mod.rs | 2 -- crates/air/src/layout/recursive/mod.rs | 2 -- crates/air/src/layout/recursive_with_poseidon/mod.rs | 2 -- crates/air/src/layout/small/mod.rs | 2 -- crates/air/src/layout/starknet/mod.rs | 2 -- crates/air/src/layout/starknet_with_keccak/mod.rs | 2 -- 7 files changed, 14 deletions(-) diff --git a/crates/air/src/layout/dex/mod.rs b/crates/air/src/layout/dex/mod.rs index 0a9eaa4..80de416 100644 --- a/crates/air/src/layout/dex/mod.rs +++ b/crates/air/src/layout/dex/mod.rs @@ -360,7 +360,6 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? @@ -392,7 +391,6 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/dynamic/mod.rs b/crates/air/src/layout/dynamic/mod.rs index 5d090eb..91eaad5 100644 --- a/crates/air/src/layout/dynamic/mod.rs +++ b/crates/air/src/layout/dynamic/mod.rs @@ -733,7 +733,6 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? @@ -765,7 +764,6 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/recursive/mod.rs b/crates/air/src/layout/recursive/mod.rs index 5db26ec..bfb7e55 100644 --- a/crates/air/src/layout/recursive/mod.rs +++ b/crates/air/src/layout/recursive/mod.rs @@ -360,7 +360,6 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? @@ -392,7 +391,6 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/recursive_with_poseidon/mod.rs b/crates/air/src/layout/recursive_with_poseidon/mod.rs index 126345b..c948227 100644 --- a/crates/air/src/layout/recursive_with_poseidon/mod.rs +++ b/crates/air/src/layout/recursive_with_poseidon/mod.rs @@ -417,7 +417,6 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? @@ -449,7 +448,6 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/small/mod.rs b/crates/air/src/layout/small/mod.rs index 161ddf2..99952cb 100644 --- a/crates/air/src/layout/small/mod.rs +++ b/crates/air/src/layout/small/mod.rs @@ -360,7 +360,6 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? @@ -392,7 +391,6 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/starknet/mod.rs b/crates/air/src/layout/starknet/mod.rs index 30aab2b..bf239e1 100644 --- a/crates/air/src/layout/starknet/mod.rs +++ b/crates/air/src/layout/starknet/mod.rs @@ -487,7 +487,6 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? @@ -519,7 +518,6 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2; diff --git a/crates/air/src/layout/starknet_with_keccak/mod.rs b/crates/air/src/layout/starknet_with_keccak/mod.rs index 8609878..5c91c87 100644 --- a/crates/air/src/layout/starknet_with_keccak/mod.rs +++ b/crates/air/src/layout/starknet_with_keccak/mod.rs @@ -536,7 +536,6 @@ impl LayoutTrait for Layout { .get(segments::PROGRAM) .ok_or(PublicInputError::SegmentMissing { segment: segments::PROGRAM })? .begin_addr; - let initial_ap = public_segments .get(segments::EXECUTION) .ok_or(PublicInputError::SegmentMissing { segment: segments::EXECUTION })? @@ -568,7 +567,6 @@ impl LayoutTrait for Layout { .collect::>(); ensure!(initial_pc == INITIAL_PC, PublicInputError::MaxSteps); - // ensure!(final_pc == INITIAL_PC + FELT_4, PublicInputError::MaxSteps); let program_end_pc = initial_fp - FELT_2;