@lodestar/beacon-node 1.31.0-dev.af28220937 → 1.31.0-dev.bde6131d6a
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/config/index.js +5 -0
- package/lib/api/impl/config/index.js.map +1 -1
- package/lib/api/impl/validator/index.js +2 -1
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +4 -2
- package/lib/chain/blocks/blockInput/blockInput.js +28 -12
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/index.d.ts +1 -0
- package/lib/chain/blocks/blockInput/index.js +1 -0
- package/lib/chain/blocks/blockInput/index.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +2 -1
- package/lib/chain/blocks/blockInput/utils.d.ts +9 -0
- package/lib/chain/blocks/blockInput/utils.js +35 -0
- package/lib/chain/blocks/blockInput/utils.js.map +1 -0
- package/lib/chain/blocks/importBlock.d.ts +5 -0
- package/lib/chain/blocks/importBlock.js +27 -2
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/chain.d.ts +2 -0
- package/lib/chain/chain.js +11 -2
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/interface.d.ts +2 -0
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.d.ts +11 -4
- package/lib/chain/opPools/syncContributionAndProofPool.js +50 -8
- package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
- package/lib/chain/opPools/types.d.ts +1 -1
- package/lib/chain/opPools/types.js +1 -1
- package/lib/chain/opPools/types.js.map +1 -1
- package/lib/chain/seenCache/seenAggregateAndProof.d.ts +3 -3
- package/lib/chain/seenCache/seenAggregateAndProof.js +12 -6
- package/lib/chain/seenCache/seenAggregateAndProof.js.map +1 -1
- package/lib/chain/seenCache/seenBlockInput.d.ts +84 -0
- package/lib/chain/seenCache/seenBlockInput.js +225 -0
- package/lib/chain/seenCache/seenBlockInput.js.map +1 -0
- package/lib/chain/validation/aggregateAndProof.js +2 -2
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +32 -1
- package/lib/metrics/metrics/lodestar.js +70 -4
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/processor/gossipHandlers.js +2 -1
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/package.json +15 -15
|
@@ -28,11 +28,14 @@ export class SeenAggregatedAttestations {
|
|
|
28
28
|
* Array of AttestingIndices by same attestation data root by epoch.
|
|
29
29
|
* Note that there are at most TARGET_AGGREGATORS_PER_COMMITTEE (16) per attestation data.
|
|
30
30
|
* */
|
|
31
|
-
this.aggregateRootsByEpoch = new MapDef(() => new MapDef(() => []));
|
|
31
|
+
this.aggregateRootsByEpoch = new MapDef(() => new MapDef(() => new MapDef(() => [])));
|
|
32
32
|
this.lowestPermissibleEpoch = 0;
|
|
33
33
|
}
|
|
34
|
-
isKnown(targetEpoch, attDataRoot, aggregationBits) {
|
|
35
|
-
const seenAggregationInfoArr = this.aggregateRootsByEpoch
|
|
34
|
+
isKnown(targetEpoch, committeeIndex, attDataRoot, aggregationBits) {
|
|
35
|
+
const seenAggregationInfoArr = this.aggregateRootsByEpoch
|
|
36
|
+
.getOrDefault(targetEpoch)
|
|
37
|
+
.getOrDefault(committeeIndex)
|
|
38
|
+
.getOrDefault(attDataRoot);
|
|
36
39
|
this.metrics?.seenCache.aggregatedAttestations.isKnownCalls.inc();
|
|
37
40
|
for (let i = 0; i < seenAggregationInfoArr.length; i++) {
|
|
38
41
|
if (isSuperSetOrEqual(seenAggregationInfoArr[i].aggregationBits, aggregationBits)) {
|
|
@@ -44,12 +47,15 @@ export class SeenAggregatedAttestations {
|
|
|
44
47
|
this.metrics?.seenCache.aggregatedAttestations.superSetCheckTotal.observe(seenAggregationInfoArr.length);
|
|
45
48
|
return false;
|
|
46
49
|
}
|
|
47
|
-
add(targetEpoch, attDataRoot, newItem, checkIsKnown) {
|
|
50
|
+
add(targetEpoch, committeeIndex, attDataRoot, newItem, checkIsKnown) {
|
|
48
51
|
const { aggregationBits } = newItem;
|
|
49
|
-
if (checkIsKnown && this.isKnown(targetEpoch, attDataRoot, aggregationBits)) {
|
|
52
|
+
if (checkIsKnown && this.isKnown(targetEpoch, committeeIndex, attDataRoot, aggregationBits)) {
|
|
50
53
|
return;
|
|
51
54
|
}
|
|
52
|
-
const seenAggregationInfoArr = this.aggregateRootsByEpoch
|
|
55
|
+
const seenAggregationInfoArr = this.aggregateRootsByEpoch
|
|
56
|
+
.getOrDefault(targetEpoch)
|
|
57
|
+
.getOrDefault(committeeIndex)
|
|
58
|
+
.getOrDefault(attDataRoot);
|
|
53
59
|
insertDesc(seenAggregationInfoArr, newItem);
|
|
54
60
|
}
|
|
55
61
|
prune(currentEpoch) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seenAggregateAndProof.js","sourceRoot":"","sources":["../../../src/chain/seenCache/seenAggregateAndProof.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAO/B;;;;;;;;;GASG;AACH,MAAM,OAAO,0BAA0B;
|
|
1
|
+
{"version":3,"file":"seenAggregateAndProof.js","sourceRoot":"","sources":["../../../src/chain/seenCache/seenAggregateAndProof.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAC,iBAAiB,EAAC,MAAM,wBAAwB,CAAC;AAEzD;;;;;;;;;GASG;AACH,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAO/B;;;;;;;;;GASG;AACH,MAAM,OAAO,0BAA0B;IAgBrC,YAA6B,OAAuB;QAAvB,YAAO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BAAsB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ChainForkConfig } from "@lodestar/config";
|
|
2
|
+
import { CheckpointWithHex } from "@lodestar/fork-choice";
|
|
3
|
+
import { RootHex, SignedBeaconBlock, deneb } from "@lodestar/types";
|
|
4
|
+
import { Logger } from "@lodestar/utils";
|
|
5
|
+
import { Metrics } from "../../metrics/metrics.js";
|
|
6
|
+
import { IClock } from "../../util/clock.js";
|
|
7
|
+
import { BlockInputBlobs, IBlockInput, SourceMeta } from "../blocks/blockInput/index.js";
|
|
8
|
+
import { ChainEventEmitter } from "../emitter.js";
|
|
9
|
+
export type SeenBlockInputCacheModules = {
|
|
10
|
+
config: ChainForkConfig;
|
|
11
|
+
clock: IClock;
|
|
12
|
+
chainEvents: ChainEventEmitter;
|
|
13
|
+
signal: AbortSignal;
|
|
14
|
+
metrics: Metrics | null;
|
|
15
|
+
logger?: Logger;
|
|
16
|
+
};
|
|
17
|
+
export type GetByBlobOptions = {
|
|
18
|
+
throwErrorIfAlreadyKnown?: boolean;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Consumers that create BlockInputs or change types of old BlockInputs
|
|
22
|
+
*
|
|
23
|
+
* - gossipHandlers (block and blob)
|
|
24
|
+
* - beaconBlocksMaybeBlobsByRange
|
|
25
|
+
* - unavailableBeaconBlobsByRoot (beaconBlocksMaybeBlobsByRoot)
|
|
26
|
+
* - publishBlock in the beacon/blocks/index.ts API
|
|
27
|
+
* https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/api/impl/beacon/blocks/index.ts#L62
|
|
28
|
+
* - maybeValidateBlobs in verifyBlocksDataAvailability (is_data_available spec function)
|
|
29
|
+
* https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/chain/blocks/verifyBlocksDataAvailability.ts#L111
|
|
30
|
+
*
|
|
31
|
+
*
|
|
32
|
+
* Pruning management for SeenBlockInputCache
|
|
33
|
+
* ------------------------------------------
|
|
34
|
+
* There are four cases for how pruning needs to be handled
|
|
35
|
+
* - Normal operation following head via gossip (and/or reqresp). For this situation the consumer (process pipeline or
|
|
36
|
+
* caller of processBlock) will call the `prune` method to remove any processed BlockInputs from the cache. This will
|
|
37
|
+
* also remove any ancestors of the processed BlockInput as that will also need to have been successfully processed
|
|
38
|
+
* for import to work correctly
|
|
39
|
+
* - onFinalized event handler will help to prune any non-canonical forks once the chain finalizes. Any block-slots that
|
|
40
|
+
* are before the finalized checkpoint will be pruned.
|
|
41
|
+
* - Range-sync periods. The range process uses this cache to store and sync blocks with DA data as the chain is pulled
|
|
42
|
+
* from peers. We pull batches, by epoch, so 32 slots are pulled at a time and several batches are pulled concurrently.
|
|
43
|
+
* It is important to set the MAX_BLOCK_INPUT_CACHE_SIZE high enough to support range sync activities. Currently the
|
|
44
|
+
* value is set for 5 batches of 32 slots. As process block is called (similar to following head) the BlockInput and
|
|
45
|
+
* its ancestors will be pruned.
|
|
46
|
+
* - Non-Finality times. This is a bit more tricky. There can be long periods of non-finality and storing everything
|
|
47
|
+
* will cause OOM. The pruneToMax will help ensure a hard limit on the number of stored blocks (with DA) that are held
|
|
48
|
+
* in memory at any one time. The value for MAX_BLOCK_INPUT_CACHE_SIZE is set to accommodate range-sync but in
|
|
49
|
+
* practice this value may need to be massaged in the future if we find issues when debugging non-finality
|
|
50
|
+
*/
|
|
51
|
+
export declare class SeenBlockInputCache {
|
|
52
|
+
private readonly config;
|
|
53
|
+
private readonly clock;
|
|
54
|
+
private readonly chainEvents;
|
|
55
|
+
private readonly signal;
|
|
56
|
+
private readonly metrics;
|
|
57
|
+
private readonly logger?;
|
|
58
|
+
private blockInputs;
|
|
59
|
+
constructor({ config, clock, chainEvents, signal, metrics, logger }: SeenBlockInputCacheModules);
|
|
60
|
+
has(rootHex: RootHex): boolean;
|
|
61
|
+
get(rootHex: RootHex): IBlockInput | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* Removes the single BlockInput from the cache
|
|
64
|
+
*/
|
|
65
|
+
remove(rootHex: RootHex): void;
|
|
66
|
+
/**
|
|
67
|
+
* Removes a processed BlockInput from the cache and also removes any ancestors of processed blocks
|
|
68
|
+
*/
|
|
69
|
+
prune(rootHex: RootHex): void;
|
|
70
|
+
onFinalized: (checkpoint: CheckpointWithHex) => void;
|
|
71
|
+
getByBlock({ block, source, seenTimestampSec, peerIdStr }: SourceMeta & {
|
|
72
|
+
block: SignedBeaconBlock;
|
|
73
|
+
}): IBlockInput;
|
|
74
|
+
getByBlob({ blobSidecar, source, seenTimestampSec, peerIdStr }: SourceMeta & {
|
|
75
|
+
blobSidecar: deneb.BlobSidecar;
|
|
76
|
+
}, opts?: GetByBlobOptions): BlockInputBlobs;
|
|
77
|
+
private buildCommonProps;
|
|
78
|
+
/**
|
|
79
|
+
* Use custom implementation of pruneSetToMax to allow for sorting by slot
|
|
80
|
+
* and deleting via key/rootHex
|
|
81
|
+
*/
|
|
82
|
+
private pruneToMaxSize;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=seenBlockInput.d.ts.map
|
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
import { isForkPostDeneb } from "@lodestar/params";
|
|
2
|
+
import { computeStartSlotAtEpoch } from "@lodestar/state-transition";
|
|
3
|
+
import { LodestarError, toRootHex } from "@lodestar/utils";
|
|
4
|
+
import { BlockInputBlobs, BlockInputPreData, DAType, isBlockInputBlobs, isDaOutOfRange, } from "../blocks/blockInput/index.js";
|
|
5
|
+
import { ChainEvent } from "../emitter.js";
|
|
6
|
+
const MAX_BLOCK_INPUT_CACHE_SIZE = 5;
|
|
7
|
+
/**
|
|
8
|
+
* Consumers that create BlockInputs or change types of old BlockInputs
|
|
9
|
+
*
|
|
10
|
+
* - gossipHandlers (block and blob)
|
|
11
|
+
* - beaconBlocksMaybeBlobsByRange
|
|
12
|
+
* - unavailableBeaconBlobsByRoot (beaconBlocksMaybeBlobsByRoot)
|
|
13
|
+
* - publishBlock in the beacon/blocks/index.ts API
|
|
14
|
+
* https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/api/impl/beacon/blocks/index.ts#L62
|
|
15
|
+
* - maybeValidateBlobs in verifyBlocksDataAvailability (is_data_available spec function)
|
|
16
|
+
* https://github.com/ChainSafe/lodestar/blob/unstable/packages/beacon-node/src/chain/blocks/verifyBlocksDataAvailability.ts#L111
|
|
17
|
+
*
|
|
18
|
+
*
|
|
19
|
+
* Pruning management for SeenBlockInputCache
|
|
20
|
+
* ------------------------------------------
|
|
21
|
+
* There are four cases for how pruning needs to be handled
|
|
22
|
+
* - Normal operation following head via gossip (and/or reqresp). For this situation the consumer (process pipeline or
|
|
23
|
+
* caller of processBlock) will call the `prune` method to remove any processed BlockInputs from the cache. This will
|
|
24
|
+
* also remove any ancestors of the processed BlockInput as that will also need to have been successfully processed
|
|
25
|
+
* for import to work correctly
|
|
26
|
+
* - onFinalized event handler will help to prune any non-canonical forks once the chain finalizes. Any block-slots that
|
|
27
|
+
* are before the finalized checkpoint will be pruned.
|
|
28
|
+
* - Range-sync periods. The range process uses this cache to store and sync blocks with DA data as the chain is pulled
|
|
29
|
+
* from peers. We pull batches, by epoch, so 32 slots are pulled at a time and several batches are pulled concurrently.
|
|
30
|
+
* It is important to set the MAX_BLOCK_INPUT_CACHE_SIZE high enough to support range sync activities. Currently the
|
|
31
|
+
* value is set for 5 batches of 32 slots. As process block is called (similar to following head) the BlockInput and
|
|
32
|
+
* its ancestors will be pruned.
|
|
33
|
+
* - Non-Finality times. This is a bit more tricky. There can be long periods of non-finality and storing everything
|
|
34
|
+
* will cause OOM. The pruneToMax will help ensure a hard limit on the number of stored blocks (with DA) that are held
|
|
35
|
+
* in memory at any one time. The value for MAX_BLOCK_INPUT_CACHE_SIZE is set to accommodate range-sync but in
|
|
36
|
+
* practice this value may need to be massaged in the future if we find issues when debugging non-finality
|
|
37
|
+
*/
|
|
38
|
+
export class SeenBlockInputCache {
|
|
39
|
+
constructor({ config, clock, chainEvents, signal, metrics, logger }) {
|
|
40
|
+
this.blockInputs = new Map();
|
|
41
|
+
this.onFinalized = (checkpoint) => {
|
|
42
|
+
const cutoffSlot = computeStartSlotAtEpoch(checkpoint.epoch);
|
|
43
|
+
for (const [rootHex, blockInput] of this.blockInputs) {
|
|
44
|
+
if (blockInput.slot < cutoffSlot) {
|
|
45
|
+
this.blockInputs.delete(rootHex);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
this.pruneToMaxSize();
|
|
49
|
+
};
|
|
50
|
+
this.config = config;
|
|
51
|
+
this.clock = clock;
|
|
52
|
+
this.chainEvents = chainEvents;
|
|
53
|
+
this.signal = signal;
|
|
54
|
+
this.metrics = metrics;
|
|
55
|
+
this.logger = logger;
|
|
56
|
+
if (metrics) {
|
|
57
|
+
metrics.seenCache.blockInput.blockInputCount.addCollect(() => metrics.seenCache.blockInput.blockInputCount.set(this.blockInputs.size));
|
|
58
|
+
}
|
|
59
|
+
this.chainEvents.on(ChainEvent.forkChoiceFinalized, this.onFinalized);
|
|
60
|
+
this.signal.addEventListener("abort", () => {
|
|
61
|
+
this.chainEvents.off(ChainEvent.forkChoiceFinalized, this.onFinalized);
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
has(rootHex) {
|
|
65
|
+
return this.blockInputs.has(rootHex);
|
|
66
|
+
}
|
|
67
|
+
get(rootHex) {
|
|
68
|
+
return this.blockInputs.get(rootHex);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Removes the single BlockInput from the cache
|
|
72
|
+
*/
|
|
73
|
+
remove(rootHex) {
|
|
74
|
+
this.blockInputs.delete(rootHex);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Removes a processed BlockInput from the cache and also removes any ancestors of processed blocks
|
|
78
|
+
*/
|
|
79
|
+
prune(rootHex) {
|
|
80
|
+
let blockInput = this.blockInputs.get(rootHex);
|
|
81
|
+
let parentRootHex = blockInput?.parentRootHex;
|
|
82
|
+
while (blockInput) {
|
|
83
|
+
this.blockInputs.delete(blockInput.blockRootHex);
|
|
84
|
+
blockInput = this.blockInputs.get(parentRootHex ?? "");
|
|
85
|
+
parentRootHex = blockInput?.parentRootHex;
|
|
86
|
+
}
|
|
87
|
+
this.pruneToMaxSize();
|
|
88
|
+
}
|
|
89
|
+
getByBlock({ block, source, seenTimestampSec, peerIdStr }) {
|
|
90
|
+
const blockRoot = this.config.getForkTypes(block.message.slot).BeaconBlock.hashTreeRoot(block.message);
|
|
91
|
+
const blockRootHex = toRootHex(blockRoot);
|
|
92
|
+
// TODO(peerDAS): Why is it necessary to static cast this here. All conditional paths result in a valid value so should be defined correctly below
|
|
93
|
+
let blockInput = this.blockInputs.get(blockRootHex);
|
|
94
|
+
if (!blockInput) {
|
|
95
|
+
const { forkName, daOutOfRange } = this.buildCommonProps(block.message.slot);
|
|
96
|
+
if (!isForkPostDeneb(forkName)) {
|
|
97
|
+
blockInput = BlockInputPreData.createFromBlock({
|
|
98
|
+
block,
|
|
99
|
+
blockRootHex,
|
|
100
|
+
daOutOfRange,
|
|
101
|
+
forkName,
|
|
102
|
+
source: {
|
|
103
|
+
source,
|
|
104
|
+
seenTimestampSec,
|
|
105
|
+
peerIdStr,
|
|
106
|
+
},
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
// else if (isForkPostFulu(forkName)) {
|
|
110
|
+
// blockInput = new BlockInputColumns.createFromBlock({
|
|
111
|
+
// block,
|
|
112
|
+
// blockRootHex,
|
|
113
|
+
// daOutOfRange,
|
|
114
|
+
// forkName,
|
|
115
|
+
// custodyColumns: this.custodyConfig.custodyColumns,
|
|
116
|
+
// sampledColumns: this.custodyConfig.sampledColumns,
|
|
117
|
+
// source: {
|
|
118
|
+
// source,
|
|
119
|
+
// seenTimestampSec,
|
|
120
|
+
// peerIdStr
|
|
121
|
+
// }
|
|
122
|
+
// })
|
|
123
|
+
// }
|
|
124
|
+
else {
|
|
125
|
+
blockInput = BlockInputBlobs.createFromBlock({
|
|
126
|
+
block: block,
|
|
127
|
+
blockRootHex,
|
|
128
|
+
daOutOfRange,
|
|
129
|
+
forkName,
|
|
130
|
+
source: {
|
|
131
|
+
source,
|
|
132
|
+
seenTimestampSec,
|
|
133
|
+
peerIdStr,
|
|
134
|
+
},
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
this.blockInputs.set(blockInput.blockRootHex, blockInput);
|
|
138
|
+
}
|
|
139
|
+
if (!blockInput.hasBlock()) {
|
|
140
|
+
blockInput.addBlock({ block, blockRootHex, source: { source, seenTimestampSec, peerIdStr } });
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
this.logger?.debug("Attempt to cache block but is already cached on BlockInput", blockInput.getLogMeta());
|
|
144
|
+
this.metrics?.seenCache.blockInput.duplicateBlockCount.inc({ source });
|
|
145
|
+
}
|
|
146
|
+
return blockInput;
|
|
147
|
+
}
|
|
148
|
+
getByBlob({ blobSidecar, source, seenTimestampSec, peerIdStr }, opts = {}) {
|
|
149
|
+
const blockRoot = this.config
|
|
150
|
+
.getForkTypes(blobSidecar.signedBlockHeader.message.slot)
|
|
151
|
+
.BeaconBlockHeader.hashTreeRoot(blobSidecar.signedBlockHeader.message);
|
|
152
|
+
const blockRootHex = toRootHex(blockRoot);
|
|
153
|
+
// TODO(peerDAS): Why is it necessary to static cast this here. All conditional paths result in a valid value so should be defined correctly below
|
|
154
|
+
let blockInput = this.blockInputs.get(blockRootHex);
|
|
155
|
+
let created = false;
|
|
156
|
+
if (!blockInput) {
|
|
157
|
+
created = true;
|
|
158
|
+
const { forkName, daOutOfRange } = this.buildCommonProps(blobSidecar.signedBlockHeader.message.slot);
|
|
159
|
+
blockInput = BlockInputBlobs.createFromBlob({
|
|
160
|
+
blobSidecar,
|
|
161
|
+
blockRootHex,
|
|
162
|
+
daOutOfRange,
|
|
163
|
+
forkName,
|
|
164
|
+
source,
|
|
165
|
+
seenTimestampSec,
|
|
166
|
+
peerIdStr,
|
|
167
|
+
});
|
|
168
|
+
this.metrics?.seenCache.blockInput.createdByBlob.inc();
|
|
169
|
+
this.blockInputs.set(blockRootHex, blockInput);
|
|
170
|
+
}
|
|
171
|
+
if (!isBlockInputBlobs(blockInput)) {
|
|
172
|
+
throw new SeenBlockInputCacheError({
|
|
173
|
+
code: SeenBlockInputCacheErrorCode.WRONG_BLOCK_INPUT_TYPE,
|
|
174
|
+
cachedType: blockInput.type,
|
|
175
|
+
requestedType: DAType.Blobs,
|
|
176
|
+
...blockInput.getLogMeta(),
|
|
177
|
+
}, `BlockInputType mismatch adding blobIndex=${blobSidecar.index}`);
|
|
178
|
+
}
|
|
179
|
+
if (!blockInput.hasBlob(blobSidecar.index)) {
|
|
180
|
+
blockInput.addBlob({ blobSidecar, blockRootHex, source, seenTimestampSec, peerIdStr });
|
|
181
|
+
}
|
|
182
|
+
else if (!created) {
|
|
183
|
+
this.logger?.debug(`Attempt to cache blob index #${blobSidecar.index} but is already cached on BlockInput`, blockInput.getLogMeta());
|
|
184
|
+
this.metrics?.seenCache.blockInput.duplicateBlobCount.inc({ source });
|
|
185
|
+
if (opts.throwErrorIfAlreadyKnown) {
|
|
186
|
+
throw new SeenBlockInputCacheError({
|
|
187
|
+
code: SeenBlockInputCacheErrorCode.GOSSIP_BLOB_ALREADY_KNOWN,
|
|
188
|
+
...blockInput.getLogMeta(),
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return blockInput;
|
|
193
|
+
}
|
|
194
|
+
buildCommonProps(slot) {
|
|
195
|
+
const forkName = this.config.getForkName(slot);
|
|
196
|
+
return {
|
|
197
|
+
forkName,
|
|
198
|
+
daOutOfRange: isDaOutOfRange(this.config, forkName, slot, this.clock.currentEpoch),
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Use custom implementation of pruneSetToMax to allow for sorting by slot
|
|
203
|
+
* and deleting via key/rootHex
|
|
204
|
+
*/
|
|
205
|
+
pruneToMaxSize() {
|
|
206
|
+
let itemsToDelete = this.blockInputs.size - MAX_BLOCK_INPUT_CACHE_SIZE;
|
|
207
|
+
if (itemsToDelete > 0) {
|
|
208
|
+
const sorted = [...this.blockInputs.entries()].sort((a, b) => b[1].slot - a[1].slot);
|
|
209
|
+
for (const [rootHex] of sorted) {
|
|
210
|
+
this.blockInputs.delete(rootHex);
|
|
211
|
+
itemsToDelete--;
|
|
212
|
+
if (itemsToDelete <= 0)
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
var SeenBlockInputCacheErrorCode;
|
|
219
|
+
(function (SeenBlockInputCacheErrorCode) {
|
|
220
|
+
SeenBlockInputCacheErrorCode["WRONG_BLOCK_INPUT_TYPE"] = "BLOCK_INPUT_CACHE_ERROR_WRONG_BLOCK_INPUT_TYPE";
|
|
221
|
+
SeenBlockInputCacheErrorCode["GOSSIP_BLOB_ALREADY_KNOWN"] = "BLOCK_INPUT_CACHE_ERROR_GOSSIP_BLOB_ALREADY_KNOWN";
|
|
222
|
+
})(SeenBlockInputCacheErrorCode || (SeenBlockInputCacheErrorCode = {}));
|
|
223
|
+
class SeenBlockInputCacheError extends LodestarError {
|
|
224
|
+
}
|
|
225
|
+
//# sourceMappingURL=seenBlockInput.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"seenBlockInput.js","sourceRoot":"","sources":["../../../src/chain/seenCache/seenBlockInput.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAC,uBAAuB,EAAC,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAC,aAAa,EAAU,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAGjE,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,MAAM,EAMN,iBAAiB,EACjB,cAAc,GACf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAC,UAAU,EAAoB,MAA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AAI,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC;SACnF,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,cAAc;QACpB,IAAI,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,GAAG,0BAA0B,CAAC;QAEvE,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;YACtB,MAAM,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YACrF,KAAK,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,EAAE,CAAC;gBAC/B,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;gBACjC,aAAa,EAAE,CAAC;gBAChB,IAAI,aAAa,IAAI,CAAC;oBAAE,OAAO;YACjC,CAAC;QACH,CAAC;IACH,CAAC;CACF;AAED,IAAK,4BAGJ;AAHD,WAAK,4BAA4B;IAC/B,yGAAyE,CAAA;IACzE,+GAA+E,CAAA;AACjF,CAAC,EAHI,4BAA4B,KAA5B,4BAA4B,QAGhC;AAYD,MAAM,wBAAyB,SAAQ,aAA2C;CAAG"}
|
|
@@ -88,7 +88,7 @@ async function validateAggregateAndProof(fork, chain, signedAggregateAndProof, s
|
|
|
88
88
|
? cachedAttData.attDataRootHex
|
|
89
89
|
: toRootHex(ssz.phase0.AttestationData.hashTreeRoot(attData));
|
|
90
90
|
if (!skipValidationKnownAttesters &&
|
|
91
|
-
chain.seenAggregatedAttestations.isKnown(targetEpoch, attDataRootHex, aggregationBits)) {
|
|
91
|
+
chain.seenAggregatedAttestations.isKnown(targetEpoch, attIndex, attDataRootHex, aggregationBits)) {
|
|
92
92
|
throw new AttestationError(GossipAction.IGNORE, {
|
|
93
93
|
code: AttestationErrorCode.ATTESTERS_ALREADY_KNOWN,
|
|
94
94
|
targetEpoch,
|
|
@@ -166,7 +166,7 @@ async function validateAggregateAndProof(fork, chain, signedAggregateAndProof, s
|
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
chain.seenAggregators.add(targetEpoch, aggregatorIndex);
|
|
169
|
-
chain.seenAggregatedAttestations.add(targetEpoch, attDataRootHex, { aggregationBits, trueBitCount: attestingIndices.length }, false);
|
|
169
|
+
chain.seenAggregatedAttestations.add(targetEpoch, attIndex, attDataRootHex, { aggregationBits, trueBitCount: attestingIndices.length }, false);
|
|
170
170
|
return { indexedAttestation, committeeIndices, attDataRootHex };
|
|
171
171
|
}
|
|
172
172
|
//# sourceMappingURL=aggregateAndProof.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aggregateAndProof.js","sourceRoot":"","sources":["../../../src/chain/validation/aggregateAndProof.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,yCAAyC,EACzC,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAgE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAExF,OAAO,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EACL,6BAA6B,EAC7B,mBAAmB,EACnB,4CAA4C,EAC5C,sCAAsC,EACtC,4BAA4B,EAC5B,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,gCAAgC,EAAE,6BAA6B,EAAC,MAAM,0BAA0B,CAAC;AAQzG,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,IAAc,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0GAA0G;QAC1G,iFAAiF;QACjF,cAAc;QACd,oIAAoI;QACpI,gDAAgD;QAChD,mFAAmF;QACnF,sFAAsF;QACtF,wDAAwD;QACxD,gHAAgH;QAChH,0BAA0B,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;IAED,uFAAuF;IACvF,wFAAwF;IACxF,MAAM,eAAe,GAAG,iBAAiB,CAAC,eAAe,CAAC;IAC1D,IAAI,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,gBAAgB,CAAC,YAAY,CAAC,MAAM,EAAE;YAC9C,IAAI,EAAE,oBAAoB,CAAC,wBAAwB;YACnD,WAAW;YACX,eAAe;SAChB,CAAC,CAAC;IACL,CAAC;IAED,gHAAgH;IAChH,wDAAwD;IACxD,MAAM,cAAc,GAAG,aAAa;QAClC,CAAC,CAAC,aAAa,CAAC,cAAc;QAC9B,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,MAAM,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;IAChE,IACE,CAAC,4BAA4B;QAC7B,KAAK,CAAC,0BAA0B,CAAC,OAAO,CAAC,WAAW,EAAE,cAAc,EAAE,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"aggregateAndProof.js","sourceRoot":"","sources":["../../../src/chain/validation/aggregateAndProof.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,OAAO,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EACL,kBAAkB,EAClB,yCAAyC,EACzC,+BAA+B,GAChC,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAgE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACnG,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EAAC,gBAAgB,EAAE,oBAAoB,EAAE,YAAY,EAAC,MAAM,oBAAoB,CAAC;AAExF,O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K,CAAC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,uBAAuB,CAAC;QAC7F,8BAA8B;KAC/B,CAAC;IACF,2CAA2C;IAE3C,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,GAAG,CAAC,mBAAmB,CAAC,aAAa,EAAE,EAAC,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,aAAa,EAAC,CAAC,CAAC,EAAE,CAAC;QACtG,MAAM,IAAI,gBAAgB,CAAC,YAAY,CAAC,MAAM,EAAE,EAAC,IAAI,EAAE,oBAAoB,CAAC,iBAAiB,EAAC,CAAC,CAAC;IAClG,CAAC;IAED,wFAAwF;IACxF,oFAAoF;IACpF,qCAAqC;IACrC,IAAI,KAAK,CAAC,eAAe,CAAC,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,gBAAgB,CAAC,YAAY,CAAC,MAAM,EAAE;YAC9C,IAAI,EAAE,oBAAoB,CAAC,wBAAwB;YACnD,WAAW;YACX,eAAe;SAChB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,GAAG,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;IACxD,KAAK,CAAC,0BAA0B,CAAC,GAAG,CAClC,WAAW,EACX,QAAQ,EACR,cAAc,EACd,EAAC,eAAe,EAAE,YAAY,EAAE,gBAAgB,CAAC,MAAM,EAAC,EACxD,KAAK,CACN,CAAC;IAEF,OAAO,EAAC,kBAAkB,EAAE,gBAAgB,EAAE,cAAc,EAAC,CAAC;AAChE,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockInputSource } from "../../chain/blocks/blockInput/index.js";
|
|
1
2
|
import { BlobsSource, BlockSource } from "../../chain/blocks/types.js";
|
|
2
3
|
import { JobQueueItemType } from "../../chain/bls/index.js";
|
|
3
4
|
import { AttestationErrorCode, BlockErrorCode } from "../../chain/errors/index.js";
|
|
@@ -366,7 +367,26 @@ export declare function createLodestarMetrics(register: RegistryMetricCreator, m
|
|
|
366
367
|
syncCommitteeMessagePoolInsertOutcome: import("@lodestar/utils").Counter<{
|
|
367
368
|
insertOutcome: InsertOutcome;
|
|
368
369
|
}>;
|
|
369
|
-
|
|
370
|
+
syncContributionAndProofPool: {
|
|
371
|
+
size: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
372
|
+
gossipInsertOutcome: import("@lodestar/utils").Counter<{
|
|
373
|
+
insertOutcome: InsertOutcome;
|
|
374
|
+
}>;
|
|
375
|
+
apiInsertOutcome: import("@lodestar/utils").Counter<{
|
|
376
|
+
insertOutcome: InsertOutcome;
|
|
377
|
+
}>;
|
|
378
|
+
blockRootsPerSlot: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
379
|
+
subnetsByBlockRoot: import("@lodestar/utils").GaugeExtra<{
|
|
380
|
+
index: number;
|
|
381
|
+
}>;
|
|
382
|
+
participantsByBlockRoot: import("@lodestar/utils").GaugeExtra<{
|
|
383
|
+
index: number;
|
|
384
|
+
}>;
|
|
385
|
+
getAggregateRoots: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
386
|
+
getAggregateSubnets: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
387
|
+
getAggregateParticipants: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
388
|
+
getAggregateReturnsEmpty: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
389
|
+
};
|
|
370
390
|
};
|
|
371
391
|
chain: {
|
|
372
392
|
blacklistedBlocks: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
@@ -457,6 +477,17 @@ export declare function createLodestarMetrics(register: RegistryMetricCreator, m
|
|
|
457
477
|
reason: RejectReason;
|
|
458
478
|
}>;
|
|
459
479
|
};
|
|
480
|
+
blockInput: {
|
|
481
|
+
blockInputCount: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
482
|
+
duplicateBlockCount: import("@lodestar/utils").GaugeExtra<{
|
|
483
|
+
source: BlockInputSource;
|
|
484
|
+
}>;
|
|
485
|
+
duplicateBlobCount: import("@lodestar/utils").GaugeExtra<{
|
|
486
|
+
source: BlockInputSource;
|
|
487
|
+
}>;
|
|
488
|
+
createdByBlock: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
489
|
+
createdByBlob: import("@lodestar/utils").GaugeExtra<import("@lodestar/utils").NoLabels>;
|
|
490
|
+
};
|
|
460
491
|
};
|
|
461
492
|
regenFnCallTotal: import("@lodestar/utils").GaugeExtra<{
|
|
462
493
|
entrypoint: RegenFnName;
|
|
@@ -867,10 +867,52 @@ export function createLodestarMetrics(register, metadata, genesisTime) {
|
|
|
867
867
|
help: "Total number of InsertOutcome as a result of adding a SyncCommitteeMessage to pool",
|
|
868
868
|
labelNames: ["insertOutcome"],
|
|
869
869
|
}),
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
870
|
+
syncContributionAndProofPool: {
|
|
871
|
+
size: register.gauge({
|
|
872
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_size",
|
|
873
|
+
help: "Current size of the SyncContributionAndProofPool unique by slot subnet and block root",
|
|
874
|
+
}),
|
|
875
|
+
gossipInsertOutcome: register.counter({
|
|
876
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_gossip_insert_outcome_total",
|
|
877
|
+
help: "Total number of InsertOutcome as a result of adding a ContributionAndProof from gossip into the pool",
|
|
878
|
+
labelNames: ["insertOutcome"],
|
|
879
|
+
}),
|
|
880
|
+
apiInsertOutcome: register.counter({
|
|
881
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_api_insert_outcome_total",
|
|
882
|
+
help: "Total number of InsertOutcome as a result of adding a ContributionAndProof from api into the pool",
|
|
883
|
+
labelNames: ["insertOutcome"],
|
|
884
|
+
}),
|
|
885
|
+
blockRootsPerSlot: register.gauge({
|
|
886
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_block_roots_per_slot_total",
|
|
887
|
+
help: "Total number of block roots per slot in SyncContributionAndProofPool",
|
|
888
|
+
}),
|
|
889
|
+
subnetsByBlockRoot: register.gauge({
|
|
890
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_subnets_by_block_root_total",
|
|
891
|
+
help: "Total number of subnets per block root in SyncContributionAndProofPool",
|
|
892
|
+
labelNames: ["index"],
|
|
893
|
+
}),
|
|
894
|
+
participantsByBlockRoot: register.gauge({
|
|
895
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_participants_by_block_root_total",
|
|
896
|
+
help: "Total number of participants per block root in SyncContributionAndProofPool",
|
|
897
|
+
labelNames: ["index"],
|
|
898
|
+
}),
|
|
899
|
+
getAggregateRoots: register.gauge({
|
|
900
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_get_aggregate_roots_total",
|
|
901
|
+
help: "Total number of block roots in SyncContributionAndProofPool.getAggregate(slot)",
|
|
902
|
+
}),
|
|
903
|
+
getAggregateSubnets: register.gauge({
|
|
904
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_get_aggregate_subnets_total",
|
|
905
|
+
help: "Total number of subnets in SyncContributionAndProofPool.getAggregate(slot, root)",
|
|
906
|
+
}),
|
|
907
|
+
getAggregateParticipants: register.gauge({
|
|
908
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_get_aggregate_participants_total",
|
|
909
|
+
help: "Total number of participants in SyncContributionAndProofPool.getAggregate(slot, root)",
|
|
910
|
+
}),
|
|
911
|
+
getAggregateReturnsEmpty: register.gauge({
|
|
912
|
+
name: "lodestar_oppool_sync_contribution_and_proof_pool_get_aggregate_returns_empty_total",
|
|
913
|
+
help: "Total number of empty returns in SyncContributionAndProofPool.getAggregate(slot, root)",
|
|
914
|
+
}),
|
|
915
|
+
},
|
|
874
916
|
},
|
|
875
917
|
chain: {
|
|
876
918
|
blacklistedBlocks: register.gauge({
|
|
@@ -1137,6 +1179,30 @@ export function createLodestarMetrics(register, metadata, genesisTime) {
|
|
|
1137
1179
|
labelNames: ["reason"],
|
|
1138
1180
|
}),
|
|
1139
1181
|
},
|
|
1182
|
+
blockInput: {
|
|
1183
|
+
blockInputCount: register.gauge({
|
|
1184
|
+
name: "lodestar_seen_block_input_cache_size",
|
|
1185
|
+
help: "Number of cached BlockInputs",
|
|
1186
|
+
}),
|
|
1187
|
+
duplicateBlockCount: register.gauge({
|
|
1188
|
+
name: "lodestar_seen_block_input_cache_duplicate_block_count",
|
|
1189
|
+
help: "Total number of duplicate blocks that pass validation and attempt to be cached but are known",
|
|
1190
|
+
labelNames: ["source"],
|
|
1191
|
+
}),
|
|
1192
|
+
duplicateBlobCount: register.gauge({
|
|
1193
|
+
name: "lodestar_seen_block_input_cache_duplicate_blob_count",
|
|
1194
|
+
help: "Total number of duplicate blobs that pass validation and attempt to be cached but are known",
|
|
1195
|
+
labelNames: ["source"],
|
|
1196
|
+
}),
|
|
1197
|
+
createdByBlock: register.gauge({
|
|
1198
|
+
name: "lodestar_seen_block_input_cache_items_created_by_block",
|
|
1199
|
+
help: "Number of BlockInputs created via a block being seen first",
|
|
1200
|
+
}),
|
|
1201
|
+
createdByBlob: register.gauge({
|
|
1202
|
+
name: "lodestar_seen_block_input_cache_items_created_by_blob",
|
|
1203
|
+
help: "Number of BlockInputs created via a blob being seen first",
|
|
1204
|
+
}),
|
|
1205
|
+
},
|
|
1140
1206
|
},
|
|
1141
1207
|
regenFnCallTotal: register.gauge({
|
|
1142
1208
|
name: "lodestar_regen_fn_call_total",
|