Skip to content

Conversation

@dorimedini-starkware
Copy link
Collaborator

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Collaborator Author

dorimedini-starkware commented Oct 1, 2025

@dorimedini-starkware dorimedini-starkware self-assigned this Oct 1, 2025
@dorimedini-starkware dorimedini-starkware marked this pull request as ready for review October 1, 2025 08:43
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from 58cc596 to 97906d9 Compare October 1, 2025 08:45
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch from 0d96759 to 40cdcc7 Compare October 1, 2025 08:51
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from 97906d9 to 54669b5 Compare October 1, 2025 08:52
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch from 40cdcc7 to 7ae9c81 Compare October 5, 2025 07:45
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from 54669b5 to 331d175 Compare October 5, 2025 07:45
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch from 7ae9c81 to f661e8b Compare October 5, 2025 09:37
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from 331d175 to eccbbad Compare October 5, 2025 09:37
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch from b1c6cea to a010edf Compare October 14, 2025 10:21
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from 6ba2a44 to 3de0895 Compare October 14, 2025 10:21
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch from a010edf to 1460e98 Compare October 15, 2025 11:16
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from 3de0895 to ac793d6 Compare October 15, 2025 11:16
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch 2 times, most recently from 68be87e to 87b8d4e Compare October 19, 2025 07:04
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from ac793d6 to 5f4fc35 Compare October 19, 2025 07:05
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch from 87b8d4e to 4fddda3 Compare October 19, 2025 18:42
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from 5f4fc35 to 65aee29 Compare October 19, 2025 18:42
Copy link
Contributor

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

Q:

The Py test parametrized with private_keys and os_test_variant. What are the equivalents here?

possible TODOs:

  1. Use a macro or a function to create calldata with an inner call
  2. I don't think that the test adds an empty block in the multi-block ( let me know if I`m wrong )

@AvivYossef-starkware reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @meship-starkware and @Yoni-Starkware)


crates/starknet_os_flow_tests/src/initial_state.rs line 306 at r1 (raw file):

        nonce,
        resource_bounds,
        Felt::ONE,

Suggestion:

// Default salt.
Felt::ONE

crates/starknet_os_flow_tests/src/initial_state.rs line 321 at r1 (raw file):

    nonce: Nonce,
    resource_bounds: ValidResourceBounds,
    contract_address_salt: Felt,

Suggestion:

contract_address_salt: ContractAddressSalt

crates/starknet_os_flow_tests/src/tests.rs line 419 at r1 (raw file):

        .add_cairo0_declare_tx(tx, get_class_hash_of_feature_contract(cairo0_test_contract));

    // Deploy some instances of the test contract.

Suggestion:

// Deploy some instances of the deprecated test contract.

crates/starknet_os_flow_tests/src/tests.rs line 440 at r1 (raw file):

    let calldata = create_calldata(
        contract_addresses[0],
        "test_storage_read_write",

Note that in the py test we call set_value but Im ok with that.

Code quote:

test_storage_read_write

crates/starknet_os_flow_tests/src/tests.rs line 495 at r1 (raw file):

    if block_number_offset * txs_per_block < test_manager.total_txs() + 1 {
        block_number_offset += 1;
    }

I don't think that we add an empty block here, like in split_txs_into_blocks_in_multi_blocks

Code quote:

    // Calculate the block number of the next transaction.
    let txs_per_block = n_expected_txs / n_blocks_in_multi_block;
    // Calculate the block number of tx 'len(txs) + 1' without the added empty block.
    let mut block_number_offset = (test_manager.total_txs() + 1) / txs_per_block;
    if block_number_offset * txs_per_block < test_manager.total_txs() + 1 {
        block_number_offset += 1;
    }

crates/starknet_os_flow_tests/src/tests.rs line 516 at r1 (raw file):

        contract_addresses[0],
        "test_call_contract",
        &[**contract_addresses[0], selector_from_name("send_message").0, Felt::ONE, Felt::from(85)],

Suggestion:

    // Call contract -> send message to L1.
    let inner_selector_name = "test_call_contract";
    let inner_calldata = Felt::from(85);
    let inner_calldata_len = Felt::ONE;
    let calldata = create_calldata(
        contract_addresses[0],
        "test_call_contract",
        &[**contract_addresses[0], selector_from_name("send_message").0, inner_calldata_len, inner_calldata],

crates/starknet_os_flow_tests/src/tests.rs line 525 at r1 (raw file):

    };

    // Test get_contract_address.

Suggestion:

// Test get_caller_address syscall.

crates/starknet_os_flow_tests/src/tests.rs line 532 at r1 (raw file):

            *contract_addresses[1].0.key(),
            selector_from_name("test_get_caller_address").0,
            Felt::ONE,

Suggestion:

Felt::ONE, // Inner calldata len.

crates/starknet_os_flow_tests/src/tests.rs line 682 at r1 (raw file):

        ],
    );
    let signature = TransactionSignature(Arc::new(vec![Felt::from(100)]));

