Skip to content

Conversation

@ArniStarkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@ArniStarkware ArniStarkware marked this pull request as ready for review November 30, 2025 14:46
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/caching branch from b71a015 to f78ae7f Compare November 30, 2025 15:51
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/wait_on_native_compilation branch from 8662f9d to b1c40c5 Compare November 30, 2025 15:51
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/caching branch from f78ae7f to b4ccc10 Compare November 30, 2025 19:16
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/wait_on_native_compilation branch from b1c40c5 to d24c18a Compare November 30, 2025 19:16
Copy link
Contributor Author

@ArniStarkware ArniStarkware 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 1 files reviewed, 1 unresolved discussion (waiting on @avivg-starkware, @noaov1, and @TzahiTaub)


a discussion (no related file):
See this discussion:
https://stackoverflow.com/questions/31195529/escaping-commas-in-macro-output

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.

Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @avivg-starkware, and @noaov1)


crates/blockifier/src/state/state_reader_and_contract_manager_test.rs line 168 at r1 (raw file):

            is_declared_result: None,
        },
        expected_result: Ok(RunnableCompiledClass::test_casm_contract_class()),

IIUC, when the test runs with native, it tries to compile the contract, fails (as the sierra code is invalid, maybe there a re more reasons), puts in the cache a value of CompiledClasses::V1Native(CachedCairoNative::CompilationFailed(CompiledClassV1)), and when it returns via the get_compiled_class (using the to_runnable) it's returned as a regular casm so the test succeeds. I'm not sure this test should test the native class manager, the dedicated test above might be enough, but the current flow for the native runs hides unexpected behavior (specifically, if we replace the empty sierra with the right one this test should fail). Need to think how to make the test succeed in native, or close it for native entirely

Code quote:

        expected_result: Ok(RunnableCompiledClass::test_casm_contract_class()),

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.

Reviewable status: 0 of 1 files reviewed, 2 unresolved discussions (waiting on @ArniStarkware, @avivg-starkware, and @noaov1)


crates/blockifier/src/state/state_reader_and_contract_manager_test.rs line 168 at r1 (raw file):

Previously, TzahiTaub (Tzahi) wrote…

IIUC, when the test runs with native, it tries to compile the contract, fails (as the sierra code is invalid, maybe there a re more reasons), puts in the cache a value of CompiledClasses::V1Native(CachedCairoNative::CompilationFailed(CompiledClassV1)), and when it returns via the get_compiled_class (using the to_runnable) it's returned as a regular casm so the test succeeds. I'm not sure this test should test the native class manager, the dedicated test above might be enough, but the current flow for the native runs hides unexpected behavior (specifically, if we replace the empty sierra with the right one this test should fail). Need to think how to make the test succeed in native, or close it for native entirely

I think that if the cache is tested for native in the previous test (i.e., that we get CachedCairoNative::Compiled from the the manager for appropriate cairo 1), we can just put this entire test under #[cfg(not(feature = "cairo_native"))]

@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/caching branch from b4ccc10 to 1823079 Compare December 2, 2025 10:51
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/wait_on_native_compilation branch from d24c18a to 84c4a08 Compare December 2, 2025 10:51
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/caching branch from 1823079 to 9876970 Compare December 2, 2025 11:19
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/wait_on_native_compilation branch from 84c4a08 to 2d30889 Compare December 2, 2025 11:19
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.

Reviewable status: 0 of 1 files reviewed, 3 unresolved discussions (waiting on @ArniStarkware, @avivg-starkware, and @noaov1)


crates/blockifier/src/state/state_reader_and_contract_manager_test.rs line 175 at r2 (raw file):

    GetCompiledClassTestScenario {
        expectations: GetCompiledClassTestExpectation {
            get_compiled_classes_result: Some(Ok(CompiledClasses::from_runnable_for_testing(

As long as this function returns SierraContractClass::default() for the V1, the native feature cannot be tested properly in the below unit test.

Code quote:

from_runnable_for_testing(

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, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ArniStarkware, @avivg-starkware, and @noaov1)

@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/caching branch from 9876970 to 8918ab4 Compare December 2, 2025 17:55
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/wait_on_native_compilation branch from 2d30889 to 8c5631d Compare December 2, 2025 17:55
@ArniStarkware ArniStarkware changed the base branch from arni/blockifier/state_reader_and_contract_manager/unit_tests/caching to graphite-base/10493 December 2, 2025 18:54
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/wait_on_native_compilation branch from 8c5631d to 61bf8f1 Compare December 2, 2025 18:54
@ArniStarkware ArniStarkware changed the base branch from graphite-base/10493 to main-v0.14.1 December 2, 2025 18:54
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/wait_on_native_compilation branch from 61bf8f1 to c3f6aae Compare December 3, 2025 05:50
@ArniStarkware ArniStarkware force-pushed the arni/blockifier/state_reader_and_contract_manager/unit_tests/wait_on_native_compilation branch from c3f6aae to 8c2c56e Compare December 3, 2025 11:55
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