Skip to content

Commit

Permalink
Revert "comment querying from snapshots to prevent slowdown"
Browse files Browse the repository at this point in the history
This reverts commit e9e217d.
  • Loading branch information
shekhirin committed Jan 25, 2024
1 parent e9e217d commit 019d1bf
Showing 1 changed file with 13 additions and 22 deletions.
35 changes: 13 additions & 22 deletions crates/storage/provider/src/providers/database/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1644,29 +1644,20 @@ impl<TX: DbTx> TransactionsProvider for DatabaseProvider<TX> {
&self,
range: impl RangeBounds<TxNumber>,
) -> ProviderResult<Vec<RawValue<TransactionSignedNoHash>>> {
let range = to_range(range);
self.cursor_collect_with_capacity(
&mut self.tx.cursor_read::<RawTable<tables::Transactions>>()?,
RawKey::new(range.start)..RawKey::new(range.end),
range_size_hint(&range).unwrap_or(0),
|_, v| Ok(v),
self.get_range_with_snapshot(
SnapshotSegment::Transactions,
to_range(range),
|snapshot, range, _| snapshot.raw_transactions_by_tx_range(range),
|range, _| {
self.cursor_collect_with_capacity(
&mut self.tx.cursor_read::<RawTable<tables::Transactions>>()?,
RawKey::new(range.start)..RawKey::new(range.end),
range_size_hint(&range).unwrap_or(0),
|_, v| Ok(v),
)
},
|_| true,
)

// TODO(alexey): uncomment to query from snapshots
// self.get_range_with_snapshot(
// SnapshotSegment::Transactions,
// to_range(range),
// |snapshot, range, _| snapshot.raw_transactions_by_tx_range(range),
// |range, _| {
// self.cursor_collect_with_capacity(
// &mut self.tx.cursor_read::<RawTable<tables::Transactions>>()?,
// RawKey::new(range.start)..RawKey::new(range.end),
// range_size_hint(&range).unwrap_or(0),
// |_, v| Ok(v),
// )
// },
// |_| true,
// )
}

fn senders_by_tx_range(
Expand Down

0 comments on commit 019d1bf

Please sign in to comment.