Skip to content

fix: only apply beaconapi.clientIndex filter when explicitly set#651

Closed
barnabasbusa wants to merge 1 commit intoethpandaops:masterfrom
barnabasbusa:fix/beaconapi-client-index-default
Closed

fix: only apply beaconapi.clientIndex filter when explicitly set#651
barnabasbusa wants to merge 1 commit intoethpandaops:masterfrom
barnabasbusa:fix/beaconapi-client-index-default

Conversation

@barnabasbusa
Copy link
Copy Markdown
Collaborator

Summary

  • beaconapi.ClientIndex was typed int, so its Go zero value (0) always satisfied the >= 0 check in utils.ReadConfig, collapsing beaconapi.endpoints down to endpoints[0] for users who never set clientIndex. Multi-endpoint setups only ever exposed the first beacon client on /clients/consensus and in the indexer.
  • Change ClientIndex to *int so nil means "unset"; the single-endpoint selection now only runs when the field is explicitly configured (YAML or BEACONAPI_CLIENT_INDEX).
  • Introduced in 11f18e6 (Nov 2025).

Test plan

  • Verified locally: config with two beaconapi.endpoints and no clientIndex previously rendered only the first client on /clients/consensus; after the fix, both clients are listed and indexed.
  • go build ./... passes.
  • Still honors explicit clientIndex: N (selects a single endpoint) and BEACONAPI_CLIENT_INDEX env var.

ClientIndex was a plain `int` whose zero value (0) caused
ReadConfig to collapse `beaconapi.endpoints` down to
`endpoints[0]` whenever the field was omitted from the config.
Users with multiple beacon endpoints only ever saw the first one
on the consensus clients page and in the indexer.

Change ClientIndex to `*int` so that only explicit configuration
(YAML or env) triggers the single-endpoint selection.
@barnabasbusa
Copy link
Copy Markdown
Collaborator Author

reopening from origin with correct branch prefix (bbusa/)

@barnabasbusa barnabasbusa deleted the fix/beaconapi-client-index-default branch April 21, 2026 12:49
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