@lodestar/beacon-node 1.42.0-rc.0 → 1.43.0-dev.07875b3e0c
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 +21 -4
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +4 -0
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +13 -10
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +2 -2
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/lodestar/attesterSlashing.d.ts +8 -0
- package/lib/api/impl/lodestar/attesterSlashing.d.ts.map +1 -0
- package/lib/api/impl/lodestar/attesterSlashing.js +29 -0
- package/lib/api/impl/lodestar/attesterSlashing.js.map +1 -0
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +39 -0
- package/lib/api/impl/lodestar/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +8 -5
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +1 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +1 -2
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +4 -4
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts +4 -4
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.d.ts.map +1 -1
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js +2 -4
- package/lib/chain/archiveStore/strategies/frequencyStateArchiveStrategy.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +2 -2
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +110 -58
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +29 -35
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +15 -14
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +69 -82
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +1 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +3 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +20 -0
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +5 -0
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +6 -4
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +15 -21
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +3 -2
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +4 -2
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.d.ts +24 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.d.ts.map +1 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js +76 -0
- package/lib/chain/blocks/verifyExecutionPayloadEnvelope.js.map +1 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +14 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +25 -0
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -0
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts +1 -1
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js +2 -11
- package/lib/chain/blocks/writePayloadEnvelopeInputToDb.js.map +1 -1
- package/lib/chain/chain.d.ts +5 -4
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +32 -38
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +16 -4
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -0
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +8 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +4 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +11 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +4 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +5 -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 +5 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +1 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +21 -23
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/interface.d.ts +4 -3
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts +2 -2
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +7 -0
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +5 -2
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.d.ts +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.d.ts.map +1 -1
- package/lib/chain/opPools/executionPayloadBidPool.js +2 -2
- package/lib/chain/opPools/executionPayloadBidPool.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +32 -11
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +1 -7
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +1 -28
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -10
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +49 -19
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/errors.d.ts +1 -11
- package/lib/chain/regen/errors.d.ts.map +1 -1
- package/lib/chain/regen/errors.js +0 -2
- package/lib/chain/regen/errors.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +6 -12
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +6 -11
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +8 -40
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +0 -5
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +7 -34
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +11 -4
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +20 -18
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/stateCache/datastore/db.d.ts +5 -4
- package/lib/chain/stateCache/datastore/db.d.ts.map +1 -1
- package/lib/chain/stateCache/datastore/db.js +10 -32
- package/lib/chain/stateCache/datastore/db.js.map +1 -1
- package/lib/chain/stateCache/datastore/file.d.ts +1 -1
- package/lib/chain/stateCache/datastore/file.d.ts.map +1 -1
- package/lib/chain/stateCache/datastore/file.js +5 -5
- package/lib/chain/stateCache/datastore/file.js.map +1 -1
- package/lib/chain/stateCache/datastore/types.d.ts +1 -1
- package/lib/chain/stateCache/datastore/types.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts +1 -7
- package/lib/chain/stateCache/fifoBlockStateCache.d.ts.map +1 -1
- package/lib/chain/stateCache/fifoBlockStateCache.js +0 -8
- package/lib/chain/stateCache/fifoBlockStateCache.js.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts +13 -30
- package/lib/chain/stateCache/persistentCheckpointsCache.d.ts.map +1 -1
- package/lib/chain/stateCache/persistentCheckpointsCache.js +120 -216
- package/lib/chain/stateCache/persistentCheckpointsCache.js.map +1 -1
- package/lib/chain/stateCache/types.d.ts +8 -15
- package/lib/chain/stateCache/types.d.ts.map +1 -1
- package/lib/chain/stateCache/types.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +12 -0
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +12 -0
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +27 -5
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +19 -4
- 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 +27 -12
- 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 +8 -4
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/syncCommittee.d.ts.map +1 -1
- package/lib/chain/validation/syncCommittee.js +4 -0
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +4 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +3 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js +1 -1
- package/lib/db/repositories/executionPayloadEnvelopeArchive.js.map +1 -1
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +21 -14
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +1 -0
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +6 -0
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/types.d.ts +20 -0
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +18 -0
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +3 -2
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/network.js +1 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +26 -6
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js +2 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js +2 -0
- package/lib/network/reqresp/handlers/beaconBlocksByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +7 -3
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +6 -0
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +7 -3
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +2 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +3 -8
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +6 -1
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/notifier.d.ts.map +1 -1
- package/lib/node/notifier.js +2 -2
- package/lib/node/notifier.js.map +1 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +16 -3
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +30 -4
- package/src/api/impl/beacon/pool/index.ts +4 -0
- package/src/api/impl/beacon/state/index.ts +15 -15
- package/src/api/impl/beacon/state/utils.ts +2 -2
- package/src/api/impl/lodestar/attesterSlashing.ts +43 -0
- package/src/api/impl/lodestar/index.ts +51 -1
- package/src/api/impl/validator/index.ts +10 -6
- package/src/chain/GetBlobsTracker.ts +1 -2
- package/src/chain/archiveStore/archiveStore.ts +5 -5
- package/src/chain/archiveStore/interface.ts +4 -4
- package/src/chain/archiveStore/strategies/frequencyStateArchiveStrategy.ts +6 -8
- package/src/chain/archiveStore/utils/archiveBlocks.ts +153 -94
- package/src/chain/blocks/importBlock.ts +33 -42
- package/src/chain/blocks/importExecutionPayload.ts +83 -99
- package/src/chain/blocks/index.ts +1 -2
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +27 -0
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +6 -5
- package/src/chain/blocks/types.ts +15 -26
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +2 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +9 -2
- package/src/chain/blocks/verifyExecutionPayloadEnvelope.ts +129 -0
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +38 -0
- package/src/chain/blocks/writePayloadEnvelopeInputToDb.ts +9 -18
- package/src/chain/chain.ts +47 -62
- package/src/chain/emitter.ts +15 -3
- package/src/chain/errors/attestationError.ts +6 -1
- package/src/chain/errors/blockError.ts +7 -1
- package/src/chain/errors/executionPayloadBid.ts +6 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +6 -0
- package/src/chain/forkChoice/index.ts +19 -28
- package/src/chain/interface.ts +7 -2
- package/src/chain/lightClient/index.ts +15 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +6 -1
- package/src/chain/opPools/executionPayloadBidPool.ts +3 -3
- package/src/chain/prepareNextSlot.ts +38 -11
- package/src/chain/produceBlock/computeNewStateRoot.ts +1 -37
- package/src/chain/produceBlock/produceBlockBody.ts +74 -23
- package/src/chain/regen/errors.ts +1 -6
- package/src/chain/regen/interface.ts +6 -12
- package/src/chain/regen/queued.ts +12 -48
- package/src/chain/regen/regen.ts +8 -36
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +22 -20
- package/src/chain/stateCache/datastore/db.ts +10 -33
- package/src/chain/stateCache/datastore/file.ts +5 -6
- package/src/chain/stateCache/datastore/types.ts +2 -3
- package/src/chain/stateCache/fifoBlockStateCache.ts +1 -10
- package/src/chain/stateCache/persistentCheckpointsCache.ts +139 -247
- package/src/chain/stateCache/types.ts +8 -14
- package/src/chain/validation/aggregateAndProof.ts +13 -0
- package/src/chain/validation/attestation.ts +13 -0
- package/src/chain/validation/block.ts +30 -7
- package/src/chain/validation/executionPayloadBid.ts +21 -3
- package/src/chain/validation/executionPayloadEnvelope.ts +32 -13
- package/src/chain/validation/payloadAttestationMessage.ts +9 -3
- package/src/chain/validation/syncCommittee.ts +5 -1
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +5 -1
- package/src/chain/validatorMonitor.ts +3 -2
- package/src/db/repositories/executionPayloadEnvelopeArchive.ts +1 -1
- package/src/execution/engine/http.ts +21 -14
- package/src/execution/engine/interface.ts +1 -0
- package/src/execution/engine/mock.ts +8 -1
- package/src/execution/engine/types.ts +41 -0
- package/src/network/network.ts +1 -1
- package/src/network/processor/gossipHandlers.ts +31 -10
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +3 -1
- package/src/network/reqresp/handlers/beaconBlocksByRoot.ts +3 -0
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +15 -3
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +11 -0
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +19 -3
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +3 -1
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +3 -12
- package/src/node/nodejs.ts +7 -2
- package/src/node/notifier.ts +7 -2
- package/src/util/sszBytes.ts +21 -3
|
@@ -745,13 +745,29 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
745
745
|
});
|
|
746
746
|
}
|
|
747
747
|
|
|
748
|
-
chain.processExecutionPayload
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
);
|
|
754
|
-
|
|
748
|
+
// NOTE: we do NOT call chain.processExecutionPayload here. That is triggered only by
|
|
749
|
+
// envelope arrival (gossip or API). An in-flight importExecutionPayload is awaiting
|
|
750
|
+
// payloadInput.waitForAllData(); addColumn above will resolve it once hasAllData flips.
|
|
751
|
+
|
|
752
|
+
if (!payloadInput.isComplete()) {
|
|
753
|
+
const cutoffTimeMs = getCutoffTimeMs(chain, dataColumnSlot, BLOCK_AVAILABILITY_CUTOFF_MS);
|
|
754
|
+
// do not await here to not delay gossip validation
|
|
755
|
+
payloadInput.waitForEnvelopeAndAllData(cutoffTimeMs).catch((_e) => {
|
|
756
|
+
chain.logger.debug(
|
|
757
|
+
"Waited for envelope and data after receiving gossip column. Cut-off reached so emitting incompletePayloadEnvelope",
|
|
758
|
+
{
|
|
759
|
+
dataColumnIndex: index,
|
|
760
|
+
...payloadInputMeta,
|
|
761
|
+
}
|
|
762
|
+
);
|
|
763
|
+
// TODO GLOAS: UnknownBlockSync to handle this event
|
|
764
|
+
chain.emitter.emit(ChainEvent.incompletePayloadEnvelope, {
|
|
765
|
+
payloadInput,
|
|
766
|
+
peer: peerIdStr,
|
|
767
|
+
source: BlockInputSource.gossip,
|
|
768
|
+
});
|
|
769
|
+
});
|
|
770
|
+
}
|
|
755
771
|
} else {
|
|
756
772
|
if (config.getForkSeq(dataColumnSlot) < ForkSeq.fulu) {
|
|
757
773
|
throw new GossipActionError(GossipAction.REJECT, {code: "PRE_FULU_BLOCK"});
|
|
@@ -1049,7 +1065,8 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1049
1065
|
await validateGossipExecutionPayloadEnvelope(chain, signedEnvelope);
|
|
1050
1066
|
} catch (e) {
|
|
1051
1067
|
if (e instanceof ExecutionPayloadEnvelopeError) {
|
|
1052
|
-
const {
|
|
1068
|
+
const {beaconBlockRoot} = signedEnvelope.message;
|
|
1069
|
+
const slot = signedEnvelope.message.payload.slotNumber;
|
|
1053
1070
|
logger.debug("Gossip envelope has error", {slot, root: toRootHex(beaconBlockRoot), code: e.type.code});
|
|
1054
1071
|
if (e.type.code === ExecutionPayloadEnvelopeErrorCode.BLOCK_ROOT_UNKNOWN) {
|
|
1055
1072
|
// TODO GLOAS: UnknownBlockSync to handle this
|
|
@@ -1072,7 +1089,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1072
1089
|
throw e;
|
|
1073
1090
|
}
|
|
1074
1091
|
|
|
1075
|
-
const slot = envelope.
|
|
1092
|
+
const slot = envelope.payload.slotNumber;
|
|
1076
1093
|
const delaySec = seenTimestampSec - computeTimeAtSlot(config, slot, chain.genesisTime);
|
|
1077
1094
|
metrics?.gossipExecutionPayloadEnvelope.elapsedTimeTillReceived.observe({source: OpSource.gossip}, delaySec);
|
|
1078
1095
|
chain.validatorMonitor?.registerExecutionPayloadEnvelope(OpSource.gossip, delaySec, signedEnvelope);
|
|
@@ -1102,7 +1119,6 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1102
1119
|
builderIndex: envelope.builderIndex,
|
|
1103
1120
|
blockHash: toRootHex(envelope.payload.blockHash),
|
|
1104
1121
|
blockRoot: blockRootHex,
|
|
1105
|
-
stateRoot: toRootHex(envelope.stateRoot),
|
|
1106
1122
|
});
|
|
1107
1123
|
|
|
1108
1124
|
chain.processExecutionPayload(payloadInput, {validSignature: true}).catch((e) => {
|
|
@@ -1148,6 +1164,11 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1148
1164
|
} catch (e) {
|
|
1149
1165
|
logger.error("Error adding to executionPayloadBid pool", {}, e as Error);
|
|
1150
1166
|
}
|
|
1167
|
+
|
|
1168
|
+
chain.emitter.emit(routes.events.EventType.executionPayloadBid, {
|
|
1169
|
+
version: config.getForkName(executionPayloadBid.message.slot),
|
|
1170
|
+
data: executionPayloadBid,
|
|
1171
|
+
});
|
|
1151
1172
|
},
|
|
1152
1173
|
};
|
|
1153
1174
|
}
|
|
@@ -96,11 +96,13 @@ export function validateBeaconBlocksByRangeRequest(
|
|
|
96
96
|
if (count < 1) {
|
|
97
97
|
throw new ResponseError(RespStatus.INVALID_REQUEST, "count < 1");
|
|
98
98
|
}
|
|
99
|
-
// TODO: validate against MIN_EPOCHS_FOR_BLOCK_REQUESTS
|
|
100
99
|
if (startSlot < GENESIS_SLOT) {
|
|
101
100
|
throw new ResponseError(RespStatus.INVALID_REQUEST, "startSlot < genesis");
|
|
102
101
|
}
|
|
103
102
|
|
|
103
|
+
// The phase0 req/resp spec uses MIN_EPOCHS_FOR_BLOCK_REQUESTS to define the minimum range peers MUST serve.
|
|
104
|
+
// Archival nodes may still serve older retained blocks to allow genesis sync.
|
|
105
|
+
|
|
104
106
|
// step > 1 is deprecated, see https://github.com/ethereum/consensus-specs/pull/2856
|
|
105
107
|
|
|
106
108
|
const maxRequestBlocks = isForkPostDeneb(config.getForkName(startSlot))
|
|
@@ -8,6 +8,9 @@ export async function* onBeaconBlocksByRoot(
|
|
|
8
8
|
requestBody: BeaconBlocksByRootRequest,
|
|
9
9
|
chain: IBeaconChain
|
|
10
10
|
): AsyncIterable<ResponseOutgoing> {
|
|
11
|
+
// The phase0 req/resp spec uses MIN_EPOCHS_FOR_BLOCK_REQUESTS to define the minimum range peers MUST serve.
|
|
12
|
+
// Archival nodes may still serve older retained blocks to allow genesis sync.
|
|
13
|
+
|
|
11
14
|
for (const blockRoot of requestBody) {
|
|
12
15
|
const root = blockRoot;
|
|
13
16
|
const block = await chain.getSerializedBlockByRoot(toRootHex(root));
|
|
@@ -2,7 +2,7 @@ import {ChainConfig} from "@lodestar/config";
|
|
|
2
2
|
import {BLOB_SIDECAR_FIXED_SIZE, GENESIS_SLOT} from "@lodestar/params";
|
|
3
3
|
import {RespStatus, ResponseError, ResponseOutgoing} from "@lodestar/reqresp";
|
|
4
4
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
5
|
-
import {Slot, deneb} from "@lodestar/types";
|
|
5
|
+
import {Epoch, Slot, deneb} from "@lodestar/types";
|
|
6
6
|
import {fromHex} from "@lodestar/utils";
|
|
7
7
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
8
8
|
import {IBeaconDb} from "../../../db/index.js";
|
|
@@ -14,7 +14,7 @@ export async function* onBlobSidecarsByRange(
|
|
|
14
14
|
db: IBeaconDb
|
|
15
15
|
): AsyncIterable<ResponseOutgoing> {
|
|
16
16
|
// Non-finalized range of blobs
|
|
17
|
-
const {startSlot, count} = validateBlobSidecarsByRangeRequest(chain.config, request);
|
|
17
|
+
const {startSlot, count} = validateBlobSidecarsByRangeRequest(chain.config, chain.clock.currentEpoch, request);
|
|
18
18
|
const endSlot = startSlot + count;
|
|
19
19
|
|
|
20
20
|
const finalized = db.blobSidecarsArchive;
|
|
@@ -94,6 +94,7 @@ export function* iterateBlobBytesFromWrapper(
|
|
|
94
94
|
|
|
95
95
|
export function validateBlobSidecarsByRangeRequest(
|
|
96
96
|
config: ChainConfig,
|
|
97
|
+
currentEpoch: Epoch,
|
|
97
98
|
request: deneb.BlobSidecarsByRangeRequest
|
|
98
99
|
): deneb.BlobSidecarsByRangeRequest {
|
|
99
100
|
const {startSlot} = request;
|
|
@@ -102,11 +103,22 @@ export function validateBlobSidecarsByRangeRequest(
|
|
|
102
103
|
if (count < 1) {
|
|
103
104
|
throw new ResponseError(RespStatus.INVALID_REQUEST, "count < 1");
|
|
104
105
|
}
|
|
105
|
-
// TODO: validate against MIN_EPOCHS_FOR_BLOCK_REQUESTS
|
|
106
106
|
if (startSlot < GENESIS_SLOT) {
|
|
107
107
|
throw new ResponseError(RespStatus.INVALID_REQUEST, "startSlot < genesis");
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
// Spec: [max(current_epoch - MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS, DENEB_FORK_EPOCH), current_epoch]
|
|
111
|
+
const minimumRequestEpoch = Math.max(
|
|
112
|
+
currentEpoch - config.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,
|
|
113
|
+
config.DENEB_FORK_EPOCH
|
|
114
|
+
);
|
|
115
|
+
if (computeEpochAtSlot(startSlot) < minimumRequestEpoch) {
|
|
116
|
+
throw new ResponseError(
|
|
117
|
+
RespStatus.RESOURCE_UNAVAILABLE,
|
|
118
|
+
"startSlot is before MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS"
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
110
122
|
if (count > config.MAX_REQUEST_BLOCKS_DENEB) {
|
|
111
123
|
count = config.MAX_REQUEST_BLOCKS_DENEB;
|
|
112
124
|
}
|
|
@@ -12,6 +12,13 @@ export async function* onBlobSidecarsByRoot(
|
|
|
12
12
|
): AsyncIterable<ResponseOutgoing> {
|
|
13
13
|
const finalizedSlot = chain.forkChoice.getFinalizedBlock().slot;
|
|
14
14
|
|
|
15
|
+
// Spec: [max(current_epoch - MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS, DENEB_FORK_EPOCH), current_epoch]
|
|
16
|
+
const currentEpoch = chain.clock.currentEpoch;
|
|
17
|
+
const minimumRequestEpoch = Math.max(
|
|
18
|
+
currentEpoch - chain.config.MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS,
|
|
19
|
+
chain.config.DENEB_FORK_EPOCH
|
|
20
|
+
);
|
|
21
|
+
|
|
15
22
|
// In sidecars by root request, it can be expected that sidecar requests will be come
|
|
16
23
|
// clustured by blockroots, and this helps us save db lookups once we load sidecars
|
|
17
24
|
// for a root
|
|
@@ -29,6 +36,10 @@ export async function* onBlobSidecarsByRoot(
|
|
|
29
36
|
continue;
|
|
30
37
|
}
|
|
31
38
|
|
|
39
|
+
if (computeEpochAtSlot(block.slot) < minimumRequestEpoch) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
|
|
32
43
|
// Check if we need to load sidecars for a new block root
|
|
33
44
|
if (lastFetchedSideCars === null || lastFetchedSideCars.blockRoot !== blockRootHex) {
|
|
34
45
|
const blobSidecarsBytes = await chain.getSerializedBlobSidecars(block.slot, blockRootHex);
|
|
@@ -3,7 +3,7 @@ import {ChainConfig} from "@lodestar/config";
|
|
|
3
3
|
import {GENESIS_SLOT} from "@lodestar/params";
|
|
4
4
|
import {RespStatus, ResponseError, ResponseOutgoing} from "@lodestar/reqresp";
|
|
5
5
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
6
|
-
import {ColumnIndex, fulu} from "@lodestar/types";
|
|
6
|
+
import {ColumnIndex, Epoch, fulu} from "@lodestar/types";
|
|
7
7
|
import {fromHex} from "@lodestar/utils";
|
|
8
8
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
9
9
|
import {IBeaconDb} from "../../../db/index.js";
|
|
@@ -21,7 +21,11 @@ export async function* onDataColumnSidecarsByRange(
|
|
|
21
21
|
peerClient: string
|
|
22
22
|
): AsyncIterable<ResponseOutgoing> {
|
|
23
23
|
// Non-finalized range of columns
|
|
24
|
-
const {
|
|
24
|
+
const {
|
|
25
|
+
startSlot,
|
|
26
|
+
count,
|
|
27
|
+
columns: requestedColumns,
|
|
28
|
+
} = validateDataColumnSidecarsByRangeRequest(chain.config, chain.clock.currentEpoch, request);
|
|
25
29
|
const availableColumns = validateRequestedDataColumns(chain, requestedColumns);
|
|
26
30
|
const endSlot = startSlot + count;
|
|
27
31
|
|
|
@@ -139,6 +143,7 @@ export async function* onDataColumnSidecarsByRange(
|
|
|
139
143
|
|
|
140
144
|
export function validateDataColumnSidecarsByRangeRequest(
|
|
141
145
|
config: ChainConfig,
|
|
146
|
+
currentEpoch: Epoch,
|
|
142
147
|
request: fulu.DataColumnSidecarsByRangeRequest
|
|
143
148
|
): fulu.DataColumnSidecarsByRangeRequest {
|
|
144
149
|
const {startSlot, columns} = request;
|
|
@@ -147,11 +152,22 @@ export function validateDataColumnSidecarsByRangeRequest(
|
|
|
147
152
|
if (count < 1) {
|
|
148
153
|
throw new ResponseError(RespStatus.INVALID_REQUEST, "count < 1");
|
|
149
154
|
}
|
|
150
|
-
// TODO: validate against MIN_EPOCHS_FOR_BLOCK_REQUESTS
|
|
151
155
|
if (startSlot < GENESIS_SLOT) {
|
|
152
156
|
throw new ResponseError(RespStatus.INVALID_REQUEST, "startSlot < genesis");
|
|
153
157
|
}
|
|
154
158
|
|
|
159
|
+
// Spec: [max(current_epoch - MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS, FULU_FORK_EPOCH), current_epoch]
|
|
160
|
+
const minimumRequestEpoch = Math.max(
|
|
161
|
+
currentEpoch - config.MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS,
|
|
162
|
+
config.FULU_FORK_EPOCH
|
|
163
|
+
);
|
|
164
|
+
if (computeEpochAtSlot(startSlot) < minimumRequestEpoch) {
|
|
165
|
+
throw new ResponseError(
|
|
166
|
+
RespStatus.RESOURCE_UNAVAILABLE,
|
|
167
|
+
"startSlot is before MIN_EPOCHS_FOR_DATA_COLUMN_SIDECARS_REQUESTS"
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
155
171
|
if (count > config.MAX_REQUEST_BLOCKS_DENEB) {
|
|
156
172
|
count = config.MAX_REQUEST_BLOCKS_DENEB;
|
|
157
173
|
}
|
|
@@ -81,11 +81,13 @@ export function validateExecutionPayloadEnvelopesByRangeRequest(
|
|
|
81
81
|
if (count < 1) {
|
|
82
82
|
throw new ResponseError(RespStatus.INVALID_REQUEST, "count < 1");
|
|
83
83
|
}
|
|
84
|
-
// TODO: validate against MIN_EPOCHS_FOR_BLOCK_REQUESTS
|
|
85
84
|
if (startSlot < GENESIS_SLOT) {
|
|
86
85
|
throw new ResponseError(RespStatus.INVALID_REQUEST, "startSlot < genesis");
|
|
87
86
|
}
|
|
88
87
|
|
|
88
|
+
// The gloas req/resp spec uses MIN_EPOCHS_FOR_BLOCK_REQUESTS to define the minimum range peers MUST serve.
|
|
89
|
+
// Archival nodes may still serve older retained payloads to allow genesis sync.
|
|
90
|
+
|
|
89
91
|
if (count > config.MAX_REQUEST_BLOCKS_DENEB) {
|
|
90
92
|
count = config.MAX_REQUEST_BLOCKS_DENEB;
|
|
91
93
|
}
|
|
@@ -10,12 +10,8 @@ export async function* onExecutionPayloadEnvelopesByRoot(
|
|
|
10
10
|
chain: IBeaconChain,
|
|
11
11
|
db: IBeaconDb
|
|
12
12
|
): AsyncIterable<ResponseOutgoing> {
|
|
13
|
-
//
|
|
14
|
-
|
|
15
|
-
const minimumRequestEpoch = Math.max(
|
|
16
|
-
currentEpoch - chain.config.MIN_EPOCHS_FOR_BLOCK_REQUESTS,
|
|
17
|
-
chain.config.GLOAS_FORK_EPOCH
|
|
18
|
-
);
|
|
13
|
+
// The gloas req/resp spec uses MIN_EPOCHS_FOR_BLOCK_REQUESTS to define the minimum range peers MUST serve.
|
|
14
|
+
// Archival nodes may still serve older retained payloads to allow genesis sync.
|
|
19
15
|
|
|
20
16
|
for (const root of requestBody) {
|
|
21
17
|
const rootHex = toRootHex(root);
|
|
@@ -27,16 +23,11 @@ export async function* onExecutionPayloadEnvelopesByRoot(
|
|
|
27
23
|
continue;
|
|
28
24
|
}
|
|
29
25
|
|
|
30
|
-
const requestedEpoch = computeEpochAtSlot(slot);
|
|
31
|
-
if (requestedEpoch < minimumRequestEpoch) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
26
|
const envelopeBytes = await chain.getSerializedExecutionPayloadEnvelope(slot, rootHex);
|
|
36
27
|
if (envelopeBytes) {
|
|
37
28
|
yield {
|
|
38
29
|
data: envelopeBytes,
|
|
39
|
-
boundary: chain.config.getForkBoundaryAtEpoch(
|
|
30
|
+
boundary: chain.config.getForkBoundaryAtEpoch(computeEpochAtSlot(slot)),
|
|
40
31
|
};
|
|
41
32
|
}
|
|
42
33
|
}
|
package/src/node/nodejs.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {BeaconApiMethods} from "@lodestar/api/beacon/server";
|
|
|
6
6
|
import {BeaconConfig} from "@lodestar/config";
|
|
7
7
|
import type {LoggerNode} from "@lodestar/logger/node";
|
|
8
8
|
import {ZERO_HASH_HEX} from "@lodestar/params";
|
|
9
|
-
import {IBeaconStateView, PubkeyCache} from "@lodestar/state-transition";
|
|
9
|
+
import {IBeaconStateView, PubkeyCache, isStatePostBellatrix, isStatePostGloas} from "@lodestar/state-transition";
|
|
10
10
|
import {phase0} from "@lodestar/types";
|
|
11
11
|
import {sleep, toRootHex} from "@lodestar/utils";
|
|
12
12
|
import {ProcessShutdownCallback} from "@lodestar/validator";
|
|
@@ -221,7 +221,12 @@ export class BeaconNode {
|
|
|
221
221
|
|
|
222
222
|
let executionEngineOpts = opts.executionEngine;
|
|
223
223
|
if (opts.executionEngine.mode === "mock") {
|
|
224
|
-
const eth1BlockHash =
|
|
224
|
+
const eth1BlockHash =
|
|
225
|
+
isStatePostBellatrix(anchorState) && anchorState.isExecutionStateType
|
|
226
|
+
? isStatePostGloas(anchorState)
|
|
227
|
+
? toRootHex(anchorState.latestBlockHash)
|
|
228
|
+
: toRootHex(anchorState.latestExecutionPayloadHeader.blockHash)
|
|
229
|
+
: undefined;
|
|
225
230
|
executionEngineOpts = {
|
|
226
231
|
...opts.executionEngine,
|
|
227
232
|
genesisBlockHash: ZERO_HASH_HEX,
|
package/src/node/notifier.ts
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import {BeaconConfig} from "@lodestar/config";
|
|
2
2
|
import {ExecutionStatus, ProtoBlock} from "@lodestar/fork-choice";
|
|
3
3
|
import {EPOCHS_PER_SYNC_COMMITTEE_PERIOD, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
IBeaconStateView,
|
|
6
|
+
computeEpochAtSlot,
|
|
7
|
+
computeStartSlotAtEpoch,
|
|
8
|
+
isStatePostBellatrix,
|
|
9
|
+
} from "@lodestar/state-transition";
|
|
5
10
|
import {Epoch} from "@lodestar/types";
|
|
6
11
|
import {ErrorAborted, Logger, prettyBytes, prettyBytesShort, sleep} from "@lodestar/utils";
|
|
7
12
|
import {IBeaconChain} from "../chain/index.js";
|
|
@@ -165,7 +170,7 @@ function getHeadExecutionInfo(
|
|
|
165
170
|
const executionStatusStr = headInfo.executionStatus.toLowerCase();
|
|
166
171
|
|
|
167
172
|
// Add execution status to notifier only if head is on/post bellatrix
|
|
168
|
-
if (headState.isExecutionStateType) {
|
|
173
|
+
if (isStatePostBellatrix(headState) && headState.isExecutionStateType) {
|
|
169
174
|
if (headState.isMergeTransitionComplete) {
|
|
170
175
|
const executionPayloadHashInfo =
|
|
171
176
|
headInfo.executionStatus !== ExecutionStatus.PreMerge ? headInfo.executionPayloadBlockHash : "empty";
|
package/src/util/sszBytes.ts
CHANGED
|
@@ -560,8 +560,8 @@ export function getBeaconBlockRootFromDataColumnSidecarSerialized(data: Uint8Arr
|
|
|
560
560
|
* ├─ 4 bytes: executionRequests offset
|
|
561
561
|
* ├─ 8 bytes: builderIndex (offset 108-115)
|
|
562
562
|
* ├─ 32 bytes: beaconBlockRoot (offset 116-147)
|
|
563
|
-
*
|
|
564
|
-
*
|
|
563
|
+
* └─ variable: payload data (starts at envelope + 48)
|
|
564
|
+
* └─ ExecutionPayload fixed portion includes slotNumber at offset 532
|
|
565
565
|
*/
|
|
566
566
|
const SIGNED_EXECUTION_PAYLOAD_ENVELOPE_MESSAGE_OFFSET = 4;
|
|
567
567
|
const SIGNED_EXECUTION_PAYLOAD_ENVELOPE_SIGNATURE_SIZE = 96;
|
|
@@ -576,8 +576,26 @@ const BEACON_BLOCK_ROOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE =
|
|
|
576
576
|
EXECUTION_PAYLOAD_ENVELOPE_REQUESTS_OFFSET +
|
|
577
577
|
EXECUTION_PAYLOAD_ENVELOPE_BUILDER_INDEX_SIZE; // 116
|
|
578
578
|
|
|
579
|
+
// Envelope fixed portion (without slot): payload_offset(4) + requests_offset(4) + builderIndex(8) + beaconBlockRoot(32) = 48
|
|
580
|
+
const EXECUTION_PAYLOAD_ENVELOPE_FIXED_SIZE =
|
|
581
|
+
EXECUTION_PAYLOAD_ENVELOPE_PAYLOAD_OFFSET +
|
|
582
|
+
EXECUTION_PAYLOAD_ENVELOPE_REQUESTS_OFFSET +
|
|
583
|
+
EXECUTION_PAYLOAD_ENVELOPE_BUILDER_INDEX_SIZE +
|
|
584
|
+
ROOT_SIZE; // 48
|
|
585
|
+
|
|
586
|
+
// slotNumber offset within ExecutionPayload fixed portion:
|
|
587
|
+
// parentHash(32) + feeRecipient(20) + stateRoot(32) + receiptsRoot(32) + logsBloom(256) +
|
|
588
|
+
// prevRandao(32) + blockNumber(8) + gasLimit(8) + gasUsed(8) + timestamp(8) +
|
|
589
|
+
// extraData_offset(4) + baseFeePerGas(32) + blockHash(32) + transactions_offset(4) +
|
|
590
|
+
// withdrawals_offset(4) + blobGasUsed(8) + excessBlobGas(8) + blockAccessList_offset(4) = 532
|
|
591
|
+
const SLOT_NUMBER_OFFSET_IN_EXECUTION_PAYLOAD = 532;
|
|
592
|
+
|
|
593
|
+
// Payload data starts right after the envelope's fixed portion
|
|
594
|
+
const ENVELOPE_START_IN_SIGNED =
|
|
595
|
+
SIGNED_EXECUTION_PAYLOAD_ENVELOPE_MESSAGE_OFFSET + SIGNED_EXECUTION_PAYLOAD_ENVELOPE_SIGNATURE_SIZE; // 100
|
|
596
|
+
|
|
579
597
|
const SLOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE =
|
|
580
|
-
|
|
598
|
+
ENVELOPE_START_IN_SIGNED + EXECUTION_PAYLOAD_ENVELOPE_FIXED_SIZE + SLOT_NUMBER_OFFSET_IN_EXECUTION_PAYLOAD; // 100 + 48 + 532 = 680
|
|
581
599
|
|
|
582
600
|
export function getSlotFromExecutionPayloadEnvelopeSerialized(data: Uint8Array): Slot | null {
|
|
583
601
|
if (data.length < SLOT_OFFSET_IN_SIGNED_EXECUTION_PAYLOAD_ENVELOPE + SLOT_SIZE) {
|