Skip to content

[Feature] Add UnknownReason for disconnects#4018

Merged
kaimast merged 4 commits intostagingfrom
feat/disconnect-reason
Nov 27, 2025
Merged

[Feature] Add UnknownReason for disconnects#4018
kaimast merged 4 commits intostagingfrom
feat/disconnect-reason

Conversation

@kaimast
Copy link
Copy Markdown
Contributor

@kaimast kaimast commented Nov 20, 2025

To ensure forward compatibility with new disconnect reasons, such as the ones in #3902, this PR adds an UnknownReason that is the default DisconnectReason when encountering and unknown value.

This is useful, as adding a new disconnect reason should not require a message version bump or a synchronous update.

Additionally, the PR implements Display for DisconnectReason and uses it in log/error messages (in 4027d70)

@kaimast kaimast changed the title [Feat] Add Unknown disconnec [Feature] Add UnknownReason for disconnects Nov 20, 2025
@kaimast kaimast force-pushed the feat/disconnect-reason branch 4 times, most recently from 83b5be9 to d91b590 Compare November 20, 2025 21:16
@kaimast kaimast force-pushed the feat/disconnect-reason branch from d91b590 to 4027d70 Compare November 21, 2025 18:36
@kaimast kaimast marked this pull request as ready for review November 21, 2025 23:49
@kaimast kaimast requested review from ljedrz, raychu86 and vicsn and removed request for vicsn November 21, 2025 23:50
Comment thread node/router/messages/src/helpers/disconnect.rs Outdated
Comment thread node/router/messages/src/helpers/disconnect.rs Outdated
Comment thread node/router/src/handshake.rs Outdated
Co-authored-by: ljedrz <3750347+ljedrz@users.noreply.github.com>
Signed-off-by: Kai Mast <kai@kaimast.com>
@kaimast kaimast requested a review from ljedrz November 24, 2025 23:27
Comment thread node/bft/events/src/disconnect.rs Outdated
Comment thread node/router/messages/src/helpers/disconnect.rs Outdated
ljedrz
ljedrz previously approved these changes Nov 25, 2025
Copy link
Copy Markdown
Collaborator

@ljedrz ljedrz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with the comments by @raychu86 addressed

Co-authored-by: Raymond Chu <14917648+raychu86@users.noreply.github.com>
Signed-off-by: Kai Mast <kai@kaimast.com>
@kaimast
Copy link
Copy Markdown
Contributor Author

kaimast commented Nov 26, 2025

Typos fixed!

@kaimast kaimast merged commit 5934989 into staging Nov 27, 2025
5 checks passed
@kaimast kaimast deleted the feat/disconnect-reason branch November 27, 2025 02:34
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.

3 participants