diff --git a/crates/blockifier/src/execution/execution_utils.rs b/crates/blockifier/src/execution/execution_utils.rs index ecd5c20f4b4..0dd162fe4ff 100644 --- a/crates/blockifier/src/execution/execution_utils.rs +++ b/crates/blockifier/src/execution/execution_utils.rs @@ -142,13 +142,24 @@ pub fn execute_entry_point_call( ), #[cfg(feature = "cairo_native")] ContractClass::V1Native(contract_class) => { - native_entry_point_execution::execute_entry_point_call( - call, - contract_class, - state, - resources, - context, - ) + if context.tracked_resource_stack.last() == Some(&TrackedResource::CairoSteps) { + // if CairoSteps are tracked instead of SierraGas, use Casm for all following calling txs. + entry_point_execution::execute_entry_point_call( + call, + contract_class.casm(), + state, + resources, + context, + ) + } else { + native_entry_point_execution::execute_entry_point_call( + call, + contract_class, + state, + resources, + context, + ) + } } } } diff --git a/crates/blockifier/src/execution/native/contract_class.rs b/crates/blockifier/src/execution/native/contract_class.rs index 97cb832a8cb..529070283cc 100644 --- a/crates/blockifier/src/execution/native/contract_class.rs +++ b/crates/blockifier/src/execution/native/contract_class.rs @@ -47,6 +47,10 @@ impl NativeContractClassV1 { pub fn get_entry_point(&self, call: &CallEntryPoint) -> Result { self.entry_points_by_type.get_entry_point(call).map(|ep| ep.function_id) } + + pub fn casm(&self) -> ContractClassV1 { + self.casm.clone() + } } #[derive(Debug)]