starknet_api: add BlockHashVersion::V0_14_3 variant#13876
starknet_api: add BlockHashVersion::V0_14_3 variant#13876sirandreww-starkware wants to merge 1 commit intomainfrom
Conversation
18edaf1 to
fba7ec9
Compare
fba7ec9 to
3ed5828
Compare
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 4 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware, matanl-starkware, ShahakShama, and sirandreww-starkware).
a discussion (no related file):
Please modify crates/starknet_api/src/block_hash/block_hash_calculator_test.rs - the tests test_hash_changes and test_block_hash_regression.
crates/starknet_api/src/block_hash/block_hash_calculator.rs line 50 at r2 (raw file):
ascii_as_felt("STARKNET_BLOCK_HASH1").expect("ascii_as_felt failed for 'STARKNET_BLOCK_HASH1'") }); pub static STARKNET_BLOCK_HASH2: LazyLock<Felt> = LazyLock::new(|| {
IMO it's clearer, non-blocking.
If you accept it, please update the previous statics as well
Suggestion:
STARKNET_BLOCK_HASH2: LazyLock<BlockHashConstant> 0b466cf to
c77f96f
Compare
1fa271d to
8dc328e
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 2 comments and resolved 1 discussion.
Reviewable status: 3 of 5 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware, matanl-starkware, ShahakShama, and yoavGrs).
a discussion (no related file):
Previously, yoavGrs wrote…
Please modify
crates/starknet_api/src/block_hash/block_hash_calculator_test.rs- the teststest_hash_changesandtest_block_hash_regression.
Done - added V0_14_3 to test_block_hash_regression's #[values(...)] (with the corresponding expected hash), and parameterized the test_hash_changes macro on block_hash_version so change_field_of_hash_input now runs as an rstest over both V0_13_4 and V0_14_3.
crates/starknet_api/src/block_hash/block_hash_calculator.rs line 50 at r2 (raw file):
Previously, yoavGrs wrote…
IMO it's clearer, non-blocking.
If you accept it, please update the previous statics as well
Done
8dc328e to
bd0d2c5
Compare
c77f96f to
694e7c2
Compare
bd0d2c5 to
e8a6182
Compare
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 1 file and all commit messages, and made 1 comment.
Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware, matanl-starkware, ShahakShama, and sirandreww-starkware).
crates/starknet_api/src/block_hash/block_hash_calculator_test.rs line 231 at r3 (raw file):
#[rstest] fn change_field_of_hash_input( #[values(BlockHashVersion::V0_13_4, BlockHashVersion::V0_14_3)]
Changing fee_proposal won't change the hash for V0_13_4, so you need to test it only for V0_14_3.
7dbd196 to
ea0f7c1
Compare
e8a6182 to
13afb9e
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 1 comment.
Reviewable status: 4 of 5 files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware, matanl-starkware, ShahakShama, and yoavGrs).
crates/starknet_api/src/block_hash/block_hash_calculator_test.rs line 231 at r3 (raw file):
Previously, yoavGrs wrote…
Changing fee_proposal won't change the hash for V0_13_4, so you need to test it only for V0_14_3.
And I assume we only want to test the latest version? so no value in gating for different hash versions.
In any case, this PR is before the addition of fee_proposal to the hash, will add a TODO and fix it when fee proposal is introduced to the hash calculation
|
Artifacts upload workflows: |
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 1 file and all commit messages, made 2 comments, and resolved 1 discussion.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware, matanl-starkware, ShahakShama, and sirandreww-starkware).
crates/starknet_api/src/block_hash/block_hash_calculator_test.rs line 231 at r3 (raw file):
Previously, sirandreww-starkware (Andrew Luka) wrote…
And I assume we only want to test the latest version? so no value in gating for different hash versions.
In any case, this PR is before the addition of fee_proposal to the hash, will add a TODO and fix it when fee proposal is introduced to the hash calculation
Yes, we test only the latest.
crates/starknet_api/src/block_hash/block_hash_calculator_test.rs line 42 at r4 (raw file):
{ let partial_block_hash_components = PartialBlockHashComponents { starknet_version: BlockHashVersion::V0_13_4.into(),
Suggestion:
BlockHashVersion::V0_14_3
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 1 comment.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on dorimedini-starkware, matanl-starkware, ShahakShama, and yoavGrs).
crates/starknet_api/src/block_hash/block_hash_calculator_test.rs line 42 at r4 (raw file):
{ let partial_block_hash_components = PartialBlockHashComponents { starknet_version: BlockHashVersion::V0_13_4.into(),
This is done in #13814
Would you prefer this change to be done here? Isn't this change meaningless unless fee_proposal is added to the test?
I can do it here if you prefer
13afb9e to
137b319
Compare
yoavGrs
left a comment
There was a problem hiding this comment.
@yoavGrs reviewed 1 file and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status: 5 of 7 files reviewed, 1 unresolved discussion (waiting on dorimedini-starkware, matanl-starkware, ShahakShama, and sirandreww-starkware).
crates/blockifier/resources/blockifier_versioned_constants_0_14_3.json line 71 at r5 (raw file):
"allowed_virtual_os_program_hashes": [ "0x3e98c2d7703b03a7edb73ed7f075f97f1dcbaa8f717cdf6e1a57bf058265473", "0x46328da2901e5ccd1585a82de99fd97d0e757a876d6b66f29d8ca94bb5ba27b"
Do you need both hashes?
Please ask someone on the privacy team to review.
Code quote:
"0x3e98c2d7703b03a7edb73ed7f075f97f1dcbaa8f717cdf6e1a57bf058265473",
"0x46328da2901e5ccd1585a82de99fd97d0e757a876d6b66f29d8ca94bb5ba27b"137b319 to
607874a
Compare

No description provided.