diff --git a/beacon_node/beacon_chain/tests/block_verification.rs b/beacon_node/beacon_chain/tests/block_verification.rs index 078a5d848c..415aed5831 100644 --- a/beacon_node/beacon_chain/tests/block_verification.rs +++ b/beacon_node/beacon_chain/tests/block_verification.rs @@ -206,6 +206,10 @@ fn update_blob_signed_header( signed_block: &SignedBeaconBlock, blobs: &mut BlobSidecarList, ) { + // Required to prevent as_mut_slice being called on an uninitialized list. Yuck. + if blobs.is_empty() { + return; + } for old_blob_sidecar in blobs.as_mut_slice().unwrap() { let new_blob = Arc::new(BlobSidecar:: { index: old_blob_sidecar.index, diff --git a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs index f5e3e560ec..a190b3fb75 100644 --- a/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs +++ b/beacon_node/execution_layer/src/test_utils/execution_block_generator.rs @@ -672,7 +672,7 @@ impl ExecutionBlockGenerator { // get random number between 0 and Max Blobs let mut rng = self.rng.lock(); // TODO(pawan): thread the chainspec value here somehow - let num_blobs = rng.gen::() % 6; + let num_blobs = rng.gen::() % (6 + 1); let (bundle, transactions) = generate_blobs(num_blobs)?; for tx in Vec::from(transactions) { execution_payload