MCP: v1 layout wire encoding - #3245
Draft
xinyuan-dev wants to merge 1 commit into
Draft
xinyuan-dev wants to merge 1 commit into
xinyuan-dev wants to merge 1 commit into
Conversation
xinyuan-dev
force-pushed
the
xinyuan/da-serialization
branch
from
September 7, 2026 17:20
021aa2d to
32ea657
Compare
xinyuan-dev
force-pushed
the
xinyuan/da-serialization
branch
from
September 7, 2026 18:09
32ea657 to
8df6748
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR implements the encoding and decoding of logical
Chunkinto/from v1 wire format (Bytes).The concept of
PacketLayoutgets absorbed intowire/v1.rsandEncodingScheme. Now v1 packet layout is simplified into two parts: header (sig, signed bytes) and body (merkle proof, chunk header, symbol).Clarified separation of responsibility:
wire/v1.rsowns the knowledge of packet format (segment length, positions of fields), decoding & encoding of the bytesEncodingSchemeis logical - it owns the knowledge of theapp_msg_len, thedepthand their calculation as well as other header fields.Changes:
EncodingScheme for D25 now includes three fields:
app_msg_len, depth, coarse_tsinstead of two:app_msg_len, unix_ts. The extradepthfield makes validation cheaper and obviate the need to pre-compute packet layout. The coarse-grained ts is better at expressing the semantic of equality onEncodingScheme.The
stubsymbol codec implementation is changed to a repetition code to accommodate for the enforced symbol length.Another conceptual simplification is the delayed verification of a chunk:
SlotRaptorcast(akaauthenticate, shared with chorus for proposal headers received in consensus message)RaptorcastInstance; so a chunk with invalid merkle proof still gets its header registered for potential equivocation.