Skip to content

feat: warn when a new auto-renewed validator is not connected - #39

Open
owenwahlgren wants to merge 1 commit into
mainfrom
feat/warn-auto-renewed-validator-not-connected
Open

feat: warn when a new auto-renewed validator is not connected#39
owenwahlgren wants to merge 1 commit into
mainfrom
feat/warn-auto-renewed-validator-not-connected

Conversation

@owenwahlgren

Copy link
Copy Markdown
Collaborator

Auto-renewal is conditioned on reward eligibility, so a node the network cannot reach is removed at the first cycle boundary and forfeits that cycle's rewards instead of renewing. Nothing in the flow surfaced this: add-auto-renewed printed a TX ID and exited successfully even when the validator was never visible to the network.

This is not hypothetical. Registering a validator whose node was unreachable produced a committed transaction, a validator in the set with connected: false and uptime: 0.0000, and no indication anything was wrong.

What changed

  • pchain.GetValidatorHealth reads the connected and uptime fields that platform.getCurrentValidators reports for a node on the primary network.
  • add-auto-renewed calls it after the transaction is accepted and warns when the validator is not connected, pointing at the usual causes (node not running, --public-ip unset, inbound 9651 blocked).

The transaction has already landed by then, so every failure in the check is advisory: it never changes the exit status, and a lookup error or a validator not yet visible prints a note rather than an error.

Verification

go build ./..., gofmt -l . clean, full go test ./... green. Six new table-driven tests cover connected, disconnected, missing uptime, absent validator, an unrelated node ID, and an unparseable uptime, reusing the existing newCurrentValidatorsServer stub. The response shape was confirmed against a live Fuji auto-renewed validator.

Notes

Scoped to add-auto-renewed, where the consequence is losing the position. add-permissionless could reuse the same helper, where the consequence is only a missed reward. Left out to keep this to one concern.

Auto-renewal is conditioned on reward eligibility, so a node the network cannot
reach is removed at the first cycle boundary and forfeits that cycle's rewards
instead of renewing. Nothing in the flow surfaced this: add-auto-renewed printed
a TX ID and exited even when the validator was never visible to the network.

After the transaction is accepted, look the validator up with
platform.getCurrentValidators and warn when it is not connected. The
transaction has already landed at that point, so every failure here is advisory
and never changes the exit status.
@owenwahlgren
owenwahlgren force-pushed the feat/warn-auto-renewed-validator-not-connected branch from 2260db5 to 6f8eea4 Compare July 28, 2026 21: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