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

Update Deneb to 1.4.0-beta.2 (devnet-9) #4735

Merged
merged 7 commits into from
Sep 25, 2023
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
6 changes: 6 additions & 0 deletions beacon_node/beacon_chain/src/blob_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ impl<T: BeaconChainTypes> GossipVerifiedBlob<T> {
let blob_index = blob.message.index;
validate_blob_sidecar_for_gossip(blob, blob_index, chain)
}
/// Construct a `GossipVerifiedBlob` that is assumed to be valid.
///
/// This should ONLY be used for testing.
pub fn __assumed_valid(blob: SignedBlobSidecar<T::EthSpec>) -> Self {
Self { blob }
}
pub fn id(&self) -> BlobIdentifier {
self.blob.message.id()
}
Expand Down
1 change: 1 addition & 0 deletions book/src/api-vc-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ Example Response Body
"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": "5",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ TARGET_COMMITTEE_SIZE: 128
MAX_VALIDATORS_PER_COMMITTEE: 2048
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
# 2**12 (= 4096)
CHURN_LIMIT_QUOTIENT: 4096
# See issue 563
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ INACTIVITY_SCORE_RECOVERY_RATE: 16
EJECTION_BALANCE: 16000000000
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
# 2**12 (= 4096)
CHURN_LIMIT_QUOTIENT: 4096

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ INACTIVITY_SCORE_RECOVERY_RATE: 16
EJECTION_BALANCE: 28000000000
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ INACTIVITY_SCORE_RECOVERY_RATE: 16
EJECTION_BALANCE: 16000000000
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ INACTIVITY_SCORE_RECOVERY_RATE: 16
EJECTION_BALANCE: 16000000000
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ INACTIVITY_SCORE_RECOVERY_RATE: 16
EJECTION_BALANCE: 16000000000
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536

Expand Down
3 changes: 2 additions & 1 deletion consensus/fork_choice/src/fork_choice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,8 @@ where
// Add proposer score boost if the block is timely.
let is_before_attesting_interval =
block_delay < Duration::from_secs(spec.seconds_per_slot / INTERVALS_PER_SLOT);
if current_slot == block.slot() && is_before_attesting_interval {
let is_first_block = self.fc_store.proposer_boost_root().is_zero();
if current_slot == block.slot() && is_before_attesting_interval && is_first_block {
self.fc_store.set_proposer_boost_root(block_root);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ pub fn process_registry_updates<T: EthSpec>(
.collect_vec();

// Dequeue validators for activation up to churn limit
let churn_limit = state.get_churn_limit(spec)? as usize;
let activation_churn_limit = state.get_activation_churn_limit(spec)? as usize;
let delayed_activation_epoch = state.compute_activation_exit_epoch(current_epoch, spec)?;
for index in activation_queue.into_iter().take(churn_limit) {
for index in activation_queue.into_iter().take(activation_churn_limit) {
state.get_validator_mut(index)?.activation_epoch = delayed_activation_epoch;
}

Expand Down
18 changes: 18 additions & 0 deletions consensus/types/src/beacon_state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down
11 changes: 11 additions & 0 deletions consensus/types/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -686,6 +688,8 @@ impl ChainSpec {
config_name: None,
max_committees_per_slot: 4,
target_committee_size: 4,
min_per_epoch_churn_limit: 2,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was scratching my head for a while over this one, wondering why so many tests were failing on the new spec 😅

max_per_epoch_activation_churn_limit: 4,
churn_limit_quotient: 32,
shuffle_round_count: 10,
min_genesis_active_validator_count: 64,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -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 }),

Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lighthouse/environment/tests/testnet_dir/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ INACTIVITY_SCORE_RECOVERY_RATE: 16
EJECTION_BALANCE: 16000000000
# 2**2 (= 4)
MIN_PER_EPOCH_CHURN_LIMIT: 4
# 2**3 (= 8)
MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8
# 2**16 (= 65,536)
CHURN_LIMIT_QUOTIENT: 65536

Expand Down
2 changes: 1 addition & 1 deletion testing/ef_tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
TESTS_TAG := v1.4.0-beta.1
TESTS_TAG := v1.4.0-beta.2-hotfix
TESTS = general minimal mainnet
TARBALLS = $(patsubst %,%-$(TESTS_TAG).tar.gz,$(TESTS))

Expand Down
Loading