Skip to content

Commit

Permalink
Merge pull request #2432 from eqlabs/krisztian/fix-get-events-max-unc…
Browse files Browse the repository at this point in the history
…ached-bloom-filter-load-limit

fix(storage/event): really check max uncached bloom filter load limit
  • Loading branch information
kkovaacs authored Dec 3, 2024
2 parents e9812d8 + 24601d5 commit 69d6bb7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/storage/src/connection/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,12 @@ impl Transaction<'_> {
break ScanResult::Done;
}

// Check if we've reached our Bloom filter load limit
if bloom_filters_loaded >= max_uncached_bloom_filters_to_load.get() {
tracing::trace!("Bloom filter limit reached");
break ScanResult::ContinueFrom(block_number);
}

// Check bloom filter
if !key_filter_is_empty || filter.contract_address.is_some() {
let bloom = self.load_bloom(reorg_counter, block_number)?;
Expand Down Expand Up @@ -398,12 +404,6 @@ impl Transaction<'_> {
}

block_number += 1;

// Check if we've reached our Bloom filter load limit
if bloom_filters_loaded >= max_uncached_bloom_filters_to_load.get() {
tracing::trace!("Bloom filter limit reached");
break ScanResult::ContinueFrom(block_number);
}
};

match result {
Expand Down

0 comments on commit 69d6bb7

Please sign in to comment.