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

chore(cairo_native): update cairo native version in rust to 0.3.1 #4160

Merged
merged 1 commit into from
Feb 16, 2025

Conversation

meship-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

@meship-starkware meship-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 8 files reviewed, 1 unresolved discussion (waiting on @avi-starkware and @noaov1)


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

        execution_result.execution.gas_consumed == native_execution_result.execution.gas_consumed
    );
}

I added this just to make sure that 0.3.1 solved the circuit problem, but if you think it might be useful to have a test that checks that native and casm have the same builtins prices I can add this test with some changes in another PR

Code quote:

#[cfg(feature = "cairo_native")]
#[test]
fn test_circuit() {
    let test_contract = FeatureContract::TestContract(CairoVersion::Cairo1(RunnableCairo1::Casm));
    let native_test_contract =
        FeatureContract::TestContract(CairoVersion::Cairo1(RunnableCairo1::Native));
    let chain_info = &ChainInfo::create_for_testing();
    let mut state = test_state(chain_info, BALANCE, &[(test_contract, 1)]);
    let mut native_state = test_state(chain_info, BALANCE, &[(native_test_contract, 1)]);

    let calldata = calldata![];
    let entry_point_call = CallEntryPoint {
        entry_point_selector: selector_from_name("test_circuit"),
        calldata,
        ..trivial_external_entry_point_new(test_contract)
    };

    let execution_result = entry_point_call.clone().execute_directly(&mut state).unwrap();
    let native_execution_result = entry_point_call.execute_directly(&mut native_state).unwrap();
    println!("casm gas consumed: {}", execution_result.execution.gas_consumed);
    println!("native gas consumed: {}", native_execution_result.execution.gas_consumed);
    assert!(
        execution_result.execution.gas_consumed == native_execution_result.execution.gas_consumed
    );
}

Copy link
Contributor Author

@meship-starkware meship-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 8 files reviewed, 1 unresolved discussion (waiting on @avi-starkware and @noaov1)


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

Previously, meship-starkware (Meshi Peled) wrote…

I added this just to make sure that 0.3.1 solved the circuit problem, but if you think it might be useful to have a test that checks that native and casm have the same builtins prices I can add this test with some changes in another PR

talked f2f we don't want this at the moment
Done.

Copy link
Collaborator

@avi-starkware avi-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:

Reviewed 7 of 8 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)

@meship-starkware meship-starkware changed the title Update cairo native version in rust to 0.3.1 chore(cairo_native): update cairo native version in rust to 0.3.1 Feb 16, 2025
Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

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

Reviewed 7 of 8 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @meship-starkware)


crates/starknet_api/src/contract_class.rs line 34 at r3 (raw file):

}

// TODO(Meshi): Share this code with the blockifier crate.

Maybe add this TODO in the blockifier (to use the method defined in starknet api). Starknet api should not be aware to the blockifier.

Code quote:

// TODO(Meshi): Share this code with the blockifier crate.

Copy link
Contributor Author

@meship-starkware meship-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 6 of 8 files at r1, 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware)

Copy link
Contributor Author

@meship-starkware meship-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 8 files at r1.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @meship-starkware)

Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

@meship-starkware meship-starkware merged commit 0384709 into main-v0.13.4 Feb 16, 2025
21 checks passed
@meship-starkware meship-starkware deleted the meship/update_to_0.3.1 branch February 16, 2025 12:20
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 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