Skip to content

Conversation

@ChaoticTempest
Copy link
Contributor

Adds in protocol versioning to /status. Defaults PROTOCOL_VERSION to 1, since 0 is what we have mainnet.

Copy link
Contributor

Copilot AI left a 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_VERSION constant set to 1
  • Wraps the /status endpoint response in a StatusResponse struct 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.

Copy link
Contributor

@jakmeier jakmeier left a 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() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice test!

@ChaoticTempest ChaoticTempest merged commit 77ea512 into develop Dec 2, 2025
3 checks passed
@ChaoticTempest ChaoticTempest deleted the phuong/feat/mpc-versioning branch December 2, 2025 02:16
@volovyks
Copy link
Contributor

volovyks commented Dec 2, 2025

@ChaoticTempest thanks for looking into this!

ppca pushed a commit that referenced this pull request Dec 3, 2025
* Add protocol versioning

* Fix comment
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.

4 participants