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

chore(blockifier): unify get entry point for V1 and Native #1243

Merged

Conversation

meship-starkware
Copy link
Contributor

@meship-starkware meship-starkware commented Oct 8, 2024

This change is Reviewable

@meship-starkware meship-starkware force-pushed the meship/blockifier/unify_get_native_entry_point_and_v1 branch from 4045d53 to 5b7d5e3 Compare October 8, 2024 06:53
Copy link

github-actions bot commented Oct 8, 2024

Benchmark movements:
full_committer_flow performance regressed!
full_committer_flow time: [29.898 ms 29.955 ms 30.020 ms]
change: [+1.7011% +1.9476% +2.2315%] (p = 0.00 < 0.05)
Performance has regressed.
Found 5 outliers among 100 measurements (5.00%)
2 (2.00%) high mild
3 (3.00%) high severe

@meship-starkware meship-starkware force-pushed the meship/blockifier/unify_get_native_entry_point_and_v1 branch from 5b7d5e3 to 57baa8e Compare October 8, 2024 07:09
Copy link

codecov bot commented Oct 8, 2024

Codecov Report

Attention: Patch coverage is 63.46154% with 19 lines in your changes missing coverage. Please review.

Project coverage is 70.89%. Comparing base (b0cfe82) to head (18bab8d).
Report is 326 commits behind head on main.

Files with missing lines Patch % Lines
crates/blockifier/src/execution/contract_class.rs 65.21% 15 Missing and 1 partial ⚠️
crates/papyrus_protobuf/src/converters/class.rs 0.00% 2 Missing ⚠️
...ates/starknet_api/src/deprecated_contract_class.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1243      +/-   ##
==========================================
- Coverage   74.18%   70.89%   -3.30%     
==========================================
  Files         359      207     -152     
  Lines       36240    25876   -10364     
  Branches    36240    25876   -10364     
==========================================
- Hits        26886    18344    -8542     
+ Misses       7220     5927    -1293     
+ Partials     2134     1605     -529     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@meship-starkware meship-starkware force-pushed the meship/blockifier/unify_get_native_entry_point_and_v1 branch from 57baa8e to fcfc201 Compare October 10, 2024 10:31
Copy link
Contributor Author

@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.

Reviewable status: 0 of 12 files reviewed, 1 unresolved discussion (waiting on @noaov1)


crates/starknet_client/src/writer/objects/transaction.rs line 27 at r1 (raw file):

    ContractClassAbiEntry as DeprecatedContractClassAbiEntry,
    EntryPointType as DeprecatedEntryPointType,
    EntryPointV0 as DeprecatedEntryPoint,

I'm not sure if it needs to be part of this PR or if we should change the name. I can revert it if you'd like

Code quote:

EntryPointV0

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 12 of 12 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @meship-starkware)


crates/blockifier/src/execution/contract_class.rs line 72 at r1 (raw file):

    V1(EntryPointV1),
    Native(NativeEntryPoint),
}

I would even consider renaming EntryPointV1 -> CasmEntryPoint (separate PR)

Suggestion:

pub enum Cairo1EntryPoint {
    Casm(EntryPointV1),
    Native(NativeEntryPoint),
}

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

}

pub fn get_entry_point(

Can you please move it to the contract_class.rs file?

Code quote:

pub fn get_entry_point(

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

    let entry_points_of_same_type =
        &contract_class.entry_points_of_same_type(call.entry_point_type);

Is this working? If so, you can remove some of th * in the following lines.

Suggestion:

    let entry_points_of_same_type =
        contract_class.entry_points_of_same_type(call.entry_point_type);

crates/starknet_client/src/reader/starknet_feeder_gateway_client_test.rs line 26 at r1 (raw file):

    ContractClassAbiEntry,
    EntryPointOffset,
    EntryPointType as DeprecatedEntryPointType,

Why is it deprecated?

Code quote:

    EntryPointType as DeprecatedEntryPointType,

@meship-starkware meship-starkware force-pushed the meship/blockifier/unify_get_native_entry_point_and_v1 branch 2 times, most recently from 960d7fa to c198c6f Compare October 13, 2024 05:49
Copy link
Contributor Author

@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.

Reviewable status: 10 of 12 files reviewed, 3 unresolved discussions (waiting on @noaov1)


crates/blockifier/src/execution/contract_class.rs line 72 at r1 (raw file):

Previously, noaov1 (Noa Oved) wrote…

I would even consider renaming EntryPointV1 -> CasmEntryPoint (separate PR)

Done. Added a Monday task for the refactor.


crates/starknet_client/src/reader/starknet_feeder_gateway_client_test.rs line 26 at r1 (raw file):

Previously, noaov1 (Noa Oved) wrote…

Why is it deprecated?

Because the EntryPointType appears in the deprecated_contract_class. I guess the reason is that the deprecated_contract_class file is in starknet_api, and the EntryPointType also appears in the state in starknet_api. So as I see it, we can unify both entry point enum and change the name from deprecated in the imports. Anyway I don't think it should be part of this PR.


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

Previously, noaov1 (Noa Oved) wrote…

Can you please move it to the contract_class.rs file?

Done.

@meship-starkware meship-starkware force-pushed the meship/blockifier/unify_get_native_entry_point_and_v1 branch from c198c6f to a97fd07 Compare October 13, 2024 06:19
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 r2, 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware)

@meship-starkware meship-starkware force-pushed the meship/blockifier/unify_get_native_entry_point_and_v1 branch from a97fd07 to 18bab8d Compare October 13, 2024 10:57
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 11 of 11 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware)

@meship-starkware meship-starkware merged commit cfbb00e into main Oct 13, 2024
23 checks passed
@meship-starkware meship-starkware deleted the meship/blockifier/unify_get_native_entry_point_and_v1 branch October 13, 2024 11:23
@github-actions github-actions bot locked and limited conversation to collaborators Oct 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants