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

refactor(blockifier): native syscall handler new method params #1380

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

rodrigo-pino
Copy link
Contributor

@rodrigo-pino rodrigo-pino commented Oct 14, 2024

This change is Reviewable

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.

Project coverage is 67.34%. Comparing base (e3165c4) to head (e203e9f).
Report is 34 commits behind head on main.

Files with missing lines Patch % Lines
...fier/src/execution/native/entry_point_execution.rs 0.00% 10 Missing ⚠️
...blockifier/src/execution/native/syscall_handler.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1380       +/-   ##
===========================================
+ Coverage   40.10%   67.34%   +27.23%     
===========================================
  Files          26      102       +76     
  Lines        1895    13690    +11795     
  Branches     1895    13690    +11795     
===========================================
+ Hits          760     9219     +8459     
- Misses       1100     4070     +2970     
- Partials       35      401      +366     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rodrigo-pino rodrigo-pino force-pushed the rdr/add-entry-point-execution branch from 3e9210b to edde72b Compare October 14, 2024 03:42
@rodrigo-pino rodrigo-pino force-pushed the rdr/refactor-native-syscall-handler branch from c782ef6 to fe9fe6d Compare October 14, 2024 03:43
@rodrigo-pino rodrigo-pino added the native integration Related with the integration of Cairo Native into the Blockifier label Oct 14, 2024
Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @rodrigo-pino)


crates/blockifier/src/execution/native/entry_point_execution.rs line 29 at r1 (raw file):

    let syscall_handler: NativeSyscallHandler<'_> =
        NativeSyscallHandler::new(&call, state, resources, context);

Suggestion:

        NativeSyscallHandler::new(call, state, resources, context);

crates/blockifier/src/execution/native/entry_point_execution.rs line 32 at r1 (raw file):

    run_native_executor(&contract_class.executor, function_id, call, syscall_handler)
}

Suggestion:

    run_native_executor(&contract_class.executor, function_id, syscall_handler)
}

crates/blockifier/src/execution/native/entry_point_execution.rs line 38 at r1 (raw file):

    function_id: FunctionId,
    call: CallEntryPoint,
    mut syscall_handler: NativeSyscallHandler<'_>,

Can you use the call in the syscall handler? (see my suggestion below)

Suggestion:

fn run_native_executor(
    native_executor: &AotNativeExecutor,
    function_id: FunctionId,
    mut syscall_handler: NativeSyscallHandler<'_>,

crates/blockifier/src/execution/native/entry_point_execution.rs line 65 at r1 (raw file):

    call: CallEntryPoint,
    call_result: ContractExecutionResult,
    syscall_handler: NativeSyscallHandler<'_>,

Suggestion:

fn create_callinfo(
    call_result: ContractExecutionResult,
    syscall_handler: NativeSyscallHandler<'_>,

crates/blockifier/src/execution/native/syscall_handler.rs line 34 at r1 (raw file):

    pub caller_address: ContractAddress,
    pub contract_address: ContractAddress,
    pub entry_point_selector: Felt,

Suggestion:

    pub context: &'state mut EntryPointExecutionContext,
    pub call: CallEntryPoint

@rodrigo-pino rodrigo-pino force-pushed the rdr/refactor-native-syscall-handler branch from fe9fe6d to 8be2077 Compare October 16, 2024 01:44
@rodrigo-pino rodrigo-pino force-pushed the rdr/add-entry-point-execution branch from 67c4e9c to 76f983f Compare October 16, 2024 13:16
@noaov1 noaov1 deleted the branch main October 21, 2024 07:13
@noaov1 noaov1 closed this Oct 21, 2024
@noaov1 noaov1 reopened this Oct 21, 2024
@noaov1 noaov1 changed the base branch from rdr/add-entry-point-execution to main October 21, 2024 07:17
@rodrigo-pino rodrigo-pino force-pushed the rdr/refactor-native-syscall-handler branch 3 times, most recently from 8cfeaa7 to 576ccaf Compare October 24, 2024 12:32
Copy link
Contributor Author

@rodrigo-pino rodrigo-pino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 0 of 2 files reviewed, 5 unresolved discussions (waiting on @noaov1)


crates/blockifier/src/execution/native/entry_point_execution.rs line 29 at r1 (raw file):

    let syscall_handler: NativeSyscallHandler<'_> =
        NativeSyscallHandler::new(&call, state, resources, context);

Done.


crates/blockifier/src/execution/native/entry_point_execution.rs line 32 at r1 (raw file):

    run_native_executor(&contract_class.executor, function_id, call, syscall_handler)
}

Done.


crates/blockifier/src/execution/native/entry_point_execution.rs line 38 at r1 (raw file):

Previously, noaov1 (Noa Oved) wrote…

Can you use the call in the syscall handler? (see my suggestion below)

Done.


crates/blockifier/src/execution/native/entry_point_execution.rs line 65 at r1 (raw file):

    call: CallEntryPoint,
    call_result: ContractExecutionResult,
    syscall_handler: NativeSyscallHandler<'_>,

Done.


crates/blockifier/src/execution/native/syscall_handler.rs line 34 at r1 (raw file):

    pub caller_address: ContractAddress,
    pub contract_address: ContractAddress,
    pub entry_point_selector: Felt,

Done.

Copy link

Artifacts upload triggered. View details here

@rodrigo-pino rodrigo-pino force-pushed the rdr/refactor-native-syscall-handler branch from 576ccaf to e203e9f Compare October 24, 2024 21:33
Copy link

Artifacts upload triggered. View details here

Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 1 of 2 files at r3, 1 of 1 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @rodrigo-pino)

@noaov1 noaov1 merged commit 8a3b75f into main Oct 28, 2024
12 checks passed
@noaov1 noaov1 deleted the rdr/refactor-native-syscall-handler branch October 28, 2024 07:37
@github-actions github-actions bot locked and limited conversation to collaborators Oct 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
native integration Related with the integration of Cairo Native into the Blockifier
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants