@lodestar/beacon-node 1.47.0-rc.0 → 1.48.0-dev.02b355c4db
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 +8 -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 +44 -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 +89 -23
- 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/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +5 -2
- package/lib/chain/blocks/verifyBlock.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 +12 -6
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +131 -76
- 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 +19 -7
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +2 -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 +9 -0
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +2 -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 +6 -6
- 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 +5 -0
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +37 -14
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +3 -25
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +46 -64
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +1 -0
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +1 -0
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +74 -63
- 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 +15 -3
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +199 -28
- 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/apiClient.d.ts +6 -0
- package/lib/execution/builder/apiClient.d.ts.map +1 -1
- package/lib/execution/builder/apiClient.js +19 -1
- package/lib/execution/builder/apiClient.js.map +1 -1
- package/lib/execution/builder/validateBid.d.ts +1 -0
- package/lib/execution/builder/validateBid.d.ts.map +1 -1
- package/lib/execution/builder/validateBid.js +17 -6
- 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 +32 -4
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +78 -8
- 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 -6
- 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/network.d.ts.map +1 -1
- package/lib/network/network.js +7 -6
- 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/gossipQueues/indexed.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/indexed.js +0 -1
- package/lib/network/processor/gossipQueues/indexed.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 +270 -122
- 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/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +9 -2
- package/lib/sync/range/chain.js.map +1 -1
- package/lib/sync/range/range.d.ts.map +1 -1
- package/lib/sync/range/range.js +25 -2
- 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 +18 -18
- package/src/api/impl/beacon/blocks/index.ts +12 -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 +49 -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 +126 -29
- package/src/chain/blocks/types.ts +9 -0
- package/src/chain/blocks/utils/chainSegment.ts +26 -12
- package/src/chain/blocks/verifyBlock.ts +5 -2
- package/src/chain/blocks/writeBlockInputToDb.ts +10 -17
- package/src/chain/chain.ts +155 -85
- package/src/chain/emitter.ts +1 -1
- package/src/chain/errors/blockError.ts +22 -10
- package/src/chain/errors/dataColumnSidecarError.ts +24 -8
- package/src/chain/errors/executionPayloadBid.ts +8 -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 +6 -6
- 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 +42 -17
- package/src/chain/produceBlock/computeNewStateRoot.ts +3 -38
- package/src/chain/produceBlock/produceBlockBody.ts +50 -71
- package/src/chain/regen/interface.ts +1 -0
- package/src/chain/validation/block.ts +77 -79
- package/src/chain/validation/dataColumnSidecar.ts +47 -14
- package/src/chain/validation/executionPayloadBid.ts +230 -32
- 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/apiClient.ts +21 -1
- package/src/execution/builder/validateBid.ts +26 -7
- package/src/execution/engine/mock.ts +4 -1
- package/src/metrics/metrics/lodestar.ts +83 -9
- package/src/monitoring/clientStats.ts +1 -1
- package/src/network/gossip/encoding.ts +0 -6
- package/src/network/gossip/topic.ts +3 -25
- package/src/network/network.ts +9 -6
- package/src/network/processor/gossipHandlers.ts +500 -355
- package/src/network/processor/gossipQueues/indexed.ts +0 -1
- package/src/network/processor/index.ts +312 -176
- 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/chain.ts +9 -2
- package/src/sync/range/range.ts +24 -2
- 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
|
+
}
|
|
@@ -201,6 +201,26 @@ export class BuilderApiClient {
|
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
+
/**
|
|
205
|
+
* Establish the connection to every known builder outside the bid deadline, a cold TCP/TLS handshake
|
|
206
|
+
* to a distant builder can exhaust `BUILDER_BID_DEADLINE_MS` on its own, and a long idle connection
|
|
207
|
+
* may be half-open and only fail once written to.
|
|
208
|
+
*/
|
|
209
|
+
async checkStatus(): Promise<void> {
|
|
210
|
+
await Promise.all(
|
|
211
|
+
Array.from(this.clients.entries()).map(async ([url, client]) => {
|
|
212
|
+
try {
|
|
213
|
+
(await client.status()).assertOk();
|
|
214
|
+
this.metrics?.builderApi.statusChecks.inc({status: "success"});
|
|
215
|
+
this.logger?.debug("Builder is ready", {builder: toPrintableUrl(url)});
|
|
216
|
+
} catch (e) {
|
|
217
|
+
this.metrics?.builderApi.statusChecks.inc({status: "error"});
|
|
218
|
+
this.logger?.warn("Builder status check failed", {builder: toPrintableUrl(url)}, e as Error);
|
|
219
|
+
}
|
|
220
|
+
})
|
|
221
|
+
);
|
|
222
|
+
}
|
|
223
|
+
|
|
204
224
|
private async getOrCreateClient(
|
|
205
225
|
url: BuilderUrl,
|
|
206
226
|
proposerPubkey: BLSPubkey,
|
|
@@ -237,7 +257,7 @@ export class BuilderApiClient {
|
|
|
237
257
|
{config: this.config, metrics: this.metrics?.builderHttpClient, logger: this.logger}
|
|
238
258
|
);
|
|
239
259
|
this.clients.set(url, client);
|
|
240
|
-
this.logger?.
|
|
260
|
+
this.logger?.debug("External builder registered", {url: toPrintableUrl(url)});
|
|
241
261
|
}
|
|
242
262
|
return client;
|
|
243
263
|
}
|
|
@@ -37,10 +37,11 @@ export async function validateBuilderApiExecutionPayloadBid(
|
|
|
37
37
|
parentBlockHash: RootHex;
|
|
38
38
|
parentBlockRoot: RootHex;
|
|
39
39
|
entry: routes.validator.BuilderEntry;
|
|
40
|
+
getParentExecutionRequests: () => Promise<gloas.ExecutionRequests>;
|
|
40
41
|
}
|
|
41
42
|
): Promise<void> {
|
|
42
43
|
const bid = signedExecutionPayloadBid.message;
|
|
43
|
-
const {slot, parentBlock, parentBlockHash, parentBlockRoot, entry} = request;
|
|
44
|
+
const {slot, parentBlock, parentBlockHash, parentBlockRoot, entry, getParentExecutionRequests} = request;
|
|
44
45
|
|
|
45
46
|
if (bid.slot !== slot) {
|
|
46
47
|
throw Error(`Bid slot=${bid.slot} does not match requested slot=${slot}`);
|
|
@@ -55,6 +56,16 @@ export async function validateBuilderApiExecutionPayloadBid(
|
|
|
55
56
|
);
|
|
56
57
|
}
|
|
57
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
|
+
|
|
58
69
|
const totalPayment = getBuilderBidTotalGwei(bid, entry.maxExecutionPayment);
|
|
59
70
|
if (totalPayment < entry.minBid) {
|
|
60
71
|
throw Error(
|
|
@@ -99,12 +110,6 @@ export async function validateBuilderApiExecutionPayloadBid(
|
|
|
99
110
|
);
|
|
100
111
|
}
|
|
101
112
|
|
|
102
|
-
const blobKzgCommitmentsLen = bid.blobKzgCommitments.length;
|
|
103
|
-
const maxBlobsPerBlock = chain.config.getMaxBlobsPerBlock(computeEpochAtSlot(bid.slot));
|
|
104
|
-
if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
|
|
105
|
-
throw Error(`Bid has too many KZG commitments len=${blobKzgCommitmentsLen} limit=${maxBlobsPerBlock}`);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
113
|
// The coverage check only applies to the staked collateral payment, a pure execution
|
|
109
114
|
// layer payment bid has nothing to cover on-chain
|
|
110
115
|
if (bid.value > 0 && !state.canBuilderCoverBid(bid.builderIndex, bid.value)) {
|
|
@@ -118,6 +123,20 @@ export async function validateBuilderApiExecutionPayloadBid(
|
|
|
118
123
|
throw Error(`Invalid bid prevRandao=${toHex(bid.prevRandao)} expected=${toHex(randaoMix)}`);
|
|
119
124
|
}
|
|
120
125
|
|
|
126
|
+
// The parent's payload does not try to exit the builder
|
|
127
|
+
if (byteArrayEquals(bid.parentBlockHash, state.latestExecutionPayloadBid.blockHash)) {
|
|
128
|
+
const requests = await getParentExecutionRequests();
|
|
129
|
+
if (
|
|
130
|
+
requests.builderExits.some(
|
|
131
|
+
(request) =>
|
|
132
|
+
byteArrayEquals(request.pubkey, builder.pubkey) &&
|
|
133
|
+
byteArrayEquals(request.sourceAddress, builder.executionAddress)
|
|
134
|
+
)
|
|
135
|
+
) {
|
|
136
|
+
throw Error(`Bid builderIndex=${bid.builderIndex} may exit in the parent payload`);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
121
140
|
// The builder must honor the proposer preferences it learned over gossip
|
|
122
141
|
const bidEpoch = computeEpochAtSlot(bid.slot);
|
|
123
142
|
const dependentRootHex = (() => {
|
|
@@ -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";
|
|
@@ -83,15 +85,15 @@ export function createLodestarMetrics(
|
|
|
83
85
|
}),
|
|
84
86
|
jobTime: register.histogram<{topic: GossipType}>({
|
|
85
87
|
name: "lodestar_gossip_validation_queue_job_time_seconds",
|
|
86
|
-
help: "Time to process gossip validation queue job in seconds",
|
|
88
|
+
help: "Time to process gossip validation queue job in seconds (accepted messages only)",
|
|
87
89
|
labelNames: ["topic"],
|
|
88
|
-
buckets: [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2
|
|
90
|
+
buckets: [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2],
|
|
89
91
|
}),
|
|
90
92
|
jobWaitTime: register.histogram<{topic: GossipType}>({
|
|
91
93
|
name: "lodestar_gossip_validation_queue_job_wait_time_seconds",
|
|
92
94
|
help: "Time from job added to the queue to starting the job in seconds",
|
|
93
95
|
labelNames: ["topic"],
|
|
94
|
-
buckets: [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2
|
|
96
|
+
buckets: [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 2],
|
|
95
97
|
}),
|
|
96
98
|
concurrency: register.gauge<{topic: GossipType}>({
|
|
97
99
|
name: "lodestar_gossip_validation_queue_concurrency",
|
|
@@ -104,9 +106,10 @@ export function createLodestarMetrics(
|
|
|
104
106
|
help: "Age of the first item of each key in the indexed queues in seconds",
|
|
105
107
|
buckets: [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 5],
|
|
106
108
|
}),
|
|
107
|
-
queueTime: register.histogram({
|
|
109
|
+
queueTime: register.histogram<{topic: GossipType}>({
|
|
108
110
|
name: "lodestar_gossip_validation_queue_time_seconds",
|
|
109
111
|
help: "Total time an item stays in queue until it is processed in seconds",
|
|
112
|
+
labelNames: ["topic"],
|
|
110
113
|
buckets: [0.01, 0.02, 0.05, 0.1, 0.2, 0.5, 1, 5],
|
|
111
114
|
}),
|
|
112
115
|
},
|
|
@@ -920,6 +923,12 @@ export function createLodestarMetrics(
|
|
|
920
923
|
help: "Count of errors, by error type, while processing blocks",
|
|
921
924
|
labelNames: ["error"],
|
|
922
925
|
}),
|
|
926
|
+
|
|
927
|
+
preStateSource: register.counter<{source: "parentState" | "fallbackPreState" | "preState"}>({
|
|
928
|
+
name: "lodestar_gossip_block_validation_pre_state_source_total",
|
|
929
|
+
help: "Source of the pre-state used for gossip block validation",
|
|
930
|
+
labelNames: ["source"],
|
|
931
|
+
}),
|
|
923
932
|
},
|
|
924
933
|
gossipBlob: {
|
|
925
934
|
recvToValidation: register.histogram({
|
|
@@ -1040,6 +1049,11 @@ export function createLodestarMetrics(
|
|
|
1040
1049
|
name: "lodestar_import_block_set_head_after_cutoff_total",
|
|
1041
1050
|
help: "Total times an imported block is set as head after ATTESTATION_DUE_BPS of the slot",
|
|
1042
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
|
+
}),
|
|
1043
1057
|
bySource: register.gauge<{source: BlockInputSource}>({
|
|
1044
1058
|
name: "lodestar_import_block_by_source_total",
|
|
1045
1059
|
help: "Total number of imported blocks by source",
|
|
@@ -1345,10 +1359,10 @@ export function createLodestarMetrics(
|
|
|
1345
1359
|
help: "Total number of InsertOutcome as a result of adding an execution payload bid from gossip to the pool",
|
|
1346
1360
|
labelNames: ["insertOutcome"],
|
|
1347
1361
|
}),
|
|
1348
|
-
|
|
1349
|
-
name: "
|
|
1350
|
-
help: "
|
|
1351
|
-
|
|
1362
|
+
apiValidationTime: register.histogram({
|
|
1363
|
+
name: "lodestar_api_execution_payload_bid_validation_time_seconds",
|
|
1364
|
+
help: "Time elapsed for signed execution payload bid validation - api path",
|
|
1365
|
+
buckets: [0.005, 0.01, 0.025, 0.05, 0.1, 0.5],
|
|
1352
1366
|
}),
|
|
1353
1367
|
},
|
|
1354
1368
|
},
|
|
@@ -2030,6 +2044,11 @@ export function createLodestarMetrics(
|
|
|
2030
2044
|
},
|
|
2031
2045
|
|
|
2032
2046
|
builderApi: {
|
|
2047
|
+
statusChecks: register.counter<{status: "success" | "error"}>({
|
|
2048
|
+
name: "lodestar_builder_api_status_checks_total",
|
|
2049
|
+
help: "Total count of status checks sent to external builders ahead of a proposal",
|
|
2050
|
+
labelNames: ["status"],
|
|
2051
|
+
}),
|
|
2033
2052
|
bidRequests: register.counter({
|
|
2034
2053
|
name: "lodestar_builder_api_bid_requests_total",
|
|
2035
2054
|
help: "Total count of execution payload bid requests sent to external builders",
|
|
@@ -2081,7 +2100,7 @@ export function createLodestarMetrics(
|
|
|
2081
2100
|
}),
|
|
2082
2101
|
dbSizeTotal: register.gauge({
|
|
2083
2102
|
name: "lodestar_db_size_bytes_total",
|
|
2084
|
-
help: "Approximate number of bytes of file system space used by
|
|
2103
|
+
help: "Approximate number of bytes of file system space used by LevelDB",
|
|
2085
2104
|
}),
|
|
2086
2105
|
dbApproximateSizeTime: register.histogram({
|
|
2087
2106
|
name: "lodestar_db_approximate_size_time_seconds",
|
|
@@ -2090,6 +2109,61 @@ export function createLodestarMetrics(
|
|
|
2090
2109
|
}),
|
|
2091
2110
|
},
|
|
2092
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
|
+
|
|
2093
2167
|
pruneHistory: {
|
|
2094
2168
|
pruneCount: register.gauge({
|
|
2095
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",
|
|
@@ -123,9 +123,6 @@ export class DataTransformSnappy implements DataTransform {
|
|
|
123
123
|
if (uncompressedDataLength > maxSize) {
|
|
124
124
|
throw Error(`ssz_snappy decoded data length ${uncompressedDataLength} > ${maxSize}`);
|
|
125
125
|
}
|
|
126
|
-
if (uncompressedDataLength > sszType.maxSize) {
|
|
127
|
-
throw Error(`ssz_snappy decoded data length ${uncompressedDataLength} > ${sszType.maxSize}`);
|
|
128
|
-
}
|
|
129
126
|
|
|
130
127
|
// Only after sanity length checks, we can decompress the data
|
|
131
128
|
// Using Buffer.alloc() instead of Buffer.allocUnsafe() to mitigate high GC pressure observed in some environments
|
|
@@ -146,9 +143,6 @@ export class DataTransformSnappy implements DataTransform {
|
|
|
146
143
|
if (data.length > maxSize) {
|
|
147
144
|
throw Error(`ssz_snappy encoded data length ${data.length} > ${maxSize}`);
|
|
148
145
|
}
|
|
149
|
-
if (data.length > sszType.maxSize) {
|
|
150
|
-
throw Error(`ssz_snappy encoded data length ${data.length} > ${sszType.maxSize}`);
|
|
151
|
-
}
|
|
152
146
|
|
|
153
147
|
// Using Buffer.alloc() instead of Buffer.allocUnsafe() to mitigate high GC pressure observed in some environments
|
|
154
148
|
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
|
/**
|
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>(
|
|
@@ -516,7 +516,8 @@ export class Network implements INetwork {
|
|
|
516
516
|
|
|
517
517
|
return this.publishGossip<GossipType.execution_payload_bid>(
|
|
518
518
|
{type: GossipType.execution_payload_bid, boundary},
|
|
519
|
-
signedBid
|
|
519
|
+
signedBid,
|
|
520
|
+
{floodPublish: true}
|
|
520
521
|
);
|
|
521
522
|
}
|
|
522
523
|
|
|
@@ -542,17 +543,19 @@ export class Network implements INetwork {
|
|
|
542
543
|
|
|
543
544
|
private async publishGossip<K extends GossipType>(
|
|
544
545
|
topic: GossipTopicMap[K],
|
|
545
|
-
object: GossipTypeMap[K]
|
|
546
|
+
object: GossipTypeMap[K],
|
|
547
|
+
opts?: PublishOpts
|
|
546
548
|
): Promise<number> {
|
|
547
549
|
const topicStr = stringifyGossipTopic(this.config, topic);
|
|
548
550
|
const sszType = getGossipSSZType(topic);
|
|
549
551
|
const messageData = (sszType.serialize as (object: GossipTypeMap[GossipType]) => Uint8Array)(object);
|
|
550
|
-
const
|
|
552
|
+
const publishOpts: PublishOpts = {
|
|
551
553
|
ignoreDuplicatePublishError: gossipTopicIgnoreDuplicatePublishError[topic.type],
|
|
552
554
|
// Leave undefined unless the topic opts out, so `--network.allowPublishToZeroPeers` still applies
|
|
553
555
|
allowPublishToZeroTopicPeers: gossipTopicAllowPublishToZeroPeers[topic.type] ? true : undefined,
|
|
556
|
+
...opts,
|
|
554
557
|
};
|
|
555
|
-
const sentPeers = await this.core.publishGossip(topicStr, messageData,
|
|
558
|
+
const sentPeers = await this.core.publishGossip(topicStr, messageData, publishOpts);
|
|
556
559
|
|
|
557
560
|
this.logger.verbose("Publish to topic", {topic: topicStr, sentPeers, currentSlot: this.clock.currentSlot});
|
|
558
561
|
return sentPeers;
|