-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
R4R remove global shares #1644
R4R remove global shares #1644
Changes from 25 commits
2bf78d9
b24b537
53afa92
d1270ce
8252e47
4563fb7
1daa854
cc754a8
68946e6
f2eb305
a0ab1d6
b5ba334
885615f
d487b56
244d1ba
3a5a396
40c8bcb
f448183
ef11205
00bbef0
754baa7
a97101d
b3111bc
1565645
257ec17
54c0bdb
813087a
597dbfc
f8d72be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,29 +6,18 @@ | |
- value: `amino(pool)` | ||
|
||
The pool is a space for all dynamic global state of the Cosmos Hub. It tracks | ||
information about the total amounts of Atoms in all states, representative | ||
validator shares for stake in the global pools, moving Atom inflation | ||
information, etc. | ||
information about the total amounts of Atoms in all states, moving Atom | ||
inflation information, etc. | ||
|
||
```golang | ||
type Pool struct { | ||
LooseTokens int64 // tokens not associated with any validator | ||
UnbondedTokens int64 // reserve of unbonded tokens held with validators | ||
UnbondingTokens int64 // tokens moving from bonded to unbonded pool | ||
BondedTokens int64 // reserve of bonded tokens | ||
UnbondedShares sdk.Rat // sum of all shares distributed for the Unbonded Pool | ||
UnbondingShares sdk.Rat // shares moving from Bonded to Unbonded Pool | ||
BondedShares sdk.Rat // sum of all shares distributed for the Bonded Pool | ||
InflationLastTime int64 // block which the last inflation was processed // TODO make time | ||
Inflation sdk.Rat // current annual inflation rate | ||
|
||
DateLastCommissionReset int64 // unix timestamp for last commission accounting reset (daily) | ||
} | ||
|
||
type PoolShares struct { | ||
Status sdk.BondStatus // either: unbonded, unbonding, or bonded | ||
Amount sdk.Rat // total shares of type ShareKind | ||
} | ||
``` | ||
|
||
### Params | ||
|
@@ -85,7 +74,9 @@ type Validator struct { | |
ConsensusPubKey crypto.PubKey // Tendermint consensus pubkey of validator | ||
Revoked bool // has the validator been revoked? | ||
|
||
PoolShares PoolShares // total shares for tokens held in the pool | ||
PoolShares sdk.BondStatus // total shares for tokens held in the pool | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this line be removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, removed |
||
Status sdk.BondStatus // validator status (bonded/unbonding/unbonded) | ||
Tokens sdk.Rat // delegated tokens (incl. self-delegation) | ||
DelegatorShares sdk.Rat // total shares issued to a validator's delegators | ||
SlashRatio sdk.Rat // increases each time the validator is slashed | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,12 +35,13 @@ func NewHandler(k keeper.Keeper) sdk.Handler { | |
// Called every block, process inflation, update validator set | ||
func EndBlocker(ctx sdk.Context, k keeper.Keeper) (ValidatorUpdates []abci.Validator) { | ||
pool := k.GetPool(ctx) | ||
params := k.GetParams(ctx) | ||
|
||
// Process types.Validator Provisions | ||
blockTime := ctx.BlockHeader().Time | ||
if pool.InflationLastTime+blockTime >= 3600 { | ||
pool.InflationLastTime = blockTime | ||
pool = k.ProcessProvisions(ctx) | ||
pool.ProcessProvisions(params) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to capture the returned There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, THANK YOU - added |
||
} | ||
|
||
// save the params | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LooseTokens
is now tokens not associated with any bonded validator, right? (it includes tokens associated with *unbonded validators)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct - just updated the comment to reflect this