-
Notifications
You must be signed in to change notification settings - Fork 256
feat: merge intermediate upgrade mode changes #6174
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
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
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
7a01618 to
7785472
Compare
7785472 to
8329327
Compare
neacsu
reviewed
Nov 6, 2025
Contributor
neacsu
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.
@neacsu reviewed 70 of 158 files at r1, all commit messages.
Reviewable status: 70 of 158 files reviewed, all discussions resolved (waiting on @simonwicky)
jstuczyn
added a commit
that referenced
this pull request
Nov 7, 2025
… easily resolve merge conflicts during rebasing added additional v2 query for metadata endpoint for requesting upgrade mode recheck added additional message to v6 authenticator to request explicit upgrade mode recheck clippy test fixes due to updated keys updated assertion for upgrading v1 top up request to v2 compare attester public key against the expected value within the credential proxy use pre-generated attestation public keys within nym-nodes remove version deprecation bugfix: default bandwidth response for authenticator expose upgrade mode information in authenticator responses adding tests for new v2 server passing upgrade mode information in metadata endpoint v2 wireguard private metadata bugfix: make sure to immediately poll for attestation after spawning task fix gateway probe and remove code duplication for finalizing registration squashing before rebasing post rebasing fixes AuthenticatorVersion helpers additional nits allow unwraps in mocks fixed linux build clippy integrating upgrade mode into authenticator fixed build after adding wrappers to response types conditionally updating peer handle bandwidth cleanup negotiate initial protocol during registration change auth to use highest protocol handler for JWT message dont meter client bandwidth in upgrade mode handling recheck requests sending information about upgrade_mode on client messages gateway watching for upgrade mode attestation wip: gateways to disable bandwidth metering on upgrade mode
35ba5de to
1b159c8
Compare
simonwicky
approved these changes
Nov 12, 2025
jstuczyn
added a commit
that referenced
this pull request
Nov 13, 2025
… easily resolve merge conflicts during rebasing added additional v2 query for metadata endpoint for requesting upgrade mode recheck added additional message to v6 authenticator to request explicit upgrade mode recheck clippy test fixes due to updated keys updated assertion for upgrading v1 top up request to v2 compare attester public key against the expected value within the credential proxy use pre-generated attestation public keys within nym-nodes remove version deprecation bugfix: default bandwidth response for authenticator expose upgrade mode information in authenticator responses adding tests for new v2 server passing upgrade mode information in metadata endpoint v2 wireguard private metadata bugfix: make sure to immediately poll for attestation after spawning task fix gateway probe and remove code duplication for finalizing registration squashing before rebasing post rebasing fixes AuthenticatorVersion helpers additional nits allow unwraps in mocks fixed linux build clippy integrating upgrade mode into authenticator fixed build after adding wrappers to response types conditionally updating peer handle bandwidth cleanup negotiate initial protocol during registration change auth to use highest protocol handler for JWT message dont meter client bandwidth in upgrade mode handling recheck requests sending information about upgrade_mode on client messages gateway watching for upgrade mode attestation wip: gateways to disable bandwidth metering on upgrade mode
70abac2 to
85856d7
Compare
jstuczyn
added a commit
that referenced
this pull request
Nov 13, 2025
… easily resolve merge conflicts during rebasing added additional v2 query for metadata endpoint for requesting upgrade mode recheck added additional message to v6 authenticator to request explicit upgrade mode recheck clippy test fixes due to updated keys updated assertion for upgrading v1 top up request to v2 compare attester public key against the expected value within the credential proxy use pre-generated attestation public keys within nym-nodes remove version deprecation bugfix: default bandwidth response for authenticator expose upgrade mode information in authenticator responses adding tests for new v2 server passing upgrade mode information in metadata endpoint v2 wireguard private metadata bugfix: make sure to immediately poll for attestation after spawning task fix gateway probe and remove code duplication for finalizing registration squashing before rebasing post rebasing fixes AuthenticatorVersion helpers additional nits allow unwraps in mocks fixed linux build clippy integrating upgrade mode into authenticator fixed build after adding wrappers to response types conditionally updating peer handle bandwidth cleanup negotiate initial protocol during registration change auth to use highest protocol handler for JWT message dont meter client bandwidth in upgrade mode handling recheck requests sending information about upgrade_mode on client messages gateway watching for upgrade mode attestation wip: gateways to disable bandwidth metering on upgrade mode
85856d7 to
ec7f499
Compare
jstuczyn
added a commit
that referenced
this pull request
Nov 13, 2025
this includes bringing over changes introduced in #6174
jstuczyn
added a commit
that referenced
this pull request
Nov 14, 2025
this includes bringing over changes introduced in #6174
… easily resolve merge conflicts during rebasing added additional v2 query for metadata endpoint for requesting upgrade mode recheck added additional message to v6 authenticator to request explicit upgrade mode recheck clippy test fixes due to updated keys updated assertion for upgrading v1 top up request to v2 compare attester public key against the expected value within the credential proxy use pre-generated attestation public keys within nym-nodes remove version deprecation bugfix: default bandwidth response for authenticator expose upgrade mode information in authenticator responses adding tests for new v2 server passing upgrade mode information in metadata endpoint v2 wireguard private metadata bugfix: make sure to immediately poll for attestation after spawning task fix gateway probe and remove code duplication for finalizing registration squashing before rebasing post rebasing fixes AuthenticatorVersion helpers additional nits allow unwraps in mocks fixed linux build clippy integrating upgrade mode into authenticator fixed build after adding wrappers to response types conditionally updating peer handle bandwidth cleanup negotiate initial protocol during registration change auth to use highest protocol handler for JWT message dont meter client bandwidth in upgrade mode handling recheck requests sending information about upgrade_mode on client messages gateway watching for upgrade mode attestation wip: gateways to disable bandwidth metering on upgrade mode
ec7f499 to
cd29af2
Compare
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.
this is a stepping stone towards the the naive versions NET-451 and NET-450 as part of NET-341(https://nymtech.atlassian.net/browse/NET-341
and supersedes #5986.
this PR contains all of the ongoing work that can be merged into develop to reduce code rot whilst additional work continues on a separate branch.
to fully understand the context behind the changes, it is crucial to familiarise yourself with the following document: https://nymtech.atlassian.net/wiki/spaces/KB/pages/263880725/Implementation#
as long as nothing gets put on the url controlled by
UPGRADE_MODE_ATTESTATION_URL(by default"https://nym.com/upgrade-mode/attestation.json"on mainnet), there should be no changes in behaviour in our clients or nodes.for reference for @simonwicky: this PR does NOT contain changes to
BandwidthTicketProvidertrait. this is still ongoing work on another branchChangelog
the following changes are by no means exhaustive, because, due to the fault of my own, I have severely underestimated the scope of the work and haven't been keeping track of all the relevant updates and had to attempt to produce the list on a later date.
Env Changes
Added
UPGRADE_MODE_ATTESTATION_URLto control url used for polling attestation endpointUPGRADE_MODE_ATTESTER_ED25519_BS58_PUBKEYto control expected key used for signing the attestation - @benedettadavico @tommyv1987: please visit our vault in order to retrieve private keys for sandbox and canaryInterface Changes
Added
lints.workspace = truesection toCargo.tomlfiles of additional crates and fixed associated warningsnym-credentials-interface:BandwidthCredentialto act as a wrapper for different types of credentials. currently it includes the oldCredentialSpendingData(i.e. zk-nym ticketbooks) and JWT tokens issued during upgrade mode. in the future it is expected to get expanded to include emergency mode credentials issued by signer quorumChanged
RegistredData=>RegisteredData(including all conversion impls) orRegistredAndFree=>RegisteredAndFreeNym Node Changes
to control upgrade-mode related features
Authenticator Service Provider
Added
UpgradeModeStatustrait to expose information on the current state of the upgrade mode:it is implemented for all authenticator responses, i.e.
PendingRegistration,Registered,RemainingBandwidth,TopUpBandwidthBandwidthClaimstruct that wraps aroundBandwidthCredentialand includes explicit bandwidthkind(i.e. mixnet/wg entry/exit). note: conversion fromCredentialSpendingDatacan fail if it has invalid embedded ticket datafinalise_registrationmethod to existingPendingRegistrationResponsetrait to remove code repetition and simplify version-matching logicv6version of authenticator messagesCheckUpgradeModeto explicitly request upgrade mode state checkupgrade_mode_enabled: boolfieldFinalMessageusesBandwidthClaiminstead ofCredentialSpendingDatafor thecredentialfield. this is reflected in the trait changesChanged
credential()method on theFinalMessagetrait now returnsOption<BandwidthClaim>as opposed toOption<CredentialSpendingData>to allow the upgrade mode flow where user would not have a valid zk-nymv6authenticator version marked as "latest"ClientMessagebytes()method now returnsSerialisedRequestinstead of the tuple(Vec<u8>, u64)to be more explicit about its content. the internal data stayed unchangedAuthenticatorClient
Changed
query_bandwidthnow returnsResult<AvailableBandwidthClientResponse>which is a wrapper around bandwidth and upgrade mode informationtop_upnow returnsResult<TopUpClientResponse>which is a wrapper around bandwidth and upgrade mode informationGateway Mixnet WebSocket
Added
send_upgrade_mode_jwton the client to allow sending upgrade mode token to the gateway in order to prompt it to perform state refreshChanged
CURRENT_PROTOCOL_VERSIONfrom 5 to 6 ('upgrade mode')ServerResponse::Authenticatecontainsupgrade_modeflag to indicate whether gateway thinks the system is undergoing the upgradeServerResponse::Registercontainsupgrade_modeflag to indicate whether gateway thinks the system is undergoing the upgradeServerResponse::Bandwidthcontainsupgrade_modeflag to indicate whether gateway thinks the system is undergoing the upgradeServerResponse::Sendcontainsupgrade_modeflag to indicate whether gateway thinks the system is undergoing the upgradeFixed
Wireguard Metadata Endpoint
Added
v2version of metadata endpoint messages that include support for the upgrade modeChanged
v2version marked as "latest"RequestData::TopUpBandwidthnow usesBandwidthCredentialrather than `CredentialSpendingDataRequestData::AvailableBandwidthResponseData::AvailableBandwidthnow has explicit field indicating remaining bandwidth alongside upgrade mode informationResponseData::TopUpBandwidthnow has explicit field indicating available bandwidth alongside upgrade mode informationTesting changes
sharedcrate under"testing" feature, e.g.Construct for Response now exists incommon/wireguard-private-metadata/shared/src/models/v1/interface.rsinstead of duplicating the type and reimplementig the trait incommon/wireguard-private-metadata/tests/src/v1/interface.rsmock_connect_infoto be able to write future tests against clients originating from different ip addressesAppStateper each test serverMockPeerControllerV2to allow registration of expected responses given particular request for more fine-grained test controlServerTestthat wraps around different test features and provides helpful interface for interacting with the stateThis change is