Skip to content

Commit

Permalink
chore(blockifier): alternate use of casm and native depending on trac…
Browse files Browse the repository at this point in the history
…ked_resource
  • Loading branch information
avivg-starkware committed Oct 30, 2024
1 parent 1545731 commit 0cf8cda
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
24 changes: 17 additions & 7 deletions crates/blockifier/src/execution/execution_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,23 @@ 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) {
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,
)
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/blockifier/src/execution/native/contract_class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl NativeContractClassV1 {
pub struct NativeContractClassV1Inner {
pub executor: AotNativeExecutor,
entry_points_by_type: EntryPointsByType<NativeEntryPoint>,
casm: ContractClassV1,
pub casm: ContractClassV1,
}

impl NativeContractClassV1Inner {
Expand Down

0 comments on commit 0cf8cda

Please sign in to comment.