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

staking: deprecate obsolete base reward rate field #4651

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Binary file modified crates/cnidarium/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
6 changes: 0 additions & 6 deletions crates/core/app/src/params/change.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ impl AppParameters {
stake_params:
StakeParameters {
active_validator_limit,
base_reward_rate: _,
slashing_penalty_misbehavior: _,
slashing_penalty_downtime: _,
signed_blocks_window_len,
Expand Down Expand Up @@ -190,7 +189,6 @@ impl AppParameters {
stake_params:
StakeParameters {
active_validator_limit,
base_reward_rate,
slashing_penalty_misbehavior,
slashing_penalty_downtime,
signed_blocks_window_len,
Expand Down Expand Up @@ -223,10 +221,6 @@ impl AppParameters {
*active_validator_limit > 3,
"active validator limit must be at least 4",
),
(
*base_reward_rate >= 1,
"base reward rate must be at least 1 basis point",
),
(
*slashing_penalty_misbehavior >= 1,
"slashing penalty (misbehavior) must be at least 1 basis point",
Expand Down
7 changes: 1 addition & 6 deletions crates/core/component/stake/src/params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ pub struct StakeParameters {
pub unbonding_delay: u64,
/// The number of validators allowed in the consensus set (Active state).
pub active_validator_limit: u64,
/// The base reward rate, expressed in basis points of basis points
pub base_reward_rate: u64,
/// The penalty for slashing due to misbehavior, expressed in basis points squared (10^-8)
pub slashing_penalty_misbehavior: u64,
/// The penalty for slashing due to downtime, expressed in basis points squared (10^-8)
Expand All @@ -36,7 +34,6 @@ impl TryFrom<pb::StakeParameters> for StakeParameters {
active_validator_limit: msg.active_validator_limit,
slashing_penalty_downtime: msg.slashing_penalty_downtime,
slashing_penalty_misbehavior: msg.slashing_penalty_misbehavior,
base_reward_rate: msg.base_reward_rate,
missed_blocks_maximum: msg.missed_blocks_maximum,
signed_blocks_window_len: msg.signed_blocks_window_len,
min_validator_stake: msg
Expand All @@ -58,7 +55,7 @@ impl From<StakeParameters> for pb::StakeParameters {
missed_blocks_maximum: params.missed_blocks_maximum,
slashing_penalty_downtime: params.slashing_penalty_downtime,
slashing_penalty_misbehavior: params.slashing_penalty_misbehavior,
base_reward_rate: params.base_reward_rate,
base_reward_rate: 0,
min_validator_stake: Some(params.min_validator_stake.into()),
unbonding_delay: params.unbonding_delay,
}
Expand All @@ -78,8 +75,6 @@ impl Default for StakeParameters {
slashing_penalty_misbehavior: 1000_0000,
// 1 basis point = 0.01%
slashing_penalty_downtime: 1_0000,
// 3bps -> 11% return over 365 epochs
base_reward_rate: 3_0000,
// 1 penumbra
min_validator_stake: 1_000_000u128.into(),
}
Expand Down
1 change: 1 addition & 0 deletions crates/proto/src/gen/penumbra.core.component.stake.v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,7 @@ pub struct StakeParameters {
#[prost(uint64, tag = "2")]
pub active_validator_limit: u64,
/// The base reward rate, expressed in basis points of basis points
#[deprecated]
#[prost(uint64, tag = "3")]
pub base_reward_rate: u64,
/// The penalty for slashing due to misbehavior.
Expand Down
Binary file modified crates/proto/src/gen/proto_descriptor.bin.no_lfs
Binary file not shown.
4 changes: 2 additions & 2 deletions proto/penumbra/penumbra/core/component/stake/v1/stake.proto
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ message StakeParameters {
// The maximum number of validators in the consensus set.
uint64 active_validator_limit = 2;
// The base reward rate, expressed in basis points of basis points
uint64 base_reward_rate = 3;
uint64 base_reward_rate = 3 [deprecated = true];
// The penalty for slashing due to misbehavior.
uint64 slashing_penalty_misbehavior = 4;
// The penalty for slashing due to downtime.
Expand Down Expand Up @@ -408,4 +408,4 @@ message EventSlashingPenaltyApplied {
uint64 epoch_index = 2;
// The penalty amount after slashing.
Penalty new_penalty = 3;
}
}
Loading