Rename Functions to More Closely Match Spec (#5591)

* Rename Functions to More Closely Match Spec
This commit is contained in:
ethDreamer
2024-04-16 14:03:08 -05:00
committed by GitHub
parent f68989815c
commit cda926ce1b
6 changed files with 11 additions and 11 deletions

View File

@@ -1444,7 +1444,7 @@ impl<E: EthSpec> BeaconState<E> {
/// Return the churn limit for the current epoch (number of validators who can leave per epoch).
///
/// Uses the current epoch committee cache, and will error if it isn't initialized.
pub fn get_churn_limit(&self, spec: &ChainSpec) -> Result<u64, Error> {
pub fn get_validator_churn_limit(&self, spec: &ChainSpec) -> Result<u64, Error> {
Ok(std::cmp::max(
spec.min_per_epoch_churn_limit,
(self
@@ -1462,10 +1462,10 @@ impl<E: EthSpec> BeaconState<E> {
BeaconState::Base(_)
| BeaconState::Altair(_)
| BeaconState::Merge(_)
| BeaconState::Capella(_) => self.get_churn_limit(spec)?,
| BeaconState::Capella(_) => self.get_validator_churn_limit(spec)?,
BeaconState::Deneb(_) | BeaconState::Electra(_) => std::cmp::min(
spec.max_per_epoch_activation_churn_limit,
self.get_churn_limit(spec)?,
self.get_validator_churn_limit(spec)?,
),
})
}