Skip to content

Commit

Permalink
fix(blockifier): remove redundent comment of fn
Browse files Browse the repository at this point in the history
test_stack_overflow that was modved (#3886)
  • Loading branch information
avivg-starkware authored Feb 3, 2025
1 parent bd8a2ba commit 6f2e50a
Showing 1 changed file with 0 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,54 +57,3 @@ fn test_total_tx_limits_less_than_max_sierra_gas() {
<= MAX_POSSIBLE_SIERRA_GAS
);
}

// TODO (AvivG) move this test to Transaction executor

// #[cfg(feature = "cairo_native")]
// #[cfg(feature = "cairo_native")]
// use crate::context::ChainInfo;
// #[cfg(feature = "cairo_native")]
// use crate::test_utils::initial_test_state::test_state;
// #[cfg(feature = "cairo_native")]
// use crate::test_utils::BALANCE;
// #[rstest::rstest]
// #[case(MAX_POSSIBLE_SIERRA_GAS, MAX_POSSIBLE_SIERRA_GAS - 2681170910)]
// #[case(MAX_POSSIBLE_SIERRA_GAS / 10, 81886490)]
// #[case(MAX_POSSIBLE_SIERRA_GAS / 100, 8190940)]
// #[case(MAX_POSSIBLE_SIERRA_GAS / 1000, 822890)]
// #[case(MAX_POSSIBLE_SIERRA_GAS / 10000, 85440)]
// #[case(MAX_POSSIBLE_SIERRA_GAS / 100000, 12340)]
// #[case(MAX_POSSIBLE_SIERRA_GAS / 1000000, 0)]
// #[case(350, 0)]
// #[case(35, 0)]
// #[case(0, 0)]
// /// Tests that Native can handle deep recursion calls without overflowing the stack.
// /// Note that the recursive function must be complicated, since the compiler might transform
// /// simple recursions into loops. The tested function was manually tested with higher gas and
// /// reached stack overflow.
// ///
// /// Also, there is no need to test the VM here since it doesn't use the stack.
// fn test_stack_overflow(#[case] initial_gas: u64, #[case] gas_consumed: u64) {
// let test_contract =
// FeatureContract::TestContract(CairoVersion::Cairo1(RunnableCairo1::Native)); let mut state =
// test_state(&ChainInfo::create_for_testing(), BALANCE, &[(test_contract, 1)]);

// let depth = felt!(1000000_u128);
// let entry_point_call = CallEntryPoint {
// calldata: calldata![depth],
// entry_point_selector: selector_from_name("test_stack_overflow"),
// initial_gas,
// ..trivial_external_entry_point_new(test_contract)
// };
// let call_info = entry_point_call.execute_directly(&mut state).unwrap();
// assert_eq!(
// call_info.execution,
// CallExecution {
// // 'Out of gas'
// retdata: retdata![felt!["0x4f7574206f6620676173"]],
// gas_consumed,
// failed: true,
// ..Default::default()
// }
// );
// }

0 comments on commit 6f2e50a

Please sign in to comment.