Fix announce flood from TCP hub overwhelming device (v1.5.7)

4-layer defense against 100+ node announce storms from rns.ratspeak.org:
- Transport-level rate limiter (5/sec) via filter_packet callback, before Ed25519 verify
- TCP frame processing time-boxed to 15ms per loop iteration
- Global announce rate limit (3/sec) in AnnounceManager
- UI rebuild throttled to once per 2 seconds

Also fixes message status not persisting to disk on queue drain.
This commit is contained in:
DeFiDude
2026-03-10 00:08:56 -06:00
parent 9c48530ec8
commit 6f272596c8
11 changed files with 115 additions and 5 deletions
+3 -2
View File
@@ -71,8 +71,9 @@ void TCPClientInterface::loop() {
return; // Will reconnect on next loop iteration
}
// Drain multiple incoming frames per loop (up to 10)
for (int i = 0; i < 10 && _client.available(); i++) {
// Drain multiple incoming frames per loop (up to 10, time-boxed)
unsigned long tcpStart = millis();
for (int i = 0; i < 10 && _client.available() && (millis() - tcpStart < TCP_LOOP_BUDGET_MS); i++) {
unsigned long rxStart = millis();
int len = readFrame();
if (len > 0) {