Skip to content

Commit 2fade27

Browse files
committed
sim-rs: skip conformance events for irrelevant pipelines
1 parent 40edb59 commit 2fade27

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

sim-rs/sim-core/src/sim/node.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -594,6 +594,7 @@ impl Node {
594594
if pipeline < 4 {
595595
// The first pipeline with IBs in it is pipeline 4.
596596
// Don't generate EBs before that pipeline, because they would just be empty.
597+
return;
597598
}
598599
for next_p in vrf_probabilities(self.sim_config.eb_generation_probability) {
599600
if self.run_vrf(next_p).is_some() {
@@ -651,6 +652,12 @@ impl Node {
651652
}
652653

653654
fn vote_for_endorser_blocks(&mut self, slot: u64) {
655+
let pipeline = self.slot_to_pipeline(slot);
656+
if pipeline < 4 {
657+
// The first pipeline with IBs in it is pipeline 4.
658+
// Don't try voting before that pipeline, because there's nothing to vote for.
659+
return;
660+
}
654661
if !self.try_vote_for_endorser_blocks(slot) && self.sim_config.emit_conformance_events {
655662
self.tracker.track_no_vote_generated(self.id, slot);
656663
}

0 commit comments

Comments
 (0)