From 941305105356f089f4ffaba32fcce3f5c4713c8f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Thu, 22 Apr 2021 03:29:52 +0000 Subject: [PATCH] Clean up "APR" language around inflation rewards (#16732) (cherry picked from commit b8b54567b1e9b1d9cac137bf2a686fb7c436fa7f) Co-authored-by: Michael Vines --- cli-output/src/cli_output.rs | 16 ++++++++++------ docs/src/developing/clients/jsonrpc-api.md | 3 ++- sdk/src/genesis_config.rs | 4 ++++ 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/cli-output/src/cli_output.rs b/cli-output/src/cli_output.rs index 401f8e59e0..fd73bccdd7 100644 --- a/cli-output/src/cli_output.rs +++ b/cli-output/src/cli_output.rs @@ -1405,18 +1405,18 @@ impl fmt::Display for CliInflation { if (self.governor.initial - self.governor.terminal).abs() < f64::EPSILON { writeln!( f, - "Fixed APR: {:>5.2}%", + "Fixed rate: {:>5.2}%", self.governor.terminal * 100. )?; } else { writeln!( f, - "Initial APR: {:>5.2}%", + "Initial rate: {:>5.2}%", self.governor.initial * 100. )?; writeln!( f, - "Terminal APR: {:>5.2}%", + "Terminal rate: {:>5.2}%", self.governor.terminal * 100. )?; writeln!( @@ -1424,6 +1424,10 @@ impl fmt::Display for CliInflation { "Rate reduction per year: {:>5.2}%", self.governor.taper * 100. )?; + writeln!( + f, + "* Rate reduction is derived using the target slot time in genesis config" + )?; } if self.governor.foundation_term > 0. { writeln!( @@ -1445,17 +1449,17 @@ impl fmt::Display for CliInflation { )?; writeln!( f, - "Total APR: {:>5.2}%", + "Total rate: {:>5.2}%", self.current_rate.total * 100. )?; writeln!( f, - "Staking APR: {:>5.2}%", + "Staking rate: {:>5.2}%", self.current_rate.validator * 100. )?; writeln!( f, - "Foundation APR: {:>5.2}%", + "Foundation rate: {:>5.2}%", self.current_rate.foundation * 100. ) } diff --git a/docs/src/developing/clients/jsonrpc-api.md b/docs/src/developing/clients/jsonrpc-api.md index 3a87e31f47..ed9509ba5f 100644 --- a/docs/src/developing/clients/jsonrpc-api.md +++ b/docs/src/developing/clients/jsonrpc-api.md @@ -1410,7 +1410,8 @@ The result field will be a JSON object with the following fields: - `initial: `, the initial inflation percentage from time 0 - `terminal: `, terminal inflation percentage -- `taper: `, rate per year at which inflation is lowered +- `taper: `, rate per year at which inflation is lowered. + Rate reduction is derived using the target slot time in genesis config - `foundation: `, percentage of total inflation allocated to the foundation - `foundationTerm: `, duration of foundation pool inflation in years diff --git a/sdk/src/genesis_config.rs b/sdk/src/genesis_config.rs index 7449a67852..d6faa5a0b0 100644 --- a/sdk/src/genesis_config.rs +++ b/sdk/src/genesis_config.rs @@ -241,8 +241,10 @@ impl fmt::Display for GenesisConfig { Shred version: {}\n\ Ticks per slot: {:?}\n\ Hashes per tick: {:?}\n\ + Target tick duration: {:?}\n\ Slots per epoch: {}\n\ Warmup epochs: {}abled\n\ + Slots per year: {}\n\ {:?}\n\ {:?}\n\ {:?}\n\ @@ -256,12 +258,14 @@ impl fmt::Display for GenesisConfig { compute_shred_version(&self.hash(), None), self.ticks_per_slot, self.poh_config.hashes_per_tick, + self.poh_config.target_tick_duration, self.epoch_schedule.slots_per_epoch, if self.epoch_schedule.warmup { "en" } else { "dis" }, + self.slots_per_year(), self.inflation, self.rent, self.fee_rate_governor,