Skip to content

Commit 7d3e57d

Browse files
committed
Remove from delay_map 2 slots after duty
1 parent 48789c7 commit 7d3e57d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

beacon_node/network/src/subnet_service/attestation_subnets.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,16 @@ impl<T: BeaconChainTypes> AttestationService<T> {
477477
time_to_subscription_slot.saturating_sub(advance_subscription_duration)
478478
};
479479

480+
let mut time_to_subscription_slot = self
481+
.beacon_chain
482+
.slot_clock
483+
.duration_to_slot(slot)
484+
.unwrap_or_default(); // If this is a past slot we will just get a 0 duration.
485+
486+
time_to_subscription_slot += slot_duration * 2;
487+
480488
if let Some(tracked_vals) = self.aggregate_validators_on_subnet.as_mut() {
481-
tracked_vals.insert(ExactSubnet { subnet_id, slot });
489+
tracked_vals.insert_at(ExactSubnet { subnet_id, slot }, time_to_subscription_slot);
482490
}
483491

484492
// If the subscription should be done in the future, schedule it. Otherwise subscribe

0 commit comments

Comments
 (0)