Merge branch 'gloas-containers' into gloas-envelope-processing

This commit is contained in:
Mark Mackey
2025-11-28 14:40:55 -06:00
101 changed files with 3693 additions and 3689 deletions

View File

@@ -11,7 +11,9 @@ use beacon_chain::test_utils::{
AttestationStrategy, BeaconChainHarness, BlockStrategy, DiskHarnessType, get_kzg,
mock_execution_layer_from_parts, test_spec,
};
use beacon_chain::test_utils::{SyncCommitteeStrategy, fork_name_from_env};
use beacon_chain::test_utils::{
SyncCommitteeStrategy, fork_name_from_env, generate_data_column_indices_rand_order,
};
use beacon_chain::{
BeaconChain, BeaconChainError, BeaconChainTypes, BeaconSnapshot, BlockError, ChainConfig,
NotifyExecutionLayer, ServerSentEventHandler, WhenSlotSkipped,
@@ -2707,7 +2709,7 @@ async fn weak_subjectivity_sync_easy() {
let num_initial_slots = E::slots_per_epoch() * 11;
let checkpoint_slot = Slot::new(E::slots_per_epoch() * 9);
let slots = (1..num_initial_slots).map(Slot::new).collect();
weak_subjectivity_sync_test(slots, checkpoint_slot, None).await
weak_subjectivity_sync_test(slots, checkpoint_slot, None, true).await
}
#[tokio::test]
@@ -2715,7 +2717,7 @@ async fn weak_subjectivity_sync_single_block_batches() {
let num_initial_slots = E::slots_per_epoch() * 11;
let checkpoint_slot = Slot::new(E::slots_per_epoch() * 9);
let slots = (1..num_initial_slots).map(Slot::new).collect();
weak_subjectivity_sync_test(slots, checkpoint_slot, Some(1)).await
weak_subjectivity_sync_test(slots, checkpoint_slot, Some(1), true).await
}
#[tokio::test]
@@ -2729,7 +2731,7 @@ async fn weak_subjectivity_sync_unaligned_advanced_checkpoint() {
slot <= checkpoint_slot - 3 || slot > checkpoint_slot
})
.collect();
weak_subjectivity_sync_test(slots, checkpoint_slot, None).await
weak_subjectivity_sync_test(slots, checkpoint_slot, None, true).await
}
#[tokio::test]
@@ -2743,7 +2745,7 @@ async fn weak_subjectivity_sync_unaligned_unadvanced_checkpoint() {
slot <= checkpoint_slot || slot > checkpoint_slot + 3
})
.collect();
weak_subjectivity_sync_test(slots, checkpoint_slot, None).await
weak_subjectivity_sync_test(slots, checkpoint_slot, None, true).await
}
// Regression test for https://github.com/sigp/lighthouse/issues/4817
@@ -2755,7 +2757,7 @@ async fn weak_subjectivity_sync_skips_at_genesis() {
let end_slot = E::slots_per_epoch() * 4;
let slots = (start_slot..end_slot).map(Slot::new).collect();
let checkpoint_slot = Slot::new(E::slots_per_epoch() * 2);
weak_subjectivity_sync_test(slots, checkpoint_slot, None).await
weak_subjectivity_sync_test(slots, checkpoint_slot, None, true).await
}
// Checkpoint sync from the genesis state.
@@ -2768,13 +2770,24 @@ async fn weak_subjectivity_sync_from_genesis() {
let end_slot = E::slots_per_epoch() * 2;
let slots = (start_slot..end_slot).map(Slot::new).collect();
let checkpoint_slot = Slot::new(0);
weak_subjectivity_sync_test(slots, checkpoint_slot, None).await
weak_subjectivity_sync_test(slots, checkpoint_slot, None, true).await
}
// Test checkpoint sync without providing blobs - backfill should fetch them.
#[tokio::test]
async fn weak_subjectivity_sync_without_blobs() {
let start_slot = 4;
let end_slot = E::slots_per_epoch() * 4;
let slots = (start_slot..end_slot).map(Slot::new).collect();
let checkpoint_slot = Slot::new(E::slots_per_epoch() * 2);
weak_subjectivity_sync_test(slots, checkpoint_slot, None, false).await
}
async fn weak_subjectivity_sync_test(
slots: Vec<Slot>,
checkpoint_slot: Slot,
backfill_batch_size: Option<usize>,
provide_blobs: bool,
) {
// Build an initial chain on one harness, representing a synced node with full history.
let num_final_blocks = E::slots_per_epoch() * 2;
@@ -2876,7 +2889,11 @@ async fn weak_subjectivity_sync_test(
.weak_subjectivity_state(
wss_state,
wss_block.clone(),
wss_blobs_opt.clone(),
if provide_blobs {
wss_blobs_opt.clone()
} else {
None
},
genesis_state,
)
.unwrap()
@@ -2885,17 +2902,10 @@ async fn weak_subjectivity_sync_test(
.shutdown_sender(shutdown_tx)
.event_handler(Some(ServerSentEventHandler::new_with_capacity(1)))
.execution_layer(Some(mock.el))
.ordered_custody_column_indices(generate_data_column_indices_rand_order::<E>())
.rng(Box::new(StdRng::seed_from_u64(42)))
.build()
.expect("should build");
beacon_chain
.data_availability_checker
.custody_context()
.init_ordered_data_columns_from_custody_groups(
(0..spec.number_of_custody_groups).collect(),
&spec,
)
.unwrap();
let beacon_chain = Arc::new(beacon_chain);
let wss_block_root = wss_block.canonical_root();