-
Notifications
You must be signed in to change notification settings - Fork 11
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: use starknet_api builtin for name trait #319
feat: use starknet_api builtin for name trait #319
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @ArniStarkware and the rest of your teammates on Graphite |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #319 +/- ##
==========================================
+ Coverage 82.38% 82.58% +0.20%
==========================================
Files 33 33
Lines 1612 1631 +19
Branches 1612 1631 +19
==========================================
+ Hits 1328 1347 +19
Misses 219 219
Partials 65 65 ☔ View full report in Codecov by Sentry. |
e6bdf01
to
e82f53b
Compare
31a8d34
to
d572302
Compare
e82f53b
to
f67b511
Compare
d572302
to
fd9e01e
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.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArniStarkware and @Yael-Starkware)
crates/gateway/src/gateway.rs
line 187 at r1 (raw file):
// TODO(Arni): Add to a config. fn get_supported_builtins() -> Vec<String> {
Please use https://docs.rs/once_cell/latest/once_cell/sync/struct.Lazy.html
crates/gateway/src/gateway.rs
line 187 at r1 (raw file):
// TODO(Arni): Add to a config. fn get_supported_builtins() -> Vec<String> {
Consider adding is_supported
method to Builtin
together with using https://docs.rs/strum/latest/strum/derive.EnumIter.html
This way whenever a new builtin is created it won't be forgotten in this function
f67b511
to
c2d41e8
Compare
fd9e01e
to
d4dbe20
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: all files reviewed, 3 unresolved discussions (waiting on @ArniStarkware)
crates/gateway/src/utils.rs
line 164 at r1 (raw file):
true }
I think this whole code should move the starknet-api , it is relevant for all repos (mempool and blockifier for sure).
Previously, Yael-Starkware (YaelD) wrote…
I agree :) |
c2d41e8
to
d0d4053
Compare
25fa666
to
e060f39
Compare
d0d4053
to
ab76a25
Compare
e060f39
to
a3ddc46
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 4 files reviewed, 2 unresolved discussions (waiting on @Yael-Starkware and @yair-starkware)
crates/gateway/src/gateway.rs
line 187 at r1 (raw file):
Previously, yair-starkware (Yair) wrote…
Please use https://docs.rs/once_cell/latest/once_cell/sync/struct.Lazy.html
Done.
crates/gateway/src/gateway.rs
line 187 at r1 (raw file):
Previously, yair-starkware (Yair) wrote…
Consider adding
is_supported
method toBuiltin
together with using https://docs.rs/strum/latest/strum/derive.EnumIter.htmlThis way whenever a new builtin is created it won't be forgotten in this function
Done. See related Starknet API PR: https://reviewable.io/reviews/starkware-libs/starknet-api/290#-
ab76a25
to
0c30c7a
Compare
a3ddc46
to
6275ce0
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 4 files reviewed, 2 unresolved discussions (waiting on @Yael-Starkware and @yair-starkware)
crates/gateway/src/utils.rs
line 164 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
I agree :)
Here it is in Starknet API: https://reviewable.io/reviews/starkware-libs/starknet-api/288#- (inmain-mempool
branch).
Done*.
crates/gateway/src/utils.rs
line 195 at r3 (raw file):
} } }
The name
method is taken from starknet-api
(The code supporting it is already merged).
Code quote:
impl NameExt for Builtin {
fn name(&self) -> &'static str {
match self {
Builtin::RangeCheck => RANGE_CHACK_BUILTIN_NAME,
Builtin::Pedersen => PEDERSEN_BUILTIN_NAME,
Builtin::Poseidon => POSEIDON_BUILTIN_NAME,
Builtin::EcOp => EC_OP_BUILTIN_NAME,
Builtin::Ecdsa => ECDSA_BUILTIN_NAME,
Builtin::Bitwise => BITWISE_BUILTIN_NAME,
Builtin::Keccak => KECCAK_BUILTIN_NAME,
Builtin::SegmentArena => SEGMENT_ARENA_BUILTIN_NAME,
}
}
}
Previously, ArniStarkware (Arnon Hod) wrote…
See another related PR in SN-API: starkware-libs/starknet-api#290 |
6275ce0
to
307d91a
Compare
361094e
to
255fbad
Compare
255fbad
to
ac80823
Compare
ac80823
to
afdd207
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 5 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware and @yair-starkware)
crates/gateway/src/utils.rs
line 164 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
No - They are a property of the gateway.
is_supported_builtin - is a property of the gateway, which is going to be used to create the replacement of the static variable - a config variable.
lets add a todo to consider moving it to starknet-api.
I think it is a property of the whole system and should be in a central place
afdd207
to
e87b419
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 5 files reviewed, 2 unresolved discussions (waiting on @Yael-Starkware and @yair-starkware)
crates/gateway/src/utils.rs
line 164 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
lets add a todo to consider moving it to starknet-api.
I think it is a property of the whole system and should be in a central place
Done.
e87b419
to
c553217
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 5 files reviewed, 2 unresolved discussions (waiting on @Yael-Starkware and @yair-starkware)
crates/gateway/src/utils.rs
line 164 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
Done.
See todo: TODO(Arni): Consider moving into Starknet-api.
c553217
to
69054eb
Compare
69054eb
to
65d2d27
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.
Reviewed 2 of 3 files at r7, 1 of 2 files at r8, all commit messages.
Reviewable status: 3 of 6 files reviewed, 3 unresolved discussions (waiting on @ArniStarkware and @yair-starkware)
crates/gateway/src/compilation.rs
line 66 at r8 (raw file):
// TODO(Arni): Consider moving into Starknet-api. // List of supported builtins. // This is an explicit function so that it is explicitly desiced which builtins are supported.
decides?
Code quote:
desiced
crates/gateway/src/compilation.rs
line 68 at r8 (raw file):
// This is an explicit function so that it is explicitly desiced which builtins are supported. // If new builtins are added, they should be added here. fn is_supported_builtin(builtin: &Builtin) -> bool {
Suggestion:
is_os_supported_builtin
65d2d27
to
cb35c83
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: 2 of 6 files reviewed, 1 unresolved discussion (waiting on @Yael-Starkware and @yair-starkware)
crates/gateway/src/compilation.rs
line 66 at r8 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
decides?
Done
crates/gateway/src/compilation.rs
line 68 at r8 (raw file):
// This is an explicit function so that it is explicitly desiced which builtins are supported. // If new builtins are added, they should be added here. fn is_supported_builtin(builtin: &Builtin) -> bool {
Done
cb35c83
to
dba37cb
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: 2 of 6 files reviewed, 1 unresolved discussion (waiting on @yair-starkware)
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.
Reviewed 2 of 4 files at r3, 1 of 2 files at r8, all commit messages.
Reviewable status: 3 of 6 files reviewed, all discussions resolved (waiting on @Yael-Starkware)
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.
Reviewed 2 of 3 files at r7, 1 of 1 files at r9.
Reviewable status: 4 of 6 files reviewed, all discussions resolved (waiting on @Yael-Starkware)
This change is
The TODO is addressed here: starkware-libs/starknet-api#288