-
Notifications
You must be signed in to change notification settings - Fork 21
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
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @dorimedini-starkware and the rest of your teammates on Graphite |
Codecov ReportAttention: Patch coverage is
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
d672c71
to
02c9fc2
Compare
c013952
to
ae55902
Compare
02c9fc2
to
15ec01b
Compare
ae55902
to
8c86aa3
Compare
15ec01b
to
b201719
Compare
1c123c9
to
e281cf3
Compare
b201719
to
19f7359
Compare
e281cf3
to
87fd39f
Compare
19f7359
to
04596b5
Compare
87fd39f
to
be83c62
Compare
04596b5
to
fe71073
Compare
be83c62
to
8294dd8
Compare
fe71073
to
a2c261b
Compare
8294dd8
to
cdb878e
Compare
a2c261b
to
932542f
Compare
There was a problem hiding this 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())
cdb878e
to
f1d80a7
Compare
There was a problem hiding this 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
f1d80a7
to
dfb9e29
Compare
There was a problem hiding this 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 withStarknetVersion::V0_9_1
you will get constants matchingV0_13_3
, and you will getlatest_constants
(not necessarilyV0_13_3
) if you sendNone
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)?;
This change is