diff --git a/packages/beacon-node/src/network/subnets/dllAttnetsService.ts b/packages/beacon-node/src/network/subnets/dllAttnetsService.ts index ea6f72fa10cf..edaf17e0a241 100644 --- a/packages/beacon-node/src/network/subnets/dllAttnetsService.ts +++ b/packages/beacon-node/src/network/subnets/dllAttnetsService.ts @@ -29,11 +29,6 @@ type Subnet = number; // map of subnet to time to form stable mesh as seconds, null if not yet formed type AggregatorDutyInfo = Map; -/** - * This value means node is not able to form stable mesh. - */ -const MAX_TIME_TO_STABLE_MESH_SEC = 120; - /** * Manage deleterministic long lived (DLL) subnets and short lived subnets. * - PeerManager uses attnetsService to know which peers are required for duties and long lived subscriptions @@ -196,6 +191,10 @@ export class DLLAttnetsService implements IAttnetsService { } }; + /** + * We subsribe to aggregator duties 2 slots in advance, track time to stable mesh + * every half slot. + */ private onHalfSlot = (clockSlot: Slot): void => { for (const [dutiedSlot, dutiedInfo] of this.aggregatorSlotSubnet.entries()) { this.trackTimeToStableMesh(clockSlot, dutiedSlot, dutiedInfo); @@ -206,18 +205,7 @@ export class DLLAttnetsService implements IAttnetsService { * Track time to form stable mesh if not yet formed */ private trackTimeToStableMesh(clockSlot: Slot, dutiedSlot: Slot, dutiedInfo: AggregatorDutyInfo): void { - if (dutiedSlot < clockSlot) { - // aggregator duty is expired, set timeToStableMesh to some big value so we know this value is not good - for (const [subnet, timeToFormMesh] of dutiedInfo.entries()) { - if (timeToFormMesh === null) { - dutiedInfo.set(subnet, MAX_TIME_TO_STABLE_MESH_SEC); - this.metrics?.attnetsService.subscriptionsCommitteeTimeToStableMesh.observe( - {subnet}, - MAX_TIME_TO_STABLE_MESH_SEC - ); - } - } - } else if (dutiedSlot <= clockSlot + this.opts.slotsToSubscribeBeforeAggregatorDuty) { + if (dutiedSlot <= clockSlot + this.opts.slotsToSubscribeBeforeAggregatorDuty) { // aggregator duty is not expired, track time to stable mesh if this is the 1st time we see mesh peers>=Dlo (6) for (const [subnet, timeToFormMesh] of dutiedInfo.entries()) { if (timeToFormMesh === null) {