From 7d3e57d0bbcb5ec08d9b4b89b4eb77d8dec5f901 Mon Sep 17 00:00:00 2001 From: Pawan Dhananjay Date: Wed, 29 May 2024 20:12:21 +0530 Subject: [PATCH] Remove from delay_map 2 slots after duty --- .../network/src/subnet_service/attestation_subnets.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/beacon_node/network/src/subnet_service/attestation_subnets.rs b/beacon_node/network/src/subnet_service/attestation_subnets.rs index ab9ffb95a6c..bffc772a453 100644 --- a/beacon_node/network/src/subnet_service/attestation_subnets.rs +++ b/beacon_node/network/src/subnet_service/attestation_subnets.rs @@ -477,8 +477,16 @@ impl AttestationService { 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