Skip to content

Conversation

@einat-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

einat-starkware commented Jan 14, 2026

@einat-starkware einat-starkware marked this pull request as ready for review January 14, 2026 07:01
@einat-starkware einat-starkware force-pushed the einat/proof_archive/set_proof branch from a5e3eb3 to fff30ff Compare January 14, 2026 07:56
@einat-starkware einat-starkware force-pushed the einat/proof_manager/dont_write_rejected_txs branch from cca3adc to 8cfb0ad Compare January 14, 2026 07:56
@einat-starkware einat-starkware changed the base branch from einat/proof_archive/set_proof to graphite-base/11703 January 14, 2026 09:04
@einat-starkware einat-starkware force-pushed the einat/proof_manager/dont_write_rejected_txs branch from 8cfb0ad to 715551a Compare January 14, 2026 09:04
@einat-starkware einat-starkware changed the base branch from graphite-base/11703 to main January 14, 2026 09:04
@einat-starkware einat-starkware force-pushed the einat/proof_manager/dont_write_rejected_txs branch from 715551a to f1a914d Compare January 14, 2026 13:54
Copy link
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 1 comment.
Reviewable status: 0 of 5 files reviewed, 1 unresolved discussion (waiting on @meship-starkware and @noaov1).


crates/apollo_class_manager_types/src/transaction_converter_test.rs line 125 at r2 (raw file):

#[rstest]
#[tokio::test]
async fn test_proof_verification_skipped_when_proof_already_exists() {

I removed this test because set_proof wouldn't be called anyways after moving it to the gateway so it doesn't check anything

@ArniStarkware
Copy link
Contributor

crates/apollo_gateway/src/gateway_test.rs line 319 at r3 (raw file):

        if !invoke_tx.proof_facts.is_empty() {
            mock_dependencies
                .expect_set_proof(invoke_tx.proof_facts.clone(), invoke_tx.proof.clone());

Suggestion:

.expect_set_proof(invoke_tx.proof_facts.clone(), invoke_tx.proof.clone())
.once()
.with(eq(...)); // If it is easy (i.e., this part of the comment is non-blocking), 
                // please add to the expectation the expected input to this call of `set_proof`). 

@ArniStarkware
Copy link
Contributor

crates/apollo_gateway/src/gateway_test.rs line 171 at r3 (raw file):

        self.mock_transaction_converter
            .expect_get_proof_manager_client()
            .returning(move || pmc.clone());

Why here and not in the constructor of MockDependencies?

Code quote:

        let proof_manager_client: Arc<dyn ProofManagerClient> =
            Arc::new(self.mock_proof_manager_client);
        let pmc = proof_manager_client.clone();
        self.mock_transaction_converter
            .expect_get_proof_manager_client()
            .returning(move || pmc.clone());

@ArniStarkware
Copy link
Contributor

crates/apollo_gateway/src/gateway.rs line 273 at r3 (raw file):

    let transaction_converter = Arc::new(TransactionConverter::new(
        class_manager_client,
        proof_manager_client.clone(),

why clone?

Code quote:

        proof_manager_client.clone(),

@ArniStarkware
Copy link
Contributor

crates/apollo_class_manager_types/src/transaction_converter.rs line 161 at r3 (raw file):

                };

                let internal_tx = self.convert_rpc_tx_to_internal_rpc_tx(tx).await?;

Please move this logic into convert_rpc_tx_to_internal_rpc_tx. It has a match arm for invoke anyway...

Code quote:

convert_rpc_tx_to_internal_rpc_tx

@einat-starkware
Copy link
Contributor Author

crates/apollo_class_manager_types/src/transaction_converter.rs line 161 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

Please move this logic into convert_rpc_tx_to_internal_rpc_tx. It has a match arm for invoke anyway...

I don't want this logic in there as that function also gets called in the gateway (where I don't want to write until after the validations in the gateway have passed).

@einat-starkware einat-starkware force-pushed the einat/proof_manager/dont_write_rejected_txs branch from 6465d80 to dafa059 Compare January 15, 2026 12:47
Copy link
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 3 comments.
Reviewable status: 0 of 5 files reviewed, 5 unresolved discussions (waiting on @ArniStarkware, @meship-starkware, and @noaov1).


crates/apollo_gateway/src/gateway.rs line 273 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

why clone?

An accidental leftover from an earlier version of the PR, removed now :)


crates/apollo_gateway/src/gateway_test.rs line 171 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

Why here and not in the constructor of MockDependencies?

It needs to be here I believe so that the mock_proof_manager_client is accessible in the tests (so I can check that it gets called).


crates/apollo_gateway/src/gateway_test.rs line 319 at r3 (raw file):

        if !invoke_tx.proof_facts.is_empty() {
            mock_dependencies
                .expect_set_proof(invoke_tx.proof_facts.clone(), invoke_tx.proof.clone());

This is already done in the inner function that this function is a wrapper for :)

@ArniStarkware
Copy link
Contributor

crates/apollo_gateway/src/gateway_test.rs line 171 at r3 (raw file):

Previously, einat-starkware wrote…

It needs to be here I believe so that the mock_proof_manager_client is accessible in the tests (so I can check that it gets called).

Please try moving it into

#[fixture]
fn mock_dependencies() -> MockDependencies {

Copy link
Contributor

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

@ArniStarkware made 1 comment and resolved 1 discussion.
Reviewable status: 0 of 5 files reviewed, 4 unresolved discussions (waiting on @einat-starkware, @meship-starkware, and @noaov1).


crates/apollo_gateway/src/gateway_test.rs line 319 at r3 (raw file):

Previously, einat-starkware wrote…

This is already done in the inner function that this function is a wrapper for :)

I don't understand. If this is already done, why do it here?

this = expect_set_proof.

@ArniStarkware
Copy link
Contributor

crates/apollo_class_manager_types/src/transaction_converter.rs line 161 at r3 (raw file):

Previously, einat-starkware wrote…

I don't want this logic in there as that function also gets called in the gateway (where I don't want to write until after the validations in the gateway have passed).

