feat: snapshots (#5738)

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Co-authored-by: Alexey Shekhirin <a.shekhirin@gmail.com>
Co-authored-by: Bjerg <onbjerg@users.noreply.github.com>
This commit is contained in:
joshieDo
2023-12-18 15:55:43 +00:00
committed by GitHub
parent 900fe7ea4e
commit 18dd1b72a1
28 changed files with 1749 additions and 453 deletions

View File

@ -83,12 +83,12 @@ impl<DB> ProviderFactory<DB> {
mut self,
snapshots_path: PathBuf,
highest_snapshot_tracker: watch::Receiver<Option<HighestSnapshots>>,
) -> Self {
) -> ProviderResult<Self> {
self.snapshot_provider = Some(Arc::new(
SnapshotProvider::new(snapshots_path)
SnapshotProvider::new(snapshots_path)?
.with_highest_tracker(Some(highest_snapshot_tracker)),
));
self
Ok(self)
}
/// Returns reference to the underlying database.
@ -401,6 +401,13 @@ impl<DB: Database> ReceiptProvider for ProviderFactory<DB> {
fn receipts_by_block(&self, block: BlockHashOrNumber) -> ProviderResult<Option<Vec<Receipt>>> {
self.provider()?.receipts_by_block(block)
}
fn receipts_by_tx_range(
&self,
range: impl RangeBounds<TxNumber>,
) -> ProviderResult<Vec<Receipt>> {
self.provider()?.receipts_by_tx_range(range)
}
}
impl<DB: Database> WithdrawalsProvider for ProviderFactory<DB> {