@lodestar/beacon-node 1.50.0-dev.fef46df5ba → 1.50.0-rc.0
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 +6 -1
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/index.js +13 -0
- package/lib/api/impl/beacon/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +4 -4
- package/lib/api/impl/beacon/pool/index.js.map +1 -1
- package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/index.js +28 -6
- package/lib/api/impl/beacon/state/index.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +26 -18
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts +1 -0
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +49 -1
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/archiveStore/archiveStore.d.ts +5 -0
- package/lib/chain/archiveStore/archiveStore.d.ts.map +1 -1
- package/lib/chain/archiveStore/archiveStore.js +14 -24
- package/lib/chain/archiveStore/archiveStore.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +5 -7
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js +1 -1
- package/lib/chain/archiveStore/historicalState/historicalStateRegen.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/types.d.ts +2 -2
- package/lib/chain/archiveStore/historicalState/types.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js +1 -1
- package/lib/chain/archiveStore/historicalState/worker.js.map +1 -1
- package/lib/chain/archiveStore/interface.d.ts +1 -1
- package/lib/chain/archiveStore/interface.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +2 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/beaconProposerCache.d.ts +6 -0
- package/lib/chain/beaconProposerCache.d.ts.map +1 -1
- package/lib/chain/beaconProposerCache.js +16 -0
- package/lib/chain/beaconProposerCache.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +18 -8
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
- package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +7 -7
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts +2 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js +5 -4
- package/lib/chain/blocks/verifyBlocksStateTransitionOnly.js.map +1 -1
- package/lib/chain/chain.d.ts +10 -5
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +105 -36
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/emitter.d.ts +7 -1
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +5 -0
- package/lib/chain/emitter.js.map +1 -1
- package/lib/chain/errors/envelopeReconstructionError.d.ts +5 -0
- package/lib/chain/errors/envelopeReconstructionError.d.ts.map +1 -1
- package/lib/chain/errors/envelopeReconstructionError.js +2 -0
- package/lib/chain/errors/envelopeReconstructionError.js.map +1 -1
- package/lib/chain/errors/gossipValidation.d.ts +3 -1
- package/lib/chain/errors/gossipValidation.d.ts.map +1 -1
- package/lib/chain/errors/gossipValidation.js +2 -0
- package/lib/chain/errors/gossipValidation.js.map +1 -1
- package/lib/chain/forkChoice/index.d.ts.map +1 -1
- package/lib/chain/forkChoice/index.js +2 -0
- package/lib/chain/forkChoice/index.js.map +1 -1
- package/lib/chain/interface.d.ts +5 -2
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts +4 -2
- package/lib/chain/opPools/aggregatedAttestationPool.d.ts.map +1 -1
- package/lib/chain/opPools/aggregatedAttestationPool.js +30 -8
- package/lib/chain/opPools/aggregatedAttestationPool.js.map +1 -1
- package/lib/chain/opPools/opPool.d.ts +5 -4
- package/lib/chain/opPools/opPool.d.ts.map +1 -1
- package/lib/chain/opPools/opPool.js +60 -38
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.d.ts +8 -4
- package/lib/chain/opPools/proposerPreferencesPool.d.ts.map +1 -1
- package/lib/chain/opPools/proposerPreferencesPool.js +27 -12
- package/lib/chain/opPools/proposerPreferencesPool.js.map +1 -1
- package/lib/chain/opPools/utils.d.ts +15 -1
- package/lib/chain/opPools/utils.d.ts.map +1 -1
- package/lib/chain/opPools/utils.js +33 -1
- package/lib/chain/opPools/utils.js.map +1 -1
- package/lib/chain/options.d.ts +2 -1
- package/lib/chain/options.d.ts.map +1 -1
- package/lib/chain/options.js +1 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +16 -5
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +11 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +46 -30
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/regen/regen.d.ts +2 -0
- package/lib/chain/regen/regen.d.ts.map +1 -1
- package/lib/chain/regen/regen.js +10 -4
- package/lib/chain/regen/regen.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +7 -0
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +21 -0
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +9 -2
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +23 -13
- package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +18 -8
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +72 -18
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/validation/attesterSlashing.d.ts +4 -4
- package/lib/chain/validation/attesterSlashing.d.ts.map +1 -1
- package/lib/chain/validation/attesterSlashing.js +3 -0
- package/lib/chain/validation/attesterSlashing.js.map +1 -1
- package/lib/chain/validation/proposerSlashing.d.ts +3 -3
- package/lib/chain/validation/proposerSlashing.d.ts.map +1 -1
- package/lib/chain/validation/proposerSlashing.js +3 -0
- package/lib/chain/validation/proposerSlashing.js.map +1 -1
- package/lib/chain/validatorMonitor.d.ts +5 -1
- package/lib/chain/validatorMonitor.d.ts.map +1 -1
- package/lib/chain/validatorMonitor.js +64 -54
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/db/beacon.d.ts +4 -1
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +6 -1
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/buckets.d.ts +3 -1
- package/lib/db/buckets.d.ts.map +1 -1
- package/lib/db/buckets.js +2 -0
- package/lib/db/buckets.js.map +1 -1
- package/lib/db/interface.d.ts +4 -1
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/blockArchiveIndex.d.ts +2 -2
- package/lib/db/repositories/blockArchiveIndex.d.ts.map +1 -1
- package/lib/db/repositories/earliestAvailableSlot.d.ts +11 -0
- package/lib/db/repositories/earliestAvailableSlot.d.ts.map +1 -0
- package/lib/db/repositories/earliestAvailableSlot.js +19 -0
- package/lib/db/repositories/earliestAvailableSlot.js.map +1 -0
- package/lib/db/repositories/index.d.ts +1 -0
- package/lib/db/repositories/index.d.ts.map +1 -1
- package/lib/db/repositories/index.js +1 -0
- package/lib/db/repositories/index.js.map +1 -1
- package/lib/db/repositories/proposerPreferences.d.ts +14 -0
- package/lib/db/repositories/proposerPreferences.d.ts.map +1 -0
- package/lib/db/repositories/proposerPreferences.js +21 -0
- package/lib/db/repositories/proposerPreferences.js.map +1 -0
- package/lib/db/repositories/proposerSlashing.d.ts +1 -0
- package/lib/db/repositories/proposerSlashing.d.ts.map +1 -1
- package/lib/db/repositories/proposerSlashing.js +5 -1
- package/lib/db/repositories/proposerSlashing.js.map +1 -1
- package/lib/execution/engine/blobVersionedHashes.d.ts +9 -0
- package/lib/execution/engine/blobVersionedHashes.d.ts.map +1 -0
- package/lib/execution/engine/blobVersionedHashes.js +74 -0
- package/lib/execution/engine/blobVersionedHashes.js.map +1 -0
- package/lib/execution/engine/disabled.d.ts +0 -2
- package/lib/execution/engine/disabled.d.ts.map +1 -1
- package/lib/execution/engine/disabled.js +0 -6
- package/lib/execution/engine/disabled.js.map +1 -1
- package/lib/execution/engine/http.d.ts +46 -16
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +236 -213
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/index.d.ts +3 -2
- package/lib/execution/engine/index.d.ts.map +1 -1
- package/lib/execution/engine/index.js +33 -8
- package/lib/execution/engine/index.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +2 -4
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +25 -0
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -0
- package/lib/execution/engine/jsonRpcTransport.js +158 -0
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -0
- package/lib/execution/engine/mock.d.ts +0 -2
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +0 -8
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/restHttpClient.d.ts +71 -0
- package/lib/execution/engine/restHttpClient.d.ts.map +1 -0
- package/lib/execution/engine/restHttpClient.js +201 -0
- package/lib/execution/engine/restHttpClient.js.map +1 -0
- package/lib/execution/engine/restTransport.d.ts +46 -0
- package/lib/execution/engine/restTransport.d.ts.map +1 -0
- package/lib/execution/engine/restTransport.js +399 -0
- package/lib/execution/engine/restTransport.js.map +1 -0
- package/lib/execution/engine/sszTypes.d.ts +1261 -0
- package/lib/execution/engine/sszTypes.d.ts.map +1 -0
- package/lib/execution/engine/sszTypes.js +216 -0
- package/lib/execution/engine/sszTypes.js.map +1 -0
- package/lib/execution/engine/transport.d.ts +39 -0
- package/lib/execution/engine/transport.d.ts.map +1 -0
- package/lib/execution/engine/transport.js +2 -0
- package/lib/execution/engine/transport.js.map +1 -0
- package/lib/execution/engine/types.d.ts +2 -8
- package/lib/execution/engine/types.d.ts.map +1 -1
- package/lib/execution/engine/types.js +24 -57
- 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 +9 -2
- package/lib/execution/engine/utils.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +10 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +22 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/metrics/metrics.d.ts +7 -3
- package/lib/metrics/metrics.d.ts.map +1 -1
- package/lib/metrics/metrics.js +4 -4
- package/lib/metrics/metrics.js.map +1 -1
- package/lib/network/core/events.d.ts +5 -1
- package/lib/network/core/events.d.ts.map +1 -1
- package/lib/network/core/events.js +8 -0
- package/lib/network/core/events.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +67 -68
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts +7 -3
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +7 -3
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/processor/index.d.ts +9 -0
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +77 -10
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +1 -1
- package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.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 +27 -4
- package/lib/node/nodejs.js.map +1 -1
- package/lib/node/options.d.ts +3 -2
- package/lib/node/options.d.ts.map +1 -1
- package/lib/node/options.js +2 -2
- package/lib/node/options.js.map +1 -1
- package/lib/sync/range/batch.d.ts +11 -5
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +21 -17
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +4 -4
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +12 -6
- 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 +75 -29
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +5 -2
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +49 -24
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +38 -14
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +84 -39
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/util/asyncIterableToEvents.d.ts +10 -2
- package/lib/util/asyncIterableToEvents.d.ts.map +1 -1
- package/lib/util/asyncIterableToEvents.js +29 -3
- package/lib/util/asyncIterableToEvents.js.map +1 -1
- package/lib/util/execution.d.ts +9 -11
- package/lib/util/execution.d.ts.map +1 -1
- package/lib/util/execution.js +5 -1
- package/lib/util/execution.js.map +1 -1
- package/lib/util/metadata.d.ts.map +1 -1
- package/lib/util/metadata.js +2 -1
- package/lib/util/metadata.js.map +1 -1
- package/package.json +18 -17
- package/src/api/impl/beacon/blocks/index.ts +7 -4
- package/src/api/impl/beacon/index.ts +15 -0
- package/src/api/impl/beacon/pool/index.ts +4 -4
- package/src/api/impl/beacon/state/index.ts +43 -6
- package/src/api/impl/debug/index.ts +28 -19
- package/src/api/impl/validator/index.ts +61 -2
- package/src/chain/archiveStore/archiveStore.ts +19 -25
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +5 -7
- package/src/chain/archiveStore/historicalState/historicalStateRegen.ts +1 -1
- package/src/chain/archiveStore/historicalState/types.ts +2 -2
- package/src/chain/archiveStore/historicalState/worker.ts +1 -2
- package/src/chain/archiveStore/interface.ts +1 -1
- package/src/chain/archiveStore/utils/pruneHistory.ts +4 -1
- package/src/chain/beaconProposerCache.ts +19 -1
- package/src/chain/blocks/importBlock.ts +21 -7
- package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
- package/src/chain/blocks/verifyBlock.ts +8 -6
- package/src/chain/blocks/verifyBlocksStateTransitionOnly.ts +6 -3
- package/src/chain/chain.ts +135 -38
- package/src/chain/emitter.ts +7 -1
- package/src/chain/errors/envelopeReconstructionError.ts +3 -0
- package/src/chain/errors/gossipValidation.ts +2 -0
- package/src/chain/forkChoice/index.ts +2 -0
- package/src/chain/interface.ts +5 -2
- package/src/chain/opPools/aggregatedAttestationPool.ts +34 -10
- package/src/chain/opPools/opPool.ts +89 -46
- package/src/chain/opPools/proposerPreferencesPool.ts +34 -11
- package/src/chain/opPools/utils.ts +62 -3
- package/src/chain/options.ts +3 -3
- package/src/chain/prepareNextSlot.ts +21 -6
- package/src/chain/produceBlock/computeNewStateRoot.ts +1 -1
- package/src/chain/produceBlock/produceBlockBody.ts +76 -35
- package/src/chain/regen/regen.ts +12 -4
- package/src/chain/seenCache/seenGossipBlockInput.ts +23 -0
- package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +31 -13
- package/src/chain/shufflingCache.ts +84 -22
- package/src/chain/validation/attesterSlashing.ts +7 -4
- package/src/chain/validation/proposerSlashing.ts +7 -4
- package/src/chain/validatorMonitor.ts +75 -57
- package/src/db/beacon.ts +6 -0
- package/src/db/buckets.ts +2 -0
- package/src/db/interface.ts +4 -0
- package/src/db/repositories/earliestAvailableSlot.ts +19 -0
- package/src/db/repositories/index.ts +1 -0
- package/src/db/repositories/proposerPreferences.ts +23 -0
- package/src/db/repositories/proposerSlashing.ts +6 -1
- package/src/execution/engine/blobVersionedHashes.ts +72 -0
- package/src/execution/engine/disabled.ts +0 -8
- package/src/execution/engine/http.ts +304 -300
- package/src/execution/engine/index.ts +41 -7
- package/src/execution/engine/interface.ts +2 -6
- package/src/execution/engine/jsonRpcTransport.ts +247 -0
- package/src/execution/engine/mock.ts +1 -19
- package/src/execution/engine/restHttpClient.ts +269 -0
- package/src/execution/engine/restTransport.ts +544 -0
- package/src/execution/engine/sszTypes.ts +354 -0
- package/src/execution/engine/transport.ts +61 -0
- package/src/execution/engine/types.ts +34 -84
- package/src/execution/engine/utils.ts +12 -2
- package/src/metrics/metrics/lodestar.ts +23 -0
- package/src/metrics/metrics.ts +21 -6
- package/src/network/core/events.ts +16 -1
- package/src/network/processor/gossipHandlers.ts +98 -81
- package/src/network/processor/gossipValidatorFn.ts +13 -3
- package/src/network/processor/index.ts +89 -10
- package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +1 -1
- package/src/node/nodejs.ts +35 -3
- package/src/node/options.ts +10 -1
- package/src/sync/range/batch.ts +25 -19
- package/src/sync/range/chain.ts +15 -8
- package/src/sync/range/range.ts +76 -30
- package/src/sync/unknownBlock.ts +62 -25
- package/src/sync/utils/downloadByRange.ts +123 -58
- package/src/util/asyncIterableToEvents.ts +44 -5
- package/src/util/execution.ts +16 -8
- package/src/util/metadata.ts +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/util/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEhE,wBAAgB,wBAAwB,CAAC,IAAI,CAAC,EAAE;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../../src/util/metadata.ts"],"names":[],"mappings":"AACA,OAAO,EAAa,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAEhE,wBAAgB,wBAAwB,CAAC,IAAI,CAAC,EAAE;IAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAC,GAAG,aAAa,CAQlG;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAEpD;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAE3D"}
|
package/lib/util/metadata.js
CHANGED
|
@@ -5,7 +5,8 @@ export function getLodestarClientVersion(info) {
|
|
|
5
5
|
code: ClientCode.LS,
|
|
6
6
|
name: "Lodestar",
|
|
7
7
|
version: info?.version ?? "",
|
|
8
|
-
commit
|
|
8
|
+
// engine_getClientVersionV1 defines commit as 4 bytes, so builds without git data must not send an empty one
|
|
9
|
+
commit: info?.commit ? info.commit.slice(0, 8) : "00000000",
|
|
9
10
|
};
|
|
10
11
|
}
|
|
11
12
|
/**
|
package/lib/util/metadata.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/util/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAC,UAAU,EAAgB,MAAM,uBAAuB,CAAC;AAEhE,MAAM,UAAU,wBAAwB,CAAC,IAA0C;IACjF,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,EAAE;QACnB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,EAAE;QAC5B,MAAM,EAAE,IAAI,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"metadata.js","sourceRoot":"","sources":["../../src/util/metadata.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAC,UAAU,EAAgB,MAAM,uBAAuB,CAAC;AAEhE,MAAM,UAAU,wBAAwB,CAAC,IAA0C;IACjF,OAAO;QACL,IAAI,EAAE,UAAU,CAAC,EAAE;QACnB,IAAI,EAAE,UAAU;QAChB,OAAO,EAAE,IAAI,EAAE,OAAO,IAAI,EAAE;QAC5B,6GAA6G;QAC7G,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU;KAC5D,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,UAAU,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,QAAoB;IACjD,OAAO,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AACpC,CAAC"}
|
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.50.0-
|
|
14
|
+
"version": "1.50.0-rc.0",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -104,12 +104,12 @@
|
|
|
104
104
|
"@chainsafe/discv5": "^12.0.2",
|
|
105
105
|
"@chainsafe/enr": "^6.0.2",
|
|
106
106
|
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
107
|
-
"@chainsafe/libp2p-quic": "^2.1.
|
|
107
|
+
"@chainsafe/libp2p-quic": "^2.1.5",
|
|
108
108
|
"@chainsafe/lodestar-z": "catalog:",
|
|
109
109
|
"@chainsafe/persistent-merkle-tree": "^1.3.1",
|
|
110
110
|
"@chainsafe/prometheus-gc-stats": "^1.0.0",
|
|
111
111
|
"@chainsafe/snappy-wasm": "^0.5.2",
|
|
112
|
-
"@chainsafe/ssz": "^1.8.
|
|
112
|
+
"@chainsafe/ssz": "^1.8.1",
|
|
113
113
|
"@chainsafe/threads": "^1.11.3",
|
|
114
114
|
"@crate-crypto/node-eth-kzg": "0.9.1",
|
|
115
115
|
"@fastify/bearer-auth": "^10.0.1",
|
|
@@ -127,17 +127,17 @@
|
|
|
127
127
|
"@libp2p/prometheus-metrics": "^5.0.28",
|
|
128
128
|
"@libp2p/tcp": "^11.0.27",
|
|
129
129
|
"@libp2p/utils": "^7.4.0",
|
|
130
|
-
"@lodestar/api": "^1.50.0-
|
|
131
|
-
"@lodestar/config": "^1.50.0-
|
|
132
|
-
"@lodestar/db": "^1.50.0-
|
|
133
|
-
"@lodestar/fork-choice": "^1.50.0-
|
|
134
|
-
"@lodestar/logger": "^1.50.0-
|
|
135
|
-
"@lodestar/params": "^1.50.0-
|
|
136
|
-
"@lodestar/reqresp": "^1.50.0-
|
|
137
|
-
"@lodestar/state-transition": "^1.50.0-
|
|
138
|
-
"@lodestar/types": "^1.50.0-
|
|
139
|
-
"@lodestar/utils": "^1.50.0-
|
|
140
|
-
"@lodestar/validator": "^1.50.0-
|
|
130
|
+
"@lodestar/api": "^1.50.0-rc.0",
|
|
131
|
+
"@lodestar/config": "^1.50.0-rc.0",
|
|
132
|
+
"@lodestar/db": "^1.50.0-rc.0",
|
|
133
|
+
"@lodestar/fork-choice": "^1.50.0-rc.0",
|
|
134
|
+
"@lodestar/logger": "^1.50.0-rc.0",
|
|
135
|
+
"@lodestar/params": "^1.50.0-rc.0",
|
|
136
|
+
"@lodestar/reqresp": "^1.50.0-rc.0",
|
|
137
|
+
"@lodestar/state-transition": "^1.50.0-rc.0",
|
|
138
|
+
"@lodestar/types": "^1.50.0-rc.0",
|
|
139
|
+
"@lodestar/utils": "^1.50.0-rc.0",
|
|
140
|
+
"@lodestar/validator": "^1.50.0-rc.0",
|
|
141
141
|
"@multiformats/multiaddr": "^13.0.1",
|
|
142
142
|
"datastore-core": "^12.0.1",
|
|
143
143
|
"datastore-level": "^13.0.1",
|
|
@@ -156,10 +156,11 @@
|
|
|
156
156
|
"xxhash-wasm": "1.0.2"
|
|
157
157
|
},
|
|
158
158
|
"devDependencies": {
|
|
159
|
+
"@ethereumjs/rlp": "^4.0.1",
|
|
159
160
|
"@libp2p/interface-internal": "^3.1.12",
|
|
160
161
|
"@libp2p/logger": "^6.2.13",
|
|
161
|
-
"@lodestar/spec-test-util": "^1.50.0-
|
|
162
|
-
"@lodestar/test-utils": "^1.50.0-
|
|
162
|
+
"@lodestar/spec-test-util": "^1.50.0-rc.0",
|
|
163
|
+
"@lodestar/test-utils": "^1.50.0-rc.0",
|
|
163
164
|
"@types/js-yaml": "^4.0.5",
|
|
164
165
|
"@types/qs": "^6.9.7",
|
|
165
166
|
"@types/tmp": "^0.2.3",
|
|
@@ -174,5 +175,5 @@
|
|
|
174
175
|
"beacon",
|
|
175
176
|
"blockchain"
|
|
176
177
|
],
|
|
177
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "e6451d61295de46ca524b2553576e774178d9c7b"
|
|
178
179
|
}
|
|
@@ -1118,10 +1118,13 @@ export function getBeaconBlockApi({
|
|
|
1118
1118
|
: await chain.getExecutionPayloadEnvelope(slot, blockRootHex);
|
|
1119
1119
|
} catch (e) {
|
|
1120
1120
|
if (e instanceof EnvelopeReconstructionError) {
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1121
|
+
// The envelope is archived but our EL cannot serve it right now (EL down, or it does not
|
|
1122
|
+
// have the body / block access list): 503 so clients retry or ask another node, rather than
|
|
1123
|
+
// 500 for what is not a beacon node fault. A body root mismatch is a local inconsistency.
|
|
1124
|
+
const unavailable =
|
|
1125
|
+
e.type.code === EnvelopeReconstructionErrorCode.ENGINE_UNAVAILABLE ||
|
|
1126
|
+
e.type.code === EnvelopeReconstructionErrorCode.BODY_UNAVAILABLE;
|
|
1127
|
+
throw new ApiError(unavailable ? 503 : 500, `Failed to reconstruct execution payload envelope: ${e.message}`);
|
|
1125
1128
|
}
|
|
1126
1129
|
throw e;
|
|
1127
1130
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
3
|
+
import {isForkPostGloas} from "@lodestar/params";
|
|
4
|
+
import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
5
|
+
import {toRootHex} from "@lodestar/utils";
|
|
6
|
+
import {ApiError} from "../errors.js";
|
|
3
7
|
import {ApiModules} from "../types.js";
|
|
4
8
|
import {getBeaconBlockApi} from "./blocks/index.js";
|
|
5
9
|
import {getBeaconPoolApi} from "./pool/index.js";
|
|
@@ -31,5 +35,16 @@ export function getBeaconApi(
|
|
|
31
35
|
},
|
|
32
36
|
};
|
|
33
37
|
},
|
|
38
|
+
|
|
39
|
+
async getProposerPreferences({slot, dependentRoot}) {
|
|
40
|
+
// Preferences are broadcast up to one epoch ahead of their proposal slot, the first ones before Gloas is active
|
|
41
|
+
const fork = config.getForkName(slot ?? computeStartSlotAtEpoch(chain.clock.currentEpoch + 1));
|
|
42
|
+
if (!isForkPostGloas(fork)) {
|
|
43
|
+
throw new ApiError(400, `Proposer preferences are not supported before Gloas fork=${fork}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const preferences = chain.proposerPreferencesPool.getAll(slot, dependentRoot && toRootHex(dependentRoot));
|
|
47
|
+
return {data: preferences, meta: {version: fork}};
|
|
48
|
+
},
|
|
34
49
|
};
|
|
35
50
|
}
|
|
@@ -170,15 +170,15 @@ export function getBeaconPoolApi({
|
|
|
170
170
|
},
|
|
171
171
|
|
|
172
172
|
async submitPoolAttesterSlashingsV2({attesterSlashing}) {
|
|
173
|
-
await validateApiAttesterSlashing(chain, attesterSlashing);
|
|
173
|
+
const verifiedDomains = await validateApiAttesterSlashing(chain, attesterSlashing);
|
|
174
174
|
const fork = chain.config.getForkName(Number(attesterSlashing.attestation1.data.slot));
|
|
175
|
-
chain.opPool.insertAttesterSlashing(fork, attesterSlashing);
|
|
175
|
+
chain.opPool.insertAttesterSlashing(fork, attesterSlashing, verifiedDomains);
|
|
176
176
|
await network.publishAttesterSlashing(attesterSlashing);
|
|
177
177
|
},
|
|
178
178
|
|
|
179
179
|
async submitPoolProposerSlashings({proposerSlashing}) {
|
|
180
|
-
await validateApiProposerSlashing(chain, proposerSlashing);
|
|
181
|
-
chain.opPool.insertProposerSlashing(proposerSlashing);
|
|
180
|
+
const verifiedDomain = await validateApiProposerSlashing(chain, proposerSlashing);
|
|
181
|
+
chain.opPool.insertProposerSlashing(proposerSlashing, verifiedDomain);
|
|
182
182
|
await network.publishProposerSlashing(proposerSlashing);
|
|
183
183
|
},
|
|
184
184
|
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
EPOCHS_PER_HISTORICAL_VECTOR,
|
|
5
|
+
MIN_SEED_LOOKAHEAD,
|
|
6
|
+
SLOTS_PER_EPOCH,
|
|
7
|
+
SYNC_COMMITTEE_SUBNET_SIZE,
|
|
8
|
+
} from "@lodestar/params";
|
|
4
9
|
import {
|
|
5
10
|
IBeaconStateView,
|
|
6
11
|
computeEpochAtSlot,
|
|
@@ -11,7 +16,14 @@ import {
|
|
|
11
16
|
isStatePostFulu,
|
|
12
17
|
isStatePostGloas,
|
|
13
18
|
} from "@lodestar/state-transition";
|
|
14
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
ValidatorIndex,
|
|
21
|
+
getBuilderStatus,
|
|
22
|
+
getValidatorStatus,
|
|
23
|
+
mapToGeneralStatus,
|
|
24
|
+
ssz,
|
|
25
|
+
sszTypesFor,
|
|
26
|
+
} from "@lodestar/types";
|
|
15
27
|
import {ApiError} from "../../errors.js";
|
|
16
28
|
import {ApiModules} from "../../types.js";
|
|
17
29
|
import {assertUniqueItems} from "../../utils.js";
|
|
@@ -100,7 +112,8 @@ export function getBeaconStateApi({
|
|
|
100
112
|
if (resp.valid) {
|
|
101
113
|
const validatorIndex = resp.validatorIndex;
|
|
102
114
|
const validator = state.getValidator(validatorIndex);
|
|
103
|
-
|
|
115
|
+
const status = getValidatorStatus(validator, currentEpoch);
|
|
116
|
+
if (statuses.length && !statuses.includes(status) && !statuses.includes(mapToGeneralStatus(status))) {
|
|
104
117
|
continue;
|
|
105
118
|
}
|
|
106
119
|
const validatorResponse = toValidatorResponse(
|
|
@@ -374,6 +387,28 @@ export function getBeaconStateApi({
|
|
|
374
387
|
};
|
|
375
388
|
},
|
|
376
389
|
|
|
390
|
+
async getStatePtc({stateId, slot}) {
|
|
391
|
+
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
392
|
+
if (!isStatePostGloas(state)) {
|
|
393
|
+
throw new ApiError(400, `Cannot retrieve PTC for pre-gloas state fork=${state.forkName}`);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
const usedSlot = slot ?? state.slot;
|
|
397
|
+
const epoch = computeEpochAtSlot(usedSlot);
|
|
398
|
+
const stateEpoch = computeEpochAtSlot(state.slot);
|
|
399
|
+
if (epoch < config.GLOAS_FORK_EPOCH) {
|
|
400
|
+
throw new ApiError(400, `Cannot retrieve PTC for pre-gloas slot=${usedSlot}`);
|
|
401
|
+
}
|
|
402
|
+
if (epoch < stateEpoch - 1 || epoch > stateEpoch + MIN_SEED_LOOKAHEAD) {
|
|
403
|
+
throw new ApiError(400, `Slot ${usedSlot} is outside the PTC window of state epoch ${stateEpoch}`);
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
return {
|
|
407
|
+
data: {slot: usedSlot, validators: Array.from(state.getPayloadTimelinessCommittee(usedSlot))},
|
|
408
|
+
meta: {executionOptimistic, finalized},
|
|
409
|
+
};
|
|
410
|
+
},
|
|
411
|
+
|
|
377
412
|
async getPendingDeposits({stateId}, context) {
|
|
378
413
|
const {state, executionOptimistic, finalized} = await getState(stateId);
|
|
379
414
|
const fork = state.forkName;
|
|
@@ -385,7 +420,9 @@ export function getBeaconStateApi({
|
|
|
385
420
|
const pendingDeposits = state.pendingDeposits;
|
|
386
421
|
|
|
387
422
|
return {
|
|
388
|
-
data: context?.returnBytes
|
|
423
|
+
data: context?.returnBytes
|
|
424
|
+
? sszTypesFor(state.forkName).PendingDeposits.serialize(pendingDeposits)
|
|
425
|
+
: pendingDeposits,
|
|
389
426
|
meta: {executionOptimistic, finalized, version: fork},
|
|
390
427
|
};
|
|
391
428
|
},
|
|
@@ -402,7 +439,7 @@ export function getBeaconStateApi({
|
|
|
402
439
|
|
|
403
440
|
return {
|
|
404
441
|
data: context?.returnBytes
|
|
405
|
-
?
|
|
442
|
+
? sszTypesFor(state.forkName).PendingPartialWithdrawals.serialize(pendingPartialWithdrawals)
|
|
406
443
|
: pendingPartialWithdrawals,
|
|
407
444
|
meta: {executionOptimistic, finalized, version: fork},
|
|
408
445
|
};
|
|
@@ -420,7 +457,7 @@ export function getBeaconStateApi({
|
|
|
420
457
|
|
|
421
458
|
return {
|
|
422
459
|
data: context?.returnBytes
|
|
423
|
-
?
|
|
460
|
+
? sszTypesFor(state.forkName).PendingConsolidations.serialize(pendingConsolidations)
|
|
424
461
|
: pendingConsolidations,
|
|
425
462
|
meta: {executionOptimistic, finalized, version: fork},
|
|
426
463
|
};
|
|
@@ -4,7 +4,7 @@ import {ExecutionStatus, PayloadStatus} from "@lodestar/fork-choice";
|
|
|
4
4
|
import {ForkPostDeneb, ZERO_HASH_HEX, isForkPostDeneb, isForkPostFulu} from "@lodestar/params";
|
|
5
5
|
import {computeTimeAtSlot} from "@lodestar/state-transition";
|
|
6
6
|
import {BeaconState, DataColumnSidecar, DataColumnSidecars, type SignedBeaconBlock, sszTypesFor} from "@lodestar/types";
|
|
7
|
-
import {toRootHex} from "@lodestar/utils";
|
|
7
|
+
import {fromHex, toRootHex} from "@lodestar/utils";
|
|
8
8
|
import {getBlobKzgCommitments} from "../../../util/dataColumns.js";
|
|
9
9
|
import {isOptimisticBlock} from "../../../util/forkChoice.js";
|
|
10
10
|
import {getStateSlotFromBytes} from "../../../util/multifork.js";
|
|
@@ -74,46 +74,55 @@ export function getDebugApi({
|
|
|
74
74
|
|
|
75
75
|
async getDebugForkChoiceV2() {
|
|
76
76
|
const {forkChoice} = chain;
|
|
77
|
+
const nodes = forkChoice.getAllNodes();
|
|
78
|
+
const head = forkChoice.getHead();
|
|
77
79
|
return {
|
|
78
80
|
data: {
|
|
79
81
|
justifiedCheckpoint: forkChoice.getJustifiedCheckpoint(),
|
|
80
82
|
finalizedCheckpoint: forkChoice.getFinalizedCheckpoint(),
|
|
81
|
-
forkChoiceNodes:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const ptc = node.payloadStatus === PayloadStatus.FULL ? forkChoice.getPTCVoteCounts(node.blockRoot) : null;
|
|
83
|
+
forkChoiceNodes: nodes.map((node) => {
|
|
84
|
+
const parent = node.parent === undefined ? undefined : nodes[node.parent];
|
|
85
|
+
const ptc = forkChoice.getPTCVoteCounts(node.blockRoot);
|
|
85
86
|
return {
|
|
86
|
-
payloadStatus: toPayloadStatusName(node.payloadStatus),
|
|
87
87
|
slot: node.slot,
|
|
88
88
|
blockRoot: node.blockRoot,
|
|
89
|
-
|
|
89
|
+
payloadStatus: toPayloadStatusName(node.payloadStatus),
|
|
90
|
+
parentRoot:
|
|
91
|
+
node.parentBlockHash !== null && node.payloadStatus !== PayloadStatus.PENDING
|
|
92
|
+
? node.blockRoot
|
|
93
|
+
: node.parentRoot,
|
|
94
|
+
parentPayloadStatus: parent === undefined ? null : toPayloadStatusName(parent.payloadStatus),
|
|
95
|
+
justifiedCheckpoint: {epoch: node.justifiedEpoch, root: fromHex(node.justifiedRoot)},
|
|
96
|
+
finalizedCheckpoint: {epoch: node.finalizedEpoch, root: fromHex(node.finalizedRoot)},
|
|
90
97
|
weight: node.weight,
|
|
91
98
|
validity: toForkChoiceValidity(node.executionStatus),
|
|
92
99
|
executionBlockHash: node.executionPayloadBlockHash ?? ZERO_HASH_HEX,
|
|
100
|
+
payloadAttesterCount: ptc?.attesterCount ?? 0,
|
|
101
|
+
payloadAvailabilityYesCount: ptc?.payloadPresentCount ?? 0,
|
|
102
|
+
payloadDataAvailabilityYesCount: ptc?.dataAvailableCount ?? 0,
|
|
93
103
|
extraData: {
|
|
104
|
+
attestationScore: node.attestationScore,
|
|
94
105
|
executionOptimistic: isOptimisticBlock(node),
|
|
106
|
+
gasLimit:
|
|
107
|
+
node.payloadStatus === PayloadStatus.FULL && node.executionStatus !== ExecutionStatus.PreMerge
|
|
108
|
+
? node.executionPayloadGasLimit
|
|
109
|
+
: null,
|
|
95
110
|
timestamp: computeTimeAtSlot(config, node.slot, chain.genesisTime),
|
|
111
|
+
stateRoot: node.stateRoot,
|
|
96
112
|
target: node.targetRoot,
|
|
97
|
-
justifiedEpoch: node.justifiedEpoch,
|
|
98
|
-
finalizedEpoch: node.finalizedEpoch,
|
|
99
113
|
unrealizedJustifiedEpoch: node.unrealizedJustifiedEpoch,
|
|
114
|
+
unrealizedJustifiedRoot: node.unrealizedJustifiedRoot,
|
|
100
115
|
unrealizedFinalizedEpoch: node.unrealizedFinalizedEpoch,
|
|
101
|
-
|
|
102
|
-
payloadAvailabilityYesCount: ptc?.payloadPresentCount ?? null,
|
|
103
|
-
payloadDataAvailabilityYesCount: ptc?.dataAvailableCount ?? null,
|
|
104
|
-
gasLimit:
|
|
105
|
-
node.payloadStatus === PayloadStatus.FULL && "executionPayloadGasLimit" in node
|
|
106
|
-
? node.executionPayloadGasLimit
|
|
107
|
-
: null,
|
|
116
|
+
unrealizedFinalizedRoot: node.unrealizedFinalizedRoot,
|
|
108
117
|
},
|
|
109
118
|
};
|
|
110
119
|
}),
|
|
111
120
|
extraData: {
|
|
112
|
-
|
|
113
|
-
unrealizedFinalizedCheckpoint: forkChoice.getUnrealizedFinalizedCheckpoint(),
|
|
121
|
+
head: {blockRoot: head.blockRoot, payloadStatus: toPayloadStatusName(head.payloadStatus)},
|
|
114
122
|
proposerBoostRoot: forkChoice.getProposerBoostRoot(),
|
|
115
123
|
previousProposerBoostRoot: forkChoice.getPreviousProposerBoostRoot(),
|
|
116
|
-
|
|
124
|
+
unrealizedJustifiedCheckpoint: forkChoice.getUnrealizedJustifiedCheckpoint(),
|
|
125
|
+
unrealizedFinalizedCheckpoint: forkChoice.getUnrealizedFinalizedCheckpoint(),
|
|
117
126
|
},
|
|
118
127
|
},
|
|
119
128
|
};
|
|
@@ -189,6 +189,7 @@ export enum EngineBlockSelectionReason {
|
|
|
189
189
|
BuilderTimeout = "builder_timeout",
|
|
190
190
|
BuilderPending = "builder_pending",
|
|
191
191
|
BuilderNoBid = "builder_no_bid",
|
|
192
|
+
BuilderCircuitBreaker = "builder_circuit_breaker",
|
|
192
193
|
BuilderCensorship = "builder_censorship",
|
|
193
194
|
BlockValue = "block_value",
|
|
194
195
|
EnginePreferred = "engine_preferred",
|
|
@@ -1160,8 +1161,21 @@ export function getValidatorApi(
|
|
|
1160
1161
|
: {}),
|
|
1161
1162
|
};
|
|
1162
1163
|
|
|
1163
|
-
|
|
1164
|
-
|
|
1164
|
+
if (circuitBreakerActive && engineResult.status === "fulfilled") {
|
|
1165
|
+
source = ProducedBlockSource.engine;
|
|
1166
|
+
bestResult = engineResult;
|
|
1167
|
+
metrics?.blockProductionSelectionResults.inc({
|
|
1168
|
+
source: ProducedBlockSource.engine,
|
|
1169
|
+
reason: EngineBlockSelectionReason.BuilderCircuitBreaker,
|
|
1170
|
+
});
|
|
1171
|
+
logger.info("Selected local block: builder circuit breaker is active", {
|
|
1172
|
+
reason: EngineBlockSelectionReason.BuilderCircuitBreaker,
|
|
1173
|
+
...logCtx,
|
|
1174
|
+
durationMs: engineResult.durationMs,
|
|
1175
|
+
...getBlockValueLogInfo(engineResult.value),
|
|
1176
|
+
});
|
|
1177
|
+
} else if (
|
|
1178
|
+
// handle shouldOverrideBuilder separately
|
|
1165
1179
|
engineResult.status === "fulfilled" &&
|
|
1166
1180
|
engineResult.value.shouldOverrideBuilder &&
|
|
1167
1181
|
(builderBidExpected || bidBlockResult.status === "fulfilled")
|
|
@@ -1286,6 +1300,10 @@ export function getValidatorApi(
|
|
|
1286
1300
|
blobs: blobsBundle.blobs,
|
|
1287
1301
|
};
|
|
1288
1302
|
|
|
1303
|
+
if (chain.opts.persistProducedPayloadEnvelopes) {
|
|
1304
|
+
chain.persistExecutionPayloadEnvelope(blockContents.executionPayloadEnvelope);
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1289
1307
|
return {
|
|
1290
1308
|
data: blockContents,
|
|
1291
1309
|
meta: {version: fork, consensusBlockValue, executionPayloadValue, executionPayloadIncluded: true},
|
|
@@ -1914,6 +1932,17 @@ export function getValidatorApi(
|
|
|
1914
1932
|
},
|
|
1915
1933
|
|
|
1916
1934
|
async prepareBeaconCommitteeSubnet({subscriptions}) {
|
|
1935
|
+
// The subscribing validators use this node for duties regardless of its sync state and
|
|
1936
|
+
// the subscription must not fail on the tracking, e.g. if the finalized state is unavailable
|
|
1937
|
+
try {
|
|
1938
|
+
await chain.updateAttachedValidators(
|
|
1939
|
+
chain.clock.currentEpoch,
|
|
1940
|
+
Array.from(new Set(subscriptions.map(({validatorIndex}) => validatorIndex)))
|
|
1941
|
+
);
|
|
1942
|
+
} catch (e) {
|
|
1943
|
+
logger.warn("Error tracking attached validators", {count: subscriptions.length}, e as Error);
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1917
1946
|
notWhileSyncing(chain, sync.state);
|
|
1918
1947
|
|
|
1919
1948
|
await network.prepareBeaconCommitteeSubnets(
|
|
@@ -1977,6 +2006,13 @@ export function getValidatorApi(
|
|
|
1977
2006
|
},
|
|
1978
2007
|
|
|
1979
2008
|
async prepareBeaconProposer({proposers}) {
|
|
2009
|
+
if (isForkPostGloas(config.getForkName(chain.clock.currentSlot))) {
|
|
2010
|
+
throw new ApiError(
|
|
2011
|
+
410,
|
|
2012
|
+
"prepareBeaconProposer is no longer supported from gloas, submit signed proposer preferences via POST /eth/v1/validator/proposer_preferences instead"
|
|
2013
|
+
);
|
|
2014
|
+
}
|
|
2015
|
+
|
|
1980
2016
|
await chain.updateBeaconProposerData(chain.clock.currentEpoch, proposers);
|
|
1981
2017
|
},
|
|
1982
2018
|
|
|
@@ -2011,6 +2047,13 @@ export function getValidatorApi(
|
|
|
2011
2047
|
},
|
|
2012
2048
|
|
|
2013
2049
|
async registerValidator({registrations}) {
|
|
2050
|
+
if (isForkPostGloas(config.getForkName(chain.clock.currentSlot))) {
|
|
2051
|
+
throw new ApiError(
|
|
2052
|
+
410,
|
|
2053
|
+
"registerValidator is no longer supported from gloas, submit builder preferences via POST /eth/v1/validator/builder_preferences instead"
|
|
2054
|
+
);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2014
2057
|
if (!chain.executionBuilder) {
|
|
2015
2058
|
throw Error("External builder not configured");
|
|
2016
2059
|
}
|
|
@@ -2046,11 +2089,14 @@ export function getValidatorApi(
|
|
|
2046
2089
|
|
|
2047
2090
|
async submitProposerPreferences({signedProposerPreferences}) {
|
|
2048
2091
|
const failures: FailureList = [];
|
|
2092
|
+
// Preferences submitted here are signed by validators using this node, gossiped ones are not
|
|
2093
|
+
const attachedValidatorIndices: ValidatorIndex[] = [];
|
|
2049
2094
|
|
|
2050
2095
|
await Promise.all(
|
|
2051
2096
|
signedProposerPreferences.map(async (signed, i) => {
|
|
2052
2097
|
try {
|
|
2053
2098
|
await validateGossipProposerPreferences(chain, signed);
|
|
2099
|
+
attachedValidatorIndices.push(signed.message.validatorIndex);
|
|
2054
2100
|
|
|
2055
2101
|
chain.proposerPreferencesPool.add(signed);
|
|
2056
2102
|
await network.publishProposerPreferences(signed);
|
|
@@ -2066,6 +2112,7 @@ export function getValidatorApi(
|
|
|
2066
2112
|
};
|
|
2067
2113
|
|
|
2068
2114
|
if (e instanceof ProposerPreferencesError && e.type.code === ProposerPreferencesErrorCode.ALREADY_KNOWN) {
|
|
2115
|
+
attachedValidatorIndices.push(signed.message.validatorIndex);
|
|
2069
2116
|
logger.debug("Ignoring known signed proposer preferences", logCtx);
|
|
2070
2117
|
return;
|
|
2071
2118
|
}
|
|
@@ -2079,6 +2126,14 @@ export function getValidatorApi(
|
|
|
2079
2126
|
})
|
|
2080
2127
|
);
|
|
2081
2128
|
|
|
2129
|
+
if (attachedValidatorIndices.length > 0) {
|
|
2130
|
+
try {
|
|
2131
|
+
await chain.updateAttachedValidators(chain.clock.currentEpoch, attachedValidatorIndices);
|
|
2132
|
+
} catch (e) {
|
|
2133
|
+
logger.warn("Error tracking attached validators", {count: attachedValidatorIndices.length}, e as Error);
|
|
2134
|
+
}
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2082
2137
|
if (failures.length > 0) {
|
|
2083
2138
|
throw new IndexedError("Error processing signed proposer preferences", failures);
|
|
2084
2139
|
}
|
|
@@ -2173,6 +2228,10 @@ export function getValidatorApi(
|
|
|
2173
2228
|
blockHash: toRootHex(executionPayload.blockHash),
|
|
2174
2229
|
});
|
|
2175
2230
|
|
|
2231
|
+
if (chain.opts.persistProducedPayloadEnvelopes) {
|
|
2232
|
+
chain.persistExecutionPayloadEnvelope(envelope);
|
|
2233
|
+
}
|
|
2234
|
+
|
|
2176
2235
|
return {
|
|
2177
2236
|
data: envelope,
|
|
2178
2237
|
meta: {
|
|
@@ -113,7 +113,9 @@ export class ArchiveStore {
|
|
|
113
113
|
this.logger,
|
|
114
114
|
this.metrics,
|
|
115
115
|
this.opts.anchorState.finalizedCheckpoint.epoch,
|
|
116
|
-
this.chain.clock.currentEpoch
|
|
116
|
+
this.chain.clock.currentEpoch,
|
|
117
|
+
this.statePruneFromSlot,
|
|
118
|
+
this.advanceEarliestAvailableSlot
|
|
117
119
|
),
|
|
118
120
|
() => this.logger.info("Still pruning historical data, please wait..."),
|
|
119
121
|
30_000,
|
|
@@ -122,33 +124,13 @@ export class ArchiveStore {
|
|
|
122
124
|
this.statePruneFromSlot = stateCutoffSlot;
|
|
123
125
|
}
|
|
124
126
|
|
|
125
|
-
// Initialize earliestAvailableSlot from the earliest block actually retained (after any pruning
|
|
126
|
-
// above), rather than the anchor state slot set in the constructor. On an in-place restart the DB
|
|
127
|
-
// still holds finalized history below the anchor; leaving the value at the anchor makes the node
|
|
128
|
-
// reject by_range requests (beacon_blocks, execution_payload_envelopes and data_column_sidecars
|
|
129
|
-
// all gate on this slot) for data it still retains. An empty archive (e.g. a fresh checkpoint
|
|
130
|
-
// sync with nothing below the anchor) leaves the constructor's anchor slot in place.
|
|
131
|
-
const earliestArchivedBlockSlot = await this.db.blockArchive.firstKey();
|
|
132
|
-
if (earliestArchivedBlockSlot != null) {
|
|
133
|
-
const oldEarliestAvailableSlot = this.chain.earliestAvailableSlot;
|
|
134
|
-
this.chain.earliestAvailableSlot = earliestArchivedBlockSlot;
|
|
135
|
-
this.logger.verbose("Initialized earliestAvailableSlot from retained block archive", {
|
|
136
|
-
oldEarliestAvailableSlot,
|
|
137
|
-
newEarliestAvailableSlot: earliestArchivedBlockSlot,
|
|
138
|
-
});
|
|
139
|
-
} else {
|
|
140
|
-
this.logger.verbose("Empty block archive on init, keeping anchor earliestAvailableSlot", {
|
|
141
|
-
earliestAvailableSlot: this.chain.earliestAvailableSlot,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
|
|
145
127
|
if (this.opts.serveHistoricalState) {
|
|
146
128
|
this.historicalStateRegen = await HistoricalStateRegen.init({
|
|
147
129
|
opts: {
|
|
148
130
|
genesisTime: this.chain.clock.genesisTime,
|
|
149
131
|
dbLocation: this.opts.dbName,
|
|
150
132
|
dataColumnDir: this.opts.dataColumnDir,
|
|
151
|
-
|
|
133
|
+
nativeStateTransition: this.opts.nativeStateTransition ?? false,
|
|
152
134
|
},
|
|
153
135
|
config: this.chain.config,
|
|
154
136
|
metrics: this.metrics,
|
|
@@ -158,6 +140,18 @@ export class ArchiveStore {
|
|
|
158
140
|
}
|
|
159
141
|
}
|
|
160
142
|
|
|
143
|
+
/**
|
|
144
|
+
* The CLI owns the initial value; this only advances it during pruneHistory.
|
|
145
|
+
* Persisted before any deletion so a crash mid-prune never leaves the floor below deleted data.
|
|
146
|
+
*/
|
|
147
|
+
private advanceEarliestAvailableSlot = async (blockCutoffSlot: Slot): Promise<void> => {
|
|
148
|
+
const earliestAvailableSlot = Math.max(this.chain.earliestAvailableSlot, blockCutoffSlot);
|
|
149
|
+
if (earliestAvailableSlot !== this.chain.earliestAvailableSlot) {
|
|
150
|
+
await this.db.earliestAvailableSlot.set(earliestAvailableSlot);
|
|
151
|
+
this.chain.earliestAvailableSlot = earliestAvailableSlot;
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
|
|
161
155
|
async close(): Promise<void> {
|
|
162
156
|
await this.historicalStateRegen?.close();
|
|
163
157
|
}
|
|
@@ -259,17 +253,17 @@ export class ArchiveStore {
|
|
|
259
253
|
|
|
260
254
|
if (this.opts.pruneHistory) {
|
|
261
255
|
timer = this.metrics?.processFinalizedCheckpoint.durationByTask.startTimer();
|
|
262
|
-
const {
|
|
256
|
+
const {stateCutoffSlot} = await pruneHistory(
|
|
263
257
|
this.chain.config,
|
|
264
258
|
this.db,
|
|
265
259
|
this.logger,
|
|
266
260
|
this.metrics,
|
|
267
261
|
finalizedEpoch,
|
|
268
262
|
this.chain.clock.currentEpoch,
|
|
269
|
-
this.statePruneFromSlot
|
|
263
|
+
this.statePruneFromSlot,
|
|
264
|
+
this.advanceEarliestAvailableSlot
|
|
270
265
|
);
|
|
271
266
|
this.statePruneFromSlot = stateCutoffSlot;
|
|
272
|
-
this.chain.earliestAvailableSlot = Math.max(this.chain.earliestAvailableSlot, blockCutoffSlot);
|
|
273
267
|
timer?.({source: ArchiveStoreTask.PruneHistory});
|
|
274
268
|
}
|
|
275
269
|
|
|
@@ -17,7 +17,7 @@ export async function getNearestState(
|
|
|
17
17
|
slot: number,
|
|
18
18
|
config: BeaconConfig,
|
|
19
19
|
db: IBeaconDb,
|
|
20
|
-
|
|
20
|
+
nativeStateTransition: boolean
|
|
21
21
|
): Promise<IBeaconStateView> {
|
|
22
22
|
const stateBytesArr = await db.stateArchive.binaries({limit: 1, lte: slot, reverse: true});
|
|
23
23
|
if (!stateBytesArr.length) {
|
|
@@ -25,9 +25,7 @@ export async function getNearestState(
|
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
const stateBytes = stateBytesArr[0];
|
|
28
|
-
return
|
|
29
|
-
? createBeaconStateViewForHistoricalRegen({useNative: true, stateBytes})
|
|
30
|
-
: createBeaconStateViewForHistoricalRegen({useNative: false, config, stateBytes});
|
|
28
|
+
return createBeaconStateViewForHistoricalRegen({nativeStateTransition: nativeStateTransition, config, stateBytes});
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
/**
|
|
@@ -37,13 +35,13 @@ export async function getHistoricalState(
|
|
|
37
35
|
slot: number,
|
|
38
36
|
config: BeaconConfig,
|
|
39
37
|
db: IBeaconDb,
|
|
40
|
-
|
|
38
|
+
nativeStateTransition: boolean,
|
|
41
39
|
metrics?: HistoricalStateRegenMetrics
|
|
42
40
|
): Promise<Uint8Array> {
|
|
43
41
|
const regenTimer = metrics?.regenTime.startTimer();
|
|
44
42
|
|
|
45
43
|
const loadStateTimer = metrics?.loadStateTime.startTimer();
|
|
46
|
-
let state = await getNearestState(slot, config, db,
|
|
44
|
+
let state = await getNearestState(slot, config, db, nativeStateTransition).catch((e) => {
|
|
47
45
|
metrics?.regenErrorCount.inc({reason: RegenErrorType.loadState});
|
|
48
46
|
throw e;
|
|
49
47
|
});
|
|
@@ -54,7 +52,7 @@ export async function getHistoricalState(
|
|
|
54
52
|
for await (const block of db.blockArchive.valuesStream({gt: state.slot, lte: slot})) {
|
|
55
53
|
try {
|
|
56
54
|
state = state.stateTransition(
|
|
57
|
-
block,
|
|
55
|
+
{block},
|
|
58
56
|
{
|
|
59
57
|
verifyProposer: false,
|
|
60
58
|
verifySignatures: false,
|
|
@@ -36,7 +36,7 @@ export class HistoricalStateRegen implements HistoricalStateWorkerApi {
|
|
|
36
36
|
dataColumnDir: modules.opts.dataColumnDir,
|
|
37
37
|
metricsEnabled: Boolean(modules.metrics),
|
|
38
38
|
loggerOpts: modules.logger.toOpts(),
|
|
39
|
-
|
|
39
|
+
nativeStateTransition: modules.opts.nativeStateTransition,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
const worker = new Worker(path.join(WORKER_DIR, "worker.js"), {
|
|
@@ -8,7 +8,7 @@ export type HistoricalStateRegenInitModules = {
|
|
|
8
8
|
genesisTime: number;
|
|
9
9
|
dbLocation: string;
|
|
10
10
|
dataColumnDir: string;
|
|
11
|
-
|
|
11
|
+
nativeStateTransition: boolean;
|
|
12
12
|
};
|
|
13
13
|
config: BeaconConfig;
|
|
14
14
|
logger: LoggerNode;
|
|
@@ -29,7 +29,7 @@ export type HistoricalStateWorkerData = {
|
|
|
29
29
|
dataColumnDir: string;
|
|
30
30
|
metricsEnabled: boolean;
|
|
31
31
|
loggerOpts: LoggerNodeOpts;
|
|
32
|
-
|
|
32
|
+
nativeStateTransition: boolean;
|
|
33
33
|
};
|
|
34
34
|
|
|
35
35
|
export type HistoricalStateWorkerApi = {
|
|
@@ -36,7 +36,6 @@ const abortController = new AbortController();
|
|
|
36
36
|
const metricsRegister = workerData.metricsEnabled ? new RegistryMetricCreator() : null;
|
|
37
37
|
let historicalStateRegenMetrics: HistoricalStateRegenMetrics | undefined;
|
|
38
38
|
let queueMetrics: QueueMetrics | undefined;
|
|
39
|
-
|
|
40
39
|
if (metricsRegister) {
|
|
41
40
|
const closeMetrics = collectNodeJSMetrics(metricsRegister, "lodestar_historical_state_worker_");
|
|
42
41
|
abortController.signal.addEventListener("abort", closeMetrics, {once: true});
|
|
@@ -65,7 +64,7 @@ const api: HistoricalStateWorkerApi = {
|
|
|
65
64
|
historicalStateRegenMetrics?.regenRequestCount.inc();
|
|
66
65
|
|
|
67
66
|
const stateBytes = await queue.push<Uint8Array>(() =>
|
|
68
|
-
getHistoricalState(slot, config, db, workerData.
|
|
67
|
+
getHistoricalState(slot, config, db, workerData.nativeStateTransition, historicalStateRegenMetrics)
|
|
69
68
|
);
|
|
70
69
|
const result = Transfer(stateBytes, [stateBytes.buffer]) as unknown as Uint8Array;
|
|
71
70
|
|