starknet_os_flow_tests: fuzz test get block hash scenario#13155
Conversation
0a49942 to
7988531
Compare
d4f0ad4 to
ff032c0
Compare
2908864 to
f464e9b
Compare
ff032c0 to
9941f34
Compare
f464e9b to
2cd2c2c
Compare
9941f34 to
3f3bd7c
Compare
2cd2c2c to
46d6f19
Compare
46d6f19 to
f53991f
Compare
04c43c5 to
8a163d3
Compare
1d2ec81 to
8d11fbc
Compare
8a163d3 to
5f143fe
Compare
8d11fbc to
198d30e
Compare
5f143fe to
2e7ba5f
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware reviewed 4 files and all commit messages, and made 1 comment.
Reviewable status: 4 of 14 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware).
crates/blockifier_test_utils/resources/feature_contracts/cairo1/fuzz_revert_orchestrator.cairo line 133 at r3 (raw file):
if contains_unexpected_error { panic(error); }
wat? no in or .contains in cairo?
Code quote:
let mut contains_unexpected_error = false;
for error_value in error
.span() {
for unexpected_error in unexpected_errors {
if error_value == unexpected_error {
contains_unexpected_error = true;
break;
}
}
}
if contains_unexpected_error {
panic(error);
}
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware reviewed 2 files.
Reviewable status: 6 of 14 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware).
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware made 1 comment.
Reviewable status: 6 of 14 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware and Yoni-Starkware).
crates/blockifier_test_utils/resources/feature_contracts/cairo1/fuzz_revert_orchestrator.cairo line 133 at r3 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
wat? no
inor.containsin cairo?
claude says no, can't see anything in the cairo book
198d30e to
ff5ef8e
Compare
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: 7 of 14 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware).
crates/blockifier_test_utils/resources/feature_contracts/cairo1/fuzz_revert_orchestrator.cairo line 133 at r3 (raw file):
Previously, dorimedini-starkware wrote…
claude says no, can't see anything in the cairo book
According to claude there's this
let found = array![1_u8, 2, 3].into_iter().any(|e| e == needle);
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware made 1 comment.
Reviewable status: 7 of 14 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware and Yoni-Starkware).
crates/blockifier_test_utils/resources/feature_contracts/cairo1/fuzz_revert_orchestrator.cairo line 133 at r3 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
According to claude there's this
let found = array![1_u8, 2, 3].into_iter().any(|e| e == needle);
yes, that's still two loops: iterate over array and iterate over the heystack
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware resolved 1 discussion.
Reviewable status: 7 of 14 files reviewed, all discussions resolved (waiting on dorimedini-starkware).
dorimedini-starkware
left a comment
There was a problem hiding this comment.
@dorimedini-starkware reviewed 7 files.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on dorimedini-starkware).
Yoni-Starkware
left a comment
There was a problem hiding this comment.
@Yoni-Starkware made 1 comment.
Reviewable status:complete! all files reviewed, all discussions resolved.
crates/blockifier_test_utils/resources/feature_contracts/cairo1/fuzz_revert_orchestrator.cairo line 133 at r3 (raw file):
Previously, dorimedini-starkware wrote…
yes, that's still two loops: iterate over
arrayand iterate over the heystack
What? How do you know it's two loops and not one?
Note
Medium Risk
Adds a new fuzz scenario that exercises
get_block_hashsyscall behavior and modifies block advancement/address expectations, which could make the fuzz harness more brittle if block-number assumptions change.Overview
Adds a new fuzz operation/scenario (
17) to exercise theget_block_hashsyscall: Cairo1 contracts now callsyscalls::get_block_hash_syscalland validate both expected success (retrospective block) and expected failure (out-of-range), while Cairo0 explicitly reverts withget_block_hash_cairo0.Updates the orchestrator contract to expose new unexpected-error panic messages and improves error/OOB handling, plus refactors Cairo1 immediate-syscall failure handling via
maybe_unwrap_error.Enhances the Rust fuzz harness to generate
GetBlockHashoperations, track the testblock_number, advance blocks to passSTORED_BLOCK_HASH_BUFFER, and addsTestManager::get_current_block_number; this changes expected deployed contract addresses and updates the Cairo0 compiled artifact accordingly.Reviewed by Cursor Bugbot for commit ff5ef8e. Bugbot is set up for automated code reviews on this repo. Configure here.