Skip to content

Allow readers to ignore trailing bytes after declared SSZ bytes - #5511

Open
dapplion wants to merge 2 commits into
ethereum:masterfrom
dapplion:p2p-trailing-bytes
Open

Allow readers to ignore trailing bytes after declared SSZ bytes#5511
dapplion wants to merge 2 commits into
ethereum:masterfrom
dapplion:p2p-trailing-bytes

Conversation

@dapplion

@dapplion dapplion commented Aug 4, 2026

Copy link
Copy Markdown
Member

Description

Trailing bytes after the declared n SSZ bytes cannot change the decoded message, but rejecting them requires observing EOF before processing, which adds latency and lets a peer stall a request by holding the stream open. This makes ignoring them permitted.

Teku rejects trailing bytes; Lighthouse, Prysm, Lodestar, Nimbus and Grandine accept them. MAY leaves all six conformant.

Related to sigp/lighthouse#9301
Related to sigp/lighthouse#9567

@Alleysira

Copy link
Copy Markdown
Contributor

Thanks for looking into this @dapplion. I would like to add some cross-client context for discussion, since the implementation has changed after the original report:

@jtraglia jtraglia changed the title p2p: allow readers to ignore trailing bytes after the SSZ payload Allow readers to ignore trailing bytes after declared SSZ bytes Aug 5, 2026
@jtraglia

jtraglia commented Aug 5, 2026

Copy link
Copy Markdown
Member

Will merge after at least one developer from each client team has approved this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants