diff --git a/crates/core/component/stake/src/component/action_handler/delegate.rs b/crates/core/component/stake/src/component/action_handler/delegate.rs index c1fd73f26c..8db537414c 100644 --- a/crates/core/component/stake/src/component/action_handler/delegate.rs +++ b/crates/core/component/stake/src/component/action_handler/delegate.rs @@ -27,7 +27,8 @@ impl ActionHandler for Delegate { let d = self; - // We check if the rate data is for the current epoch. + // We check if the rate data is for the current epoch to provide a helpful + // error message if there is a mismatch. let current_epoch = state.get_current_epoch().await?; ensure!( d.epoch_index == current_epoch.index, diff --git a/crates/core/component/stake/src/component/validator_handler/validator_manager.rs b/crates/core/component/stake/src/component/validator_handler/validator_manager.rs index d2bddb876a..3960e9bb44 100644 --- a/crates/core/component/stake/src/component/validator_handler/validator_manager.rs +++ b/crates/core/component/stake/src/component/validator_handler/validator_manager.rs @@ -13,9 +13,7 @@ use anyhow::Result; use async_trait::async_trait; use futures::StreamExt as _; use penumbra_num::Amount; -use penumbra_sct::{ - component::clock::{EpochManager, EpochRead}, -}; +use penumbra_sct::component::clock::{EpochManager, EpochRead}; use penumbra_shielded_pool::component::{SupplyRead as _, SupplyWrite}; use sha2::{Digest as _, Sha256}; use tendermint::abci::types::{CommitInfo, Misbehavior}; diff --git a/crates/core/component/stake/src/component/validator_handler/validator_store.rs b/crates/core/component/stake/src/component/validator_handler/validator_store.rs index 527976afdc..95a3f7f56b 100644 --- a/crates/core/component/stake/src/component/validator_handler/validator_store.rs +++ b/crates/core/component/stake/src/component/validator_handler/validator_store.rs @@ -150,7 +150,7 @@ pub trait ValidatorDataRead: StateRead { async fn compute_unbonding_height( &self, id: &IdentityKey, - unbonding_height_start: u64, + unbonding_start_height: u64, ) -> Result { let Some(val_bonding_state) = self.get_validator_bonding_state(id).await else { anyhow::bail!( @@ -161,14 +161,14 @@ pub trait ValidatorDataRead: StateRead { let min_block_delay = self.get_stake_params().await?.unbonding_delay; - let upper_bound_height = unbonding_height_start.saturating_add(min_block_delay); + let upper_bound_height = unbonding_start_height.saturating_add(min_block_delay); let unbonding_height = match val_bonding_state { Bonded => upper_bound_height, // When the minimum delay parameter changes, an unbonding validator may // have a delay that is larger than the new minimum delay. In this case, Unbonding { unbonds_at_height } => unbonds_at_height.min(upper_bound_height), - Unbonded => unbonding_height_start, + Unbonded => unbonding_start_height, }; Ok(unbonding_height)