Skip to content

Bound successful coordinator responses and reject trailing JSON - #16

Open
nirmalhk7 wants to merge 1 commit into
NTARI-RAND:mainfrom
nirmalhk7:nirmal/protocol-response-limits
Open

nirmalhk7 wants to merge 1 commit into
NTARI-RAND:mainfrom
nirmalhk7:nirmal/protocol-response-limits

Conversation

@nirmalhk7

@nirmalhk7 nirmalhk7 commented Nov 7, 2026 •

Copy link
Copy Markdown
Contributor

The reference HTTP client previously accepted trailing JSON values or junk after a successful response and had no configurable success-body size bound. This change requires a complete JSON document for PollJobs and Fees and adds an opt-in Client.MaxResponseBytes budget under SPEC §7.1.

Positive budgets reject declared overflow before reading and bound streamed reads to the budget plus one detection byte before decoding. Zero leaves size unbounded; negative values fail before transport. Read failures and cancellation propagate, response bodies close, and failures return no partial jobs or fee declaration. Unknown fields remain accepted. The budget also covers ignored successful POST content; the existing error-diagnostic cap remains.

The SPEC, conformance bindings, shared transport fixtures, and migration notes accompany the implementation. Current canonical message bytes, signature domains, endpoints, and the standard-library-only dependency boundary are preserved by this patch.

Verification refreshed on November 16, 2026, on both PR head d0acd07e56e12c3c95ac98877f040ae3ca79fb00 and GitHub's merge tree 088cf11077c6f92cff8b65e18c1b25aa52027917 against current main cfe78d1399c1f395c77eda0be991b3206dfdb0cf:

  • go test -race ./... -count=1, go vet ./..., and go build ./... pass, including real chunked signed-fee responses and cancellation while waiting for EOF.
  • python3 testdata/reproduce_spec.py passes all 55 canonical checks; python3 vectors/reproduce_responses.py passes all 15 response framing/budget vectors.
  • Golden vectors regenerate unchanged. Go formatting and PR whitespace checks pass. go list -m all lists only this module; no go.sum or vendor directory is introduced.
  • Source review identified no blocking implementation issue. No code changes were needed for this verification refresh. The PR commit carries a DCO sign-off, and the hosted DCO check passes.

Hosted CI and dependency-leaf workflows still require maintainer authorization; local results do not replace those gates. Independent human review remains required, and the author must not merge the PR. Contributions follow NTARI's Bug-Build-Test guide.

Release and deployment are separate from review readiness. Maintainers must publish a new immutable v0.4.0 tag after review and merge before the Cloudy dependency draft and SoHoLINK dependency draft can acquire real checksums and complete tagged-module verification. Existing consumers pin v0.1.0; intervening GPU/storage additions changed listing and assignment signing bytes under existing v0 domains. Old-module fixtures demonstrate that the candidate rejects those signatures. A coordinated agent, frontend/relay, and coordinator rollout must be agreed and verified before deployment. This PR adopts no persisted-signature migration policy, and publishes no tag or deployment.

Add opt-in pre-decoding byte budgets and require one complete JSON
response for every client. Preserve current-main signing bytes and
document the proposed release and coordinated consumer migration gates.

Signed-off-by: Nirmal Khedkar <nirmalhk7@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant