Disclaimer. I’ll admit up front that I have a lot to learn about the peer-to-peer layer; I’d love pointers to deeper resources beyond e.g. the ethereum.org documentation about the networking layer.
Background. In my understanding, the P2P protocol needs to very carefully limit messages propogated, to avoid DOS. Therefore, nodes employ a variety of rules and also heuristics to decide when to pass on gossip. However, we do need to often allow messages to make it across the entire network, even some messages that seem wrong or untrusted to the current node (I am thinking of the Holesky Pectra deployment failure, where we need the minority chain members to be able to reach each other).
So, we would like each untrustworthy message to either be treated in one of two ways:
- Essentially do not propogate at all; reject.
- Propogate to essentially every node on the network, with as little communication as possible.
For example, for each message, we can flip a coin with weight depending on how overloaded the network currently is and how trustworthy the message is, and propogate the message only if the coin comes up heads.
Problem. The key point is that if each node tries to employ such a filtering method independently, we will (I think) fail to achieve a balance between (1) and (2) above. If each node randomly rejects, then messages will generally die out after a few hops, not reaching the entire network. If that is not true (i.e. random rejection probabilities are low), then most messages will reach the entire network, but that means we’re vulnerable to DOS.
Proposal. We can use a coordination mechanism where instead of nodes independently flipping a coin, they coordinate to all flip the same coin. If the coin is heads, every node spreads this untrustworthy message (according to a reasonable gossip protocol; I’m not saying they have to blast it to all their peers). If the coin is tails, every honest node agrees not to spread this message.
How do we flip a coin all together? We can do something like hash the message along with the header of the most recent block on the chain, and propogate the message if the last bit is 1. Since most of the network will agree on the most recent block, this will have pretty good coordination properties.
Extension. Suppose that nodes want to coordinate, but each node wants to use its own heuristics for trustworthiness of a message and make its own decisions about how often to propogate in general. We can ask each node to compute a score for each message between 0 and 2^{64} based on trustworthiness and willingness to propogate. A node then uses the last 64 bits of the coordinated hash mentioned above to determine a threshold between 0 and 2^{64} - 1. If the message’s score is above my personal threshold, then I propagate the message. This system will still have the property that it propogates generally trustworthy messages much more than untrustworthy ones, but it sometimes allows seemingly-untrustworthy messages to spread.
Note. A similar technique can be used for other P2P decisions, such as whether to respond to requests from a new, untrusted node. Also, this technique can be pictured as, or modified to work as, a type of proof-of-work HashCash defense mechanism against DOS attacks.
Questions. Are ideas like this already out there? Is it a reasonable or potentially useful idea? Is there something important about the P2P layer that I don’t seem to understand?