This PR aims to solve a DOS vector that is outlined in https://github.com/AleoNet/snarkOS/issues/3243, where a malicious validator can fill up the max_redundant_requests and not respond. This PR adjusts the rules so that we only send one request for that item to a given peer at a time.
This means that max_redundant_requests can only be reached with unique peers. And because max_redundant_requests is based on the availability threshold you can expect at least one node to be honest.
Test Plan
A test has been added to ensure that the functionality of contains_peer_with_sent_request is as intended.
Motivation
This PR aims to solve a DOS vector that is outlined in https://github.com/AleoNet/snarkOS/issues/3243, where a malicious validator can fill up the
max_redundant_requests
and not respond. This PR adjusts the rules so that we only send one request for that item to a given peer at a time.This means that
max_redundant_requests
can only be reached with unique peers. And becausemax_redundant_requests
is based on the availability threshold you can expect at least one node to be honest.Test Plan
A test has been added to ensure that the functionality of
contains_peer_with_sent_request
is as intended.