Skip to content

Commit

Permalink
adjust docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo committed Sep 21, 2024
1 parent 6cdee2e commit f581935
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions crates/storage/provider/src/providers/static_file/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -534,14 +534,14 @@ impl StaticFileProvider {
.or_insert_with(|| BTreeMap::from([(tx_end, current_block_range)]));
}
} else if segment.is_tx_based() {
// The unwound file has no more transactions/receipts. However, the tip is part
// of this files' block range. We only retain entries with
// block ranges before the current one.
// The unwinded file has no more transactions/receipts. However, the highest
// block is within this files' block range. We only retain
// entries with block ranges before the current one.
tx_index.entry(segment).and_modify(|index| {
index.retain(|_, block_range| block_range.start() < fixed_range.start());
});

// If the segment index is empty, just remove it.
// If the index is empty, just remove it.
if tx_index.get(&segment).is_some_and(|index| index.is_empty()) {
tx_index.remove(&segment);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/storage/provider/src/providers/static_file/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,9 +510,9 @@ mod tests {
0,
blocks_per_file - 1,
Some(highest_tx - 1),
files_per_range + 1,
files_per_range + 1, // includes lockfile
vec![(highest_tx - 1, SegmentRangeInclusive::new(0, 9))],
), /* includes lockfile */
),
// Case 2: Prune most txs up to block 1.
(
highest_tx - 1,
Expand Down

0 comments on commit f581935

Please sign in to comment.