2018-08-28 15:23:57 -07:00
|
|
|
# Hooks
|
2018-08-08 03:10:21 -07:00
|
|
|
|
|
|
|
## Create or modify delegation distribution
|
|
|
|
|
2019-01-11 12:08:01 -08:00
|
|
|
- triggered-by: `staking.TxDelegate`, `staking.TxBeginRedelegate`, `staking.TxBeginUnbonding`
|
2018-08-08 03:10:21 -07:00
|
|
|
|
|
|
|
The pool of a new delegator bond will be 0 for the height at which the bond was
|
2018-08-08 12:03:43 -07:00
|
|
|
added, or the withdrawal has taken place. This is achieved by setting
|
2018-10-05 17:32:06 -07:00
|
|
|
`DelegationDistInfo.WithdrawalHeight` to the height of the triggering transaction.
|
2018-08-08 03:10:21 -07:00
|
|
|
|
|
|
|
## Commission rate change
|
|
|
|
|
2019-01-11 12:08:01 -08:00
|
|
|
- triggered-by: `staking.TxEditValidator`
|
2018-08-08 03:10:21 -07:00
|
|
|
|
|
|
|
If a validator changes its commission rate, all commission on fees must be
|
2018-08-08 20:43:40 -07:00
|
|
|
simultaneously withdrawn using the transaction `TxWithdrawValidator`.
|
|
|
|
Additionally the change and associated height must be recorded in a
|
|
|
|
`ValidatorUpdate` state record.
|
2018-08-08 03:10:21 -07:00
|
|
|
|
2018-08-08 12:03:43 -07:00
|
|
|
## Change in Validator State
|
|
|
|
|
2019-01-11 12:08:01 -08:00
|
|
|
- triggered-by: `staking.Slash`, `staking.UpdateValidator`
|
2018-08-08 12:03:43 -07:00
|
|
|
|
2018-08-08 20:43:40 -07:00
|
|
|
Whenever a validator is slashed or enters/leaves the validator group all of the
|
2018-08-20 08:50:13 -07:00
|
|
|
validator entitled reward tokens must be simultaneously withdrawn from
|
|
|
|
`Global.Pool` and added to `ValidatorDistInfo.Pool`.
|