-
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
chore(blockifier): implement staknet_api class_info to match blockifier class_info #1702
chore(blockifier): implement staknet_api class_info to match blockifier class_info #1702
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1702 +/- ##
===========================================
+ Coverage 40.10% 75.44% +35.33%
===========================================
Files 26 103 +77
Lines 1895 13907 +12012
Branches 1895 13907 +12012
===========================================
+ Hits 760 10492 +9732
- Misses 1100 2959 +1859
- Partials 35 456 +421 ☔ View full report in Codecov by Sentry. |
Benchmark movements: |
8e13fb4
to
8d98dc1
Compare
166b9ed
to
c01142e
Compare
Benchmark movements: |
1b6ef79
to
8af325a
Compare
c01142e
to
b9d906d
Compare
ed0d822
to
2cd23a7
Compare
011775d
to
340ab90
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 3 files reviewed, 1 unresolved discussion (waiting on @noaov1)
crates/starknet_api/src/contract_class.rs
line 106 at r2 (raw file):
} } }
copied from blockifier::execution::contract_class::ClassInfo to be used through staknet_api executable_tx through AccountTransaction in following PR (1688)
340ab90
to
977f134
Compare
Artifacts upload triggered. View details here |
Benchmark movements: full_committer_flow performance regressed! |
2cd23a7
to
9bdbcae
Compare
977f134
to
f6f3de1
Compare
Artifacts upload triggered. View details here |
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 r3, 3 of 3 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @noaov1)
crates/starknet_api/src/contract_class.rs
line 106 at r2 (raw file):
Previously, avivg-starkware wrote…
copied from blockifier::execution::contract_class::ClassInfo to be used through staknet_api executable_tx through AccountTransaction in following PR (1688)
#1688 (add a HashTag for PR number to become a link :) )
crates/starknet_api/src/contract_class.rs
line 100 at r4 (raw file):
}) } }
Damn, do I hate this new
method... (This is not a practical comment - just sharing).
It can only return an error if we have an internal error.
Out of scope for this PR - just personal grudges. And the upside is that with the old new
method deleted - the refactor I planned can take effect.
Code quote:
pub fn new(
contract_class: &ContractClass,
sierra_program_length: usize,
abi_length: usize,
) -> Result<Self, StarknetApiError> {
let (contract_class_version, condition) = match contract_class {
ContractClass::V0(_) => (0, sierra_program_length == 0),
ContractClass::V1(_) => (1, sierra_program_length > 0),
};
if condition {
Ok(Self { contract_class: contract_class.clone(), sierra_program_length, abi_length })
} else {
Err(StarknetApiError::ContractClassVersionSierraProgramLengthMismatch {
contract_class_version,
sierra_program_length,
})
}
}
Suggestion: // TODO(Ayelet,10/02/2024): Change to bytes.
pub struct ClassInfo { |
9bdbcae
to
35360cd
Compare
f6f3de1
to
c56e01a
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: 5 of 6 files reviewed, 1 unresolved discussion (waiting on @ArniStarkware, @meship-starkware, and @noaov1)
crates/starknet_api/src/contract_class.rs
line 106 at r2 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
#1688 (add a HashTag for PR number to become a link :) )
thanks!
crates/starknet_api/src/contract_class.rs
line 48 at r4 (raw file):
/// and other parameters derived from the original declare transaction required for billing. #[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] pub struct ClassInfo {
Done.
crates/starknet_api/src/contract_class.rs
line 100 at r4 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
Damn, do I hate this
new
method... (This is not a practical comment - just sharing).
It can only return an error if we have an internal error.Out of scope for this PR - just personal grudges. And the upside is that with the old
new
method deleted - the refactor I planned can take effect.
I might ask you about it in person out of curiosity, for me to better understand your hate :)
a00b261
to
1684532
Compare
8ad09b5
to
3bde9c8
Compare
Artifacts upload triggered. View details here |
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: 7 of 9 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @meship-starkware, and @noaov1)
crates/starknet_api/src/core.rs
line 468 at r10 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
Constants should be at the start of the file.
Another issue is that the constant
WORD_WIDTH
's name is non-informative in this context.
Would you change the name of the constant or just add the comment as you did?
As there were other constants along this file, I wasn't sure where best to place. I moved it just below the 'use'... should it be elsewhere?
crates/blockifier/src/fee/eth_gas_constants.rs
line 4 at r10 (raw file):
pub const GAS_PER_MEMORY_ZERO_BYTE: usize = 4; pub const GAS_PER_MEMORY_BYTE: usize = 16; pub const WORD_WIDTH: usize = 32; //TODO(AvivG): use starknet_api::core::WORD_WIDTH instead.aig add -p
Done.
1684532
to
2e700bb
Compare
3bde9c8
to
81587b1
Compare
Artifacts upload triggered. View details here |
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 1 of 2 files at r11.
Reviewable status: 8 of 9 files reviewed, all discussions resolved (waiting on @meship-starkware and @noaov1)
crates/starknet_api/src/core.rs
line 468 at r10 (raw file):
Previously, avivg-starkware wrote…
Would you change the name of the constant or just add the comment as you did?
As there were other constants along this file, I wasn't sure where best to place. I moved it just below the 'use'... should it be elsewhere?
I think this is fine for now.
Maybe we want a starknet_api::constants.rs
- but I think this is out of scope.
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 2 files at r11, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @noaov1)
crates/blockifier/src/fee/eth_gas_constants.rs
line 4 at r10 (raw file):
Previously, avivg-starkware wrote…
Done.
- Great.
- Non-blocking - how hard is it to follow through with this to-do in this PR? How many files are affected?
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 r11, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noaov1)
b58a0cf
to
0930b05
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: complete! all files reviewed, all discussions resolved (waiting on @noaov1)
crates/blockifier/src/fee/eth_gas_constants.rs
line 4 at r10 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
- Great.
- Non-blocking - how hard is it to follow through with this to-do in this PR? How many files are affected?
there are only 4 files WORD_WIDTH appears in. I still prefer to handle this in a separate PR, will link in this thread when exists
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: complete! all files reviewed, all discussions resolved (waiting on @noaov1)
81587b1
to
d6be674
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @avivg-starkware and the rest of your teammates on Graphite |
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
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 r12, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @noaov1)
…er class_info