Drop support for mpsc frames without the MessageEnd byte
Maintainers usually reply within 2 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 43/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend-api-design, networking
Research direction
Read decode_frame and its protocol version or ALPN handling, along with the related discussion in #27. Trace how frame length and MessageEnd are decoded, then check the protocol tests for compatibility cases. Done means frames require an end byte, aborted frames are dropped before decoding, malformed frames return protocol errors, and the wire break is accompanied by a version bump.
Written by the indexing model from the issue text.
Description
Since #167, an mpsc frame ends with a one-byte MessageEnd (0 = complete, 1 = aborted), included in the length prefix. To stay wire compatible with pre-1.0 senders, decode_frame also accepts frames without that byte, and treats them as complete.
Because an old frame has no end marker, its last byte is just message data, so the receiver cannot tell the two formats apart by looking at the last byte. decode_frame therefore has to:
- decode the message first,
- then look at what is left: nothing means an old frame (complete), one byte is the
MessageEnd, - and if the decode fails, drop the frame if its last byte happens to be
1(Aborted).
This has two warts:
- An aborted message is fully deserialized only to be thrown away.
- A pre-1.0 frame that does not decode and happens to end in
1is silently dropped instead of failing withMessageDecodeFailed(roughly 1 in 256 undecodable old frames). This is documented ondecode_frame, but it is weird.
Once we no longer need to talk to pre-1.0 senders, we should require the end byte:
- last byte
1: drop the frame without decoding it, - last byte
0: decode, and any decode failure is a real error, - no end byte / trailing garbage: protocol error.
This is a wire break for pre-1.0 senders, so it should come with a protocol version bump (e.g. a new ALPN) rather than land silently.
Related: #27
- Dominant language
- Rust
- Stars
- 59
- Forks
- 10
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 21
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from n0-computer/irpc
-
Would be nice to have a way to get the current RTT (and possibly other information) from the underlying connectionPossibly taken @rklaehn claimed this 12 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
n0-computer/irpc#95 · 4 comments · 1 reaction ·
Maintainers usually reply within 2 days
-
Rate limiting for irpc (quinn and iroh) server sideMay be free again @rklaehn claimed this 281 days ago, and no pull request is open. Openenhancement
n0-computer/irpc#93 · 1 assignee ·
Maintainers usually reply within 2 days
-
Make it possible to have stateful connectionsPossibly taken @Frando claimed this 25 days ago. Open
Difficulty 5/5 Over a week Newbie friendliness 42/100
n0-computer/irpc#60 · 2 comments ·
Maintainers usually reply within 2 days
-
Difficulty 1/5 1-3 hours Newbie friendliness 45/100
n0-computer/irpc#49 ·
Maintainers usually reply within 2 days
-
Add connection idOpen
Difficulty 3/5 1-2 days Newbie friendliness 45/100
n0-computer/irpc#13 ·
Maintainers usually reply within 2 days
All issues in n0-computer/irpc
Similar issues
-
area:web kind:bug priority:p2 ready
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 84/100
sims1253/r-typeshed#140 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
storytold/craft-libs#2867 ·
Maintainers usually reply within 1 day
-
help wanted needs investigation priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 62/100