Skip to content

Commit

Permalink
Merge remote-tracking branch 'namada/pos-integration' (#677) into main
Browse files Browse the repository at this point in the history
* namada/pos-integration: (120 commits)
  [ci] wasm checksums update
  changelog: add #707
  remove comments to self
  convert to tm voting power in `update_epoch`
  client: replace voting power with bonded stake in queries, etc
  fix pos state machine test
  clean up naming of "validator total deltas" -> "validator deltas"
  fix client voting power query
  fix `TendermintValidator::power`
  clippy: suppress unused validation vars (may need later)
  fmt + cleanup after cherrypicking commits from #388
  more voting_power removal and accurate variable renaming
  keep voting_power as a possible client query
  change `validator_total_deltas` -> `validator_deltas`
  Update wasm tx_(un)bond with VotingPower removal
  refactor VotingPower out of PoS VP
  continue refactoring away VotingPower
  refactor out VotingPower(Delta) in pos crate, distinguish total and validator deltas
  [ci] wasm checksums update
  changelog: add #708
  remove `min_duration` from `ParametersConfig`
  remove `staked_ratio` and `pos_inflation_amount` from `ParametersConfig`
  update comments
  [ci] wasm checksums update
  fmt and includes
  updates to accommodate `tm_votes_per_token` relative to namnam
  Update rewards parameters and distribution
  update toml files with latest parameters and values
  fix arb_amount to max out at max tm voting power (fix wasm test bug)
  storage change: last inflation rate -> last inflation token amount
  fix: write all fields in Parameters storage in `init_storage`
  fix initial staked ratio parameter at genesis
  update rust_decimal version + fmt
  clean comments and toml files of basis points
  fix correct inner type of ValidationError::TotalVotingPowerTooLarge
  more decimal_mult function uses
  add fns to multiply Decimal and integer type, return truncated integer
  remove BasisPoints and change relevant parameters to Decimal type
  documentation updates + unused imports removal
  rename reward_rate -> inflation_rate for pos
  specify read or write intentions for parameters storage keys
  add target_staked_ratio to PoS params
  update max inflation rate in params (formerly max_staking_rewards_rate)
  rename `votes_per_token` to `tm_votes_per_token` since this will only be used to interface with tendermint
  add new parameters needed for rewards PD controller to the Parameters storage
  add max_staking_reward_rate to PosParams
  clarify+rename 'epoch_storage_key' as 'epoch_duration_storage_key'
  changelog: add #695
  [ci] wasm checksums update
  addressing 2nd round of review comments
  async tx to change validator commission rate
  changelog: add #582
  add vp validator to wasms
  fix: critical flaw in pos VP that was prematurely returning true
  add max commission rate info to validation and pos state machine test
  validator VP that checks source and signature for a commission rate change tx
  changes in response to review comments
  [ci] wasm checksums update
  fix pos state machine test
  add max change info to query of validator commission rate
  fix get of epoched commission rate before pipeline
  bug fix: consensus key validation error
  commission change wasm tx test: fix and update validation
  fix error convention
  wasm tx test for changing validator commission rate
  [ci] wasm checksums update
  governance: more refactor
  wasm: update checksums
  chore: rebuild wasm for test
  governance: more refactor
  queries/shell: refactor to single def
  queries/router: rm dbg prints
  queries: add more PoS queries and use them for gov
  RPC: add PoS is_validator and bond_amount queries
  shared: implement PosReadOnly for Storage
  governance: more refactor
  governance: more refactor
  governance: refactor with storage api
  fix: rename native token in e2e genesis file
  [ci] wasm checksums update
  [ci] wasm checksums update
  improve docs
  fix commission rate validation on validator initialization
  init validator: add commission rate required args for tests
  cleaning: incl fmt + clippy
  bug fix from splitting this PR off of #388
  include and update `rust_decimal`
  add missing commission rate-related instances
  commission rate: query + refactor validator change tx
  epoched commission rate and tx for validator to change their rate
  require commission rate input data for new validators
  introduce validator commission rate and changes
  changelog: #687
  remove staking rewards address from cli strings and docs strings
  wallet: remove validator rewards key
  client: remove staking rewards address from init-validator result
  remove staking reward address from genesis toml files
  remove staking reward address from all code
  changelog: #436
  [ci] wasm checksums update
  ...
  • Loading branch information
juped committed Nov 14, 2022
2 parents e84eaca + e28bd81 commit e0604a2
Show file tree
Hide file tree
Showing 102 changed files with 4,606 additions and 3,461 deletions.
2 changes: 2 additions & 0 deletions .changelog/unreleased/features/582-native-token-param.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Allow to set the native token via genesis configuration.
([#582](https://github.com/anoma/namada/pull/582))
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

0 comments on commit e0604a2

Please sign in to comment.