Skip to content

Commit

Permalink
Remove from delay_map 2 slots after duty
Browse files Browse the repository at this point in the history
  • Loading branch information
pawanjay176 committed May 29, 2024
1 parent 48789c7 commit 7d3e57d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion beacon_node/network/src/subnet_service/attestation_subnets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,16 @@ impl<T: BeaconChainTypes> AttestationService<T> {
time_to_subscription_slot.saturating_sub(advance_subscription_duration)
};

let mut time_to_subscription_slot = self
.beacon_chain
.slot_clock
.duration_to_slot(slot)
.unwrap_or_default(); // If this is a past slot we will just get a 0 duration.

time_to_subscription_slot += slot_duration * 2;

if let Some(tracked_vals) = self.aggregate_validators_on_subnet.as_mut() {
tracked_vals.insert(ExactSubnet { subnet_id, slot });
tracked_vals.insert_at(ExactSubnet { subnet_id, slot }, time_to_subscription_slot);
}

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

0 comments on commit 7d3e57d

Please sign in to comment.