Skip to content

Commit

Permalink
add some more docs wrt snapshot tx num != db tx num
Browse files Browse the repository at this point in the history
  • Loading branch information
joshieDo committed Jan 23, 2024
1 parent 2a5fc4f commit ead73cc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/stages/src/stages/bodies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,10 @@ impl<DB: Database, D: BodyDownloader> Stage<DB> for BodyStage<D> {
.unwrap_or_default();

match next_snapshot_tx_num.cmp(&next_tx_num) {
// If static files is ahead, then we didn't reach the database commit in a previous stage run.
Ordering::Greater => snapshotter
.prune_transactions(next_snapshot_tx_num - next_tx_num, from_block - 1)?,
// If static files is behind, then there was some corruption or loss of files.
Ordering::Less => {
let last_block = snapshot_provider
.get_highest_snapshot_block(SnapshotSegment::Transactions)
Expand Down

0 comments on commit ead73cc

Please sign in to comment.