@@ -73,7 +73,7 @@ pub struct IngressService<Q: MessageQueue, M: Mempool> {
7373 tx_submission_method : TxSubmissionMethod ,
7474 bundle_queue_publisher : BundleQueuePublisher < Q > ,
7575 user_op_queue_publisher : UserOpQueuePublisher < Q > ,
76- reputation_service : Arc < ReputationServiceImpl < M > > ,
76+ reputation_service : Option < Arc < ReputationServiceImpl < M > > > ,
7777 audit_channel : mpsc:: UnboundedSender < BundleEvent > ,
7878 send_transaction_default_lifetime_seconds : u64 ,
7979 metrics : Metrics ,
@@ -93,9 +93,10 @@ impl<Q: MessageQueue, M: Mempool> IngressService<Q, M> {
9393 audit_channel : mpsc:: UnboundedSender < BundleEvent > ,
9494 builder_tx : broadcast:: Sender < MeterBundleResponse > ,
9595 builder_backrun_tx : broadcast:: Sender < AcceptedBundle > ,
96- mempool_engine : Arc < MempoolEngine < M > > ,
96+ mempool_engine : impl Into < Option < Arc < MempoolEngine < M > > > > ,
9797 config : Config ,
9898 ) -> Self {
99+ let mempool_engine = mempool_engine. into ( ) ;
99100 let mempool_provider = Arc :: new ( providers. mempool ) ;
100101 let simulation_provider = Arc :: new ( providers. simulation ) ;
101102 let raw_tx_forward_provider = providers. raw_tx_forward . map ( Arc :: new) ;
@@ -104,7 +105,9 @@ impl<Q: MessageQueue, M: Mempool> IngressService<Q, M> {
104105 config. validate_user_operation_timeout_ms ,
105106 ) ;
106107 let queue_connection = Arc :: new ( queue) ;
107- let reputation_service = ReputationServiceImpl :: new ( mempool_engine. get_mempool ( ) ) ;
108+ let reputation_service = mempool_engine
109+ . as_ref ( )
110+ . map ( |engine| Arc :: new ( ReputationServiceImpl :: new ( engine. get_mempool ( ) ) ) ) ;
108111 Self {
109112 mempool_provider,
110113 simulation_provider,
@@ -119,7 +122,7 @@ impl<Q: MessageQueue, M: Mempool> IngressService<Q, M> {
119122 queue_connection. clone ( ) ,
120123 config. ingress_topic ,
121124 ) ,
122- reputation_service : Arc :: new ( reputation_service ) ,
125+ reputation_service,
123126 audit_channel,
124127 send_transaction_default_lifetime_seconds : config
125128 . send_transaction_default_lifetime_seconds ,
@@ -384,11 +387,11 @@ impl<Q: MessageQueue + 'static, M: Mempool + 'static> IngressApiServer for Ingre
384387 chain_id : 1 ,
385388 } ;
386389
387- // DO Nothing with reputation at the moment as this is scafolding
388- let _ = self
389- . reputation_service
390- . get_reputation ( & request . user_operation . sender ( ) )
391- . await ;
390+ if let Some ( reputation_service ) = & self . reputation_service {
391+ let _ = reputation_service
392+ . get_reputation ( & request . user_operation . sender ( ) )
393+ . await ;
394+ }
392395
393396 let user_op_hash = request. hash ( ) . map_err ( |e| {
394397 warn ! ( message = "Failed to hash user operation" , error = %e) ;
@@ -592,7 +595,7 @@ mod tests {
592595 ingress_topic : String :: new ( ) ,
593596 audit_kafka_properties : String :: new ( ) ,
594597 audit_topic : String :: new ( ) ,
595- user_operation_consumer_properties : String :: new ( ) ,
598+ user_operation_consumer_properties : None ,
596599 user_operation_consumer_group_id : "tips-user-operation" . to_string ( ) ,
597600 log_level : String :: from ( "info" ) ,
598601 log_format : tips_core:: logger:: LogFormat :: Pretty ,
0 commit comments