@lodestar/beacon-node 1.51.0-dev.2b933d3b9a → 1.51.0-dev.2bcbe7ce2d
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/api.js +1 -1
- package/lib/api/impl/api.js.map +1 -1
- package/lib/api/impl/beacon/blocks/index.d.ts +2 -1
- package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/blocks/index.js +29 -34
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/index.d.ts +2 -1
- package/lib/api/impl/beacon/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/index.js +2 -2
- package/lib/api/impl/beacon/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 +5 -2
- 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/validator/index.d.ts +6 -0
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +49 -31
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/api/options.d.ts +2 -0
- package/lib/api/options.d.ts.map +1 -1
- package/lib/api/options.js +1 -0
- package/lib/api/options.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +11 -0
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +85 -27
- 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/utils/archiveBlocks.d.ts +4 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +61 -97
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +6 -5
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +6 -11
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +10 -16
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.js +2 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +12 -9
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +24 -19
- package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
- package/lib/chain/blocks/types.d.ts +4 -1
- package/lib/chain/blocks/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +18 -7
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js +8 -1
- package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +7 -5
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +3 -3
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +11 -6
- package/lib/chain/blocks/verifyPayloadsDataAvailability.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.map +1 -1
- package/lib/chain/bls/multithread/index.js +13 -11
- 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 +1 -1
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +1 -1
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +4 -4
- package/lib/chain/chain.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/interface.d.ts +2 -3
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/interface.js.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +23 -10
- 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.map +1 -1
- package/lib/chain/opPools/inclusionListStore.js +2 -2
- package/lib/chain/opPools/inclusionListStore.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/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 +0 -1
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +0 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +0 -1
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/interface.d.ts +0 -1
- package/lib/chain/regen/interface.d.ts.map +1 -1
- package/lib/chain/regen/interface.js +0 -1
- package/lib/chain/regen/interface.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts +0 -15
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +13 -166
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/inclusionList.d.ts.map +1 -1
- package/lib/chain/validation/inclusionList.js +11 -2
- package/lib/chain/validation/inclusionList.js.map +1 -1
- package/lib/db/beacon.d.ts +7 -0
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +34 -0
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/dataColumnStore.d.ts +1 -1
- package/lib/db/dataColumnStore.d.ts.map +1 -1
- package/lib/db/dataColumnStore.js +1 -4
- package/lib/db/dataColumnStore.js.map +1 -1
- package/lib/db/flatFileStore/flatFileStore.js +5 -5
- package/lib/db/flatFileStore/flatFileStore.js.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/interface.d.ts +1 -0
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts +6 -0
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +19 -0
- 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/blobVersionedHashes.d.ts +1 -1
- package/lib/execution/engine/blobVersionedHashes.d.ts.map +1 -1
- package/lib/execution/engine/blobVersionedHashes.js.map +1 -1
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +0 -1
- 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 +1 -1
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +6 -4
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts +1 -2
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/payloadIdCache.js +3 -3
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/sszTypes.d.ts +38 -38
- package/lib/execution/engine/types.d.ts +1 -1
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +9 -8
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +2 -0
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +7 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +15 -0
- package/lib/metrics/metrics/lodestar.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 +2 -0
- package/lib/network/core/networkCore.d.ts.map +1 -1
- package/lib/network/core/networkCore.js +3 -0
- package/lib/network/core/networkCore.js.map +1 -1
- package/lib/network/core/networkCoreWorker.js +1 -0
- package/lib/network/core/networkCoreWorker.js.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.d.ts +2 -0
- package/lib/network/core/networkCoreWorkerHandler.d.ts.map +1 -1
- package/lib/network/core/networkCoreWorkerHandler.js +3 -0
- package/lib/network/core/networkCoreWorkerHandler.js.map +1 -1
- package/lib/network/core/types.d.ts +2 -0
- package/lib/network/core/types.d.ts.map +1 -1
- package/lib/network/gossip/topic.d.ts +6 -6
- package/lib/network/interface.d.ts +2 -0
- 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 +2 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +6 -1
- 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.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.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/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +36 -26
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +26 -25
- package/lib/network/processor/index.js.map +1 -1
- package/lib/node/nodejs.d.ts +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +11 -2
- 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/sync.d.ts +7 -0
- package/lib/sync/sync.d.ts.map +1 -1
- package/lib/sync/sync.js +61 -3
- package/lib/sync/sync.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +42 -18
- package/lib/sync/unknownBlock.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.js +2 -2
- package/lib/util/sszBytes.js.map +1 -1
- package/package.json +31 -32
- package/src/api/impl/api.ts +1 -1
- package/src/api/impl/beacon/blocks/index.ts +57 -62
- package/src/api/impl/beacon/index.ts +3 -1
- package/src/api/impl/beacon/pool/index.ts +5 -1
- package/src/api/impl/beacon/state/utils.ts +1 -1
- package/src/api/impl/validator/index.ts +54 -37
- package/src/api/options.ts +3 -0
- package/src/chain/GetBlobsTracker.ts +97 -38
- package/src/chain/archiveStore/archiveStore.ts +1 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +76 -130
- package/src/chain/blocks/importBlock.ts +8 -7
- package/src/chain/blocks/importExecutionPayload.ts +15 -22
- package/src/chain/blocks/index.ts +6 -2
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +35 -24
- package/src/chain/blocks/types.ts +4 -1
- package/src/chain/blocks/verifyBlock.ts +31 -16
- package/src/chain/blocks/verifyBlocksDataAvailability.ts +10 -1
- package/src/chain/blocks/verifyBlocksSignatures.ts +7 -5
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +14 -6
- package/src/chain/bls/interface.ts +2 -0
- package/src/chain/bls/multithread/index.ts +14 -10
- 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 +1 -1
- package/src/chain/chain.ts +5 -5
- package/src/chain/errors/blockError.ts +1 -1
- package/src/chain/interface.ts +2 -3
- package/src/chain/opPools/aggregatedAttestationPool.ts +25 -9
- package/src/chain/opPools/attestationPool.ts +16 -4
- package/src/chain/opPools/inclusionListStore.ts +3 -3
- package/src/chain/opPools/payloadAttestationPool.ts +18 -7
- 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 +0 -2
- package/src/chain/produceBlock/produceBlockBody.ts +0 -1
- package/src/chain/regen/interface.ts +0 -1
- package/src/chain/validation/executionPayloadBid.ts +14 -193
- package/src/chain/validation/inclusionList.ts +11 -2
- package/src/db/beacon.ts +44 -0
- package/src/db/dataColumnStore.ts +2 -4
- package/src/db/flatFileStore/flatFileStore.ts +7 -7
- package/src/db/flatFileStore/slotIndex.ts +4 -3
- package/src/db/interface.ts +2 -0
- package/src/db/repositories/dataColumnSidecarArchive.ts +20 -0
- package/src/execution/builder/apiClient.ts +16 -13
- package/src/execution/builder/http.ts +4 -0
- package/src/execution/engine/blobVersionedHashes.ts +1 -1
- package/src/execution/engine/http.ts +0 -1
- package/src/execution/engine/index.ts +1 -1
- package/src/execution/engine/interface.ts +1 -1
- package/src/execution/engine/mock.ts +6 -4
- package/src/execution/engine/payloadIdCache.ts +6 -7
- package/src/execution/engine/types.ts +11 -9
- package/src/index.ts +2 -0
- package/src/metrics/metrics/lodestar.ts +15 -0
- package/src/monitoring/service.ts +1 -1
- package/src/network/core/networkCore.ts +5 -0
- package/src/network/core/networkCoreWorker.ts +1 -0
- package/src/network/core/networkCoreWorkerHandler.ts +4 -0
- package/src/network/core/types.ts +2 -0
- package/src/network/interface.ts +2 -0
- package/src/network/libp2p/index.ts +5 -1
- package/src/network/network.ts +8 -1
- package/src/network/options.ts +2 -0
- package/src/network/peers/peerManager.ts +1 -1
- package/src/network/peers/utils/assertPeerRelevance.ts +39 -23
- package/src/network/processor/gossipHandlers.ts +44 -28
- package/src/network/processor/index.ts +22 -23
- package/src/network/processor/types.ts +1 -1
- package/src/node/nodejs.ts +25 -7
- package/src/node/options.ts +9 -6
- package/src/sync/interface.ts +1 -0
- package/src/sync/sync.ts +65 -4
- package/src/sync/unknownBlock.ts +47 -28
- package/src/util/file.ts +8 -9
- package/src/util/queue/itemQueue.ts +1 -1
- package/src/util/sszBytes.ts +2 -2
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.51.0-dev.
|
|
14
|
+
"version": "1.51.0-dev.2bcbe7ce2d",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -105,39 +105,39 @@
|
|
|
105
105
|
"@chainsafe/enr": "^6.0.2",
|
|
106
106
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
107
107
|
"@chainsafe/libp2p-quic": "^2.1.5",
|
|
108
|
-
"@chainsafe/lodestar-z": "catalog:",
|
|
109
108
|
"@chainsafe/persistent-merkle-tree": "^1.3.1",
|
|
110
109
|
"@chainsafe/prometheus-gc-stats": "^1.0.0",
|
|
111
110
|
"@chainsafe/snappy-wasm": "^0.5.2",
|
|
112
|
-
"@chainsafe/ssz": "^1.
|
|
111
|
+
"@chainsafe/ssz": "^1.9.0",
|
|
113
112
|
"@chainsafe/threads": "^1.11.3",
|
|
114
113
|
"@crate-crypto/node-eth-kzg": "0.9.1",
|
|
115
114
|
"@fastify/bearer-auth": "^10.0.1",
|
|
116
115
|
"@fastify/cors": "^10.0.1",
|
|
117
116
|
"@fastify/swagger": "^9.0.0",
|
|
118
117
|
"@fastify/swagger-ui": "^5.0.1",
|
|
119
|
-
"@libp2p/bootstrap": "^12.0.
|
|
120
|
-
"@libp2p/crypto": "^5.1.
|
|
121
|
-
"@libp2p/gossipsub": "^17.1.
|
|
122
|
-
"@libp2p/identify": "^4.1.
|
|
123
|
-
"@libp2p/interface": "^3.
|
|
124
|
-
"@libp2p/mdns": "^12.0.
|
|
125
|
-
"@libp2p/mplex": "^12.0.
|
|
126
|
-
"@libp2p/peer-id": "^6.0.
|
|
127
|
-
"@libp2p/prometheus-metrics": "^5.0.
|
|
128
|
-
"@libp2p/tcp": "^11.0.
|
|
129
|
-
"@libp2p/utils": "^7.4.
|
|
130
|
-
"@lodestar/api": "^1.51.0-dev.
|
|
131
|
-
"@lodestar/config": "^1.51.0-dev.
|
|
132
|
-
"@lodestar/db": "^1.51.0-dev.
|
|
133
|
-
"@lodestar/fork-choice": "^1.51.0-dev.
|
|
134
|
-
"@lodestar/logger": "^1.51.0-dev.
|
|
135
|
-
"@lodestar/
|
|
136
|
-
"@lodestar/
|
|
137
|
-
"@lodestar/
|
|
138
|
-
"@lodestar/
|
|
139
|
-
"@lodestar/
|
|
140
|
-
"@lodestar/
|
|
118
|
+
"@libp2p/bootstrap": "^12.0.34",
|
|
119
|
+
"@libp2p/crypto": "^5.1.25",
|
|
120
|
+
"@libp2p/gossipsub": "^17.1.4",
|
|
121
|
+
"@libp2p/identify": "^4.1.16",
|
|
122
|
+
"@libp2p/interface": "^3.4.0",
|
|
123
|
+
"@libp2p/mdns": "^12.0.34",
|
|
124
|
+
"@libp2p/mplex": "^12.0.34",
|
|
125
|
+
"@libp2p/peer-id": "^6.0.17",
|
|
126
|
+
"@libp2p/prometheus-metrics": "^5.0.31",
|
|
127
|
+
"@libp2p/tcp": "^11.0.30",
|
|
128
|
+
"@libp2p/utils": "^7.4.3",
|
|
129
|
+
"@lodestar/api": "^1.51.0-dev.2bcbe7ce2d",
|
|
130
|
+
"@lodestar/config": "^1.51.0-dev.2bcbe7ce2d",
|
|
131
|
+
"@lodestar/db": "^1.51.0-dev.2bcbe7ce2d",
|
|
132
|
+
"@lodestar/fork-choice": "^1.51.0-dev.2bcbe7ce2d",
|
|
133
|
+
"@lodestar/logger": "^1.51.0-dev.2bcbe7ce2d",
|
|
134
|
+
"@lodestar/native": "^1.51.0-dev.2bcbe7ce2d",
|
|
135
|
+
"@lodestar/params": "^1.51.0-dev.2bcbe7ce2d",
|
|
136
|
+
"@lodestar/reqresp": "^1.51.0-dev.2bcbe7ce2d",
|
|
137
|
+
"@lodestar/state-transition": "^1.51.0-dev.2bcbe7ce2d",
|
|
138
|
+
"@lodestar/types": "^1.51.0-dev.2bcbe7ce2d",
|
|
139
|
+
"@lodestar/utils": "^1.51.0-dev.2bcbe7ce2d",
|
|
140
|
+
"@lodestar/validator": "^1.51.0-dev.2bcbe7ce2d",
|
|
141
141
|
"@multiformats/multiaddr": "^13.0.1",
|
|
142
142
|
"datastore-core": "^12.0.1",
|
|
143
143
|
"datastore-level": "^13.0.1",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"fastify": "^5.8.1",
|
|
146
146
|
"interface-datastore": "^10.0.1",
|
|
147
147
|
"jwt-simple": "0.5.6",
|
|
148
|
-
"libp2p": "3.
|
|
148
|
+
"libp2p": "3.4.0",
|
|
149
149
|
"multiformats": "^13.4.2",
|
|
150
150
|
"prom-client": "^15.1.0",
|
|
151
151
|
"qs": "^6.14.2",
|
|
@@ -157,16 +157,15 @@
|
|
|
157
157
|
},
|
|
158
158
|
"devDependencies": {
|
|
159
159
|
"@ethereumjs/rlp": "^4.0.1",
|
|
160
|
-
"@libp2p/interface-internal": "^3.
|
|
161
|
-
"@libp2p/logger": "^6.2.
|
|
162
|
-
"@lodestar/spec-test-util": "^1.51.0-dev.
|
|
163
|
-
"@lodestar/test-utils": "^1.51.0-dev.
|
|
160
|
+
"@libp2p/interface-internal": "^3.2.0",
|
|
161
|
+
"@libp2p/logger": "^6.2.15",
|
|
162
|
+
"@lodestar/spec-test-util": "^1.51.0-dev.2bcbe7ce2d",
|
|
163
|
+
"@lodestar/test-utils": "^1.51.0-dev.2bcbe7ce2d",
|
|
164
164
|
"@types/js-yaml": "^4.0.5",
|
|
165
165
|
"@types/qs": "^6.9.7",
|
|
166
166
|
"@types/tmp": "^0.2.3",
|
|
167
167
|
"dotenv": "^16.4.5",
|
|
168
168
|
"js-yaml": "^4.1.0",
|
|
169
|
-
"rimraf": "^4.4.1",
|
|
170
169
|
"tmp": "^0.2.1"
|
|
171
170
|
},
|
|
172
171
|
"keywords": [
|
|
@@ -175,5 +174,5 @@
|
|
|
175
174
|
"beacon",
|
|
176
175
|
"blockchain"
|
|
177
176
|
],
|
|
178
|
-
"gitHead": "
|
|
177
|
+
"gitHead": "45314f9f511749795738da0f641502f8bb162957"
|
|
179
178
|
}
|
package/src/api/impl/api.ts
CHANGED
|
@@ -13,7 +13,7 @@ import {getValidatorApi} from "./validator/index.js";
|
|
|
13
13
|
|
|
14
14
|
export function getApi(opts: ApiOptions, modules: ApiModules): BeaconApiMethods {
|
|
15
15
|
return {
|
|
16
|
-
beacon: getBeaconApi(modules),
|
|
16
|
+
beacon: getBeaconApi(opts, modules),
|
|
17
17
|
config: getConfigApi(modules),
|
|
18
18
|
debug: getDebugApi(modules),
|
|
19
19
|
events: getEventsApi(modules),
|
|
@@ -62,7 +62,7 @@ import {
|
|
|
62
62
|
} from "../../../../chain/produceBlock/index.js";
|
|
63
63
|
import {RegenCaller} from "../../../../chain/regen/index.js";
|
|
64
64
|
import {validateGossipBlock, verifyBlockProposerSignature} from "../../../../chain/validation/block.js";
|
|
65
|
-
import {
|
|
65
|
+
import {validateGossipExecutionPayloadBid} from "../../../../chain/validation/executionPayloadBid.js";
|
|
66
66
|
import {validateApiExecutionPayloadEnvelope} from "../../../../chain/validation/executionPayloadEnvelope.js";
|
|
67
67
|
import {OpSource} from "../../../../chain/validatorMonitor.js";
|
|
68
68
|
import {
|
|
@@ -79,6 +79,7 @@ import {
|
|
|
79
79
|
import {isOptimisticBlock} from "../../../../util/forkChoice.js";
|
|
80
80
|
import {kzg} from "../../../../util/kzg.js";
|
|
81
81
|
import {promiseAllMaybeAsync} from "../../../../util/promises.js";
|
|
82
|
+
import {ApiOptions} from "../../../options.js";
|
|
82
83
|
import {ApiModules} from "../../types.js";
|
|
83
84
|
import {assertUniqueItems} from "../../utils.js";
|
|
84
85
|
import {getBlockResponse, toBeaconHeaderResponse} from "./utils.js";
|
|
@@ -96,16 +97,10 @@ const MAX_API_CLOCK_DISPARITY_MS = 1000;
|
|
|
96
97
|
*/
|
|
97
98
|
const IDENTITY_PEER_ID = ""; // TODO: Compute identity keypair
|
|
98
99
|
|
|
99
|
-
export function getBeaconBlockApi(
|
|
100
|
-
|
|
101
|
-
config,
|
|
102
|
-
|
|
103
|
-
network,
|
|
104
|
-
db,
|
|
105
|
-
}: Pick<
|
|
106
|
-
ApiModules,
|
|
107
|
-
"chain" | "config" | "metrics" | "network" | "db"
|
|
108
|
-
>): ApplicationMethods<routes.beacon.block.Endpoints> {
|
|
100
|
+
export function getBeaconBlockApi(
|
|
101
|
+
opts: ApiOptions,
|
|
102
|
+
{chain, config, metrics, network, db}: Pick<ApiModules, "chain" | "config" | "metrics" | "network" | "db">
|
|
103
|
+
): ApplicationMethods<routes.beacon.block.Endpoints> {
|
|
109
104
|
const publishBlockV2: ApplicationMethods<routes.beacon.block.Endpoints>["publishBlockV2"] = async (
|
|
110
105
|
{signedBlockContents, broadcastValidation, builderUrl},
|
|
111
106
|
context,
|
|
@@ -321,18 +316,8 @@ export function getBeaconBlockApi({
|
|
|
321
316
|
break;
|
|
322
317
|
}
|
|
323
318
|
|
|
324
|
-
case routes.beacon.BroadcastValidation.none: {
|
|
325
|
-
chain.logger.debug("Skipping broadcast validation", valLogMeta);
|
|
326
|
-
break;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
319
|
default: {
|
|
330
|
-
|
|
331
|
-
const message = `Broadcast validation of ${broadcastValidation} type not implemented yet`;
|
|
332
|
-
if (chain.opts.broadcastValidationStrictness === "error") {
|
|
333
|
-
throw Error(message);
|
|
334
|
-
}
|
|
335
|
-
chain.logger.warn(message, valLogMeta);
|
|
320
|
+
throw new ApiError(400, `Invalid broadcast validation level ${broadcastValidation}`);
|
|
336
321
|
}
|
|
337
322
|
}
|
|
338
323
|
|
|
@@ -402,26 +387,24 @@ export function getBeaconBlockApi({
|
|
|
402
387
|
...blobSidecars.map((blobSidecar) => () => network.publishBlobSidecar(blobSidecar)),
|
|
403
388
|
() =>
|
|
404
389
|
// there is no rush to persist block since we published it to gossip anyway
|
|
405
|
-
chain
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
source: BlockInputSource.api,
|
|
420
|
-
});
|
|
421
|
-
}
|
|
390
|
+
chain.processBlock(blockForImport, opts).catch((e) => {
|
|
391
|
+
if (e instanceof BlockError) {
|
|
392
|
+
switch (e.type.code) {
|
|
393
|
+
case BlockErrorCode.ALREADY_KNOWN:
|
|
394
|
+
// Block was imported while publishing, e.g. received via gossip
|
|
395
|
+
chain.logger.debug("Ignoring already-known block during publishing", valLogMeta);
|
|
396
|
+
return;
|
|
397
|
+
case BlockErrorCode.PARENT_BLOCK_UNKNOWN:
|
|
398
|
+
case BlockErrorCode.PARENT_PAYLOAD_UNKNOWN:
|
|
399
|
+
chain.emitter.emit(ChainEvent.blockUnknownParent, {
|
|
400
|
+
blockInput: blockForImport,
|
|
401
|
+
peer: IDENTITY_PEER_ID,
|
|
402
|
+
source: BlockInputSource.api,
|
|
403
|
+
});
|
|
422
404
|
}
|
|
423
|
-
|
|
424
|
-
|
|
405
|
+
}
|
|
406
|
+
throw e;
|
|
407
|
+
}),
|
|
425
408
|
];
|
|
426
409
|
const sentPeersArr = await promiseAllMaybeAsync<{sentPeers: number; alreadyPublished: boolean} | number | void>(
|
|
427
410
|
publishPromises
|
|
@@ -809,11 +792,6 @@ export function getBeaconBlockApi({
|
|
|
809
792
|
};
|
|
810
793
|
try {
|
|
811
794
|
switch (broadcastValidation) {
|
|
812
|
-
case routes.beacon.BroadcastValidation.none: {
|
|
813
|
-
chain.logger.debug("Skipping broadcast validation of execution payload envelope", valLogMeta);
|
|
814
|
-
break;
|
|
815
|
-
}
|
|
816
|
-
|
|
817
795
|
case routes.beacon.BroadcastValidation.gossip: {
|
|
818
796
|
await validateApiExecutionPayloadEnvelope(chain, signedExecutionPayloadEnvelope);
|
|
819
797
|
break;
|
|
@@ -852,11 +830,7 @@ export function getBeaconBlockApi({
|
|
|
852
830
|
}
|
|
853
831
|
|
|
854
832
|
default: {
|
|
855
|
-
|
|
856
|
-
if (chain.opts.broadcastValidationStrictness === "error") {
|
|
857
|
-
throw Error(message);
|
|
858
|
-
}
|
|
859
|
-
chain.logger.warn(message, valLogMeta);
|
|
833
|
+
throw new ApiError(400, `Invalid broadcast validation level ${broadcastValidation}`);
|
|
860
834
|
}
|
|
861
835
|
}
|
|
862
836
|
} catch (error) {
|
|
@@ -1008,9 +982,13 @@ export function getBeaconBlockApi({
|
|
|
1008
982
|
() => network.publishSignedExecutionPayloadEnvelope(signedExecutionPayloadEnvelope),
|
|
1009
983
|
// Publish all data column sidecars
|
|
1010
984
|
...dataColumnSidecars.map((dataColumnSidecar) => () => network.publishDataColumnSidecar(dataColumnSidecar)),
|
|
1011
|
-
// Import execution payload
|
|
1012
|
-
|
|
1013
|
-
|
|
985
|
+
// Import execution payload
|
|
986
|
+
() =>
|
|
987
|
+
chain.processExecutionPayload(payloadInput, {
|
|
988
|
+
// Signature is verified during broadcast validation only for the submitted envelope,
|
|
989
|
+
// an envelope cached by another source is verified at import
|
|
990
|
+
validSignature: payloadInput.getPayloadEnvelope() === signedExecutionPayloadEnvelope,
|
|
991
|
+
}),
|
|
1014
992
|
];
|
|
1015
993
|
|
|
1016
994
|
const publishPromise = promiseAllMaybeAsync<{sentPeers: number; alreadyPublished: boolean} | number | void>(
|
|
@@ -1077,15 +1055,25 @@ export function getBeaconBlockApi({
|
|
|
1077
1055
|
throw new ApiError(400, `publishExecutionPayloadBid not supported for pre-gloas fork=${fork}`);
|
|
1078
1056
|
}
|
|
1079
1057
|
|
|
1080
|
-
const validationTimer = metrics?.opPool.executionPayloadBidPool.apiValidationTime.startTimer();
|
|
1081
|
-
// TODO: once the builder is tested and can be trusted, skip this local validation
|
|
1082
|
-
// to publish faster, accepting peer-score risk if it ever emits an invalid bid.
|
|
1083
|
-
await validateApiExecutionPayloadBid(chain, signedExecutionPayloadBid);
|
|
1084
|
-
validationTimer?.();
|
|
1085
|
-
|
|
1086
1058
|
const elapsedSec = chain.clock.secFromSlot(slot, seenTimestampSec);
|
|
1087
1059
|
metrics?.gossipExecutionPayloadBid.elapsedTimeTillReceived.observe({source: OpSource.api}, elapsedSec);
|
|
1088
1060
|
|
|
1061
|
+
if (!opts.disableBidValidation) {
|
|
1062
|
+
const validationTimer = metrics?.opPool.executionPayloadBidPool.apiValidationTime.startTimer();
|
|
1063
|
+
const {proposerIndex} = await validateGossipExecutionPayloadBid(chain, signedExecutionPayloadBid);
|
|
1064
|
+
validationTimer?.();
|
|
1065
|
+
|
|
1066
|
+
// Gossip does not deliver our own messages back to us, so a validated bid is added to the
|
|
1067
|
+
// pool here to allow a proposer on this node to select it
|
|
1068
|
+
const insertOutcome = chain.executionPayloadBidPool.add(
|
|
1069
|
+
signedExecutionPayloadBid,
|
|
1070
|
+
Math.floor(elapsedSec * 1000)
|
|
1071
|
+
);
|
|
1072
|
+
metrics?.opPool.executionPayloadBidPool.apiInsertOutcome.inc({insertOutcome});
|
|
1073
|
+
|
|
1074
|
+
chain.validatorMonitor?.registerExecutionPayloadBid(OpSource.api, proposerIndex, bid);
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1089
1077
|
const sentPeers = await network.publishSignedExecutionPayloadBid(signedExecutionPayloadBid);
|
|
1090
1078
|
|
|
1091
1079
|
chain.emitter.emit(routes.events.EventType.executionPayloadBid, {
|
|
@@ -1104,7 +1092,7 @@ export function getBeaconBlockApi({
|
|
|
1104
1092
|
},
|
|
1105
1093
|
|
|
1106
1094
|
async getSignedExecutionPayloadEnvelope({blockId}, context) {
|
|
1107
|
-
const {block,
|
|
1095
|
+
const {block, finalized} = await getBlockResponse(chain, blockId);
|
|
1108
1096
|
const slot = block.message.slot;
|
|
1109
1097
|
const fork = config.getForkName(slot);
|
|
1110
1098
|
|
|
@@ -1118,6 +1106,13 @@ export function getBeaconBlockApi({
|
|
|
1118
1106
|
const blockRoot = config.getForkTypes(slot).BeaconBlock.hashTreeRoot(block.message);
|
|
1119
1107
|
const blockRootHex = toRootHex(blockRoot);
|
|
1120
1108
|
|
|
1109
|
+
// The block's own flag is the status of the payload it builds on, the envelope's is that of its
|
|
1110
|
+
// FULL variant. An unfinalized block without one has not imported its envelope yet.
|
|
1111
|
+
const payload = finalized ? null : chain.forkChoice.getBlockHex(blockRootHex, PayloadStatus.FULL);
|
|
1112
|
+
if (!finalized && payload === null) {
|
|
1113
|
+
throw new ApiError(404, `Execution payload envelope not found for slot=${slot}, blockRoot=${blockRootHex}`);
|
|
1114
|
+
}
|
|
1115
|
+
|
|
1121
1116
|
let data: Uint8Array | gloas.SignedExecutionPayloadEnvelope | null;
|
|
1122
1117
|
try {
|
|
1123
1118
|
data = context?.returnBytes
|
|
@@ -1142,7 +1137,7 @@ export function getBeaconBlockApi({
|
|
|
1142
1137
|
|
|
1143
1138
|
return {
|
|
1144
1139
|
data,
|
|
1145
|
-
meta: {executionOptimistic, finalized, version: fork},
|
|
1140
|
+
meta: {executionOptimistic: payload !== null && isOptimisticBlock(payload), finalized, version: fork},
|
|
1146
1141
|
};
|
|
1147
1142
|
},
|
|
1148
1143
|
|
|
@@ -3,6 +3,7 @@ import {ApplicationMethods} from "@lodestar/api/server";
|
|
|
3
3
|
import {isForkPostGloas} from "@lodestar/params";
|
|
4
4
|
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
5
5
|
import {toRootHex} from "@lodestar/utils";
|
|
6
|
+
import {ApiOptions} from "../../options.js";
|
|
6
7
|
import {ApiError} from "../errors.js";
|
|
7
8
|
import {ApiModules} from "../types.js";
|
|
8
9
|
import {getBeaconBlockApi} from "./blocks/index.js";
|
|
@@ -11,9 +12,10 @@ import {getBeaconRewardsApi} from "./rewards/index.js";
|
|
|
11
12
|
import {getBeaconStateApi} from "./state/index.js";
|
|
12
13
|
|
|
13
14
|
export function getBeaconApi(
|
|
15
|
+
opts: ApiOptions,
|
|
14
16
|
modules: Pick<ApiModules, "chain" | "config" | "logger" | "metrics" | "network" | "db" | "sync">
|
|
15
17
|
): ApplicationMethods<routes.beacon.Endpoints> {
|
|
16
|
-
const block = getBeaconBlockApi(modules);
|
|
18
|
+
const block = getBeaconBlockApi(opts, modules);
|
|
17
19
|
const pool = getBeaconPoolApi(modules);
|
|
18
20
|
const state = getBeaconStateApi(modules);
|
|
19
21
|
const rewards = getBeaconRewardsApi(modules);
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
PayloadAttestationError,
|
|
18
18
|
PayloadAttestationErrorCode,
|
|
19
19
|
SyncCommitteeError,
|
|
20
|
+
SyncCommitteeErrorCode,
|
|
20
21
|
} from "../../../../chain/errors/index.js";
|
|
21
22
|
import {validateApiAttesterSlashing} from "../../../../chain/validation/attesterSlashing.js";
|
|
22
23
|
import {validateApiBlsToExecutionChange} from "../../../../chain/validation/blsToExecutionChange.js";
|
|
@@ -340,7 +341,10 @@ export function getBeaconPoolApi({
|
|
|
340
341
|
const synCommittee = state.getIndexedSyncCommittee(signature.slot);
|
|
341
342
|
const indexesInCommittee = synCommittee.validatorIndexMap.get(signature.validatorIndex);
|
|
342
343
|
if (indexesInCommittee === undefined || indexesInCommittee.length === 0) {
|
|
343
|
-
|
|
344
|
+
throw new SyncCommitteeError(GossipAction.REJECT, {
|
|
345
|
+
code: SyncCommitteeErrorCode.VALIDATOR_NOT_IN_SYNC_COMMITTEE,
|
|
346
|
+
validatorIndex: signature.validatorIndex,
|
|
347
|
+
});
|
|
344
348
|
}
|
|
345
349
|
|
|
346
350
|
// Verify signature only, all other data is very likely to be correct, since the `signature` object is created by this node.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {type PubkeyCache} from "@chainsafe/lodestar-z/pubkeys";
|
|
2
1
|
import {routes} from "@lodestar/api";
|
|
3
2
|
import {CheckpointWithHex, IForkChoice} from "@lodestar/fork-choice";
|
|
3
|
+
import {type PubkeyCache} from "@lodestar/native/pubkeys";
|
|
4
4
|
import {GENESIS_SLOT} from "@lodestar/params";
|
|
5
5
|
import {IBeaconStateView, IBeaconStateViewGloas} from "@lodestar/state-transition";
|
|
6
6
|
import {
|
|
@@ -94,7 +94,7 @@ import {
|
|
|
94
94
|
import {validateGossipProposerPreferences} from "../../../chain/validation/proposerPreferences.js";
|
|
95
95
|
import {validateSyncCommitteeGossipContributionAndProof} from "../../../chain/validation/syncCommitteeContributionAndProof.js";
|
|
96
96
|
import {ZERO_HASH} from "../../../constants/index.js";
|
|
97
|
-
import {
|
|
97
|
+
import {BuilderApiBid, decodeBuilderUrl} from "../../../execution/builder/apiClient.js";
|
|
98
98
|
import {BuilderStatus, NoBidReceived} from "../../../execution/builder/http.js";
|
|
99
99
|
import {getBuilderBidTotalGwei, validateBuilderApiExecutionPayloadBid} from "../../../execution/builder/validateBid.js";
|
|
100
100
|
import {validateGossipFnRetryUnknownRoot} from "../../../network/processor/gossipHandlers.js";
|
|
@@ -123,10 +123,14 @@ import {
|
|
|
123
123
|
* A cutoff of 1667 BPS (2 seconds for 12s slots) gives enough time and if there are unexpected delays
|
|
124
124
|
* it ensures we publish in time as proposals after the attestation deadline will likely be orphaned
|
|
125
125
|
* due to proposer boost reorg.
|
|
126
|
-
*
|
|
127
|
-
* TODO GLOAS: re-evaluate cutoff timing due to attestation deadline changes in gloas
|
|
128
126
|
*/
|
|
129
127
|
const BLOCK_PRODUCTION_RACE_CUTOFF_BPS = 1667;
|
|
128
|
+
/**
|
|
129
|
+
* Post-gloas cutoff, kept at 1667 BPS (2 seconds for 12s slots) for now.
|
|
130
|
+
*
|
|
131
|
+
* TODO GLOAS: revisit, the block propagates faster as it only commits to a bid and the attestation deadline changed
|
|
132
|
+
*/
|
|
133
|
+
export const BLOCK_PRODUCTION_RACE_CUTOFF_GLOAS_BPS = 1667;
|
|
130
134
|
/** Rejection message of the bid block branch when there is no viable bid to commit to */
|
|
131
135
|
const NO_BID_AVAILABLE = "No builder bid available";
|
|
132
136
|
|
|
@@ -254,13 +258,13 @@ export function getValidatorApi(
|
|
|
254
258
|
genesisBlockRoot = state.computeAnchorCheckpoint().checkpoint.root;
|
|
255
259
|
} else if (state.slot < SLOTS_PER_HISTORICAL_ROOT) {
|
|
256
260
|
genesisBlockRoot = state.getBlockRootAtSlot(GENESIS_SLOT);
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
261
|
+
} else {
|
|
262
|
+
const blockRes = await chain.getCanonicalBlockAtSlot(GENESIS_SLOT);
|
|
263
|
+
if (blockRes) {
|
|
264
|
+
genesisBlockRoot = config
|
|
265
|
+
.getForkTypes(blockRes.block.message.slot)
|
|
266
|
+
.BeaconBlock.hashTreeRoot(blockRes.block.message);
|
|
267
|
+
}
|
|
264
268
|
}
|
|
265
269
|
}
|
|
266
270
|
|
|
@@ -1005,33 +1009,50 @@ export function getValidatorApi(
|
|
|
1005
1009
|
(!circuitBreakerActive &&
|
|
1006
1010
|
chain.executionPayloadBidPool.getBestBid(slot, bidParentBlockHash, parentBlockRootHex) !== null);
|
|
1007
1011
|
|
|
1008
|
-
//
|
|
1009
|
-
//
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
});
|
|
1022
|
-
return null;
|
|
1023
|
-
}
|
|
1024
|
-
return p2pBid;
|
|
1025
|
-
});
|
|
1012
|
+
// Calculate cutoff time based on start of the slot, ensures a slow local payload build does
|
|
1013
|
+
// not delay the proposal when a builder bid block is available (and vice versa)
|
|
1014
|
+
const cutoffMs = Math.max(
|
|
1015
|
+
0,
|
|
1016
|
+
config.getSlotComponentDurationMs(fork, BLOCK_PRODUCTION_RACE_CUTOFF_GLOAS_BPS) - chain.clock.msFromSlot(slot)
|
|
1017
|
+
);
|
|
1018
|
+
|
|
1019
|
+
// Give p2p bids the same time to bid up as granted to builder API bid requests via the advertised
|
|
1020
|
+
// deadline, the pool is read once the deadline passed and the bid requests settled. A late request
|
|
1021
|
+
// does not wait past the race cutoff, a pooled bid is still the fastest fallback if the local block fails
|
|
1022
|
+
const bidDeadlinePromise = circuitBreakerActive
|
|
1023
|
+
? Promise.resolve()
|
|
1024
|
+
: sleep(Math.min(chain.builderApiClient.bidDeadline, cutoffMs));
|
|
1026
1025
|
|
|
1027
1026
|
// Candidates are ranked by their boosted counted total payment, the p2p bid is governed
|
|
1028
1027
|
// by the top-level factors and each builder API bid by its own entry. Ties prefer the
|
|
1029
1028
|
// earliest received builder API bid, so the signed block can be routed back to its
|
|
1030
1029
|
// builder directly.
|
|
1031
1030
|
const bestBidPromise: Promise<BidCandidate | null> = (async () => {
|
|
1032
|
-
|
|
1031
|
+
// Past the race cutoff a pooled p2p bid is used right away rather than waiting for pending
|
|
1032
|
+
// builder API requests, the local block is selected at the cutoff anyway if it is ready
|
|
1033
|
+
let [builderApiBids] = await Promise.all([
|
|
1034
|
+
Promise.race([builderApiBidsPromise, sleep(cutoffMs).then(() => null)]),
|
|
1035
|
+
bidDeadlinePromise,
|
|
1036
|
+
]);
|
|
1033
1037
|
let parentExecutionRequestsPromise: Promise<gloas.ExecutionRequests> | null = null;
|
|
1034
1038
|
|
|
1039
|
+
let p2pBid: PooledExecutionPayloadBid | null = circuitBreakerActive
|
|
1040
|
+
? null
|
|
1041
|
+
: chain.executionPayloadBidPool.getBestBid(slot, bidParentBlockHash, parentBlockRootHex);
|
|
1042
|
+
// Discard p2p bids below the proposer's configured floor on the total payment.
|
|
1043
|
+
// A p2p bid's total is just its value since gossip validation enforces executionPayment=0.
|
|
1044
|
+
if (p2pBid !== null && BigInt(p2pBid.signedBid.message.value) < builderConfig.minBid) {
|
|
1045
|
+
logger.info("Best p2p bid below configured minimum", {
|
|
1046
|
+
slot,
|
|
1047
|
+
bidValue: prettyGweiToEth(p2pBid.signedBid.message.value),
|
|
1048
|
+
minBid: prettyGweiToEth(builderConfig.minBid),
|
|
1049
|
+
});
|
|
1050
|
+
p2pBid = null;
|
|
1051
|
+
}
|
|
1052
|
+
if (builderApiBids === null) {
|
|
1053
|
+
builderApiBids = p2pBid !== null ? [] : await builderApiBidsPromise;
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1035
1056
|
const candidates = (
|
|
1036
1057
|
await Promise.all(
|
|
1037
1058
|
builderApiBids.map(async ({url, entry, signedBid, receivedMs}): Promise<BidCandidate | null> => {
|
|
@@ -1118,13 +1139,6 @@ export function getValidatorApi(
|
|
|
1118
1139
|
return fn().finally(() => t?.({source}));
|
|
1119
1140
|
};
|
|
1120
1141
|
|
|
1121
|
-
// Calculate cutoff time based on start of the slot, ensures a slow local payload build does
|
|
1122
|
-
// not delay the proposal when a builder bid block is available (and vice versa)
|
|
1123
|
-
const cutoffMs = Math.max(
|
|
1124
|
-
0,
|
|
1125
|
-
config.getSlotComponentDurationMs(fork, BLOCK_PRODUCTION_RACE_CUTOFF_BPS) - chain.clock.msFromSlot(slot)
|
|
1126
|
-
);
|
|
1127
|
-
|
|
1128
1142
|
// use abort controller to stop waiting for the bid block if the engine block will be selected
|
|
1129
1143
|
const controller = new AbortController();
|
|
1130
1144
|
|
|
@@ -1756,7 +1770,10 @@ export function getValidatorApi(
|
|
|
1756
1770
|
}
|
|
1757
1771
|
}
|
|
1758
1772
|
|
|
1759
|
-
|
|
1773
|
+
// The fork epoch PTC is computed at the fork from effective balances updated at the end of the
|
|
1774
|
+
// last pre-fork epoch, so its dependent root is one epoch later than for other epochs
|
|
1775
|
+
const dependentRootEpoch = epoch === config.GLOAS_FORK_EPOCH ? epoch + 1 : epoch;
|
|
1776
|
+
const dependentRoot = fromHex(state.getShufflingDecisionRoot(dependentRootEpoch));
|
|
1760
1777
|
|
|
1761
1778
|
return {
|
|
1762
1779
|
data: duties,
|
package/src/api/options.ts
CHANGED
|
@@ -2,6 +2,8 @@ import {BeaconRestApiServerOpts, beaconRestApiServerOpts} from "./rest/index.js"
|
|
|
2
2
|
|
|
3
3
|
export type ApiOptions = {
|
|
4
4
|
maxGindicesInProof?: number;
|
|
5
|
+
/** Broadcast execution payload bids submitted via the API without running gossip validation */
|
|
6
|
+
disableBidValidation?: boolean;
|
|
5
7
|
rest: BeaconRestApiServerOpts;
|
|
6
8
|
commit?: string;
|
|
7
9
|
version?: string;
|
|
@@ -10,6 +12,7 @@ export type ApiOptions = {
|
|
|
10
12
|
|
|
11
13
|
export const defaultApiOptions: ApiOptions = {
|
|
12
14
|
maxGindicesInProof: 512,
|
|
15
|
+
disableBidValidation: false,
|
|
13
16
|
rest: beaconRestApiServerOpts,
|
|
14
17
|
version: "dev",
|
|
15
18
|
private: false,
|