fix(yamux): align default window with spec and reject invalid versions#2787
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2787 +/- ##
==========================================
- Coverage 81.32% 81.31% -0.02%
==========================================
Files 171 171
Lines 31013 31014 +1
Branches 12 12
==========================================
- Hits 25221 25218 -3
- Misses 5792 5796 +4
🚀 New features to boost your workflow:
|
vladopajic
approved these changes
Jul 8, 2026
gmelodie
approved these changes
Jul 8, 2026
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.
Summary
Align yamux’s default stream window with the spec/reference 256 KiB value (
256 * 1024) instead of decimal256000, and reject headers whose version byte is not0.This matches the default initial credit and version handling used by go-yamux and rust-yamux. Existing yamux tests were updated to use
YamuxDefaultWindowSizefor window exhaustion cases and to expectYamuxErrorfor non-zero-version headers.Affected Areas
Protocol Logic
Yamux stream-window defaults and header validation.
Other
Yamux muxer/header tests and metrics bucket boundaries.
Impact on Library Users
No API changes.
Behavior changes:
Risk Assessment
Low. This brings Nim yamux behavior in line with upstream Go and Rust implementations. The main compatibility impact is that peers sending non-zero yamux versions are now rejected, which is expected for
/yamux/1.0.0.References