@lodestar/beacon-node 1.51.0 → 1.52.0-dev.03eb33e6f1
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 +99 -127
- 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 +25 -3
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +2 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +6 -2
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts +6 -0
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +55 -32
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +4 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +4 -0
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +13 -2
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +69 -35
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +4 -4
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +7 -0
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +12 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +17 -2
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts +9 -2
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +19 -7
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.d.ts +11 -56
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +8 -242
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/errors.d.ts +2 -4
- package/lib/chain/blocks/blockInput/errors.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/errors.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +2 -18
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/types.js +0 -1
- package/lib/chain/blocks/blockInput/types.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +36 -53
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +11 -12
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +56 -22
- 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 +5 -19
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +10 -7
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +22 -17
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +4 -20
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/types.js +0 -24
- package/lib/chain/blocks/types.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +29 -14
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +17 -5
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +14 -8
- package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSanityChecks.js +4 -0
- package/lib/chain/blocks/verifyBlocksSanityChecks.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +12 -6
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +2 -2
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +12 -7
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts +0 -2
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +6 -24
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/bls/interface.d.ts +2 -0
- package/lib/chain/bls/interface.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.d.ts +1 -1
- package/lib/chain/bls/multithread/index.d.ts.map +1 -1
- package/lib/chain/bls/multithread/index.js +50 -22
- package/lib/chain/bls/multithread/index.js.map +1 -1
- package/lib/chain/bls/multithread/types.d.ts +1 -1
- package/lib/chain/bls/multithread/types.d.ts.map +1 -1
- package/lib/chain/bls/multithread/worker.js +1 -1
- package/lib/chain/bls/multithread/worker.js.map +1 -1
- package/lib/chain/bls/singleThread.js +1 -1
- package/lib/chain/bls/singleThread.js.map +1 -1
- package/lib/chain/bls/utils.js +2 -2
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +31 -9
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +193 -64
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +7 -7
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -5
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +15 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +8 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +1 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +1 -1
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +3 -2
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -1
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +55 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +8 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/errors/index.d.ts +0 -1
- package/lib/chain/errors/index.d.ts.map +1 -1
- package/lib/chain/errors/index.js +0 -1
- package/lib/chain/errors/index.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts +8 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +8 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/forkChoiceExecutionEngine.d.ts +53 -0
- package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -0
- package/lib/chain/forkChoiceExecutionEngine.js +140 -0
- package/lib/chain/forkChoiceExecutionEngine.js.map +1 -0
- package/lib/chain/interface.d.ts +10 -8
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts +13 -6
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +95 -115
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +17 -4
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +199 -46
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/attestationPool.d.ts +1 -1
- package/lib/chain/opPools/attestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/attestationPool.js +15 -4
- package/lib/chain/opPools/attestationPool.js.map +1 -1
- package/lib/chain/opPools/inclusionListStore.d.ts +4 -1
- package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -1
- package/lib/chain/opPools/inclusionListStore.js +5 -2
- package/lib/chain/opPools/inclusionListStore.js.map +1 -1
- package/lib/chain/opPools/index.d.ts +1 -0
- package/lib/chain/opPools/index.d.ts.map +1 -1
- package/lib/chain/opPools/index.js +1 -0
- package/lib/chain/opPools/index.js.map +1 -1
- package/lib/chain/opPools/opPool.js +6 -6
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/payloadAttestationPool.js +17 -7
- package/lib/chain/opPools/payloadAttestationPool.js.map +1 -1
- package/lib/chain/opPools/singleAttestationPool.d.ts +77 -0
- package/lib/chain/opPools/singleAttestationPool.d.ts.map +1 -0
- package/lib/chain/opPools/singleAttestationPool.js +209 -0
- package/lib/chain/opPools/singleAttestationPool.js.map +1 -0
- package/lib/chain/opPools/syncCommitteeMessagePool.d.ts.map +1 -1
- package/lib/chain/opPools/syncCommitteeMessagePool.js +9 -3
- package/lib/chain/opPools/syncCommitteeMessagePool.js.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.d.ts.map +1 -1
- package/lib/chain/opPools/syncContributionAndProofPool.js +11 -3
- package/lib/chain/opPools/syncContributionAndProofPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +1 -1
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +1 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +5 -3
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +2 -3
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -2
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +3 -2
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/proposerTracker.d.ts +31 -0
- package/lib/chain/proposerTracker.d.ts.map +1 -0
- package/lib/chain/proposerTracker.js +75 -0
- package/lib/chain/proposerTracker.js.map +1 -0
- package/lib/chain/regen/interface.d.ts +1 -1
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/queued.d.ts +1 -1
- package/lib/chain/regen/queued.d.ts.map +1 -1
- package/lib/chain/regen/queued.js +5 -3
- package/lib/chain/regen/queued.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts +1 -0
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js +1 -1
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.d.ts +8 -2
- package/lib/chain/seenCache/seenBlockAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.js +43 -6
- package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +13 -4
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.js +13 -12
- package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -14
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +6 -65
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +5 -0
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +39 -1
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +38 -10
- 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 +33 -17
- 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 +9 -1
- 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 +8 -1
- 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 +36 -46
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts +6 -0
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +132 -4
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +9 -0
- 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 +16 -10
- package/lib/chain/validation/syncCommittee.js.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.d.ts.map +1 -1
- package/lib/chain/validation/syncCommitteeContributionAndProof.js +11 -0
- package/lib/chain/validation/syncCommitteeContributionAndProof.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +1 -2
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +0 -3
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/dataColumnStore.d.ts +3 -2
- package/lib/db/dataColumnStore.d.ts.map +1 -1
- package/lib/db/dataColumnStore.js +3 -3
- package/lib/db/dataColumnStore.js.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.d.ts +1 -1
- package/lib/db/flatFileStore/flatFileStore.d.ts.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.js +10 -9
- package/lib/db/flatFileStore/flatFileStore.js.map +1 -1
- package/lib/db/flatFileStore/interface.d.ts +2 -1
- package/lib/db/flatFileStore/interface.d.ts.map +1 -1
- package/lib/db/flatFileStore/slotIndex.d.ts.map +1 -1
- package/lib/db/flatFileStore/slotIndex.js +2 -2
- package/lib/db/flatFileStore/slotIndex.js.map +1 -1
- package/lib/db/repositories/blobSidecars.d.ts +0 -1
- package/lib/db/repositories/blobSidecars.d.ts.map +1 -1
- package/lib/db/repositories/blobSidecars.js +0 -1
- package/lib/db/repositories/blobSidecars.js.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts +2 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +14 -4
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/execution/builder/apiClient.d.ts +14 -8
- package/lib/execution/builder/apiClient.d.ts.map +1 -1
- package/lib/execution/builder/apiClient.js +12 -10
- package/lib/execution/builder/apiClient.js.map +1 -1
- package/lib/execution/builder/http.d.ts +2 -0
- package/lib/execution/builder/http.d.ts.map +1 -1
- package/lib/execution/builder/http.js +2 -0
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/execution/engine/http.d.ts +4 -6
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +8 -10
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/index.d.ts +1 -1
- package/lib/execution/engine/index.d.ts.map +1 -1
- package/lib/execution/engine/index.js +1 -1
- package/lib/execution/engine/index.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +18 -6
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +2 -4
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +2 -12
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts +0 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +0 -4
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +2 -4
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +1 -15
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/sszTypes.d.ts +0 -9
- package/lib/execution/engine/sszTypes.d.ts.map +1 -1
- package/lib/execution/engine/sszTypes.js +0 -5
- package/lib/execution/engine/sszTypes.js.map +1 -1
- package/lib/execution/engine/transport.d.ts +1 -14
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/execution/engine/types.d.ts +0 -8
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +2 -10
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/execution/engine/utils.d.ts.map +1 -1
- package/lib/execution/engine/utils.js +3 -2
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +4 -9
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +11 -32
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +32 -8
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +116 -46
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/server/http.js +5 -5
- package/lib/metrics/server/http.js.map +1 -1
- package/lib/monitoring/service.js +1 -1
- package/lib/monitoring/service.js.map +1 -1
- package/lib/network/core/networkCore.d.ts +4 -1
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +7 -0
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +2 -0
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +4 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +6 -0
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +6 -1
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +1 -0
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +23 -6
- package/lib/network/gossip/gossipsub.js.map +1 -1
- package/lib/network/gossip/interface.d.ts +1 -8
- package/lib/network/gossip/interface.d.ts.map +1 -1
- package/lib/network/gossip/interface.js +0 -1
- package/lib/network/gossip/interface.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +1 -23
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +0 -36
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/interface.d.ts +4 -5
- 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 +5 -1
- package/lib/network/libp2p/index.js.map +1 -1
- package/lib/network/network.d.ts +9 -7
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +73 -46
- package/lib/network/network.js.map +1 -1
- package/lib/network/options.d.ts +2 -0
- package/lib/network/options.d.ts.map +1 -1
- package/lib/network/options.js +2 -0
- package/lib/network/options.js.map +1 -1
- package/lib/network/peers/peerManager.d.ts +2 -1
- package/lib/network/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +28 -1
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/assertPeerRelevance.d.ts +9 -1
- package/lib/network/peers/utils/assertPeerRelevance.d.ts.map +1 -1
- package/lib/network/peers/utils/assertPeerRelevance.js +32 -21
- package/lib/network/peers/utils/assertPeerRelevance.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts +4 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +8 -16
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/peers/utils/subnetMap.d.ts +5 -2
- package/lib/network/peers/utils/subnetMap.d.ts.map +1 -1
- package/lib/network/peers/utils/subnetMap.js +6 -3
- package/lib/network/peers/utils/subnetMap.js.map +1 -1
- package/lib/network/processor/extractSlotRootFns.d.ts.map +1 -1
- package/lib/network/processor/extractSlotRootFns.js +1 -8
- 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 +72 -138
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipQueues/index.d.ts.map +1 -1
- package/lib/network/processor/gossipQueues/index.js +0 -6
- package/lib/network/processor/gossipQueues/index.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +4 -5
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts +6 -0
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +33 -6
- 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 +0 -3
- package/lib/network/reqresp/ReqRespBeaconNode.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByHead.js +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByHead.js.map +1 -1
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts +2 -2
- package/lib/network/reqresp/handlers/beaconBlocksByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/index.js +1 -12
- package/lib/network/reqresp/handlers/index.js.map +1 -1
- package/lib/network/reqresp/protocols.d.ts +0 -2
- package/lib/network/reqresp/protocols.d.ts.map +1 -1
- package/lib/network/reqresp/protocols.js +0 -10
- 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 +1 -17
- package/lib/network/reqresp/rateLimit.js.map +1 -1
- package/lib/network/reqresp/types.d.ts +2 -8
- package/lib/network/reqresp/types.d.ts.map +1 -1
- package/lib/network/reqresp/types.js +1 -7
- package/lib/network/reqresp/types.js.map +1 -1
- package/lib/network/reqresp/utils/collect.d.ts +4 -4
- package/lib/network/reqresp/utils/collect.d.ts.map +1 -1
- package/lib/network/reqresp/utils/collect.js +9 -8
- package/lib/network/reqresp/utils/collect.js.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +2 -2
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js.map +1 -1
- package/lib/network/subnets/attnetsService.d.ts +35 -5
- package/lib/network/subnets/attnetsService.d.ts.map +1 -1
- package/lib/network/subnets/attnetsService.js +84 -6
- package/lib/network/subnets/attnetsService.js.map +1 -1
- package/lib/network/subnets/interface.d.ts +7 -0
- package/lib/network/subnets/interface.d.ts.map +1 -1
- package/lib/network/subnets/interface.js.map +1 -1
- package/lib/node/nodejs.d.ts +3 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +38 -20
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/options.d.ts +3 -1
- package/lib/node/options.d.ts.map +1 -1
- package/lib/node/options.js +4 -2
- package/lib/node/options.js.map +1 -1
- package/lib/sync/interface.d.ts.map +1 -1
- package/lib/sync/interface.js.map +1 -1
- package/lib/sync/range/batch.d.ts +8 -3
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +26 -22
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +10 -16
- 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 +43 -3
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/sync.d.ts +15 -0
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +103 -25
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/types.d.ts +12 -1
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +2 -0
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +28 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +257 -31
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +20 -35
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +36 -130
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +23 -17
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +57 -100
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/bitArray.d.ts +6 -6
- package/lib/util/bitArray.d.ts.map +1 -1
- package/lib/util/bitArray.js +25 -50
- package/lib/util/bitArray.js.map +1 -1
- package/lib/util/blobs.d.ts +1 -7
- package/lib/util/blobs.d.ts.map +1 -1
- package/lib/util/blobs.js +0 -19
- package/lib/util/blobs.js.map +1 -1
- package/lib/util/eventLoop.d.ts +5 -0
- package/lib/util/eventLoop.d.ts.map +1 -1
- package/lib/util/eventLoop.js +7 -0
- package/lib/util/eventLoop.js.map +1 -1
- package/lib/util/execution.d.ts +3 -4
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +1 -73
- package/lib/util/execution.js.map +1 -1
- package/lib/util/file.d.ts.map +1 -1
- package/lib/util/file.js +8 -9
- package/lib/util/file.js.map +1 -1
- package/lib/util/queue/itemQueue.js +1 -1
- package/lib/util/queue/itemQueue.js.map +1 -1
- package/lib/util/sszBytes.d.ts +5 -1
- package/lib/util/sszBytes.d.ts.map +1 -1
- package/lib/util/sszBytes.js +36 -19
- package/lib/util/sszBytes.js.map +1 -1
- package/lib/util/types.d.ts +0 -5
- package/lib/util/types.d.ts.map +1 -1
- package/lib/util/types.js +1 -2
- package/lib/util/types.js.map +1 -1
- package/package.json +27 -28
- package/src/api/impl/beacon/blocks/index.ts +133 -156
- package/src/api/impl/beacon/pool/index.ts +40 -8
- package/src/api/impl/beacon/state/utils.ts +3 -2
- package/src/api/impl/debug/index.ts +6 -2
- package/src/api/impl/validator/index.ts +62 -36
- package/src/chain/ColumnReconstructionTracker.ts +5 -0
- package/src/chain/GetBlobsTracker.ts +82 -52
- package/src/chain/archiveStore/archiveStore.ts +6 -4
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +9 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +21 -2
- package/src/chain/archiveStore/utils/pruneHistory.ts +24 -9
- package/src/chain/blocks/blockInput/blockInput.ts +15 -344
- package/src/chain/blocks/blockInput/errors.ts +1 -2
- package/src/chain/blocks/blockInput/types.ts +2 -20
- package/src/chain/blocks/importBlock.ts +56 -72
- package/src/chain/blocks/importExecutionPayload.ts +85 -38
- package/src/chain/blocks/index.ts +8 -33
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +33 -22
- package/src/chain/blocks/types.ts +5 -31
- package/src/chain/blocks/verifyBlock.ts +47 -26
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +20 -6
- package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +16 -10
- package/src/chain/blocks/verifyBlocksSanityChecks.ts +4 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +13 -5
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +16 -8
- package/src/chain/blocks/writeBlockInputToDb.ts +6 -29
- package/src/chain/bls/interface.ts +2 -0
- package/src/chain/bls/multithread/index.ts +48 -24
- package/src/chain/bls/multithread/types.ts +1 -1
- package/src/chain/bls/multithread/worker.ts +1 -5
- package/src/chain/bls/singleThread.ts +1 -1
- package/src/chain/bls/utils.ts +2 -2
- package/src/chain/chain.ts +243 -81
- package/src/chain/emitter.ts +8 -8
- package/src/chain/errors/attestationError.ts +11 -1
- package/src/chain/errors/blockError.ts +1 -1
- package/src/chain/errors/executionPayloadBid.ts +3 -2
- package/src/chain/errors/executionPayloadEnvelope.ts +58 -0
- package/src/chain/errors/index.ts +0 -1
- package/src/chain/forkChoice/index.ts +8 -0
- package/src/chain/forkChoiceExecutionEngine.ts +216 -0
- package/src/chain/interface.ts +10 -7
- package/src/chain/lightClient/index.ts +108 -142
- package/src/chain/opPools/aggregatedAttestationPool.ts +246 -43
- package/src/chain/opPools/attestationPool.ts +16 -4
- package/src/chain/opPools/inclusionListStore.ts +5 -2
- package/src/chain/opPools/index.ts +1 -0
- package/src/chain/opPools/opPool.ts +6 -6
- package/src/chain/opPools/payloadAttestationPool.ts +18 -7
- package/src/chain/opPools/singleAttestationPool.ts +287 -0
- package/src/chain/opPools/syncCommitteeMessagePool.ts +10 -3
- package/src/chain/opPools/syncContributionAndProofPool.ts +13 -3
- package/src/chain/opPools/utils.ts +1 -1
- package/src/chain/options.ts +7 -6
- package/src/chain/produceBlock/produceBlockBody.ts +7 -3
- package/src/chain/proposerTracker.ts +94 -0
- package/src/chain/regen/interface.ts +1 -1
- package/src/chain/regen/queued.ts +6 -4
- package/src/chain/seenCache/seenAttesters.ts +1 -1
- package/src/chain/seenCache/seenBlockAttesters.ts +48 -6
- package/src/chain/seenCache/seenExecutionPayloadBids.ts +35 -15
- package/src/chain/seenCache/seenGossipBlockInput.ts +9 -93
- package/src/chain/shufflingCache.ts +40 -1
- package/src/chain/validation/aggregateAndProof.ts +44 -15
- package/src/chain/validation/attestation.ts +32 -21
- package/src/chain/validation/block.ts +9 -1
- package/src/chain/validation/dataColumnSidecar.ts +7 -1
- package/src/chain/validation/executionPayloadBid.ts +47 -48
- package/src/chain/validation/executionPayloadEnvelope.ts +155 -4
- package/src/chain/validation/payloadAttestationMessage.ts +10 -0
- package/src/chain/validation/syncCommittee.ts +31 -15
- package/src/chain/validation/syncCommitteeContributionAndProof.ts +13 -0
- package/src/chain/validatorMonitor.ts +0 -6
- package/src/db/dataColumnStore.ts +5 -4
- package/src/db/flatFileStore/flatFileStore.ts +12 -11
- package/src/db/flatFileStore/interface.ts +2 -1
- package/src/db/flatFileStore/slotIndex.ts +4 -3
- package/src/db/repositories/blobSidecars.ts +0 -1
- package/src/db/repositories/dataColumnSidecarArchive.ts +14 -4
- package/src/execution/builder/apiClient.ts +16 -13
- package/src/execution/builder/http.ts +4 -0
- package/src/execution/engine/http.ts +19 -42
- package/src/execution/engine/index.ts +1 -1
- package/src/execution/engine/interface.ts +19 -10
- package/src/execution/engine/jsonRpcTransport.ts +10 -22
- package/src/execution/engine/mock.ts +0 -7
- package/src/execution/engine/restTransport.ts +3 -22
- package/src/execution/engine/sszTypes.ts +0 -9
- package/src/execution/engine/transport.ts +8 -17
- package/src/execution/engine/types.ts +3 -18
- package/src/execution/engine/utils.ts +4 -2
- package/src/index.ts +1 -1
- package/src/metrics/metrics/beacon.ts +11 -32
- package/src/metrics/metrics/lodestar.ts +117 -46
- package/src/metrics/server/http.ts +5 -5
- package/src/monitoring/service.ts +1 -1
- package/src/network/core/networkCore.ts +11 -1
- package/src/network/core/networkCoreWorker.ts +2 -0
- package/src/network/core/networkCoreWorkerHandler.ts +8 -1
- package/src/network/core/types.ts +6 -1
- package/src/network/gossip/gossipsub.ts +24 -6
- package/src/network/gossip/interface.ts +0 -5
- package/src/network/gossip/topic.ts +1 -39
- package/src/network/interface.ts +2 -5
- package/src/network/libp2p/index.ts +5 -1
- package/src/network/network.ts +88 -69
- package/src/network/options.ts +4 -0
- package/src/network/peers/peerManager.ts +28 -3
- package/src/network/peers/utils/assertPeerRelevance.ts +39 -23
- package/src/network/peers/utils/prioritizePeers.ts +14 -22
- package/src/network/peers/utils/subnetMap.ts +6 -3
- package/src/network/processor/extractSlotRootFns.ts +0 -9
- package/src/network/processor/gossipHandlers.ts +91 -178
- package/src/network/processor/gossipQueues/index.ts +0 -6
- package/src/network/processor/gossipValidatorFn.ts +4 -5
- package/src/network/processor/index.ts +32 -6
- package/src/network/reqresp/ReqRespBeaconNode.ts +0 -7
- package/src/network/reqresp/handlers/beaconBlocksByHead.ts +1 -1
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +2 -2
- package/src/network/reqresp/handlers/index.ts +0 -17
- package/src/network/reqresp/protocols.ts +0 -12
- package/src/network/reqresp/rateLimit.ts +1 -17
- package/src/network/reqresp/types.ts +0 -13
- package/src/network/reqresp/utils/collect.ts +16 -8
- package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +3 -2
- package/src/network/subnets/attnetsService.ts +94 -6
- package/src/network/subnets/interface.ts +7 -0
- package/src/node/nodejs.ts +40 -21
- package/src/node/options.ts +9 -6
- package/src/sync/interface.ts +1 -0
- package/src/sync/range/batch.ts +29 -21
- package/src/sync/range/chain.ts +10 -14
- package/src/sync/range/range.ts +56 -3
- package/src/sync/sync.ts +108 -26
- package/src/sync/types.ts +11 -0
- package/src/sync/unknownBlock.ts +296 -32
- package/src/sync/utils/downloadByRange.ts +60 -233
- package/src/sync/utils/downloadByRoot.ts +78 -139
- package/src/util/bitArray.ts +22 -43
- package/src/util/blobs.ts +0 -34
- package/src/util/eventLoop.ts +8 -0
- package/src/util/execution.ts +8 -102
- package/src/util/file.ts +8 -9
- package/src/util/queue/itemQueue.ts +1 -1
- package/src/util/sszBytes.ts +42 -24
- package/src/util/types.ts +1 -8
- package/lib/chain/errors/blobSidecarError.d.ts +0 -108
- package/lib/chain/errors/blobSidecarError.d.ts.map +0 -1
- package/lib/chain/errors/blobSidecarError.js +0 -38
- package/lib/chain/errors/blobSidecarError.js.map +0 -1
- package/lib/chain/validation/blobSidecar.d.ts +0 -16
- package/lib/chain/validation/blobSidecar.d.ts.map +0 -1
- package/lib/chain/validation/blobSidecar.js +0 -276
- package/lib/chain/validation/blobSidecar.js.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts +0 -9
- package/lib/network/reqresp/handlers/blobSidecarsByRange.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js +0 -91
- package/lib/network/reqresp/handlers/blobSidecarsByRange.js.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts +0 -5
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.d.ts.map +0 -1
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js +0 -46
- package/lib/network/reqresp/handlers/blobSidecarsByRoot.js.map +0 -1
- package/src/chain/errors/blobSidecarError.ts +0 -70
- package/src/chain/validation/blobSidecar.ts +0 -357
- package/src/network/reqresp/handlers/blobSidecarsByRange.ts +0 -133
- package/src/network/reqresp/handlers/blobSidecarsByRoot.ts +0 -69
package/src/chain/chain.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import {PrivateKey} from "@libp2p/interface";
|
|
3
|
-
import {type PubkeyCache} from "@chainsafe/lodestar-z/pubkeys";
|
|
4
3
|
import {Type} from "@chainsafe/ssz";
|
|
5
4
|
import {routes} from "@lodestar/api";
|
|
6
5
|
import {BeaconConfig} from "@lodestar/config";
|
|
7
6
|
import {
|
|
7
|
+
AncestorStatus,
|
|
8
8
|
CheckpointWithHex,
|
|
9
9
|
EpochDifference,
|
|
10
|
+
ForkChoiceError,
|
|
11
|
+
ForkChoiceErrorCode,
|
|
10
12
|
ForkChoiceStateGetter,
|
|
11
13
|
IForkChoice,
|
|
12
14
|
PayloadStatus,
|
|
@@ -14,12 +16,14 @@ import {
|
|
|
14
16
|
UpdateHeadOpt,
|
|
15
17
|
} from "@lodestar/fork-choice";
|
|
16
18
|
import {LoggerNode} from "@lodestar/logger/node";
|
|
19
|
+
import {type PubkeyCache} from "@lodestar/native/pubkeys";
|
|
17
20
|
import {
|
|
18
21
|
EFFECTIVE_BALANCE_INCREMENT,
|
|
19
22
|
type ForkPostFulu,
|
|
20
23
|
type ForkPostGloas,
|
|
21
24
|
GENESIS_SLOT,
|
|
22
25
|
SLOTS_PER_EPOCH,
|
|
26
|
+
isForkPostFulu,
|
|
23
27
|
isForkPostGloas,
|
|
24
28
|
} from "@lodestar/params";
|
|
25
29
|
import {
|
|
@@ -33,6 +37,7 @@ import {
|
|
|
33
37
|
isStatePostAltair,
|
|
34
38
|
isStatePostElectra,
|
|
35
39
|
isStatePostGloas,
|
|
40
|
+
proposerShufflingDecisionRoot,
|
|
36
41
|
} from "@lodestar/state-transition";
|
|
37
42
|
import {
|
|
38
43
|
BeaconBlock,
|
|
@@ -60,7 +65,6 @@ import {Logger, fromHex, gweiToWei, isErrorAborted, pruneSetToMax, sleep, toRoot
|
|
|
60
65
|
import {ProcessShutdownCallback} from "@lodestar/validator";
|
|
61
66
|
import {GENESIS_EPOCH, HALF_SLOT_BPS, ZERO_HASH} from "../constants/index.js";
|
|
62
67
|
import {IBeaconDb} from "../db/index.js";
|
|
63
|
-
import {BLOB_SIDECARS_IN_WRAPPER_INDEX} from "../db/repositories/blobSidecars.js";
|
|
64
68
|
import {decodeArchivedEnvelope} from "../db/repositories/index.js";
|
|
65
69
|
import {BuilderApiClient, BuilderApiClientOpts} from "../execution/builder/apiClient.js";
|
|
66
70
|
import {BuilderStatus} from "../execution/builder/http.js";
|
|
@@ -80,7 +84,7 @@ import {getSlotFromSignedBeaconBlockSerialized} from "../util/sszBytes.js";
|
|
|
80
84
|
import {ArchiveStore} from "./archiveStore/archiveStore.js";
|
|
81
85
|
import {CheckpointBalancesCache} from "./balancesCache.js";
|
|
82
86
|
import {BeaconProposerCache} from "./beaconProposerCache.js";
|
|
83
|
-
import {IBlockInput,
|
|
87
|
+
import {IBlockInput, isBlockInputColumns} from "./blocks/blockInput/index.js";
|
|
84
88
|
import {BlockProcessor, ImportBlockOpts} from "./blocks/index.js";
|
|
85
89
|
import {PayloadEnvelopeInputSource} from "./blocks/payloadEnvelopeInput/index.js";
|
|
86
90
|
import {PayloadEnvelopeProcessor} from "./blocks/payloadEnvelopeProcessor.js";
|
|
@@ -89,9 +93,10 @@ import {persistBlockInput} from "./blocks/writeBlockInputToDb.js";
|
|
|
89
93
|
import {persistPayloadEnvelopeInput} from "./blocks/writePayloadEnvelopeInputToDb.js";
|
|
90
94
|
import {BlsMultiThreadWorkerPool, BlsSingleThreadVerifier, IBlsVerifier} from "./bls/index.js";
|
|
91
95
|
import {BuilderCircuitBreaker} from "./builderCircuitBreaker.js";
|
|
92
|
-
import {ColumnReconstructionTracker} from "./ColumnReconstructionTracker.js";
|
|
93
|
-
import {ChainEvent, ChainEventEmitter} from "./emitter.js";
|
|
96
|
+
import {ColumnReconstructionTracker, RECONSTRUCTED_COLUMNS_WAIT_BPS} from "./ColumnReconstructionTracker.js";
|
|
97
|
+
import {ChainEvent, ChainEventEmitter, ReorgEventData} from "./emitter.js";
|
|
94
98
|
import {ForkchoiceCaller, initializeForkChoice} from "./forkChoice/index.js";
|
|
99
|
+
import {ForkChoiceExecutionEngine} from "./forkChoiceExecutionEngine.js";
|
|
95
100
|
import {GetBlobsTracker} from "./GetBlobsTracker.js";
|
|
96
101
|
import {CommonBlockBody, FindHeadFnName, IBeaconChain, ProposerPreparationData, StateGetOpts} from "./interface.js";
|
|
97
102
|
import {LightClientServer} from "./lightClient/index.js";
|
|
@@ -104,6 +109,7 @@ import {
|
|
|
104
109
|
OpPool,
|
|
105
110
|
PayloadAttestationPool,
|
|
106
111
|
ProposerPreferencesPool,
|
|
112
|
+
SingleAttestationPool,
|
|
107
113
|
SyncCommitteeMessagePool,
|
|
108
114
|
SyncContributionAndProofPool,
|
|
109
115
|
} from "./opPools/index.js";
|
|
@@ -112,6 +118,7 @@ import {PrepareNextSlotScheduler} from "./prepareNextSlot.js";
|
|
|
112
118
|
import {computeNewStateRoot} from "./produceBlock/computeNewStateRoot.js";
|
|
113
119
|
import {AssembledBlockType, BlockType, ProduceResult} from "./produceBlock/index.js";
|
|
114
120
|
import {BlockAttributes, produceBlockBody, produceCommonBlockBody} from "./produceBlock/produceBlockBody.js";
|
|
121
|
+
import {ProposerTracker} from "./proposerTracker.js";
|
|
115
122
|
import {QueuedStateRegenerator, RegenCaller} from "./regen/index.js";
|
|
116
123
|
import {ReprocessController} from "./reprocess.js";
|
|
117
124
|
import {
|
|
@@ -166,7 +173,7 @@ const DEFAULT_MAX_PENDING_UNFINALIZED_PAYLOAD_ENVELOPE_WRITES = 16;
|
|
|
166
173
|
export class BeaconChain implements IBeaconChain {
|
|
167
174
|
readonly genesisTime: UintNum64;
|
|
168
175
|
readonly genesisValidatorsRoot: Root;
|
|
169
|
-
readonly executionEngine:
|
|
176
|
+
readonly executionEngine: ForkChoiceExecutionEngine;
|
|
170
177
|
readonly executionBuilder?: IExecutionBuilder;
|
|
171
178
|
readonly builderCircuitBreaker: BuilderCircuitBreaker;
|
|
172
179
|
readonly builderApiClient: BuilderApiClient;
|
|
@@ -194,6 +201,13 @@ export class BeaconChain implements IBeaconChain {
|
|
|
194
201
|
// Ops pool
|
|
195
202
|
readonly attestationPool: AttestationPool;
|
|
196
203
|
readonly aggregatedAttestationPool: AggregatedAttestationPool;
|
|
204
|
+
readonly singleAttestationPool: SingleAttestationPool;
|
|
205
|
+
readonly proposerTracker: ProposerTracker;
|
|
206
|
+
/**
|
|
207
|
+
* Head state epoch and decision root of its next epoch proposers when local proposals were last refreshed. The root
|
|
208
|
+
* alone is not enough: a reorg onto a branch without blocks in a whole epoch keeps the root but moves the epoch
|
|
209
|
+
*/
|
|
210
|
+
private localProposalsKey: string | null = null;
|
|
197
211
|
readonly syncCommitteeMessagePool: SyncCommitteeMessagePool;
|
|
198
212
|
readonly syncContributionAndProofPool;
|
|
199
213
|
readonly executionPayloadBidPool: ExecutionPayloadBidPool;
|
|
@@ -317,7 +331,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
317
331
|
this.genesisTime = anchorState.genesisTime;
|
|
318
332
|
this.anchorStateLatestBlockSlot = anchorState.latestBlockHeader.slot;
|
|
319
333
|
this.genesisValidatorsRoot = anchorState.genesisValidatorsRoot;
|
|
320
|
-
this.executionEngine = executionEngine;
|
|
321
334
|
this.executionBuilder = executionBuilder;
|
|
322
335
|
const signal = this.abortController.signal;
|
|
323
336
|
const emitter = new ChainEventEmitter();
|
|
@@ -331,6 +344,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
331
344
|
this.blacklistedBlocks = new Map((opts.blacklistedBlocks ?? []).map((hex) => [hex, null]));
|
|
332
345
|
this.attestationPool = new AttestationPool(config, clock, this.opts?.preaggregateSlotDistance, metrics);
|
|
333
346
|
this.aggregatedAttestationPool = new AggregatedAttestationPool(this.config, metrics, logger);
|
|
347
|
+
this.singleAttestationPool = new SingleAttestationPool(metrics);
|
|
348
|
+
this.proposerTracker = new ProposerTracker(this.opts.singleAttestationIgnoreProposalDuty ?? false, metrics);
|
|
334
349
|
this.syncCommitteeMessagePool = new SyncCommitteeMessagePool(config, clock, this.opts?.preaggregateSlotDistance);
|
|
335
350
|
this.syncContributionAndProofPool = new SyncContributionAndProofPool(config, clock, metrics, logger);
|
|
336
351
|
this.executionPayloadBidPool = new ExecutionPayloadBidPool();
|
|
@@ -457,6 +472,12 @@ export class BeaconChain implements IBeaconChain {
|
|
|
457
472
|
this.payloadEnvelopeProcessor = new PayloadEnvelopeProcessor(this, metrics, signal);
|
|
458
473
|
|
|
459
474
|
this.forkChoice = forkChoice;
|
|
475
|
+
this.executionEngine = new ForkChoiceExecutionEngine(executionEngine, {
|
|
476
|
+
forkChoice,
|
|
477
|
+
recomputeHeadAfterELInvalidResponse: () => this.recomputeHeadAfterELInvalidResponse(),
|
|
478
|
+
logger,
|
|
479
|
+
metrics,
|
|
480
|
+
});
|
|
460
481
|
|
|
461
482
|
this.builderCircuitBreaker = new BuilderCircuitBreaker(
|
|
462
483
|
{faultInspectionWindow: opts.faultInspectionWindow, allowedFaults: opts.allowedFaults},
|
|
@@ -680,7 +701,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
680
701
|
const state = await this.regen.getBlockSlotState(block, slot, {dontTransferCache: true}, RegenCaller.restApi);
|
|
681
702
|
return {
|
|
682
703
|
state,
|
|
683
|
-
|
|
704
|
+
// The canonical variant can be FULL, a state reports the status of the payload its block builds on
|
|
705
|
+
executionOptimistic: isOptimisticBlock(this.forkChoice.getBlockHexDefaultStatus(block.blockRoot) ?? block),
|
|
684
706
|
finalized: slot === finalizedBlock.slot && finalizedBlock.slot !== GENESIS_SLOT,
|
|
685
707
|
};
|
|
686
708
|
}
|
|
@@ -696,7 +718,7 @@ export class BeaconChain implements IBeaconChain {
|
|
|
696
718
|
return (
|
|
697
719
|
state && {
|
|
698
720
|
state,
|
|
699
|
-
executionOptimistic: isOptimisticBlock(block),
|
|
721
|
+
executionOptimistic: isOptimisticBlock(this.forkChoice.getBlockHexDefaultStatus(block.blockRoot) ?? block),
|
|
700
722
|
finalized: slot === finalizedBlock.slot && finalizedBlock.slot !== GENESIS_SLOT,
|
|
701
723
|
}
|
|
702
724
|
);
|
|
@@ -844,7 +866,9 @@ export class BeaconChain implements IBeaconChain {
|
|
|
844
866
|
const finalizedBlock = this.forkChoice.getFinalizedBlock();
|
|
845
867
|
if (slot > finalizedBlock.slot) {
|
|
846
868
|
// Unfinalized slot, attempt to find in fork-choice
|
|
847
|
-
const
|
|
869
|
+
const canonicalBlock = this.forkChoice.getCanonicalBlockAtSlot(slot);
|
|
870
|
+
// The canonical variant can be FULL, a block reports the status of the payload it builds on
|
|
871
|
+
const block = canonicalBlock && this.forkChoice.getBlockHexDefaultStatus(canonicalBlock.blockRoot);
|
|
848
872
|
if (block) {
|
|
849
873
|
// Block found in fork-choice.
|
|
850
874
|
// It may be in the block input cache, awaiting full DA reconstruction, check there first
|
|
@@ -933,16 +957,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
933
957
|
}
|
|
934
958
|
|
|
935
959
|
async getBlobSidecars(blockSlot: Slot, blockRootHex: string): Promise<deneb.BlobSidecars | null> {
|
|
936
|
-
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
937
|
-
if (blockInput) {
|
|
938
|
-
if (!isBlockInputBlobs(blockInput)) {
|
|
939
|
-
throw new Error(`Expected block input to have blobs: slot=${blockSlot} root=${blockRootHex}`);
|
|
940
|
-
}
|
|
941
|
-
if (!blockInput.hasAllData()) {
|
|
942
|
-
return null;
|
|
943
|
-
}
|
|
944
|
-
return blockInput.getBlobs();
|
|
945
|
-
}
|
|
946
960
|
const unfinalizedBlobSidecars = (await this.db.blobSidecars.get(fromHex(blockRootHex)))?.blobSidecars ?? null;
|
|
947
961
|
if (unfinalizedBlobSidecars) {
|
|
948
962
|
return unfinalizedBlobSidecars;
|
|
@@ -950,28 +964,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
950
964
|
return (await this.db.blobSidecarsArchive.get(blockSlot))?.blobSidecars ?? null;
|
|
951
965
|
}
|
|
952
966
|
|
|
953
|
-
async getSerializedBlobSidecars(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null> {
|
|
954
|
-
const blockInput = this.seenBlockInputCache.get(blockRootHex);
|
|
955
|
-
if (blockInput) {
|
|
956
|
-
if (!isBlockInputBlobs(blockInput)) {
|
|
957
|
-
throw new Error(`Expected block input to have blobs: slot=${blockSlot} root=${blockRootHex}`);
|
|
958
|
-
}
|
|
959
|
-
if (!blockInput.hasAllData()) {
|
|
960
|
-
return null;
|
|
961
|
-
}
|
|
962
|
-
return ssz.deneb.BlobSidecars.serialize(blockInput.getBlobs());
|
|
963
|
-
}
|
|
964
|
-
const unfinalizedBlobSidecarsWrapper = await this.db.blobSidecars.getBinary(fromHex(blockRootHex));
|
|
965
|
-
if (unfinalizedBlobSidecarsWrapper) {
|
|
966
|
-
return unfinalizedBlobSidecarsWrapper.slice(BLOB_SIDECARS_IN_WRAPPER_INDEX);
|
|
967
|
-
}
|
|
968
|
-
const finalizedBlobSidecarsWrapper = await this.db.blobSidecarsArchive.getBinary(blockSlot);
|
|
969
|
-
if (finalizedBlobSidecarsWrapper) {
|
|
970
|
-
return finalizedBlobSidecarsWrapper.slice(BLOB_SIDECARS_IN_WRAPPER_INDEX);
|
|
971
|
-
}
|
|
972
|
-
return null;
|
|
973
|
-
}
|
|
974
|
-
|
|
975
967
|
async getSerializedExecutionPayloadEnvelope(blockSlot: Slot, blockRootHex: string): Promise<Uint8Array | null> {
|
|
976
968
|
const [bytes] = await this.getSerializedExecutionPayloadEnvelopes([{blockSlot, blockRootHex}]);
|
|
977
969
|
return bytes;
|
|
@@ -1137,6 +1129,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1137
1129
|
// After gloas, columns are tracked in PayloadEnvelopeInput
|
|
1138
1130
|
const payloadInput = this.seenPayloadEnvelopeInputCache.get(blockRootHex);
|
|
1139
1131
|
if (payloadInput) {
|
|
1132
|
+
// Available with half the columns, peers that saw it attested expect the reconstructed rest
|
|
1133
|
+
if (
|
|
1134
|
+
!payloadInput.hasComputedAllData() &&
|
|
1135
|
+
payloadInput.hasAllData() &&
|
|
1136
|
+
indices.some((index) => !payloadInput.hasColumn(index))
|
|
1137
|
+
) {
|
|
1138
|
+
this.columnReconstructionTracker.triggerColumnReconstruction(payloadInput);
|
|
1139
|
+
await payloadInput
|
|
1140
|
+
.waitForComputedAllData(this.config.getSlotComponentDurationMs(fork, RECONSTRUCTED_COLUMNS_WAIT_BPS))
|
|
1141
|
+
.catch(() => this.logger.debug("Columns not reconstructed in time", {slot: blockSlot, root: blockRootHex}));
|
|
1142
|
+
}
|
|
1140
1143
|
for (let i = 0; i < indices.length; i++) {
|
|
1141
1144
|
const index = indices[i];
|
|
1142
1145
|
const sidecar = payloadInput.getColumn(index);
|
|
@@ -1158,6 +1161,17 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1158
1161
|
if (!isBlockInputColumns(blockInput)) {
|
|
1159
1162
|
throw new Error(`Expected block input to have columns: slot=${blockSlot} root=${blockRootHex}`);
|
|
1160
1163
|
}
|
|
1164
|
+
// Available with half the columns, peers that saw it attested expect the reconstructed rest
|
|
1165
|
+
if (
|
|
1166
|
+
!blockInput.hasComputedAllData() &&
|
|
1167
|
+
blockInput.hasAllData() &&
|
|
1168
|
+
indices.some((index) => !blockInput.hasColumn(index))
|
|
1169
|
+
) {
|
|
1170
|
+
this.columnReconstructionTracker.triggerColumnReconstruction(blockInput);
|
|
1171
|
+
await blockInput
|
|
1172
|
+
.waitForComputedAllData(this.config.getSlotComponentDurationMs(fork, RECONSTRUCTED_COLUMNS_WAIT_BPS))
|
|
1173
|
+
.catch(() => this.logger.debug("Columns not reconstructed in time", {slot: blockSlot, root: blockRootHex}));
|
|
1174
|
+
}
|
|
1161
1175
|
for (let i = 0; i < indices.length; i++) {
|
|
1162
1176
|
const index = indices[i];
|
|
1163
1177
|
const sidecar = blockInput.getColumn(index);
|
|
@@ -1430,11 +1444,64 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1430
1444
|
}
|
|
1431
1445
|
}
|
|
1432
1446
|
|
|
1447
|
+
/**
|
|
1448
|
+
* Apply chain side effects of a fork choice head change: head state, head metrics, and reorg detection
|
|
1449
|
+
*/
|
|
1450
|
+
onHeadChanged(oldHead: ProtoBlock, newHead: ProtoBlock, maybeHeadState?: IBeaconStateView): void {
|
|
1451
|
+
// Set head state as strong reference
|
|
1452
|
+
this.regen.updateHeadState(newHead, maybeHeadState);
|
|
1453
|
+
|
|
1454
|
+
const delaySec = this.clock.secFromSlot(newHead.slot);
|
|
1455
|
+
this.logger.verbose("New chain head", {
|
|
1456
|
+
slot: newHead.slot,
|
|
1457
|
+
root: newHead.blockRoot,
|
|
1458
|
+
payloadStatus: newHead.payloadStatus,
|
|
1459
|
+
delaySec,
|
|
1460
|
+
});
|
|
1461
|
+
this.metrics?.headSlot.set(newHead.slot);
|
|
1462
|
+
|
|
1463
|
+
this.onNewHead(newHead);
|
|
1464
|
+
this.metrics?.forkChoice.changedHead.inc();
|
|
1465
|
+
|
|
1466
|
+
const ancestorResult = this.forkChoice.getCommonAncestorDepth(oldHead, newHead);
|
|
1467
|
+
if (ancestorResult.code === AncestorStatus.CommonAncestor) {
|
|
1468
|
+
// CommonAncestor = chain reorg, old head and new head not direct descendants
|
|
1469
|
+
|
|
1470
|
+
const forkChoiceReorgEventData: ReorgEventData = {
|
|
1471
|
+
depth: ancestorResult.depth,
|
|
1472
|
+
epoch: computeEpochAtSlot(newHead.slot),
|
|
1473
|
+
slot: newHead.slot,
|
|
1474
|
+
newHeadBlock: newHead.blockRoot,
|
|
1475
|
+
oldHeadBlock: oldHead.blockRoot,
|
|
1476
|
+
newHeadState: newHead.stateRoot,
|
|
1477
|
+
oldHeadState: oldHead.stateRoot,
|
|
1478
|
+
executionOptimistic: isOptimisticBlock(newHead),
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1481
|
+
this.emitter.emit(routes.events.EventType.chainReorg, forkChoiceReorgEventData);
|
|
1482
|
+
this.logger.verbose("Chain reorg", forkChoiceReorgEventData);
|
|
1483
|
+
|
|
1484
|
+
this.metrics?.forkChoice.reorg.inc();
|
|
1485
|
+
this.metrics?.forkChoice.reorgDistance.observe(ancestorResult.depth);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
|
|
1489
|
+
private recomputeHeadAfterELInvalidResponse(): void {
|
|
1490
|
+
// validateLatestHash only re-scores proto-array, the cached head is still the old one
|
|
1491
|
+
const oldHead = this.forkChoice.getHead();
|
|
1492
|
+
const newHead = this.recomputeForkChoiceHead(ForkchoiceCaller.executionInvalid);
|
|
1493
|
+
if (newHead.blockRoot === oldHead.blockRoot && newHead.payloadStatus === oldHead.payloadStatus) {
|
|
1494
|
+
return;
|
|
1495
|
+
}
|
|
1496
|
+
this.onHeadChanged(oldHead, newHead);
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1433
1499
|
/**
|
|
1434
1500
|
* Emit `head` and `head_v2` when the fork choice head differs between two observations. Every caller that
|
|
1435
|
-
* can move the head, `updateAndGetHead()` and `
|
|
1501
|
+
* can move the head, `updateAndGetHead()`, `updateTime()` and `onExecutionPayload()`, must capture the head before
|
|
1502
|
+
* and pass both.
|
|
1436
1503
|
*/
|
|
1437
|
-
|
|
1504
|
+
emitHeadEvents(prevHead: ProtoBlock, head: ProtoBlock): void {
|
|
1438
1505
|
const headRootChanged = head.blockRoot !== prevHead.blockRoot;
|
|
1439
1506
|
|
|
1440
1507
|
if (!headRootChanged && prevHead.payloadStatus === head.payloadStatus) {
|
|
@@ -1565,38 +1632,76 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1565
1632
|
}
|
|
1566
1633
|
|
|
1567
1634
|
/**
|
|
1568
|
-
* Invalid state root error is critical and it causes the node to stale most of the time so we want to
|
|
1569
|
-
*
|
|
1635
|
+
* Invalid state root error is critical and it causes the node to stale most of the time so we want to persist
|
|
1636
|
+
* preState, postState and block for further investigation.
|
|
1570
1637
|
*/
|
|
1571
1638
|
async persistInvalidStateRoot(
|
|
1572
1639
|
preState: IBeaconStateView,
|
|
1573
1640
|
postState: IBeaconStateView,
|
|
1574
1641
|
block: SignedBeaconBlock
|
|
1575
1642
|
): Promise<void> {
|
|
1643
|
+
if (!this.opts.persistInvalidSszObjects) {
|
|
1644
|
+
return;
|
|
1645
|
+
}
|
|
1576
1646
|
const blockSlot = block.message.slot;
|
|
1577
|
-
const
|
|
1578
|
-
const
|
|
1579
|
-
const
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1647
|
+
const forkTypes = this.config.getForkTypes(blockSlot);
|
|
1648
|
+
const preStateRoot = toRootHex(preState.hashTreeRoot());
|
|
1649
|
+
const postStateRoot = toRootHex(postState.hashTreeRoot());
|
|
1650
|
+
const logStr = `slot_${blockSlot}_invalid_state_root_${postStateRoot}`;
|
|
1651
|
+
try {
|
|
1652
|
+
await Promise.all([
|
|
1653
|
+
this.persistSszObject(
|
|
1654
|
+
`SignedBeaconBlock_slot_${blockSlot}`,
|
|
1655
|
+
forkTypes.SignedBeaconBlock.serialize(block),
|
|
1656
|
+
toRootHex(forkTypes.BeaconBlock.hashTreeRoot(block.message)),
|
|
1657
|
+
`${logStr}_block`
|
|
1658
|
+
),
|
|
1659
|
+
this.persistSszObject(
|
|
1660
|
+
`preState_slot_${preState.slot}_BeaconState`,
|
|
1661
|
+
preState.serialize(),
|
|
1662
|
+
preStateRoot,
|
|
1663
|
+
`${logStr}_pre_state`
|
|
1664
|
+
),
|
|
1665
|
+
this.persistSszObject(
|
|
1666
|
+
`postState_slot_${postState.slot}_BeaconState`,
|
|
1667
|
+
postState.serialize(),
|
|
1668
|
+
postStateRoot,
|
|
1669
|
+
`${logStr}_post_state`
|
|
1670
|
+
),
|
|
1671
|
+
]);
|
|
1672
|
+
} catch (e) {
|
|
1673
|
+
this.logger.error(
|
|
1674
|
+
"Error persisting invalid state root objects",
|
|
1675
|
+
{slot: blockSlot, preStateRoot, postStateRoot},
|
|
1676
|
+
e as Error
|
|
1677
|
+
);
|
|
1678
|
+
}
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
async persistInvalidSignature(state: IBeaconStateView, block: SignedBeaconBlock): Promise<void> {
|
|
1682
|
+
if (!this.opts.persistInvalidSszObjects) {
|
|
1683
|
+
return;
|
|
1684
|
+
}
|
|
1685
|
+
const blockSlot = block.message.slot;
|
|
1686
|
+
const forkTypes = this.config.getForkTypes(blockSlot);
|
|
1687
|
+
try {
|
|
1688
|
+
await Promise.all([
|
|
1689
|
+
this.persistSszObject(
|
|
1690
|
+
forkTypes.SignedBeaconBlock.typeName,
|
|
1691
|
+
forkTypes.SignedBeaconBlock.serialize(block),
|
|
1692
|
+
toRootHex(forkTypes.BeaconBlock.hashTreeRoot(block.message)),
|
|
1693
|
+
`${blockSlot}_invalid_signature`
|
|
1694
|
+
),
|
|
1695
|
+
this.persistSszObject(
|
|
1696
|
+
"BeaconState",
|
|
1697
|
+
state.serialize(),
|
|
1698
|
+
toRootHex(state.hashTreeRoot()),
|
|
1699
|
+
`${state.slot}_invalid_signature`
|
|
1700
|
+
),
|
|
1701
|
+
]);
|
|
1702
|
+
} catch (e) {
|
|
1703
|
+
this.logger.error("Error persisting invalid signature objects", {slot: blockSlot}, e as Error);
|
|
1704
|
+
}
|
|
1600
1705
|
}
|
|
1601
1706
|
|
|
1602
1707
|
persistInvalidSszValue<T>(type: Type<T>, sszObject: T, suffix?: string, rootHex?: RootHex): void {
|
|
@@ -1611,12 +1716,6 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1611
1716
|
}
|
|
1612
1717
|
}
|
|
1613
1718
|
|
|
1614
|
-
persistInvalidSszBytes(typeName: string, sszBytes: Uint8Array, rootHex: RootHex, suffix?: string): void {
|
|
1615
|
-
if (this.opts.persistInvalidSszObjects) {
|
|
1616
|
-
void this.persistSszObject(typeName, sszBytes, rootHex, suffix);
|
|
1617
|
-
}
|
|
1618
|
-
}
|
|
1619
|
-
|
|
1620
1719
|
/**
|
|
1621
1720
|
* Regenerate state for attestation verification, this does not happen with default chain option of maxSkipSlots = 32 .
|
|
1622
1721
|
* However, need to handle just in case. Lodestar doesn't support multiple regen state requests for attestation verification
|
|
@@ -1816,19 +1915,25 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1816
1915
|
private onClockSlot(slot: Slot): void {
|
|
1817
1916
|
this.logger.verbose("Clock slot", {slot});
|
|
1818
1917
|
|
|
1819
|
-
// CRITICAL UPDATE
|
|
1820
|
-
if (this.forkChoice.irrecoverableError) {
|
|
1821
|
-
this.processShutdownCallback(this.forkChoice.irrecoverableError);
|
|
1822
|
-
}
|
|
1823
|
-
|
|
1824
1918
|
// updateTime() recomputes the head on epoch-boundary checkpoint pull-up and under fast confirmation
|
|
1825
1919
|
const prevHead = this.forkChoice.getHead();
|
|
1826
|
-
|
|
1920
|
+
try {
|
|
1921
|
+
this.forkChoice.updateTime(slot);
|
|
1922
|
+
} catch (e) {
|
|
1923
|
+
// Per optimistic sync the node MAY exit once the justified checkpoint is INVALIDATED, fork choice has no head
|
|
1924
|
+
if (e instanceof ForkChoiceError && e.type.code === ForkChoiceErrorCode.INVALID_JUSTIFIED_EXECUTION_STATUS) {
|
|
1925
|
+
this.processShutdownCallback(e);
|
|
1926
|
+
return;
|
|
1927
|
+
}
|
|
1928
|
+
throw e;
|
|
1929
|
+
}
|
|
1827
1930
|
this.emitHeadEvents(prevHead, this.forkChoice.getHead());
|
|
1828
1931
|
this.metrics?.clockSlot.set(slot);
|
|
1829
1932
|
|
|
1830
1933
|
this.attestationPool.prune(slot);
|
|
1831
1934
|
this.aggregatedAttestationPool.prune(slot);
|
|
1935
|
+
this.proposerTracker.prune(slot);
|
|
1936
|
+
this.singleAttestationPool.prune(this.proposerTracker);
|
|
1832
1937
|
this.syncCommitteeMessagePool.prune(slot);
|
|
1833
1938
|
this.seenSyncCommitteeMessages.prune(slot);
|
|
1834
1939
|
this.payloadAttestationPool.prune(slot);
|
|
@@ -1855,6 +1960,55 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1855
1960
|
}
|
|
1856
1961
|
}
|
|
1857
1962
|
|
|
1963
|
+
/**
|
|
1964
|
+
* Track upcoming proposals of validators connected to this node, so that SingleAttestationPool only collects and
|
|
1965
|
+
* the network only subscribes to all attestation subnets before them. Proposals only change when the decision block
|
|
1966
|
+
* of next epoch proposers changes (the head enters a new epoch or reorgs that block) or a new validator connects,
|
|
1967
|
+
* set localProposalsKey to null before calling for the latter.
|
|
1968
|
+
* Never throws, it runs during block import.
|
|
1969
|
+
*/
|
|
1970
|
+
private refreshLocalProposals(): void {
|
|
1971
|
+
const clockSlot = this.clock.currentSlot;
|
|
1972
|
+
try {
|
|
1973
|
+
const headState = this.getHeadState();
|
|
1974
|
+
const headFork = this.config.getForkName(headState.slot);
|
|
1975
|
+
// post-fulu, the head state knows proposers of its epoch and the next one thanks to the proposer lookahead,
|
|
1976
|
+
// a pre-fulu state only predicts next epoch proposers
|
|
1977
|
+
if (!isForkPostFulu(headFork) || headState.epoch < computeEpochAtSlot(clockSlot) - 1) {
|
|
1978
|
+
return;
|
|
1979
|
+
}
|
|
1980
|
+
|
|
1981
|
+
const decisionRoot = proposerShufflingDecisionRoot(headFork, headState, headState.epoch + 1);
|
|
1982
|
+
if (decisionRoot === null) {
|
|
1983
|
+
return;
|
|
1984
|
+
}
|
|
1985
|
+
const localProposalsKey = `${headState.epoch}_${toRootHex(decisionRoot)}`;
|
|
1986
|
+
if (localProposalsKey === this.localProposalsKey) {
|
|
1987
|
+
return;
|
|
1988
|
+
}
|
|
1989
|
+
this.localProposalsKey = localProposalsKey;
|
|
1990
|
+
|
|
1991
|
+
const startSlot = computeStartSlotAtEpoch(headState.epoch);
|
|
1992
|
+
const newProposalSlots: Slot[] = [];
|
|
1993
|
+
for (const [i, proposerIndex] of [...headState.currentProposers, ...headState.nextProposers].entries()) {
|
|
1994
|
+
const proposalSlot = startSlot + i;
|
|
1995
|
+
if (
|
|
1996
|
+
proposalSlot >= clockSlot &&
|
|
1997
|
+
this.beaconProposerCache.has(proposerIndex) &&
|
|
1998
|
+
this.proposerTracker.addProposal(proposalSlot)
|
|
1999
|
+
) {
|
|
2000
|
+
newProposalSlots.push(proposalSlot);
|
|
2001
|
+
}
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
if (newProposalSlots.length > 0) {
|
|
2005
|
+
this.emitter.emit(ChainEvent.localProposalSlots, newProposalSlots);
|
|
2006
|
+
}
|
|
2007
|
+
} catch (e) {
|
|
2008
|
+
this.logger.debug("Error refreshing local proposals", {slot: clockSlot}, e as Error);
|
|
2009
|
+
}
|
|
2010
|
+
}
|
|
2011
|
+
|
|
1858
2012
|
private onClockEpoch(epoch: Epoch): void {
|
|
1859
2013
|
this.metrics?.clockEpoch.set(epoch);
|
|
1860
2014
|
|
|
@@ -1869,6 +2023,8 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1869
2023
|
protected onNewHead(head: ProtoBlock): void {
|
|
1870
2024
|
this.syncContributionAndProofPool.prune(head.slot);
|
|
1871
2025
|
this.seenContributionAndProof.prune(head.slot);
|
|
2026
|
+
|
|
2027
|
+
this.refreshLocalProposals();
|
|
1872
2028
|
}
|
|
1873
2029
|
|
|
1874
2030
|
private onForkChoiceJustified(this: BeaconChain, cp: CheckpointWithHex): void {
|
|
@@ -1937,6 +2093,9 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1937
2093
|
|
|
1938
2094
|
// Only update validator custody if we discovered new validators
|
|
1939
2095
|
if (newValidatorCount > previousValidatorCount) {
|
|
2096
|
+
// new validators may propose in the current or next epoch, a failed attempt leaves null so the next head retries
|
|
2097
|
+
this.localProposalsKey = null;
|
|
2098
|
+
this.refreshLocalProposals();
|
|
1940
2099
|
const finalizedCheckpoint = this.forkChoice.getFinalizedCheckpoint();
|
|
1941
2100
|
await this.updateValidatorsCustodyRequirement(finalizedCheckpoint);
|
|
1942
2101
|
}
|
|
@@ -1952,6 +2111,9 @@ export class BeaconChain implements IBeaconChain {
|
|
|
1952
2111
|
|
|
1953
2112
|
// Only update validator custody if we discovered new validators
|
|
1954
2113
|
if (hasNewValidators) {
|
|
2114
|
+
// new validators may propose in the current or next epoch, a failed attempt leaves null so the next head retries
|
|
2115
|
+
this.localProposalsKey = null;
|
|
2116
|
+
this.refreshLocalProposals();
|
|
1955
2117
|
const finalizedCheckpoint = this.forkChoice.getFinalizedCheckpoint();
|
|
1956
2118
|
await this.updateValidatorsCustodyRequirement(finalizedCheckpoint);
|
|
1957
2119
|
}
|
package/src/chain/emitter.ts
CHANGED
|
@@ -3,7 +3,7 @@ import {StrictEventEmitter} from "strict-event-emitter-types";
|
|
|
3
3
|
import {routes} from "@lodestar/api";
|
|
4
4
|
import {CheckpointWithHex, PtcQuorumEvent} from "@lodestar/fork-choice";
|
|
5
5
|
import {IBeaconStateView} from "@lodestar/state-transition";
|
|
6
|
-
import {DataColumnSidecar, RootHex, Slot,
|
|
6
|
+
import {DataColumnSidecar, RootHex, Slot, phase0} from "@lodestar/types";
|
|
7
7
|
import {PeerIdStr} from "../util/peerId.js";
|
|
8
8
|
import {BlockInputSource, IBlockInput} from "./blocks/blockInput/types.js";
|
|
9
9
|
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/payloadEnvelopeInput.js";
|
|
@@ -50,16 +50,16 @@ export enum ChainEvent {
|
|
|
50
50
|
* and are ready to be published.
|
|
51
51
|
*/
|
|
52
52
|
publishDataColumns = "publishDataColumns",
|
|
53
|
-
/**
|
|
54
|
-
* This event signals that blobs have been fetched from the execution engine
|
|
55
|
-
* and are ready to be published.
|
|
56
|
-
*/
|
|
57
|
-
publishBlobSidecars = "publishBlobSidecars",
|
|
58
53
|
/**
|
|
59
54
|
* This event signals that a proposer slashing has been produced from an observed equivocation
|
|
60
55
|
* and is ready to be published.
|
|
61
56
|
*/
|
|
62
57
|
publishProposerSlashing = "publishProposerSlashing",
|
|
58
|
+
/**
|
|
59
|
+
* New block proposal slots of validators connected to this node, the network subscribes to all attestation
|
|
60
|
+
* subnets before them, see `slotsToSubscribeBeforeProposalDuty`
|
|
61
|
+
*/
|
|
62
|
+
localProposalSlots = "localProposalSlots",
|
|
63
63
|
/**
|
|
64
64
|
* Trigger an update of status so reqresp by peers have current earliestAvailableSlot
|
|
65
65
|
*/
|
|
@@ -123,10 +123,10 @@ export type IChainEvents = ApiEvents & {
|
|
|
123
123
|
|
|
124
124
|
[ChainEvent.publishDataColumns]: (sidecars: DataColumnSidecar[]) => void;
|
|
125
125
|
|
|
126
|
-
[ChainEvent.publishBlobSidecars]: (sidecars: deneb.BlobSidecar[]) => void;
|
|
127
|
-
|
|
128
126
|
[ChainEvent.publishProposerSlashing]: (proposerSlashing: phase0.ProposerSlashing) => void;
|
|
129
127
|
|
|
128
|
+
[ChainEvent.localProposalSlots]: (proposalSlots: Slot[]) => void;
|
|
129
|
+
|
|
130
130
|
[ChainEvent.updateStatus]: () => void;
|
|
131
131
|
|
|
132
132
|
// Sync events that are chain->chain. Initiated from network requests but do not cross the network
|
|
@@ -151,6 +151,14 @@ export enum AttestationErrorCode {
|
|
|
151
151
|
* Gloas: index-1 attestation but the execution payload has not been seen yet
|
|
152
152
|
*/
|
|
153
153
|
EXECUTION_PAYLOAD_NOT_SEEN = "ATTESTATION_ERROR_EXECUTION_PAYLOAD_NOT_SEEN",
|
|
154
|
+
/**
|
|
155
|
+
* Gloas: index-1 attestation to a block whose execution payload is not yet validated by the execution engine
|
|
156
|
+
*/
|
|
157
|
+
EXECUTION_PAYLOAD_OPTIMISTIC = "ATTESTATION_ERROR_EXECUTION_PAYLOAD_OPTIMISTIC",
|
|
158
|
+
/**
|
|
159
|
+
* Gloas: index-1 attestation to a block whose execution payload was invalidated
|
|
160
|
+
*/
|
|
161
|
+
EXECUTION_PAYLOAD_INVALID = "ATTESTATION_ERROR_EXECUTION_PAYLOAD_INVALID",
|
|
154
162
|
}
|
|
155
163
|
|
|
156
164
|
export type AttestationErrorType =
|
|
@@ -190,7 +198,9 @@ export type AttestationErrorType =
|
|
|
190
198
|
| {code: AttestationErrorCode.ATTESTER_NOT_IN_COMMITTEE}
|
|
191
199
|
| {code: AttestationErrorCode.INVALID_PAYLOAD_STATUS_VALUE; attDataIndex: number}
|
|
192
200
|
| {code: AttestationErrorCode.PREMATURELY_INDICATED_PAYLOAD_PRESENT}
|
|
193
|
-
| {code: AttestationErrorCode.EXECUTION_PAYLOAD_NOT_SEEN; beaconBlockRoot: RootHex}
|
|
201
|
+
| {code: AttestationErrorCode.EXECUTION_PAYLOAD_NOT_SEEN; beaconBlockRoot: RootHex}
|
|
202
|
+
| {code: AttestationErrorCode.EXECUTION_PAYLOAD_OPTIMISTIC; beaconBlockRoot: RootHex}
|
|
203
|
+
| {code: AttestationErrorCode.EXECUTION_PAYLOAD_INVALID; beaconBlockRoot: RootHex};
|
|
194
204
|
|
|
195
205
|
export class AttestationError extends GossipActionError<AttestationErrorType> {
|
|
196
206
|
getMetadata(): Record<string, string | number | null> {
|
|
@@ -72,7 +72,7 @@ export enum BlockErrorCode {
|
|
|
72
72
|
* whoever served the block MAY be downscored. Mirrors PayloadErrorCode.EXECUTION_ENGINE_INVALID.
|
|
73
73
|
*/
|
|
74
74
|
EXECUTION_ENGINE_INVALID = "BLOCK_ERROR_EXECUTION_INVALID",
|
|
75
|
-
/** The
|
|
75
|
+
/** The blob or column data did not arrive within the availability wait */
|
|
76
76
|
DATA_UNAVAILABLE = "BLOCK_ERROR_DATA_UNAVAILABLE",
|
|
77
77
|
/** Block contains too many kzg commitments */
|
|
78
78
|
TOO_MANY_KZG_COMMITMENTS = "BLOCK_ERROR_TOO_MANY_KZG_COMMITMENTS",
|
|
@@ -7,7 +7,7 @@ export enum ExecutionPayloadBidErrorCode {
|
|
|
7
7
|
NON_ZERO_EXECUTION_PAYMENT = "EXECUTION_PAYLOAD_BID_ERROR_NON_ZERO_EXECUTION_PAYMENT",
|
|
8
8
|
BLOCK_HASH_EQUALS_PARENT_BLOCK_HASH = "EXECUTION_PAYLOAD_BID_ERROR_BLOCK_HASH_EQUALS_PARENT_BLOCK_HASH",
|
|
9
9
|
INCOMPATIBLE_WITH_HEAD = "EXECUTION_PAYLOAD_BID_ERROR_INCOMPATIBLE_WITH_HEAD",
|
|
10
|
-
|
|
10
|
+
BID_LIMIT_REACHED = "EXECUTION_PAYLOAD_BID_ERROR_BID_LIMIT_REACHED",
|
|
11
11
|
BID_TOO_LOW = "EXECUTION_PAYLOAD_BID_ERROR_BID_TOO_LOW",
|
|
12
12
|
BID_TOO_HIGH = "EXECUTION_PAYLOAD_BID_ERROR_BID_TOO_HIGH",
|
|
13
13
|
BUILDER_MAY_EXIT = "EXECUTION_PAYLOAD_BID_ERROR_BUILDER_MAY_EXIT",
|
|
@@ -46,11 +46,12 @@ export type ExecutionPayloadBidErrorType =
|
|
|
46
46
|
headBlockRoot: RootHex;
|
|
47
47
|
}
|
|
48
48
|
| {
|
|
49
|
-
code: ExecutionPayloadBidErrorCode.
|
|
49
|
+
code: ExecutionPayloadBidErrorCode.BID_LIMIT_REACHED;
|
|
50
50
|
builderIndex: BuilderIndex;
|
|
51
51
|
slot: Slot;
|
|
52
52
|
parentBlockRoot: RootHex;
|
|
53
53
|
parentBlockHash: RootHex;
|
|
54
|
+
bidLimit: number;
|
|
54
55
|
}
|
|
55
56
|
| {code: ExecutionPayloadBidErrorCode.BID_TOO_LOW; bidValue: number; currentHighestBid: number}
|
|
56
57
|
| {code: ExecutionPayloadBidErrorCode.BID_TOO_HIGH; bidValue: number; builderBalance: number}
|