Repository navigation
Fix ticket byte overcount and relay reconnect recovery in 0.5.9 - #6
Merged
Merged
Conversation
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.
On reconnect, DiodeJS queried
bytesbefore its first ticket selected the configured fleet, then added that value to its prior paid total. With 10 MB already paid and no new traffic, it could sign roughly 20 MB; at larger totals the relay rejected tickets withtoo_big_jump. Parallel connections could also add pending bytes that another connection had already paid.Use the relay's absolute usage report from
helloversion 1001 before signing, reconcile stale local totals downward, and respect the current epoch's paid floor. Refresh usage aftertoo_lowand use bounded retry margins during active streaming; an older relay that rejects 1001 uses a conservative fallback. Bump the package to 0.5.9 and run tests on pull requests without publishing from PRs.Validation: clean Node 20 install and full suite pass (287/287); Node 22 full suite passes; package dry run includes the updated connection code. Independent review found no blocking issue. Traffic growing by more than the 1 MB retry bound can still fail closed with
too_low.