Skip to content

RPC trailing-bytes rejection skips zero-payload request protocols #727

Description

@rocker-zhang

PR #28 adds the trailing-bytes drain only on the SSZ-decode arm of upgrade_inbound. The five zero-payload arms (MetaDataV1/V2/V3, LightClientOptimisticUpdateV1, LightClientFinalityUpdateV1) return early, so a peer can still send arbitrary bytes after the protocol prefix on those streams and we accept the request.

Fix: same drain as PR #28, hoisted into a helper around all six arms. Test: a MetaDataV2-with-trailing-bytes variant of test_framed_read_yields_extra_chunk_when_trailing_bytes.

Deferred from #28 to keep that PR small.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions