@lodestar/beacon-node 1.41.0-dev.555261016d → 1.41.0-dev.628870a020
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/lightclient/index.d.ts.map +1 -1
- package/lib/api/impl/lightclient/index.js +19 -2
- package/lib/api/impl/lightclient/index.js.map +1 -1
- package/lib/api/impl/node/index.d.ts +1 -1
- package/lib/api/impl/node/index.d.ts.map +1 -1
- package/lib/api/impl/node/index.js +18 -1
- package/lib/api/impl/node/index.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +0 -2
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +2 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +3 -0
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +7 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +2 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +1 -1
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +27 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +2 -1
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +3 -25
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js +2 -20
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/metrics/metrics.d.ts.map +1 -1
- package/lib/metrics/metrics.js +8 -3
- package/lib/metrics/metrics.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +1 -2
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js +7 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +3 -9
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +4 -4
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/dataColumns.d.ts +5 -0
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +13 -5
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/serializedCache.d.ts +5 -0
- package/lib/util/serializedCache.d.ts.map +1 -1
- package/lib/util/serializedCache.js +5 -0
- package/lib/util/serializedCache.js.map +1 -1
- package/package.json +15 -15
- package/src/api/impl/lightclient/index.ts +19 -2
- package/src/api/impl/node/index.ts +22 -1
- package/src/chain/blocks/importBlock.ts +0 -3
- package/src/chain/blocks/index.ts +2 -1
- package/src/chain/blocks/writeBlockInputToDb.ts +3 -0
- package/src/chain/errors/blockError.ts +4 -1
- package/src/chain/lightClient/index.ts +4 -1
- package/src/chain/validation/block.ts +32 -4
- package/src/chain/validation/executionPayloadEnvelope.ts +2 -1
- package/src/chain/validation/payloadAttestationMessage.ts +1 -1
- package/src/execution/engine/interface.ts +3 -27
- package/src/metrics/metrics.ts +8 -3
- package/src/network/reqresp/handlers/lightClientUpdatesByRange.ts +6 -1
- package/src/sync/utils/downloadByRange.ts +3 -15
- package/src/sync/utils/downloadByRoot.ts +5 -11
- package/src/util/dataColumns.ts +18 -5
- package/src/util/serializedCache.ts +5 -0
package/src/util/dataColumns.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ForkPreGloas,
|
|
9
9
|
KZG_COMMITMENTS_GINDEX,
|
|
10
10
|
NUMBER_OF_COLUMNS,
|
|
11
|
+
isForkPostGloas,
|
|
11
12
|
} from "@lodestar/params";
|
|
12
13
|
import {signedBlockToSignedHeader} from "@lodestar/state-transition";
|
|
13
14
|
import {
|
|
@@ -19,6 +20,7 @@ import {
|
|
|
19
20
|
SignedBeaconBlockHeader,
|
|
20
21
|
deneb,
|
|
21
22
|
fulu,
|
|
23
|
+
gloas,
|
|
22
24
|
ssz,
|
|
23
25
|
} from "@lodestar/types";
|
|
24
26
|
import {bytesToBigInt} from "@lodestar/utils";
|
|
@@ -261,6 +263,20 @@ export async function getCellsAndProofs(
|
|
|
261
263
|
return blobsAndProofs;
|
|
262
264
|
}
|
|
263
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Get blob KZG commitments from a signed block, handling the different locations
|
|
268
|
+
* in pre-Gloas (directly in block body) vs post-Gloas (in execution payload bid).
|
|
269
|
+
*/
|
|
270
|
+
export function getBlobKzgCommitments(
|
|
271
|
+
fork: ForkName,
|
|
272
|
+
signedBlock: SignedBeaconBlock<ForkPostFulu>
|
|
273
|
+
): deneb.KZGCommitment[] {
|
|
274
|
+
if (isForkPostGloas(fork)) {
|
|
275
|
+
return (signedBlock as gloas.SignedBeaconBlock).message.body.signedExecutionPayloadBid.message.blobKzgCommitments;
|
|
276
|
+
}
|
|
277
|
+
return (signedBlock.message.body as BeaconBlockBody<ForkPostFulu & ForkPreGloas>).blobKzgCommitments;
|
|
278
|
+
}
|
|
279
|
+
|
|
264
280
|
/**
|
|
265
281
|
* Given a signed block header and the commitments, inclusion proof, cells/proofs associated with
|
|
266
282
|
* each blob in the block, assemble the sidecars which can be distributed to peers.
|
|
@@ -310,16 +326,13 @@ export function getDataColumnSidecarsFromBlock(
|
|
|
310
326
|
signedBlock: SignedBeaconBlock<ForkPostFulu>,
|
|
311
327
|
cellsAndKzgProofs: {cells: Uint8Array[]; proofs: Uint8Array[]}[]
|
|
312
328
|
): fulu.DataColumnSidecars {
|
|
313
|
-
|
|
314
|
-
const blobKzgCommitments = (signedBlock
|
|
315
|
-
.blobKzgCommitments;
|
|
329
|
+
const fork = config.getForkName(signedBlock.message.slot);
|
|
330
|
+
const blobKzgCommitments = getBlobKzgCommitments(fork, signedBlock);
|
|
316
331
|
|
|
317
332
|
// No need to create data column sidecars if there are no blobs
|
|
318
333
|
if (blobKzgCommitments.length === 0) {
|
|
319
334
|
return [];
|
|
320
335
|
}
|
|
321
|
-
|
|
322
|
-
const fork = config.getForkName(signedBlock.message.slot);
|
|
323
336
|
const signedBlockHeader = signedBlockToSignedHeader(config, signedBlock);
|
|
324
337
|
|
|
325
338
|
const kzgCommitmentsInclusionProof = computePostFuluKzgCommitmentsInclusionProof(fork, signedBlock.message.body);
|
|
@@ -14,6 +14,11 @@ export class SerializedCache {
|
|
|
14
14
|
this.map.set(obj, serialized);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Replace the internal WeakMap to force GC of all cached entries.
|
|
19
|
+
* Must only be called after all DB writes that may read from this cache have completed,
|
|
20
|
+
* otherwise cached serialized bytes will be unavailable and data will be re-serialized unnecessarily.
|
|
21
|
+
*/
|
|
17
22
|
clear(): void {
|
|
18
23
|
this.map = new WeakMap();
|
|
19
24
|
}
|