[Fix/Feat] Asymmetrical Noise-XX handshake for the validators - #4354
Open
ljedrz wants to merge 3 commits into
Open
[Fix/Feat] Asymmetrical Noise-XX handshake for the validators#4354ljedrz wants to merge 3 commits into
ljedrz wants to merge 3 commits into
Conversation
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Signed-off-by: ljedrz <ljedrz@users.noreply.github.com>
Collaborator
|
Can you enable the |
vicsn
requested changes
Jul 30, 2026
Collaborator
There was a problem hiding this comment.
Looks amazing!
It would be great if we can truly consider the issues closed with one PR (ignoring the pruning of dead code). Therefore:
- should we also adjust the gateway handshake done by the bootstrap nodes?
- either we:
- keep
NOISE_HANDSHAKE_ACTIVATION_HEIGHT=V19and introduce a newNOISE_HANDSHAKE_DEACTIVATION_HEIGHT=V20. - replace
NOISE_HANDSHAKE_ACTIVATION_HEIGHT=V19to aNOISE_HANDSHAKE_DEACTIVATION_HEIGHT=V19. As soon as a validator has upgraded, they attempt a noise handshake. If it fails, they retry with the legacy handshake. AtNOISE_HANDSHAKE_DEACTIVATION_HEIGHT==V19we assume all nodes upgraded and everyone is using noise.
- keep
| /// the new one. Note also that the same relay is reachable through the router's handshake, which | ||
| /// signs a byte-identical message with the same account key, so the gateway cannot be the last part | ||
| /// of this to be converted. | ||
| const NOISE_HANDSHAKE_ACTIVATION_HEIGHT: Option<u32> = None; |
Collaborator
There was a problem hiding this comment.
Can we set this to CONSENSUS_HEIGHT(ConsensusVersion::V19) (regrettably a runtime value)
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
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.
Replaces the gateway's challenge-response handshake with one built on the Noise XX pattern, where each side binds its Aleo identity to the session by signing the running Noise handshake hash. Identity is still the Aleo account key - the Noise static keys are per-connection and exist only to give the pattern a channel to bind to. The post-handshake traffic remains unencrypted.
The legacy handshake is still accepted, so validators can be upgraded one at a time.
NOISE_HANDSHAKE_ACTIVATION_HEIGHTisNone: nothing on mainnet initiates the new handshake yet, only devnets do.Over 50% of the new code is tests, and much of the new plumbing can be reused if we want to utilize this handshake pattern with other node types as well.
Benefits:
As a small drive-by, there's also a hardening for the
EventCodec's encoder, in its own commit.CC #4140