Skip to content

Deactivate staking validators missing from the chain response - #976

Open
DRadmir wants to merge 1 commit into
mainfrom
wt2/stake-validator-inactive
Open

Deactivate staking validators missing from the chain response#976
DRadmir wants to merge 1 commit into
mainfrom
wt2/stake-validator-inactive

Conversation

@DRadmir

@DRadmir DRadmir commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Validators that disappear from the chain are no longer shown as active.

Before this, the app only added validators to its local list and never removed them. A validator that stopped being active kept showing up in the validator picker with its old rate, and could still be picked for a new stake.

Now such validators are marked inactive so they drop out of the picker. They are not deleted, because deleting a validator would also delete the stake that points at it. A failed or empty response from the network never deactivates anything.

Validator rows were only ever inserted or updated, never removed or
flagged, so a validator that stopped being returned by the chain kept
its stale isActive and apr forever. Both pickers filter on exactly
those columns, so such a validator stayed selectable for a new stake.

Mark them inactive instead of deleting: stake_delegations references
stake_validators with ON DELETE CASCADE, and the stale validators are
the ones that have delegations.

The sweep runs only on a complete response. A failed fetch already
propagates as an error and an empty response is already skipped, so
neither can deactivate anything.
@DRadmir
DRadmir force-pushed the wt2/stake-validator-inactive branch from 659e676 to d0505d3 Compare August 26, 2026 11:31
@DRadmir DRadmir self-assigned this Aug 26, 2026
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