@lodestar/beacon-node 1.42.0-dev.7e96447c23 → 1.42.0-dev.8300b502a6
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 +24 -12
- 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/debug/index.js.map +1 -1
- package/lib/api/impl/lodestar/index.d.ts.map +1 -1
- package/lib/api/impl/lodestar/index.js +4 -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 +9 -3
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +2 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +5 -5
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +2 -1
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +14 -12
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +1 -0
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +3 -3
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +6 -4
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.d.ts +2 -2
- 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/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 +1 -4
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -0
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +5 -5
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +4 -4
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +34 -20
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +10 -8
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +86 -49
- 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 +2 -1
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts +14 -6
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js +33 -2
- package/lib/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.d.ts +20 -14
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +4 -3
- 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/chain.d.ts +4 -2
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +82 -28
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +29 -7
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +12 -3
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +6 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +2 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts +31 -1
- package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
- package/lib/chain/errors/dataColumnSidecarError.js +7 -0
- package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +10 -8
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/interface.d.ts +5 -2
- package/lib/chain/interface.d.ts.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/options.d.ts +1 -0
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +7 -1
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +3 -3
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +8 -8
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +5 -5
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +23 -4
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +2 -2
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +2 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +14 -5
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.d.ts +11 -4
- package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
- package/lib/chain/validation/dataColumnSidecar.js +184 -5
- package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +7 -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 +6 -1
- 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 +4 -1
- 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/buckets.d.ts +2 -2
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -2
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecar.js +4 -2
- package/lib/db/repositories/dataColumnSidecar.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +4 -2
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +20 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +33 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/interface.d.ts +6 -3
- package/lib/network/interface.d.ts.map +1 -1
- package/lib/network/libp2p/index.d.ts.map +1 -1
- package/lib/network/libp2p/index.js +22 -11
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +6 -3
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +9 -0
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +7 -2
- package/lib/network/options.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +25 -5
- package/lib/network/processor/extractSlotRootFns.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +260 -73
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts +11 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +234 -22
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.d.ts.map +1 -1
- package/lib/network/reqresp/ReqRespBeaconNode.js +9 -0
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts +8 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js +69 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRange.js.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts +6 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.d.ts.map +1 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +28 -0
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -0
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +11 -1
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +2 -0
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +10 -0
- package/lib/network/reqresp/protocols.js.map +1 -1
- package/lib/network/reqresp/rateLimit.d.ts.map +1 -1
- package/lib/network/reqresp/rateLimit.js +8 -0
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/score.d.ts.map +1 -1
- package/lib/network/reqresp/score.js +2 -0
- package/lib/network/reqresp/score.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +10 -4
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +16 -4
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +4 -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/sync/unknownBlock.js +2 -2
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +3 -3
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +4 -2
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +3 -3
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +10 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/blobs.d.ts +3 -3
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +21 -10
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/dataColumns.d.ts +18 -11
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +51 -17
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/execution.d.ts +6 -2
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +49 -25
- package/lib/util/execution.js.map +1 -1
- package/lib/util/sszBytes.d.ts +25 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +189 -2
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +2 -0
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -0
- package/lib/util/types.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +32 -15
- package/src/api/impl/beacon/pool/index.ts +4 -0
- package/src/api/impl/beacon/state/index.ts +15 -15
- package/src/api/impl/debug/index.ts +2 -2
- package/src/api/impl/lodestar/index.ts +4 -0
- package/src/api/impl/validator/index.ts +9 -2
- package/src/chain/ColumnReconstructionTracker.ts +6 -5
- package/src/chain/GetBlobsTracker.ts +14 -12
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +6 -5
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +2 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -0
- package/src/chain/archiveStore/historicalState/worker.ts +1 -5
- package/src/chain/archiveStore/interface.ts +1 -0
- package/src/chain/blocks/blockInput/blockInput.ts +8 -8
- package/src/chain/blocks/blockInput/types.ts +4 -4
- package/src/chain/blocks/importBlock.ts +45 -23
- package/src/chain/blocks/importExecutionPayload.ts +94 -53
- package/src/chain/blocks/index.ts +2 -1
- package/src/chain/blocks/payloadEnvelopeInput/payloadEnvelopeInput.ts +53 -12
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/blocks/types.ts +25 -14
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +6 -5
- package/src/chain/blocks/verifyBlocksSignatures.ts +9 -2
- package/src/chain/chain.ts +95 -32
- package/src/chain/emitter.ts +25 -7
- package/src/chain/errors/blockError.ts +4 -1
- package/src/chain/errors/dataColumnSidecarError.ts +32 -1
- package/src/chain/forkChoice/index.ts +11 -8
- package/src/chain/interface.ts +5 -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/options.ts +2 -0
- package/src/chain/prepareNextSlot.ts +8 -0
- package/src/chain/produceBlock/computeNewStateRoot.ts +11 -10
- package/src/chain/produceBlock/produceBlockBody.ts +40 -10
- package/src/chain/seenCache/seenGossipBlockInput.ts +2 -2
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +2 -2
- package/src/chain/validation/block.ts +15 -7
- package/src/chain/validation/dataColumnSidecar.ts +230 -7
- package/src/chain/validation/executionPayloadBid.ts +7 -3
- package/src/chain/validation/executionPayloadEnvelope.ts +10 -1
- package/src/chain/validation/payloadAttestationMessage.ts +4 -0
- 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/buckets.ts +2 -2
- package/src/db/repositories/dataColumnSidecar.ts +4 -2
- package/src/db/repositories/dataColumnSidecarArchive.ts +4 -2
- package/src/metrics/metrics/lodestar.ts +34 -0
- package/src/network/interface.ts +17 -3
- package/src/network/libp2p/index.ts +24 -13
- package/src/network/network.ts +36 -5
- package/src/network/options.ts +7 -2
- package/src/network/processor/extractSlotRootFns.ts +32 -6
- package/src/network/processor/gossipHandlers.ts +325 -86
- package/src/network/processor/index.ts +304 -22
- package/src/network/reqresp/ReqRespBeaconNode.ts +13 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRange.ts +94 -0
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +43 -0
- package/src/network/reqresp/handlers/index.ts +12 -0
- package/src/network/reqresp/protocols.ts +12 -0
- package/src/network/reqresp/rateLimit.ts +18 -0
- package/src/network/reqresp/score.ts +2 -0
- package/src/network/reqresp/types.ts +26 -5
- package/src/node/nodejs.ts +5 -2
- package/src/node/notifier.ts +7 -2
- package/src/sync/unknownBlock.ts +3 -3
- package/src/sync/utils/downloadByRange.ts +9 -7
- package/src/sync/utils/downloadByRoot.ts +16 -12
- package/src/util/blobs.ts +35 -15
- package/src/util/dataColumns.ts +69 -25
- package/src/util/execution.ts +49 -30
- package/src/util/sszBytes.ts +245 -3
- package/src/util/types.ts +6 -0
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.42.0-dev.
|
|
14
|
+
"version": "1.42.0-dev.8300b502a6",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -113,7 +113,7 @@
|
|
|
113
113
|
"@chainsafe/discv5": "^12.0.1",
|
|
114
114
|
"@chainsafe/enr": "^6.0.1",
|
|
115
115
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
116
|
-
"@chainsafe/libp2p-quic": "^2.0.
|
|
116
|
+
"@chainsafe/libp2p-quic": "^2.0.1",
|
|
117
117
|
"@chainsafe/persistent-merkle-tree": "^1.2.1",
|
|
118
118
|
"@chainsafe/prometheus-gc-stats": "^1.0.0",
|
|
119
119
|
"@chainsafe/pubkey-index-map": "^3.0.0",
|
|
@@ -135,18 +135,18 @@
|
|
|
135
135
|
"@libp2p/peer-id": "^6.0.4",
|
|
136
136
|
"@libp2p/prometheus-metrics": "^5.0.14",
|
|
137
137
|
"@libp2p/tcp": "^11.0.13",
|
|
138
|
-
"@lodestar/api": "^1.42.0-dev.
|
|
139
|
-
"@lodestar/config": "^1.42.0-dev.
|
|
140
|
-
"@lodestar/db": "^1.42.0-dev.
|
|
141
|
-
"@lodestar/fork-choice": "^1.42.0-dev.
|
|
142
|
-
"@lodestar/light-client": "^1.42.0-dev.
|
|
143
|
-
"@lodestar/logger": "^1.42.0-dev.
|
|
144
|
-
"@lodestar/params": "^1.42.0-dev.
|
|
145
|
-
"@lodestar/reqresp": "^1.42.0-dev.
|
|
146
|
-
"@lodestar/state-transition": "^1.42.0-dev.
|
|
147
|
-
"@lodestar/types": "^1.42.0-dev.
|
|
148
|
-
"@lodestar/utils": "^1.42.0-dev.
|
|
149
|
-
"@lodestar/validator": "^1.42.0-dev.
|
|
138
|
+
"@lodestar/api": "^1.42.0-dev.8300b502a6",
|
|
139
|
+
"@lodestar/config": "^1.42.0-dev.8300b502a6",
|
|
140
|
+
"@lodestar/db": "^1.42.0-dev.8300b502a6",
|
|
141
|
+
"@lodestar/fork-choice": "^1.42.0-dev.8300b502a6",
|
|
142
|
+
"@lodestar/light-client": "^1.42.0-dev.8300b502a6",
|
|
143
|
+
"@lodestar/logger": "^1.42.0-dev.8300b502a6",
|
|
144
|
+
"@lodestar/params": "^1.42.0-dev.8300b502a6",
|
|
145
|
+
"@lodestar/reqresp": "^1.42.0-dev.8300b502a6",
|
|
146
|
+
"@lodestar/state-transition": "^1.42.0-dev.8300b502a6",
|
|
147
|
+
"@lodestar/types": "^1.42.0-dev.8300b502a6",
|
|
148
|
+
"@lodestar/utils": "^1.42.0-dev.8300b502a6",
|
|
149
|
+
"@lodestar/validator": "^1.42.0-dev.8300b502a6",
|
|
150
150
|
"@multiformats/multiaddr": "^13.0.1",
|
|
151
151
|
"datastore-core": "^11.0.2",
|
|
152
152
|
"datastore-fs": "^11.0.2",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"@libp2p/interface-internal": "^3.0.13",
|
|
170
170
|
"@libp2p/logger": "^6.2.2",
|
|
171
171
|
"@libp2p/utils": "^7.0.13",
|
|
172
|
-
"@lodestar/spec-test-util": "^1.42.0-dev.
|
|
172
|
+
"@lodestar/spec-test-util": "^1.42.0-dev.8300b502a6",
|
|
173
173
|
"@types/js-yaml": "^4.0.5",
|
|
174
174
|
"@types/qs": "^6.9.7",
|
|
175
175
|
"@types/tmp": "^0.2.3",
|
|
@@ -186,5 +186,5 @@
|
|
|
186
186
|
"beacon",
|
|
187
187
|
"blockchain"
|
|
188
188
|
],
|
|
189
|
-
"gitHead": "
|
|
189
|
+
"gitHead": "a4f68321415ed6ad6459a3eb0c8bb1e97da0ec57"
|
|
190
190
|
}
|
|
@@ -57,7 +57,11 @@ import {
|
|
|
57
57
|
kzgCommitmentToVersionedHash,
|
|
58
58
|
reconstructBlobs,
|
|
59
59
|
} from "../../../../util/blobs.js";
|
|
60
|
-
import {
|
|
60
|
+
import {
|
|
61
|
+
getBlobKzgCommitments,
|
|
62
|
+
getDataColumnSidecarsFromBlock,
|
|
63
|
+
getGloasDataColumnSidecars,
|
|
64
|
+
} from "../../../../util/dataColumns.js";
|
|
61
65
|
import {isOptimisticBlock} from "../../../../util/forkChoice.js";
|
|
62
66
|
import {kzg} from "../../../../util/kzg.js";
|
|
63
67
|
import {promiseAllMaybeAsync} from "../../../../util/promises.js";
|
|
@@ -99,17 +103,20 @@ export function getBeaconBlockApi({
|
|
|
99
103
|
const fork = config.getForkName(slot);
|
|
100
104
|
const blockRoot = toRootHex(chain.config.getForkTypes(slot).BeaconBlock.hashTreeRoot(signedBlock.message));
|
|
101
105
|
|
|
102
|
-
// TODO GLOAS: handle new BlockInput type
|
|
103
106
|
const blockForImport = chain.seenBlockInputCache.getByBlock({
|
|
104
107
|
block: signedBlock,
|
|
105
108
|
source: BlockInputSource.api,
|
|
106
109
|
seenTimestampSec,
|
|
107
110
|
blockRootHex: blockRoot,
|
|
108
111
|
});
|
|
109
|
-
let blobSidecars: deneb.BlobSidecars, dataColumnSidecars: fulu.
|
|
112
|
+
let blobSidecars: deneb.BlobSidecars, dataColumnSidecars: fulu.DataColumnSidecar[];
|
|
110
113
|
|
|
111
114
|
if (isDenebBlockContents(signedBlockContents)) {
|
|
112
|
-
if (
|
|
115
|
+
if (isForkPostGloas(fork)) {
|
|
116
|
+
// After gloas, data columns are not published with the block but when publishing the execution payload envelope
|
|
117
|
+
blobSidecars = [];
|
|
118
|
+
dataColumnSidecars = [];
|
|
119
|
+
} else if (isForkPostFulu(fork)) {
|
|
113
120
|
const timer = metrics?.peerDas.dataColumnSidecarComputationTime.startTimer();
|
|
114
121
|
// If the block was produced by this node, we will already have computed cells
|
|
115
122
|
// Otherwise, we will compute them from the blobs in this function
|
|
@@ -124,7 +131,7 @@ export function getBeaconBlockApi({
|
|
|
124
131
|
config,
|
|
125
132
|
signedBlock as SignedBeaconBlock<ForkPostFulu>,
|
|
126
133
|
cellsAndProofs
|
|
127
|
-
);
|
|
134
|
+
) as fulu.DataColumnSidecar[];
|
|
128
135
|
timer?.();
|
|
129
136
|
blobSidecars = [];
|
|
130
137
|
} else if (isForkPostDeneb(fork)) {
|
|
@@ -210,7 +217,7 @@ export function getBeaconBlockApi({
|
|
|
210
217
|
if (!blockLocallyProduced) {
|
|
211
218
|
const parentBlock = chain.forkChoice.getBlockDefaultStatus(signedBlock.message.parentRoot);
|
|
212
219
|
if (parentBlock === null) {
|
|
213
|
-
chain.emitter.emit(ChainEvent.
|
|
220
|
+
chain.emitter.emit(ChainEvent.blockUnknownParent, {
|
|
214
221
|
blockInput: blockForImport,
|
|
215
222
|
peer: IDENTITY_PEER_ID,
|
|
216
223
|
source: BlockInputSource.api,
|
|
@@ -305,7 +312,7 @@ export function getBeaconBlockApi({
|
|
|
305
312
|
.processBlock(blockForImport, opts)
|
|
306
313
|
.catch((e) => {
|
|
307
314
|
if (e instanceof BlockError && e.type.code === BlockErrorCode.PARENT_UNKNOWN) {
|
|
308
|
-
chain.emitter.emit(ChainEvent.
|
|
315
|
+
chain.emitter.emit(ChainEvent.blockUnknownParent, {
|
|
309
316
|
blockInput: blockForImport,
|
|
310
317
|
peer: IDENTITY_PEER_ID,
|
|
311
318
|
source: BlockInputSource.api,
|
|
@@ -647,6 +654,8 @@ export function getBeaconBlockApi({
|
|
|
647
654
|
const slot = envelope.slot;
|
|
648
655
|
const fork = config.getForkName(slot);
|
|
649
656
|
const blockRootHex = toRootHex(envelope.beaconBlockRoot);
|
|
657
|
+
const blockHashHex = toRootHex(envelope.payload.blockHash);
|
|
658
|
+
const stateRootHex = toRootHex(envelope.stateRoot);
|
|
650
659
|
|
|
651
660
|
if (!isForkPostGloas(fork)) {
|
|
652
661
|
throw new ApiError(400, `publishExecutionPayloadEnvelope not supported for pre-gloas fork=${fork}`);
|
|
@@ -664,7 +673,7 @@ export function getBeaconBlockApi({
|
|
|
664
673
|
await validateApiExecutionPayloadEnvelope(chain, signedExecutionPayloadEnvelope);
|
|
665
674
|
|
|
666
675
|
const isSelfBuild = envelope.builderIndex === BUILDER_INDEX_SELF_BUILD;
|
|
667
|
-
let dataColumnSidecars: gloas.
|
|
676
|
+
let dataColumnSidecars: gloas.DataColumnSidecar[] = [];
|
|
668
677
|
|
|
669
678
|
if (isSelfBuild) {
|
|
670
679
|
// For self-builds, construct and publish data column sidecars from cached block production data
|
|
@@ -689,7 +698,7 @@ export function getBeaconBlockApi({
|
|
|
689
698
|
),
|
|
690
699
|
}));
|
|
691
700
|
|
|
692
|
-
dataColumnSidecars =
|
|
701
|
+
dataColumnSidecars = getGloasDataColumnSidecars(slot, envelope.beaconBlockRoot, cellsAndProofs);
|
|
693
702
|
timer?.();
|
|
694
703
|
}
|
|
695
704
|
} else {
|
|
@@ -730,6 +739,8 @@ export function getBeaconBlockApi({
|
|
|
730
739
|
const valLogMeta = {
|
|
731
740
|
slot,
|
|
732
741
|
blockRoot: blockRootHex,
|
|
742
|
+
blockHash: blockHashHex,
|
|
743
|
+
stateRoot: stateRootHex,
|
|
733
744
|
builderIndex: envelope.builderIndex,
|
|
734
745
|
isSelfBuild,
|
|
735
746
|
dataColumns: dataColumnSidecars.length,
|
|
@@ -750,7 +761,17 @@ export function getBeaconBlockApi({
|
|
|
750
761
|
() => chain.processExecutionPayload(payloadInput, {validSignature: true}),
|
|
751
762
|
];
|
|
752
763
|
|
|
753
|
-
const
|
|
764
|
+
const publishPromise = promiseAllMaybeAsync<number | void>(publishPromises);
|
|
765
|
+
|
|
766
|
+
chain.emitter.emit(routes.events.EventType.executionPayloadGossip, {
|
|
767
|
+
slot,
|
|
768
|
+
builderIndex: envelope.builderIndex,
|
|
769
|
+
blockHash: blockHashHex,
|
|
770
|
+
blockRoot: blockRootHex,
|
|
771
|
+
stateRoot: stateRootHex,
|
|
772
|
+
});
|
|
773
|
+
|
|
774
|
+
const sentPeersArr = await publishPromise;
|
|
754
775
|
|
|
755
776
|
// Track metrics for data column publishing
|
|
756
777
|
if (dataColumnSidecars.length > 0) {
|
|
@@ -774,15 +795,11 @@ export function getBeaconBlockApi({
|
|
|
774
795
|
metrics?.dataColumns.bySource.inc({source: BlockInputSource.api}, dataColumnSidecars.length);
|
|
775
796
|
|
|
776
797
|
if (chain.emitter.listenerCount(routes.events.EventType.dataColumnSidecar)) {
|
|
777
|
-
// TODO GLOAS: revisit this, we likely don't wanna emit KZG commitments anymore
|
|
778
|
-
const cachedResult = chain.blockProductionCache.get(blockRootHex) as ProduceFullGloas | undefined;
|
|
779
|
-
const kzgCommitments = cachedResult?.blobsBundle.commitments.map(toHex) ?? [];
|
|
780
798
|
for (const dataColumnSidecar of dataColumnSidecars) {
|
|
781
799
|
chain.emitter.emit(routes.events.EventType.dataColumnSidecar, {
|
|
782
800
|
blockRoot: blockRootHex,
|
|
783
801
|
slot,
|
|
784
802
|
index: dataColumnSidecar.index,
|
|
785
|
-
kzgCommitments,
|
|
786
803
|
});
|
|
787
804
|
}
|
|
788
805
|
}
|
|
@@ -906,7 +923,7 @@ export function getBeaconBlockApi({
|
|
|
906
923
|
);
|
|
907
924
|
}
|
|
908
925
|
|
|
909
|
-
const blobKzgCommitments = (block
|
|
926
|
+
const blobKzgCommitments = getBlobKzgCommitments(fork, block as SignedBeaconBlock<ForkPostFulu>);
|
|
910
927
|
const blobCount = blobKzgCommitments.length;
|
|
911
928
|
|
|
912
929
|
if (blobCount > 0) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
3
3
|
import {ForkPostElectra, ForkPreElectra, SYNC_COMMITTEE_SUBNET_SIZE, isForkPostElectra} from "@lodestar/params";
|
|
4
|
+
import {isStatePostAltair} from "@lodestar/state-transition";
|
|
4
5
|
import {Attestation, Epoch, SingleAttestation, isElectraAttestation, ssz, sszTypesFor} from "@lodestar/types";
|
|
5
6
|
import {
|
|
6
7
|
AttestationError,
|
|
@@ -249,6 +250,9 @@ export function getBeaconPoolApi({
|
|
|
249
250
|
|
|
250
251
|
// TODO: Fetch states at signature slots
|
|
251
252
|
const state = chain.getHeadState();
|
|
253
|
+
if (!isStatePostAltair(state)) {
|
|
254
|
+
throw new ApiError(400, "Sync committee pool is not supported before Altair");
|
|
255
|
+
}
|
|
252
256
|
|
|
253
257
|
const failures: FailureList = [];
|
|
254
258
|
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
3
|
-
import {
|
|
4
|
-
EPOCHS_PER_HISTORICAL_VECTOR,
|
|
5
|
-
SLOTS_PER_EPOCH,
|
|
6
|
-
SYNC_COMMITTEE_SUBNET_SIZE,
|
|
7
|
-
isForkPostElectra,
|
|
8
|
-
isForkPostFulu,
|
|
9
|
-
} from "@lodestar/params";
|
|
3
|
+
import {EPOCHS_PER_HISTORICAL_VECTOR, SLOTS_PER_EPOCH, SYNC_COMMITTEE_SUBNET_SIZE} from "@lodestar/params";
|
|
10
4
|
import {
|
|
11
5
|
IBeaconStateView,
|
|
12
6
|
computeEpochAtSlot,
|
|
13
7
|
computeStartSlotAtEpoch,
|
|
14
8
|
getCurrentEpoch,
|
|
9
|
+
isStatePostAltair,
|
|
10
|
+
isStatePostElectra,
|
|
11
|
+
isStatePostFulu,
|
|
15
12
|
} from "@lodestar/state-transition";
|
|
16
13
|
import {ValidatorIndex, getValidatorStatus, ssz} from "@lodestar/types";
|
|
17
14
|
import {ApiError} from "../../errors.js";
|
|
@@ -303,6 +300,9 @@ export function getBeaconStateApi({
|
|
|
303
300
|
if (stateEpoch < config.ALTAIR_FORK_EPOCH) {
|
|
304
301
|
throw new ApiError(400, "Requested state before ALTAIR_FORK_EPOCH");
|
|
305
302
|
}
|
|
303
|
+
if (!isStatePostAltair(state)) {
|
|
304
|
+
throw new Error("Expected Altair state for sync committee lookup");
|
|
305
|
+
}
|
|
306
306
|
|
|
307
307
|
const syncCommitteeCache = state.getIndexedSyncCommitteeAtEpoch(epoch ?? stateEpoch);
|
|
308
308
|
const validatorIndices = new Array<ValidatorIndex>(...syncCommitteeCache.validatorIndices);
|
|
@@ -324,9 +324,9 @@ export function getBeaconStateApi({
|
|
|
324
324
|
|
|
325
325
|
async getPendingDeposits({stateId}, context) {
|
|
326
326
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
327
|
-
const fork =
|
|
327
|
+
const fork = state.forkName;
|
|
328
328
|
|
|
329
|
-
if (!
|
|
329
|
+
if (!isStatePostElectra(state)) {
|
|
330
330
|
throw new ApiError(400, `Cannot retrieve pending deposits for pre-electra state fork=${fork}`);
|
|
331
331
|
}
|
|
332
332
|
|
|
@@ -340,9 +340,9 @@ export function getBeaconStateApi({
|
|
|
340
340
|
|
|
341
341
|
async getPendingPartialWithdrawals({stateId}, context) {
|
|
342
342
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
343
|
-
const fork =
|
|
343
|
+
const fork = state.forkName;
|
|
344
344
|
|
|
345
|
-
if (!
|
|
345
|
+
if (!isStatePostElectra(state)) {
|
|
346
346
|
throw new ApiError(400, `Cannot retrieve pending partial withdrawals for pre-electra state fork=${fork}`);
|
|
347
347
|
}
|
|
348
348
|
|
|
@@ -358,9 +358,9 @@ export function getBeaconStateApi({
|
|
|
358
358
|
|
|
359
359
|
async getPendingConsolidations({stateId}, context) {
|
|
360
360
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
361
|
-
const fork =
|
|
361
|
+
const fork = state.forkName;
|
|
362
362
|
|
|
363
|
-
if (!
|
|
363
|
+
if (!isStatePostElectra(state)) {
|
|
364
364
|
throw new ApiError(400, `Cannot retrieve pending consolidations for pre-electra state fork=${fork}`);
|
|
365
365
|
}
|
|
366
366
|
|
|
@@ -376,9 +376,9 @@ export function getBeaconStateApi({
|
|
|
376
376
|
|
|
377
377
|
async getProposerLookahead({stateId}, context) {
|
|
378
378
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
379
|
-
const fork =
|
|
379
|
+
const fork = state.forkName;
|
|
380
380
|
|
|
381
|
-
if (!
|
|
381
|
+
if (!isStatePostFulu(state)) {
|
|
382
382
|
throw new ApiError(400, `Cannot retrieve proposer lookahead for pre-fulu state fork=${fork}`);
|
|
383
383
|
}
|
|
384
384
|
|
|
@@ -2,7 +2,7 @@ import {routes} from "@lodestar/api";
|
|
|
2
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
3
3
|
import {ExecutionStatus} from "@lodestar/fork-choice";
|
|
4
4
|
import {ForkPostDeneb, ZERO_HASH_HEX, isForkPostDeneb, isForkPostFulu} from "@lodestar/params";
|
|
5
|
-
import {BeaconState, DataColumnSidecars, type SignedBeaconBlock, sszTypesFor} from "@lodestar/types";
|
|
5
|
+
import {BeaconState, DataColumnSidecar, DataColumnSidecars, type SignedBeaconBlock, sszTypesFor} from "@lodestar/types";
|
|
6
6
|
import {toRootHex} from "@lodestar/utils";
|
|
7
7
|
import {getBlobKzgCommitments} from "../../../util/dataColumns.js";
|
|
8
8
|
import {isOptimisticBlock} from "../../../util/forkChoice.js";
|
|
@@ -98,7 +98,7 @@ export function getDebugApi({
|
|
|
98
98
|
const fork = config.getForkName(block.message.slot);
|
|
99
99
|
const blockRoot = sszTypesFor(fork).BeaconBlock.hashTreeRoot(block.message);
|
|
100
100
|
|
|
101
|
-
let dataColumnSidecars:
|
|
101
|
+
let dataColumnSidecars: DataColumnSidecar[];
|
|
102
102
|
|
|
103
103
|
const blobCount = isForkPostDeneb(fork)
|
|
104
104
|
? getBlobKzgCommitments(fork, block as SignedBeaconBlock<ForkPostDeneb>).length
|
|
@@ -3,6 +3,7 @@ import {ApplicationMethods} from "@lodestar/api/server";
|
|
|
3
3
|
import {ChainForkConfig} from "@lodestar/config";
|
|
4
4
|
import {Repository} from "@lodestar/db";
|
|
5
5
|
import {ForkSeq, SLOTS_PER_EPOCH} from "@lodestar/params";
|
|
6
|
+
import {isStatePostCapella} from "@lodestar/state-transition";
|
|
6
7
|
import {ssz} from "@lodestar/types";
|
|
7
8
|
import {Checkpoint} from "@lodestar/types/phase0";
|
|
8
9
|
import {fromHex, toHex, toRootHex} from "@lodestar/utils";
|
|
@@ -218,6 +219,9 @@ export function getLodestarApi({
|
|
|
218
219
|
if (ForkSeq[fork] < ForkSeq.capella) {
|
|
219
220
|
throw new Error("Historical summaries are not supported before Capella");
|
|
220
221
|
}
|
|
222
|
+
if (!isStatePostCapella(stateView)) {
|
|
223
|
+
throw new Error("Expected Capella state for historical summaries");
|
|
224
|
+
}
|
|
221
225
|
|
|
222
226
|
const {gindex} = ssz[fork].BeaconState.getPathInfo(["historicalSummaries"]);
|
|
223
227
|
const proof = stateView.getSingleProof(gindex);
|
|
@@ -25,6 +25,7 @@ import {
|
|
|
25
25
|
computeStartSlotAtEpoch,
|
|
26
26
|
computeTimeAtSlot,
|
|
27
27
|
getCurrentSlot,
|
|
28
|
+
isStatePostAltair,
|
|
28
29
|
proposerShufflingDecisionRoot,
|
|
29
30
|
} from "@lodestar/state-transition";
|
|
30
31
|
import {
|
|
@@ -1282,6 +1283,9 @@ export function getValidatorApi(
|
|
|
1282
1283
|
if (indices.length === 0) {
|
|
1283
1284
|
throw new ApiError(400, "No validator to get attester duties");
|
|
1284
1285
|
}
|
|
1286
|
+
if (epoch < config.ALTAIR_FORK_EPOCH) {
|
|
1287
|
+
throw new ApiError(400, "Sync committee duties are not supported before Altair");
|
|
1288
|
+
}
|
|
1285
1289
|
|
|
1286
1290
|
// May request for an epoch that's in the future
|
|
1287
1291
|
await waitForNextClosestEpoch();
|
|
@@ -1291,6 +1295,9 @@ export function getValidatorApi(
|
|
|
1291
1295
|
// Note: does not support requesting past duties
|
|
1292
1296
|
const head = chain.forkChoice.getHead();
|
|
1293
1297
|
const state = chain.getHeadState();
|
|
1298
|
+
if (!isStatePostAltair(state)) {
|
|
1299
|
+
throw new ApiError(400, "Sync committee duties are not available before Altair");
|
|
1300
|
+
}
|
|
1294
1301
|
|
|
1295
1302
|
// Check that all validatorIndex belong to the state before calling getCommitteeAssignments()
|
|
1296
1303
|
const pubkeys = getPubkeysForIndices(state, indices);
|
|
@@ -1635,7 +1642,7 @@ export function getValidatorApi(
|
|
|
1635
1642
|
throw Error("Cached block production result is not full block");
|
|
1636
1643
|
}
|
|
1637
1644
|
|
|
1638
|
-
const {executionPayload, executionRequests,
|
|
1645
|
+
const {executionPayload, executionRequests, payloadEnvelopeStateRoot} = produceResult as ProduceFullGloas;
|
|
1639
1646
|
|
|
1640
1647
|
const envelope: gloas.ExecutionPayloadEnvelope = {
|
|
1641
1648
|
payload: executionPayload,
|
|
@@ -1643,7 +1650,7 @@ export function getValidatorApi(
|
|
|
1643
1650
|
builderIndex: BUILDER_INDEX_SELF_BUILD,
|
|
1644
1651
|
beaconBlockRoot,
|
|
1645
1652
|
slot,
|
|
1646
|
-
stateRoot:
|
|
1653
|
+
stateRoot: payloadEnvelopeStateRoot,
|
|
1647
1654
|
};
|
|
1648
1655
|
|
|
1649
1656
|
logger.info("Produced execution payload envelope", {
|
|
@@ -3,6 +3,7 @@ import {Logger, sleep} from "@lodestar/utils";
|
|
|
3
3
|
import {Metrics} from "../metrics/metrics.js";
|
|
4
4
|
import {DataColumnReconstructionCode, recoverDataColumnSidecars} from "../util/dataColumns.js";
|
|
5
5
|
import {BlockInputColumns} from "./blocks/blockInput/index.js";
|
|
6
|
+
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
|
|
6
7
|
import {ChainEventEmitter} from "./emitter.js";
|
|
7
8
|
|
|
8
9
|
/**
|
|
@@ -53,25 +54,25 @@ export class ColumnReconstructionTracker {
|
|
|
53
54
|
this.maxDelayMs = this.config.getSlotComponentDurationMs(RECONSTRUCTION_DELAY_MAX_BPS);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
triggerColumnReconstruction(
|
|
57
|
+
triggerColumnReconstruction(input: BlockInputColumns | PayloadEnvelopeInput): void {
|
|
57
58
|
if (this.running) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
|
|
61
|
-
if (this.lastBlockRootHex ===
|
|
62
|
+
if (this.lastBlockRootHex === input.blockRootHex) {
|
|
62
63
|
return;
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
// We don't care about the outcome of this call,
|
|
66
67
|
// just that it has been triggered for this block root.
|
|
67
68
|
this.running = true;
|
|
68
|
-
this.lastBlockRootHex =
|
|
69
|
+
this.lastBlockRootHex = input.blockRootHex;
|
|
69
70
|
const delay = this.minDelayMs + Math.random() * (this.maxDelayMs - this.minDelayMs);
|
|
70
71
|
sleep(delay)
|
|
71
72
|
.then(() => {
|
|
72
|
-
const logCtx = {slot:
|
|
73
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
73
74
|
this.logger.debug("Attempting data column sidecar reconstruction", logCtx);
|
|
74
|
-
recoverDataColumnSidecars(
|
|
75
|
+
recoverDataColumnSidecars(input, this.emitter, this.metrics)
|
|
75
76
|
.then((result) => {
|
|
76
77
|
this.metrics?.recoverDataColumnSidecars.reconstructionResult.inc({result});
|
|
77
78
|
this.logger.debug("Data column sidecar reconstruction complete", {...logCtx, result});
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
getDataColumnSidecarsFromExecution,
|
|
12
12
|
} from "../util/execution.js";
|
|
13
13
|
import {IBlockInput, isBlockInputBlobs} from "./blocks/blockInput/index.js";
|
|
14
|
+
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
|
|
14
15
|
import {ChainEventEmitter} from "./emitter.js";
|
|
15
16
|
|
|
16
17
|
export type GetBlobsTrackerInit = {
|
|
@@ -43,22 +44,22 @@ export class GetBlobsTracker {
|
|
|
43
44
|
this.config = init.config;
|
|
44
45
|
}
|
|
45
46
|
|
|
46
|
-
triggerGetBlobs(
|
|
47
|
-
if (this.activeReconstructions.has(
|
|
47
|
+
triggerGetBlobs(input: IBlockInput | PayloadEnvelopeInput, onComplete?: () => void): void {
|
|
48
|
+
if (this.activeReconstructions.has(input.blockRootHex)) {
|
|
48
49
|
return;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
|
-
if (isBlockInputBlobs(
|
|
52
|
+
if (!(input instanceof PayloadEnvelopeInput) && isBlockInputBlobs(input)) {
|
|
52
53
|
// there is not preallocation for blob sidecars like there is for columns sidecars so no need to
|
|
53
54
|
// store the index for the preallocated buffers
|
|
54
|
-
this.activeReconstructions.add(
|
|
55
|
+
this.activeReconstructions.add(input.blockRootHex);
|
|
55
56
|
callInNextEventLoop(() => {
|
|
56
|
-
const logCtx = {slot:
|
|
57
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
57
58
|
this.logger.verbose("Trigger getBlobsV1 for block", logCtx);
|
|
58
|
-
getBlobSidecarsFromExecution(this.config, this.executionEngine, this.metrics, this.emitter,
|
|
59
|
+
getBlobSidecarsFromExecution(this.config, this.executionEngine, this.metrics, this.emitter, input).finally(
|
|
59
60
|
() => {
|
|
60
61
|
this.logger.verbose("Completed getBlobsV1 for block", logCtx);
|
|
61
|
-
this.activeReconstructions.delete(
|
|
62
|
+
this.activeReconstructions.delete(input.blockRootHex);
|
|
62
63
|
}
|
|
63
64
|
);
|
|
64
65
|
});
|
|
@@ -72,7 +73,7 @@ export class GetBlobsTracker {
|
|
|
72
73
|
this.blobsAndProofsBuffers[freeIndex] = {inUse: false, buffers: []};
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
const maxBlobs = this.config.getMaxBlobsPerBlock(computeEpochAtSlot(
|
|
76
|
+
const maxBlobs = this.config.getMaxBlobsPerBlock(computeEpochAtSlot(input.slot));
|
|
76
77
|
// double check that there is enough pre-allocated space (blob schedule may have changed since the last use)
|
|
77
78
|
const timer = this.metrics?.peerDas.getBlobsV2PreAllocationTime.startTimer();
|
|
78
79
|
for (let i = 0; i < maxBlobs; i++) {
|
|
@@ -84,22 +85,23 @@ export class GetBlobsTracker {
|
|
|
84
85
|
|
|
85
86
|
// We don't care about the outcome of this call,
|
|
86
87
|
// just that it has been triggered for this block root.
|
|
87
|
-
this.activeReconstructions.add(
|
|
88
|
+
this.activeReconstructions.add(input.blockRootHex);
|
|
88
89
|
this.blobsAndProofsBuffers[freeIndex].inUse = true;
|
|
89
90
|
callInNextEventLoop(() => {
|
|
90
|
-
const logCtx = {slot:
|
|
91
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
91
92
|
this.logger.verbose("Trigger getBlobsV2 for block", logCtx);
|
|
92
93
|
getDataColumnSidecarsFromExecution(
|
|
93
94
|
this.config,
|
|
94
95
|
this.executionEngine,
|
|
95
96
|
this.emitter,
|
|
96
|
-
|
|
97
|
+
input,
|
|
97
98
|
this.metrics,
|
|
98
99
|
this.blobsAndProofsBuffers[freeIndex].buffers
|
|
99
100
|
)
|
|
100
101
|
.then((result) => {
|
|
101
102
|
this.logger.debug("getBlobsV2 result for block", {...logCtx, result});
|
|
102
103
|
this.metrics?.dataColumns.dataColumnEngineResult.inc({result});
|
|
104
|
+
onComplete?.();
|
|
103
105
|
})
|
|
104
106
|
.catch((error) => {
|
|
105
107
|
this.logger.debug("Error during getBlobsV2 for block", logCtx, error as Error);
|
|
@@ -107,7 +109,7 @@ export class GetBlobsTracker {
|
|
|
107
109
|
})
|
|
108
110
|
.finally(() => {
|
|
109
111
|
this.logger.verbose("Completed getBlobsV2 for block", logCtx);
|
|
110
|
-
this.activeReconstructions.delete(
|
|
112
|
+
this.activeReconstructions.delete(input.blockRootHex);
|
|
111
113
|
this.blobsAndProofsBuffers[freeIndex].inUse = false;
|
|
112
114
|
});
|
|
113
115
|
});
|
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
DataAvailabilityStatus,
|
|
4
4
|
ExecutionPayloadStatus,
|
|
5
5
|
IBeaconStateView,
|
|
6
|
-
type PubkeyCache,
|
|
7
6
|
createBeaconStateViewForHistoricalRegen,
|
|
8
7
|
} from "@lodestar/state-transition";
|
|
9
8
|
import {byteArrayEquals} from "@lodestar/utils";
|
|
@@ -18,7 +17,7 @@ export async function getNearestState(
|
|
|
18
17
|
slot: number,
|
|
19
18
|
config: BeaconConfig,
|
|
20
19
|
db: IBeaconDb,
|
|
21
|
-
|
|
20
|
+
nativeStateView: boolean
|
|
22
21
|
): Promise<IBeaconStateView> {
|
|
23
22
|
const stateBytesArr = await db.stateArchive.binaries({limit: 1, lte: slot, reverse: true});
|
|
24
23
|
if (!stateBytesArr.length) {
|
|
@@ -26,7 +25,9 @@ export async function getNearestState(
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
const stateBytes = stateBytesArr[0];
|
|
29
|
-
return
|
|
28
|
+
return nativeStateView
|
|
29
|
+
? createBeaconStateViewForHistoricalRegen({useNative: true, stateBytes})
|
|
30
|
+
: createBeaconStateViewForHistoricalRegen({useNative: false, config, stateBytes});
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
/**
|
|
@@ -36,13 +37,13 @@ export async function getHistoricalState(
|
|
|
36
37
|
slot: number,
|
|
37
38
|
config: BeaconConfig,
|
|
38
39
|
db: IBeaconDb,
|
|
39
|
-
|
|
40
|
+
nativeStateView: boolean,
|
|
40
41
|
metrics?: HistoricalStateRegenMetrics
|
|
41
42
|
): Promise<Uint8Array> {
|
|
42
43
|
const regenTimer = metrics?.regenTime.startTimer();
|
|
43
44
|
|
|
44
45
|
const loadStateTimer = metrics?.loadStateTime.startTimer();
|
|
45
|
-
let state = await getNearestState(slot, config, db,
|
|
46
|
+
let state = await getNearestState(slot, config, db, nativeStateView).catch((e) => {
|
|
46
47
|
metrics?.regenErrorCount.inc({reason: RegenErrorType.loadState});
|
|
47
48
|
throw e;
|
|
48
49
|
});
|
|
@@ -20,7 +20,7 @@ export class HistoricalStateRegen implements HistoricalStateWorkerApi {
|
|
|
20
20
|
private readonly api: ModuleThread<HistoricalStateWorkerApi>;
|
|
21
21
|
private readonly logger: LoggerNode;
|
|
22
22
|
|
|
23
|
-
constructor(modules: HistoricalStateRegenModules) {
|
|
23
|
+
private constructor(modules: HistoricalStateRegenModules) {
|
|
24
24
|
this.api = modules.api;
|
|
25
25
|
this.logger = modules.logger;
|
|
26
26
|
modules.signal?.addEventListener("abort", () => this.close(), {once: true});
|
|
@@ -35,6 +35,7 @@ export class HistoricalStateRegen implements HistoricalStateWorkerApi {
|
|
|
35
35
|
dbLocation: modules.opts.dbLocation,
|
|
36
36
|
metricsEnabled: Boolean(modules.metrics),
|
|
37
37
|
loggerOpts: modules.logger.toOpts(),
|
|
38
|
+
nativeStateView: modules.opts.nativeStateView,
|
|
38
39
|
};
|
|
39
40
|
|
|
40
41
|
const worker = new Worker(path.join(WORKER_DIR, "worker.js"), {
|
|
@@ -7,6 +7,7 @@ export type HistoricalStateRegenInitModules = {
|
|
|
7
7
|
opts: {
|
|
8
8
|
genesisTime: number;
|
|
9
9
|
dbLocation: string;
|
|
10
|
+
nativeStateView: boolean;
|
|
10
11
|
};
|
|
11
12
|
config: BeaconConfig;
|
|
12
13
|
logger: LoggerNode;
|
|
@@ -26,6 +27,7 @@ export type HistoricalStateWorkerData = {
|
|
|
26
27
|
dbLocation: string;
|
|
27
28
|
metricsEnabled: boolean;
|
|
28
29
|
loggerOpts: LoggerNodeOpts;
|
|
30
|
+
nativeStateView: boolean;
|
|
29
31
|
};
|
|
30
32
|
|
|
31
33
|
export type HistoricalStateWorkerApi = {
|
|
@@ -3,7 +3,6 @@ import {Transfer, expose} from "@chainsafe/threads/worker";
|
|
|
3
3
|
import {chainConfigFromJson, createBeaconConfig} from "@lodestar/config";
|
|
4
4
|
import {LevelDbController} from "@lodestar/db/controller/level";
|
|
5
5
|
import {getNodeLogger} from "@lodestar/logger/node";
|
|
6
|
-
import {createPubkeyCache} from "@lodestar/state-transition";
|
|
7
6
|
import {BeaconDb} from "../../../db/index.js";
|
|
8
7
|
import {RegistryMetricCreator, collectNodeJSMetrics} from "../../../metrics/index.js";
|
|
9
8
|
import {JobFnQueue} from "../../../util/queue/fnQueue.js";
|
|
@@ -52,9 +51,6 @@ const queue = new JobFnQueue(
|
|
|
52
51
|
queueMetrics
|
|
53
52
|
);
|
|
54
53
|
|
|
55
|
-
// Reuse a single pubkey cache across all historical state regen calls in this worker
|
|
56
|
-
const pubkeyCache = createPubkeyCache();
|
|
57
|
-
|
|
58
54
|
const api: HistoricalStateWorkerApi = {
|
|
59
55
|
async close() {
|
|
60
56
|
abortController.abort();
|
|
@@ -66,7 +62,7 @@ const api: HistoricalStateWorkerApi = {
|
|
|
66
62
|
historicalStateRegenMetrics?.regenRequestCount.inc();
|
|
67
63
|
|
|
68
64
|
const stateBytes = await queue.push<Uint8Array>(() =>
|
|
69
|
-
getHistoricalState(slot, config, db,
|
|
65
|
+
getHistoricalState(slot, config, db, workerData.nativeStateView, historicalStateRegenMetrics)
|
|
70
66
|
);
|
|
71
67
|
const result = Transfer(stateBytes, [stateBytes.buffer]) as unknown as Uint8Array;
|
|
72
68
|
|