feat(p2p): add production infrastructure modules

- error.rs: Structured error types with context for all subsystems
  (transport, routing, crypto, protocol, store, config)
- config.rs: Runtime configuration with TOML parsing and validation
- metrics.rs: Counter/gauge/histogram metrics with transport-specific
  tracking and JSON-serializable snapshots
- rate_limit.rs: Token bucket rate limiting with per-peer tracking,
  duty cycle enforcement for LoRa, and backpressure control

These modules provide the foundation for production deployment.
This commit is contained in:
2026-04-01 09:16:44 +02:00
parent ac36534063
commit 024b6c91d1
7 changed files with 1824 additions and 0 deletions

View File

@@ -37,6 +37,10 @@ x25519-dalek = { workspace = true }
hkdf = { workspace = true }
thiserror = { workspace = true }
# Configuration
toml = "0.8"
humantime-serde = "1"
[dev-dependencies]
tempfile = "3"