Skip to content

Commit 613ce3c

Browse files
authored
chore!: remove pub visibility on OVERFLOW_LRU_CAPACITY and STATE_LRU_CAPACITY_NON_ZERO (#8234)
- Renames `OVERFLOW_LRU_CAPACITY` to `OVERFLOW_LRU_CAPACITY_NON_ZERO` to follow naming convention of `STATE_LRU_CAPACITY_NON_ZERO` - Makes `OVERFLOW_LRU_CAPACITY_NON_ZERO` and `STATE_LRU_CAPACITY_NON_ZERO` private since they are only used in this module - Moves `STATE_LRU_CAPACITY` into test module since it is only used for tests Co-Authored-By: Kevaundray Wedderburn <[email protected]>
1 parent 9baef8b commit 613ce3c

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

beacon_node/beacon_chain/src/data_availability_checker.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,8 @@ use types::non_zero_usize::new_non_zero_usize;
5252
///
5353
/// `PendingComponents` are now never removed from the cache manually are only removed via LRU
5454
/// eviction to prevent race conditions (#7961), so we expect this cache to be full all the time.
55-
pub const OVERFLOW_LRU_CAPACITY: NonZeroUsize = new_non_zero_usize(32);
56-
pub const STATE_LRU_CAPACITY_NON_ZERO: NonZeroUsize = new_non_zero_usize(32);
57-
pub const STATE_LRU_CAPACITY: usize = STATE_LRU_CAPACITY_NON_ZERO.get();
55+
const OVERFLOW_LRU_CAPACITY_NON_ZERO: NonZeroUsize = new_non_zero_usize(32);
56+
const STATE_LRU_CAPACITY_NON_ZERO: NonZeroUsize = new_non_zero_usize(32);
5857

5958
/// Cache to hold fully valid data that can't be imported to fork-choice yet. After Dencun hard-fork
6059
/// blocks have a sidecar of data that is received separately from the network. We call the concept
@@ -128,7 +127,7 @@ impl<T: BeaconChainTypes> DataAvailabilityChecker<T> {
128127
spec: Arc<ChainSpec>,
129128
) -> Result<Self, AvailabilityCheckError> {
130129
let inner = DataAvailabilityCheckerInner::new(
131-
OVERFLOW_LRU_CAPACITY,
130+
OVERFLOW_LRU_CAPACITY_NON_ZERO,
132131
store,
133132
custody_context.clone(),
134133
spec.clone(),

beacon_node/beacon_chain/src/data_availability_checker/overflow_lru_cache.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,7 +828,7 @@ mod test {
828828
block_verification::PayloadVerificationOutcome,
829829
block_verification_types::{AsBlock, BlockImportData},
830830
custody_context::NodeCustodyType,
831-
data_availability_checker::STATE_LRU_CAPACITY,
831+
data_availability_checker::STATE_LRU_CAPACITY_NON_ZERO,
832832
test_utils::{BaseHarnessType, BeaconChainHarness, DiskHarnessType},
833833
};
834834
use fork_choice::PayloadVerificationStatus;
@@ -842,6 +842,7 @@ mod test {
842842
use types::{ExecPayload, MinimalEthSpec};
843843

844844
const LOW_VALIDATOR_COUNT: usize = 32;
845+
const STATE_LRU_CAPACITY: usize = STATE_LRU_CAPACITY_NON_ZERO.get();
845846

846847
fn get_store_with_spec<E: EthSpec>(
847848
db_path: &TempDir,

0 commit comments

Comments
 (0)