Skip to content

Commit

Permalink
refactor: remove non-finalized block caching logic from Filter method
Browse files Browse the repository at this point in the history
  • Loading branch information
samcm committed Mar 4, 2025
1 parent b342262 commit 2e3a163
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,21 +97,6 @@ func (b *BeaconBlockV2) Filter(ctx context.Context) bool {
return true
}

// check if block wasn't finalized when requested and filter if already in cache
if !additionalData.EthV2BeaconBlockV2.GetFinalizedWhenRequested() {
key := "beacon_block" + ":" + hash

_, retrieved, err := b.nonFinalizedCache.GetOrSet(ctx, key, version, time.Minute*30)
if err != nil {
b.log.WithError(err).Error("failed to retrieve from cache")

return true
}

// If the block is already in the cache, filter it out
return retrieved
}

return false
}

Expand Down

0 comments on commit 2e3a163

Please sign in to comment.