Merge PR #2337: Update revoked -> jailed in the docs, and in minor places within cmd

This commit is contained in:
Dev Ojha 2018-09-14 11:52:23 -07:00 committed by Christopher Goes
parent 7dc09d0fc2
commit 9cf40e2df5
6 changed files with 11 additions and 11 deletions

View File

@ -234,7 +234,7 @@ func genesisAccountFromGenTx(genTx GaiaGenTx) GenesisAccount {
} }
// GaiaValidateGenesisState ensures that the genesis state obeys the expected invariants // GaiaValidateGenesisState ensures that the genesis state obeys the expected invariants
// TODO: No validators are both bonded and revoked (#2088) // TODO: No validators are both bonded and jailed (#2088)
// TODO: Error if there is a duplicate validator (#1708) // TODO: Error if there is a duplicate validator (#1708)
// TODO: Ensure all state machine parameters are in genesis (#1704) // TODO: Ensure all state machine parameters are in genesis (#1704)
func GaiaValidateGenesisState(genesisState GenesisState) (err error) { func GaiaValidateGenesisState(genesisState GenesisState) (err error) {
@ -258,7 +258,7 @@ func validateGenesisStateValidators(validators []stakeTypes.Validator) (err erro
return fmt.Errorf("Duplicate validator in genesis state: moniker %v, Address %v", val.Description.Moniker, val.ConsAddress()) return fmt.Errorf("Duplicate validator in genesis state: moniker %v, Address %v", val.Description.Moniker, val.ConsAddress())
} }
if val.Jailed && val.Status == sdk.Bonded { if val.Jailed && val.Status == sdk.Bonded {
return fmt.Errorf("Validator is bonded and revoked in genesis state: moniker %v, Address %v", val.Description.Moniker, val.ConsAddress()) return fmt.Errorf("Validator is bonded and jailed in genesis state: moniker %v, Address %v", val.Description.Moniker, val.ConsAddress())
} }
addrMap[strKey] = true addrMap[strKey] = true
} }

View File

@ -84,7 +84,7 @@ func TestGaiaGenesisValidation(t *testing.T) {
genesisState := makeGenesisState(genTxs) genesisState := makeGenesisState(genTxs)
err := GaiaValidateGenesisState(genesisState) err := GaiaValidateGenesisState(genesisState)
require.NotNil(t, err) require.NotNil(t, err)
// Test bonded + revoked validator fails // Test bonded + jailed validator fails
genesisState = makeGenesisState(genTxs[:1]) genesisState = makeGenesisState(genTxs[:1])
val1 := stakeTypes.NewValidator(addr1, pk1, stakeTypes.Description{Moniker: "test #2"}) val1 := stakeTypes.NewValidator(addr1, pk1, stakeTypes.Description{Moniker: "test #2"})
val1.Jailed = true val1.Jailed = true

View File

@ -65,7 +65,7 @@ func runHackCmd(cmd *cobra.Command, args []string) error {
// The following powerKey was there, but the corresponding "trouble" validator did not exist. // The following powerKey was there, but the corresponding "trouble" validator did not exist.
// So here we do a binary search on the past states to find when the powerKey first showed up ... // So here we do a binary search on the past states to find when the powerKey first showed up ...
// operator of the validator the bonds, gets revoked, later unbonds, and then later is still found in the bypower store // operator of the validator the bonds, gets jailed, later unbonds, and then later is still found in the bypower store
trouble := hexToBytes("D3DC0FF59F7C3B548B7AFA365561B87FD0208AF8") trouble := hexToBytes("D3DC0FF59F7C3B548B7AFA365561B87FD0208AF8")
// this is his "bypower" key // this is his "bypower" key
powerKey := hexToBytes("05303030303030303030303033FFFFFFFFFFFF4C0C0000FFFED3DC0FF59F7C3B548B7AFA365561B87FD0208AF8") powerKey := hexToBytes("05303030303030303030303033FFFFFFFFFFFF4C0C0000FFFED3DC0FF59F7C3B548B7AFA365561B87FD0208AF8")

View File

@ -34,7 +34,7 @@ See [testnets repo](https://github.com/cosmos/testnets).
## *June 13, 2018, 17:00 EST* - Gaia-6002 is making blocks! ## *June 13, 2018, 17:00 EST* - Gaia-6002 is making blocks!
- Gaia-6002 is live and making blocks - Gaia-6002 is live and making blocks
- Absent validators have been slashed and revoked - Absent validators have been slashed and jailed
- Currently live with 17 validators - Currently live with 17 validators
## *June 13, 2018, 4:30 EST* - New Testnet Gaia-6002 ## *June 13, 2018, 4:30 EST* - New Testnet Gaia-6002

View File

@ -1003,7 +1003,7 @@ where the processes that caused the consensus to fail (ie. caused clients of
the protocol to accept different values - a fork) can be identified and punished the protocol to accept different values - a fork) can be identified and punished
according to the rules of the protocol, or, possibly, the legal system. When according to the rules of the protocol, or, possibly, the legal system. When
the legal system is unreliable or excessively expensive to invoke, validators can be forced to make security the legal system is unreliable or excessively expensive to invoke, validators can be forced to make security
deposits in order to participate, and those deposits can be revoked, or slashed, deposits in order to participate, and those deposits can be jailed, or slashed,
when malicious behaviour is detected [\[10\]][10]. when malicious behaviour is detected [\[10\]][10].
Note this is unlike Bitcoin, where forking is a regular occurence due to Note this is unlike Bitcoin, where forking is a regular occurence due to

View File

@ -100,7 +100,7 @@ type TxDelegate struct {
delegate(tx TxDelegate): delegate(tx TxDelegate):
pool = getPool() pool = getPool()
if validator.Status == Revoked return if validator.Status == Jailed return
delegation = getDelegatorBond(DelegatorAddr, ValidatorAddr) delegation = getDelegatorBond(DelegatorAddr, ValidatorAddr)
if delegation == nil then delegation = NewDelegation(DelegatorAddr, ValidatorAddr) if delegation == nil then delegation = NewDelegation(DelegatorAddr, ValidatorAddr)
@ -141,7 +141,7 @@ startUnbonding(tx TxStartUnbonding):
revokeCandidacy = false revokeCandidacy = false
if bond.Shares.IsZero() { if bond.Shares.IsZero() {
if bond.DelegatorAddr == validator.Operator && validator.Revoked == false if bond.DelegatorAddr == validator.Operator && validator.Jailed == false
revokeCandidacy = true revokeCandidacy = true
removeDelegation( bond) removeDelegation( bond)
@ -157,7 +157,7 @@ startUnbonding(tx TxStartUnbonding):
setUnbondingDelegation(unbondingDelegation) setUnbondingDelegation(unbondingDelegation)
if revokeCandidacy if revokeCandidacy
validator.Revoked = true validator.Jailed = true
validator = updateValidator(validator) validator = updateValidator(validator)
@ -279,9 +279,9 @@ updateBondedValidators(newValidator Validator) (updatedVal Validator)
else else
validator = getValidator(operatorAddr) validator = getValidator(operatorAddr)
// if not previously a validator (and unrevoked), // if not previously a validator (and unjailed),
// kick the cliff validator / bond this new validator // kick the cliff validator / bond this new validator
if validator.Status() != Bonded && !validator.Revoked { if validator.Status() != Bonded && !validator.Jailed {
kickCliffValidator = true kickCliffValidator = true
validator = bondValidator(ctx, store, validator) validator = bondValidator(ctx, store, validator)