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): update cairo native to 0.2.2-alpha.0 #2076

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

rodrigo-pino
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

@rodrigo-pino rodrigo-pino added the native integration Related with the integration of Cairo Native into the Blockifier label Nov 14, 2024
Copy link

Artifacts upload triggered. View details here

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.30%. Comparing base (e3165c4) to head (8a48ebf).
Report is 482 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2076       +/-   ##
===========================================
+ Coverage   40.10%   77.30%   +37.19%     
===========================================
  Files          26      384      +358     
  Lines        1895    40343    +38448     
  Branches     1895    40343    +38448     
===========================================
+ Hits          760    31187    +30427     
- Misses       1100     6864     +5764     
- Partials       35     2292     +2257     

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


🚨 Try these New Features:

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 4 of 7 files at r1, 2 of 2 files at r2, 2 of 2 files at r3, 8 of 8 files at r4, all commit messages.
Reviewable status: 16 of 18 files reviewed, all discussions resolved

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.

Reviewed 7 of 7 files at r1, 1 of 2 files at r2, 1 of 2 files at r3, 8 of 8 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @rodrigo-pino)


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

    context: &mut EntryPointExecutionContext,
) -> EntryPointExecutionResult<CallInfo> {
    let function_selector = call.entry_point_selector.0;

Please go through .get_entry_point() since it returns an error if the entrypoint is not found.
You can change the return type of this function.

Please add a TODO to test entrypoint-not-found in native.

Code quote:

let function_selector = call.entry_point_selector.0;

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

        &syscall_handler.call.calldata.0.clone(),
        Some(syscall_handler.call.initial_gas.into()),
        // Todo(rodrigo): What should be the builtin costs?

Same as in here:

Code quote:

        // Todo(rodrigo): What should be the builtin costs?

Copy link

Artifacts upload triggered. View details here

Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.804 ms 34.870 ms 34.936 ms]
change: [-4.5350% -2.8563% -1.3978%] (p = 0.00 < 0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild

full_committer_flow performance improved 😺
full_committer_flow time: [29.874 ms 29.916 ms 29.961 ms]
change: [-1.5840% -1.3706% -1.1523%] (p = 0.00 < 0.05)
Performance has improved.
Found 2 outliers among 100 measurements (2.00%)
2 (2.00%) high mild

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: 16 of 19 files reviewed, 3 unresolved discussions (waiting on @meship-starkware and @rodrigo-pino)


crates/blockifier/src/execution/native/contract_class.rs line 20 at r5 (raw file):

impl NativeContractClassV1 {
    pub(crate) fn constructor_selector(&self) -> Option<EntryPointSelector> {
        self.casm.entry_points_by_type.constructor.first().map(|ep| ep.selector)

Suggestion:

self.casm.constructor_selector()

Copy link

Artifacts upload triggered. View details here

Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [33.635 ms 33.666 ms 33.702 ms]
change: [-4.2614% -2.6161% -1.1699%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
4 (4.00%) high mild
6 (6.00%) high severe

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.

Reviewed 2 of 18 files at r6, 2 of 2 files at r8, all commit messages.
Reviewable status: 5 of 21 files reviewed, 3 unresolved discussions (waiting on @meship-starkware and @rodrigo-pino)

Copy link

Artifacts upload triggered. View details here

Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [33.017 ms 33.196 ms 33.391 ms]
change: [-5.0604% -3.4241% -1.9721%] (p = 0.00 < 0.05)
Performance has improved.
Found 6 outliers among 100 measurements (6.00%)
5 (5.00%) high mild
1 (1.00%) high severe

full_committer_flow performance improved 😺
full_committer_flow time: [29.028 ms 29.132 ms 29.233 ms]
change: [-2.8897% -2.1207% -1.4530%] (p = 0.00 < 0.05)
Performance has improved.

Copy link

Artifacts upload triggered. View details here

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: 3 of 21 files reviewed, 3 unresolved discussions (waiting on @meship-starkware and @Yoni-Starkware)


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

Previously, Yoni-Starkware (Yoni) wrote…

Please go through .get_entry_point() since it returns an error if the entrypoint is not found.
You can change the return type of this function.

Please add a TODO to test entrypoint-not-found in native.

Done


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

Previously, Yoni-Starkware (Yoni) wrote…

Same as in here:

Done.


crates/blockifier/src/execution/native/contract_class.rs line 20 at r5 (raw file):

impl NativeContractClassV1 {
    pub(crate) fn constructor_selector(&self) -> Option<EntryPointSelector> {
        self.casm.entry_points_by_type.constructor.first().map(|ep| ep.selector)

constructor_selector is a private class, should I make it public for this instance?

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 18 files at r6, 1 of 2 files at r7, 1 of 14 files at r10, 3 of 13 files at r13, 2 of 2 files at r14, 10 of 10 files at r15, all commit messages.
Reviewable status: 20 of 21 files reviewed, 1 unresolved discussion (waiting on @meship-starkware and @rodrigo-pino)


crates/blockifier/src/execution/native/contract_class.rs line 20 at r5 (raw file):

Previously, rodrigo-pino (Rodrigo) wrote…

constructor_selector is a private class, should I make it public for this instance?

Yes

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: 20 of 21 files reviewed, 1 unresolved discussion (waiting on @meship-starkware and @Yoni-Starkware)


crates/blockifier/src/execution/native/contract_class.rs line 20 at r5 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…

Yes

Done.

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 13 of 14 files at r16.
Reviewable status: 9 of 22 files reviewed, all discussions resolved (waiting on @meship-starkware)

refactor(blockifier): modify entry point logic from native runnable class

refactor(blockifier): apply general improvements

refactor(blockifier): make casm constructor public
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.

Reviewed 1 of 14 files at r16, 2 of 2 files at r17, 9 of 10 files at r18, all commit messages.
Reviewable status: 20 of 22 files reviewed, all discussions resolved (waiting on @meship-starkware)

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.

Reviewed 1 of 18 files at r6, 1 of 10 files at r18.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware)

@Yoni-Starkware Yoni-Starkware merged commit 6ba1b90 into main Nov 18, 2024
22 checks passed
@Yoni-Starkware Yoni-Starkware deleted the rdr/update-native branch November 18, 2024 21:02
@Yoni-Starkware Yoni-Starkware restored the rdr/update-native branch November 18, 2024 21:02
@github-actions github-actions bot locked and limited conversation to collaborators Nov 20, 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.

4 participants