refactor(geode): drop unused KtorRelay knobs (maxFrameBytes, maxAdminBodyBytes)

Ktor's WebSocket layer is unbounded by default, so [limits].max_ws_frame_bytes
was a strfry-parity tuning knob nobody actually used — drop the whole
LimitsSection from StaticConfig and the matching constructor param from
KtorRelay. The negentropy-large-corpus plan note is updated accordingly.

maxAdminBodyBytes is a real defense-in-depth cap (NIP-98 forces us to
read the body for the payload sha256 before we can authenticate, so an
unbounded read is a pre-auth DoS vector). Keep the cap, but stop
exposing it as an operator knob — it was never plumbed through to
StaticConfig and 1 MiB is ~1000× any plausible NIP-86 RPC payload.
Hardcoded at the Nip86HttpRoute construction site with the rationale
inline. Nip86HttpRoute.maxBodyBytes stays so tests can drive the 413
boundary.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vitor Pamplona
2026-05-12 16:14:15 -04:00
parent 47fdd8638e
commit f4bcf38caf
6 changed files with 21 additions and 55 deletions
@@ -126,12 +126,13 @@ for unlimited). 500_000 is well above the floor. Pure config change in
`NegSessionRegistry.open`; expose via `[negentropy].frame_size_limit`
for operators who tune it down to fit smaller WS frame budgets.
Note: `LimitsSection.max_ws_frame_bytes`
(`geode/src/main/kotlin/com/vitorpamplona/geode/config/StaticConfig.kt:148`)
applies to the WebSocket layer. After hex-encoding a 500_000-byte
negentropy payload doubles to ~1_000_000 bytes on the wire; ensure
`max_ws_frame_bytes` is at least 2 MB (or unlimited) in default
config so the response isn't truncated by the WS layer.
Note: Ktor's WebSocket layer does not impose a default frame cap, so a
~1 MB hex-encoded negentropy payload is delivered intact. The
`[limits].max_ws_frame_bytes` operator knob was removed once Ktor's
unbounded default was confirmed to be sufficient — see the
`refactor(geode): drop [limits] section` commit. If a reverse proxy
is in front of the relay, the proxy's frame cap is the only thing
that can still truncate.
### D — concurrent NEG-OPEN cap, shared with REQ