diff --git a/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts b/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts index fd7b9bd3a23..cd56b309c2f 100644 --- a/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts +++ b/packages/beacon-node/src/chain/opPools/syncCommitteeMessagePool.ts @@ -1,7 +1,7 @@ import {Signature, aggregateSignatures} from "@chainsafe/blst"; import {BitArray} from "@chainsafe/ssz"; import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_COUNT} from "@lodestar/params"; -import {Root, Slot, SubcommitteeIndex, altair} from "@lodestar/types"; +import {Root, Slot, SubcommitteeIndex, SubnetID, altair} from "@lodestar/types"; import {MapDef, toRootHex} from "@lodestar/utils"; import {IClock} from "../../util/clock.js"; import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js"; @@ -26,7 +26,6 @@ type ContributionFast = Omit> - >(() => new MapDef>(() => new Map())); + MapDef> + >(() => new MapDef>(() => new Map())); private lowestPermissibleSlot = 0; constructor( @@ -62,7 +61,7 @@ export class SyncCommitteeMessagePool { } // TODO: indexInSubcommittee: number should be indicesInSyncCommittee - add(subnet: Subnet, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number): InsertOutcome { + add(subnet: SubnetID, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number): InsertOutcome { const {slot, beaconBlockRoot} = signature; const rootHex = toRootHex(beaconBlockRoot); const lowestPermissibleSlot = this.lowestPermissibleSlot; @@ -146,7 +145,7 @@ function aggregateSignatureInto( * Format `signature` into an efficient `contribution` to add more signatures in with aggregateSignatureInto() */ function signatureToAggregate( - subnet: Subnet, + subnet: SubnetID, signature: altair.SyncCommitteeMessage, indexInSubcommittee: number ): ContributionFast { diff --git a/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts b/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts index 0f25032e1d7..b38b6c1d117 100644 --- a/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts +++ b/packages/beacon-node/src/chain/opPools/syncContributionAndProofPool.ts @@ -2,7 +2,7 @@ import {Signature, aggregateSignatures} from "@chainsafe/blst"; import {BitArray} from "@chainsafe/ssz"; import {SYNC_COMMITTEE_SIZE, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params"; import {G2_POINT_AT_INFINITY} from "@lodestar/state-transition"; -import {Root, Slot, altair, ssz} from "@lodestar/types"; +import {Root, Slot, SubnetID, altair, ssz} from "@lodestar/types"; import {MapDef, toRootHex} from "@lodestar/utils"; import {InsertOutcome, OpPoolError, OpPoolErrorCode} from "./types.js"; import {pruneBySlot, signatureFromBytesNoCheck} from "./utils.js"; @@ -33,7 +33,6 @@ export type SyncContributionFast = { /** Hex string of `contribution.beaconBlockRoot` */ type BlockRootHex = string; -type Subnet = number; /** * Cache SyncCommitteeContribution and seen ContributionAndProof. @@ -43,8 +42,8 @@ type Subnet = number; export class SyncContributionAndProofPool { private readonly bestContributionBySubnetRootBySlot = new MapDef< Slot, - MapDef> - >(() => new MapDef>(() => new Map())); + MapDef> + >(() => new MapDef>(() => new Map())); private lowestPermissibleSlot = 0; diff --git a/packages/beacon-node/src/network/subnets/attnetsService.ts b/packages/beacon-node/src/network/subnets/attnetsService.ts index aa97746bee0..5652460b5ab 100644 --- a/packages/beacon-node/src/network/subnets/attnetsService.ts +++ b/packages/beacon-node/src/network/subnets/attnetsService.ts @@ -25,9 +25,8 @@ export enum SubnetSource { longLived = "long_lived", } -type Subnet = number; // map of subnet to time to form stable mesh as seconds, null if not yet formed -type AggregatorDutyInfo = Map; +type AggregatorDutyInfo = Map; /** * This value means node is not able to form stable mesh.