Skip to content

Commit 03d4866

Browse files
committed
Log missed slots.
1 parent fc08254 commit 03d4866

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

.github/workflows/test-suite.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ jobs:
296296
channel: stable
297297
cache-target: release
298298
- name: Run a basic beacon chain sim that starts from Deneb
299-
run: cargo run --release --bin simulator basic-sim --speed-up-factor 1
299+
run: cargo run --release --bin simulator basic-sim
300300
fallback-simulator-ubuntu:
301301
name: fallback-simulator-ubuntu
302302
needs: [check-labels]

testing/simulator/src/checks.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,23 @@ pub async fn verify_full_block_production_up_to<E: EthSpec>(
128128
slot_delay(slot, slot_duration).await;
129129
let beacon_nodes = network.beacon_nodes.read();
130130
let beacon_chain = beacon_nodes[0].client.beacon_chain().unwrap();
131-
let num_blocks = beacon_chain
131+
let block_slots = beacon_chain
132132
.chain_dump()
133133
.unwrap()
134134
.iter()
135135
.take_while(|s| s.beacon_block.slot() <= slot)
136-
.count();
136+
.map(|s| s.beacon_block.slot().as_usize())
137+
.collect::<Vec<_>>();
138+
let num_blocks = block_slots.len();
137139
if num_blocks != slot.as_usize() + 1 {
140+
let missed_slots = (0..slot.as_usize())
141+
.filter(|slot| !block_slots.contains(slot))
142+
.collect::<Vec<_>>();
138143
return Err(format!(
139-
"There wasn't a block produced at every slot, got: {}, expected: {}",
144+
"There wasn't a block produced at every slot, got: {}, expected: {}, missed: {:?}",
140145
num_blocks,
141-
slot.as_usize() + 1
146+
slot.as_usize() + 1,
147+
missed_slots
142148
));
143149
}
144150
Ok(())

0 commit comments

Comments
 (0)