Skip to content

apollo_integration_tests: add regression tests for matching the proof generation#13952

Merged
einat-starkware merged 1 commit into
main-v0.14.2from
einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation
May 13, 2026
Merged

apollo_integration_tests: add regression tests for matching the proof generation#13952
einat-starkware merged 1 commit into
main-v0.14.2from
einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation

Conversation

@einat-starkware
Copy link
Copy Markdown
Contributor

No description provided.

@reviewable-StarkWare
Copy link
Copy Markdown

This change is Reviewable

Copy link
Copy Markdown
Contributor Author

einat-starkware commented May 4, 2026

@cursor
Copy link
Copy Markdown

cursor Bot commented May 4, 2026

PR Summary

Low Risk
Low risk: changes are confined to test utilities and integration/flow tests, adding assertions and refactoring constants without affecting production logic.

Overview
Adds regression coverage to keep proof-flow fixtures in sync with the current virtual-OS pipeline and versioned constants.

Promotes the proof-flow genesis global root and STRK fee token address into shared expect-test-backed constants (EXPECTED_PROOF_FLOW_GENESIS_GLOBAL_ROOT, EXPECTED_STRK_FEE_TOKEN_ADDRESS), updates chain-info construction to use them, and adds new tests that (1) ensure the fixture program hash remains in allowed_virtual_os_program_hashes and (2) verify the virtual-OS-derived fee token address and genesis global root still match what the proof-flow integration tests/fixtures expect.

Reviewed by Cursor Bugbot for commit cca9a48. Bugbot is set up for automated code reviews on this repo. Configure here.

Comment thread crates/starknet_os_flow_tests/src/virtual_os_test.rs Outdated
@einat-starkware einat-starkware force-pushed the einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation branch from 04c025a to 43deaa1 Compare May 4, 2026 09:59
@einat-starkware einat-starkware force-pushed the einat/proof-flow-verify-integration branch from 244277b to d9603a5 Compare May 4, 2026 09:59
@einat-starkware einat-starkware force-pushed the einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation branch from 43deaa1 to f40e4a2 Compare May 4, 2026 13:08
@einat-starkware einat-starkware force-pushed the einat/proof-flow-verify-integration branch 2 times, most recently from 8c37711 to ba0e2d8 Compare May 4, 2026 13:46
@einat-starkware einat-starkware force-pushed the einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation branch from f40e4a2 to a47519c Compare May 4, 2026 13:46
@einat-starkware einat-starkware force-pushed the einat/proof-flow-verify-integration branch from ba0e2d8 to 4e73a75 Compare May 5, 2026 08:05
@einat-starkware einat-starkware force-pushed the einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation branch from a47519c to 3a3e4b1 Compare May 5, 2026 08:05
Copy link
Copy Markdown
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.

@Yoni-Starkware reviewed 3 files and all commit messages, and made 2 comments.
Reviewable status: 3 of 4 files reviewed, 2 unresolved discussions (waiting on einat-starkware).


crates/starknet_os_flow_tests/src/virtual_os_test.rs line 332 at r2 (raw file):

    EXPECTED_PROOF_FLOW_STRK_FEE_TOKEN_ADDRESS
        .assert_eq(&virtual_os_strk_fee_token_address.to_hex_string());
}

WDYT about moving EXPECTED_STRK_FEE_TOKEN_ADDRESS to a shared location like blockifier_test_utils?

We already have have a test for it here:

EXPECTED_STRK_FEE_TOKEN_ADDRESS.assert_debug_eq(&**address);

Code quote:

fn proof_flow_chain_info_matches_virtual_os_test() {
    let virtual_os_strk_fee_token_address = block_context_for_flow_tests(BlockNumber(0), false)
        .chain_info()
        .fee_token_addresses
        .strk_fee_token_address;
    EXPECTED_PROOF_FLOW_STRK_FEE_TOKEN_ADDRESS
        .assert_eq(&virtual_os_strk_fee_token_address.to_hex_string());
}

crates/starknet_os_flow_tests/src/virtual_os_test.rs line 350 at r2 (raw file):

    .global_root();
    EXPECTED_PROOF_FLOW_GENESIS_GLOBAL_ROOT.assert_eq(&virtual_os_global_root.0.to_hex_string());
}

