-
Notifications
You must be signed in to change notification settings - Fork 24
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): get sierra contract class from feature contract #2466
feat(blockifier): get sierra contract class from feature contract #2466
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2466 +/- ##
===========================================
+ Coverage 40.10% 80.25% +40.15%
===========================================
Files 26 98 +72
Lines 1895 13528 +11633
Branches 1895 13528 +11633
===========================================
+ Hits 760 10857 +10097
- Misses 1100 2202 +1102
- Partials 35 469 +434 ☔ View full report in Codecov by Sentry. |
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 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @AvivYossef-starkware, @meship-starkware, and @Yoni-Starkware)
crates/starknet_api/src/state.rs
line 250 at r1 (raw file):
None => Default::default(), } },
Suggestion:
abi: cairo_lang_contract_class.abi.map(|abi| abi.json()).unwrap_or_default(),
crates/starknet_api/src/state.rs
line 253 at r1 (raw file):
} } }
@Yoni-Starkware this conversion includes O(len(sierra_program)) Felt::from(biguint) operations...
how bad is it?
@AvivYossef-starkware how many times is this conversion invoked? is it cached?
Code quote:
impl From<CairoLangContractClass> for SierraContractClass {
fn from(cairo_lang_contract_class: CairoLangContractClass) -> Self {
Self {
sierra_program: cairo_lang_contract_class
.sierra_program
.into_iter()
.map(|big_uint_as_hex| Felt::from(big_uint_as_hex.value))
.collect(),
contract_class_version: cairo_lang_contract_class.contract_class_version,
entry_points_by_type: cairo_lang_contract_class.entry_points_by_type.into(),
abi: {
match cairo_lang_contract_class.abi {
Some(abi) => abi.json(),
None => Default::default(),
}
},
}
}
}
crates/starknet_api/src/rpc_transaction.rs
line 7 at r1 (raw file):
use std::collections::HashMap; use cairo_lang_starknet_classes::contract_class::ContractEntryPoints as CairoLangContractEntryPoints;
why rename? I don't see a name collision
Suggestion:
ContractEntryPoints;
crates/starknet_api/src/rpc_transaction.rs
line 287 at r1 (raw file):
// TODO(AVIV): Consider removing this conversion and using the one in the // CairoLangContractEntryPoints
Suggestion:
// TODO(AVIV): Consider removing this conversion and using ContractEntryPoints instead of
// defining the EntryPointByType struct.
7045fbb
to
cff63ab
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: 1 of 3 files reviewed, 4 unresolved discussions (waiting on @dorimedini-starkware, @meship-starkware, and @Yoni-Starkware)
crates/starknet_api/src/rpc_transaction.rs
line 7 at r1 (raw file):
Previously, dorimedini-starkware wrote…
why rename? I don't see a name collision
To make it clearer when looking at the function
crates/starknet_api/src/state.rs
line 253 at r1 (raw file):
Previously, dorimedini-starkware wrote…
@Yoni-Starkware this conversion includes O(len(sierra_program)) Felt::from(biguint) operations...
how bad is it?
@AvivYossef-starkware how many times is this conversion invoked? is it cached?
Currently, I only use it once for each feature contract in the end-to-end test.
crates/starknet_api/src/state.rs
line 250 at r1 (raw file):
None => Default::default(), } },
Done.
crates/starknet_api/src/rpc_transaction.rs
line 287 at r1 (raw file):
// TODO(AVIV): Consider removing this conversion and using the one in the // CairoLangContractEntryPoints
Done.
Benchmark movements: |
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 r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @meship-starkware and @Yoni-Starkware)
crates/starknet_api/src/state.rs
line 253 at r1 (raw file):
Previously, AvivYossef-starkware wrote…
Currently, I only use it once for each feature contract in the end-to-end test.
this is not used in business logic? then please gate it behind #[cfg(any(test, feature = "testing"))]
cff63ab
to
3efd03b
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 3 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware, @meship-starkware, and @Yoni-Starkware)
crates/starknet_api/src/state.rs
line 253 at r1 (raw file):
Previously, dorimedini-starkware wrote…
this is not used in business logic? then please gate it behind #[cfg(any(test, feature = "testing"))]
No
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 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @Yoni-Starkware)
e4ce2e7
to
e85b600
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 1 of 3 files at r1, 1 of 2 files at r2, 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-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 all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
e85b600
to
cb2c53d
Compare
Merge activity
|
No description provided.