Skip to content

Commit

Permalink
Caplin: fixed remote DOS (#13482)
Browse files Browse the repository at this point in the history
added circuit breaker if too many iterations are performed
  • Loading branch information
Giulio2002 authored Jan 19, 2025
1 parent 9d18363 commit 37cf19f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cl/sentinel/handlers/blobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,13 @@ func (c *ConsensusHandlers) blobsSidecarsByRangeHandler(s network.Stream, versio
defer tx.Rollback()

written := 0
maxIter := 32
currIter := 0
for slot := req.StartSlot; slot < req.StartSlot+req.Count; slot++ {
if currIter >= maxIter {
break
}
currIter++
blockRoot, err := beacon_indicies.ReadCanonicalBlockRoot(tx, slot)
if err != nil {
return err
Expand Down

0 comments on commit 37cf19f

Please sign in to comment.