Deactivate staking validators missing from the chain response - #976
Open
DRadmir wants to merge 1 commit into
Open
Deactivate staking validators missing from the chain response#976DRadmir wants to merge 1 commit into
DRadmir wants to merge 1 commit into
Conversation
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
force-pushed
the
wt2/stake-validator-inactive
branch
from
August 26, 2026 11:31
659e676 to
d0505d3
Compare
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.
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.