go-p2p/node
Claude a60dfdf93b
feat: implement UEPS packet dispatcher with threat circuit breaker
Implements Phase 4 of the go-p2p task queue. The Dispatcher routes
HMAC-verified UEPS packets to registered IntentHandlers by IntentID,
enforcing a threat circuit breaker that drops packets with ThreatScore
exceeding 50,000 (logged as threat events at WARN level).

Design choices:
- IntentHandler is a func type (not interface) for lightweight registration
- 1:1 mapping of IntentID to handler, replacement on re-register
- Threat check fires before intent routing (hostile packets never reach handlers)
- Sentinel errors (ErrThreatScoreExceeded, ErrUnknownIntent, ErrNilPacket)
- RWMutex protects handler map for concurrent safety

Tests: 10 test functions, 17 subtests — 100% dispatcher coverage.
Race detector clean. All 102 existing tests continue to pass.

Co-Authored-By: Charon <developers@lethean.io>
2026-02-20 00:23:10 +00:00
..
bufpool.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
bundle.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
bundle_test.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
controller.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
controller_test.go test: add controller tests (Phase 3) — node/ coverage 63.5% to 72.1% 2026-02-20 00:17:31 +00:00
dispatcher.go feat: implement UEPS packet dispatcher with threat circuit breaker 2026-02-20 00:23:10 +00:00
dispatcher_test.go feat: implement UEPS packet dispatcher with threat circuit breaker 2026-02-20 00:23:10 +00:00
identity.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
identity_test.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
message.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
message_test.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
peer.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
peer_test.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
protocol.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
protocol_test.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
transport.go test: add controller tests (Phase 3) — node/ coverage 63.5% to 72.1% 2026-02-20 00:17:31 +00:00
transport_test.go test: add transport layer tests (Phase 2) — node/ coverage 42% to 63.5% 2026-02-20 00:08:35 +00:00
worker.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00
worker_test.go feat: extract P2P networking and UEPS protocol from Mining repo 2026-02-16 15:47:10 +00:00