@lodestar/beacon-node 1.47.0 → 1.48.0-dev.042c96183c
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 +40 -15
- 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 +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/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 -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/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 +19 -20
- 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 +47 -18
- package/src/chain/produceBlock/computeNewStateRoot.ts +3 -38
- package/src/chain/produceBlock/produceBlockBody.ts +62 -79
- 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 -7
- 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
|
@@ -528,23 +528,18 @@ export async function produceBlockBody<T extends BlockType>(
|
|
|
528
528
|
}
|
|
529
529
|
}
|
|
530
530
|
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
throw Error(`Invalid builder getHeader response for fork=${fork}, missing blobKzgCommitments`);
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
(blockBody as deneb.BlindedBeaconBlockBody).blobKzgCommitments = blobKzgCommitments;
|
|
538
|
-
Object.assign(logMeta, {blobs: blobKzgCommitments.length});
|
|
531
|
+
const {blobKzgCommitments, executionRequests} = builderRes;
|
|
532
|
+
if (blobKzgCommitments === undefined) {
|
|
533
|
+
throw Error(`Invalid builder getHeader response for fork=${fork}, missing blobKzgCommitments`);
|
|
539
534
|
}
|
|
540
535
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
}
|
|
546
|
-
(blockBody as electra.BlindedBeaconBlockBody).executionRequests = executionRequests;
|
|
536
|
+
(blockBody as BlindedBeaconBlockBody<ForkName.fulu>).blobKzgCommitments = blobKzgCommitments;
|
|
537
|
+
Object.assign(logMeta, {blobs: blobKzgCommitments.length});
|
|
538
|
+
|
|
539
|
+
if (executionRequests === undefined) {
|
|
540
|
+
throw Error(`Invalid builder getHeader response for fork=${fork}, missing executionRequests`);
|
|
547
541
|
}
|
|
542
|
+
(blockBody as BlindedBeaconBlockBody<ForkName.fulu>).executionRequests = executionRequests;
|
|
548
543
|
}
|
|
549
544
|
|
|
550
545
|
// blockType === BlockType.Full
|
|
@@ -740,7 +735,9 @@ export async function prepareExecutionPayload(
|
|
|
740
735
|
* parent execution payload first (see `withParentPayloadApplied`).
|
|
741
736
|
*/
|
|
742
737
|
state: IBeaconStateViewBellatrix,
|
|
743
|
-
suggestedFeeRecipient: string
|
|
738
|
+
suggestedFeeRecipient: string,
|
|
739
|
+
/** Attributes already computed for the same state and fee recipient, e.g. for the SSE event */
|
|
740
|
+
payloadAttributes?: PayloadAttributes
|
|
744
741
|
): Promise<{prepType: PayloadPreparationType; payloadId: PayloadId}> {
|
|
745
742
|
const timestamp = computeTimeAtSlot(chain.config, state.slot, state.genesisTime);
|
|
746
743
|
const prevRandao = state.getRandaoMix(state.epoch);
|
|
@@ -771,13 +768,15 @@ export async function prepareExecutionPayload(
|
|
|
771
768
|
prepType = PayloadPreparationType.Fresh;
|
|
772
769
|
}
|
|
773
770
|
|
|
774
|
-
const attributes: PayloadAttributes =
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
771
|
+
const attributes: PayloadAttributes =
|
|
772
|
+
payloadAttributes ??
|
|
773
|
+
preparePayloadAttributes(fork, chain, {
|
|
774
|
+
prepareState: state,
|
|
775
|
+
prepareSlot: state.slot,
|
|
776
|
+
parentBlockRoot,
|
|
777
|
+
parentBlockHash,
|
|
778
|
+
feeRecipient: suggestedFeeRecipient,
|
|
779
|
+
});
|
|
781
780
|
|
|
782
781
|
payloadId = await chain.executionEngine.notifyForkchoiceUpdate(
|
|
783
782
|
fork,
|
|
@@ -899,45 +898,38 @@ function preparePayloadAttributes(
|
|
|
899
898
|
): SSEPayloadAttributes["payloadAttributes"] {
|
|
900
899
|
const timestamp = computeTimeAtSlot(chain.config, prepareSlot, prepareState.genesisTime);
|
|
901
900
|
const prevRandao = prepareState.getRandaoMix(prepareState.epoch);
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
suggestedFeeRecipient: feeRecipient,
|
|
906
|
-
};
|
|
907
|
-
|
|
908
|
-
if (ForkSeq[fork] >= ForkSeq.capella) {
|
|
909
|
-
if (!isStatePostCapella(prepareState)) {
|
|
910
|
-
throw new Error("Expected Capella state for withdrawals");
|
|
911
|
-
}
|
|
901
|
+
if (!isStatePostCapella(prepareState)) {
|
|
902
|
+
throw new Error("Expected Capella state for withdrawals");
|
|
903
|
+
}
|
|
912
904
|
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
(payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
|
|
922
|
-
prepareState.getExpectedWithdrawals().expectedWithdrawals;
|
|
923
|
-
} else {
|
|
924
|
-
// When the parent block is empty, state.payloadExpectedWithdrawals holds a batch
|
|
925
|
-
// already deducted from CL balances but never credited on the EL (the envelope
|
|
926
|
-
// was not delivered). The next payload must carry those same withdrawals to
|
|
927
|
-
// restore CL/EL consistency, otherwise validators permanently lose that balance.
|
|
928
|
-
(payloadAttributes as capella.SSEPayloadAttributes["payloadAttributes"]).withdrawals =
|
|
929
|
-
prepareState.payloadExpectedWithdrawals;
|
|
905
|
+
let withdrawals: capella.Withdrawal[];
|
|
906
|
+
if (isStatePostGloas(prepareState)) {
|
|
907
|
+
const isExtendingPayload = byteArrayEquals(parentBlockHash, prepareState.latestExecutionPayloadBid.blockHash);
|
|
908
|
+
if (isExtendingPayload) {
|
|
909
|
+
// applyParentExecutionPayload sets latestBlockHash = parentBid.blockHash, so a mismatch
|
|
910
|
+
// here means the caller did not apply parent payload to prepareState
|
|
911
|
+
if (!byteArrayEquals(prepareState.latestBlockHash, prepareState.latestExecutionPayloadBid.blockHash)) {
|
|
912
|
+
throw new Error("Expected state with parent execution payload applied for withdrawals");
|
|
930
913
|
}
|
|
914
|
+
withdrawals = prepareState.getExpectedWithdrawals().expectedWithdrawals;
|
|
931
915
|
} else {
|
|
932
|
-
//
|
|
933
|
-
|
|
934
|
-
|
|
916
|
+
// When the parent block is empty, state.payloadExpectedWithdrawals holds a batch
|
|
917
|
+
// already deducted from CL balances but never credited on the EL (the envelope
|
|
918
|
+
// was not delivered). The next payload must carry those same withdrawals to
|
|
919
|
+
// restore CL/EL consistency, otherwise validators permanently lose that balance.
|
|
920
|
+
withdrawals = prepareState.payloadExpectedWithdrawals;
|
|
935
921
|
}
|
|
922
|
+
} else {
|
|
923
|
+
withdrawals = prepareState.getExpectedWithdrawals().expectedWithdrawals;
|
|
936
924
|
}
|
|
937
925
|
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
926
|
+
const payloadAttributes: deneb.SSEPayloadAttributes["payloadAttributes"] = {
|
|
927
|
+
timestamp,
|
|
928
|
+
prevRandao,
|
|
929
|
+
suggestedFeeRecipient: feeRecipient,
|
|
930
|
+
withdrawals,
|
|
931
|
+
parentBeaconBlockRoot: parentBlockRoot,
|
|
932
|
+
};
|
|
941
933
|
|
|
942
934
|
if (ForkSeq[fork] >= ForkSeq.gloas) {
|
|
943
935
|
if (!isStatePostGloas(prepareState)) {
|
|
@@ -1050,37 +1042,28 @@ export async function produceCommonBlockBody<T extends BlockType>(
|
|
|
1050
1042
|
step: BlockProductionStep.attestations,
|
|
1051
1043
|
});
|
|
1052
1044
|
|
|
1053
|
-
const
|
|
1045
|
+
const endSyncAggregate = stepsMetrics?.startTimer();
|
|
1046
|
+
const parentBlockRoot = fromHex(parentBlock.blockRoot);
|
|
1047
|
+
const previousSlot = slot - 1;
|
|
1048
|
+
const syncAggregate = this.syncContributionAndProofPool.getAggregate(previousSlot, parentBlockRoot);
|
|
1049
|
+
this.metrics?.production.producedSyncAggregateParticipants.observe(
|
|
1050
|
+
syncAggregate.syncCommitteeBits.getTrueBitIndexes().length
|
|
1051
|
+
);
|
|
1052
|
+
endSyncAggregate?.({
|
|
1053
|
+
step: BlockProductionStep.syncAggregate,
|
|
1054
|
+
});
|
|
1055
|
+
|
|
1056
|
+
// Live proposal production is supported from Fulu onward.
|
|
1057
|
+
return {
|
|
1054
1058
|
randaoReveal,
|
|
1055
1059
|
graffiti,
|
|
1056
|
-
// Eth1 data voting is no longer required since electra
|
|
1057
1060
|
eth1Data: currentState.eth1Data,
|
|
1058
1061
|
proposerSlashings: this.opts.disableProposerSlashings === true ? [] : proposerSlashings,
|
|
1059
1062
|
attesterSlashings,
|
|
1060
1063
|
attestations,
|
|
1061
|
-
// Since electra, deposits are processed by the execution layer,
|
|
1062
|
-
// we no longer support handling deposits from earlier forks.
|
|
1063
1064
|
deposits: [],
|
|
1064
1065
|
voluntaryExits,
|
|
1066
|
+
blsToExecutionChanges,
|
|
1067
|
+
syncAggregate,
|
|
1065
1068
|
};
|
|
1066
|
-
|
|
1067
|
-
if (ForkSeq[fork] >= ForkSeq.capella) {
|
|
1068
|
-
(blockBody as CommonBlockBody).blsToExecutionChanges = blsToExecutionChanges;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
const endSyncAggregate = stepsMetrics?.startTimer();
|
|
1072
|
-
if (ForkSeq[fork] >= ForkSeq.altair) {
|
|
1073
|
-
const parentBlockRoot = fromHex(parentBlock.blockRoot);
|
|
1074
|
-
const previousSlot = slot - 1;
|
|
1075
|
-
const syncAggregate = this.syncContributionAndProofPool.getAggregate(previousSlot, parentBlockRoot);
|
|
1076
|
-
this.metrics?.production.producedSyncAggregateParticipants.observe(
|
|
1077
|
-
syncAggregate.syncCommitteeBits.getTrueBitIndexes().length
|
|
1078
|
-
);
|
|
1079
|
-
(blockBody as CommonBlockBody).syncAggregate = syncAggregate;
|
|
1080
|
-
}
|
|
1081
|
-
endSyncAggregate?.({
|
|
1082
|
-
step: BlockProductionStep.syncAggregate,
|
|
1083
|
-
});
|
|
1084
|
-
|
|
1085
|
-
return blockBody as CommonBlockBody;
|
|
1086
1069
|
}
|
|
@@ -24,6 +24,7 @@ export enum RegenCaller {
|
|
|
24
24
|
validateApiVoluntaryExit = "validateApiVoluntaryExit",
|
|
25
25
|
publishDeferredVoluntaryExits = "publishDeferredVoluntaryExits",
|
|
26
26
|
validateGossipExecutionPayloadBid = "validateGossipExecutionPayloadBid",
|
|
27
|
+
validateApiExecutionPayloadBid = "validateApiExecutionPayloadBid",
|
|
27
28
|
validateGossipPayloadAttestationMessage = "validateGossipPayloadAttestationMessage",
|
|
28
29
|
validateGossipProposerPreferences = "validateGossipProposerPreferences",
|
|
29
30
|
onForkChoiceFinalized = "onForkChoiceFinalized",
|
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {ExecutionStatus} from "@lodestar/fork-choice";
|
|
3
|
-
import {
|
|
4
|
-
ForkName,
|
|
5
|
-
MAX_ATTESTATIONS_ELECTRA,
|
|
6
|
-
MAX_ATTESTER_SLASHINGS_ELECTRA,
|
|
7
|
-
MAX_BLS_TO_EXECUTION_CHANGES,
|
|
8
|
-
MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD,
|
|
9
|
-
MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD,
|
|
10
|
-
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD,
|
|
11
|
-
MAX_PAYLOAD_ATTESTATIONS,
|
|
12
|
-
MAX_PROPOSER_SLASHINGS,
|
|
13
|
-
MAX_VOLUNTARY_EXITS,
|
|
14
|
-
MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD,
|
|
15
|
-
isForkPostBellatrix,
|
|
16
|
-
isForkPostDeneb,
|
|
17
|
-
isForkPostGloas,
|
|
18
|
-
} from "@lodestar/params";
|
|
3
|
+
import {ForkName, MIN_SEED_LOOKAHEAD, isForkPostBellatrix, isForkPostDeneb, isForkPostGloas} from "@lodestar/params";
|
|
19
4
|
import {
|
|
20
5
|
computeEpochAtSlot,
|
|
21
6
|
computeStartSlotAtEpoch,
|
|
@@ -149,8 +134,9 @@ export async function validateGossipBlock(
|
|
|
149
134
|
if (parentBlock.slot >= blockSlot) {
|
|
150
135
|
throw new BlockGossipError(GossipAction.REJECT, {
|
|
151
136
|
code: BlockErrorCode.NOT_LATER_THAN_PARENT,
|
|
152
|
-
parentSlot: parentBlock.slot,
|
|
153
137
|
slot: blockSlot,
|
|
138
|
+
root: blockRoot,
|
|
139
|
+
parentSlot: parentBlock.slot,
|
|
154
140
|
});
|
|
155
141
|
}
|
|
156
142
|
|
|
@@ -165,6 +151,8 @@ export async function validateGossipBlock(
|
|
|
165
151
|
if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
|
|
166
152
|
throw new BlockGossipError(GossipAction.REJECT, {
|
|
167
153
|
code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS,
|
|
154
|
+
slot: blockSlot,
|
|
155
|
+
root: blockRoot,
|
|
168
156
|
blobKzgCommitmentsLen,
|
|
169
157
|
commitmentLimit: maxBlobsPerBlock,
|
|
170
158
|
});
|
|
@@ -172,7 +160,8 @@ export async function validateGossipBlock(
|
|
|
172
160
|
}
|
|
173
161
|
|
|
174
162
|
if (isForkPostGloas(fork)) {
|
|
175
|
-
const
|
|
163
|
+
const body = (block as gloas.BeaconBlock).body;
|
|
164
|
+
const bid = body.signedExecutionPayloadBid.message;
|
|
176
165
|
|
|
177
166
|
// [REJECT] The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer
|
|
178
167
|
// -- i.e. validate that len(bid.blob_kzg_commitments) <= max_blobs_per_block
|
|
@@ -181,6 +170,8 @@ export async function validateGossipBlock(
|
|
|
181
170
|
if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
|
|
182
171
|
throw new BlockGossipError(GossipAction.REJECT, {
|
|
183
172
|
code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS,
|
|
173
|
+
slot: blockSlot,
|
|
174
|
+
root: blockRoot,
|
|
184
175
|
blobKzgCommitmentsLen,
|
|
185
176
|
commitmentLimit: maxBlobsPerBlock,
|
|
186
177
|
});
|
|
@@ -190,89 +181,85 @@ export async function validateGossipBlock(
|
|
|
190
181
|
if (!byteArrayEquals(bid.parentBlockRoot, block.parentRoot)) {
|
|
191
182
|
throw new BlockGossipError(GossipAction.REJECT, {
|
|
192
183
|
code: BlockErrorCode.BID_PARENT_ROOT_MISMATCH,
|
|
184
|
+
slot: blockSlot,
|
|
185
|
+
root: blockRoot,
|
|
193
186
|
bidParentRoot: toRootHex(bid.parentBlockRoot),
|
|
194
187
|
blockParentRoot: parentRoot,
|
|
195
188
|
});
|
|
196
189
|
}
|
|
197
190
|
|
|
198
|
-
// [REJECT] The
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
// limits -- i.e. validate that
|
|
207
|
-
// `len(block.body.proposer_slashings) <= MAX_PROPOSER_SLASHINGS`,
|
|
208
|
-
// `len(block.body.attester_slashings) <= MAX_ATTESTER_SLASHINGS_ELECTRA`,
|
|
209
|
-
// `len(block.body.attestations) <= MAX_ATTESTATIONS_ELECTRA`,
|
|
210
|
-
// `len(block.body.deposits) == 0`,
|
|
211
|
-
// `len(block.body.voluntary_exits) <= MAX_VOLUNTARY_EXITS`,
|
|
212
|
-
// `len(block.body.bls_to_execution_changes) <= MAX_BLS_TO_EXECUTION_CHANGES`,
|
|
213
|
-
// and `len(block.body.payload_attestations) <= MAX_PAYLOAD_ATTESTATIONS`.
|
|
214
|
-
const body = (block as gloas.BeaconBlock).body;
|
|
215
|
-
const requests = body.parentExecutionRequests;
|
|
216
|
-
const countLimits: [string, number, number][] = [
|
|
217
|
-
["parentExecutionRequests.withdrawals", requests.withdrawals.length, MAX_WITHDRAWAL_REQUESTS_PER_PAYLOAD],
|
|
218
|
-
[
|
|
219
|
-
"parentExecutionRequests.consolidations",
|
|
220
|
-
requests.consolidations.length,
|
|
221
|
-
MAX_CONSOLIDATION_REQUESTS_PER_PAYLOAD,
|
|
222
|
-
],
|
|
223
|
-
[
|
|
224
|
-
"parentExecutionRequests.builderDeposits",
|
|
225
|
-
requests.builderDeposits.length,
|
|
226
|
-
MAX_BUILDER_DEPOSIT_REQUESTS_PER_PAYLOAD,
|
|
227
|
-
],
|
|
228
|
-
["parentExecutionRequests.builderExits", requests.builderExits.length, MAX_BUILDER_EXIT_REQUESTS_PER_PAYLOAD],
|
|
229
|
-
["proposerSlashings", body.proposerSlashings.length, MAX_PROPOSER_SLASHINGS],
|
|
230
|
-
["attesterSlashings", body.attesterSlashings.length, MAX_ATTESTER_SLASHINGS_ELECTRA],
|
|
231
|
-
["attestations", body.attestations.length, MAX_ATTESTATIONS_ELECTRA],
|
|
232
|
-
["deposits", body.deposits.length, 0],
|
|
233
|
-
["voluntaryExits", body.voluntaryExits.length, MAX_VOLUNTARY_EXITS],
|
|
234
|
-
["blsToExecutionChanges", body.blsToExecutionChanges.length, MAX_BLS_TO_EXECUTION_CHANGES],
|
|
235
|
-
["payloadAttestations", body.payloadAttestations.length, MAX_PAYLOAD_ATTESTATIONS],
|
|
236
|
-
];
|
|
237
|
-
for (const [name, count, limit] of countLimits) {
|
|
238
|
-
if (count > limit) {
|
|
239
|
-
throw new BlockGossipError(GossipAction.REJECT, {
|
|
240
|
-
code: BlockErrorCode.TOO_MANY_BLOCK_OPERATIONS,
|
|
241
|
-
name,
|
|
242
|
-
count,
|
|
243
|
-
limit,
|
|
244
|
-
});
|
|
245
|
-
}
|
|
191
|
+
// [REJECT] The block contains no deposits.
|
|
192
|
+
if (body.deposits.length !== 0) {
|
|
193
|
+
throw new BlockGossipError(GossipAction.REJECT, {
|
|
194
|
+
code: BlockErrorCode.NON_ZERO_DEPOSITS,
|
|
195
|
+
slot: blockSlot,
|
|
196
|
+
root: blockRoot,
|
|
197
|
+
count: body.deposits.length,
|
|
198
|
+
});
|
|
246
199
|
}
|
|
247
200
|
|
|
248
201
|
// TODO GLOAS: [REJECT] The block's execution payload parent (defined by bid.parent_block_hash) passes all validation
|
|
249
202
|
// This requires execution engine integration to verify the parent block hash
|
|
250
203
|
}
|
|
251
204
|
|
|
252
|
-
//
|
|
253
|
-
//
|
|
205
|
+
// For gossip forwarding we only need the state to check the block's proposer index.
|
|
206
|
+
// If the state cannot be regenerated we throw an IGNORE (whereas the spec says we should REJECT for the
|
|
207
|
+
// finalized-ancestor scenario, which is already guarded by the parentBlock lookup above).
|
|
254
208
|
// this is something we should change this in the future to make the code airtight to the spec.
|
|
255
209
|
// [IGNORE] The block's parent (defined by block.parent_root) has been seen (via both gossip and non-gossip sources) (a client MAY queue blocks for processing once the parent block is retrieved).
|
|
256
210
|
// [REJECT] The block's parent (defined by block.parent_root) passes validation.
|
|
257
|
-
const
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
211
|
+
const canUseParentState = blockEpoch - computeEpochAtSlot(parentBlock.slot) <= MIN_SEED_LOOKAHEAD;
|
|
212
|
+
|
|
213
|
+
const getValidationState = async () => {
|
|
214
|
+
const getPreState = () =>
|
|
215
|
+
chain.regen.getPreState(block, {dontTransferCache: true}, RegenCaller.validateGossipBlock);
|
|
216
|
+
if (canUseParentState) {
|
|
217
|
+
try {
|
|
218
|
+
const parentState = await chain.regen.getState(parentBlock.stateRoot, RegenCaller.validateGossipBlock);
|
|
219
|
+
chain.metrics?.gossipBlock.preStateSource.inc({source: "parentState"});
|
|
220
|
+
return parentState;
|
|
221
|
+
} catch {
|
|
222
|
+
// if parent state is not in memory, we fall back to disk reload / dial-forward
|
|
223
|
+
chain.metrics?.gossipBlock.preStateSource.inc({source: "fallbackPreState"});
|
|
224
|
+
chain.logger.debug("Parent state not in memory, falling back to getPreState for gossip block validation", {
|
|
225
|
+
slot: blockSlot,
|
|
226
|
+
root: blockRoot,
|
|
227
|
+
parentSlot: parentBlock.slot,
|
|
228
|
+
parentRoot,
|
|
229
|
+
});
|
|
230
|
+
return getPreState();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
// parent is >1 epoch behind (deep skip) → beyond proposer-lookahead range, must dial forward
|
|
234
|
+
chain.metrics?.gossipBlock.preStateSource.inc({source: "preState"});
|
|
235
|
+
chain.logger.debug("Cannot use parent state for gossip block validation, dialing forward via getPreState", {
|
|
236
|
+
slot: blockSlot,
|
|
237
|
+
root: blockRoot,
|
|
238
|
+
parentSlot: parentBlock.slot,
|
|
239
|
+
parentRoot,
|
|
261
240
|
});
|
|
241
|
+
return getPreState();
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
const state = await getValidationState().catch(() => {
|
|
245
|
+
throw new BlockGossipError(GossipAction.IGNORE, {code: BlockErrorCode.PARENT_BLOCK_UNKNOWN, parentRoot});
|
|
246
|
+
});
|
|
262
247
|
|
|
263
248
|
// in forky condition, make sure to populate ShufflingCache with regened state
|
|
264
|
-
chain.shufflingCache.processState(
|
|
249
|
+
chain.shufflingCache.processState(state);
|
|
265
250
|
|
|
266
251
|
// [REJECT] The block's execution payload timestamp is correct with respect to the slot
|
|
267
252
|
// -- i.e. execution_payload.timestamp == compute_timestamp_at_slot(state, block.slot).
|
|
268
253
|
if (isForkPostBellatrix(fork) && !isForkPostGloas(fork)) {
|
|
269
254
|
if (!isExecutionBlockBodyType(block.body)) throw Error("Not execution block body type");
|
|
270
255
|
const executionPayload = block.body.executionPayload;
|
|
271
|
-
if (isStatePostBellatrix(
|
|
256
|
+
if (isStatePostBellatrix(state) && state.isExecutionStateType && state.isExecutionEnabled(block)) {
|
|
272
257
|
const expectedTimestamp = computeTimeAtSlot(config, blockSlot, chain.genesisTime);
|
|
273
258
|
if (executionPayload.timestamp !== computeTimeAtSlot(config, blockSlot, chain.genesisTime)) {
|
|
274
259
|
throw new BlockGossipError(GossipAction.REJECT, {
|
|
275
260
|
code: BlockErrorCode.INCORRECT_TIMESTAMP,
|
|
261
|
+
slot: blockSlot,
|
|
262
|
+
root: blockRoot,
|
|
276
263
|
timestamp: executionPayload.timestamp,
|
|
277
264
|
expectedTimestamp,
|
|
278
265
|
});
|
|
@@ -281,8 +268,13 @@ export async function validateGossipBlock(
|
|
|
281
268
|
}
|
|
282
269
|
|
|
283
270
|
// [REJECT] The proposer index is a valid validator index
|
|
284
|
-
if (proposerIndex >=
|
|
285
|
-
throw new BlockGossipError(GossipAction.REJECT, {
|
|
271
|
+
if (proposerIndex >= state.validatorCount) {
|
|
272
|
+
throw new BlockGossipError(GossipAction.REJECT, {
|
|
273
|
+
code: BlockErrorCode.UNKNOWN_PROPOSER,
|
|
274
|
+
slot: blockSlot,
|
|
275
|
+
root: blockRoot,
|
|
276
|
+
proposerIndex,
|
|
277
|
+
});
|
|
286
278
|
}
|
|
287
279
|
|
|
288
280
|
// [REJECT] The proposer signature, signed_beacon_block.signature, is valid with respect to the proposer_index pubkey.
|
|
@@ -293,8 +285,13 @@ export async function validateGossipBlock(
|
|
|
293
285
|
// shuffling (defined by parent_root/slot). If the proposer_index cannot immediately be verified against the expected
|
|
294
286
|
// shuffling, the block MAY be queued for later processing while proposers for the block's branch are calculated --
|
|
295
287
|
// in such a case do not REJECT, instead IGNORE this message.
|
|
296
|
-
if (
|
|
297
|
-
throw new BlockGossipError(GossipAction.REJECT, {
|
|
288
|
+
if (state.getBeaconProposer(blockSlot) !== proposerIndex) {
|
|
289
|
+
throw new BlockGossipError(GossipAction.REJECT, {
|
|
290
|
+
code: BlockErrorCode.INCORRECT_PROPOSER,
|
|
291
|
+
slot: blockSlot,
|
|
292
|
+
root: blockRoot,
|
|
293
|
+
proposerIndex,
|
|
294
|
+
});
|
|
298
295
|
}
|
|
299
296
|
|
|
300
297
|
// Simple implementation of a pending block queue. Keeping the block here recycles the queue logic, and keeps the
|
|
@@ -339,7 +336,8 @@ export async function verifyBlockProposerSignature(
|
|
|
339
336
|
if (!(await chain.bls.verifySignatureSets([signatureSet], {verifyOnMainThread: opts.verifyOnMainThread ?? true}))) {
|
|
340
337
|
throw new BlockGossipError(GossipAction.REJECT, {
|
|
341
338
|
code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID,
|
|
342
|
-
blockSlot,
|
|
339
|
+
slot: blockSlot,
|
|
340
|
+
root: blockRoot,
|
|
343
341
|
});
|
|
344
342
|
}
|
|
345
343
|
|