cosmos-sdk/x/stake/keeper/_store.md

44 lines
1.8 KiB
Markdown
Raw Normal View History

2018-05-17 07:35:51 -07:00
# Stores
This document provided a bit more insight as to the purpose of several related
prefixed areas of the staking store which are accessed in `x/stake/keeper.go`.
# IAVL Store
2018-05-17 07:35:51 -07:00
## Validators
2018-05-17 07:35:51 -07:00
- Prefix Key Space: ValidatorsKey
- Key/Sort: Validator Operator Address
2018-05-22 16:34:31 -07:00
- Value: Validator Object
2018-05-17 12:48:47 -07:00
- Contains: All Validator records independent of being bonded or not
- Used For: Retrieve validator from operator address, general validator retrieval
2018-05-17 07:35:51 -07:00
## Validators By Power
- Prefix Key Space: ValidatorsByPowerKey
- Key/Sort: Validator Power (equivalent bonded shares) then Block
Height then Transaction Order
- Value: Validator Operator Address
2018-05-17 12:48:47 -07:00
- Contains: All Validator records independent of being bonded or not
2018-05-17 07:35:51 -07:00
- Used For: Determining who the top validators are whom should be bonded
2018-05-22 16:34:31 -07:00
## Validators Cliff Power
- Prefix Key Space: ValidatorCliffKey
- Key/Sort: single-record
- Value: Validator Power Key (as above store)
- Contains: The cliff validator (ex. 100th validator) power
- Used For: Efficient updates to validator status
## Validators Bonded
2018-05-17 07:35:51 -07:00
- Prefix Key Space: ValidatorsBondedKey
- Key/Sort: Validator PubKey Address (NOTE same as Tendermint)
- Value: Validator Operator Address
2018-05-17 07:35:51 -07:00
- Contains: Only currently bonded Validators
- Used For: Retrieving the list of all currently bonded validators when updating
for a new validator entering the validator set we may want to loop
2018-05-17 07:35:51 -07:00
through this set to determine who we've kicked out.
retrieving validator by tendermint index
# Transient Store
The transient store persists between transations but not between blocks