Skip to content

Commit 80892e6

Browse files
authored
Fix DAS branch CI (#5793)
* Fix invalid syntax. * Update cli doc. Ignore get_custody_columns test temporarily. * Fix failing test and add verify inclusion test. * Undo accidentally removed code.
1 parent b64dd9d commit 80892e6

File tree

10 files changed

+31
-31
lines changed

10 files changed

+31
-31
lines changed

beacon_node/beacon_chain/src/test_utils.rs

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2578,32 +2578,20 @@ pub fn generate_rand_block_and_blobs<E: EthSpec>(
25782578
(block, blob_sidecars)
25792579
}
25802580

2581+
#[allow(clippy::type_complexity)]
25812582
pub fn generate_rand_block_and_data_columns<E: EthSpec>(
25822583
fork_name: ForkName,
25832584
num_blobs: NumBlobs,
25842585
rng: &mut impl Rng,
25852586
) -> (
25862587
SignedBeaconBlock<E, FullPayload<E>>,
2587-
Vec<DataColumnSidecar<E>>,
2588+
Vec<Arc<DataColumnSidecar<E>>>,
25882589
) {
25892590
let (block, blobs) = generate_rand_block_and_blobs(fork_name, num_blobs, rng);
2590-
let blob = blobs.first().expect("should have at least 1 blob");
2591-
2592-
let data_columns = (0..E::number_of_columns())
2593-
.map(|index| DataColumnSidecar {
2594-
index: index as u64,
2595-
column: <_>::default(),
2596-
kzg_commitments: block
2597-
.message()
2598-
.body()
2599-
.blob_kzg_commitments()
2600-
.unwrap()
2601-
.clone(),
2602-
kzg_proofs: (vec![]).into(),
2603-
signed_block_header: blob.signed_block_header.clone(),
2604-
kzg_commitments_inclusion_proof: <_>::default(),
2605-
})
2606-
.collect::<Vec<_>>();
2591+
let blob: BlobsList<E> = blobs.into_iter().map(|b| b.blob).collect::<Vec<_>>().into();
2592+
let data_columns = DataColumnSidecar::build_sidecars(&blob, &block, &KZG)
2593+
.unwrap()
2594+
.into();
26072595

26082596
(block, data_columns)
26092597
}

beacon_node/beacon_chain/tests/block_verification.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ async fn add_base_block_to_altair_chain() {
13621362
)
13631363
.await,
13641364
ChainSegmentResult::Failed {
1365-
..
1365+
imported_blocks: _,
13661366
error: BlockError::InconsistentFork(InconsistentFork {
13671367
fork_at_slot: ForkName::Altair,
13681368
object_fork: ForkName::Base,
@@ -1497,7 +1497,7 @@ async fn add_altair_block_to_base_chain() {
14971497
)
14981498
.await,
14991499
ChainSegmentResult::Failed {
1500-
..
1500+
imported_blocks: _,
15011501
error: BlockError::InconsistentFork(InconsistentFork {
15021502
fork_at_slot: ForkName::Base,
15031503
object_fork: ForkName::Altair,

beacon_node/network/src/sync/block_lookups/tests.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ impl TestRig {
241241
generate_rand_block_and_blobs::<E>(fork_name, num_blobs, rng)
242242
}
243243

244-
fn rand_block_and_data_columns(&mut self) -> (SignedBeaconBlock<E>, Vec<DataColumnSidecar<E>>) {
244+
fn rand_block_and_data_columns(
245+
&mut self,
246+
) -> (SignedBeaconBlock<E>, Vec<Arc<DataColumnSidecar<E>>>) {
245247
let num_blobs = NumBlobs::Number(1);
246248
generate_rand_block_and_data_columns::<E>(self.fork_name, num_blobs, &mut self.rng)
247249
}
@@ -640,7 +642,7 @@ impl TestRig {
640642
fn complete_valid_sampling_column_requests(
641643
&mut self,
642644
sampling_ids: SamplingIds,
643-
data_columns: Vec<DataColumnSidecar<E>>,
645+
data_columns: Vec<Arc<DataColumnSidecar<E>>>,
644646
) {
645647
for (id, column_index) in sampling_ids {
646648
self.log(&format!("return valid data column for {column_index}"));
@@ -654,7 +656,7 @@ impl TestRig {
654656
fn complete_valid_sampling_column_request(
655657
&mut self,
656658
id: DataColumnsByRootRequestId,
657-
data_column: DataColumnSidecar<E>,
659+
data_column: Arc<DataColumnSidecar<E>>,
658660
) {
659661
let block_root = data_column.block_root();
660662
let column_index = data_column.index;
@@ -677,7 +679,7 @@ impl TestRig {
677679
fn complete_valid_custody_request(
678680
&mut self,
679681
sampling_ids: SamplingIds,
680-
data_columns: Vec<DataColumnSidecar<E>>,
682+
data_columns: Vec<Arc<DataColumnSidecar<E>>>,
681683
missing_components: bool,
682684
) {
683685
let lookup_id = if let DataColumnsByRootRequester::Custody(id) =
@@ -720,14 +722,14 @@ impl TestRig {
720722
fn complete_data_columns_by_root_request(
721723
&mut self,
722724
id: DataColumnsByRootRequestId,
723-
data_column: DataColumnSidecar<E>,
725+
data_column: Arc<DataColumnSidecar<E>>,
724726
) {
725727
let peer_id = PeerId::random();
726728
// Send chunk
727729
self.send_sync_message(SyncMessage::RpcDataColumn {
728730
request_id: SyncRequestId::DataColumnsByRoot(id),
729731
peer_id,
730-
data_column: Some(Arc::new(data_column)),
732+
data_column: Some(data_column),
731733
seen_timestamp: timestamp_now(),
732734
});
733735
// Send stream termination

beacon_node/network/src/sync/block_sidecar_coupling.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ mod tests {
299299
for block in &blocks {
300300
for column in &block.1 {
301301
if expects_custody_columns.contains(&column.index) {
302-
info.add_data_column(Some(column.clone().into()));
302+
info.add_data_column(Some(column.clone()));
303303
}
304304
}
305305
}

beacon_node/src/cli.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ pub fn cli_app<'a, 'b>() -> App<'a, 'b> {
4747
.takes_value(false),
4848
)
4949
.arg(
50+
// TODO(das): remove this before release
5051
Arg::with_name("malicious-withhold-count")
5152
.long("malicious-withhold-count")
5253
.help("TESTING ONLY do not use this")
54+
.hidden(true)
5355
.takes_value(true),
5456
)
5557
.arg(

beacon_node/src/config.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ pub fn get_config<E: EthSpec>(
443443
client_config.store.epochs_per_blob_prune = epochs_per_blob_prune;
444444
}
445445

446+
if let Some(blob_prune_margin_epochs) =
447+
clap_utils::parse_optional(cli_args, "blob-prune-margin-epochs")?
448+
{
449+
client_config.store.blob_prune_margin_epochs = blob_prune_margin_epochs;
450+
}
451+
446452
if let Some(malicious_withhold_count) =
447453
clap_utils::parse_optional(cli_args, "malicious-withhold-count")?
448454
{

book/src/help_bn.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ OPTIONS:
259259
260260
--graffiti <GRAFFITI>
261261
Specify your custom graffiti to be included in blocks. Defaults to the current version and commit, truncated
262-
to fit in 32 bytes.
262+
to fit in 32 bytes.
263263
--historic-state-cache-size <SIZE>
264264
Specifies how many states from the freezer database should cache in memory [default: 1]
265265
@@ -324,9 +324,6 @@ OPTIONS:
324324
--logfile-max-size <SIZE>
325325
The maximum size (in MB) each log file can grow to before rotating. If set to 0, background file logging is
326326
disabled. [default: 200]
327-
--malicious-withhold-count <malicious-withhold-count>
328-
TESTING ONLY do not use this
329-
330327
--max-skip-slots <NUM_SLOTS>
331328
Refuse to skip more than this many slots when processing an attestation. This prevents nodes on minority
332329
forks from wasting our time and disk space, but could also cause unnecessary consensus failures, so is

consensus/types/src/data_column_sidecar.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ mod test {
461461
col_sidecar.kzg_commitments_inclusion_proof,
462462
block_kzg_commitments_inclusion_proof
463463
);
464+
assert!(col_sidecar.verify_inclusion_proof());
464465
}
465466
}
466467

testing/ef_tests/check_all_files_accessed.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
excluded_paths = [
2323
# TODO(das): remove once electra tests are on unstable
2424
"tests/.*/electra/",
25+
# TODO(das): ignore until new spec test release with column subnet count = 64.
26+
"tests/.*/.*/.*/get_custody_columns/",
2527
# Eth1Block and PowBlock
2628
#
2729
# Intentionally omitted, as per https://github.com/sigp/lighthouse/issues/1835

testing/ef_tests/tests/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,9 @@ fn rewards() {
775775
}
776776
}
777777

778+
// TODO(das): ignore until new spec test release with column subnet count = 64.
778779
#[test]
780+
#[ignore]
779781
fn get_custody_columns() {
780782
GetCustodyColumnsHandler::<MainnetEthSpec>::default()
781783
.run_for_feature(ForkName::Deneb, FeatureName::Eip7594);

0 commit comments

Comments
 (0)