@lodestar/beacon-node 1.42.0-dev.b2b4af3e21 → 1.42.0-dev.bc0be71fb0
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/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +11 -11
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +5 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +14 -12
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +4 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +13 -1
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +14 -6
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +33 -2
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/chain.d.ts +3 -2
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +55 -20
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +29 -7
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +12 -3
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +7 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/interface.d.ts +4 -2
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +2 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +184 -5
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/db/buckets.d.ts +2 -2
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -2
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.js +4 -2
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +4 -2
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +20 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +33 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/interface.d.ts +3 -2
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/network.d.ts +3 -2
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +3 -0
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +25 -5
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +242 -66
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +11 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +234 -22
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +3 -3
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +9 -3
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/sync/unknownBlock.js +2 -2
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +3 -3
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +4 -2
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +3 -3
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +10 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +3 -3
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +21 -10
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/dataColumns.d.ts +18 -11
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +51 -17
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +6 -2
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +49 -25
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +25 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +189 -2
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +15 -15
- package/src/api/impl/beacon/blocks/index.ts +17 -14
- package/src/api/impl/debug/index.ts +2 -2
- package/src/chain/ColumnReconstructionTracker.ts +6 -5
- package/src/chain/GetBlobsTracker.ts +14 -12
- package/src/chain/blocks/blockInput/blockInput.ts +8 -8
- package/src/chain/blocks/blockInput/types.ts +4 -4
- package/src/chain/blocks/importBlock.ts +18 -1
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +53 -12
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/chain.ts +63 -24
- package/src/chain/emitter.ts +25 -7
- package/src/chain/errors/dataColumnSidecarError.ts +32 -1
- package/src/chain/interface.ts +4 -2
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +2 -2
- package/src/chain/validation/dataColumnSidecar.ts +230 -7
- package/src/db/buckets.ts +2 -2
- package/src/db/repositories/dataColumnSidecar.ts +4 -2
- package/src/db/repositories/dataColumnSidecarArchive.ts +4 -2
- package/src/metrics/metrics/lodestar.ts +34 -0
- package/src/network/interface.ts +3 -2
- package/src/network/network.ts +7 -4
- package/src/network/processor/extractSlotRootFns.ts +32 -6
- package/src/network/processor/gossipHandlers.ts +305 -79
- package/src/network/processor/index.ts +304 -22
- package/src/network/reqresp/types.ts +13 -5
- package/src/sync/unknownBlock.ts +3 -3
- package/src/sync/utils/downloadByRange.ts +9 -7
- package/src/sync/utils/downloadByRoot.ts +16 -12
- package/src/util/blobs.ts +35 -15
- package/src/util/dataColumns.ts +69 -25
- package/src/util/execution.ts +49 -30
- package/src/util/sszBytes.ts +245 -3
|
@@ -16,8 +16,10 @@ const SLOT_BYTE_SIZE = 8;
|
|
|
16
16
|
*/
|
|
17
17
|
export class DataColumnSidecarArchiveRepository extends PrefixedRepository<Slot, ColumnIndex, DataColumnSidecar> {
|
|
18
18
|
constructor(config: ChainForkConfig, db: Db) {
|
|
19
|
-
const bucket = Bucket.
|
|
20
|
-
|
|
19
|
+
const bucket = Bucket.allForks_dataColumnSidecarsArchive;
|
|
20
|
+
// Type won't be used since we select it dynamically based on fork
|
|
21
|
+
const type = ssz.fulu.DataColumnSidecar;
|
|
22
|
+
super(config, db, bucket, type, getBucketNameByValue(bucket));
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
/**
|
|
@@ -1746,6 +1746,40 @@ export function createLodestarMetrics(
|
|
|
1746
1746
|
}),
|
|
1747
1747
|
},
|
|
1748
1748
|
|
|
1749
|
+
// some gossip messages need to wait for payload to be processed before they can be processed
|
|
1750
|
+
awaitingPayloadGossipMessages: {
|
|
1751
|
+
queue: register.gauge<{topic: GossipType}>({
|
|
1752
|
+
name: "lodestar_awaiting_payload_gossip_messages_total",
|
|
1753
|
+
help: "Total number of gossip messages waiting for payload to be processed",
|
|
1754
|
+
labelNames: ["topic"],
|
|
1755
|
+
}),
|
|
1756
|
+
countPerSlot: register.gauge({
|
|
1757
|
+
name: "lodestar_awaiting_payload_gossip_messages_per_slot_total",
|
|
1758
|
+
help: "Total number of gossip messages waiting for payload to be processed per slot",
|
|
1759
|
+
}),
|
|
1760
|
+
resolve: register.gauge<{topic: GossipType}>({
|
|
1761
|
+
name: "lodestar_awaiting_payload_gossip_messages_resolve_total",
|
|
1762
|
+
help: "Total number of gossip messages are reprocessed",
|
|
1763
|
+
labelNames: ["topic"],
|
|
1764
|
+
}),
|
|
1765
|
+
waitSecBeforeResolve: register.gauge<{topic: GossipType}>({
|
|
1766
|
+
name: "lodestar_awaiting_payload_gossip_messages_wait_time_resolve_seconds",
|
|
1767
|
+
help: "Time to wait for unknown payload in seconds",
|
|
1768
|
+
labelNames: ["topic"],
|
|
1769
|
+
}),
|
|
1770
|
+
// having 2 labels here is not great for performance, however it's rarely happening and having the reason label is important for debugging
|
|
1771
|
+
reject: register.gauge<{reason: ReprocessRejectReason; topic: GossipType}>({
|
|
1772
|
+
name: "lodestar_awaiting_payload_gossip_messages_reject_total",
|
|
1773
|
+
help: "Total number of gossip messages are rejected to reprocess",
|
|
1774
|
+
labelNames: ["reason", "topic"],
|
|
1775
|
+
}),
|
|
1776
|
+
waitSecBeforeReject: register.gauge<{reason: ReprocessRejectReason; topic: GossipType}>({
|
|
1777
|
+
name: "lodestar_awaiting_payload_gossip_messages_wait_time_reject_seconds",
|
|
1778
|
+
help: "Time to wait for unknown payload before being rejected",
|
|
1779
|
+
labelNames: ["reason", "topic"],
|
|
1780
|
+
}),
|
|
1781
|
+
},
|
|
1782
|
+
|
|
1749
1783
|
lightclientServer: {
|
|
1750
1784
|
onSyncAggregate: register.gauge<{event: string}>({
|
|
1751
1785
|
name: "lodestar_lightclient_server_on_sync_aggregate_event_total",
|
package/src/network/interface.ts
CHANGED
|
@@ -74,6 +74,7 @@ export interface INetwork extends INetworkCorePublic {
|
|
|
74
74
|
shouldAggregate(subnet: SubnetID, slot: Slot): boolean;
|
|
75
75
|
reStatusPeers(peers: PeerIdStr[]): Promise<void>;
|
|
76
76
|
searchUnknownBlock(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void;
|
|
77
|
+
searchUnknownEnvelope(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void;
|
|
77
78
|
// ReqResp
|
|
78
79
|
sendBeaconBlocksByRange(peerId: PeerIdStr, request: phase0.BeaconBlocksByRangeRequest): Promise<SignedBeaconBlock[]>;
|
|
79
80
|
sendBeaconBlocksByRoot(peerId: PeerIdStr, request: BeaconBlocksByRootRequest): Promise<SignedBeaconBlock[]>;
|
|
@@ -82,11 +83,11 @@ export interface INetwork extends INetworkCorePublic {
|
|
|
82
83
|
sendDataColumnSidecarsByRange(
|
|
83
84
|
peerId: PeerIdStr,
|
|
84
85
|
request: fulu.DataColumnSidecarsByRangeRequest
|
|
85
|
-
): Promise<
|
|
86
|
+
): Promise<DataColumnSidecar[]>;
|
|
86
87
|
sendDataColumnSidecarsByRoot(
|
|
87
88
|
peerId: PeerIdStr,
|
|
88
89
|
request: DataColumnSidecarsByRootRequest
|
|
89
|
-
): Promise<
|
|
90
|
+
): Promise<DataColumnSidecar[]>;
|
|
90
91
|
sendExecutionPayloadEnvelopesByRange(
|
|
91
92
|
peerId: PeerIdStr,
|
|
92
93
|
request: gloas.ExecutionPayloadEnvelopesByRangeRequest
|
package/src/network/network.ts
CHANGED
|
@@ -11,7 +11,6 @@ import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
|
11
11
|
import {
|
|
12
12
|
AttesterSlashing,
|
|
13
13
|
DataColumnSidecar,
|
|
14
|
-
DataColumnSidecars,
|
|
15
14
|
LightClientBootstrap,
|
|
16
15
|
LightClientFinalityUpdate,
|
|
17
16
|
LightClientOptimisticUpdate,
|
|
@@ -286,6 +285,10 @@ export class Network implements INetwork {
|
|
|
286
285
|
this.networkProcessor.searchUnknownBlock(slotRoot, source, peer);
|
|
287
286
|
}
|
|
288
287
|
|
|
288
|
+
searchUnknownEnvelope(slotRoot: SlotRootHex, source: BlockInputSource, peer?: PeerIdStr): void {
|
|
289
|
+
this.networkProcessor.searchUnknownEnvelope(slotRoot, source, peer);
|
|
290
|
+
}
|
|
291
|
+
|
|
289
292
|
async reportPeer(peer: PeerIdStr, action: PeerAction, actionName: string): Promise<void> {
|
|
290
293
|
return this.core.reportPeer(peer, action, actionName);
|
|
291
294
|
}
|
|
@@ -621,7 +624,7 @@ export class Network implements INetwork {
|
|
|
621
624
|
async sendDataColumnSidecarsByRange(
|
|
622
625
|
peerId: PeerIdStr,
|
|
623
626
|
request: fulu.DataColumnSidecarsByRangeRequest
|
|
624
|
-
): Promise<
|
|
627
|
+
): Promise<DataColumnSidecar[]> {
|
|
625
628
|
return collectMaxResponseTyped(
|
|
626
629
|
this.sendReqRespRequest(peerId, ReqRespMethod.DataColumnSidecarsByRange, [Version.V1], request),
|
|
627
630
|
request.count * request.columns.length,
|
|
@@ -632,7 +635,7 @@ export class Network implements INetwork {
|
|
|
632
635
|
async sendDataColumnSidecarsByRoot(
|
|
633
636
|
peerId: PeerIdStr,
|
|
634
637
|
request: DataColumnSidecarsByRootRequest
|
|
635
|
-
): Promise<
|
|
638
|
+
): Promise<DataColumnSidecar[]> {
|
|
636
639
|
return collectMaxResponseTyped(
|
|
637
640
|
this.sendReqRespRequest(peerId, ReqRespMethod.DataColumnSidecarsByRoot, [Version.V1], request),
|
|
638
641
|
request.reduce((total, {columns}) => total + columns.length, 0),
|
|
@@ -812,7 +815,7 @@ export class Network implements INetwork {
|
|
|
812
815
|
this.core.setTargetGroupCount(count);
|
|
813
816
|
};
|
|
814
817
|
|
|
815
|
-
private onPublishDataColumns = (sidecars:
|
|
818
|
+
private onPublishDataColumns = (sidecars: DataColumnSidecar[]): Promise<number[]> => {
|
|
816
819
|
return promiseAllMaybeAsync(sidecars.map((sidecar) => () => this.publishDataColumnSidecar(sidecar)));
|
|
817
820
|
};
|
|
818
821
|
|
|
@@ -1,23 +1,25 @@
|
|
|
1
|
-
import {ForkName,
|
|
1
|
+
import {ForkName, ForkSeq} from "@lodestar/params";
|
|
2
2
|
import {SlotOptionalRoot, SlotRootHex} from "@lodestar/types";
|
|
3
3
|
import {
|
|
4
4
|
getBeaconBlockRootFromDataColumnSidecarSerialized,
|
|
5
|
-
getBeaconBlockRootFromExecutionPayloadEnvelopeSerialized,
|
|
6
5
|
getBlockRootFromBeaconAttestationSerialized,
|
|
6
|
+
getBlockRootFromPayloadAttestationMessageSerialized,
|
|
7
7
|
getBlockRootFromSignedAggregateAndProofSerialized,
|
|
8
8
|
getSlotFromBeaconAttestationSerialized,
|
|
9
9
|
getSlotFromBlobSidecarSerialized,
|
|
10
10
|
getSlotFromDataColumnSidecarSerialized,
|
|
11
11
|
getSlotFromExecutionPayloadEnvelopeSerialized,
|
|
12
|
+
getSlotFromPayloadAttestationMessageSerialized,
|
|
12
13
|
getSlotFromSignedAggregateAndProofSerialized,
|
|
13
14
|
getSlotFromSignedBeaconBlockSerialized,
|
|
15
|
+
getSlotFromSignedExecutionPayloadBidSerialized,
|
|
14
16
|
} from "../../util/sszBytes.js";
|
|
15
17
|
import {GossipType} from "../gossip/index.js";
|
|
16
18
|
import {ExtractSlotRootFns} from "./types.js";
|
|
17
19
|
|
|
18
20
|
/**
|
|
19
21
|
* Extract the slot and block root of a gossip message form serialized data.
|
|
20
|
-
*
|
|
22
|
+
* Only do it for messages that have a slot and block root, and we want to await the block if the block root is not known.
|
|
21
23
|
*/
|
|
22
24
|
export function createExtractBlockSlotRootFns(): ExtractSlotRootFns {
|
|
23
25
|
return {
|
|
@@ -57,21 +59,45 @@ export function createExtractBlockSlotRootFns(): ExtractSlotRootFns {
|
|
|
57
59
|
},
|
|
58
60
|
[GossipType.data_column_sidecar]: (data: Uint8Array, fork: ForkName): SlotOptionalRoot | null => {
|
|
59
61
|
const slot = getSlotFromDataColumnSidecarSerialized(data, fork);
|
|
62
|
+
|
|
60
63
|
if (slot === null) {
|
|
61
64
|
return null;
|
|
62
65
|
}
|
|
63
66
|
|
|
64
|
-
|
|
67
|
+
if (ForkSeq[fork] < ForkSeq.gloas) {
|
|
68
|
+
return {slot};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const root = getBeaconBlockRootFromDataColumnSidecarSerialized(data);
|
|
72
|
+
// null root means the message is invalid here and will be ignored in gossip handler later
|
|
73
|
+
// returning the slot here helps check the earliest permissable slot in the network processor
|
|
65
74
|
return root !== null ? {slot, root} : {slot};
|
|
66
75
|
},
|
|
67
|
-
[GossipType.execution_payload]: (data: Uint8Array):
|
|
76
|
+
[GossipType.execution_payload]: (data: Uint8Array): SlotOptionalRoot | null => {
|
|
68
77
|
const slot = getSlotFromExecutionPayloadEnvelopeSerialized(data);
|
|
69
|
-
|
|
78
|
+
// Do not extract the root here; the network processor will extract it in the 2nd round to trigger block search without awaiting.
|
|
79
|
+
if (slot === null) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
return {slot};
|
|
83
|
+
},
|
|
84
|
+
[GossipType.payload_attestation_message]: (data: Uint8Array): SlotRootHex | null => {
|
|
85
|
+
const slot = getSlotFromPayloadAttestationMessageSerialized(data);
|
|
86
|
+
const root = getBlockRootFromPayloadAttestationMessageSerialized(data);
|
|
70
87
|
|
|
71
88
|
if (slot === null || root === null) {
|
|
72
89
|
return null;
|
|
73
90
|
}
|
|
74
91
|
return {slot, root};
|
|
75
92
|
},
|
|
93
|
+
[GossipType.execution_payload_bid]: (data: Uint8Array): SlotOptionalRoot | null => {
|
|
94
|
+
const slot = getSlotFromSignedExecutionPayloadBidSerialized(data);
|
|
95
|
+
|
|
96
|
+
if (slot === null) {
|
|
97
|
+
return null;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return {slot};
|
|
101
|
+
},
|
|
76
102
|
};
|
|
77
103
|
}
|