UNPKG

@lodestar/beacon-node

Version:

A Typescript implementation of the beacon chain

35 lines 1.93 kB
import { BitArray } from "@chainsafe/ssz"; import { CommitteeIndex, Epoch, RootHex } from "@lodestar/types"; import { Metrics } from "../../metrics/index.js"; export type AggregationInfo = { aggregationBits: BitArray; trueBitCount: number; }; /** * Although there are up to TARGET_AGGREGATORS_PER_COMMITTEE (16 for mainnet) AggregateAndProof messages per slot, * they tend to have the same aggregate attestation, or one attestation is non-strict superset of another, * the gossipsub messages-ids are different because they are really different SignedAggregateAndProof object. * This is used to address the following spec in p2p-interface gossipsub: * _[IGNORE]_ A valid aggregate attestation defined by `hash_tree_root(aggregate.data)` whose `aggregation_bits` is a * non-strict superset has _not_ already been seen. * * We have AggregatedAttestationPool op pool, however aggregated attestations are not added to that place while this does. */ export declare class SeenAggregatedAttestations { private readonly metrics; /** * Array of AttestingIndices by same attestation data root by epoch. * Note that there are at most TARGET_AGGREGATORS_PER_COMMITTEE (16) per attestation data. * */ private readonly aggregateRootsByEpoch; private lowestPermissibleEpoch; constructor(metrics: Metrics | null); isKnown(targetEpoch: Epoch, committeeIndex: CommitteeIndex, attDataRoot: RootHex, aggregationBits: BitArray): boolean; add(targetEpoch: Epoch, committeeIndex: CommitteeIndex, attDataRoot: RootHex, newItem: AggregationInfo, checkIsKnown: boolean): void; prune(currentEpoch: Epoch): void; } /** * Make sure seenAggregationInfoArr is always in desc order based on trueBitCount so that isKnown can be faster */ export declare function insertDesc(seenAggregationInfoArr: AggregationInfo[], newItem: AggregationInfo): void; //# sourceMappingURL=seenAggregateAndProof.d.ts.map