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

Do you have access to the reason for reverting?
If so,, can you verify that the revert reason is as expected?

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


crates/starknet_os_flow_tests/src/tests.rs line 263 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", &[]),

The entry point needs to receive a value (storage write).

Code quote:

calldata: create_calldata(test_contract_address, "write_and_revert", &[])

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

    assert!(
        test_output.decompressed_state_diff.storage_updates.contains_key(&STRK_FEE_TOKEN_ADDRESS)
    );

Can you check that srorage key[FUNDED_ACCOUNT_ADDRESS] has changed? ( for the STRK_FEE_TOKEN_ADDRESS )

Code quote:

    assert!(
        test_output.decompressed_state_diff.storage_updates.contains_key(&STRK_FEE_TOKEN_ADDRESS)
    );

crates/blockifier_test_utils/resources/feature_contracts/cairo1/test_contract.cairo line 63 at r1 (raw file):

    }

    #[external(v0)]

Can you use test_revert_helper ?
( or do you want to be more specific )

Code quote:

    fn write_and_revert(self: @ContractState, address: StorageAddress, value: felt252) {
        let address_domain = 0;
        syscalls::storage_write_syscall(address_domain, address, value).unwrap_syscall();
        assert(1 == 0, 'Panic for revert');
    }

    #[external(v0)]

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.

already done :) (2 PRs ahead of this one)

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @meship-starkware, and @Yoni-Starkware)


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

Previously, AvivYossef-starkware wrote…

The entry point needs to receive a value (storage write).

you are correct, this is caught and fixed here, where I add control over revert reasons

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: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @meship-starkware, and @Yoni-Starkware)


crates/blockifier_test_utils/resources/feature_contracts/cairo1/test_contract.cairo line 63 at r1 (raw file):

Previously, AvivYossef-starkware wrote…

Can you use test_revert_helper ?
( or do you want to be more specific )

  1. I want to be more specific
  2. I want to use the same call and calldata for both cairo0 and cairo1 contracts - test_revert_helper is not on the cairo0 contract

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: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware, @meship-starkware, and @Yoni-Starkware)


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

Previously, dorimedini-starkware wrote…

you are correct, this is caught and fixed here, where I add control over revert reasons

sababa


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

#[rstest]
#[tokio::test]
async fn test_reverted_invoke_tx(

Suggestion:

/// This test verifies that when an entry point modifies storage and then reverts (panics):
/// 1. All storage changes made before the revert are properly rolled back.
/// 2. The transaction fee is still deducted from the caller's account.
async fn test_reverted_invoke_tx(

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

    assert!(
        test_output.decompressed_state_diff.storage_updates.contains_key(&STRK_FEE_TOKEN_ADDRESS)
    );

Can we verify specifically that the sender's balance changes?

Code quote:

    assert!(
        test_output.decompressed_state_diff.storage_updates.contains_key(&STRK_FEE_TOKEN_ADDRESS)
    );

@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_migrate_test_reverted_invoke_tx branch from 618347c to 45ca679 Compare October 5, 2025 07:44
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: 5 of 7 files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware, @meship-starkware, and @Yoni-Starkware)


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

Previously, AvivYossef-starkware wrote…

sababa

Done.

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.

:lgtm:

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

@dorimedini-starkware dorimedini-starkware force-pushed the 09-30-starknet_os_flow_tests_migrate_test_reverted_invoke_tx branch 3 times, most recently from 05fba72 to 7973059 Compare October 9, 2025 10:04
@github-actions
Copy link

github-actions bot commented Oct 9, 2025

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 2 files at r2, 1 of 21 files at r3, 38 of 38 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware and @Yoni-Starkware)

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 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 15, 2025
Merged via the queue into main with commit 1067fc1 Oct 15, 2025
28 of 30 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 17, 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