Add and remove validators without voting
How to add or remove validators without voting
QBFT network conditions might not allow voting to change validators. For example, if a majority of the current validators are no longer participating in the network, a vote to add or remove validators won't be successful. You can bypass voting and specify new validators using a transition in the genesis file.
!!! warning
To add or remove validators without voting:
In the genesis file, add the
transitions
configuration item where:<BlockNumber>
is the upcoming block at which to change validators.<ValidatorAddressX> ... <ValidatorAddressZ>
are strings representing the account addresses of the validators after<BlockNumber>
.
!!! example "Transitions object in the genesis file"
Restart all nodes in the network using the updated genesis file. You can make a rolling update of the nodes, as long as they're all up before the transition block is processed.
To verify the changes after the transition block, call
qbft_getValidatorsByBlockNumber
, specifyinglatest
.
Override smart contract validators
When using QBFT contract validator selection, if network conditions require it, you can bypass the smart contract and specify new validators in the genesis file. For example, you lose quorum for your current list of contract validators, and you can't perform a transaction to vote more in.
This requires temporarily switching to block header validator selection mode.
To bypass the smart contract and specify new validators:
In the genesis file, add a
transitions
configuration item where:<BlockNumber>
is the upcoming block at which to change validators.<SelectionMode>
is the validator selection mode to switch to. In this case we'll switch to theblockheader
mode temporarily.<ValidatorAddressX> ... <ValidatorAddressZ>
are strings representing the account addresses of the validators after<BlockNumber>
. These validators only need to be sufficient to progress the chain and allow a new contract to be deployed.
=== "Syntax"
=== "Example"
Restart all nodes in the network using the updated genesis file. You can make a rolling update of the nodes, as long as they're all up before the transition block is processed.
Deploy a new contract to the blockchain containing the desired list of validators.
In the genesis file, add another
transitions
configuration item where:<BlockNumber>
is the upcoming block at which to change validators.<SelectionMode>
is the validator selection mode to switch to. In this case we'll switch tocontract
mode.<NewValidatorContractAddress>
is the address of the new smart contract.
=== "Syntax"
=== "Example"
Restart all nodes in the network using the updated genesis file. You can make a rolling update of the nodes, as long as they're all up before the transition block is processed.
Last updated