@@ -70,7 +70,7 @@ pub struct ConnectionWorkersSchedulerConfig {
7070
7171 /// Optional stake identity keypair used in the endpoint certificate for
7272 /// identifying the sender.
73- pub identity : Option < Keypair > ,
73+ pub stake_identity : Option < Keypair > ,
7474
7575 /// The number of connections to be maintained by the scheduler.
7676 pub num_connections : usize ,
@@ -101,14 +101,17 @@ impl ConnectionWorkersScheduler {
101101 ///
102102 /// Runs the main loop that handles worker scheduling and management for
103103 /// connections. Returns the error quic statistics per connection address or
104- /// an error.
104+ /// an error along with receiver for transactions. The receiver returned
105+ /// back to the user because in some cases we need to re-utilize the same
106+ /// receiver for the new scheduler. For example, this happens when the
107+ /// identity for the validator is updated.
105108 ///
106109 /// Importantly, if some transactions were not delivered due to network
107110 /// problems, they will not be retried when the problem is resolved.
108111 pub async fn run (
109112 ConnectionWorkersSchedulerConfig {
110113 bind,
111- identity ,
114+ stake_identity ,
112115 num_connections,
113116 skip_check_transaction_age,
114117 worker_channel_size,
@@ -119,7 +122,7 @@ impl ConnectionWorkersScheduler {
119122 mut transaction_receiver : mpsc:: Receiver < TransactionBatch > ,
120123 cancel : CancellationToken ,
121124 ) -> Result < TransactionStatsAndReceiver , ConnectionWorkersSchedulerError > {
122- let endpoint = Self :: setup_endpoint ( bind, identity . as_ref ( ) ) ?;
125+ let endpoint = Self :: setup_endpoint ( bind, stake_identity . as_ref ( ) ) ?;
123126 debug ! ( "Client endpoint bind address: {:?}" , endpoint. local_addr( ) ) ;
124127 let mut workers = WorkersCache :: new ( num_connections, cancel. clone ( ) ) ;
125128 let mut send_stats_per_addr = SendTransactionStatsPerAddr :: new ( ) ;
@@ -195,9 +198,9 @@ impl ConnectionWorkersScheduler {
195198 /// Sets up the QUIC endpoint for the scheduler to handle connections.
196199 fn setup_endpoint (
197200 bind : SocketAddr ,
198- identity : Option < & Keypair > ,
201+ stake_identity : Option < & Keypair > ,
199202 ) -> Result < Endpoint , ConnectionWorkersSchedulerError > {
200- let client_certificate = QuicClientCertificate :: new ( identity ) ;
203+ let client_certificate = QuicClientCertificate :: new ( stake_identity ) ;
201204 let client_config = create_client_config ( client_certificate) ;
202205 let endpoint = create_client_endpoint ( bind, client_config) ?;
203206 Ok ( endpoint)
0 commit comments