Skip to content

Commit

Permalink
Remove inaccurate guess for db index
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane committed Jan 8, 2023
1 parent 2d44cdd commit 4b4c24e
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions beacon_node/store/src/hot_cold_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ pub enum HotColdDBError {
MissingHotStateSummary(Hash256),
MissingEpochBoundaryState(Hash256),
MissingSplitState(Hash256, Slot),
MissingStateToPruneBlobs(Hash256, Slot),
MissingStateToPruneBlobs(Hash256),
MissingExecutionPayload(Hash256),
MissingFullBlockExecutionPayloadPruned(Hash256, Slot),
MissingAnchorInfo,
Expand Down Expand Up @@ -1710,15 +1710,9 @@ impl<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>> HotColdDB<E, Hot, Cold>
}

// Load the state from which to prune blobs so we can backtrack.
let erase_state = self
.get_state(
&data_availability_breakpoint,
Some(blob_info.last_pruned_epoch.end_slot(E::slots_per_epoch())),
)?
.ok_or(HotColdDBError::MissingStateToPruneBlobs(
data_availability_breakpoint,
blob_info.oldest_blob_slot,
))?;
let erase_state = self.get_state(&data_availability_breakpoint, None)?.ok_or(
HotColdDBError::MissingStateToPruneBlobs(data_availability_breakpoint),
)?;

// The data availability breakpoint is set at the start of an epoch indicating the epoch
// before can be pruned.
Expand Down

0 comments on commit 4b4c24e

Please sign in to comment.