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

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

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
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, 2 unresolved discussions (waiting on @amosStarkware and @TzahiTaub)


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

Previously, TzahiTaub (Tzahi) wrote…

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

PTAL - refactored at the top of this stack.
not sure it is better, LMK what you think?


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

Previously, TzahiTaub (Tzahi) wrote…

Please verify that both slices are of the same length

Done.


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();

Done.

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.

:lgtm:

@TzahiTaub reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)


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

Previously, dorimedini-starkware wrote…

PTAL - refactored at the top of this stack.
not sure it is better, LMK what you think?

Well, in the PR it just adds more code and doesn't seem to simplify things, so I guess leaving it as is is 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.

@AvivYossef-starkware reviewed 1 of 2 files at r3.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)


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

pub(crate) struct FlowTestTx {
    tx: BlockifierTransaction,
    revert_reason: Option<String>,

Suggestion:

expected_revert_reason: Option<String>

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

        &mut self,
        tx: DeclareTransaction,
        compiled_class_hash: CompiledClassHash,

Unrelated q:
What is this compiled_class_hash?
Cairo O contracts shouldn't have it.

Code quote:

 compiled_class_hash: CompiledClassHash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants