Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(blockifier): add entry point execution logic for native #1158

Merged
merged 9 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
SEED: 0

codecov:
runs-on: starkware-ubuntu-latest-medium
runs-on: starkware-ubuntu-latest-large
steps:
- uses: actions/checkout@v4
with:
Expand Down
109 changes: 55 additions & 54 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions crates/blockifier/src/execution/errors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::collections::HashSet;

use cairo_native::error::Error as NativeError;
use cairo_vm::types::builtin_name::BuiltinName;
use cairo_vm::types::errors::math_errors::MathError;
use cairo_vm::vm::errors::cairo_run_errors::CairoRunError;
Expand Down Expand Up @@ -88,6 +89,8 @@ pub enum EntryPointExecutionError {
#[error("Invalid input: {input_descriptor}; {info}")]
InvalidExecutionInput { input_descriptor: String, info: String },
#[error(transparent)]
NativeUnexpectedError(#[from] NativeError),
#[error(transparent)]
PostExecutionError(#[from] PostExecutionError),
#[error(transparent)]
PreExecutionError(#[from] PreExecutionError),
Expand Down
16 changes: 11 additions & 5 deletions crates/blockifier/src/execution/execution_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ use starknet_api::deprecated_contract_class::Program as DeprecatedProgram;
use starknet_api::transaction::Calldata;
use starknet_types_core::felt::Felt;

use super::entry_point::ConstructorEntryPointExecutionResult;
use super::errors::ConstructorEntryPointExecutionError;
use crate::execution::call_info::{CallInfo, Retdata};
use crate::execution::contract_class::{ContractClass, TrackedResource};
use crate::execution::entry_point::{
execute_constructor_entry_point,
CallEntryPoint,
ConstructorContext,
ConstructorEntryPointExecutionResult,
EntryPointExecutionContext,
EntryPointExecutionResult,
};
use crate::execution::errors::PostExecutionError;
use crate::execution::errors::{ConstructorEntryPointExecutionError, PostExecutionError};
use crate::execution::native::entry_point_execution as native_entry_point_execution;
use crate::execution::{deprecated_entry_point_execution, entry_point_execution};
use crate::state::errors::StateError;
use crate::state::state_api::State;
Expand Down Expand Up @@ -107,8 +107,14 @@ pub fn execute_entry_point_call(
resources,
context,
),
ContractClass::V1Native(_contract_class) => {
unimplemented!("Native contract entry point execution is not yet implemented.")
ContractClass::V1Native(contract_class) => {
native_entry_point_execution::execute_entry_point_call(
call,
contract_class,
state,
resources,
context,
)
}
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/blockifier/src/execution/native.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
pub mod entry_point_execution;
pub mod syscall_handler;
pub mod utils;

Expand Down
Loading
Loading