-
Notifications
You must be signed in to change notification settings - Fork 3
feat: add protocol versioning #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
942a1c0 to
671824a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds protocol versioning to the /status endpoint to enable version compatibility checks between nodes. The implementation sets PROTOCOL_VERSION to 1 (distinguishing from the mainnet default of 0) and wraps the status response in a new StatusResponse struct that includes the version number.
Key changes:
- Introduces a
PROTOCOL_VERSIONconstant set to 1 - Wraps the
/statusendpoint response in aStatusResponsestruct containing both the status and protocol version - Implements protocol version checking in node connections to mark incompatible nodes as offline
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
chain-signatures/node/src/lib.rs |
Defines PROTOCOL_VERSION constant as 1 |
chain-signatures/node/src/web/mod.rs |
Introduces StatusResponse struct and updates the /status endpoint to return it with protocol version |
chain-signatures/node/src/node_client.rs |
Updates client to expect StatusResponse instead of NodeStatus from the /status endpoint |
chain-signatures/node/src/mesh/connection.rs |
Adds protocol version validation logic to mark nodes with mismatched versions as offline |
chain-signatures/node/src/web/mock.rs |
Updates mock server to support protocol version testing, including backward compatibility mode |
chain-signatures/node/src/mesh/mod.rs |
Adds comprehensive test for protocol version mismatch behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jakmeier
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense!
I tried writing down the context around, as we discussed it on Slack, in an issue. Please take a look #609
| } | ||
|
|
||
| #[test(tokio::test)] | ||
| async fn test_protocol_version_mismatch_marks_offline() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice test!
|
@ChaoticTempest thanks for looking into this! |
* Add protocol versioning * Fix comment
Adds in protocol versioning to /status. Defaults PROTOCOL_VERSION to 1, since 0 is what we have mainnet.