op-node: prevent spamming of reqs for blocks triggered by `checkForGapInUnsafeQueue` (#10063)
* Add rangeReqId so we can cancel all associated block req via single flag * Use crypto/rand instead of math/rand for randomReqId * Use atomic counter instead of random num for rangeReqId * Remove redundant peerRequest.complete field. Use inFlight instead * Add mutex to activeRangeRequests map * Do not penalize peer for block not found error * Fix inFlight request clean up logic * Add test checks for cancelled range request * Add mutex protection to inFlight map * Use constants for ResultCode * Simplify inFlight.get method logic * Use same struct for activeRangeRequests and inFlight
Showing
This diff is collapsed.
Please register or sign in to comment