Why is it needed?

Code quote:

let signature = TransactionSignature(Arc::new(vec![Felt::from(100)]));

crates/starknet_os_flow_tests/src/tests.rs line 699 at r1 (raw file):

        ],
    );
    let signature = TransactionSignature(Arc::new(vec![Felt::from(100)]));

Why is it needed?

Code quote:

let signature = TransactionSignature(Arc::new(vec![Felt::from(100)]));

@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch from 4fddda3 to a6e3a01 Compare October 22, 2025 10:22
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from 65aee29 to cd53bd6 Compare October 22, 2025 10:23
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

good catch! this parametrization was added after I migrated the test...
I'll add the private keys parametrization now.
the os_test_variant is unecessary; it's just for converage. I'll update the coverage PR (later in the stack)

as for your questions:

  1. this, and other improvements (e.g. reduce boilerplate when adding declare/deploy txs), are a good idea, but the stack is already huge; we can do this later :)
  2. correct, no empty block is added. do you think it's important?

Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware, @meship-starkware, and @Yoni-Starkware)


crates/starknet_os_flow_tests/src/tests.rs line 495 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

I don't think that we add an empty block here, like in split_txs_into_blocks_in_multi_blocks

yes, this is why the expected_block_number has the -1


crates/starknet_os_flow_tests/src/tests.rs line 682 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

Why is it needed?

seems it really doesn't test anything interesting (was like this in the original test), removed


crates/starknet_os_flow_tests/src/tests.rs line 699 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

Why is it needed?

ditto


crates/starknet_os_flow_tests/src/tests.rs line 516 at r1 (raw file):

        contract_addresses[0],
        "test_call_contract",
        &[**contract_addresses[0], selector_from_name("send_message").0, Felt::ONE, Felt::from(85)],

how about like this? better?

Copy link
Contributor

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

  1. Sababa
  2. @meship-starkware WDYT?

@AvivYossef-starkware reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware, @meship-starkware, and @Yoni-Starkware)


crates/starknet_os_flow_tests/src/tests.rs line 516 at r1 (raw file):

Previously, dorimedini-starkware wrote…

how about like this? better?

Yes

Copy link
Contributor

@AvivYossef-starkware AvivYossef-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @Yoni-Starkware)

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

good catch! this parametrization was added after I migrated the test...
I'll add the private keys parametrization now.
the os_test_variant is unecessary; it's just for converage. I'll update the coverage PR (later in the stack)

as for your questions:

  1. this, and other improvements (e.g. reduce boilerplate when adding declare/deploy txs), are a good idea, but the stack is already huge; we can do this later :)
  2. correct, no empty block is added. do you think it's important?

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @Yoni-Starkware)

@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic branch from a6e3a01 to 5309233 Compare October 22, 2025 15:01
@dorimedini-starkware dorimedini-starkware force-pushed the 10-01-starknet_os_flow_tests_migrate_test_os_logic_and_some_small_refactors branch from cd53bd6 to bce8534 Compare October 22, 2025 15:02
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @Yoni-Starkware)

@dorimedini-starkware dorimedini-starkware changed the base branch from 10-01-blockifier_test_utils_add_functionality_to_test_contract_for_test_os_logic to main October 22, 2025 15:30
@github-actions
Copy link

Artifacts upload workflows:

Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

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

@dorimedini-starkware reviewed 1 of 4 files at r1, 2 of 2 files at r2, 10 of 10 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @Yoni-Starkware)

@dorimedini-starkware dorimedini-starkware added this pull request to the merge queue Oct 22, 2025
Merged via the queue into main with commit 8a217b4 Oct 22, 2025
28 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 24, 2025
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.

4 participants