You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The validator manager pallet has three functions exposed:
add_validator
remove_validator
add_validator_again
And two main storage items:
Validators (active validator set)
ApprovedValidators (validators who were once added by a sudo entity, however they might not be active at the moment)
When running remove_validator the pallet is supposed to run do_remove_validator which removes the account from Validators and then run unapprove_validator which removes the account from the ApprovedValidators storage.
However, the pallet doesn't remove accounts from the ApprovedValidators set, only from the Validators set. Therefore, when you attempt to add the validator again, you get a Duplicate error, because the validator is already included in ApprovedValidators even though it was removed from Validators.
Solution
There's a missing line in unapprove_validator that actually overwrites the storage with the removed entry:
Not a high priority right now, we can circumvent this problem. Although, this functionality might be intended at some level, because the im-online pallet only removes active validators (when they go offline) and not approved validators. Thus, when a validator comes back online, they can re-join the network as validators because they are still approved.
Description
The validator manager pallet has three functions exposed:
add_validator
remove_validator
add_validator_again
And two main storage items:
Validators
(active validator set)ApprovedValidators
(validators who were once added by a sudo entity, however they might not be active at the moment)When running
remove_validator
the pallet is supposed to rundo_remove_validator
which removes the account fromValidators
and then rununapprove_validator
which removes the account from theApprovedValidators
storage.However, the pallet doesn't remove accounts from the
ApprovedValidators
set, only from theValidators
set. Therefore, when you attempt to add the validator again, you get aDuplicate
error, because the validator is already included inApprovedValidators
even though it was removed fromValidators
.Solution
There's a missing line in
unapprove_validator
that actually overwrites the storage with the removed entry:The text was updated successfully, but these errors were encountered: