Skip to content

Fix ticket byte overcount and relay reconnect recovery in 0.5.9 - #6

Merged
tuhalf merged 4 commits into
mainfrom
fix/bounded-ticket-advance
Sep 24, 2026
Merged

tuhalf merged 4 commits into
mainfrom
fix/bounded-ticket-advance

Conversation

@tuhalf

@tuhalf tuhalf commented Sep 24, 2026

Copy link
Copy Markdown
Contributor

On reconnect, DiodeJS queried bytes before 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 with too_big_jump. Parallel connections could also add pending bytes that another connection had already paid.

Use the relay's absolute usage report from hello version 1001 before signing, reconcile stale local totals downward, and respect the current epoch's paid floor. Refresh usage after too_low and 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.

@tuhalf
tuhalf merged commit 3a5a83c into main Sep 24, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant