Skip to content
This repository was archived by the owner on Jan 22, 2025. It is now read-only.

Commit ef01ab1

Browse files
mergify[bot]yihau
authored andcommitted
v1.17: Disable cache warmer if RPC is not using it (backport of #1063) (backport of #1068) (#1108)
v1.18: Disable cache warmer if RPC is not using it (backport of #1063) (#1068) Disable connection cache warmer for tpu if no rpc services using it. (cherry picked from commit d87e23d) # Conflicts: # core/src/tvu.rs * Merge conflicts --------- Co-authored-by: Lijun Wang <[email protected]> (cherry picked from commit f09d04d) Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent f51d29f commit ef01ab1

File tree

2 files changed

+16
-13
lines changed

2 files changed

+16
-13
lines changed

core/src/tvu.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl Tvu {
133133
wait_to_vote_slot: Option<Slot>,
134134
accounts_background_request_sender: AbsRequestSender,
135135
log_messages_bytes_limit: Option<usize>,
136-
connection_cache: &Arc<ConnectionCache>,
136+
connection_cache: Option<&Arc<ConnectionCache>>,
137137
prioritization_fee_cache: &Arc<PrioritizationFeeCache>,
138138
banking_tracer: Arc<BankingTracer>,
139139
turbine_quic_endpoint_sender: AsyncSender<(SocketAddr, Bytes)>,
@@ -267,16 +267,19 @@ impl Tvu {
267267
tower_storage,
268268
);
269269

270-
let warm_quic_cache_service = if connection_cache.use_quic() {
271-
Some(WarmQuicCacheService::new(
272-
connection_cache.clone(),
273-
cluster_info.clone(),
274-
poh_recorder.clone(),
275-
exit.clone(),
276-
))
277-
} else {
278-
None
279-
};
270+
let warm_quic_cache_service = connection_cache.and_then(|connection_cache| {
271+
if connection_cache.use_quic() {
272+
Some(WarmQuicCacheService::new(
273+
connection_cache.clone(),
274+
cluster_info.clone(),
275+
poh_recorder.clone(),
276+
exit.clone(),
277+
))
278+
} else {
279+
None
280+
}
281+
});
282+
280283
let (cost_update_sender, cost_update_receiver) = unbounded();
281284
let cost_update_service = CostUpdateService::new(blockstore.clone(), cost_update_receiver);
282285

@@ -486,7 +489,7 @@ pub mod tests {
486489
None,
487490
AbsRequestSender::default(),
488491
None,
489-
&Arc::new(ConnectionCache::new("connection_cache_test")),
492+
Some(&Arc::new(ConnectionCache::new("connection_cache_test"))),
490493
&ignored_prioritization_fee_cache,
491494
BankingTracer::new_disabled(),
492495
turbine_quic_endpoint_sender,

core/src/validator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1269,7 +1269,7 @@ impl Validator {
12691269
config.wait_to_vote_slot,
12701270
accounts_background_request_sender,
12711271
config.runtime_config.log_messages_bytes_limit,
1272-
&connection_cache,
1272+
json_rpc_service.is_some().then_some(&connection_cache), // for the cache warmer only used for STS for RPC service
12731273
&prioritization_fee_cache,
12741274
banking_tracer.clone(),
12751275
turbine_quic_endpoint_sender.clone(),

0 commit comments

Comments
 (0)