Skip to content

sse_transport: handle SSE lines larger than the transfer buffer (error.StreamTooLong) #79

Description

@koko1123

Problem

MevShareClient.on (and any SSE consumer) uses a fixed 8192-byte transfer buffer with takeDelimiterInclusive('\n'). Real MEV-Share mainnet hints with large logs/calldata arrays exceed one buffer and kill the stream with error.StreamTooLong. Reproduced live while building the backrunner example (#38): the stream connects and parses small events, then dies on the first oversized hint.

Fix

  • Grow the transfer buffer, or
  • Handle oversized lines by accumulating into a dynamic buffer until the delimiter is found, or
  • Make the buffer size configurable on the SSE parser / MevShareClient

Pointers

src/sse_transport.zig (the parser) and src/mev_share.zig on() (the 8192 buffer). Add a unit test feeding a >8KB single line. Also worth extending the refAllDeclsRecursive guard pattern to sse_transport so consumer-path breakage is caught in CI.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions