An idea to block invalid addresses from reaching the peers.dat buckets



Summary:

According to a post on bitcointalk.org, someone is spamming the bitcoin network with addr message pointing to invalid addresses and ports, which is causing issues with the peers.dat file and corresponding memory structure. The custom record type used in peers.dat makes it difficult to parse and determine specifics of IP addresses listed. However, the author suggests implementing changes to prevent this kind of attack from happening in the future. One solution is to change the AddrDb updating functionality so that it does not add nodes that are unreachable due to "connection refused" errors. These addresses can be stored in a new, separate database-like file or augmented in the peers.dat file under a new entry type. Invalid nodes can be immediately flushed from memory to avoid processing them. The check for unreachable nodes will only be made the first time the node is seen in the wild, to avoid blocking nodes that go offline. A new ZMQ message can also be created to send the node's list of ignored addresses, facilitating other nodes discovering blocked nodes. The author suggests introducing a new file or command-line/config option called "ignorelist" or something with a list of subnets that will not be read into the AddrDB buckets in any case. This would work differently from the banlist, which is used to block peers that send invalid messages, not peers that are unreachable. The author of the post is Ali Sherief.


Updated on: 2023-05-21T03:18:37.336291+00:00