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 Sep 30, 2025

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.

Reviewable status: 0 of 3 files reviewed, all discussions resolved (waiting on @amosStarkware and @TzahiTaub)


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

        sender_address: *FUNDED_ACCOUNT_ADDRESS,
        nonce: nonce_manager.next(*FUNDED_ACCOUNT_ADDRESS),
        calldata: create_calldata(test_contract_address, "write_and_revert", &[Felt::ONE, Felt::TWO]),

was previously reverted, but for the wrong reason (missing params)

Code quote:

 &[Felt::ONE, Felt::TWO]

@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_add_control_for_expected_reverting_txs branch 2 times, most recently from 0a931fa to 923885c Compare September 30, 2025 14:11
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_migrate_test_reverted_l1_handler_tx branch from fc8c397 to 8611c44 Compare October 5, 2025 07:44
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_add_control_for_expected_reverting_txs branch from 923885c to 57fc21d Compare October 5, 2025 07:44
Copy link
Contributor

@TzahiTaub TzahiTaub left a comment

Choose a reason for hiding this comment

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

@TzahiTaub reviewed 1 of 1 files at r2, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @amosStarkware)


crates/starknet_os_flow_tests/src/test_manager.rs line 94 at r3 (raw file):

    tx: BlockifierTransaction,
    revert_reason: Option<String>,
}

Just to ask, do you think the optional field is better than having an enum for the entire tx? With something like this pseudo?

Suggestion:

pub(crate) enum FlowTestTx {
    succesful/accepted({tx: BlockifierTransaction})
    reverted({
    tx: BlockifierTransaction,
    revert_reason: String}
}

crates/starknet_os_flow_tests/src/test_manager.rs line 445 at r3 (raw file):

    fn verify_execution_outputs(
        revert_reasons: &[Option<String>],
        execution_outputs: &[(TransactionExecutionInfo, StateMaps)],

Please verify that both slices are of the same length

Code quote:

        revert_reasons: &[Option<String>],
        execution_outputs: &[(TransactionExecutionInfo, StateMaps)],

crates/starknet_os_flow_tests/src/test_manager.rs line 529 at r3 (raw file):

                .into_iter()
                .map(|flow_test_tx| (flow_test_tx.tx, flow_test_tx.revert_reason))
                .unzip();

Suggestion:

            let (block_txs, revert_reasons): (Vec<_>, Vec<_>) = block_txs_with_reason
                .into_iter()
                .map(|flow_test_tx| (flow_test_tx.tx, flow_test_tx.revert_reason))
                .unzip();
            // Clone the block info for later use.

@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_migrate_test_reverted_l1_handler_tx branch from 8611c44 to 4991eb5 Compare October 5, 2025 09:37
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_add_control_for_expected_reverting_txs branch from 57fc21d to 1178d98 Compare October 5, 2025 09:37
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_migrate_test_reverted_l1_handler_tx branch from 13fbf11 to b40ab5c Compare October 14, 2025 10:20
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_add_control_for_expected_reverting_txs branch from b83b978 to 68f9b19 Compare October 14, 2025 10:21
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_migrate_test_reverted_l1_handler_tx branch from b40ab5c to 58caca8 Compare October 15, 2025 11:14
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_add_control_for_expected_reverting_txs branch from 68f9b19 to f88053c Compare October 15, 2025 11:14
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_migrate_test_reverted_l1_handler_tx branch from 58caca8 to 9593ab0 Compare October 15, 2025 11:33
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_add_control_for_expected_reverting_txs branch from f88053c to d414c5c Compare October 15, 2025 11:51
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: 1 of 3 files reviewed, all discussions resolved (waiting on @amosStarkware and @TzahiTaub)


crates/starknet_os_flow_tests/src/test_manager.rs line 333 at r3 (raw file):

Previously, dorimedini-starkware wrote…

StarknetOsInput uses this type as the key for the deprecated_compiled_classes map, is this a bug?
since "class hash" refers to sierra hash and "compiled class hash" refers to casm hash, maybe "compiled class hash" is a better term for a cairo0 compiled contract hash. no?

What is this represent? The hash of what?
I see that in thin state_diff it saved by class_hash.
There is class_hash for deprecated contract class here

#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
pub struct StateDiff {
    pub deployed_contracts: IndexMap<ContractAddress, ClassHash>,
    pub storage_diffs: IndexMap<ContractAddress, IndexMap<StorageKey, Felt>>,
    pub declared_classes: IndexMap<ClassHash, (CompiledClassHash, SierraContractClass)>,
    pub migrated_compiled_classes: IndexMap<ClassHash, CompiledClassHash>,
    pub deprecated_declared_classes: IndexMap<ClassHash, DeprecatedContractClass>,
    pub nonces: IndexMap<ContractAddress, Nonce>,
}

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.

Reviewable status: 1 of 3 files reviewed, all discussions resolved (waiting on @amosStarkware and @TzahiTaub)


crates/starknet_os_flow_tests/src/test_manager.rs line 333 at r3 (raw file):

Previously, AvivYossef-starkware wrote…

What is this represent? The hash of what?
I see that in thin state_diff it saved by class_hash.
There is class_hash for deprecated contract class here

#[derive(Debug, Default, Clone, Eq, PartialEq, Deserialize, Serialize)]
pub struct StateDiff {
    pub deployed_contracts: IndexMap<ContractAddress, ClassHash>,
    pub storage_diffs: IndexMap<ContractAddress, IndexMap<StorageKey, Felt>>,
    pub declared_classes: IndexMap<ClassHash, (CompiledClassHash, SierraContractClass)>,
    pub migrated_compiled_classes: IndexMap<ClassHash, CompiledClassHash>,
    pub deprecated_declared_classes: IndexMap<ClassHash, DeprecatedContractClass>,
    pub nonces: IndexMap<ContractAddress, Nonce>,
}

this represents the hash of a cairo0 contract.
there is only one way to compute this hash (right?)
(unlike cairo1, where we have sierra/casm hashes)

in any case, since the issue is the type in the OS input struct, I would say this is out of scope... and not a blocker, because the underlying type is a Felt anyway

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: 1 of 3 files reviewed, all discussions resolved (waiting on @amosStarkware and @TzahiTaub)


crates/starknet_os_flow_tests/src/test_manager.rs line 333 at r3 (raw file):

Previously, dorimedini-starkware wrote…

this represents the hash of a cairo0 contract.
there is only one way to compute this hash (right?)
(unlike cairo1, where we have sierra/casm hashes)

in any case, since the issue is the type in the OS input struct, I would say this is out of scope... and not a blocker, because the underlying type is a Felt anyway

Yes, it's definitely out of scope,
But we should change it in a different PR to be consistent

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.

Reviewable status: 1 of 3 files reviewed, all discussions resolved (waiting on @amosStarkware and @TzahiTaub)


crates/starknet_os_flow_tests/src/test_manager.rs line 333 at r3 (raw file):

Previously, AvivYossef-starkware wrote…

Yes, it's definitely out of scope,
But we should change it in a different PR to be consistent

PR

@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_add_control_for_expected_reverting_txs branch from d414c5c to 4b5b4f7 Compare October 19, 2025 07:04
@dorimedini-starkware dorimedini-starkware changed the base branch from 09-30-starknet_os_flow_tests_migrate_test_reverted_l1_handler_tx to main October 19, 2025 07:04
@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_add_control_for_expected_reverting_txs branch from 4b5b4f7 to 6faf450 Compare October 19, 2025 18:41
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 r2, 2 of 2 files at r7, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)

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

5 participants