Skip to content

starknet_api: add BlockHashVersion::V0_14_3 variant#13876

Closed
sirandreww-starkware wants to merge 1 commit intomainfrom
04-26-starknet_api_add_blockhashversion_v0_14_3_variant
Closed

starknet_api: add BlockHashVersion::V0_14_3 variant#13876
sirandreww-starkware wants to merge 1 commit intomainfrom
04-26-starknet_api_add_blockhashversion_v0_14_3_variant

Conversation

@sirandreww-starkware
Copy link
Copy Markdown
Contributor

No description provided.

This was referenced Apr 26, 2026
Copy link
Copy Markdown
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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> 

@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_config_rename_validate_price_per_height_to_validate_dynamic_config branch from 0b466cf to c77f96f Compare April 27, 2026 08:06
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-starknet_api_add_blockhashversion_v0_14_3_variant branch 2 times, most recently from 1fa271d to 8dc328e Compare April 27, 2026 10:26
Copy link
Copy Markdown
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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 tests test_hash_changes and test_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

@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-starknet_api_add_blockhashversion_v0_14_3_variant branch from 8dc328e to bd0d2c5 Compare April 27, 2026 10:31
@sirandreww-starkware sirandreww-starkware force-pushed the 04-19-apollo_consensus_orchestrator_config_rename_validate_price_per_height_to_validate_dynamic_config branch from c77f96f to 694e7c2 Compare April 27, 2026 10:31
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-starknet_api_add_blockhashversion_v0_14_3_variant branch from bd0d2c5 to e8a6182 Compare April 27, 2026 10:37
Copy link
Copy Markdown
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@sirandreww-starkware sirandreww-starkware changed the base branch from 04-19-apollo_consensus_orchestrator_config_rename_validate_price_per_height_to_validate_dynamic_config to graphite-base/13876 April 27, 2026 11:51
@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-starknet_api_add_blockhashversion_v0_14_3_variant branch from e8a6182 to 13afb9e Compare April 27, 2026 11:51
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/13876 to main April 27, 2026 11:51
Copy link
Copy Markdown
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Copy Markdown
Contributor Author

@sirandreww-starkware sirandreww-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-starknet_api_add_blockhashversion_v0_14_3_variant branch from 13afb9e to 137b319 Compare April 27, 2026 12:39
Copy link
Copy Markdown
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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"

@sirandreww-starkware sirandreww-starkware force-pushed the 04-26-starknet_api_add_blockhashversion_v0_14_3_variant branch from 137b319 to 607874a Compare April 28, 2026 07:38
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants