Skip to content
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

Refactor out VotingPower #707

Merged
merged 86 commits into from
Nov 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
22d845b
replace floating point arithm from token module with rust_decimal
brentstone Aug 30, 2022
97523f4
[ci] wasm checksums update
github-actions[bot] Oct 26, 2022
d08da6e
changelog: #436
tzemanovic Oct 26, 2022
29eb68f
remove staking reward address from all code
brentstone Oct 25, 2022
020f6bf
remove staking reward address from genesis toml files
brentstone Oct 26, 2022
3eb21f7
client: remove staking rewards address from init-validator result
tzemanovic Oct 26, 2022
b54b5c0
wallet: remove validator rewards key
tzemanovic Oct 26, 2022
9852d28
remove staking rewards address from cli strings and docs strings
tzemanovic Oct 26, 2022
70fa58b
changelog: #687
tzemanovic Oct 26, 2022
da7bffc
introduce validator commission rate and changes
brentstone Sep 21, 2022
3fbc30e
require commission rate input data for new validators
brentstone Sep 23, 2022
4b88573
epoched commission rate and tx for validator to change their rate
brentstone Sep 27, 2022
4ff76d8
commission rate: query + refactor validator change tx
brentstone Sep 28, 2022
77dfff4
add missing commission rate-related instances
brentstone Oct 26, 2022
5b6565e
include and update `rust_decimal`
brentstone Oct 26, 2022
288bf33
bug fix from splitting this PR off of #388
brentstone Oct 26, 2022
3704ef6
cleaning: incl fmt + clippy
brentstone Oct 26, 2022
0e097d8
init validator: add commission rate required args for tests
brentstone Oct 26, 2022
80283b2
fix commission rate validation on validator initialization
brentstone Oct 28, 2022
9d8a0d0
improve docs
brentstone Oct 28, 2022
629e1c5
[ci] wasm checksums update
github-actions[bot] Oct 31, 2022
258b910
wasm tx test for changing validator commission rate
brentstone Nov 4, 2022
6610a65
fix error convention
brentstone Nov 4, 2022
563d218
commission change wasm tx test: fix and update validation
brentstone Nov 4, 2022
7d652e3
bug fix: consensus key validation error
brentstone Nov 4, 2022
9b4f2be
fix get of epoched commission rate before pipeline
brentstone Nov 4, 2022
6778fd0
add max change info to query of validator commission rate
brentstone Nov 4, 2022
b900354
fix pos state machine test
brentstone Nov 7, 2022
7b6de40
[ci] wasm checksums update
github-actions[bot] Nov 7, 2022
302a08c
changes in response to review comments
brentstone Nov 8, 2022
dcfd6af
validator VP that checks source and signature for a commission rate c…
brentstone Nov 9, 2022
9068938
add max commission rate info to validation and pos state machine test
brentstone Nov 9, 2022
9b175c4
fix: critical flaw in pos VP that was prematurely returning true
brentstone Nov 9, 2022
fea59bd
add vp validator to wasms
brentstone Nov 9, 2022
757ba1d
async tx to change validator commission rate
brentstone Nov 9, 2022
42b0bfa
addressing 2nd round of review comments
brentstone Nov 10, 2022
476877e
[ci] wasm checksums update
github-actions[bot] Nov 10, 2022
6b92f2c
changelog: add #695
tzemanovic Nov 10, 2022
862d840
clarify+rename 'epoch_storage_key' as 'epoch_duration_storage_key'
brentstone Aug 29, 2022
d953ee6
add max_staking_reward_rate to PosParams
brentstone Aug 29, 2022
a5897bd
add new parameters needed for rewards PD controller to the Parameters…
brentstone Sep 8, 2022
9ad5b56
rename `votes_per_token` to `tm_votes_per_token` since this will only…
brentstone Sep 9, 2022
32588d5
update max inflation rate in params (formerly max_staking_rewards_rate)
brentstone Sep 9, 2022
9bb70f4
add target_staked_ratio to PoS params
brentstone Sep 9, 2022
4b1eb5f
specify read or write intentions for parameters storage keys
brentstone Sep 12, 2022
e3994dc
rename reward_rate -> inflation_rate for pos
brentstone Sep 18, 2022
8ba80cb
documentation updates + unused imports removal
brentstone Sep 20, 2022
f16ec20
remove BasisPoints and change relevant parameters to Decimal type
brentstone Sep 8, 2022
9683b44
add fns to multiply Decimal and integer type, return truncated integer
brentstone Sep 8, 2022
f7ae3ce
more decimal_mult function uses
brentstone Sep 8, 2022
4f89a63
fix correct inner type of ValidationError::TotalVotingPowerTooLarge
brentstone Sep 12, 2022
9d904df
clean comments and toml files of basis points
brentstone Oct 26, 2022
1ba6ee2
update rust_decimal version + fmt
brentstone Oct 26, 2022
265b071
fix initial staked ratio parameter at genesis
brentstone Oct 21, 2022
0d0f394
fix: write all fields in Parameters storage in `init_storage`
brentstone Sep 30, 2022
2fd4ed5
storage change: last inflation rate -> last inflation token amount
brentstone Oct 18, 2022
b5ae9bb
fix arb_amount to max out at max tm voting power (fix wasm test bug)
brentstone Oct 27, 2022
6ed8bce
update toml files with latest parameters and values
brentstone Sep 21, 2022
0a8b491
Update rewards parameters and distribution
brentstone Sep 20, 2022
a079234
updates to accommodate `tm_votes_per_token` relative to namnam
brentstone Oct 28, 2022
9e7088f
fmt and includes
brentstone Oct 28, 2022
6e51bc4
[ci] wasm checksums update
github-actions[bot] Nov 8, 2022
c34c33b
update comments
brentstone Nov 9, 2022
9ca0546
remove `staked_ratio` and `pos_inflation_amount` from `ParametersConfig`
brentstone Nov 9, 2022
52e6f09
remove `min_duration` from `ParametersConfig`
brentstone Nov 10, 2022
c6cc0f5
changelog: add #708
brentstone Nov 11, 2022
4e76c28
[ci] wasm checksums update
github-actions[bot] Nov 11, 2022
14639ad
rename slash rate params with `min`, update default `PosParam` values
brentstone Nov 18, 2022
e3fbf35
refactor out VotingPower(Delta) in pos crate, distinguish total and v…
brentstone Sep 14, 2022
528b24a
continue refactoring away VotingPower
brentstone Sep 16, 2022
5da2a80
refactor VotingPower out of PoS VP
brentstone Sep 16, 2022
251f9d4
Update wasm tx_(un)bond with VotingPower removal
brentstone Sep 20, 2022
7d31f7d
change `validator_total_deltas` -> `validator_deltas`
brentstone Sep 20, 2022
08b1bdf
keep voting_power as a possible client query
brentstone Sep 20, 2022
4e161ac
more voting_power removal and accurate variable renaming
brentstone Sep 20, 2022
530e315
fmt + cleanup after cherrypicking commits from #388
brentstone Oct 30, 2022
cdd8b71
clippy: suppress unused validation vars (may need later)
brentstone Oct 30, 2022
d65654b
fix `TendermintValidator::power`
brentstone Oct 30, 2022
3e34cae
fix client voting power query
brentstone Oct 30, 2022
116a77a
clean up naming of "validator total deltas" -> "validator deltas"
brentstone Nov 7, 2022
372667a
fix pos state machine test
brentstone Nov 7, 2022
b22f2bc
client: replace voting power with bonded stake in queries, etc
brentstone Nov 9, 2022
615408b
convert to tm voting power in `update_epoch`
brentstone Nov 9, 2022
6c0b900
remove comments to self
brentstone Nov 10, 2022
13ad178
changelog: add #707
brentstone Nov 11, 2022
d30a3ba
[ci] wasm checksums update
github-actions[bot] Nov 11, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/687-remove-staking-address.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- PoS: Removed staking reward addresses in preparation of auto-staked rewards
system. ([#687](https://github.com/anoma/namada/pull/687))
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Allow to set validator's commission rates and a limit on change of commission
rate per epoch. Commission rate can be changed via a transaction authorized
by the validator, but the limit is immutable value, set when the validator's
account is initialized. ([#695](https://github.com/anoma/namada/pull/695))
5 changes: 5 additions & 0 deletions .changelog/unreleased/features/707-refactor-voting-powers.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- Optimize the PoS code to depend only on bonded stake, removing
the VotingPower(Delta) structs. This mitigates some previous
information loss in PoS calculations. Instead, the notion of
voting power is only relevant when communicating with Tendermint.
([#707](https://github.com/anoma/namada/pull/707))
4 changes: 4 additions & 0 deletions .changelog/unreleased/features/708-update-pos-params.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- Update the set of parameters in the PoS system according to the
latest spec and standardizes the use of the rust_decimal crate
for parameters and calculations that require fractional numbers.
([#708](https://github.com/anoma/namada/pull/708))
2 changes: 2 additions & 0 deletions .changelog/unreleased/improvements/436-remove-f64.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Refactored token decimal formatting.
([#436](https://github.com/anoma/namada/pull/436))
19 changes: 19 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions apps/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ tracing-subscriber = {version = "0.3.7", features = ["env-filter"]}
websocket = "0.26.2"
winapi = "0.3.9"
bimap = {version = "0.6.2", features = ["serde"]}
rust_decimal = "1.26.1"
rust_decimal_macros = "1.26.1"

[dev-dependencies]
namada = {path = "../shared", features = ["testing", "wasm-runtime"]}
Expand Down
7 changes: 5 additions & 2 deletions apps/src/bin/anoma-client/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ pub async fn main() -> Result<()> {
Sub::QueryBonds(QueryBonds(args)) => {
rpc::query_bonds(ctx, args).await;
}
Sub::QueryVotingPower(QueryVotingPower(args)) => {
rpc::query_voting_power(ctx, args).await;
Sub::QueryBondedStake(QueryBondedStake(args)) => {
rpc::query_bonded_stake(ctx, args).await;
}
Sub::QueryCommissionRate(QueryCommissionRate(args)) => {
rpc::query_commission_rate(ctx, args).await;
}
Sub::QuerySlashes(QuerySlashes(args)) => {
rpc::query_slashes(ctx, args).await;
Expand Down
Loading