Skip to content

Commit 74ebf8b

Browse files
committed
Fix clippy and tests
1 parent fcc96a1 commit 74ebf8b

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

beacon_node/beacon_chain/src/schema_change/migration_schema_v24.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,12 @@ pub fn downgrade_from_v24<T: BeaconChainTypes>(
280280
.into_iter()
281281
.flat_map(|(_, summaries)| summaries)
282282
{
283-
// If boundary state persist
283+
// If boundary state persist.
284+
// Do not cache these states as they are unlikely to be relevant later.
285+
let update_cache = false;
284286
if summary.slot % T::EthSpec::slots_per_epoch() == 0 {
285287
let (state, _) = db
286-
.load_hot_state(&state_root)?
288+
.load_hot_state(&state_root, update_cache)?
287289
.ok_or(Error::MissingState(state_root))?;
288290

289291
// Immediately commit the state. Otherwise we will OOM and it's stored in a different

beacon_node/beacon_chain/tests/store_tests.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -518,14 +518,14 @@ async fn epoch_boundary_state_attestation_processing() {
518518
.expect("block exists");
519519
// Use get_state as the state may be finalized by this point
520520
let mut epoch_boundary_state = store
521-
.get_state(&block.state_root(), None)
521+
.get_state(&block.state_root(), None, CACHE_STATE_IN_TESTS)
522522
.expect("no error")
523523
.unwrap_or_else(|| {
524524
panic!("epoch boundary state should exist {:?}", block.state_root())
525525
});
526526
let ebs_state_root = epoch_boundary_state.update_tree_hash_cache().unwrap();
527527
let mut ebs_of_ebs = store
528-
.get_state(&ebs_state_root, None)
528+
.get_state(&ebs_state_root, None, CACHE_STATE_IN_TESTS)
529529
.expect("no error")
530530
.unwrap_or_else(|| panic!("ebs of ebs should exist {ebs_state_root:?}"));
531531
ebs_of_ebs.apply_pending_mutations().unwrap();

beacon_node/store/src/hdiff.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -654,10 +654,10 @@ impl HierarchyConfig {
654654
impl HierarchyModuli {
655655
/// * `slot` - Slot of the storage strategy
656656
/// * `start_slot` - Slot before which states are not available. Initial snapshot point, which
657-
/// may not be aligned to the hierarchy moduli values. Given an example of
658-
/// exponents [5,13,21], to reconstruct state at slot 3,000,003: if start = 3,000,002
659-
/// layer 2 diff will point to the start snapshot instead of the layer 1 diff at
660-
/// 2998272.
657+
/// may not be aligned to the hierarchy moduli values. Given an example of
658+
/// exponents [5,13,21], to reconstruct state at slot 3,000,003: if start = 3,000,002
659+
/// layer 2 diff will point to the start snapshot instead of the layer 1 diff at
660+
/// 2998272.
661661
pub fn storage_strategy(&self, slot: Slot, start_slot: Slot) -> Result<StorageStrategy, Error> {
662662
match slot.cmp(&start_slot) {
663663
Ordering::Less => return Err(Error::LessThanStart(slot, start_slot)),

0 commit comments

Comments
 (0)