Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(dht/test): ban peers who send empty encrypted messages (#5130)
Description --- Bans peers who send empty encrypted messages. Significantly updates tests to check for more failure modes and assert ban status for each. Closes [issue 5132](#5132). Motivation and Context --- An [earlier PR](#5123) introduces an error when a peer sends an empty encrypted message, which is not allowed. However, the peer was not banned. Further, [another PR](#5129) updates the handling of unsigned encrypted messages to ensure that bans are done correctly, but does not update tests to check for the bug that led to it. This PR updates the banning logic to ban a peer who forwards an empty encrypted message, which is always detectable. It also significantly refactors and updates tests. For each relevant high-level message failure mode, we test for proper error detection. We also check for the proper ban status of the forwarding peer. How Has This Been Tested? --- [Who tests the testers?](https://en.wikipedia.org/wiki/Quis_custodiet_ipsos_custodes%3F)
- Loading branch information