mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 17:26:04 +00:00
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 <kevtheappdev@gmail.com>
This commit is contained in:
@@ -52,9 +52,8 @@ use types::non_zero_usize::new_non_zero_usize;
|
|||||||
///
|
///
|
||||||
/// `PendingComponents` are now never removed from the cache manually are only removed via LRU
|
/// `PendingComponents` are now never removed from the cache manually are only removed via LRU
|
||||||
/// eviction to prevent race conditions (#7961), so we expect this cache to be full all the time.
|
/// eviction to prevent race conditions (#7961), so we expect this cache to be full all the time.
|
||||||
pub const OVERFLOW_LRU_CAPACITY: NonZeroUsize = new_non_zero_usize(32);
|
const OVERFLOW_LRU_CAPACITY_NON_ZERO: NonZeroUsize = new_non_zero_usize(32);
|
||||||
pub const STATE_LRU_CAPACITY_NON_ZERO: NonZeroUsize = new_non_zero_usize(32);
|
const STATE_LRU_CAPACITY_NON_ZERO: NonZeroUsize = new_non_zero_usize(32);
|
||||||
pub const STATE_LRU_CAPACITY: usize = STATE_LRU_CAPACITY_NON_ZERO.get();
|
|
||||||
|
|
||||||
/// Cache to hold fully valid data that can't be imported to fork-choice yet. After Dencun hard-fork
|
/// Cache to hold fully valid data that can't be imported to fork-choice yet. After Dencun hard-fork
|
||||||
/// blocks have a sidecar of data that is received separately from the network. We call the concept
|
/// 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> {
|
|||||||
spec: Arc<ChainSpec>,
|
spec: Arc<ChainSpec>,
|
||||||
) -> Result<Self, AvailabilityCheckError> {
|
) -> Result<Self, AvailabilityCheckError> {
|
||||||
let inner = DataAvailabilityCheckerInner::new(
|
let inner = DataAvailabilityCheckerInner::new(
|
||||||
OVERFLOW_LRU_CAPACITY,
|
OVERFLOW_LRU_CAPACITY_NON_ZERO,
|
||||||
store,
|
store,
|
||||||
custody_context.clone(),
|
custody_context.clone(),
|
||||||
spec.clone(),
|
spec.clone(),
|
||||||
|
|||||||
@@ -828,7 +828,7 @@ mod test {
|
|||||||
block_verification::PayloadVerificationOutcome,
|
block_verification::PayloadVerificationOutcome,
|
||||||
block_verification_types::{AsBlock, BlockImportData},
|
block_verification_types::{AsBlock, BlockImportData},
|
||||||
custody_context::NodeCustodyType,
|
custody_context::NodeCustodyType,
|
||||||
data_availability_checker::STATE_LRU_CAPACITY,
|
data_availability_checker::STATE_LRU_CAPACITY_NON_ZERO,
|
||||||
test_utils::{BaseHarnessType, BeaconChainHarness, DiskHarnessType},
|
test_utils::{BaseHarnessType, BeaconChainHarness, DiskHarnessType},
|
||||||
};
|
};
|
||||||
use fork_choice::PayloadVerificationStatus;
|
use fork_choice::PayloadVerificationStatus;
|
||||||
@@ -842,6 +842,7 @@ mod test {
|
|||||||
use types::{ExecPayload, MinimalEthSpec};
|
use types::{ExecPayload, MinimalEthSpec};
|
||||||
|
|
||||||
const LOW_VALIDATOR_COUNT: usize = 32;
|
const LOW_VALIDATOR_COUNT: usize = 32;
|
||||||
|
const STATE_LRU_CAPACITY: usize = STATE_LRU_CAPACITY_NON_ZERO.get();
|
||||||
|
|
||||||
fn get_store_with_spec<E: EthSpec>(
|
fn get_store_with_spec<E: EthSpec>(
|
||||||
db_path: &TempDir,
|
db_path: &TempDir,
|
||||||
|
|||||||
Reference in New Issue
Block a user