Skip to content

feat: add dnsEndpoints peer discovery source#57

Merged
bdchatham merged 3 commits intomainfrom
refactor/add-dns-endpoints-peer-source
Apr 2, 2026
Merged

feat: add dnsEndpoints peer discovery source#57
bdchatham merged 3 commits intomainfrom
refactor/add-dns-endpoints-peer-source

Conversation

@bdchatham
Copy link
Copy Markdown
Contributor

@bdchatham bdchatham commented Apr 2, 2026

Summary

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.

Named dnsEndpoints (not kubernetesLabel) 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

  • DNSEndpointsSource with Discover() that queries each endpoint's :26657/status for node ID
  • Endpoints field added to PeerSourceEntry
  • dnsEndpoints case wired into buildSources dispatcher
  • PeerSourceDNSEndpoints constant and full client support (Validate, ToTaskRequest, FromParams)

Test plan

  • go vet passes
  • go build passes
  • Unit test for DNSEndpointsSource.Discover with mock querier

🤖 Generated with Claude Code

bdchatham and others added 3 commits April 2, 2026 11:20
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>
@bdchatham bdchatham marked this pull request as ready for review April 2, 2026 19:26
@bdchatham bdchatham merged commit caa0906 into main Apr 2, 2026
2 checks passed
@bdchatham bdchatham deleted the refactor/add-dns-endpoints-peer-source branch April 2, 2026 19:26
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.

1 participant