feat: add dnsEndpoints peer discovery source#57
Merged
Conversation
Add DNSEndpointsSource to the discover-peers handler. The controller resolves Kubernetes SeiNode label selectors to stable pod DNS names and passes them as dnsEndpoints sources. The sidecar queries each endpoint's Tendermint RPC for the node ID and builds peer addresses. - Add DNSEndpointsSource with Discover() that queries :26657/status - Add Endpoints field to PeerSourceEntry - Wire dnsEndpoints type into buildSources dispatcher - Add PeerSourceDNSEndpoints constant and client support Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- TestDNSEndpointsSource_Discover — resolves 2 endpoints with mock querier - TestDNSEndpointsSource_SkipsUnreachable — skips failed endpoint, returns reachable - TestDNSEndpointsSource_AllUnreachable_ReturnsError — fails when no endpoints reachable - TestHandler_SourcesParam_DNSEndpoints — full handler integration with config.toml write Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
defaultQueryNodeID already appends :26657 in the URL template. Passing endpoint+":26657" produced http://host:26657:26657/status. Tests updated to use bare hostnames matching the querier contract. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Add
DNSEndpointsSourceto the discover-peers handler. The controller resolves Kubernetes SeiNode label selectors to stable pod DNS names and passes them asdnsEndpointssources. The sidecar queries each endpoint's Tendermint RPC for the node ID and builds peer addresses.Named
dnsEndpoints(notkubernetesLabel) so the sidecar stays infrastructure-agnostic — it receives DNS hostnames and makes HTTP calls, no Kubernetes API access needed.Companion controller PR: sei-protocol/sei-k8s-controller#47
Changes
DNSEndpointsSourcewithDiscover()that queries each endpoint's:26657/statusfor node IDEndpointsfield added toPeerSourceEntrydnsEndpointscase wired intobuildSourcesdispatcherPeerSourceDNSEndpointsconstant and full client support (Validate, ToTaskRequest, FromParams)Test plan
go vetpassesgo buildpassesDNSEndpointsSource.Discoverwith mock querier🤖 Generated with Claude Code