1010
1111use {
1212 crate :: {
13- banking_trace:: BankingPacketSender ,
1413 proto_packet_to_packet,
1514 proxy:: {
1615 auth:: { generate_auth_tokens, maybe_refresh_auth_tokens, AuthInterceptor } ,
@@ -79,9 +78,6 @@ pub struct RelayerConfig {
7978
8079 /// The max tolerable age of the last heartbeat.
8180 pub oldest_allowed_heartbeat : Duration ,
82-
83- /// If set then it will be assumed the backend verified packets so signature verification will be bypassed in the validator.
84- pub trust_packets : bool ,
8581}
8682
8783pub struct RelayerStage {
@@ -97,8 +93,6 @@ impl RelayerStage {
9793 heartbeat_tx : Sender < HeartbeatEvent > ,
9894 // Channel that non-trusted streamed packets are piped through.
9995 packet_tx : Sender < PacketBatch > ,
100- // Channel that trusted streamed packets are piped through.
101- banking_packet_sender : BankingPacketSender ,
10296 exit : Arc < AtomicBool > ,
10397 ) -> Self {
10498 let thread = Builder :: new ( )
@@ -114,7 +108,6 @@ impl RelayerStage {
114108 cluster_info,
115109 heartbeat_tx,
116110 packet_tx,
117- banking_packet_sender,
118111 exit,
119112 ) ) ;
120113 } )
@@ -138,7 +131,6 @@ impl RelayerStage {
138131 cluster_info : Arc < ClusterInfo > ,
139132 heartbeat_tx : Sender < HeartbeatEvent > ,
140133 packet_tx : Sender < PacketBatch > ,
141- banking_packet_sender : BankingPacketSender ,
142134 exit : Arc < AtomicBool > ,
143135 ) {
144136 const CONNECTION_TIMEOUT : Duration = Duration :: from_secs ( CONNECTION_TIMEOUT_S ) ;
@@ -163,7 +155,6 @@ impl RelayerStage {
163155 & cluster_info,
164156 & heartbeat_tx,
165157 & packet_tx,
166- & banking_packet_sender,
167158 & exit,
168159 & CONNECTION_TIMEOUT ,
169160 )
@@ -195,7 +186,6 @@ impl RelayerStage {
195186 cluster_info : & Arc < ClusterInfo > ,
196187 heartbeat_tx : & Sender < HeartbeatEvent > ,
197188 packet_tx : & Sender < PacketBatch > ,
198- banking_packet_sender : & BankingPacketSender ,
199189 exit : & Arc < AtomicBool > ,
200190 connection_timeout : & Duration ,
201191 ) -> crate :: proxy:: Result < ( ) > {
@@ -261,7 +251,6 @@ impl RelayerStage {
261251 relayer_client,
262252 heartbeat_tx,
263253 packet_tx,
264- banking_packet_sender,
265254 local_relayer_config,
266255 global_relayer_config,
267256 exit,
@@ -280,7 +269,6 @@ impl RelayerStage {
280269 mut client : RelayerClient < InterceptedService < Channel , AuthInterceptor > > ,
281270 heartbeat_tx : & Sender < HeartbeatEvent > ,
282271 packet_tx : & Sender < PacketBatch > ,
283- banking_packet_sender : & BankingPacketSender ,
284272 local_config : & RelayerConfig , // local copy of config with current connections
285273 global_config : & Arc < Mutex < RelayerConfig > > , // guarded reference for detecting run-time updates
286274 exit : & Arc < AtomicBool > ,
@@ -332,7 +320,6 @@ impl RelayerStage {
332320 packet_tx,
333321 local_config,
334322 global_config,
335- banking_packet_sender,
336323 exit,
337324 auth_client,
338325 access_token,
@@ -352,7 +339,6 @@ impl RelayerStage {
352339 packet_tx : & Sender < PacketBatch > ,
353340 local_config : & RelayerConfig , // local copy of config with current connections
354341 global_config : & Arc < Mutex < RelayerConfig > > , // guarded reference for detecting run-time updates
355- banking_packet_sender : & BankingPacketSender ,
356342 exit : & Arc < AtomicBool > ,
357343 mut auth_client : AuthServiceClient < Channel > ,
358344 access_token : Arc < Mutex < Token > > ,
@@ -379,7 +365,7 @@ impl RelayerStage {
379365 tokio:: select! {
380366 maybe_msg = packet_stream. message( ) => {
381367 let resp = maybe_msg?. ok_or( ProxyError :: GrpcStreamDisconnected ) ?;
382- Self :: handle_relayer_packets( resp, heartbeat_event, heartbeat_tx, & mut last_heartbeat_ts, packet_tx, local_config . trust_packets , banking_packet_sender , & mut relayer_stats) ?;
368+ Self :: handle_relayer_packets( resp, heartbeat_event, heartbeat_tx, & mut last_heartbeat_ts, packet_tx, & mut relayer_stats) ?;
383369 }
384370 _ = heartbeat_check_interval. tick( ) => {
385371 if last_heartbeat_ts. elapsed( ) > local_config. oldest_allowed_heartbeat {
@@ -443,8 +429,6 @@ impl RelayerStage {
443429 heartbeat_tx : & Sender < HeartbeatEvent > ,
444430 last_heartbeat_ts : & mut Instant ,
445431 packet_tx : & Sender < PacketBatch > ,
446- trust_packets : bool ,
447- banking_packet_sender : & BankingPacketSender ,
448432 relayer_stats : & mut RelayerStageStats ,
449433 ) -> crate :: proxy:: Result < ( ) > {
450434 match subscribe_packets_resp. msg {
@@ -469,15 +453,9 @@ impl RelayerStage {
469453 . num_packets
470454 . add_assign ( packet_batch. len ( ) as u64 ) ;
471455
472- if trust_packets {
473- banking_packet_sender
474- . send ( Arc :: new ( vec ! [ packet_batch] ) )
475- . map_err ( |_| ProxyError :: PacketForwardError ) ?;
476- } else {
477- packet_tx
478- . send ( packet_batch)
479- . map_err ( |_| ProxyError :: PacketForwardError ) ?;
480- }
456+ packet_tx
457+ . send ( packet_batch)
458+ . map_err ( |_| ProxyError :: PacketForwardError ) ?;
481459 }
482460 Some ( relayer:: subscribe_packets_response:: Msg :: Heartbeat ( _) ) => {
483461 relayer_stats. num_heartbeats . add_assign ( 1 ) ;
0 commit comments