Skip to content

Conversation

@AvivYossef-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/class_provider branch 2 times, most recently from 042c72c to ef84d39 Compare December 23, 2025 08:41
@AvivYossef-starkware AvivYossef-starkware force-pushed the aviv/share_test_utils branch 2 times, most recently from aaab0d0 to 29a4c1b Compare December 23, 2025 12:53
@AvivYossef-starkware AvivYossef-starkware changed the base branch from aviv/share_test_utils to graphite-base/10939 December 24, 2025 09:34
@AvivYossef-starkware AvivYossef-starkware changed the base branch from graphite-base/10939 to aviv/share_test_utils December 24, 2025 12:49
Copy link
Collaborator

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

@meship-starkware partially reviewed 5 files.
Reviewable status: 2 of 5 files reviewed, all discussions resolved (waiting on @avi-starkware and @noaov1).

Copy link
Collaborator

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

:lgtm:

@meship-starkware made 1 comment.
Reviewable status: 2 of 5 files reviewed, all discussions resolved (waiting on @avi-starkware and @noaov1).

@graphite-app graphite-app bot changed the base branch from aviv/share_test_utils to graphite-base/10939 December 24, 2025 12:55
@AvivYossef-starkware AvivYossef-starkware changed the base branch from graphite-base/10939 to aviv/share_test_utils December 24, 2025 13:58
@AvivYossef-starkware AvivYossef-starkware changed the base branch from aviv/share_test_utils to main December 24, 2025 14:14
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.

@Yoni-Starkware reviewed 2 files and all commit messages, and made 2 comments.
Reviewable status: 2 of 8 files reviewed, 2 unresolved discussions (waiting on @avi-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1).


crates/starknet_os_runner/src/virtual_block_executor_test.rs line 68 at r4 (raw file):

    // Calldata for account's __execute__ (Cairo 0 OZ account format):
    // [call_array_len, call_array..., calldata_len, calldata...]

Remove this struct and add `execution_flag to the original RPC struct (with default values)

Code quote:

/// Test wrapper for RpcStateReader that overrides execution flags to skip validation.
struct TestRpcVirtualBlockExecutor(RpcVirtualBlockExecutor);

impl VirtualBlockExecutor for TestRpcVirtualBlockExecutor {
    fn block_context(
        &self,
        block_number: BlockNumber,
    ) -> Result<blockifier::context::BlockContext, VirtualBlockExecutorError> {
        self.0.block_context(block_number)
    }

    fn state_reader(
        &self,
        block_number: BlockNumber,
    ) -> Result<
        impl blockifier::state::state_reader_and_contract_manager::FetchCompiledClasses
        + Send
        + Sync
        + 'static,
        VirtualBlockExecutorError,
    > {
        self.0.state_reader(block_number)
    }

    // Override the default implementation to skip validation.
    fn convert_invoke_txs(
        txs: Vec<(Transaction, TransactionHash)>,
    ) -> Result<Vec<BlockifierTransaction>, VirtualBlockExecutorError> {
        // Call the default trait implementation.
        let mut blockifier_txs = RpcVirtualBlockExecutor::convert_invoke_txs(txs)?;

        // Modify validate flag to false for all transactions.
        for tx in &mut blockifier_txs {
            if let BlockifierTransaction::Account(account_tx) = tx {
                account_tx.execution_flags.validate = false;
            }
        }

        Ok(blockifier_txs)
    }
}

/// Constructs an Invoke transaction that calls `balanceOf` on the STRK token contract.
///
/// Since we skip validation and fee charging, we can use dummy values for signature,
/// nonce, and resource bounds.
fn construct_balance_of_invoke() -> (Transaction, TransactionHash) {
    let strk_token = ContractAddress::try_from(STRK_TOKEN_ADDRESS).unwrap();
    let sender = ContractAddress::try_from(SENDER_ADDRESS).unwrap();

    // Calldata for account's __execute__ (Cairo 0 OZ account format):
    // [call_array_len, call_array..., calldata_len, calldata...]

crates/starknet_os_runner/src/test_utils.rs line 1 at r4 (raw file):

use std::env;

How is this related to the class provider?

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.

@Yoni-Starkware resolved 1 discussion.
Reviewable status: 2 of 8 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1).

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.

@Yoni-Starkware resolved 1 discussion.
Reviewable status: 2 of 8 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @AvivYossef-starkware, @meship-starkware, and @noaov1).

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.

@AvivYossef-starkware made 1 comment.
Reviewable status: 2 of 8 files reviewed, 1 unresolved discussion (waiting on @avi-starkware, @meship-starkware, @noaov1, and @Yoni-Starkware).


crates/starknet_os_runner/src/virtual_block_executor_test.rs line 68 at r4 (raw file):

Previously, Yoni-Starkware (Yoni) wrote…

Remove this struct and add `execution_flag to the original RPC struct (with default values)

It's not part of the PR,
you saw it since the branch wasn't rebased.
I made the changes you asked in #11129

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.

:lgtm:

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

@AvivYossef-starkware AvivYossef-starkware added this pull request to the merge queue Dec 25, 2025
Merged via the queue into main with commit 2a4da23 Dec 25, 2025
27 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 27, 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.

5 participants