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(execution): delete starknet version string constants and usages #1382

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dorimedini-starkware
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware commented Oct 14, 2024

This change is Reviewable

Copy link
Collaborator Author

dorimedini-starkware commented Oct 14, 2024

Copy link

codecov bot commented Oct 14, 2024

Codecov Report

Attention: Patch coverage is 40.00000% with 3 lines in your changes missing coverage. Please review.

Project coverage is 38.43%. Comparing base (b0cfe82) to head (dfb9e29).
Report is 425 commits behind head on main.

Files with missing lines Patch % Lines
crates/papyrus_execution/src/lib.rs 40.00% 0 Missing and 3 partials ⚠️

❗ There is a different number of reports uploaded between BASE (b0cfe82) and HEAD (dfb9e29). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (b0cfe82) HEAD (dfb9e29)
3 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1382       +/-   ##
===========================================
- Coverage   74.18%   38.43%   -35.76%     
===========================================
  Files         359      108      -251     
  Lines       36240    15688    -20552     
  Branches    36240    15688    -20552     
===========================================
- Hits        26886     6030    -20856     
- Misses       7220     8990     +1770     
+ Partials     2134      668     -1466     
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.

@dorimedini-starkware dorimedini-starkware force-pushed the 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion branch from d672c71 to 02c9fc2 Compare October 14, 2024 09:01
@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch from c013952 to ae55902 Compare October 14, 2024 09:01
@dorimedini-starkware dorimedini-starkware force-pushed the 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion branch from 02c9fc2 to 15ec01b Compare October 14, 2024 12:11
@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch from ae55902 to 8c86aa3 Compare October 14, 2024 12:11
@dorimedini-starkware dorimedini-starkware force-pushed the 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion branch from 15ec01b to b201719 Compare October 14, 2024 13:04
@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch 2 times, most recently from 1c123c9 to e281cf3 Compare October 14, 2024 13:11
@dorimedini-starkware dorimedini-starkware changed the title refactor(papyrus_execution): delete starknet version string constants and usages refactor(execution): delete starknet version string constants and usages Oct 14, 2024
@dorimedini-starkware dorimedini-starkware force-pushed the 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion branch from b201719 to 19f7359 Compare October 14, 2024 13:18
@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch from e281cf3 to 87fd39f Compare October 14, 2024 13:19
@dorimedini-starkware dorimedini-starkware self-assigned this Oct 14, 2024
@dorimedini-starkware dorimedini-starkware force-pushed the 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion branch from 19f7359 to 04596b5 Compare October 15, 2024 10:11
@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch from 87fd39f to be83c62 Compare October 15, 2024 10:11
@dorimedini-starkware dorimedini-starkware force-pushed the 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion branch from 04596b5 to fe71073 Compare October 15, 2024 10:12
@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch from be83c62 to 8294dd8 Compare October 15, 2024 10:13
@dorimedini-starkware dorimedini-starkware force-pushed the 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion branch from fe71073 to a2c261b Compare October 15, 2024 11:25
@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch from 8294dd8 to cdb878e Compare October 15, 2024 11:25
@dorimedini-starkware dorimedini-starkware force-pushed the 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion branch from a2c261b to 932542f Compare October 15, 2024 17:34
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: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)


crates/papyrus_execution/src/lib.rs line 873 at r2 (raw file):

        })
    } else {
        Ok(VersionedConstants::latest_constants())

Is this still relevant? Why not try to get the exact constant and return the latest as a fallback?

Code quote:

    if let Some(starknet_version) = starknet_version {
        Ok(match starknet_version {
            StarknetVersion::V0_13_0 | StarknetVersion::V0_13_1 | StarknetVersion::V0_13_2 => {
                VersionedConstants::get(&starknet_version)?
            }
            _ => VersionedConstants::get(&StarknetVersion::V0_13_3)?,
        })
    } else {
        Ok(VersionedConstants::latest_constants())

@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch from cdb878e to f1d80a7 Compare October 15, 2024 19:42
@dorimedini-starkware dorimedini-starkware changed the base branch from 10-13-refactor_blockifier_starknet_api_delete_blockifier_s_starknetversion to main October 15, 2024 19:43
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-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 1 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @Yoni-Starkware)


crates/papyrus_execution/src/lib.rs line 873 at r2 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…

Is this still relevant? Why not try to get the exact constant and return the latest as a fallback?

Yeah I think this function can be deleted, basically; but behavior isn't exactly identical to VersionedConstants::get so I'll leave it to someone from papyrus team.
Note that if you call this with StarknetVersion::V0_9_1 you will get constants matching V0_13_3, and you will get latest_constants (not necessarily V0_13_3) if you send None

@dorimedini-starkware dorimedini-starkware force-pushed the 10-14-refactor_papyrus_execution_delete_starknet_version_string_constants_and_usages branch from f1d80a7 to dfb9e29 Compare October 18, 2024 15:45
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-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 2 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @Yoni-Starkware)


crates/papyrus_execution/src/lib.rs line 873 at r2 (raw file):

Previously, dorimedini-starkware wrote…

Yeah I think this function can be deleted, basically; but behavior isn't exactly identical to VersionedConstants::get so I'll leave it to someone from papyrus team.
Note that if you call this with StarknetVersion::V0_9_1 you will get constants matching V0_13_3, and you will get latest_constants (not necessarily V0_13_3) if you send None

deleted the function


crates/papyrus_execution/src/lib.rs line 372 at r3 (raw file):

        .get_starknet_version(block_number)?
        .unwrap_or(StarknetVersion::LATEST);
    let versioned_constants = VersionedConstants::get(&starknet_version)?;

@ShahakShama this behavior has changed now:
previously if starknet_version was not one of 0.13.0, 0.13.1 or 0.13.2, you would get 0.13.3 constants; now, you get the constants specified by the version (e.g. 0.13.1.1) or an error (any version below 0.13.0, which is the minimal version for versioned constants).
is that ok?

Code quote:

let versioned_constants = VersionedConstants::get(&starknet_version)?;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants