Skip to content

feat: opt-in Data-first PBNode field order - #103

Open
lidel wants to merge 1 commit into
masterfrom
data-first-encode-option
Open

feat: opt-in Data-first PBNode field order#103
lidel wants to merge 1 commit into
masterfrom
data-first-encode-option

Conversation

@lidel

@lidel lidel commented Aug 31, 2026

Copy link
Copy Markdown

Add EncodeOptions with a FieldOrder knob: the zero value keeps the canonical Links-first bytes, DataFirst writes the Data field before Links so streaming readers can process it before links. Package-level Encode/AppendEncode delegate to zero-value options and are byte-for-byte unchanged.

Mirrors ipld/js-dag-pb#111. Tests pin both orders to the IPIP-550 fixtures and prove the decoder already accepts either.

Refs ipfs/specs#550

Add EncodeOptions with a FieldOrder knob: the zero value keeps
the canonical Links-first bytes, DataFirst writes the Data field
before Links so streaming readers can process it before links.
Package-level Encode/AppendEncode delegate to zero-value options
and are byte-for-byte unchanged.

Mirrors ipld/js-dag-pb#111. Tests pin both orders to the
IPIP-550 fixtures and prove the decoder already accepts either.

Refs ipfs/specs#550
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