Skip to content

Commit d280dbf

Browse files
committed
sim-rs: fix bug delaying old EBs from getting referenced
1 parent 3a5a3c1 commit d280dbf

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

sim-rs/sim-core/src/sim/leios.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1666,9 +1666,7 @@ impl LeiosNode {
16661666
// η is the "quality parameter" (expected block rate), and L is stage length.
16671667
let old_pipelines =
16681668
(3 * self.sim_config.praos_chain_quality).div_ceil(self.sim_config.stage_length);
1669-
let oldest_included_pipeline = pipeline
1670-
.checked_sub(old_pipelines)
1671-
.unwrap_or(newest_included_pipeline);
1669+
let oldest_included_pipeline = pipeline.checked_sub(old_pipelines).unwrap_or_default();
16721670

16731671
Some(oldest_included_pipeline..=newest_included_pipeline)
16741672
}

sim-rs/sim-core/src/sim/stracciatella.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -632,9 +632,7 @@ impl StracciatellaLeiosNode {
632632
// η is the "quality parameter" (expected block rate), and L is stage length.
633633
let old_pipelines =
634634
(3 * self.sim_config.praos_chain_quality).div_ceil(self.sim_config.stage_length);
635-
let oldest_included_pipeline = pipeline
636-
.checked_sub(old_pipelines)
637-
.unwrap_or(newest_included_pipeline);
635+
let oldest_included_pipeline = pipeline.checked_sub(old_pipelines).unwrap_or_default();
638636

639637
Some(oldest_included_pipeline..=newest_included_pipeline)
640638
}

0 commit comments

Comments
 (0)