-
Notifications
You must be signed in to change notification settings - Fork 27
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 support for sha256_process_block syscall #1545
Conversation
Artifacts upload triggered. View details here |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1545 +/- ##
===========================================
+ Coverage 40.10% 67.47% +27.37%
===========================================
Files 26 103 +77
Lines 1895 13913 +12018
Branches 1895 13913 +12018
===========================================
+ Hits 760 9388 +8628
- Misses 1100 4124 +3024
- Partials 35 401 +366 ☔ View full report in Codecov by Sentry. |
c728762
to
4cf52c8
Compare
a8a4e1b
to
05ccd53
Compare
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
147c1d3
to
ded98cf
Compare
05ccd53
to
3cf4a05
Compare
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 r5.
Reviewable status: 1 of 5 files reviewed, 2 unresolved discussions (waiting on @noaov1 and @varex83)
crates/blockifier/src/execution/native/entry_point_execution.rs
line 74 at r5 (raw file):
let versioned_constants = syscall_handler.context.versioned_constants(); *syscall_handler.resources += &versioned_constants.get_additional_os_syscall_resources(&syscall_handler.syscall_counter);
It seems like these lines are duplicated.
Suggestion:
// todo(rodrigo): execution resources for native execution are still wip until future
// development on both Cairo lang and the Native compiler
let versioned_constants = syscall_handler.context.versioned_constants();
*syscall_handler.resources +=
&versioned_constants.get_additional_os_syscall_resources(&syscall_handler.syscall_counter);
crates/blockifier/src/test_utils/cairo_compile.rs
line 198 at r5 (raw file):
sierra_output.stdout }
I don't think this should be part of this PR. Is it here because this PR is based on add_syscall_counting and not add_native_suppourt_in_testing_suite?
Code quote:
pub fn sierra_compile(
path: String,
git_tag_override: Option<String>,
cargo_nightly_arg: Option<String>,
) -> Vec<u8> {
prepare_cairo1_compiler_deps(git_tag_override);
let cairo1_compiler_path = local_cairo1_compiler_repo_path();
// Command args common to both compilation phases.
let mut base_compile_args = vec![
"run".into(),
format!("--manifest-path={}/Cargo.toml", cairo1_compiler_path.to_string_lossy()),
"--bin".into(),
];
// Add additional cargo arg if provided. Should be first arg (base command is `cargo`).
if let Some(nightly_version) = cargo_nightly_arg {
base_compile_args.insert(0, format!("+nightly-{nightly_version}"));
}
// Cairo -> Sierra.
let mut starknet_compile_commmand = Command::new("cargo");
starknet_compile_commmand.args(base_compile_args.clone());
starknet_compile_commmand.args(["starknet-compile", "--", "--single-file", &path]);
let sierra_output = run_and_verify_output(&mut starknet_compile_commmand);
sierra_output.stdout
}
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 r1, 1 of 1 files at r2, 1 of 1 files at r3, 1 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @noaov1 and @varex83)
6e88aa9
to
55834b2
Compare
429e95a
to
baab125
Compare
Artifacts upload triggered. View details here |
baab125
to
506c511
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 r5, 4 of 4 files at r6, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @meship-starkware and @varex83)
crates/blockifier/src/execution/native/syscall_handler.rs
line 326 at r6 (raw file):
)?; let data_as_bytes = sha2::digest::generic_array::GenericArray::from_exact_iter(
Suggestion:
let current_block_as_bytes = sha2::digest::generic_array::GenericArray:
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 1 of 1 files at r5, 1 of 4 files at r6, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @meship-starkware and @varex83)
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 r6.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @varex83)
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 and @noaov1)
crates/blockifier/src/execution/native/syscall_handler.rs
line 326 at r6 (raw file):
)?; let data_as_bytes = sha2::digest::generic_array::GenericArray::from_exact_iter(
Named like that just to be consistent with the current VM implementation:
let data_as_bytes = |
deb6167
to
1cd6470
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: all files reviewed, 1 unresolved discussion (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: all files reviewed, 1 unresolved discussion (waiting on @noaov1)
538df34
to
861b3c2
Compare
1cd6470
to
bd4f9d6
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.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noaov1)
139d79d
to
3d4ab3d
Compare
bd4f9d6
to
9eebe27
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 5 of 5 files at r7, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noaov1)
9eebe27
to
097ae6a
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 2 of 2 files at r8, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @varex83)
This PR adds support for the sha256_process_block syscall for cairo native's syscall handler.