Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Fix block check in simulator #1398

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions testing/simulator/src/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,16 @@ pub async fn verify_full_block_production_up_to<E: EthSpec>(
slot_delay(slot, slot_duration).await;
let beacon_nodes = network.beacon_nodes.read();
let beacon_chain = beacon_nodes[0].client.beacon_chain().unwrap();
let chain_dump = beacon_chain.chain_dump().unwrap();
if chain_dump.len() != slot.as_usize() + 1 {
let num_blocks = beacon_chain
.chain_dump()
.unwrap()
.iter()
.take_while(|s| s.beacon_block.slot() <= slot)
.count();
if num_blocks != slot.as_usize() + 1 {
return Err(format!(
"There wasn't a block produced at every slot, got: {}, expected: {}",
chain_dump.len(),
num_blocks,
slot.as_usize() + 1
));
}
Expand Down