Skip to content

internal/witness: use uint8 origin lengths in add-entries - #73

Merged
FiloSottile merged 1 commit into
FiloSottile:mainfrom
filippo-agent:c2sp-357-origin-length
Oct 1, 2026
Merged

FiloSottile merged 1 commit into
FiloSottile:mainfrom
filippo-agent:c2sp-357-origin-length

Conversation

@filippo-agent

@filippo-agent filippo-agent commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Apply the tlog-mirror wire-format change from C2SP/C2SP#357: read the add-entries origin length as a uint8 instead of a big-endian uint16. Ticket and entry lengths remain uint16.

Update the test request encoders and header offsets, and cover successful uploads with 1-byte and 255-byte origins (including multibyte UTF-8), plus rejection of the old uint16 origin prefix. Existing malformed-request tests cover empty origins and truncation throughout the header.

The companion tlog-checkpoint parser limit belongs in Torchwood: Sunlight delegates checkpoint parsing to torchwood.ParseCheckpoint, and the current v0.10.0 dependency does not enforce the new 255-byte limit. This PR leaves that dependency follow-up separate rather than duplicating its parser locally.

Validation:

  • go test ./...
  • go test -race ./internal/witness
  • git diff --check

Companion parser validation PR: FiloSottile/torchwood#96.

Co-authored-by: Shelley <shelley@exe.dev>
@FiloSottile
FiloSottile merged commit 42d2b79 into FiloSottile:main Oct 1, 2026
5 checks passed
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.

2 participants