Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(blockifier): revert storgae changes #2913

Merged
merged 1 commit into from
Dec 25, 2024

Conversation

AvivYossef-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

AvivYossef-starkware commented Dec 24, 2024

Copy link
Collaborator

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

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


crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs line 213 at r1 (raw file):

    for call in outer_call.iter() {
        assert_eq!(call.tracked_resource, TrackedResource::SierraGas);
    }

what is this for...?
also, just because sierra gas is tracked, doesn't mean native is running

Code quote:

    // Check that the tracked resource is SierraGas to make sure that Native is running.
    for call in outer_call.iter() {
        assert_eq!(call.tracked_resource, TrackedResource::SierraGas);
    }

Copy link
Collaborator

@Yoni-Starkware Yoni-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)


crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs line 213 at r1 (raw file):

Previously, dorimedini-starkware wrote…

what is this for...?
also, just because sierra gas is tracked, doesn't mean native is running

Yeah that's my code. Currently Native is transparent, but it should run (given the test case) only when all calls are of SierraGas mode.

That's the best we can do right now. We should probably add some flag somewhere, for sanity. Out of scope.

Copy link
Collaborator

@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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware)

Copy link
Collaborator

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

:lgtm:

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware)

Copy link
Collaborator

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

Reviewed all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AvivYossef-starkware)


a discussion (no related file):
blocking until I'm sure the base branch is correct

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/test_cairo_panic branch 2 times, most recently from aa6067b to 52633ad Compare December 24, 2024 12:21
@AvivYossef-starkware AvivYossef-starkware changed the base branch from aviv/test_cairo_panic to graphite-base/2913 December 24, 2024 12:56
@AvivYossef-starkware AvivYossef-starkware changed the base branch from graphite-base/2913 to main-v0.13.4 December 24, 2024 12:57
Copy link
Collaborator

@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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware)

Copy link
Collaborator

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

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

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 4 files at r1, 2 of 2 files at r3, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @AvivYossef-starkware)


crates/blockifier/feature_contracts/cairo1/test_contract.cairo line 119 at r3 (raw file):

    /// The function performs the following:
    /// 1. Calls `write_10_to_my_storage_var` to set the storage variable to 10.
    /// 2. Calls `test_revert_helper` with `to_panic` = true`.

Suggestion:

`to_panic=true`.

crates/blockifier/feature_contracts/cairo1/test_contract.cairo line 121 at r3 (raw file):

    /// 2. Calls `test_revert_helper` with `to_panic` = true`.
    ///    - `test_revert_helper` is expected to change the storage variable to 17 and then panic.
    /// 3. Verifies that the `test_revert_helper`` changes are reverted,

Suggestion:

// 3. Verifies that the `test_revert_helper` changes are reverted,

crates/blockifier/feature_contracts/cairo1/test_contract.cairo line 127 at r3 (raw file):

        ref self: ContractState,
        contract_address: ContractAddress,
        class_hash: ClassHash,

Please rename other relevant functions to make it clear

Suggestion:

replacement_class_hash

crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs line 174 at r3 (raw file):

    let mut state = test_state(chain_info, BALANCE, &[(test_contract, 1), (empty_contract, 0)]);

    // Call data of contract A

Suggestion:

    // Calldata of contract A.

crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs line 179 at r3 (raw file):

            FeatureContract::TestContract(CairoVersion::Cairo1(RunnableCairo1::Casm))
                .get_instance_address(0)
                .into(),

Please fix other places

Suggestion:

            test_contract.get_instance_address(0).into(),

Copy link
Contributor Author

@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 4 files reviewed, 5 unresolved discussions (waiting on @dorimedini-starkware and @Yoni-Starkware)


crates/blockifier/feature_contracts/cairo1/test_contract.cairo line 127 at r3 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…

Please rename other relevant functions to make it clear

Done.


crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs line 179 at r3 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…

Please fix other places

in different PR


crates/blockifier/src/execution/syscalls/syscall_tests/call_contract.rs line 174 at r3 (raw file):

    let mut state = test_state(chain_info, BALANCE, &[(test_contract, 1), (empty_contract, 0)]);

    // Call data of contract A

Done.


crates/blockifier/feature_contracts/cairo1/test_contract.cairo line 119 at r3 (raw file):

    /// The function performs the following:
    /// 1. Calls `write_10_to_my_storage_var` to set the storage variable to 10.
    /// 2. Calls `test_revert_helper` with `to_panic` = true`.

Done.


crates/blockifier/feature_contracts/cairo1/test_contract.cairo line 121 at r3 (raw file):

    /// 2. Calls `test_revert_helper` with `to_panic` = true`.
    ///    - `test_revert_helper` is expected to change the storage variable to 17 and then panic.
    /// 3. Verifies that the `test_revert_helper`` changes are reverted,

Done.

Copy link
Collaborator

@Yoni-Starkware Yoni-Starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware)

Copy link
Collaborator

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

Reviewed 1 of 3 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @AvivYossef-starkware)

@AvivYossef-starkware AvivYossef-starkware merged commit 3ee6e46 into main-v0.13.4 Dec 25, 2024
12 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 2024
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