From a80819b0296ff8888050c293688c4d2188ad575c Mon Sep 17 00:00:00 2001 From: Brooks Date: Wed, 6 Sep 2023 13:02:52 -0400 Subject: [PATCH] PrunedBanksRequestHandler::handle_request() is only pub with dcou (#33155) --- Cargo.lock | 1 + programs/sbf/Cargo.lock | 1 + runtime/Cargo.toml | 1 + runtime/src/accounts_background_service.rs | 5 ++++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 2f46b23e5..0ba7bfa59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6854,6 +6854,7 @@ dependencies = [ "num_enum 0.6.1", "ouroboros", "percentage", + "qualifier_attr", "rand 0.8.5", "rand_chacha 0.3.1", "rayon", diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index bc743d1bf..23158b856 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -5548,6 +5548,7 @@ dependencies = [ "num_enum 0.6.1", "ouroboros", "percentage", + "qualifier_attr", "rand 0.8.5", "rayon", "regex", diff --git a/runtime/Cargo.toml b/runtime/Cargo.toml index 238d5dfb3..319e6f4d7 100644 --- a/runtime/Cargo.toml +++ b/runtime/Cargo.toml @@ -39,6 +39,7 @@ num_cpus = { workspace = true } num_enum = { workspace = true } ouroboros = { workspace = true } percentage = { workspace = true } +qualifier_attr = { workspace = true } rand = { workspace = true } rayon = { workspace = true } regex = { workspace = true } diff --git a/runtime/src/accounts_background_service.rs b/runtime/src/accounts_background_service.rs index dc635f7e6..627ccbf76 100644 --- a/runtime/src/accounts_background_service.rs +++ b/runtime/src/accounts_background_service.rs @@ -3,6 +3,8 @@ //! This can be expensive since we have to walk the append vecs being cleaned up. mod stats; +#[cfg(feature = "dev-context-only-utils")] +use qualifier_attr::qualifiers; use { crate::{ bank::{Bank, BankSlotDelta, DropCallback}, @@ -501,7 +503,8 @@ pub struct PrunedBanksRequestHandler { } impl PrunedBanksRequestHandler { - pub fn handle_request(&self, bank: &Bank) -> usize { + #[cfg_attr(feature = "dev-context-only-utils", qualifiers(pub))] + fn handle_request(&self, bank: &Bank) -> usize { let mut banks_to_purge: Vec<_> = self.pruned_banks_receiver.try_iter().collect(); // We need a stable sort to ensure we purge banks—with the same slot—in the same order // they were sent into the channel.