Skip to content

Commit

Permalink
fix: always truncate static files
Browse files Browse the repository at this point in the history
  • Loading branch information
klkvr committed Nov 22, 2024
1 parent f211aac commit c537d42
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions crates/storage/provider/src/providers/database/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3030,13 +3030,13 @@ impl<TX: DbTxMut + DbTx + 'static, N: ProviderNodeTypes + 'static> BlockWriter
.static_file_provider
.get_highest_static_file_tx(StaticFileSegment::Transactions);

if let Some(static_tx) = static_file_tx_num {
if static_tx >= unwind_tx_from {
self.static_file_provider
.latest_writer(StaticFileSegment::Transactions)?
.prune_transactions(static_tx - unwind_tx_from + 1, block)?;
}
}
let to_delete = static_file_tx_num
.map(|static_tx| (static_tx + 1).saturating_sub(unwind_tx_from))
.unwrap_or_default();

self.static_file_provider
.latest_writer(StaticFileSegment::Transactions)?
.prune_transactions(to_delete, block)?;
}

Ok(())
Expand Down

0 comments on commit c537d42

Please sign in to comment.