feat(repeater): antispam — FairnessLimiter (port #1502) + kanálový deny list
Reakce na 5. 9.: ujetý AI bot lil 11dílný Gemini 429 dump na #meshcore (99 ze 100 posledních zpráv kanálu) a naše repeatery ho poslušně šířily. Vrstva A — FairnessLimiter (port Beanowovy větve beanow/wp-repeat, upstream návrh meshcore-dev/MeshCore#1502): token buckety nad FORWARDOVANÝM provozem, klíčované 1B identifikátory v plaintextu (channel hash / src hash / pubkey[0]). Nový virtual Mesh::takeForwardingRateLimit() jako poslední podmínka všech čtyř forward rozhodnutí. DIRECT se nelimituje. Odchylky od originálu: bez RTC závislosti (logy přes MESH_DEBUG_PRINTLN), bounds guardy na payload_len. Kill switch: `fairness on|off` (persistovaný pref). Vrstva B — ChannelFilter: repeater se znalostí PSK (committed [channel_filter] — klíče hashtag kanálů jsou SHA256(jméno)[:16], tedy veřejné z konstrukce; derivace ověřená na 0xEF z éteru) dešifruje GRP_TXT a zprávy odesílatelů z runtime deny listu odmítne přeposlat (markDoNotRetransmit, stejný mechanismus jako ANON větev). CLI `filter add|del|list|clear`, seznam v NodePrefs. Jméno je spoofovatelné — je to zadržení ujetého bota, ne security; příjem a rxlog/pktfeed (CoreScope) nedotčené. Fork-only, upstream by to nevzal (privacy/no-censorship, viz diskuze u #169). ChannelBot refactor: registr kanálů + parse sdílené v ChannelCommon.h (bot = botOnChannelText), čisté helpery v ChanListUtil.h kvůli native testům. Nové testy test_fairness_limiter + test_chan_list (native i ASAN, 164/164 zelených). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7fbcf07aee
commit
04838e8492
15 files changed
+1098
-112
No files matched your search
@@ -98,6 +98,9 @@ build_flags =
|
||||
; are ~3-4 min apart: 64 records ≈ 10+ min of typical traffic buys margin for
|
||||
; busy evenings; drop detection via the E-trailer catches any overflow.
|
||||
-D PKTFEED_SIZE=64
|
||||
; Antispam deny list on the community channels (ChannelFilter.h); the keys in
|
||||
; [channel_filter] are public by construction. Runtime: `filter add <name>`.
|
||||
${channel_filter.build_flags}
|
||||
; -D MESH_PACKET_LOGGING=1
|
||||
build_src_filter = ${SenseCap_Solar.build_src_filter}
|
||||
+<../examples/simple_repeater/*.cpp>
|
||||
|
||||
Reference in new issue
Block a user