🔧 telemetry: make CONNITO_TELEMETRY_PORT actually configurable - #202
Merged
Conversation
`CONNITO_TELEMETRY_PORT` shipped in the validator image but was never read
by any code — the exporter port was hardcoded to `8200 + rank`. An operator
whose host already had 8200 occupied would set the variable, see no effect,
and end up with a validator that runs fine on chain while the exporter
fails to bind ("Address already in use") and serves nothing. The failure is
caught and logged, so the only symptom is silence. This is what took
validator slot 5 off the dashboard.
Wiring the code alone would NOT have fixed it — three further pieces were
needed, each of which would have reproduced the same "setting does nothing"
bug on its own:
- `run.py`: new `resolve_telemetry_port(rank, env)`. The var is a **base**
port, not absolute: effective port is `base + rank`, preserving the
semantics of the 8200 default it replaces so a multi-rank host stays
collision-free (an absolute override would point every rank at one port
and all but one would fail to bind — the very bug being fixed). Invalid
input warns and falls back rather than raising: a typo in an operator's
`.env` must not take a validator off chain over a telemetry setting.
- `docker-compose.yml`: pass `CONNITO_TELEMETRY_PORT` into the container.
A value in `.env` only interpolates into the compose file; without an
explicit `environment:` entry it never reaches the process.
- `docker-compose.yml`: healthcheck now follows the same variable, so
overriding the port doesn't leave the container permanently unhealthy
probing a port nothing binds.
- `Dockerfile`: comment now documents the real behaviour.
Also removes two decorations that were the same class of trap:
- `CONNITO_DHT_PORT` — deliberately NOT wired. The DHT port is already
configured by `dht.port` in validator.yaml, and it is announced to peers;
a second competing source of truth could make a validator advertise one
port while listening on another, which is a worse failure than the one
being fixed. Removed, with a comment pointing at the real knob.
- `CONNITO_STATE_API_PORT` + the `8300/tcp` EXPOSE — the /v1/state.json API
they referenced no longer exists.
Operators overriding the port must open the new port in their firewall.
Tests: 12 new covering default, rank offset, override-as-base, whitespace,
non-numeric / out-of-range / float / hostile input fallbacks, and
base+rank overflow. Verified in the stable image that the env var now takes
effect end to end, and that `docker compose config` interpolates both the
container env and the healthcheck for default and override.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
isabella618033
approved these changes
Jul 31, 2026
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.
CONNITO_TELEMETRY_PORTshipped in the validator image but was never read by any code — the exporter port was hardcoded to8200 + rank. An operator whose host already had 8200 occupied would set the variable, see no effect, and end up with a validator that runs fine on chain while the exporter fails to bind ("Address already in use") and serves nothing. The failure is caught and logged, so the only symptom is silence. This is what took validator slot 5 off the dashboard.Wiring the code alone would NOT have fixed it — three further pieces were needed, each of which would have reproduced the same "setting does nothing" bug on its own:
run.py: newresolve_telemetry_port(rank, env). The var is a base port, not absolute: effective port isbase + rank, preserving the semantics of the 8200 default it replaces so a multi-rank host stays collision-free (an absolute override would point every rank at one port and all but one would fail to bind — the very bug being fixed). Invalid input warns and falls back rather than raising: a typo in an operator's.envmust not take a validator off chain over a telemetry setting.docker-compose.yml: passCONNITO_TELEMETRY_PORTinto the container. A value in.envonly interpolates into the compose file; without an explicitenvironment:entry it never reaches the process.docker-compose.yml: healthcheck now follows the same variable, so overriding the port doesn't leave the container permanently unhealthy probing a port nothing binds.Dockerfile: comment now documents the real behaviour.Also removes two decorations that were the same class of trap:
CONNITO_DHT_PORT— deliberately NOT wired. The DHT port is already configured bydht.portin validator.yaml, and it is announced to peers; a second competing source of truth could make a validator advertise one port while listening on another, which is a worse failure than the one being fixed. Removed, with a comment pointing at the real knob.CONNITO_STATE_API_PORT+ the8300/tcpEXPOSE — the /v1/state.json API they referenced no longer exists.Operators overriding the port must open the new port in their firewall.
Tests: 12 new covering default, rank offset, override-as-base, whitespace, non-numeric / out-of-range / float / hostile input fallbacks, and base+rank overflow. Verified in the stable image that the env var now takes effect end to end, and that
docker compose configinterpolates both the container env and the healthcheck for default and override.