File tree Expand file tree Collapse file tree 3 files changed +38
-2
lines changed
crates/apollo_gateway/src Expand file tree Collapse file tree 3 files changed +38
-2
lines changed Original file line number Diff line number Diff line change @@ -67,8 +67,8 @@ members = [
6767 " crates/apollo_proc_macros" ,
6868 " crates/apollo_proc_macros_tests" ,
6969 " crates/apollo_proof_manager" ,
70- " crates/apollo_propeller" ,
7170 " crates/apollo_proof_manager_types" ,
71+ " crates/apollo_propeller" ,
7272 " crates/apollo_protobuf" ,
7373 " crates/apollo_reverts" ,
7474 " crates/apollo_rpc" ,
@@ -186,8 +186,8 @@ apollo_p2p_sync_config.path = "crates/apollo_p2p_sync_config"
186186apollo_proc_macros = { path = " crates/apollo_proc_macros" , version = " 0.0.0" }
187187apollo_proc_macros_tests.path = " crates/apollo_proc_macros_tests"
188188apollo_proof_manager.path = " crates/apollo_proof_manager"
189- apollo_propeller.path = " crates/apollo_propeller"
190189apollo_proof_manager_types.path = " crates/apollo_proof_manager_types"
190+ apollo_propeller.path = " crates/apollo_propeller"
191191apollo_protobuf.path = " crates/apollo_protobuf"
192192apollo_reverts.path = " crates/apollo_reverts"
193193apollo_rpc.path = " crates/apollo_rpc"
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use apollo_gateway_types::errors::GatewaySpecError;
1010use apollo_gateway_types:: gateway_types:: SUPPORTED_TRANSACTION_VERSIONS ;
1111use apollo_mempool_types:: communication:: { MempoolClientError , MempoolClientResult } ;
1212use apollo_mempool_types:: errors:: MempoolError ;
13+ use apollo_proof_manager_types:: { ProofManagerClientError , ProofManagerError } ;
1314use blockifier:: state:: errors:: StateError ;
1415use reqwest:: StatusCode ;
1516use serde_json:: { Error as SerdeError , Value } ;
@@ -452,3 +453,25 @@ fn convert_sn_api_error(err: StarknetApiError) -> StarknetError {
452453 } ,
453454 }
454455}
456+
457+ pub fn convert_proof_manager_error ( err : ProofManagerClientError ) -> StarknetError {
458+ match err {
459+ ProofManagerClientError :: ClientError ( client_error) => {
460+ StarknetError :: internal_with_logging ( "Proof manager client error" , & client_error)
461+ }
462+ ProofManagerClientError :: ProofManagerError ( proof_manager_error) => {
463+ match proof_manager_error {
464+ ProofManagerError :: Client ( _) => StarknetError :: internal_with_logging (
465+ "Proof manager error" ,
466+ & proof_manager_error,
467+ ) ,
468+ ProofManagerError :: ProofStorage ( _) | ProofManagerError :: Io ( _) => {
469+ StarknetError :: internal_with_logging (
470+ "Proof manager storage error" ,
471+ & proof_manager_error,
472+ )
473+ }
474+ }
475+ }
476+ }
477+ }
Original file line number Diff line number Diff line change @@ -32,12 +32,14 @@ use starknet_api::rpc_transaction::{
3232 InternalRpcTransaction ,
3333 InternalRpcTransactionWithoutTxHash ,
3434 RpcDeclareTransaction ,
35+ RpcInvokeTransaction ,
3536 RpcTransaction ,
3637} ;
3738use starknet_api:: transaction:: fields:: TransactionSignature ;
3839use tracing:: { debug, warn} ;
3940
4041use crate :: errors:: {
42+ convert_proof_manager_error,
4143 mempool_client_result_to_deprecated_gw_result,
4244 transaction_converter_err_to_deprecated_gw_err,
4345 GatewayResult ,
@@ -135,6 +137,17 @@ impl Gateway {
135137 // Perform stateless validations.
136138 self . stateless_tx_validator . validate ( & tx) ?;
137139
140+ // If a transaction has a proof then we add it to the proof manager.
141+ if let RpcTransaction :: Invoke ( RpcInvokeTransaction :: V3 ( ref v3_tx) ) = tx {
142+ if !v3_tx. proof_facts . is_empty ( ) {
143+ let proof_facts_hash = v3_tx. proof_facts . hash ( ) ;
144+ self . proof_manager_client
145+ . set_proof ( proof_facts_hash, v3_tx. proof . clone ( ) )
146+ . await
147+ . map_err ( convert_proof_manager_error) ?;
148+ }
149+ }
150+
138151 let tx_signature = tx. signature ( ) . clone ( ) ;
139152 let ( internal_tx, executable_tx) =
140153 self . convert_rpc_tx_to_internal_and_executable_txs ( tx, & tx_signature) . await ?;
You can’t perform that action at this time.
0 commit comments