mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-10 23:15:34 -05:00
fix(stages): calculate checkpoints from static files (#6973)
This commit is contained in:
@@ -343,7 +343,11 @@ fn stage_checkpoint<DB: Database>(
|
||||
) -> ProviderResult<EntitiesCheckpoint> {
|
||||
Ok(EntitiesCheckpoint {
|
||||
processed: provider.count_entries::<tables::BlockBodyIndices>()? as u64,
|
||||
total: (provider.count_entries::<tables::Headers>()? as u64).saturating_sub(1),
|
||||
// Count only static files entries. If we count the database entries too, we may have
|
||||
// duplicates. We're sure that the static files have all entries that database has,
|
||||
// because we run the `StaticFileProducer` before starting the pipeline.
|
||||
total: (provider.static_file_provider().count_entries::<tables::Headers>()? as u64)
|
||||
.saturating_sub(1),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -221,7 +221,10 @@ fn stage_checkpoint<DB: Database>(
|
||||
// matching the actual number of processed transactions. To fix that, we add the
|
||||
// number of pruned `TransactionSenders` entries.
|
||||
processed: provider.count_entries::<tables::TransactionSenders>()? as u64 + pruned_entries,
|
||||
total: provider.count_entries::<tables::Transactions>()? as u64,
|
||||
// Count only static files entries. If we count the database entries too, we may have
|
||||
// duplicates. We're sure that the static files have all entries that database has,
|
||||
// because we run the `StaticFileProducer` before starting the pipeline.
|
||||
total: provider.static_file_provider().count_entries::<tables::Transactions>()? as u64,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -219,7 +219,10 @@ fn stage_checkpoint<DB: Database>(
|
||||
// number of pruned `TransactionHashNumbers` entries.
|
||||
processed: provider.count_entries::<tables::TransactionHashNumbers>()? as u64 +
|
||||
pruned_entries,
|
||||
total: provider.count_entries::<tables::Transactions>()? as u64,
|
||||
// Count only static files entries. If we count the database entries too, we may have
|
||||
// duplicates. We're sure that the static files have all entries that database has,
|
||||
// because we run the `StaticFileProducer` before starting the pipeline.
|
||||
total: provider.static_file_provider().count_entries::<tables::Transactions>()? as u64,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user