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 library_call cairo native syscall #1547

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

PearsonWhite
Copy link
Contributor

@PearsonWhite PearsonWhite commented Oct 23, 2024

Implements library_call in the NativeSyscallHandler.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

Artifacts upload triggered. View details here

@PearsonWhite PearsonWhite added the native integration Related with the integration of Cairo Native into the Blockifier label Oct 23, 2024
Copy link

Artifacts upload triggered. View details here

@rodrigo-pino rodrigo-pino force-pushed the rdr/native-storage-read branch 2 times, most recently from ceff54f to f9d4b21 Compare October 25, 2024 11:55
Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@PearsonWhite PearsonWhite 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, 1 unresolved discussion

a discussion (no related file):
test_nested_library_call fails due to a difference in ExecutionResources when comparing the CallInfo to the expected. The expected CallInfo is the same between the VM and Native. Eventually, these should be the same (right?), but for now it fails. How would you like me to address this? I could change the test to ignore ExecutionResources in the comparison for now, or mark the test as #[ignored]


Copy link
Contributor

@varex83 varex83 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, 1 unresolved discussion (waiting on @PearsonWhite)

a discussion (no related file):

Previously, PearsonWhite wrote…

test_nested_library_call fails due to a difference in ExecutionResources when comparing the CallInfo to the expected. The expected CallInfo is the same between the VM and Native. Eventually, these should be the same (right?), but for now it fails. How would you like me to address this? I could change the test to ignore ExecutionResources in the comparison for now, or mark the test as #[ignored]

I think we can just ignore ExecutionResources check while running Native test


Copy link

Artifacts upload triggered. View details here

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 69.14%. Comparing base (e3165c4) to head (2de1599).
Report is 405 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1547       +/-   ##
===========================================
+ Coverage   40.10%   69.14%   +29.03%     
===========================================
  Files          26      105       +79     
  Lines        1895    13709    +11814     
  Branches     1895    13709    +11814     
===========================================
+ Hits          760     9479     +8719     
- Misses       1100     3827     +2727     
- Partials       35      403      +368     

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

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link
Contributor Author

@PearsonWhite PearsonWhite 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, 1 unresolved discussion (waiting on @varex83)

a discussion (no related file):

Previously, varex83 (Bohdan Ohorodnii) wrote…

I think we can just ignore ExecutionResources check while running Native test

I changed this so our expected_call_info uses the execution resources that are currently being used. This will fail when the gas is changed as long as the gas change is done correctly. At that point, the logic for if_native can be removed and the execution resources can be made the same.


Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link
Contributor

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r9, 2 of 2 files at r10, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noaov1 and @varex83)

Copy link

Artifacts upload triggered. View details here

@varex83 varex83 force-pushed the pwhite/library_call branch from fb9f1f7 to 0b7374c Compare November 13, 2024 12:00
Copy link

Artifacts upload triggered. View details here

Copy link
Contributor

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r10, 1 of 1 files at r11, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noaov1, @varex83, and @Yoni-Starkware)

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware 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 2 of 2 files at r13, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noaov1 and @varex83)

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

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

Dismissed @noaov1 from a discussion.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noaov1 and @varex83)

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware 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: all files reviewed, 3 unresolved discussions (waiting on @noaov1 and @varex83)


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

Previously, PearsonWhite wrote…

I think it's fine like this for now. I expect the error handling for StarknetSyscallHandler to change, and when that happens the return value for execute_inner_call will probably change as well.

.

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

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

Dismissed @noaov1 from a discussion.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @noaov1 and @varex83)

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

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

Dismissed @noaov1 from a discussion.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @noaov1 and @varex83)

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware 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: all files reviewed, 3 unresolved discussions (waiting on @noaov1 and @varex83)

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware 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: all files reviewed, 2 unresolved discussions (waiting on @noaov1 and @varex83)


crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs line 201 at r7 (raw file):

Previously, PearsonWhite wrote…

I forgot to git add this change on the previous update. It should be fixed now.

.

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware 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: all files reviewed, 1 unresolved discussion (waiting on @noaov1 and @varex83)


crates/blockifier/src/execution/syscalls/syscall_tests/library_call.rs line 188 at r7 (raw file):

Previously, PearsonWhite wrote…

It looks like we do account for VM resources in native execution. For example in crates/blockifier/src/execution/entry_point_execution.rs::finalize_execution which get called during the tests.

.

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @varex83)

@Yoni-Starkware Yoni-Starkware merged commit e5f9c57 into main Nov 14, 2024
12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Nov 16, 2024
@meship-starkware meship-starkware deleted the pwhite/library_call branch November 19, 2024 08:49
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.

7 participants