feat(harnessnode): configurable max receive message size #236
DefaultDialWith adds a public configuration contract, but spec.md is unchanged and WIRE-13 still states unconditionally that reference-host harness dials use no transport security. Update WIRE-13 to distinguish default dialing from explicitly configured credentials, and extend RT-4d to document option precedence and preservation of incarnation metadata and Unix-socket selection.
<!-- ccr-overview-v2 -->
🟡 Changes recommended
The new public DefaultDialWith configuration contract is undocumented in spec.md, leaving WIRE-13 inaccurate and RT-4d missing option precedence and metadata and Unix-socket preservation guarantees.
<details open>
<summary><strong>1 open issue</strong></summary>
</details>
<details>
<summary><strong>What changed in this PR</strong></summary>
This PR makes harness message receive limits configurable so long session histories can exceed gRPC’s default 4 MiB limit without replacing the standard dialing logic.
Changes:
HARNESS_MAX_RECV_MSG_SIZE, validated before harnessnode opens listeners.placement.DefaultDialWith for host-supplied gRPC options while preserving incarnation routing metadata and Unix-socket selection.| File | Description |
| ---- | ----------- |
| placement/placement.go | Adds configurable dialing through DefaultDialWith. |
| placement/dial_test.go | Tests client receive limits and routing guarantees. |
| docs/substrate-conformance.md | Documents host-interceptor routing coverage. |
| docs/harness-authoring.md | Explains server and client receive-limit configuration. |
| cmd/harnessnode/tracing_test.go | Adapts tracing tests to the server constructor parameter. |
| cmd/harnessnode/recv_limit_test.go | Tests configuration parsing and oversized session histories. |
| cmd/harnessnode/main.go | Validates, applies, and logs the server receive limit. |
| changelog/unreleased/placement-default-dial-with.md | Announces the configurable dialer API. |
| changelog/unreleased/harnessnode-max-recv-msg-size.md | Announces the harnessnode receive-limit setting. |
</details>
<sub>Review effort: Balanced</sub>
WIRE-13 describes the reference host, which still dials with DefaultDial; DefaultDialWith is a library option for embedding hosts. RT-4d already says CallMetadata replaces any same-key value, TestDefaultDialWithCallMetadataOverridesHostInterceptors pins that for DefaultDialWith, and the option order and unix-socket handling are in the godoc and docs/harness-authoring.md. Leaving spec.md as is.
Clear change, and the tests cover both directions nicely. One small edge: an interceptor that passes PerRPCCredentials can still put a second ate-target-actor on the wire, since gRPC adds credential metadata after the context rewrite. Could the godoc and guide scope the replacement guarantee to outgoing-context metadata and note that credentials shouldn't set routing keys? Not blocking.
Approved these changes.
gambtho
aramase
Startcarries the session's whole prior journal in one message, so a long session hits gRPC's 4 MiB receive limit and harnessnode refuses it withRESOURCE_EXHAUSTEDbefore the harness runs.HARNESS_MAX_RECV_MSG_SIZE(bytes) sets the harness server's receive limit. harnessnode reads all its config from env vars, so this is an env var rather than a CLI flag. Unset keeps 4 MiB; an invalid value stops startup before any listener opens.placement.DefaultDialWith(opts ...grpc.DialOption)dials likeDefaultDialplus the host's options, for example to raise the client-side receive limit.DefaultDialis unchanged, and the incarnation's call metadata still wins over a host interceptor.Tested with
go test -race ./.... New tests cover a 5 MiBStartrefused by default and accepted at a 16 MiB setting, and a 5 MiB harness-to-host message throughDefaultDialandDefaultDialWith. Not tested through atenet-router.