mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-02 04:03:35 +00:00
Update Deneb to 1.4.0-beta.2 (devnet-9) (#4735)
* Add MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT * Update tests to 1.4.0-beta.2 * Implement equivocation check for proposer boost * Use hotfix tests and fix minimal config * Start updating fork choice tests for Deneb * Finish implementing fork choice blob handling --------- Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -1322,6 +1322,24 @@ impl<T: EthSpec> BeaconState<T> {
|
||||
))
|
||||
}
|
||||
|
||||
/// Return the activation churn limit for the current epoch (number of validators who can enter per epoch).
|
||||
///
|
||||
/// Uses the epoch cache, and will error if it isn't initialized.
|
||||
///
|
||||
/// Spec v1.4.0
|
||||
pub fn get_activation_churn_limit(&self, spec: &ChainSpec) -> Result<u64, Error> {
|
||||
Ok(match self {
|
||||
BeaconState::Base(_)
|
||||
| BeaconState::Altair(_)
|
||||
| BeaconState::Merge(_)
|
||||
| BeaconState::Capella(_) => self.get_churn_limit(spec)?,
|
||||
BeaconState::Deneb(_) => std::cmp::min(
|
||||
spec.max_per_epoch_activation_churn_limit,
|
||||
self.get_churn_limit(spec)?,
|
||||
),
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns the `slot`, `index`, `committee_position` and `committee_len` for which a validator must produce an
|
||||
/// attestation.
|
||||
///
|
||||
|
||||
@@ -51,6 +51,7 @@ pub struct ChainSpec {
|
||||
pub max_committees_per_slot: usize,
|
||||
pub target_committee_size: usize,
|
||||
pub min_per_epoch_churn_limit: u64,
|
||||
pub max_per_epoch_activation_churn_limit: u64,
|
||||
pub churn_limit_quotient: u64,
|
||||
pub shuffle_round_count: u8,
|
||||
pub min_genesis_active_validator_count: u64,
|
||||
@@ -510,6 +511,7 @@ impl ChainSpec {
|
||||
max_committees_per_slot: 64,
|
||||
target_committee_size: 128,
|
||||
min_per_epoch_churn_limit: 4,
|
||||
max_per_epoch_activation_churn_limit: 8,
|
||||
churn_limit_quotient: 65_536,
|
||||
shuffle_round_count: 90,
|
||||
min_genesis_active_validator_count: 16_384,
|
||||
@@ -686,6 +688,8 @@ impl ChainSpec {
|
||||
config_name: None,
|
||||
max_committees_per_slot: 4,
|
||||
target_committee_size: 4,
|
||||
min_per_epoch_churn_limit: 2,
|
||||
max_per_epoch_activation_churn_limit: 4,
|
||||
churn_limit_quotient: 32,
|
||||
shuffle_round_count: 10,
|
||||
min_genesis_active_validator_count: 64,
|
||||
@@ -750,6 +754,7 @@ impl ChainSpec {
|
||||
max_committees_per_slot: 64,
|
||||
target_committee_size: 128,
|
||||
min_per_epoch_churn_limit: 4,
|
||||
max_per_epoch_activation_churn_limit: 8,
|
||||
churn_limit_quotient: 4_096,
|
||||
shuffle_round_count: 90,
|
||||
min_genesis_active_validator_count: 4_096,
|
||||
@@ -1015,6 +1020,8 @@ pub struct Config {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
min_per_epoch_churn_limit: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
max_per_epoch_activation_churn_limit: u64,
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
churn_limit_quotient: u64,
|
||||
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
@@ -1227,6 +1234,7 @@ impl Config {
|
||||
ejection_balance: spec.ejection_balance,
|
||||
churn_limit_quotient: spec.churn_limit_quotient,
|
||||
min_per_epoch_churn_limit: spec.min_per_epoch_churn_limit,
|
||||
max_per_epoch_activation_churn_limit: spec.max_per_epoch_activation_churn_limit,
|
||||
|
||||
proposer_score_boost: spec.proposer_score_boost.map(|value| MaybeQuoted { value }),
|
||||
|
||||
@@ -1284,6 +1292,7 @@ impl Config {
|
||||
inactivity_score_recovery_rate,
|
||||
ejection_balance,
|
||||
min_per_epoch_churn_limit,
|
||||
max_per_epoch_activation_churn_limit,
|
||||
churn_limit_quotient,
|
||||
proposer_score_boost,
|
||||
deposit_chain_id,
|
||||
@@ -1328,6 +1337,7 @@ impl Config {
|
||||
inactivity_score_recovery_rate,
|
||||
ejection_balance,
|
||||
min_per_epoch_churn_limit,
|
||||
max_per_epoch_activation_churn_limit,
|
||||
churn_limit_quotient,
|
||||
proposer_score_boost: proposer_score_boost.map(|q| q.value),
|
||||
deposit_chain_id,
|
||||
@@ -1583,6 +1593,7 @@ mod yaml_tests {
|
||||
INACTIVITY_SCORE_RECOVERY_RATE: 16
|
||||
EJECTION_BALANCE: 16000000000
|
||||
MIN_PER_EPOCH_CHURN_LIMIT: 4
|
||||
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
|
||||
CHURN_LIMIT_QUOTIENT: 65536
|
||||
PROPOSER_SCORE_BOOST: 40
|
||||
DEPOSIT_CHAIN_ID: 1
|
||||
|
||||
Reference in New Issue
Block a user