@lodestar/beacon-node 1.52.0-dev.0f379f3b22 → 1.52.0-dev.119f1f9fe6
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 +18 -5
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
- package/lib/api/impl/beacon/state/utils.js +2 -1
- package/lib/api/impl/beacon/state/utils.js.map +1 -1
- package/lib/api/impl/debug/index.d.ts.map +1 -1
- package/lib/api/impl/debug/index.js +6 -2
- package/lib/api/impl/debug/index.js.map +1 -1
- package/lib/api/impl/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +15 -8
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.d.ts +4 -0
- package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
- package/lib/chain/ColumnReconstructionTracker.js +4 -0
- package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.d.ts.map +1 -1
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js +7 -0
- package/lib/chain/archiveStore/historicalState/getHistoricalState.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +8 -4
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts +1 -1
- package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +9 -3
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +3 -17
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/chain.d.ts +6 -5
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +71 -25
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/attestationError.d.ts +15 -1
- package/lib/chain/errors/attestationError.d.ts.map +1 -1
- package/lib/chain/errors/attestationError.js +8 -0
- package/lib/chain/errors/attestationError.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +6 -1
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -0
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.d.ts +55 -0
- package/lib/chain/errors/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadEnvelope.js +8 -0
- package/lib/chain/errors/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/interface.d.ts +1 -1
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/lightClient/index.d.ts +13 -6
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +95 -115
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/prepareNextSlot.d.ts +45 -0
- package/lib/chain/prepareNextSlot.d.ts.map +1 -1
- package/lib/chain/prepareNextSlot.js +265 -69
- package/lib/chain/prepareNextSlot.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.d.ts +1 -0
- package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +23 -15
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/chain/seenCache/seenAttesters.d.ts +1 -0
- package/lib/chain/seenCache/seenAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenAttesters.js +1 -1
- package/lib/chain/seenCache/seenAttesters.js.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.d.ts +8 -2
- package/lib/chain/seenCache/seenBlockAttesters.d.ts.map +1 -1
- package/lib/chain/seenCache/seenBlockAttesters.js +43 -6
- package/lib/chain/seenCache/seenBlockAttesters.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +24 -7
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/attestation.d.ts.map +1 -1
- package/lib/chain/validation/attestation.js +32 -16
- package/lib/chain/validation/attestation.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +9 -1
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +18 -31
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +100 -9
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +9 -0
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validation/voluntaryExit.d.ts.map +1 -1
- package/lib/chain/validation/voluntaryExit.js +39 -6
- package/lib/chain/validation/voluntaryExit.js.map +1 -1
- package/lib/chain/validatorMonitor.js +43 -43
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/execution/engine/blockHash.d.ts +12 -0
- package/lib/execution/engine/blockHash.d.ts.map +1 -0
- package/lib/execution/engine/blockHash.js +17 -0
- package/lib/execution/engine/blockHash.js.map +1 -0
- package/lib/execution/engine/http.d.ts +2 -2
- package/lib/execution/engine/http.d.ts.map +1 -1
- package/lib/execution/engine/http.js +13 -7
- package/lib/execution/engine/http.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +16 -3
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js +11 -0
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.d.ts +2 -0
- package/lib/execution/engine/jsonRpcHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcHttpClient.js +14 -6
- package/lib/execution/engine/jsonRpcHttpClient.js.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.d.ts +2 -2
- package/lib/execution/engine/jsonRpcTransport.d.ts.map +1 -1
- package/lib/execution/engine/jsonRpcTransport.js +4 -4
- package/lib/execution/engine/jsonRpcTransport.js.map +1 -1
- package/lib/execution/engine/mock.d.ts.map +1 -1
- package/lib/execution/engine/mock.js +6 -6
- package/lib/execution/engine/mock.js.map +1 -1
- package/lib/execution/engine/payloadIdCache.d.ts +6 -1
- package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
- package/lib/execution/engine/payloadIdCache.js +7 -2
- package/lib/execution/engine/payloadIdCache.js.map +1 -1
- package/lib/execution/engine/restHttpClient.d.ts.map +1 -1
- package/lib/execution/engine/restHttpClient.js +9 -5
- package/lib/execution/engine/restHttpClient.js.map +1 -1
- package/lib/execution/engine/restTransport.d.ts +2 -2
- package/lib/execution/engine/restTransport.d.ts.map +1 -1
- package/lib/execution/engine/restTransport.js +4 -4
- package/lib/execution/engine/restTransport.js.map +1 -1
- package/lib/execution/engine/signal.d.ts +6 -0
- package/lib/execution/engine/signal.d.ts.map +1 -0
- package/lib/execution/engine/signal.js +24 -0
- package/lib/execution/engine/signal.js.map +1 -0
- package/lib/execution/engine/transport.d.ts +2 -2
- package/lib/execution/engine/transport.d.ts.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/metrics/metrics/beacon.d.ts +5 -0
- package/lib/metrics/metrics/beacon.d.ts.map +1 -1
- package/lib/metrics/metrics/beacon.js +5 -0
- package/lib/metrics/metrics/beacon.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +1 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +5 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/gossipsub.d.ts +1 -0
- package/lib/network/gossip/gossipsub.d.ts.map +1 -1
- package/lib/network/gossip/gossipsub.js +5 -2
- package/lib/network/gossip/gossipsub.js.map +1 -1
- 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/peers/peerManager.d.ts.map +1 -1
- package/lib/network/peers/peerManager.js +22 -2
- package/lib/network/peers/peerManager.js.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.d.ts +2 -0
- package/lib/network/peers/utils/prioritizePeers.d.ts.map +1 -1
- package/lib/network/peers/utils/prioritizePeers.js +11 -2
- package/lib/network/peers/utils/prioritizePeers.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +15 -5
- 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 +4 -2
- package/lib/network/processor/index.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js +1 -1
- package/lib/network/reqresp/handlers/dataColumnSidecarsByRoot.js.map +1 -1
- package/lib/sync/range/batch.d.ts +10 -0
- package/lib/sync/range/batch.d.ts.map +1 -1
- package/lib/sync/range/batch.js +29 -0
- package/lib/sync/range/batch.js.map +1 -1
- package/lib/sync/range/chain.d.ts +17 -2
- package/lib/sync/range/chain.d.ts.map +1 -1
- package/lib/sync/range/chain.js +60 -20
- 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 +44 -3
- package/lib/sync/range/range.js.map +1 -1
- package/lib/sync/range/utils/batches.d.ts +20 -4
- package/lib/sync/range/utils/batches.d.ts.map +1 -1
- package/lib/sync/range/utils/batches.js +31 -13
- package/lib/sync/range/utils/batches.js.map +1 -1
- package/lib/sync/range/utils/peerBalancer.d.ts +1 -1
- package/lib/sync/range/utils/peerBalancer.d.ts.map +1 -1
- package/lib/sync/range/utils/peerBalancer.js +5 -2
- package/lib/sync/range/utils/peerBalancer.js.map +1 -1
- package/lib/sync/types.d.ts +14 -1
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +2 -0
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +28 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +338 -26
- package/lib/sync/unknownBlock.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts +22 -1
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +55 -25
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +24 -2
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +48 -5
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/dataColumns.d.ts +1 -1
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +4 -1
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/eventLoop.d.ts +3 -3
- package/lib/util/eventLoop.d.ts.map +1 -1
- package/lib/util/eventLoop.js +3 -3
- package/lib/util/eventLoop.js.map +1 -1
- package/package.json +27 -27
- package/src/api/impl/beacon/blocks/index.ts +20 -5
- package/src/api/impl/beacon/state/utils.ts +2 -1
- package/src/api/impl/debug/index.ts +6 -2
- package/src/api/impl/validator/index.ts +17 -9
- package/src/chain/ColumnReconstructionTracker.ts +5 -0
- package/src/chain/archiveStore/historicalState/getHistoricalState.ts +9 -0
- package/src/chain/archiveStore/utils/archiveBlocks.ts +1 -1
- package/src/chain/archiveStore/utils/pruneHistory.ts +9 -4
- package/src/chain/blocks/importExecutionPayload.ts +9 -2
- package/src/chain/blocks/index.ts +3 -31
- package/src/chain/chain.ts +104 -42
- package/src/chain/errors/attestationError.ts +11 -1
- package/src/chain/errors/executionPayloadBid.ts +6 -0
- package/src/chain/errors/executionPayloadEnvelope.ts +58 -0
- package/src/chain/interface.ts +1 -1
- package/src/chain/lightClient/index.ts +108 -142
- package/src/chain/prepareNextSlot.ts +347 -89
- package/src/chain/produceBlock/produceBlockBody.ts +25 -16
- package/src/chain/seenCache/seenAttesters.ts +1 -1
- package/src/chain/seenCache/seenBlockAttesters.ts +48 -6
- package/src/chain/validation/aggregateAndProof.ts +24 -9
- package/src/chain/validation/attestation.ts +31 -20
- package/src/chain/validation/block.ts +9 -1
- package/src/chain/validation/executionPayloadBid.ts +21 -33
- package/src/chain/validation/executionPayloadEnvelope.ts +115 -8
- package/src/chain/validation/payloadAttestationMessage.ts +10 -0
- package/src/chain/validation/voluntaryExit.ts +44 -6
- package/src/chain/validatorMonitor.ts +43 -43
- package/src/execution/engine/blockHash.ts +27 -0
- package/src/execution/engine/http.ts +18 -10
- package/src/execution/engine/interface.ts +18 -3
- package/src/execution/engine/jsonRpcHttpClient.ts +26 -14
- package/src/execution/engine/jsonRpcTransport.ts +8 -4
- package/src/execution/engine/mock.ts +13 -8
- package/src/execution/engine/payloadIdCache.ts +12 -4
- package/src/execution/engine/restHttpClient.ts +17 -11
- package/src/execution/engine/restTransport.ts +5 -4
- package/src/execution/engine/signal.ts +28 -0
- package/src/execution/engine/transport.ts +3 -2
- package/src/index.ts +6 -1
- package/src/metrics/metrics/beacon.ts +9 -0
- package/src/metrics/metrics/lodestar.ts +5 -0
- package/src/network/gossip/gossipsub.ts +6 -2
- package/src/network/network.ts +6 -2
- package/src/network/peers/peerManager.ts +26 -2
- package/src/network/peers/utils/prioritizePeers.ts +14 -1
- package/src/network/processor/gossipHandlers.ts +15 -6
- package/src/network/processor/index.ts +7 -2
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +1 -1
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +1 -1
- package/src/sync/range/batch.ts +33 -0
- package/src/sync/range/chain.ts +72 -17
- package/src/sync/range/range.ts +57 -3
- package/src/sync/range/utils/batches.ts +38 -13
- package/src/sync/range/utils/peerBalancer.ts +4 -1
- package/src/sync/types.ts +13 -0
- package/src/sync/unknownBlock.ts +387 -28
- package/src/sync/utils/downloadByRange.ts +89 -29
- package/src/sync/utils/downloadByRoot.ts +75 -7
- package/src/util/dataColumns.ts +4 -1
- package/src/util/eventLoop.ts +3 -3
|
@@ -1216,137 +1216,137 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator, register
|
|
|
1216
1216
|
|
|
1217
1217
|
return {
|
|
1218
1218
|
validatorsConnected: register.gauge({
|
|
1219
|
-
name: "
|
|
1219
|
+
name: "validator_monitor_validators",
|
|
1220
1220
|
help: "Count of validators that are specifically monitored by this beacon node",
|
|
1221
1221
|
}),
|
|
1222
1222
|
|
|
1223
1223
|
validatorsConnectedIndices: register.gauge<{indices: string}>({
|
|
1224
|
-
name: "
|
|
1224
|
+
name: "validator_monitor_indices",
|
|
1225
1225
|
help: "Static metric with connected validator indices as label, value is always 1",
|
|
1226
1226
|
labelNames: ["indices"],
|
|
1227
1227
|
}),
|
|
1228
1228
|
|
|
1229
1229
|
validatorsInSyncCommittee: register.gauge({
|
|
1230
|
-
name: "
|
|
1230
|
+
name: "validator_monitor_validators_in_sync_committee",
|
|
1231
1231
|
help: "Count of validators monitored by this beacon node that are part of sync committee",
|
|
1232
1232
|
}),
|
|
1233
1233
|
|
|
1234
1234
|
// Validator Monitor Metrics (per-epoch summaries)
|
|
1235
1235
|
prevEpochOnChainBalance: stateDerivedRegister?.gauge({
|
|
1236
|
-
name: "
|
|
1236
|
+
name: "validator_monitor_prev_epoch_on_chain_balance",
|
|
1237
1237
|
help: "Total balance of all monitored validators after an epoch",
|
|
1238
1238
|
}),
|
|
1239
1239
|
prevEpochOnChainAttesterHit: register.gauge({
|
|
1240
|
-
name: "
|
|
1240
|
+
name: "validator_monitor_prev_epoch_on_chain_attester_hit_total",
|
|
1241
1241
|
help: "Incremented if validator's submitted attestation is included in some blocks",
|
|
1242
1242
|
}),
|
|
1243
1243
|
prevEpochOnChainAttesterMiss: register.gauge({
|
|
1244
|
-
name: "
|
|
1244
|
+
name: "validator_monitor_prev_epoch_on_chain_attester_miss_total",
|
|
1245
1245
|
help: "Incremented if validator's submitted attestation is not included in any blocks",
|
|
1246
1246
|
}),
|
|
1247
1247
|
prevEpochOnChainSourceAttesterHit: stateDerivedRegister?.gauge({
|
|
1248
|
-
name: "
|
|
1248
|
+
name: "validator_monitor_prev_epoch_on_chain_source_attester_hit_total",
|
|
1249
1249
|
help: "Incremented if the validator is flagged as a previous epoch source attester during per epoch processing",
|
|
1250
1250
|
}),
|
|
1251
1251
|
prevEpochOnChainSourceAttesterMiss: stateDerivedRegister?.gauge({
|
|
1252
|
-
name: "
|
|
1252
|
+
name: "validator_monitor_prev_epoch_on_chain_source_attester_miss_total",
|
|
1253
1253
|
help: "Incremented if the validator is not flagged as a previous epoch source attester during per epoch processing",
|
|
1254
1254
|
}),
|
|
1255
1255
|
prevEpochOnChainHeadAttesterHit: stateDerivedRegister?.gauge({
|
|
1256
|
-
name: "
|
|
1256
|
+
name: "validator_monitor_prev_epoch_on_chain_head_attester_hit_total",
|
|
1257
1257
|
help: "Incremented if the validator is flagged as a previous epoch head attester during per epoch processing",
|
|
1258
1258
|
}),
|
|
1259
1259
|
prevEpochOnChainHeadAttesterMiss: stateDerivedRegister?.gauge({
|
|
1260
|
-
name: "
|
|
1260
|
+
name: "validator_monitor_prev_epoch_on_chain_head_attester_miss_total",
|
|
1261
1261
|
help: "Incremented if the validator is not flagged as a previous epoch head attester during per epoch processing",
|
|
1262
1262
|
}),
|
|
1263
1263
|
prevOnChainAttesterCorrectHead: register.gauge({
|
|
1264
|
-
name: "
|
|
1264
|
+
name: "validator_monitor_prev_epoch_on_chain_attester_correct_head_total",
|
|
1265
1265
|
help: "Total count of times a validator votes correct head",
|
|
1266
1266
|
}),
|
|
1267
1267
|
prevOnChainAttesterIncorrectHead: register.gauge({
|
|
1268
|
-
name: "
|
|
1268
|
+
name: "validator_monitor_prev_epoch_on_chain_attester_incorrect_head_total",
|
|
1269
1269
|
help: "Total count of times a validator votes incorrect head",
|
|
1270
1270
|
}),
|
|
1271
1271
|
prevEpochOnChainTargetAttesterHit: stateDerivedRegister?.gauge({
|
|
1272
|
-
name: "
|
|
1272
|
+
name: "validator_monitor_prev_epoch_on_chain_target_attester_hit_total",
|
|
1273
1273
|
help: "Incremented if the validator is flagged as a previous epoch target attester during per epoch processing",
|
|
1274
1274
|
}),
|
|
1275
1275
|
prevEpochOnChainTargetAttesterMiss: stateDerivedRegister?.gauge({
|
|
1276
|
-
name: "
|
|
1276
|
+
name: "validator_monitor_prev_epoch_on_chain_target_attester_miss_total",
|
|
1277
1277
|
help: "Incremented if the validator is not flagged as a previous epoch target attester during per epoch processing",
|
|
1278
1278
|
}),
|
|
1279
1279
|
prevEpochOnChainInclusionDistance: register.histogram({
|
|
1280
|
-
name: "
|
|
1280
|
+
name: "validator_monitor_prev_epoch_on_chain_inclusion_distance",
|
|
1281
1281
|
help: "The attestation inclusion distance calculated during per epoch processing",
|
|
1282
1282
|
// min inclusion distance is 1, usual values are 1,2,3 max is 32 (1 epoch)
|
|
1283
1283
|
buckets: [1, 2, 3, 5, 10, 32],
|
|
1284
1284
|
}),
|
|
1285
1285
|
prevEpochAttestations: register.histogram({
|
|
1286
|
-
name: "
|
|
1286
|
+
name: "validator_monitor_prev_epoch_attestations",
|
|
1287
1287
|
help: "The number of unagg. attestations seen in the previous epoch",
|
|
1288
1288
|
buckets: [0, 1, 2, 3],
|
|
1289
1289
|
}),
|
|
1290
1290
|
prevEpochAttestationsMinDelaySeconds: register.histogram({
|
|
1291
|
-
name: "
|
|
1291
|
+
name: "validator_monitor_prev_epoch_attestations_min_delay_seconds",
|
|
1292
1292
|
help: "The min delay between when the validator should send the attestation and when it was received",
|
|
1293
1293
|
buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
|
|
1294
1294
|
}),
|
|
1295
1295
|
prevEpochAttestationAggregateInclusions: register.histogram({
|
|
1296
|
-
name: "
|
|
1296
|
+
name: "validator_monitor_prev_epoch_attestation_aggregate_inclusions",
|
|
1297
1297
|
help: "The count of times an attestation was seen inside an aggregate",
|
|
1298
1298
|
buckets: [0, 1, 2, 3, 5, 10],
|
|
1299
1299
|
}),
|
|
1300
1300
|
prevEpochAttestationBlockInclusions: register.histogram({
|
|
1301
|
-
name: "
|
|
1301
|
+
name: "validator_monitor_prev_epoch_attestation_block_inclusions",
|
|
1302
1302
|
help: "The count of times an attestation was seen inside a block",
|
|
1303
1303
|
buckets: [0, 1, 2, 3, 5],
|
|
1304
1304
|
}),
|
|
1305
1305
|
prevEpochAttestationBlockMinInclusionDistance: register.histogram({
|
|
1306
|
-
name: "
|
|
1306
|
+
name: "validator_monitor_prev_epoch_attestation_block_min_inclusion_distance",
|
|
1307
1307
|
help: "The minimum inclusion distance observed for the inclusion of an attestation in a block",
|
|
1308
1308
|
buckets: [1, 2, 3, 5, 10, 32],
|
|
1309
1309
|
}),
|
|
1310
1310
|
prevEpochBeaconBlocks: register.histogram({
|
|
1311
|
-
name: "
|
|
1311
|
+
name: "validator_monitor_prev_epoch_beacon_blocks",
|
|
1312
1312
|
help: "The number of beacon_blocks seen in the previous epoch",
|
|
1313
1313
|
buckets: [0, 1, 2, 3, 5, 10],
|
|
1314
1314
|
}),
|
|
1315
1315
|
prevEpochBeaconBlocksMinDelaySeconds: register.histogram({
|
|
1316
|
-
name: "
|
|
1316
|
+
name: "validator_monitor_prev_epoch_beacon_blocks_min_delay_seconds",
|
|
1317
1317
|
help: "The min delay between when the validator should send the block and when it was received",
|
|
1318
1318
|
buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
|
|
1319
1319
|
}),
|
|
1320
1320
|
prevEpochAggregatesTotal: register.histogram({
|
|
1321
|
-
name: "
|
|
1321
|
+
name: "validator_monitor_prev_epoch_aggregates",
|
|
1322
1322
|
help: "The number of aggregates seen in the previous epoch",
|
|
1323
1323
|
buckets: [0, 1, 2, 3, 5, 10],
|
|
1324
1324
|
}),
|
|
1325
1325
|
prevEpochAggregatesMinDelaySeconds: register.histogram({
|
|
1326
|
-
name: "
|
|
1326
|
+
name: "validator_monitor_prev_epoch_aggregates_min_delay_seconds",
|
|
1327
1327
|
help: "The min delay between when the validator should send the aggregate and when it was received",
|
|
1328
1328
|
buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
|
|
1329
1329
|
}),
|
|
1330
1330
|
prevEpochSyncCommitteeHits: register.gauge({
|
|
1331
|
-
name: "
|
|
1331
|
+
name: "validator_monitor_prev_epoch_sync_committee_hits",
|
|
1332
1332
|
help: "Count of times in prev epoch connected validators participated in imported block's syncAggregate",
|
|
1333
1333
|
}),
|
|
1334
1334
|
prevEpochSyncCommitteeMisses: register.gauge({
|
|
1335
|
-
name: "
|
|
1335
|
+
name: "validator_monitor_prev_epoch_sync_committee_misses",
|
|
1336
1336
|
help: "Count of times in prev epoch connected validators fail to participate in imported block's syncAggregate",
|
|
1337
1337
|
}),
|
|
1338
1338
|
prevEpochSyncSignatureAggregateInclusions: register.histogram({
|
|
1339
|
-
name: "
|
|
1339
|
+
name: "validator_monitor_prev_epoch_sync_signature_aggregate_inclusions",
|
|
1340
1340
|
help: "The count of times a sync signature was seen inside an aggregate",
|
|
1341
1341
|
buckets: [0, 1, 2, 3, 5, 10],
|
|
1342
1342
|
}),
|
|
1343
1343
|
prevEpochAttestationSummary: register.gauge<{summary: string}>({
|
|
1344
|
-
name: "
|
|
1344
|
+
name: "validator_monitor_prev_epoch_attestation_summary",
|
|
1345
1345
|
help: "Best guess of the node of the result of previous epoch validators attestation actions and causality",
|
|
1346
1346
|
labelNames: ["summary"],
|
|
1347
1347
|
}),
|
|
1348
1348
|
prevEpochBlockProposalSummary: register.gauge<{summary: string}>({
|
|
1349
|
-
name: "
|
|
1349
|
+
name: "validator_monitor_prev_epoch_block_proposal_summary",
|
|
1350
1350
|
help: "Best guess of the node of the result of previous epoch validators block proposal actions and causality",
|
|
1351
1351
|
labelNames: ["summary"],
|
|
1352
1352
|
}),
|
|
@@ -1354,18 +1354,18 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator, register
|
|
|
1354
1354
|
// Validator Monitor Metrics (real-time)
|
|
1355
1355
|
|
|
1356
1356
|
unaggregatedAttestationTotal: register.gauge<{src: OpSource}>({
|
|
1357
|
-
name: "
|
|
1357
|
+
name: "validator_monitor_unaggregated_attestation_total",
|
|
1358
1358
|
help: "Number of unaggregated attestations seen",
|
|
1359
1359
|
labelNames: ["src"],
|
|
1360
1360
|
}),
|
|
1361
1361
|
unaggregatedAttestationDelaySeconds: register.histogram<{src: OpSource}>({
|
|
1362
|
-
name: "
|
|
1362
|
+
name: "validator_monitor_unaggregated_attestation_delay_seconds",
|
|
1363
1363
|
help: "The delay between when the validator should send the attestation and when it was received",
|
|
1364
1364
|
labelNames: ["src"],
|
|
1365
1365
|
buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
|
|
1366
1366
|
}),
|
|
1367
1367
|
unaggregatedAttestationSubmittedSentPeers: register.histogram({
|
|
1368
|
-
name: "
|
|
1368
|
+
name: "validator_monitor_unaggregated_attestation_submitted_sent_peers_count",
|
|
1369
1369
|
help: "Number of peers that an unaggregated attestation sent to",
|
|
1370
1370
|
// as of Apr 2022, most of the time we sent to >30 peers per attestations
|
|
1371
1371
|
// these bucket values just base on that fact to get equal range
|
|
@@ -1373,52 +1373,52 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator, register
|
|
|
1373
1373
|
buckets: [0, 10, 20, 30],
|
|
1374
1374
|
}),
|
|
1375
1375
|
aggregatedAttestationTotal: register.gauge<{src: OpSource}>({
|
|
1376
|
-
name: "
|
|
1376
|
+
name: "validator_monitor_aggregated_attestation_total",
|
|
1377
1377
|
help: "Number of aggregated attestations seen",
|
|
1378
1378
|
labelNames: ["src"],
|
|
1379
1379
|
}),
|
|
1380
1380
|
aggregatedAttestationDelaySeconds: register.histogram<{src: OpSource}>({
|
|
1381
|
-
name: "
|
|
1381
|
+
name: "validator_monitor_aggregated_attestation_delay_seconds",
|
|
1382
1382
|
help: "The delay between then the validator should send the aggregate and when it was received",
|
|
1383
1383
|
labelNames: ["src"],
|
|
1384
1384
|
buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
|
|
1385
1385
|
}),
|
|
1386
1386
|
attestationInAggregateTotal: register.gauge<{src: OpSource}>({
|
|
1387
|
-
name: "
|
|
1387
|
+
name: "validator_monitor_attestation_in_aggregate_total",
|
|
1388
1388
|
help: "Number of times an attestation has been seen in an aggregate",
|
|
1389
1389
|
labelNames: ["src"],
|
|
1390
1390
|
}),
|
|
1391
1391
|
attestationInAggregateDelaySeconds: register.histogram<{src: OpSource}>({
|
|
1392
|
-
name: "
|
|
1392
|
+
name: "validator_monitor_attestation_in_aggregate_delay_seconds",
|
|
1393
1393
|
help: "The delay between when the validator should send the aggregate and when it was received",
|
|
1394
1394
|
labelNames: ["src"],
|
|
1395
1395
|
buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
|
|
1396
1396
|
}),
|
|
1397
1397
|
attestationInBlockTotal: register.gauge({
|
|
1398
|
-
name: "
|
|
1398
|
+
name: "validator_monitor_attestation_in_block_total",
|
|
1399
1399
|
help: "Number of times an attestation has been seen in a block",
|
|
1400
1400
|
}),
|
|
1401
1401
|
attestationInBlockDelaySlots: register.histogram({
|
|
1402
|
-
name: "
|
|
1402
|
+
name: "validator_monitor_attestation_in_block_delay_slots",
|
|
1403
1403
|
help: "The excess slots (beyond the minimum delay) between the attestation slot and the block slot",
|
|
1404
1404
|
buckets: [0.1, 0.25, 0.5, 1, 2, 5, 10],
|
|
1405
1405
|
}),
|
|
1406
1406
|
attestationInBlockParticipants: register.histogram({
|
|
1407
|
-
name: "
|
|
1407
|
+
name: "validator_monitor_attestation_in_block_participants",
|
|
1408
1408
|
help: "The total participants in attestations of monitored validators included in blocks",
|
|
1409
1409
|
buckets: [1, 5, 20, 50, 100, 200],
|
|
1410
1410
|
}),
|
|
1411
1411
|
syncSignatureInAggregateTotal: register.gauge({
|
|
1412
|
-
name: "
|
|
1412
|
+
name: "validator_monitor_sync_signature_in_aggregate_total",
|
|
1413
1413
|
help: "Number of times a sync signature has been seen in an aggregate",
|
|
1414
1414
|
}),
|
|
1415
1415
|
beaconBlockTotal: register.gauge<{src: OpSource}>({
|
|
1416
|
-
name: "
|
|
1416
|
+
name: "validator_monitor_beacon_block_total",
|
|
1417
1417
|
help: "Total number of beacon blocks seen",
|
|
1418
1418
|
labelNames: ["src"],
|
|
1419
1419
|
}),
|
|
1420
1420
|
beaconBlockDelaySeconds: register.histogram<{src: OpSource}>({
|
|
1421
|
-
name: "
|
|
1421
|
+
name: "validator_monitor_beacon_block_delay_seconds",
|
|
1422
1422
|
help: "The delay between when the validator should send the block and when it was received",
|
|
1423
1423
|
labelNames: ["src"],
|
|
1424
1424
|
// we also want other nodes to received our published before 4s so add bucket 3 and 3.5
|
|
@@ -1427,7 +1427,7 @@ function createValidatorMonitorMetrics(register: RegistryMetricCreator, register
|
|
|
1427
1427
|
|
|
1428
1428
|
// Only for known
|
|
1429
1429
|
proposerBalanceDeltaKnown: register.histogram({
|
|
1430
|
-
name: "
|
|
1430
|
+
name: "validator_monitor_proposer_balance_delta_known_gwei",
|
|
1431
1431
|
help: "Balance delta of known block proposer after importing a valid block",
|
|
1432
1432
|
// Jul22 mainnet block reward is consistently between 29,000,000-28,000,000 GWei
|
|
1433
1433
|
buckets: [10_000, 100_000, 1e6, 10e6, 20e6, 50e6, 100e6, 1000e6],
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {computeExecutionBlockHash as computeExecutionBlockHashNative} from "@lodestar/native/execution-block-hash";
|
|
2
|
+
import {ForkPostBellatrix, ForkSeq, isForkPostElectra} from "@lodestar/params";
|
|
3
|
+
import {ExecutionPayload, ExecutionRequests, Root, sszTypesFor} from "@lodestar/types";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Compute the execution block hash of `payload`: keccak256 of the RLP-encoded execution block header,
|
|
7
|
+
* with the header fields laid out as in execution-specs for the execution fork paired with `fork`.
|
|
8
|
+
*
|
|
9
|
+
* `parentBeaconBlockRoot` is required from deneb and `executionRequests` from electra.
|
|
10
|
+
*
|
|
11
|
+
* Throws if a transaction is empty. It would be a deletion in the transactions trie and not change the hash.
|
|
12
|
+
*/
|
|
13
|
+
export function computeExecutionBlockHash(
|
|
14
|
+
fork: ForkPostBellatrix,
|
|
15
|
+
payload: ExecutionPayload,
|
|
16
|
+
parentBeaconBlockRoot: Root | null,
|
|
17
|
+
executionRequests: ExecutionRequests | null
|
|
18
|
+
): Uint8Array {
|
|
19
|
+
return computeExecutionBlockHashNative(
|
|
20
|
+
ForkSeq[fork],
|
|
21
|
+
sszTypesFor(fork).ExecutionPayload.serialize(payload),
|
|
22
|
+
parentBeaconBlockRoot ?? undefined,
|
|
23
|
+
executionRequests !== null && isForkPostElectra(fork)
|
|
24
|
+
? sszTypesFor(fork).ExecutionRequests.serialize(executionRequests)
|
|
25
|
+
: undefined
|
|
26
|
+
);
|
|
27
|
+
}
|
|
@@ -2,7 +2,7 @@ import {Logger} from "@lodestar/logger";
|
|
|
2
2
|
import {ForkName, ForkPostFulu, ForkSeq, SLOTS_PER_EPOCH, isForkPostBellatrix} from "@lodestar/params";
|
|
3
3
|
import {BlobsBundle, ExecutionPayload, ExecutionRequests, Root, RootHex, Wei, bellatrix} from "@lodestar/types";
|
|
4
4
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
5
|
-
import {isErrorAborted} from "@lodestar/utils";
|
|
5
|
+
import {ErrorAborted, isErrorAborted} from "@lodestar/utils";
|
|
6
6
|
import {Metrics} from "../../metrics/index.js";
|
|
7
7
|
import {EPOCHS_PER_BATCH} from "../../sync/constants.js";
|
|
8
8
|
import {getLodestarClientVersion} from "../../util/metadata.js";
|
|
@@ -11,6 +11,8 @@ import {JobItemQueue} from "../../util/queue/index.js";
|
|
|
11
11
|
import {
|
|
12
12
|
ClientVersion,
|
|
13
13
|
ExecutePayloadResponse,
|
|
14
|
+
ExecutionEngineError,
|
|
15
|
+
ExecutionEngineErrorCode,
|
|
14
16
|
ExecutionEngineState,
|
|
15
17
|
ExecutionPayloadStatus,
|
|
16
18
|
ForkchoiceUpdatedResult,
|
|
@@ -334,13 +336,18 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
334
336
|
headBlockHash: RootHex,
|
|
335
337
|
safeBlockHash: RootHex,
|
|
336
338
|
finalizedBlockHash: RootHex,
|
|
337
|
-
payloadAttributes?: PayloadAttributes
|
|
339
|
+
payloadAttributes?: PayloadAttributes,
|
|
340
|
+
signal?: AbortSignal
|
|
338
341
|
): Promise<ForkchoiceUpdatedResult> {
|
|
339
|
-
const result = await this.enqueue(() =>
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
342
|
+
const result = await this.enqueue(() => {
|
|
343
|
+
// Aborted while waiting in the queue, do not select a transport and sign a request that is not sent
|
|
344
|
+
if (signal?.aborted) {
|
|
345
|
+
throw new ErrorAborted("notifyForkchoiceUpdate");
|
|
346
|
+
}
|
|
347
|
+
return this.withTransport(fork, undefined, (transport) =>
|
|
348
|
+
transport.forkchoiceUpdated(fork, headBlockHash, safeBlockHash, finalizedBlockHash, payloadAttributes, signal)
|
|
349
|
+
);
|
|
350
|
+
});
|
|
344
351
|
const {
|
|
345
352
|
payloadStatus: {status},
|
|
346
353
|
payloadId,
|
|
@@ -373,7 +380,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
373
380
|
case ExecutionPayloadStatus.SYNCING:
|
|
374
381
|
// Throw error on syncing if requested to produce a block, else silently ignore
|
|
375
382
|
if (payloadAttributes) {
|
|
376
|
-
throw
|
|
383
|
+
throw new ExecutionEngineError({code: ExecutionEngineErrorCode.SYNCING}, "Execution Layer Syncing");
|
|
377
384
|
}
|
|
378
385
|
return result;
|
|
379
386
|
|
|
@@ -394,7 +401,8 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
394
401
|
*/
|
|
395
402
|
async getPayload(
|
|
396
403
|
fork: ForkName,
|
|
397
|
-
payloadId: PayloadId
|
|
404
|
+
payloadId: PayloadId,
|
|
405
|
+
signal?: AbortSignal
|
|
398
406
|
): Promise<{
|
|
399
407
|
executionPayload: ExecutionPayload;
|
|
400
408
|
executionPayloadValue: Wei;
|
|
@@ -402,7 +410,7 @@ export class ExecutionEngineHttp implements IExecutionEngine {
|
|
|
402
410
|
executionRequests?: ExecutionRequests;
|
|
403
411
|
shouldOverrideBuilder?: boolean;
|
|
404
412
|
}> {
|
|
405
|
-
return this.withTransport(fork, undefined, (transport) => transport.getPayload(fork, payloadId));
|
|
413
|
+
return this.withTransport(fork, undefined, (transport) => transport.getPayload(fork, payloadId, signal));
|
|
406
414
|
}
|
|
407
415
|
|
|
408
416
|
async prunePayloadIdCache(): Promise<void> {
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
capella,
|
|
20
20
|
} from "@lodestar/types";
|
|
21
21
|
import {BlobAndProofV2} from "@lodestar/types/fulu";
|
|
22
|
+
import {LodestarError} from "@lodestar/utils";
|
|
22
23
|
import {PayloadId, PayloadIdCache, WithdrawalV1} from "./payloadIdCache.js";
|
|
23
24
|
import {ExecutionPayloadBodyV2} from "./types.js";
|
|
24
25
|
import {DATA} from "./utils.js";
|
|
@@ -131,6 +132,18 @@ export type PayloadAttributes = {
|
|
|
131
132
|
|
|
132
133
|
export type VersionedHashes = Uint8Array[];
|
|
133
134
|
|
|
135
|
+
export enum ExecutionEngineErrorCode {
|
|
136
|
+
/**
|
|
137
|
+
* `notifyForkchoiceUpdate` requested a payload while the execution client is syncing, the head block is not
|
|
138
|
+
* available to build on yet
|
|
139
|
+
*/
|
|
140
|
+
SYNCING = "EXECUTION_ENGINE_ERROR_SYNCING",
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export type ExecutionEngineErrorType = {code: ExecutionEngineErrorCode.SYNCING};
|
|
144
|
+
|
|
145
|
+
export class ExecutionEngineError extends LodestarError<ExecutionEngineErrorType> {}
|
|
146
|
+
|
|
134
147
|
/**
|
|
135
148
|
* Execution engine represents an abstract protocol to interact with execution clients. Potential transports include:
|
|
136
149
|
* - JSON RPC over network
|
|
@@ -180,14 +193,15 @@ export interface IExecutionEngine {
|
|
|
180
193
|
* Should be called in response to fork-choice head and finalized events.
|
|
181
194
|
*
|
|
182
195
|
* An INVALID verdict is returned, not thrown: the caller feeds it back into fork choice together with the
|
|
183
|
-
* `latestValidHash`. Only SYNCING while building a payload is an error
|
|
196
|
+
* `latestValidHash`. Only SYNCING while building a payload is an error, thrown as `ExecutionEngineError` with code `SYNCING`.
|
|
184
197
|
*/
|
|
185
198
|
notifyForkchoiceUpdate(
|
|
186
199
|
fork: ForkName,
|
|
187
200
|
headBlockHash: RootHex,
|
|
188
201
|
safeBlockHash: RootHex,
|
|
189
202
|
finalizedBlockHash: RootHex,
|
|
190
|
-
payloadAttributes?: PayloadAttributes
|
|
203
|
+
payloadAttributes?: PayloadAttributes,
|
|
204
|
+
signal?: AbortSignal
|
|
191
205
|
): Promise<ForkchoiceUpdatedResult>;
|
|
192
206
|
|
|
193
207
|
/**
|
|
@@ -199,7 +213,8 @@ export interface IExecutionEngine {
|
|
|
199
213
|
*/
|
|
200
214
|
getPayload(
|
|
201
215
|
fork: ForkName,
|
|
202
|
-
payloadId: PayloadId
|
|
216
|
+
payloadId: PayloadId,
|
|
217
|
+
signal?: AbortSignal
|
|
203
218
|
): Promise<{
|
|
204
219
|
executionPayload: ExecutionPayload;
|
|
205
220
|
executionPayloadValue: Wei;
|
|
@@ -2,6 +2,7 @@ import {EventEmitter} from "node:events";
|
|
|
2
2
|
import {StrictEventEmitter} from "strict-event-emitter-types";
|
|
3
3
|
import {ErrorAborted, Gauge, Histogram, TimeoutError, fetch, isValidHttpUrl, retry} from "@lodestar/utils";
|
|
4
4
|
import {JwtClaim, encodeJwtToken} from "./jwt.js";
|
|
5
|
+
import {withRequestSignal} from "./signal.js";
|
|
5
6
|
import {EngineTransportMetrics} from "./transportMetrics.js";
|
|
6
7
|
import {IJson, RpcPayload} from "./utils.js";
|
|
7
8
|
|
|
@@ -54,6 +55,8 @@ export type ReqOpts = {
|
|
|
54
55
|
retries?: number;
|
|
55
56
|
retryDelay?: number;
|
|
56
57
|
shouldRetry?: (lastError: Error) => boolean;
|
|
58
|
+
/** Aborts this request only, in addition to the signal of the client */
|
|
59
|
+
signal?: AbortSignal;
|
|
57
60
|
};
|
|
58
61
|
|
|
59
62
|
export type JsonRpcHttpClientMetrics = EngineTransportMetrics & {
|
|
@@ -157,19 +160,23 @@ export class JsonRpcHttpClient implements IJsonRpcHttpClient {
|
|
|
157
160
|
return this.wrapWithEvents(async () => {
|
|
158
161
|
const routeId = opts?.routeId ?? "unknown";
|
|
159
162
|
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
retries: opts?.retries ?? this.opts?.retries ?? 0,
|
|
166
|
-
retryDelay: opts?.retryDelay ?? this.opts?.retryDelay,
|
|
167
|
-
shouldRetry: opts?.shouldRetry,
|
|
168
|
-
signal: this.opts?.signal,
|
|
169
|
-
onRetry: () => {
|
|
170
|
-
this.opts?.metrics?.retryCount.inc({routeId});
|
|
163
|
+
// The delay between retries has to end with the request signal as well
|
|
164
|
+
const res = await withRequestSignal(this.opts?.signal, opts?.signal, (signal) =>
|
|
165
|
+
retry<RpcResponse<R>>(
|
|
166
|
+
async (_attempt) => {
|
|
167
|
+
return this.fetchJson({jsonrpc: "2.0", id: this.id++, ...payload}, opts);
|
|
171
168
|
},
|
|
172
|
-
|
|
169
|
+
{
|
|
170
|
+
retries: opts?.retries ?? this.opts?.retries ?? 0,
|
|
171
|
+
retryDelay: opts?.retryDelay ?? this.opts?.retryDelay,
|
|
172
|
+
// An aborted request is no longer of interest to its caller
|
|
173
|
+
shouldRetry: (lastError) => !opts?.signal?.aborted && (opts?.shouldRetry?.(lastError) ?? true),
|
|
174
|
+
signal,
|
|
175
|
+
onRetry: () => {
|
|
176
|
+
this.opts?.metrics?.retryCount.inc({routeId});
|
|
177
|
+
},
|
|
178
|
+
}
|
|
179
|
+
)
|
|
173
180
|
);
|
|
174
181
|
return parseRpcResponse(res, payload);
|
|
175
182
|
}, payload);
|
|
@@ -244,6 +251,10 @@ export class JsonRpcHttpClient implements IJsonRpcHttpClient {
|
|
|
244
251
|
|
|
245
252
|
const onParentSignalAbort = (): void => controller.abort();
|
|
246
253
|
this.opts?.signal?.addEventListener("abort", onParentSignalAbort, {once: true});
|
|
254
|
+
opts?.signal?.addEventListener("abort", onParentSignalAbort, {once: true});
|
|
255
|
+
if (opts?.signal?.aborted) {
|
|
256
|
+
controller.abort();
|
|
257
|
+
}
|
|
247
258
|
|
|
248
259
|
// Default to "unknown" to prevent mixing metrics with others.
|
|
249
260
|
const routeId = opts?.routeId ?? "unknown";
|
|
@@ -306,8 +317,8 @@ export class JsonRpcHttpClient implements IJsonRpcHttpClient {
|
|
|
306
317
|
} catch (e) {
|
|
307
318
|
this.metrics?.requestErrors.inc({routeId});
|
|
308
319
|
if (controller.signal.aborted) {
|
|
309
|
-
// controller will abort on
|
|
310
|
-
if (this.opts?.signal?.aborted) {
|
|
320
|
+
// controller will abort on parent signal abort, request signal abort + timeout of this specific request
|
|
321
|
+
if (this.opts?.signal?.aborted || opts?.signal?.aborted) {
|
|
311
322
|
throw new ErrorAborted("request");
|
|
312
323
|
}
|
|
313
324
|
throw new TimeoutError("request");
|
|
@@ -319,6 +330,7 @@ export class JsonRpcHttpClient implements IJsonRpcHttpClient {
|
|
|
319
330
|
|
|
320
331
|
clearTimeout(timeout);
|
|
321
332
|
this.opts?.signal?.removeEventListener("abort", onParentSignalAbort);
|
|
333
|
+
opts?.signal?.removeEventListener("abort", onParentSignalAbort);
|
|
322
334
|
}
|
|
323
335
|
}
|
|
324
336
|
}
|
|
@@ -141,7 +141,8 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
141
141
|
headBlockHash: RootHex,
|
|
142
142
|
safeBlockHash: RootHex,
|
|
143
143
|
finalizedBlockHash: RootHex,
|
|
144
|
-
payloadAttributes?: PayloadAttributes
|
|
144
|
+
payloadAttributes?: PayloadAttributes,
|
|
145
|
+
signal?: AbortSignal
|
|
145
146
|
): Promise<ForkchoiceUpdatedResult> {
|
|
146
147
|
const method =
|
|
147
148
|
ForkSeq[fork] >= ForkSeq.heze
|
|
@@ -161,12 +162,15 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
161
162
|
const {payloadStatus, payloadId} = await this.rpc.fetchWithRetries<
|
|
162
163
|
EngineApiRpcReturnTypes[typeof method],
|
|
163
164
|
EngineApiRpcParamTypes[typeof method]
|
|
164
|
-
>(
|
|
165
|
+
>(
|
|
166
|
+
{method, params: [{headBlockHash, safeBlockHash, finalizedBlockHash}, payloadAttributesRpc]},
|
|
167
|
+
{...fcUReqOpts, signal}
|
|
168
|
+
);
|
|
165
169
|
|
|
166
170
|
return {payloadStatus, payloadId: payloadId && payloadId !== "0x" ? payloadId : null};
|
|
167
171
|
}
|
|
168
172
|
|
|
169
|
-
async getPayload(fork: ForkName, payloadId: PayloadId): Promise<GetPayloadResult> {
|
|
173
|
+
async getPayload(fork: ForkName, payloadId: PayloadId, signal?: AbortSignal): Promise<GetPayloadResult> {
|
|
170
174
|
let method: keyof EngineApiRpcReturnTypes;
|
|
171
175
|
switch (fork) {
|
|
172
176
|
case ForkName.phase0:
|
|
@@ -193,7 +197,7 @@ export class JsonRpcEngineTransport implements IEngineTransport {
|
|
|
193
197
|
const payloadResponse = await this.rpc.fetchWithRetries<
|
|
194
198
|
EngineApiRpcReturnTypes[typeof method],
|
|
195
199
|
EngineApiRpcParamTypes[typeof method]
|
|
196
|
-
>({method, params: [payloadId]}, getPayloadOpts);
|
|
200
|
+
>({method, params: [payloadId]}, {...getPayloadOpts, signal});
|
|
197
201
|
return parseExecutionPayload(fork, payloadResponse);
|
|
198
202
|
}
|
|
199
203
|
|
|
@@ -10,14 +10,16 @@ import {
|
|
|
10
10
|
ForkPostCapella,
|
|
11
11
|
ForkSeq,
|
|
12
12
|
SLOTS_PER_EPOCH,
|
|
13
|
+
isForkPostElectra,
|
|
13
14
|
} from "@lodestar/params";
|
|
14
15
|
import {computeTimeAtSlot} from "@lodestar/state-transition";
|
|
15
|
-
import {ExecutionPayload, RootHex, bellatrix, deneb, gloas, ssz} from "@lodestar/types";
|
|
16
|
+
import {ExecutionPayload, RootHex, bellatrix, deneb, gloas, ssz, sszTypesFor} from "@lodestar/types";
|
|
16
17
|
import {fromHex, toRootHex} from "@lodestar/utils";
|
|
17
18
|
import {ZERO_HASH_HEX} from "../../constants/index.js";
|
|
18
19
|
import {INTEROP_BLOCK_HASH} from "../../node/utils/interop/state.js";
|
|
19
20
|
import {kzgCommitmentToVersionedHash} from "../../util/blobs.js";
|
|
20
21
|
import {kzg} from "../../util/kzg.js";
|
|
22
|
+
import {computeExecutionBlockHash} from "./blockHash.js";
|
|
21
23
|
import {ClientCode, ExecutionPayloadStatus, PayloadIdCache} from "./interface.js";
|
|
22
24
|
import {
|
|
23
25
|
BlobsBundleRpc,
|
|
@@ -351,7 +353,6 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
351
353
|
executionPayload.gasLimit = INTEROP_GAS_LIMIT;
|
|
352
354
|
executionPayload.gasUsed = Math.floor(0.5 * INTEROP_GAS_LIMIT);
|
|
353
355
|
executionPayload.timestamp = payloadAttributes.timestamp;
|
|
354
|
-
executionPayload.blockHash = crypto.randomBytes(32);
|
|
355
356
|
const transactions: Uint8Array[] = [];
|
|
356
357
|
|
|
357
358
|
// Between 0 and 4 transactions for all forks
|
|
@@ -401,6 +402,15 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
401
402
|
(executionPayload as gloas.ExecutionPayload).slotNumber = payloadAttributes.slotNumber;
|
|
402
403
|
}
|
|
403
404
|
|
|
405
|
+
const executionRequests = isForkPostElectra(fork) ? sszTypesFor(fork).ExecutionRequests.defaultValue() : null;
|
|
406
|
+
|
|
407
|
+
executionPayload.blockHash = computeExecutionBlockHash(
|
|
408
|
+
fork,
|
|
409
|
+
executionPayload,
|
|
410
|
+
payloadAttributes.parentBeaconBlockRoot ?? null,
|
|
411
|
+
executionRequests
|
|
412
|
+
);
|
|
413
|
+
|
|
404
414
|
this.preparingPayloads.set(payloadId, {
|
|
405
415
|
executionPayload: serializeExecutionPayload(fork, executionPayload),
|
|
406
416
|
blobsBundle: serializeBlobsBundle({
|
|
@@ -408,12 +418,7 @@ export class ExecutionEngineMockBackend implements JsonRpcBackend {
|
|
|
408
418
|
blobs,
|
|
409
419
|
proofs,
|
|
410
420
|
}),
|
|
411
|
-
executionRequests: serializeExecutionRequests(
|
|
412
|
-
fork,
|
|
413
|
-
ForkSeq[fork] >= ForkSeq.gloas
|
|
414
|
-
? ssz.gloas.ExecutionRequests.defaultValue()
|
|
415
|
-
: ssz.electra.ExecutionRequests.defaultValue()
|
|
416
|
-
),
|
|
421
|
+
executionRequests: executionRequests !== null ? serializeExecutionRequests(fork, executionRequests) : [],
|
|
417
422
|
});
|
|
418
423
|
|
|
419
424
|
// IF the payload is deemed VALID and the build process has begun
|
|
@@ -12,6 +12,9 @@ const MAX_PAYLOAD_IDS = SLOTS_PER_EPOCH;
|
|
|
12
12
|
// Since we do no processing with this id, we have no need to deserialize it
|
|
13
13
|
export type PayloadId = string;
|
|
14
14
|
|
|
15
|
+
/** Payload id returned by the engine and when the payload was requested from it, monotonic `performance.now()` ms */
|
|
16
|
+
export type PreparedPayloadId = {payloadId: PayloadId; preparedAtMs: number};
|
|
17
|
+
|
|
15
18
|
export type WithdrawalV1 = {
|
|
16
19
|
index: QUANTITY;
|
|
17
20
|
validatorIndex: QUANTITY;
|
|
@@ -26,7 +29,7 @@ type FcuAttributes = {headBlockHash: DATA} & Omit<PayloadAttributesRpc, "withdra
|
|
|
26
29
|
export class PayloadIdCache {
|
|
27
30
|
private readonly payloadIdByFcuAttributes = new Map<
|
|
28
31
|
string,
|
|
29
|
-
|
|
32
|
+
PreparedPayloadId & {fullKey: string; inclusionListTransactions?: bellatrix.Transactions}
|
|
30
33
|
>();
|
|
31
34
|
|
|
32
35
|
getFullKey({headBlockHash, timestamp, prevRandao, suggestedFeeRecipient}: FcuAttributes): string {
|
|
@@ -45,7 +48,12 @@ export class PayloadIdCache {
|
|
|
45
48
|
const key = this.getKey(fcuAttributes);
|
|
46
49
|
const fullKey = this.getFullKey(fcuAttributes);
|
|
47
50
|
const {inclusionListTransactions} = fcuAttributes;
|
|
48
|
-
this.payloadIdByFcuAttributes.set(key, {
|
|
51
|
+
this.payloadIdByFcuAttributes.set(key, {
|
|
52
|
+
payloadId,
|
|
53
|
+
preparedAtMs: performance.now(),
|
|
54
|
+
fullKey,
|
|
55
|
+
inclusionListTransactions,
|
|
56
|
+
});
|
|
49
57
|
}
|
|
50
58
|
|
|
51
59
|
prune(): void {
|
|
@@ -53,13 +61,13 @@ export class PayloadIdCache {
|
|
|
53
61
|
pruneSetToMax(this.payloadIdByFcuAttributes, MAX_PAYLOAD_IDS);
|
|
54
62
|
}
|
|
55
63
|
|
|
56
|
-
get(fcuAttributes: FcuAttributes):
|
|
64
|
+
get(fcuAttributes: FcuAttributes): PreparedPayloadId | undefined {
|
|
57
65
|
const key = this.getKey(fcuAttributes);
|
|
58
66
|
const fullKey = this.getFullKey(fcuAttributes);
|
|
59
67
|
const payloadInfo = this.payloadIdByFcuAttributes.get(key);
|
|
60
68
|
return payloadInfo?.fullKey === fullKey &&
|
|
61
69
|
isSameInclusionList(payloadInfo.inclusionListTransactions, fcuAttributes.inclusionListTransactions)
|
|
62
|
-
? payloadInfo.payloadId
|
|
70
|
+
? {payloadId: payloadInfo.payloadId, preparedAtMs: payloadInfo.preparedAtMs}
|
|
63
71
|
: undefined;
|
|
64
72
|
}
|
|
65
73
|
}
|