Regarding what we talked about in Slack: your proof regression test should also store these values and check that they match the consts.

Code quote:

/// Guards against drift between the genesis global root the proof-flow integration test seeds into
/// storage and the initial global root produced by the virtual OS test pipeline. Run with
/// `UPDATE_EXPECT=1` to refresh the constant in `apollo_integration_tests::state_reader`, then
/// regenerate the proof fixtures by running `cargo +nightly-2025-07-14 test -p
/// starknet_os_flow_tests --features starknet_transaction_prover/stwo_proving --release
/// generate_proof_fixtures -- --ignored`.
#[tokio::test(flavor = "multi_thread")]
async fn proof_flow_global_root_matches_virtual_os_test() {
    let (initial_state_data, []) =
        create_default_initial_state_data::<DictStateReader, 0>([]).await;
    let virtual_os_global_root = StateRoots {
        contracts_trie_root_hash: initial_state_data.initial_state.contracts_trie_root_hash,
        classes_trie_root_hash: initial_state_data.initial_state.classes_trie_root_hash,
    }
    .global_root();
    EXPECTED_PROOF_FLOW_GENESIS_GLOBAL_ROOT.assert_eq(&virtual_os_global_root.0.to_hex_string());
}

@einat-starkware einat-starkware force-pushed the einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation branch from 3a3e4b1 to a7317e9 Compare May 6, 2026 07:20
@einat-starkware einat-starkware force-pushed the einat/proof-flow-verify-integration branch 2 times, most recently from 563cd56 to b9f62f9 Compare May 6, 2026 09:00
@einat-starkware einat-starkware force-pushed the einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation branch 2 times, most recently from a2666ee to f593e4f Compare May 6, 2026 09:07
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit f593e4f. Configure here.

Comment thread crates/starknet_os_flow_tests/src/initial_state.rs Outdated
@einat-starkware einat-starkware force-pushed the einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation branch from f593e4f to af159ac Compare May 6, 2026 09:23
Copy link
Copy Markdown
Contributor Author

@einat-starkware einat-starkware left a comment

Choose a reason for hiding this comment

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

@einat-starkware made 2 comments.
Reviewable status: 2 of 10 files reviewed, 2 unresolved discussions (waiting on Yoni-Starkware).


crates/starknet_os_flow_tests/src/virtual_os_test.rs line 332 at r2 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…

WDYT about moving EXPECTED_STRK_FEE_TOKEN_ADDRESS to a shared location like blockifier_test_utils?

We already have have a test for it here:

EXPECTED_STRK_FEE_TOKEN_ADDRESS.assert_debug_eq(&**address);

Good idea, moved to blockifier test utils


crates/starknet_os_flow_tests/src/virtual_os_test.rs line 350 at r2 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…

Regarding what we talked about in Slack: your proof regression test should also store these values and check that they match the consts.

I added a test for the allowed program hashes, is that what you mean or should I add something else?

Copy link
Copy Markdown
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.

:lgtm:

@Yoni-Starkware reviewed 8 files and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on einat-starkware).

@graphite-app graphite-app Bot changed the base branch from einat/proof-flow-verify-integration to graphite-base/13952 May 12, 2026 17:42
@einat-starkware einat-starkware force-pushed the einat/05-04-apollo_integration_tests_add_regression_tests_for_matching_the_proof_generation branch from af159ac to cca9a48 Compare May 12, 2026 19:38
@graphite-app graphite-app Bot changed the base branch from graphite-base/13952 to main-v0.14.2 May 12, 2026 19:39
@graphite-app
Copy link
Copy Markdown

graphite-app Bot commented May 12, 2026

Merge activity

  • May 12, 7:39 PM UTC: Graphite rebased this pull request, because this pull request is set to merge when ready.

Copy link
Copy Markdown
Contributor Author

@einat-starkware einat-starkware left a comment

Choose a reason for hiding this comment

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

@einat-starkware reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on einat-starkware).

@einat-starkware einat-starkware added this pull request to the merge queue May 13, 2026
Merged via the queue into main-v0.14.2 with commit a962748 May 13, 2026
88 of 181 checks passed
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.

3 participants