In that case, please define a new function: extract_proof_and_convert_rpc_tx_to_internal_rpc_tx

@einat-starkware einat-starkware force-pushed the einat/proof_manager/dont_write_rejected_txs branch from dafa059 to 9f8d4d9 Compare January 18, 2026 07:17
Copy link
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 3 comments.
Reviewable status: 0 of 5 files reviewed, 4 unresolved discussions (waiting on @ArniStarkware, @meship-starkware, and @noaov1).


crates/apollo_class_manager_types/src/transaction_converter.rs line 161 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

In that case, please define a new function: extract_proof_and_convert_rpc_tx_to_internal_rpc_tx

Done.


crates/apollo_gateway/src/gateway_test.rs line 171 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

Please try moving it into

#[fixture]
fn mock_dependencies() -> MockDependencies {

I can't figure out how to do this while also keeping the check that I call set_proof for V3 invoke transactions with proof facts (which is what I actually want to test). I believe it's because I extract the proof manager client from the transaction converter using get_proof_manager_client() which gives me a clone of the original and then I can't set expectations for the clone. If you have an idea how to get around this let me know.


crates/apollo_gateway/src/gateway_test.rs line 319 at r3 (raw file):

Previously, ArniStarkware (Arnon Hod) wrote…

I don't understand. If this is already done, why do it here?

this = expect_set_proof.

I defined mock_dependencies.expect_set_prooffollowing the pattern of the mempool client's expect_add_tx

@einat-starkware einat-starkware force-pushed the einat/proof_manager/dont_write_rejected_txs branch from 9f8d4d9 to 8fc057f Compare January 18, 2026 10:07
Copy link
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 1 comment.
Reviewable status: 0 of 5 files reviewed, 4 unresolved discussions (waiting on @ArniStarkware, @meship-starkware, and @noaov1).


crates/apollo_gateway/src/gateway_test.rs line 171 at r3 (raw file):

Previously, einat-starkware wrote…

I can't figure out how to do this while also keeping the check that I call set_proof for V3 invoke transactions with proof facts (which is what I actually want to test). I believe it's because I extract the proof manager client from the transaction converter using get_proof_manager_client() which gives me a clone of the original and then I can't set expectations for the clone. If you have an idea how to get around this let me know.

Added as a TODO for now

@ArniStarkware
Copy link
Contributor

crates/apollo_gateway/src/gateway_test.rs line 319 at r3 (raw file):

Previously, einat-starkware wrote…

I defined mock_dependencies.expect_set_prooffollowing the pattern of the mempool client's expect_add_tx

Unblocking,
But it would be nice if we did not have unnecessary expectations.

Copy link
Contributor

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

:lgtm:

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

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