Rename Merge to Bellatrix (#5601)

* Rename Merge to Bellatrix

* Remove tree-hash-cache which got readded from the rebase
This commit is contained in:
Mac L
2024-04-26 06:19:41 +10:00
committed by GitHub
parent 320345695d
commit 13f94ef0f3
104 changed files with 808 additions and 714 deletions

View File

@@ -336,7 +336,7 @@ impl GossipTester {
pub fn earliest_valid_attestation_slot(&self) -> Slot {
let offset = match self.harness.spec.fork_name_at_epoch(self.epoch()) {
ForkName::Base | ForkName::Altair | ForkName::Merge | ForkName::Capella => {
ForkName::Base | ForkName::Altair | ForkName::Bellatrix | ForkName::Capella => {
// Subtract an additional slot since the harness will be exactly on the start of the
// slot and the propagation tolerance will allow an extra slot.
E::slots_per_epoch() + 1
@@ -1382,7 +1382,10 @@ async fn attestation_verification_use_head_state_fork() {
.block_at_slot(pre_capella_slot, WhenSlotSkipped::Prev)
.expect("should not error getting block at slot")
.expect("should find block at slot");
assert_eq!(pre_capella_block.fork_name(&spec).unwrap(), ForkName::Merge);
assert_eq!(
pre_capella_block.fork_name(&spec).unwrap(),
ForkName::Bellatrix
);
// Advance slot clock to Capella fork.
harness.advance_slot();
@@ -1427,7 +1430,7 @@ async fn attestation_verification_use_head_state_fork() {
// Scenario 2: other node forgot to update their node and signed attestations using bellatrix fork
{
let attesters = (VALIDATOR_COUNT / 2..VALIDATOR_COUNT).collect::<Vec<_>>();
let merge_fork = spec.fork_for_name(ForkName::Merge).unwrap();
let bellatrix_fork = spec.fork_for_name(ForkName::Bellatrix).unwrap();
let committee_attestations = harness
.make_unaggregated_attestations_with_opts(
attesters.as_slice(),
@@ -1436,7 +1439,7 @@ async fn attestation_verification_use_head_state_fork() {
pre_capella_block.canonical_root().into(),
first_capella_slot,
MakeAttestationOptions {
fork: merge_fork,
fork: bellatrix_fork,
limit: None,
},
)
@@ -1483,7 +1486,10 @@ async fn aggregated_attestation_verification_use_head_state_fork() {
.block_at_slot(pre_capella_slot, WhenSlotSkipped::Prev)
.expect("should not error getting block at slot")
.expect("should find block at slot");
assert_eq!(pre_capella_block.fork_name(&spec).unwrap(), ForkName::Merge);
assert_eq!(
pre_capella_block.fork_name(&spec).unwrap(),
ForkName::Bellatrix
);
// Advance slot clock to Capella fork.
harness.advance_slot();
@@ -1525,7 +1531,7 @@ async fn aggregated_attestation_verification_use_head_state_fork() {
// Scenario 2: other node forgot to update their node and signed attestations using bellatrix fork
{
let attesters = (VALIDATOR_COUNT / 2..VALIDATOR_COUNT).collect::<Vec<_>>();
let merge_fork = spec.fork_for_name(ForkName::Merge).unwrap();
let bellatrix_fork = spec.fork_for_name(ForkName::Bellatrix).unwrap();
let aggregates = harness
.make_attestations_with_opts(
attesters.as_slice(),
@@ -1534,7 +1540,7 @@ async fn aggregated_attestation_verification_use_head_state_fork() {
pre_capella_block.canonical_root().into(),
first_capella_slot,
MakeAttestationOptions {
fork: merge_fork,
fork: bellatrix_fork,
limit: None,
},
)

View File

@@ -71,9 +71,9 @@ async fn merge_with_terminal_block_hash_override() {
.chain
.head_snapshot()
.beacon_block
.as_merge()
.as_bellatrix()
.is_ok(),
"genesis block should be a merge block"
"genesis block should be a bellatrix block"
);
let mut execution_payloads = vec![];
@@ -93,11 +93,11 @@ async fn merge_with_terminal_block_hash_override() {
}
#[tokio::test]
async fn base_altair_merge_with_terminal_block_after_fork() {
async fn base_altair_bellatrix_with_terminal_block_after_fork() {
let altair_fork_epoch = Epoch::new(4);
let altair_fork_slot = altair_fork_epoch.start_slot(E::slots_per_epoch());
let bellatrix_fork_epoch = Epoch::new(8);
let merge_fork_slot = bellatrix_fork_epoch.start_slot(E::slots_per_epoch());
let bellatrix_fork_slot = bellatrix_fork_epoch.start_slot(E::slots_per_epoch());
let mut spec = E::default_spec();
spec.altair_fork_epoch = Some(altair_fork_epoch);
@@ -130,41 +130,41 @@ async fn base_altair_merge_with_terminal_block_after_fork() {
assert_eq!(altair_head.slot(), altair_fork_slot);
/*
* Do the merge fork, without a terminal PoW block.
* Do the Bellatrix fork, without a terminal PoW block.
*/
harness.extend_to_slot(merge_fork_slot).await;
harness.extend_to_slot(bellatrix_fork_slot).await;
let merge_head = &harness.chain.head_snapshot().beacon_block;
assert!(merge_head.as_merge().is_ok());
assert_eq!(merge_head.slot(), merge_fork_slot);
let bellatrix_head = &harness.chain.head_snapshot().beacon_block;
assert!(bellatrix_head.as_bellatrix().is_ok());
assert_eq!(bellatrix_head.slot(), bellatrix_fork_slot);
assert!(
merge_head
bellatrix_head
.message()
.body()
.execution_payload()
.unwrap()
.is_default_with_empty_roots(),
"Merge head is default payload"
"Bellatrix head is default payload"
);
/*
* Next merge block shouldn't include an exec payload.
* Next Bellatrix block shouldn't include an exec payload.
*/
harness.extend_slots(1).await;
let one_after_merge_head = &harness.chain.head_snapshot().beacon_block;
let one_after_bellatrix_head = &harness.chain.head_snapshot().beacon_block;
assert!(
one_after_merge_head
one_after_bellatrix_head
.message()
.body()
.execution_payload()
.unwrap()
.is_default_with_empty_roots(),
"One after merge head is default payload"
"One after bellatrix head is default payload"
);
assert_eq!(one_after_merge_head.slot(), merge_fork_slot + 1);
assert_eq!(one_after_bellatrix_head.slot(), bellatrix_fork_slot + 1);
/*
* Trigger the terminal PoW block.
@@ -188,20 +188,20 @@ async fn base_altair_merge_with_terminal_block_after_fork() {
harness.extend_slots(1).await;
let two_after_merge_head = &harness.chain.head_snapshot().beacon_block;
let two_after_bellatrix_head = &harness.chain.head_snapshot().beacon_block;
assert!(
two_after_merge_head
two_after_bellatrix_head
.message()
.body()
.execution_payload()
.unwrap()
.is_default_with_empty_roots(),
"Two after merge head is default payload"
"Two after bellatrix head is default payload"
);
assert_eq!(two_after_merge_head.slot(), merge_fork_slot + 2);
assert_eq!(two_after_bellatrix_head.slot(), bellatrix_fork_slot + 2);
/*
* Next merge block should include an exec payload.
* Next Bellatrix block should include an exec payload.
*/
for _ in 0..4 {
harness.extend_slots(1).await;

View File

@@ -25,11 +25,11 @@ fn verify_execution_payload_chain<E: EthSpec>(chain: &[FullPayload<E>]) {
}
#[tokio::test]
async fn base_altair_merge_capella() {
async fn base_altair_bellatrix_capella() {
let altair_fork_epoch = Epoch::new(4);
let altair_fork_slot = altair_fork_epoch.start_slot(E::slots_per_epoch());
let bellatrix_fork_epoch = Epoch::new(8);
let merge_fork_slot = bellatrix_fork_epoch.start_slot(E::slots_per_epoch());
let bellatrix_fork_slot = bellatrix_fork_epoch.start_slot(E::slots_per_epoch());
let capella_fork_epoch = Epoch::new(12);
let capella_fork_slot = capella_fork_epoch.start_slot(E::slots_per_epoch());
@@ -61,39 +61,39 @@ async fn base_altair_merge_capella() {
assert_eq!(altair_head.slot(), altair_fork_slot);
/*
* Do the merge fork, without a terminal PoW block.
* Do the Bellatrix fork, without a terminal PoW block.
*/
harness.extend_to_slot(merge_fork_slot).await;
harness.extend_to_slot(bellatrix_fork_slot).await;
let merge_head = &harness.chain.head_snapshot().beacon_block;
assert!(merge_head.as_merge().is_ok());
assert_eq!(merge_head.slot(), merge_fork_slot);
let bellatrix_head = &harness.chain.head_snapshot().beacon_block;
assert!(bellatrix_head.as_bellatrix().is_ok());
assert_eq!(bellatrix_head.slot(), bellatrix_fork_slot);
assert!(
merge_head
bellatrix_head
.message()
.body()
.execution_payload()
.unwrap()
.is_default_with_empty_roots(),
"Merge head is default payload"
"Bellatrix head is default payload"
);
/*
* Next merge block shouldn't include an exec payload.
* Next Bellatrix block shouldn't include an exec payload.
*/
harness.extend_slots(1).await;
let one_after_merge_head = &harness.chain.head_snapshot().beacon_block;
let one_after_bellatrix_head = &harness.chain.head_snapshot().beacon_block;
assert!(
one_after_merge_head
one_after_bellatrix_head
.message()
.body()
.execution_payload()
.unwrap()
.is_default_with_empty_roots(),
"One after merge head is default payload"
"One after bellatrix head is default payload"
);
assert_eq!(one_after_merge_head.slot(), merge_fork_slot + 1);
assert_eq!(one_after_bellatrix_head.slot(), bellatrix_fork_slot + 1);
/*
* Trigger the terminal PoW block.
@@ -114,23 +114,23 @@ async fn base_altair_merge_capella() {
});
harness.extend_slots(1).await;
let two_after_merge_head = &harness.chain.head_snapshot().beacon_block;
let two_after_bellatrix_head = &harness.chain.head_snapshot().beacon_block;
assert!(
two_after_merge_head
two_after_bellatrix_head
.message()
.body()
.execution_payload()
.unwrap()
.is_default_with_empty_roots(),
"Two after merge head is default payload"
"Two after bellatrix head is default payload"
);
assert_eq!(two_after_merge_head.slot(), merge_fork_slot + 2);
assert_eq!(two_after_bellatrix_head.slot(), bellatrix_fork_slot + 2);
/*
* Next merge block should include an exec payload.
* Next Bellatrix block should include an exec payload.
*/
let mut execution_payloads = vec![];
for _ in (merge_fork_slot.as_u64() + 3)..capella_fork_slot.as_u64() {
for _ in (bellatrix_fork_slot.as_u64() + 3)..capella_fork_slot.as_u64() {
harness.extend_slots(1).await;
let block = &harness.chain.head_snapshot().beacon_block;
let full_payload: FullPayload<E> =

View File

@@ -1,9 +1,9 @@
mod attestation_production;
mod attestation_verification;
mod bellatrix;
mod block_verification;
mod capella;
mod events;
mod merge;
mod op_verification;
mod payload_invalidation;
mod rewards;

View File

@@ -211,7 +211,7 @@ async fn produces_missed_blocks() {
// `validator_indexes[slot_in_epoch.as_usize()]` and add it below.
let validator_index_to_monitor_altair = 2;
// Same as above but for the merge upgrade
let validator_index_to_monitor_merge = 4;
let validator_index_to_monitor_bellatrix = 4;
// Same as above but for the capella upgrade
let validator_index_to_monitor_capella = 11;
// Same as above but for the deneb upgrade
@@ -224,7 +224,7 @@ async fn produces_missed_blocks() {
vec![
validator_index_to_monitor,
validator_index_to_monitor_altair,
validator_index_to_monitor_merge,
validator_index_to_monitor_bellatrix,
validator_index_to_monitor_capella,
validator_index_to_monitor_deneb,
validator_index_to_monitor_electra,