Repository navigation
beacon: NotifyNode tells a node the registry holds a relayed handshake for it - #59
Merged
Merged
Conversation
…e for it A trust handshake between two private nodes is parked at the registry until each side polls for it, once a minute. NotifyNode sends the node a two-byte MsgNotify ([0x0A][kind]) at the UDP endpoint it registered with this beacon, so an updated daemon polls right away. The message carries no node ID, address or payload. Notifies to one node are limited to one per second. Best effort: daemons that predate it drop it as an unknown beacon message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
The failing |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Summary
A trust handshake that cannot go directly (the requester cannot resolve a private node before trust exists) is relayed through the registry, and each side only finds it on its 60-second poll: about two minutes end to end. This gives the registry a way to tell the recipient to poll now.
Changes
Server.NotifyNode(nodeID)sends the node two bytes,[0x0A][0x01](MsgNotify, kind handshake), at its registered UDP endpoint.Why not reuse a punch request as the wake-up: it would hand the requester the target's IP:port before trust (which the registry refuses), it does not work at all under
-require-punch-token, and it would spend the punch budget.Used by pilot-protocol/rendezvous (
feat/handshake-notify) and handled by pilot-protocol/pilotprotocol (feat/fast-relayed-handshake).0x0Ais defined here and in the daemon rather than incommon/protocolso each branch builds alone; it should move there.Limits
Test Plan
go build ./...,go vet ./...,go test ./...TestNotifyNode🤖 Generated with Claude Code