@lodestar/beacon-node 1.52.0-dev.b59a889970 → 1.52.0-dev.b9e2dc8d93
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/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +2 -4
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +6 -1
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +7 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +17 -2
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +21 -5
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/execution/engine/blockHash.d.ts +12 -0
- package/lib/execution/engine/blockHash.d.ts.map +1 -0
- package/lib/execution/engine/blockHash.js +17 -0
- package/lib/execution/engine/blockHash.js.map +1 -0
- package/lib/execution/engine/http.d.ts +2 -2
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +13 -7
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +16 -3
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js +11 -0
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.d.ts +2 -0
- package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.js +14 -6
- package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +2 -2
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +4 -4
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +6 -6
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/restHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/restHttpClient.js +9 -5
- package/lib/execution/engine/restHttpClient.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +2 -2
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +4 -4
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/signal.d.ts +6 -0
- package/lib/execution/engine/signal.d.ts.map +1 -0
- package/lib/execution/engine/signal.js +24 -0
- package/lib/execution/engine/signal.js.map +1 -0
- package/lib/execution/engine/transport.d.ts +2 -2
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +1 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +5 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +10 -1
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/sync/types.d.ts +2 -0
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +60 -19
- package/lib/sync/unknownBlock.js.map +1 -1
- package/package.json +17 -17
- package/src/api/impl/validator/index.ts +2 -4
- package/src/chain/errors/executionPayloadBid.ts +6 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +8 -0
- package/src/chain/validation/executionPayloadBid.ts +20 -2
- package/src/chain/validation/executionPayloadEnvelope.ts +28 -5
- package/src/execution/engine/blockHash.ts +27 -0
- package/src/execution/engine/http.ts +18 -10
- package/src/execution/engine/interface.ts +18 -3
- package/src/execution/engine/jsonRpcHttpClient.ts +26 -14
- package/src/execution/engine/jsonRpcTransport.ts +8 -4
- package/src/execution/engine/mock.ts +13 -8
- package/src/execution/engine/restHttpClient.ts +17 -11
- package/src/execution/engine/restTransport.ts +5 -4
- package/src/execution/engine/signal.ts +28 -0
- package/src/execution/engine/transport.ts +3 -2
- package/src/index.ts +6 -1
- package/src/metrics/metrics/lodestar.ts +5 -0
- package/src/network/peers/peerManager.ts +14 -1
- package/src/sync/types.ts +2 -0
- package/src/sync/unknownBlock.ts +65 -21
|
@@ -241,7 +241,8 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
241
241
|
headBlockHash: RootHex,
|
|
242
242
|
safeBlockHash: RootHex,
|
|
243
243
|
finalizedBlockHash: RootHex,
|
|
244
|
-
payloadAttributes?: PayloadAttributes
|
|
244
|
+
payloadAttributes?: PayloadAttributes,
|
|
245
|
+
signal?: AbortSignal
|
|
245
246
|
): Promise<ForkchoiceUpdatedResult> {
|
|
246
247
|
const forkchoiceState = {
|
|
247
248
|
headBlockHash: fromHex(headBlockHash),
|
|
@@ -279,7 +280,7 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
279
280
|
|
|
280
281
|
const res = await this.client.request(
|
|
281
282
|
{method: "POST", path: "/forkchoice", executionFork: toExecutionForkName(fork), body, responseType: "ssz"},
|
|
282
|
-
fcUReqOpts
|
|
283
|
+
{...fcUReqOpts, signal}
|
|
283
284
|
);
|
|
284
285
|
const {payloadStatus, payloadId} = deserializeResponse(
|
|
285
286
|
ForkchoiceUpdateResponse,
|
|
@@ -293,14 +294,14 @@ export class RestEngineTransport implements IEngineTransport {
|
|
|
293
294
|
};
|
|
294
295
|
}
|
|
295
296
|
|
|
296
|
-
async getPayload(fork: ForkName, payloadId: PayloadId): Promise<GetPayloadResult> {
|
|
297
|
+
async getPayload(fork: ForkName, payloadId: PayloadId, signal?: AbortSignal): Promise<GetPayloadResult> {
|
|
297
298
|
if (!PAYLOAD_ID_REGEX.test(payloadId)) {
|
|
298
299
|
throw Error(`Invalid payloadId=${payloadId}, expected 0x prefixed 8 bytes hex`);
|
|
299
300
|
}
|
|
300
301
|
|
|
301
302
|
const res = await this.client.request(
|
|
302
303
|
{method: "GET", path: `/payloads/${payloadId}`, executionFork: toExecutionForkName(fork), responseType: "ssz"},
|
|
303
|
-
getPayloadOpts
|
|
304
|
+
{...getPayloadOpts, signal}
|
|
304
305
|
);
|
|
305
306
|
|
|
306
307
|
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Runs `fn` with a signal that aborts with either the signal of the client or the signal of a single request.
|
|
3
|
+
* Not AbortSignal.any(), Node retains every composite until the long-lived client signal aborts.
|
|
4
|
+
*/
|
|
5
|
+
export async function withRequestSignal<T>(
|
|
6
|
+
clientSignal: AbortSignal | undefined,
|
|
7
|
+
requestSignal: AbortSignal | undefined,
|
|
8
|
+
fn: (signal: AbortSignal | undefined) => Promise<T>
|
|
9
|
+
): Promise<T> {
|
|
10
|
+
if (requestSignal === undefined) {
|
|
11
|
+
return fn(clientSignal);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const controller = new AbortController();
|
|
15
|
+
const onAbort = (): void => controller.abort();
|
|
16
|
+
clientSignal?.addEventListener("abort", onAbort, {once: true});
|
|
17
|
+
requestSignal.addEventListener("abort", onAbort, {once: true});
|
|
18
|
+
if (clientSignal?.aborted || requestSignal.aborted) {
|
|
19
|
+
controller.abort();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
return await fn(controller.signal);
|
|
24
|
+
} finally {
|
|
25
|
+
clientSignal?.removeEventListener("abort", onAbort);
|
|
26
|
+
requestSignal.removeEventListener("abort", onAbort);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -42,10 +42,11 @@ export interface IEngineTransport {
|
|
|
42
42
|
headBlockHash: RootHex,
|
|
43
43
|
safeBlockHash: RootHex,
|
|
44
44
|
finalizedBlockHash: RootHex,
|
|
45
|
-
payloadAttributes?: PayloadAttributes
|
|
45
|
+
payloadAttributes?: PayloadAttributes,
|
|
46
|
+
signal?: AbortSignal
|
|
46
47
|
): Promise<ForkchoiceUpdatedResult>;
|
|
47
48
|
|
|
48
|
-
getPayload(fork: ForkName, payloadId: PayloadId): Promise<GetPayloadResult>;
|
|
49
|
+
getPayload(fork: ForkName, payloadId: PayloadId, signal?: AbortSignal): Promise<GetPayloadResult>;
|
|
49
50
|
|
|
50
51
|
getPayloadBodiesByHashV2(blockHashes: RootHex[]): Promise<(ExecutionPayloadBodyV2 | null)[]>;
|
|
51
52
|
|
package/src/index.ts
CHANGED
|
@@ -7,7 +7,12 @@ export {DbCPStateDatastore} from "./chain/stateCache/datastore/db.js";
|
|
|
7
7
|
export {FileCPStateDatastore} from "./chain/stateCache/datastore/file.js";
|
|
8
8
|
export {BeaconDb, type IBeaconDb} from "./db/index.js";
|
|
9
9
|
// Export execution engine to make it usable by builder
|
|
10
|
-
export {
|
|
10
|
+
export {
|
|
11
|
+
ExecutionEngineError,
|
|
12
|
+
ExecutionEngineErrorCode,
|
|
13
|
+
ExecutionPayloadStatus,
|
|
14
|
+
initializeExecutionEngine,
|
|
15
|
+
} from "./execution/index.js";
|
|
11
16
|
// Export metrics utilities to de-duplicate validator metrics
|
|
12
17
|
export {
|
|
13
18
|
type HttpMetricsServer,
|
|
@@ -1068,6 +1068,11 @@ export function createLodestarMetrics(
|
|
|
1068
1068
|
help: "Count of errors, by error type, while processing execution payload envelopes",
|
|
1069
1069
|
labelNames: ["error"],
|
|
1070
1070
|
}),
|
|
1071
|
+
blockHashTime: register.histogram({
|
|
1072
|
+
name: "lodestar_gossip_execution_payload_envelope_block_hash_seconds",
|
|
1073
|
+
help: "Time to compute the execution block hash of a gossip execution payload envelope",
|
|
1074
|
+
buckets: [0.001, 0.002, 0.005, 0.01, 0.025, 0.05, 0.1, 0.5, 1],
|
|
1075
|
+
}),
|
|
1071
1076
|
executionPayload: {
|
|
1072
1077
|
recvToValidation: register.histogram({
|
|
1073
1078
|
name: "lodestar_gossip_execution_payload_envelope_received_to_execution_payload_verification_seconds",
|
|
@@ -449,7 +449,8 @@ export class PeerManager {
|
|
|
449
449
|
.catch((e) => this.logger.verbose("cannot tag peer", {peerId: peer.toString()}, e as Error));
|
|
450
450
|
peerData.relevantStatus = RelevantPeerStatus.relevant;
|
|
451
451
|
}
|
|
452
|
-
|
|
452
|
+
// A peer rejected on connect is not tracked and may still send a status before its goodbye completes
|
|
453
|
+
if (peerData && getConnection(this.libp2p, peer.toString())) {
|
|
453
454
|
const nodeId = peerData?.nodeId ?? computeNodeId(peer);
|
|
454
455
|
// TODO(fulu): Are we sure we've run Metadata before this?
|
|
455
456
|
const custodyGroupCount = peerData?.metadata?.custodyGroupCount ?? this.config.CUSTODY_REQUIREMENT;
|
|
@@ -797,6 +798,18 @@ export class PeerManager {
|
|
|
797
798
|
return false;
|
|
798
799
|
}
|
|
799
800
|
|
|
801
|
+
// The heartbeat only disconnects peers that are already connected, a peer with a bad score
|
|
802
|
+
// could otherwise reconnect right after and stay connected until the next heartbeat
|
|
803
|
+
const scoreState = this.peerRpcScores.getScoreState(remotePeer);
|
|
804
|
+
if (scoreState !== ScoreState.Healthy && !this.gossipsub.isDirectPeer(remotePeerStr)) {
|
|
805
|
+
this.logger.debug("Peer with bad score connected, disconnecting", {peer: remotePeerPrettyStr, scoreState});
|
|
806
|
+
void this.goodbyeAndDisconnect(
|
|
807
|
+
remotePeer,
|
|
808
|
+
scoreState === ScoreState.Banned ? GoodByeReasonCode.BANNED : GoodByeReasonCode.SCORE_TOO_LOW
|
|
809
|
+
);
|
|
810
|
+
return false;
|
|
811
|
+
}
|
|
812
|
+
|
|
800
813
|
if (!opts.overwriteExisting && this.connectedPeers.has(remotePeerStr)) {
|
|
801
814
|
return false;
|
|
802
815
|
}
|
package/src/sync/types.ts
CHANGED
|
@@ -172,6 +172,8 @@ export type PendingPayloadRootHex = {
|
|
|
172
172
|
export type PendingPayloadEnvelope = {
|
|
173
173
|
status: PendingPayloadInputStatus.waitingForBlock;
|
|
174
174
|
envelope: SignedExecutionPayloadEnvelope;
|
|
175
|
+
/** Peer that served the envelope, undefined if it was already cached */
|
|
176
|
+
envelopePeerId?: string;
|
|
175
177
|
timeAddedSec: number;
|
|
176
178
|
peerIdStrings: Set<string>;
|
|
177
179
|
};
|
package/src/sync/unknownBlock.ts
CHANGED
|
@@ -1501,10 +1501,22 @@ export class BlockInputSync {
|
|
|
1501
1501
|
return;
|
|
1502
1502
|
}
|
|
1503
1503
|
if (validationResult.err) {
|
|
1504
|
+
const err = validationResult.err;
|
|
1505
|
+
const {envelopePeerId} = pendingPayload;
|
|
1506
|
+
// Same penalties as for an envelope validated right after download in fetchPayloadInput
|
|
1507
|
+
if (
|
|
1508
|
+
envelopePeerId !== undefined &&
|
|
1509
|
+
err instanceof ExecutionPayloadEnvelopeError &&
|
|
1510
|
+
(pendingPayload.envelope.message.payload.slotNumber !== payloadInput.slot ||
|
|
1511
|
+
toRootHex(pendingPayload.envelope.message.payload.blockHash) !== payloadInput.getBlockHashHex())
|
|
1512
|
+
) {
|
|
1513
|
+
this.network.reportPeer(envelopePeerId, PeerAction.LowToleranceError, err.type.code);
|
|
1514
|
+
}
|
|
1515
|
+
|
|
1504
1516
|
this.logger.debug(
|
|
1505
1517
|
"Pending payload envelope failed validation after block import, refetching by root",
|
|
1506
1518
|
{slot: pendingPayload.envelope.message.payload.slotNumber, root: rootHex},
|
|
1507
|
-
|
|
1519
|
+
err
|
|
1508
1520
|
);
|
|
1509
1521
|
|
|
1510
1522
|
const pendingPayloadByRoot: PendingPayloadRootHex = {
|
|
@@ -1514,6 +1526,10 @@ export class BlockInputSync {
|
|
|
1514
1526
|
timeAddedSec: pendingPayload.timeAddedSec,
|
|
1515
1527
|
peerIdStrings: new Set(pendingPayload.peerIdStrings),
|
|
1516
1528
|
};
|
|
1529
|
+
// Do not prefer the peer whose envelope just failed validation
|
|
1530
|
+
if (envelopePeerId !== undefined) {
|
|
1531
|
+
pendingPayloadByRoot.peerIdStrings.delete(envelopePeerId);
|
|
1532
|
+
}
|
|
1517
1533
|
this.pendingPayloads.set(rootHex, pendingPayloadByRoot);
|
|
1518
1534
|
|
|
1519
1535
|
if (this.network.getConnectedPeers().length > 0) {
|
|
@@ -1722,6 +1738,8 @@ export class BlockInputSync {
|
|
|
1722
1738
|
? cacheItem.payloadInput
|
|
1723
1739
|
: await this.chain.seenPayloadEnvelopeInputCache.getOrReload(rootHex);
|
|
1724
1740
|
let envelope = payloadInput?.hasPayloadEnvelope() ? payloadInput.getPayloadEnvelope() : undefined;
|
|
1741
|
+
// An envelope downloaded in an earlier attempt is validated with the peer of a later one
|
|
1742
|
+
let envelopePeerId: PeerIdStr | undefined;
|
|
1725
1743
|
|
|
1726
1744
|
const fetchStartSec = Date.now() / 1000;
|
|
1727
1745
|
if (typeof slot === "number") {
|
|
@@ -1769,6 +1787,7 @@ export class BlockInputSync {
|
|
|
1769
1787
|
try {
|
|
1770
1788
|
if (!envelope) {
|
|
1771
1789
|
envelope = await this.fetchExecutionPayloadEnvelope(peerId, blockRoot, rootHex);
|
|
1790
|
+
envelopePeerId = peerId;
|
|
1772
1791
|
cacheItem.peerIdStrings.add(peerId);
|
|
1773
1792
|
const slotWasUnknown = typeof slot !== "number";
|
|
1774
1793
|
slot = envelope.message.payload.slotNumber;
|
|
@@ -1792,6 +1811,7 @@ export class BlockInputSync {
|
|
|
1792
1811
|
return {
|
|
1793
1812
|
status: PendingPayloadInputStatus.waitingForBlock,
|
|
1794
1813
|
envelope,
|
|
1814
|
+
envelopePeerId,
|
|
1795
1815
|
timeAddedSec: cacheItem.timeAddedSec,
|
|
1796
1816
|
peerIdStrings: cacheItem.peerIdStrings,
|
|
1797
1817
|
};
|
|
@@ -1877,24 +1897,39 @@ export class BlockInputSync {
|
|
|
1877
1897
|
excludedPeers.add(peerId);
|
|
1878
1898
|
}
|
|
1879
1899
|
|
|
1900
|
+
// Honest peers serve the requested root and columns, and every path that stores payload columns verifies them
|
|
1901
|
+
if (e instanceof DownloadByRootError || e instanceof DataColumnSidecarValidationError) {
|
|
1902
|
+
this.network.reportPeer(peerId, PeerAction.LowToleranceError, e.type.code);
|
|
1903
|
+
}
|
|
1904
|
+
|
|
1880
1905
|
if (e instanceof ExecutionPayloadEnvelopeError) {
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1906
|
+
// Range sync stores an envelope after checking only its root, slot and block hash, so an honest peer may
|
|
1907
|
+
// serve one that fails the other checks. Compared directly since validation stops at the first failure.
|
|
1908
|
+
if (
|
|
1909
|
+
envelope !== undefined &&
|
|
1910
|
+
payloadInput &&
|
|
1911
|
+
(envelope.message.payload.slotNumber !== payloadInput.slot ||
|
|
1912
|
+
toRootHex(envelope.message.payload.blockHash) !== payloadInput.getBlockHashHex())
|
|
1913
|
+
) {
|
|
1914
|
+
if (envelopePeerId !== undefined) {
|
|
1915
|
+
this.network.reportPeer(envelopePeerId, PeerAction.LowToleranceError, e.type.code);
|
|
1916
|
+
}
|
|
1917
|
+
envelope = payloadInput.hasPayloadEnvelope() ? payloadInput.getPayloadEnvelope() : undefined;
|
|
1918
|
+
} else {
|
|
1919
|
+
switch (e.type.code) {
|
|
1920
|
+
// Caused by local state, the downloaded envelope may still be valid
|
|
1921
|
+
case ExecutionPayloadEnvelopeErrorCode.BLOCK_ROOT_UNKNOWN:
|
|
1922
|
+
case ExecutionPayloadEnvelopeErrorCode.ENVELOPE_ALREADY_KNOWN:
|
|
1923
|
+
case ExecutionPayloadEnvelopeErrorCode.PAYLOAD_ENVELOPE_INPUT_MISSING:
|
|
1924
|
+
case ExecutionPayloadEnvelopeErrorCode.UNKNOWN_BLOCK_STATE:
|
|
1925
|
+
// Every copy fails once the block is finalized
|
|
1926
|
+
case ExecutionPayloadEnvelopeErrorCode.BELONG_TO_FINALIZED_BLOCK:
|
|
1927
|
+
break;
|
|
1928
|
+
// The served copy is invalid, take the envelope from payloadInput or another peer on the next attempt
|
|
1929
|
+
default:
|
|
1891
1930
|
envelope = payloadInput?.hasPayloadEnvelope() ? payloadInput.getPayloadEnvelope() : undefined;
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
// The served copy is invalid, take the envelope from payloadInput or another peer on the next attempt
|
|
1895
|
-
default:
|
|
1896
|
-
envelope = payloadInput?.hasPayloadEnvelope() ? payloadInput.getPayloadEnvelope() : undefined;
|
|
1897
|
-
break;
|
|
1931
|
+
break;
|
|
1932
|
+
}
|
|
1898
1933
|
}
|
|
1899
1934
|
}
|
|
1900
1935
|
} finally {
|
|
@@ -1931,7 +1966,12 @@ export class BlockInputSync {
|
|
|
1931
1966
|
|
|
1932
1967
|
const receivedRootHex = toRootHex(envelope.message.beaconBlockRoot);
|
|
1933
1968
|
if (receivedRootHex !== rootHex) {
|
|
1934
|
-
throw new
|
|
1969
|
+
throw new DownloadByRootError({
|
|
1970
|
+
code: DownloadByRootErrorCode.MISMATCH_BLOCK_ROOT,
|
|
1971
|
+
peer: prettyPrintPeerIdStr(peerIdStr),
|
|
1972
|
+
requestedBlockRoot: rootHex,
|
|
1973
|
+
receivedBlockRoot: receivedRootHex,
|
|
1974
|
+
});
|
|
1935
1975
|
}
|
|
1936
1976
|
|
|
1937
1977
|
return envelope;
|
|
@@ -1960,9 +2000,13 @@ export class BlockInputSync {
|
|
|
1960
2000
|
const requestedColumnsSet = new Set(requestedColumns);
|
|
1961
2001
|
const extraColumns = columnSidecars.filter((columnSidecar) => !requestedColumnsSet.has(columnSidecar.index));
|
|
1962
2002
|
if (extraColumns.length > 0) {
|
|
1963
|
-
throw new
|
|
1964
|
-
|
|
1965
|
-
|
|
2003
|
+
throw new DownloadByRootError({
|
|
2004
|
+
code: DownloadByRootErrorCode.EXTRA_SIDECAR_RECEIVED,
|
|
2005
|
+
peer: prettyPrintPeerIdStr(peerIdStr),
|
|
2006
|
+
slot: payloadInput.slot,
|
|
2007
|
+
blockRoot: payloadInput.blockRootHex,
|
|
2008
|
+
invalidIndices: prettyPrintIndices(extraColumns.map((column) => column.index)),
|
|
2009
|
+
});
|
|
1966
2010
|
}
|
|
1967
2011
|
|
|
1968
2012
|
// PayloadEnvelopeInput already carries the block slot, root, and commitments, so reuse the
|