@lodestar/beacon-node 1.29.0-dev.87d367d9f7 → 1.29.0-dev.8aa1ad8d30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/impl/beacon/pool/index.js +1 -1
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/validator/index.js +5 -4
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +12 -0
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/chain.js +5 -7
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +32 -14
- package/lib/chain/opPools/aggregatedAttestationPool.js +235 -97
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/attestationPool.d.ts +4 -2
- package/lib/chain/opPools/attestationPool.js +4 -3
- package/lib/chain/opPools/attestationPool.js.map +1 -1
- package/lib/metrics/metrics/beacon.js +1 -1
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +62 -10
- package/lib/metrics/metrics/lodestar.js +141 -28
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/options.d.ts +1 -1
- package/lib/metrics/validatorMonitor.js +1 -1
- package/lib/metrics/validatorMonitor.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +3 -3
- package/lib/network/core/networkCore.js +9 -4
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +5 -3
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +2 -2
- package/lib/network/core/networkCoreWorkerHandler.js +3 -3
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +1 -1
- package/lib/network/discv5/index.d.ts +2 -3
- package/lib/network/discv5/index.js +4 -5
- package/lib/network/discv5/index.js.map +1 -1
- package/lib/network/discv5/types.d.ts +1 -1
- package/lib/network/discv5/worker.js +7 -6
- package/lib/network/discv5/worker.js.map +1 -1
- package/lib/network/gossip/gossipsub.js +4 -0
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/interface.d.ts +3 -2
- package/lib/network/libp2p/index.d.ts +2 -2
- package/lib/network/libp2p/index.js +9 -9
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +4 -4
- package/lib/network/network.js +7 -5
- package/lib/network/network.js.map +1 -1
- package/lib/network/peers/datastore.d.ts +2 -1
- package/lib/network/peers/datastore.js +1 -1
- package/lib/network/peers/datastore.js.map +1 -1
- package/lib/network/peers/discover.d.ts +2 -0
- package/lib/network/peers/discover.js +3 -4
- package/lib/network/peers/discover.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts +2 -1
- package/lib/network/peers/peerManager.js +1 -1
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/getConnectedPeerIds.js +2 -2
- package/lib/network/peers/utils/getConnectedPeerIds.js.map +1 -1
- package/lib/network/processor/gossipHandlers.js +3 -2
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/util.d.ts +4 -1
- package/lib/network/util.js +2 -2
- package/lib/network/util.js.map +1 -1
- package/lib/node/nodejs.d.ts +3 -3
- package/lib/node/nodejs.js +2 -2
- package/lib/node/nodejs.js.map +1 -1
- package/lib/util/peerId.js +1 -1
- package/lib/util/peerId.js.map +1 -1
- package/package.json +31 -32
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ChainForkConfig } from "@lodestar/config";
|
|
2
2
|
import { IForkChoice } from "@lodestar/fork-choice";
|
|
3
3
|
import { ForkName } from "@lodestar/params";
|
|
4
|
-
import { CachedBeaconStateAllForks } from "@lodestar/state-transition";
|
|
4
|
+
import { CachedBeaconStateAllForks, EffectiveBalanceIncrements } from "@lodestar/state-transition";
|
|
5
5
|
import { Attestation, Epoch, RootHex, Slot, ValidatorIndex, electra, phase0 } from "@lodestar/types";
|
|
6
|
+
import { Metrics } from "../../metrics/metrics.js";
|
|
6
7
|
import { InsertOutcome } from "./types.js";
|
|
7
8
|
type CommitteeIndex = number;
|
|
8
9
|
/**
|
|
@@ -12,22 +13,32 @@ type CommitteeIndex = number;
|
|
|
12
13
|
export type AttestationsConsolidation = {
|
|
13
14
|
byCommittee: Map<CommitteeIndex, AttestationNonParticipant>;
|
|
14
15
|
attData: phase0.AttestationData;
|
|
15
|
-
|
|
16
|
+
totalNewSeenEffectiveBalance: number;
|
|
17
|
+
newSeenAttesters: number;
|
|
18
|
+
notSeenAttesters: number;
|
|
19
|
+
/** total number of attesters across all committees in this consolidation */
|
|
20
|
+
totalAttesters: number;
|
|
16
21
|
};
|
|
17
22
|
/**
|
|
18
|
-
* This function returns not seen participation for a given epoch and slot and
|
|
23
|
+
* This function returns not seen participation for a given epoch and slot and committee index.
|
|
19
24
|
* Return null if all validators are seen or no info to check.
|
|
20
25
|
*/
|
|
21
26
|
type GetNotSeenValidatorsFn = (epoch: Epoch, slot: Slot, committeeIndex: number) => Set<number> | null;
|
|
22
27
|
type ValidateAttestationDataFn = (attData: phase0.AttestationData) => boolean;
|
|
28
|
+
export declare enum ScannedSlotsTerminationReason {
|
|
29
|
+
MaxConsolidationReached = "max_consolidation_reached",
|
|
30
|
+
ScannedAllSlots = "scanned_all_slots",
|
|
31
|
+
SlotBeforePreviousEpoch = "slot_before_previous_epoch"
|
|
32
|
+
}
|
|
23
33
|
/**
|
|
24
34
|
* Maintain a pool of aggregated attestations. Attestations can be retrieved for inclusion in a block
|
|
25
|
-
* or api. The returned attestations are aggregated to
|
|
35
|
+
* or api. The returned attestations are aggregated to maximize the number of validators that can be
|
|
26
36
|
* included.
|
|
27
37
|
* Note that we want to remove attestations with attesters that were included in the chain.
|
|
28
38
|
*/
|
|
29
39
|
export declare class AggregatedAttestationPool {
|
|
30
40
|
private readonly config;
|
|
41
|
+
private readonly metrics;
|
|
31
42
|
/**
|
|
32
43
|
* post electra, different committees could have the same AttData and we have to consolidate attestations of the same
|
|
33
44
|
* data to be included in block, so we should group by data before index
|
|
@@ -35,12 +46,7 @@ export declare class AggregatedAttestationPool {
|
|
|
35
46
|
*/
|
|
36
47
|
private readonly attestationGroupByIndexByDataHexBySlot;
|
|
37
48
|
private lowestPermissibleSlot;
|
|
38
|
-
constructor(config: ChainForkConfig);
|
|
39
|
-
/** For metrics to track size of the pool */
|
|
40
|
-
getAttestationCount(): {
|
|
41
|
-
attestationCount: number;
|
|
42
|
-
attestationDataCount: number;
|
|
43
|
-
};
|
|
49
|
+
constructor(config: ChainForkConfig, metrics?: Metrics | null);
|
|
44
50
|
add(attestation: Attestation, dataRootHex: RootHex, attestingIndicesCount: number, committee: Uint32Array): InsertOutcome;
|
|
45
51
|
/** Remove attestations which are too old to be included in a block. */
|
|
46
52
|
prune(clockSlot: Slot): void;
|
|
@@ -62,6 +68,7 @@ export declare class AggregatedAttestationPool {
|
|
|
62
68
|
* @param bySlot slot to filter, `bySlot === attestation.data.slot`
|
|
63
69
|
*/
|
|
64
70
|
getAll(bySlot?: Slot): Attestation[];
|
|
71
|
+
private onScrapeMetrics;
|
|
65
72
|
}
|
|
66
73
|
interface AttestationWithIndex {
|
|
67
74
|
attestation: Attestation;
|
|
@@ -69,7 +76,13 @@ interface AttestationWithIndex {
|
|
|
69
76
|
}
|
|
70
77
|
type AttestationNonParticipant = {
|
|
71
78
|
attestation: Attestation;
|
|
72
|
-
|
|
79
|
+
newSeenEffectiveBalance: number;
|
|
80
|
+
newSeenAttesters: number;
|
|
81
|
+
notSeenCommitteeMembers: Set<number>;
|
|
82
|
+
};
|
|
83
|
+
type GetAttestationsGroupResult = {
|
|
84
|
+
result: AttestationNonParticipant[];
|
|
85
|
+
totalAttestations: number;
|
|
73
86
|
};
|
|
74
87
|
/**
|
|
75
88
|
* Maintain a pool of AggregatedAttestation which all share the same AttestationData.
|
|
@@ -78,10 +91,11 @@ type AttestationNonParticipant = {
|
|
|
78
91
|
* Use committee instead of aggregationBits to improve performance.
|
|
79
92
|
*/
|
|
80
93
|
export declare class MatchingDataAttestationGroup {
|
|
94
|
+
private readonly config;
|
|
81
95
|
readonly committee: Uint32Array;
|
|
82
96
|
readonly data: phase0.AttestationData;
|
|
83
97
|
private readonly attestations;
|
|
84
|
-
constructor(committee: Uint32Array, data: phase0.AttestationData);
|
|
98
|
+
constructor(config: ChainForkConfig, committee: Uint32Array, data: phase0.AttestationData);
|
|
85
99
|
getAttestationCount(): number;
|
|
86
100
|
/**
|
|
87
101
|
* Add an attestation.
|
|
@@ -92,10 +106,14 @@ export declare class MatchingDataAttestationGroup {
|
|
|
92
106
|
add(attestation: AttestationWithIndex): InsertOutcome;
|
|
93
107
|
/**
|
|
94
108
|
* Get AttestationNonParticipant for this groups of same attestation data.
|
|
95
|
-
* @param
|
|
109
|
+
* @param notSeenCommitteeMembers not seen committee members, i.e. indices in the same committee (starting from 0 till (committee.size - 1))
|
|
96
110
|
* @returns an array of AttestationNonParticipant
|
|
97
111
|
*/
|
|
98
|
-
getAttestationsForBlock(fork: ForkName,
|
|
112
|
+
getAttestationsForBlock(fork: ForkName, effectiveBalanceIncrements: EffectiveBalanceIncrements, notSeenCommitteeMembers: Set<number>, maxAttestation: number): GetAttestationsGroupResult;
|
|
113
|
+
/**
|
|
114
|
+
* Select the attestation with the highest total effective balance of not seen validators.
|
|
115
|
+
*/
|
|
116
|
+
private getMostValuableAttestation;
|
|
99
117
|
/** Get attestations for API. */
|
|
100
118
|
getAttestations(): Attestation[];
|
|
101
119
|
}
|