File tree Expand file tree Collapse file tree 5 files changed +19
-9
lines changed Expand file tree Collapse file tree 5 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -452,9 +452,9 @@ impl EventMonitor {
452452 Some ( block_time - tx. generated )
453453 } )
454454 . collect ( ) ;
455- let ib_expiration_cutoff = last_timestamp - Duration :: from_secs ( self . maximum_ib_age ) ;
455+ let ib_expiration_cutoff = last_timestamp. checked_sub_duration ( Duration :: from_secs ( self . maximum_ib_age ) ) . unwrap_or_default ( ) ;
456456 let expired_ibs = ibs. values ( ) . filter ( |ib| ib. included_in_eb . is_none ( ) && ib. generated < ib_expiration_cutoff) . count ( ) ;
457- let eb_expiration_cutoff = last_timestamp - Duration :: from_secs ( self . maximum_eb_age ) ;
457+ let eb_expiration_cutoff = last_timestamp. checked_sub_duration ( Duration :: from_secs ( self . maximum_eb_age ) ) . unwrap_or_default ( ) ;
458458 let expired_ebs = ebs. values ( ) . filter ( |eb| eb. included_in_eb . is_none ( ) && eb. included_in_block . is_none ( ) && eb. generated < eb_expiration_cutoff) . count ( ) ;
459459 let empty_ebs = ebs. values ( ) . filter ( |eb| eb. is_empty ( ) ) . count ( ) ;
460460 let bundle_count = votes_per_bundle. len ( ) ;
Original file line number Diff line number Diff line change @@ -587,9 +587,13 @@ impl Node {
587587 }
588588
589589 fn generate_endorser_blocks ( & mut self , slot : u64 ) {
590+ let pipeline = self . slot_to_pipeline ( slot) + 1 ;
591+ if pipeline < 4 {
592+ // The first pipeline with IBs in it is pipeline 4.
593+ // Don't generate EBs before that pipeline, because they would just be empty.
594+ }
590595 for next_p in vrf_probabilities ( self . sim_config . eb_generation_probability ) {
591596 if self . run_vrf ( next_p) . is_some ( ) {
592- let pipeline = self . slot_to_pipeline ( slot) + 1 ;
593597 self . tracker . track_eb_lottery_won ( EndorserBlockId {
594598 slot,
595599 pipeline,
@@ -619,6 +623,12 @@ impl Node {
619623 }
620624
621625 fn schedule_endorser_block_votes ( & mut self , slot : u64 ) {
626+ let pipeline = self . slot_to_pipeline ( slot) ;
627+ if pipeline < 4 {
628+ // The first pipeline with IBs in it is pipeline 4.
629+ // Don't run the VT lottery before that pipeline, because there's nothing to vote on.
630+ return ;
631+ }
622632 let vrf_wins = vrf_probabilities ( self . sim_config . vote_probability )
623633 . filter_map ( |f| self . run_vrf ( f) )
624634 . count ( ) ;
Original file line number Diff line number Diff line change 11version https://git-lfs.github.com/spec/v1
2- oid sha256:a5b65b452312578f3a710024f04c912647fcce4e63224c3471d50921eac9c091
3- size 14783528
2+ oid sha256:1340952829906e650306286981c459c31265edd42d0db840d309b77e4db8a531
3+ size 14451878
Original file line number Diff line number Diff line change 11version https://git-lfs.github.com/spec/v1
2- oid sha256:8c73e766768276d9f707eeee0f2b60511c5f99acd0764461d84cd6238eca432f
3- size 12670009
2+ oid sha256:4c4b0d8f1f18aee8a68467211be4e34cd519c65ef130b8977f25ee31993d5483
3+ size 12135481
Original file line number Diff line number Diff line change 11version https://git-lfs.github.com/spec/v1
2- oid sha256:f32692bef181c2c22d57a9f63c97651a1ac67fa5af6c579a72395dab08105e95
3- size 8635280
2+ oid sha256:33b4bbb5760bcfa2d1e4726d81642cf48c8832cca0586d1e85b0d16aa6ec965b
3+ size 8351576
You can’t perform that action at this time.
0 commit comments