@lodestar/beacon-node 1.48.0-dev.f22c5ce63e → 1.48.0-dev.f63ac74039
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 +4 -11
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +14 -0
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/config/index.d.ts.map +1 -1
- package/lib/api/impl/config/index.js +4 -1
- package/lib/api/impl/config/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +39 -39
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts +1 -0
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +5 -1
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -0
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/metrics.js +12 -1
- package/lib/chain/archiveStore/historicalState/metrics.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -0
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +4 -1
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +9 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +68 -38
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts +5 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +12 -18
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/index.d.ts +8 -4
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +83 -17
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +8 -0
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.d.ts +1 -1
- package/lib/chain/blocks/utils/chainSegment.d.ts.map +1 -1
- package/lib/chain/blocks/utils/chainSegment.js +26 -11
- package/lib/chain/blocks/utils/chainSegment.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +9 -16
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/chain.d.ts +11 -5
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +129 -75
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +1 -1
- package/lib/chain/emitter.js +1 -1
- package/lib/chain/errors/blockError.d.ts +14 -9
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +0 -2
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +15 -2
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +4 -0
- 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 +10 -11
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +0 -2
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/gossipValidation.d.ts +2 -1
- package/lib/chain/errors/gossipValidation.d.ts.map +1 -1
- package/lib/chain/errors/gossipValidation.js +1 -0
- package/lib/chain/errors/gossipValidation.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +2 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/interface.d.ts +4 -4
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +3 -3
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +21 -23
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/lightClient/proofs.d.ts +2 -1
- package/lib/chain/lightClient/proofs.d.ts.map +1 -1
- package/lib/chain/lightClient/proofs.js +5 -1
- package/lib/chain/lightClient/proofs.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +16 -14
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +4 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +57 -72
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +27 -55
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +38 -13
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +56 -40
- 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 +10 -29
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.d.ts.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +5 -6
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +7 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +22 -5
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/beacon.d.ts +14 -5
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +17 -3
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/dataColumnStore.d.ts +39 -0
- package/lib/db/dataColumnStore.d.ts.map +1 -0
- package/lib/db/dataColumnStore.js +81 -0
- package/lib/db/dataColumnStore.js.map +1 -0
- package/lib/db/flatFileStore/atomicWrite.d.ts +8 -0
- package/lib/db/flatFileStore/atomicWrite.d.ts.map +1 -0
- package/lib/db/flatFileStore/atomicWrite.js +61 -0
- package/lib/db/flatFileStore/atomicWrite.js.map +1 -0
- package/lib/db/flatFileStore/dcolFormat.d.ts +90 -0
- package/lib/db/flatFileStore/dcolFormat.d.ts.map +1 -0
- package/lib/db/flatFileStore/dcolFormat.js +286 -0
- package/lib/db/flatFileStore/dcolFormat.js.map +1 -0
- package/lib/db/flatFileStore/errors.d.ts +82 -0
- package/lib/db/flatFileStore/errors.d.ts.map +1 -0
- package/lib/db/flatFileStore/errors.js +32 -0
- package/lib/db/flatFileStore/errors.js.map +1 -0
- package/lib/db/flatFileStore/flatFileStore.d.ts +41 -0
- package/lib/db/flatFileStore/flatFileStore.d.ts.map +1 -0
- package/lib/db/flatFileStore/flatFileStore.js +251 -0
- package/lib/db/flatFileStore/flatFileStore.js.map +1 -0
- package/lib/db/flatFileStore/index.d.ts +4 -0
- package/lib/db/flatFileStore/index.d.ts.map +1 -0
- package/lib/db/flatFileStore/index.js +2 -0
- package/lib/db/flatFileStore/index.js.map +1 -0
- package/lib/db/flatFileStore/interface.d.ts +25 -0
- package/lib/db/flatFileStore/interface.d.ts.map +1 -0
- package/lib/db/flatFileStore/interface.js +2 -0
- package/lib/db/flatFileStore/interface.js.map +1 -0
- package/lib/db/flatFileStore/metrics.d.ts +24 -0
- package/lib/db/flatFileStore/metrics.d.ts.map +1 -0
- package/lib/db/flatFileStore/metrics.js +25 -0
- package/lib/db/flatFileStore/metrics.js.map +1 -0
- package/lib/db/flatFileStore/path.d.ts +9 -0
- package/lib/db/flatFileStore/path.d.ts.map +1 -0
- package/lib/db/flatFileStore/path.js +21 -0
- package/lib/db/flatFileStore/path.js.map +1 -0
- package/lib/db/flatFileStore/slotIndex.d.ts +14 -0
- package/lib/db/flatFileStore/slotIndex.d.ts.map +1 -0
- package/lib/db/flatFileStore/slotIndex.js +46 -0
- package/lib/db/flatFileStore/slotIndex.js.map +1 -0
- package/lib/db/flatFileStore/snappy.d.ts +3 -0
- package/lib/db/flatFileStore/snappy.d.ts.map +1 -0
- package/lib/db/flatFileStore/snappy.js +12 -0
- package/lib/db/flatFileStore/snappy.js.map +1 -0
- package/lib/db/index.d.ts +1 -0
- package/lib/db/index.d.ts.map +1 -1
- package/lib/db/interface.d.ts +8 -1
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/blockArchive.d.ts +8 -1
- package/lib/db/repositories/blockArchive.d.ts.map +1 -1
- package/lib/db/repositories/blockArchive.js +65 -28
- package/lib/db/repositories/blockArchive.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +1 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.js +3 -7
- package/lib/db/repositories/blockArchiveIndex.js.map +1 -1
- package/lib/execution/builder/validateBid.d.ts.map +1 -1
- package/lib/execution/builder/validateBid.js +8 -5
- package/lib/execution/builder/validateBid.js.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +4 -1
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +22 -3
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +60 -6
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/monitoring/clientStats.js +1 -1
- package/lib/monitoring/clientStats.js.map +1 -1
- package/lib/network/gossip/encoding.d.ts.map +1 -1
- package/lib/network/gossip/encoding.js +0 -7
- package/lib/network/gossip/encoding.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +2 -1
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +4 -20
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/libp2p/index.d.ts +9 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +23 -0
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.js +2 -2
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +388 -285
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +49 -3
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +254 -114
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +112 -91
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +2 -0
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +6 -22
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.js +2 -1
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts +2 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.d.ts.map +1 -1
- package/lib/network/reqresp/utils/dataColumnResponseValidation.js +14 -9
- package/lib/network/reqresp/utils/dataColumnResponseValidation.js.map +1 -1
- package/lib/node/nodejs.d.ts +2 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +4 -2
- package/lib/node/nodejs.js.map +1 -1
- package/lib/sync/range/range.d.ts.map +1 -1
- package/lib/sync/range/range.js +24 -1
- package/lib/sync/range/range.js.map +1 -1
- package/lib/util/sszBytes.d.ts +6 -0
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +1 -1
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +19 -20
- package/src/api/impl/beacon/blocks/index.ts +8 -14
- package/src/api/impl/beacon/state/utils.ts +15 -0
- package/src/api/impl/config/index.ts +4 -1
- package/src/api/impl/validator/index.ts +44 -43
- package/src/chain/archiveStore/archiveStore.ts +12 -1
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +1 -0
- package/src/chain/archiveStore/historicalState/metrics.ts +14 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +4 -1
- package/src/chain/archiveStore/utils/archiveBlocks.ts +73 -42
- package/src/chain/blocks/importBlock.ts +25 -20
- package/src/chain/blocks/index.ts +120 -23
- package/src/chain/blocks/types.ts +9 -0
- package/src/chain/blocks/utils/chainSegment.ts +26 -12
- package/src/chain/blocks/writeBlockInputToDb.ts +10 -17
- package/src/chain/chain.ts +153 -84
- package/src/chain/emitter.ts +1 -1
- package/src/chain/errors/blockError.ts +19 -10
- package/src/chain/errors/dataColumnSidecarError.ts +24 -8
- package/src/chain/errors/executionPayloadBid.ts +2 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +14 -11
- package/src/chain/errors/gossipValidation.ts +1 -0
- package/src/chain/forkChoice/index.ts +2 -0
- package/src/chain/interface.ts +4 -4
- package/src/chain/lightClient/index.ts +32 -36
- package/src/chain/lightClient/proofs.ts +10 -0
- package/src/chain/opPools/aggregatedAttestationPool.ts +1 -1
- package/src/chain/prepareNextSlot.ts +21 -17
- package/src/chain/produceBlock/produceBlockBody.ts +62 -79
- package/src/chain/validation/block.ts +27 -72
- package/src/chain/validation/dataColumnSidecar.ts +47 -14
- package/src/chain/validation/executionPayloadBid.ts +62 -44
- package/src/chain/validation/executionPayloadEnvelope.ts +10 -37
- package/src/chain/validation/payloadAttestationMessage.ts +8 -9
- package/src/chain/validatorMonitor.ts +24 -7
- package/src/db/beacon.ts +33 -6
- package/src/db/dataColumnStore.ts +113 -0
- package/src/db/flatFileStore/atomicWrite.ts +65 -0
- package/src/db/flatFileStore/dcolFormat.ts +389 -0
- package/src/db/flatFileStore/errors.ts +53 -0
- package/src/db/flatFileStore/flatFileStore.ts +310 -0
- package/src/db/flatFileStore/index.ts +3 -0
- package/src/db/flatFileStore/interface.ts +21 -0
- package/src/db/flatFileStore/metrics.ts +48 -0
- package/src/db/flatFileStore/path.ts +32 -0
- package/src/db/flatFileStore/slotIndex.ts +56 -0
- package/src/db/flatFileStore/snappy.ts +14 -0
- package/src/db/index.ts +1 -0
- package/src/db/interface.ts +9 -1
- package/src/db/repositories/blockArchive.ts +89 -30
- package/src/db/repositories/blockArchiveIndex.ts +4 -9
- package/src/execution/builder/validateBid.ts +10 -6
- package/src/execution/engine/mock.ts +4 -1
- package/src/metrics/metrics/lodestar.ts +63 -6
- package/src/monitoring/clientStats.ts +1 -1
- package/src/network/gossip/encoding.ts +0 -7
- package/src/network/gossip/topic.ts +3 -25
- package/src/network/libp2p/index.ts +28 -1
- package/src/network/network.ts +2 -2
- package/src/network/processor/gossipHandlers.ts +500 -355
- package/src/network/processor/index.ts +287 -165
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +139 -105
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +2 -0
- package/src/network/reqresp/protocols.ts +7 -24
- package/src/network/reqresp/rateLimit.ts +2 -1
- package/src/network/reqresp/utils/dataColumnResponseValidation.ts +15 -7
- package/src/node/nodejs.ts +6 -1
- package/src/sync/range/range.ts +23 -1
- package/src/util/sszBytes.ts +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import {Db, encodeKey} from "@lodestar/db";
|
|
2
2
|
import {ForkAll} from "@lodestar/params";
|
|
3
3
|
import {Root, SSZTypesFor, SignedBeaconBlock, Slot, ssz} from "@lodestar/types";
|
|
4
|
-
import {intToBytes} from "@lodestar/utils";
|
|
5
4
|
import {Bucket, getBucketNameByValue} from "../buckets.js";
|
|
6
5
|
|
|
7
6
|
export const rootIndexBucketId = getBucketNameByValue(Bucket.index_blockArchiveRootIndex);
|
|
@@ -15,14 +14,6 @@ export async function getParentRootIndex(db: Db, parentRoot: Root): Promise<Uint
|
|
|
15
14
|
return db.get(getParentRootIndexKey(parentRoot), {bucketId: parentRootIndexBucketId});
|
|
16
15
|
}
|
|
17
16
|
|
|
18
|
-
export async function storeRootIndex(db: Db, slot: Slot, blockRoot: Root): Promise<void> {
|
|
19
|
-
return db.put(getRootIndexKey(blockRoot), intToBytes(slot, 8, "be"), {bucketId: rootIndexBucketId});
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export async function storeParentRootIndex(db: Db, slot: Slot, parentRoot: Root): Promise<void> {
|
|
23
|
-
return db.put(getParentRootIndexKey(parentRoot), intToBytes(slot, 8, "be"), {bucketId: parentRootIndexBucketId});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
17
|
export async function deleteRootIndex(
|
|
27
18
|
db: Db,
|
|
28
19
|
signedBeaconBlockType: SSZTypesFor<ForkAll, "SignedBeaconBlock">,
|
|
@@ -43,3 +34,7 @@ export function getParentRootIndexKey(parentRoot: Root): Uint8Array {
|
|
|
43
34
|
export function getRootIndexKey(root: Root): Uint8Array {
|
|
44
35
|
return encodeKey(Bucket.index_blockArchiveRootIndex, root);
|
|
45
36
|
}
|
|
37
|
+
|
|
38
|
+
export function getSlotIndexKey(slot: Slot): Uint8Array {
|
|
39
|
+
return encodeKey(Bucket.index_mainChain, slot);
|
|
40
|
+
}
|
|
@@ -56,6 +56,16 @@ export async function validateBuilderApiExecutionPayloadBid(
|
|
|
56
56
|
);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
if (byteArrayEquals(bid.blockHash, bid.parentBlockHash)) {
|
|
60
|
+
throw Error(`Bid block hash ${toRootHex(bid.blockHash)} must not equal its parent block hash`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const blobKzgCommitmentsLen = bid.blobKzgCommitments.length;
|
|
64
|
+
const maxBlobsPerBlock = chain.config.getMaxBlobsPerBlock(computeEpochAtSlot(bid.slot));
|
|
65
|
+
if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
|
|
66
|
+
throw Error(`Bid has too many KZG commitments len=${blobKzgCommitmentsLen} limit=${maxBlobsPerBlock}`);
|
|
67
|
+
}
|
|
68
|
+
|
|
59
69
|
const totalPayment = getBuilderBidTotalGwei(bid, entry.maxExecutionPayment);
|
|
60
70
|
if (totalPayment < entry.minBid) {
|
|
61
71
|
throw Error(
|
|
@@ -100,12 +110,6 @@ export async function validateBuilderApiExecutionPayloadBid(
|
|
|
100
110
|
);
|
|
101
111
|
}
|
|
102
112
|
|
|
103
|
-
const blobKzgCommitmentsLen = bid.blobKzgCommitments.length;
|
|
104
|
-
const maxBlobsPerBlock = chain.config.getMaxBlobsPerBlock(computeEpochAtSlot(bid.slot));
|
|
105
|
-
if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
|
|
106
|
-
throw Error(`Bid has too many KZG commitments len=${blobKzgCommitmentsLen} limit=${maxBlobsPerBlock}`);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
113
|
// The coverage check only applies to the staked collateral payment, a pure execution
|
|
110
114
|
// layer payment bid has nothing to cover on-chain
|
|
111
115
|
if (bid.value > 0 && !state.canBuilderCoverBid(bid.builderIndex, bid.value)) {
|
|
@@ -296,7 +296,10 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
296
296
|
|
|
297
297
|
// 5. Client software MUST update its forkchoice state if payloads referenced by forkchoiceState.headBlockHash and
|
|
298
298
|
// forkchoiceState.finalizedBlockHash are VALID.
|
|
299
|
-
|
|
299
|
+
//
|
|
300
|
+
// A zero finalizedBlockHash means "no finalized execution block" (e.g. the finalized checkpoint has no execution
|
|
301
|
+
// payload, pre-merge/pre-TTD). Real EL clients accept this, so the mock must not treat it as an unknown block.
|
|
302
|
+
if (finalizedBlockHash !== ZERO_HASH_HEX && !this.validBlocks.has(finalizedBlockHash)) {
|
|
300
303
|
throw Error(`Unknown finalizedBlockHash ${finalizedBlockHash}`);
|
|
301
304
|
}
|
|
302
305
|
this.headBlockHash = headBlockHash;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import {NotReorgedReason} from "@lodestar/fork-choice";
|
|
3
3
|
import {ArchiveStoreTask} from "../../chain/archiveStore/archiveStore.js";
|
|
4
4
|
import {FrequencyStateArchiveStep} from "../../chain/archiveStore/strategies/frequencyStateArchiveStrategy.js";
|
|
5
|
+
import type {LateCanonicalBlockReason} from "../../chain/archiveStore/utils/archiveBlocks.js";
|
|
5
6
|
import {BlockInputSource} from "../../chain/blocks/blockInput/index.js";
|
|
6
7
|
import {PayloadErrorCode} from "../../chain/blocks/importExecutionPayload.js";
|
|
7
8
|
import {
|
|
@@ -20,6 +21,7 @@ import {ReprocessStatus} from "../../chain/reprocess.js";
|
|
|
20
21
|
import {RejectReason} from "../../chain/seenCache/seenAttestationData.js";
|
|
21
22
|
import {CacheItemType} from "../../chain/stateCache/types.js";
|
|
22
23
|
import {OpSource} from "../../chain/validatorMonitor.js";
|
|
24
|
+
import type {FlatFileStoreOperation} from "../../db/flatFileStore/metrics.js";
|
|
23
25
|
import {ExecutionPayloadStatus} from "../../execution/index.js";
|
|
24
26
|
import {GossipType} from "../../network/index.js";
|
|
25
27
|
import {CannotAcceptWorkReason, ReprocessRejectReason} from "../../network/processor/index.js";
|
|
@@ -1047,6 +1049,11 @@ export function createLodestarMetrics(
|
|
|
1047
1049
|
name: "lodestar_import_block_set_head_after_cutoff_total",
|
|
1048
1050
|
help: "Total times an imported block is set as head after ATTESTATION_DUE_BPS of the slot",
|
|
1049
1051
|
}),
|
|
1052
|
+
lateCanonicalBlock: register.counter<{reason: LateCanonicalBlockReason}>({
|
|
1053
|
+
name: "lodestar_import_block_late_canonical_total",
|
|
1054
|
+
help: "Total finalized-canonical blocks this node imported after the attestation cutoff; reason distinguishes this node's processing lag (slow_import) from late reception (late_receive)",
|
|
1055
|
+
labelNames: ["reason"],
|
|
1056
|
+
}),
|
|
1050
1057
|
bySource: register.gauge<{source: BlockInputSource}>({
|
|
1051
1058
|
name: "lodestar_import_block_by_source_total",
|
|
1052
1059
|
help: "Total number of imported blocks by source",
|
|
@@ -1352,11 +1359,6 @@ export function createLodestarMetrics(
|
|
|
1352
1359
|
help: "Total number of InsertOutcome as a result of adding an execution payload bid from gossip to the pool",
|
|
1353
1360
|
labelNames: ["insertOutcome"],
|
|
1354
1361
|
}),
|
|
1355
|
-
apiInsertOutcome: register.counter<{insertOutcome: InsertOutcome}>({
|
|
1356
|
-
name: "lodestar_oppool_execution_payload_bid_pool_api_insert_outcome_total",
|
|
1357
|
-
help: "Total number of InsertOutcome as a result of adding an execution payload bid from api to the pool",
|
|
1358
|
-
labelNames: ["insertOutcome"],
|
|
1359
|
-
}),
|
|
1360
1362
|
apiValidationTime: register.histogram({
|
|
1361
1363
|
name: "lodestar_api_execution_payload_bid_validation_time_seconds",
|
|
1362
1364
|
help: "Time elapsed for signed execution payload bid validation - api path",
|
|
@@ -2098,7 +2100,7 @@ export function createLodestarMetrics(
|
|
|
2098
2100
|
}),
|
|
2099
2101
|
dbSizeTotal: register.gauge({
|
|
2100
2102
|
name: "lodestar_db_size_bytes_total",
|
|
2101
|
-
help: "Approximate number of bytes of file system space used by
|
|
2103
|
+
help: "Approximate number of bytes of file system space used by LevelDB",
|
|
2102
2104
|
}),
|
|
2103
2105
|
dbApproximateSizeTime: register.histogram({
|
|
2104
2106
|
name: "lodestar_db_approximate_size_time_seconds",
|
|
@@ -2107,6 +2109,61 @@ export function createLodestarMetrics(
|
|
|
2107
2109
|
}),
|
|
2108
2110
|
},
|
|
2109
2111
|
|
|
2112
|
+
flatFileStore: {
|
|
2113
|
+
operationDuration: {
|
|
2114
|
+
read: register.histogram({
|
|
2115
|
+
name: "lodestar_flat_file_store_read_duration_seconds",
|
|
2116
|
+
help: "Duration of flat file store reads in seconds",
|
|
2117
|
+
buckets: [0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05],
|
|
2118
|
+
}),
|
|
2119
|
+
write: register.histogram({
|
|
2120
|
+
name: "lodestar_flat_file_store_write_duration_seconds",
|
|
2121
|
+
help: "Duration of flat file store writes in seconds",
|
|
2122
|
+
buckets: [0.005, 0.01, 0.05, 0.1, 0.5, 1],
|
|
2123
|
+
}),
|
|
2124
|
+
delete: register.histogram({
|
|
2125
|
+
name: "lodestar_flat_file_store_delete_duration_seconds",
|
|
2126
|
+
help: "Duration of flat file store deletions in seconds",
|
|
2127
|
+
buckets: [0.0001, 0.0005, 0.001, 0.005, 0.01, 0.05],
|
|
2128
|
+
}),
|
|
2129
|
+
prune: register.histogram({
|
|
2130
|
+
name: "lodestar_flat_file_store_prune_duration_seconds",
|
|
2131
|
+
help: "Duration of flat file store pruning in seconds",
|
|
2132
|
+
buckets: [0.0005, 0.01, 0.05, 0.5, 5, 30],
|
|
2133
|
+
}),
|
|
2134
|
+
},
|
|
2135
|
+
operationErrors: register.counter<{operation: FlatFileStoreOperation}>({
|
|
2136
|
+
name: "lodestar_flat_file_store_operation_errors_total",
|
|
2137
|
+
help: "Total count of failed flat file store operations",
|
|
2138
|
+
labelNames: ["operation"],
|
|
2139
|
+
}),
|
|
2140
|
+
readBytes: register.counter({
|
|
2141
|
+
name: "lodestar_flat_file_store_read_bytes_total",
|
|
2142
|
+
help: "Total bytes read from flat file storage",
|
|
2143
|
+
}),
|
|
2144
|
+
writeBytes: register.counter({
|
|
2145
|
+
name: "lodestar_flat_file_store_write_bytes_total",
|
|
2146
|
+
help: "Total bytes written to flat file storage",
|
|
2147
|
+
}),
|
|
2148
|
+
prunedDirectories: register.counter({
|
|
2149
|
+
name: "lodestar_flat_file_store_pruned_directories_total",
|
|
2150
|
+
help: "Total count of slot directories pruned from flat file storage",
|
|
2151
|
+
}),
|
|
2152
|
+
slotIndexSize: register.gauge({
|
|
2153
|
+
name: "lodestar_flat_file_store_indexed_slots",
|
|
2154
|
+
help: "Count of indexed flat file slot directories, including empty directories awaiting pruning",
|
|
2155
|
+
}),
|
|
2156
|
+
startupDuration: register.histogram({
|
|
2157
|
+
name: "lodestar_flat_file_store_startup_duration_seconds",
|
|
2158
|
+
help: "Duration of flat file store slot index reconstruction in seconds",
|
|
2159
|
+
buckets: [0.1, 0.5, 1, 5, 10, 30, 60, 300],
|
|
2160
|
+
}),
|
|
2161
|
+
startupErrors: register.counter({
|
|
2162
|
+
name: "lodestar_flat_file_store_startup_errors_total",
|
|
2163
|
+
help: "Total count of flat file store startup failures",
|
|
2164
|
+
}),
|
|
2165
|
+
},
|
|
2166
|
+
|
|
2110
2167
|
pruneHistory: {
|
|
2111
2168
|
pruneCount: register.gauge({
|
|
2112
2169
|
name: "lodestar_prune_history_prune_count_total",
|
|
@@ -107,7 +107,7 @@ function createBeaconNodeStats(): ClientStats {
|
|
|
107
107
|
metricName: "lodestar_db_size_bytes_total",
|
|
108
108
|
jsonType: JsonType.Number,
|
|
109
109
|
defaultValue: 0,
|
|
110
|
-
description: "Amount of bytes consumed on disk by the beacon node's database",
|
|
110
|
+
description: "Amount of bytes consumed on disk by the beacon node's LevelDB database",
|
|
111
111
|
}),
|
|
112
112
|
networkLibp2pBytesTotalReceive: new MetricProperty({
|
|
113
113
|
jsonKey: "network_libp2p_bytes_total_receive",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type {Message} from "@libp2p/gossipsub";
|
|
2
2
|
import type {RPC} from "@libp2p/gossipsub/message";
|
|
3
3
|
import type {DataTransform} from "@libp2p/gossipsub/types";
|
|
4
|
-
// snappyjs is better for compression for smaller payloads
|
|
5
4
|
import xxhashFactory from "xxhash-wasm";
|
|
6
5
|
import {digest} from "@chainsafe/as-sha256";
|
|
7
6
|
import snappyWasm from "@chainsafe/snappy-wasm";
|
|
@@ -123,9 +122,6 @@ export class DataTransformSnappy implements DataTransform {
|
|
|
123
122
|
if (uncompressedDataLength > maxSize) {
|
|
124
123
|
throw Error(`ssz_snappy decoded data length ${uncompressedDataLength} > ${maxSize}`);
|
|
125
124
|
}
|
|
126
|
-
if (uncompressedDataLength > sszType.maxSize) {
|
|
127
|
-
throw Error(`ssz_snappy decoded data length ${uncompressedDataLength} > ${sszType.maxSize}`);
|
|
128
|
-
}
|
|
129
125
|
|
|
130
126
|
// Only after sanity length checks, we can decompress the data
|
|
131
127
|
// Using Buffer.alloc() instead of Buffer.allocUnsafe() to mitigate high GC pressure observed in some environments
|
|
@@ -146,9 +142,6 @@ export class DataTransformSnappy implements DataTransform {
|
|
|
146
142
|
if (data.length > maxSize) {
|
|
147
143
|
throw Error(`ssz_snappy encoded data length ${data.length} > ${maxSize}`);
|
|
148
144
|
}
|
|
149
|
-
if (data.length > sszType.maxSize) {
|
|
150
|
-
throw Error(`ssz_snappy encoded data length ${data.length} > ${sszType.maxSize}`);
|
|
151
|
-
}
|
|
152
145
|
|
|
153
146
|
// Using Buffer.alloc() instead of Buffer.allocUnsafe() to mitigate high GC pressure observed in some environments
|
|
154
147
|
const compressedData = Buffer.alloc(snappyWasm.max_compress_len(data.length));
|
|
@@ -4,17 +4,11 @@ import {
|
|
|
4
4
|
ATTESTATION_SUBNET_COUNT,
|
|
5
5
|
ForkName,
|
|
6
6
|
ForkSeq,
|
|
7
|
-
MAX_ATTESTER_SLASHING_SIZE,
|
|
8
|
-
MAX_DATA_COLUMN_SIDECAR_SIZE,
|
|
9
|
-
MAX_SIGNED_AGGREGATE_AND_PROOF_SIZE,
|
|
10
|
-
MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE,
|
|
11
|
-
MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE_HEZE,
|
|
12
7
|
SYNC_COMMITTEE_SUBNET_COUNT,
|
|
13
8
|
isForkPostAltair,
|
|
14
9
|
isForkPostElectra,
|
|
15
10
|
isForkPostFulu,
|
|
16
11
|
isForkPostGloas,
|
|
17
|
-
isForkPostHeze,
|
|
18
12
|
} from "@lodestar/params";
|
|
19
13
|
import {Attestation, SingleAttestation, ssz, sszTypesFor} from "@lodestar/types";
|
|
20
14
|
import {GossipAction, GossipActionError, GossipErrorCode} from "../../chain/errors/gossipValidation.js";
|
|
@@ -139,27 +133,11 @@ export function getGossipSSZType(topic: GossipTopic) {
|
|
|
139
133
|
}
|
|
140
134
|
|
|
141
135
|
/**
|
|
142
|
-
* Return the maximum uncompressed SSZ byte length accepted for a gossip object
|
|
136
|
+
* Return the maximum uncompressed SSZ byte length accepted for a gossip object, the SSZ type max size
|
|
137
|
+
* or MAX_PAYLOAD_SIZE, whichever is smaller.
|
|
143
138
|
*/
|
|
144
139
|
export function getGossipSSZMaxSize(topic: GossipTopic, maxPayloadSize: number, sszType?: CompositeTypeAny): number {
|
|
145
|
-
|
|
146
|
-
// Gloas progressive containers have broad theoretical SSZ max sizes; use the preset p2p bounds instead.
|
|
147
|
-
switch (topic.type) {
|
|
148
|
-
case GossipType.beacon_block:
|
|
149
|
-
return maxPayloadSize;
|
|
150
|
-
case GossipType.beacon_aggregate_and_proof:
|
|
151
|
-
return isForkPostGloas(fork) ? MAX_SIGNED_AGGREGATE_AND_PROOF_SIZE : (sszType ?? getGossipSSZType(topic)).maxSize;
|
|
152
|
-
case GossipType.attester_slashing:
|
|
153
|
-
return isForkPostGloas(fork) ? MAX_ATTESTER_SLASHING_SIZE : (sszType ?? getGossipSSZType(topic)).maxSize;
|
|
154
|
-
case GossipType.data_column_sidecar:
|
|
155
|
-
return isForkPostGloas(fork) ? MAX_DATA_COLUMN_SIDECAR_SIZE : (sszType ?? getGossipSSZType(topic)).maxSize;
|
|
156
|
-
case GossipType.execution_payload:
|
|
157
|
-
return maxPayloadSize;
|
|
158
|
-
case GossipType.execution_payload_bid:
|
|
159
|
-
return isForkPostHeze(fork) ? MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE_HEZE : MAX_SIGNED_EXECUTION_PAYLOAD_BID_SIZE;
|
|
160
|
-
default:
|
|
161
|
-
return (sszType ?? getGossipSSZType(topic)).maxSize;
|
|
162
|
-
}
|
|
140
|
+
return Math.min((sszType ?? getGossipSSZType(topic)).maxSize, maxPayloadSize);
|
|
163
141
|
}
|
|
164
142
|
|
|
165
143
|
/**
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {getCiphers} from "node:crypto";
|
|
2
2
|
import {bootstrap} from "@libp2p/bootstrap";
|
|
3
3
|
import {identify} from "@libp2p/identify";
|
|
4
|
-
import type {PrivateKey} from "@libp2p/interface";
|
|
4
|
+
import type {Address, PrivateKey} from "@libp2p/interface";
|
|
5
5
|
import {mdns} from "@libp2p/mdns";
|
|
6
6
|
import {mplex} from "@libp2p/mplex";
|
|
7
7
|
import {prometheusMetrics} from "@libp2p/prometheus-metrics";
|
|
8
8
|
import {tcp} from "@libp2p/tcp";
|
|
9
|
+
import {loopbackAddressLast, publicAddressesFirst, reliableTransportsFirst} from "@libp2p/utils";
|
|
10
|
+
import type {Multiaddr} from "@multiformats/multiaddr";
|
|
9
11
|
import {Libp2pInit, createLibp2p} from "libp2p";
|
|
10
12
|
import {Registry} from "prom-client";
|
|
11
13
|
import {ENR} from "@chainsafe/enr";
|
|
@@ -24,6 +26,29 @@ const noiseCrypto = getCiphers().includes("chacha20-poly1305")
|
|
|
24
26
|
chaCha20Poly1305Decrypt: asCrypto.chaCha20Poly1305Decrypt,
|
|
25
27
|
};
|
|
26
28
|
|
|
29
|
+
function quicAddressesFirst(a: Multiaddr, b: Multiaddr): -1 | 0 | 1 {
|
|
30
|
+
const aQuic = a.getComponents().some((c) => c.name === "quic-v1");
|
|
31
|
+
const bQuic = b.getComponents().some((c) => c.name === "quic-v1");
|
|
32
|
+
if (aQuic === bQuic) return 0;
|
|
33
|
+
return aQuic ? -1 : 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Custom sorter for libp2p's `addressSorter`.
|
|
38
|
+
*
|
|
39
|
+
* Prefers QUIC > TCP addresses before dialing, per p2p spec.
|
|
40
|
+
*
|
|
41
|
+
* Spec: https://github.com/ethereum/consensus-specs/blob/f21dac06e99743b1e98bb80297897b96520c942b/specs/phase0/p2p-interface.md#transport
|
|
42
|
+
*/
|
|
43
|
+
export function quicFirstAddressSorter(a: Address, b: Address): -1 | 0 | 1 {
|
|
44
|
+
return (
|
|
45
|
+
loopbackAddressLast(a.multiaddr, b.multiaddr) ||
|
|
46
|
+
publicAddressesFirst(a.multiaddr, b.multiaddr) ||
|
|
47
|
+
quicAddressesFirst(a.multiaddr, b.multiaddr) ||
|
|
48
|
+
reliableTransportsFirst(a.multiaddr, b.multiaddr)
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
27
52
|
export type NodeJsLibp2pOpts = {
|
|
28
53
|
peerStoreDir?: string;
|
|
29
54
|
disablePeerDiscovery?: boolean;
|
|
@@ -150,6 +175,8 @@ export async function createNodeJsLibp2p(
|
|
|
150
175
|
// the maximum number of pending connections libp2p will accept before it starts rejecting incoming connections.
|
|
151
176
|
// make it the same to backlog option above
|
|
152
177
|
maxIncomingPendingConnections: 5,
|
|
178
|
+
// Prefer dialing QUIC > TCP for a peer address if QUIC is enabled
|
|
179
|
+
addressSorter: quicEnabled ? quicFirstAddressSorter : undefined,
|
|
153
180
|
},
|
|
154
181
|
// rely on lodestar's peer manager to ping peers
|
|
155
182
|
connectionMonitor: {
|
package/src/network/network.ts
CHANGED
|
@@ -481,7 +481,7 @@ export class Network implements INetwork {
|
|
|
481
481
|
}
|
|
482
482
|
|
|
483
483
|
async publishLightClientFinalityUpdate(update: LightClientFinalityUpdate): Promise<number> {
|
|
484
|
-
const epoch = computeEpochAtSlot(update.
|
|
484
|
+
const epoch = computeEpochAtSlot(update.attestedHeader.beacon.slot);
|
|
485
485
|
const boundary = this.config.getForkBoundaryAtEpoch(epoch);
|
|
486
486
|
|
|
487
487
|
return this.publishGossip<GossipType.light_client_finality_update>(
|
|
@@ -491,7 +491,7 @@ export class Network implements INetwork {
|
|
|
491
491
|
}
|
|
492
492
|
|
|
493
493
|
async publishLightClientOptimisticUpdate(update: LightClientOptimisticUpdate): Promise<number> {
|
|
494
|
-
const epoch = computeEpochAtSlot(update.
|
|
494
|
+
const epoch = computeEpochAtSlot(update.attestedHeader.beacon.slot);
|
|
495
495
|
const boundary = this.config.getForkBoundaryAtEpoch(epoch);
|
|
496
496
|
|
|
497
497
|
return this.publishGossip<GossipType.light_client_optimistic_update>(
|