-
Notifications
You must be signed in to change notification settings - Fork 26
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): add get_execution_info_v1 syscall #1735
Conversation
c58b28b
to
ecaf982
Compare
Artifacts upload triggered. View details here |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1735 +/- ##
===========================================
+ Coverage 40.10% 69.06% +28.96%
===========================================
Files 26 105 +79
Lines 1895 13658 +11763
Branches 1895 13658 +11763
===========================================
+ Hits 760 9433 +8673
- Misses 1100 3822 +2722
- Partials 35 403 +368 ☔ View full report in Codecov by Sentry. |
ecaf982
to
c89a2d6
Compare
Artifacts upload triggered. View details here |
60e2392
to
538df34
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 6 files at r1, all commit messages.
Reviewable status: 2 of 6 files reviewed, all discussions resolved (waiting on @noaov1)
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 4 of 6 files at r1.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @noaov1 and @varex83)
crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs
line 267 at r1 (raw file):
let word_in_hex: String = s.as_bytes().iter().fold(String::new(), |s, byte| s + (&format!("{:02x}", byte))); [prefix, &padding_zeros, &word_in_hex].into_iter().collect()
Why did you remove this test?
Code quote:
#[test]
fn test_gas_types_constants() {
assert_eq!(str_to_32_bytes_in_hex("L1_GAS"), Resource::L1Gas.to_hex());
assert_eq!(str_to_32_bytes_in_hex("L2_GAS"), Resource::L2Gas.to_hex());
assert_eq!(str_to_32_bytes_in_hex("L1_DATA"), Resource::L1DataGas.to_hex());
}
fn str_to_32_bytes_in_hex(s: &str) -> String {
if s.len() > 32 {
panic!("Unsupported input of length > 32.")
}
let prefix = "0x";
let padding_zeros = "0".repeat(64 - s.len() * 2); // Each string char is 2 chars in hex.
let word_in_hex: String =
s.as_bytes().iter().fold(String::new(), |s, byte| s + (&format!("{:02x}", byte)));
[prefix, &padding_zeros, &word_in_hex].into_iter().collect()
crates/blockifier/src/transaction/objects.rs
line 92 at r1 (raw file):
pub fn max_fee(&self) -> TransactionFeeResult<Fee> { match self { Self::Current(_context) => Ok(Fee(0)),
Suggestion:
Self::Current(_) => Ok(Fee(0)),
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 @noaov1 and @varex83)
crates/blockifier/src/transaction/objects.rs
line 90 at r1 (raw file):
} pub fn max_fee(&self) -> TransactionFeeResult<Fee> {
Why are you returning a result? Where can it fail?
Code quote:
TransactionFeeResult
c89a2d6
to
2efef80
Compare
Artifacts upload triggered. View details here |
2efef80
to
70aaed6
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: 2 of 6 files reviewed, 1 unresolved discussion (waiting on @meship-starkware and @noaov1)
crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs
line 267 at r1 (raw file):
Previously, meship-starkware (Meshi Peled) wrote…
Why did you remove this test?
Done
Most likely some rebasing problems 👀
crates/blockifier/src/transaction/objects.rs
line 90 at r1 (raw file):
Previously, meship-starkware (Meshi Peled) wrote…
Why are you returning a result? Where can it fail?
Done
crates/blockifier/src/transaction/objects.rs
line 92 at r1 (raw file):
pub fn max_fee(&self) -> TransactionFeeResult<Fee> { match self { Self::Current(_context) => Ok(Fee(0)),
Done
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 4 files at r2.
Reviewable status: 3 of 6 files reviewed, all discussions resolved (waiting on @noaov1)
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 4 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noaov1)
538df34
to
861b3c2
Compare
5af9c72
to
82c7715
Compare
Artifacts upload triggered. View details here |
861b3c2
to
ffba45f
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 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noaov1)
139d79d
to
3d4ab3d
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 @avi-starkware, @noaov1, and @Yoni-Starkware)
1d5dd26
to
ffd093d
Compare
Artifacts upload triggered. View details here |
ffd093d
to
f3a504e
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 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @avi-starkware, @noaov1, and @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 1 of 1 files at r7, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noaov1 and @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 1 of 6 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noaov1 and @varex83)
crates/blockifier/src/transaction/objects.rs
line 101 at r7 (raw file):
} pub fn max_fee(&self) -> Fee {
Please remove max_fee_for_execution_info
and use this one
Suggestion:
max_fee_for_execution_info_syscall
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, 2 unresolved discussions (waiting on @noaov1 and @varex83)
crates/blockifier/src/test_utils/contracts.rs
line 118 at r7 (raw file):
Self::LegacyTestContract | Self::CairoStepsTestContract => CairoVersion::Cairo1, #[cfg(feature = "cairo_native")] Self::SierraExecutionInfoV1Contract => CairoVersion::Native,
Why can't you use the existing contract?
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, 2 unresolved discussions (waiting on @noaov1, @varex83, and @Yoni-Starkware)
crates/blockifier/src/test_utils/contracts.rs
line 118 at r7 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Why can't you use the existing contract?
This is how the contract in the test utils is defined. For now, native has its directory for both contracts and compiled contracts. This PR should fix this #1455
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, 1 unresolved discussion (waiting on @noaov1 and @varex83)
crates/blockifier/src/test_utils/contracts.rs
line 118 at r7 (raw file):
Previously, meship-starkware (Meshi Peled) wrote…
This is how the contract in the test utils is defined. For now, native has its directory for both contracts and compiled contracts. This PR should fix this #1455
Cool
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, 2 unresolved discussions (waiting on @meship-starkware, @noaov1, and @varex83)
crates/blockifier/src/test_utils/contracts.rs
line 118 at r7 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Cool
Can we move forward with this PR?
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, 2 unresolved discussions (waiting on @meship-starkware, @noaov1, and @Yoni-Starkware)
crates/blockifier/src/transaction/objects.rs
line 101 at r7 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Please remove
max_fee_for_execution_info
and use this one
Do you mean to remove this max_fee
function, and use max_fee_for_execution_info
instead?
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, 2 unresolved discussions (waiting on @meship-starkware, @noaov1, and @Yoni-Starkware)
crates/blockifier/src/test_utils/contracts.rs
line 118 at r7 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Can we move forward with this PR?
One main reason we use SierraExecutionInfoV1Contract
is to test get_execution_info_v1
using the same tests we use for get_execution_info_v2
. The difference is in the imports, for v2 we use starknet::get_execution_info
, and for v1 - starknet::syscalls::get_execution_info_syscall
.
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 6 files at r1, 1 of 3 files at r5, 1 of 1 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noaov1 and @varex83)
crates/blockifier/src/transaction/objects.rs
line 101 at r7 (raw file):
Previously, varex83 (Bohdan Ohorodnii) wrote…
Do you mean to remove this
max_fee
function, and usemax_fee_for_execution_info
instead?
Rename max_fee
-> max_fee_for_execution_info_syscall
, delete max_fee_for_execution_info
and use your function instead
f3a504e
to
7f6d275
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: 4 of 9 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @meship-starkware, @noaov1, and @Yoni-Starkware)
crates/blockifier/src/transaction/objects.rs
line 101 at r7 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Rename
max_fee
->max_fee_for_execution_info_syscall
, deletemax_fee_for_execution_info
and use your function instead
Done.
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 r4, 5 of 5 files at r8, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noaov1)
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 5 of 5 files at r8, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noaov1)
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)
7f6d275
to
e75ea9a
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 3 of 3 files at r9.
Reviewable status: all files reviewed (commit messages unreviewed), all discussions resolved (waiting on @noaov1)
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 @noaov1)
No description provided.