@lodestar/beacon-node 1.52.0-dev.a9e15e2b94 → 1.52.0-dev.b1d1e990d9
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 +63 -39
- package/lib/api/impl/beacon/blocks/index.js.map +1 -1
- package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
- package/lib/api/impl/beacon/pool/index.js +3 -1
- package/lib/api/impl/beacon/pool/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 +6 -4
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/blocks/index.d.ts.map +1 -1
- package/lib/chain/blocks/index.js +3 -16
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +12 -11
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
- package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js +2 -1
- package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
- package/lib/chain/bls/utils.js +1 -1
- package/lib/chain/bls/utils.js.map +1 -1
- package/lib/chain/chain.d.ts +3 -3
- package/lib/chain/chain.d.ts.map +1 -1
- package/lib/chain/chain.js +53 -24
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +3 -2
- package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/errors/executionPayloadBid.js +1 -1
- package/lib/chain/errors/executionPayloadBid.js.map +1 -1
- package/lib/chain/interface.d.ts +1 -1
- package/lib/chain/interface.d.ts.map +1 -1
- package/lib/chain/opPools/inclusionListStore.d.ts +4 -1
- package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -1
- package/lib/chain/opPools/inclusionListStore.js +5 -2
- package/lib/chain/opPools/inclusionListStore.js.map +1 -1
- package/lib/chain/opPools/opPool.js +6 -6
- package/lib/chain/opPools/opPool.js.map +1 -1
- package/lib/chain/options.js +1 -1
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +13 -4
- package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
- package/lib/chain/seenCache/seenExecutionPayloadBids.js +13 -12
- package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -1
- package/lib/chain/shufflingCache.d.ts +5 -0
- package/lib/chain/shufflingCache.d.ts.map +1 -1
- package/lib/chain/shufflingCache.js +39 -1
- package/lib/chain/shufflingCache.js.map +1 -1
- package/lib/chain/validation/aggregateAndProof.d.ts.map +1 -1
- package/lib/chain/validation/aggregateAndProof.js +13 -2
- package/lib/chain/validation/aggregateAndProof.js.map +1 -1
- package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
- package/lib/chain/validation/executionPayloadBid.js +30 -40
- package/lib/chain/validation/executionPayloadBid.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +9 -0
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/chain/validatorMonitor.js +43 -43
- package/lib/chain/validatorMonitor.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +2 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +9 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +1 -7
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/gossip/topic.js +0 -13
- package/lib/network/gossip/topic.js.map +1 -1
- package/lib/network/network.d.ts +1 -0
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +20 -11
- package/lib/network/network.js.map +1 -1
- package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
- package/lib/network/processor/gossipHandlers.js +8 -4
- package/lib/network/processor/gossipHandlers.js.map +1 -1
- package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
- package/lib/network/processor/gossipValidatorFn.js +4 -1
- package/lib/network/processor/gossipValidatorFn.js.map +1 -1
- package/lib/network/reqresp/utils/collect.d.ts +4 -4
- package/lib/network/reqresp/utils/collect.d.ts.map +1 -1
- package/lib/network/reqresp/utils/collect.js +9 -8
- package/lib/network/reqresp/utils/collect.js.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts.map +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +2 -2
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +2 -1
- package/lib/sync/unknownBlock.js.map +1 -1
- package/package.json +16 -16
- package/src/api/impl/beacon/blocks/index.ts +74 -47
- package/src/api/impl/beacon/pool/index.ts +9 -7
- 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 +6 -3
- package/src/chain/blocks/index.ts +3 -30
- package/src/chain/blocks/verifyBlock.ts +14 -10
- package/src/chain/blocks/verifyBlocksSignatures.ts +3 -0
- package/src/chain/bls/utils.ts +1 -1
- package/src/chain/chain.ts +81 -40
- package/src/chain/errors/executionPayloadBid.ts +3 -2
- package/src/chain/interface.ts +1 -1
- package/src/chain/opPools/inclusionListStore.ts +5 -2
- package/src/chain/opPools/opPool.ts +6 -6
- package/src/chain/options.ts +1 -1
- package/src/chain/seenCache/seenExecutionPayloadBids.ts +35 -15
- package/src/chain/shufflingCache.ts +40 -1
- package/src/chain/validation/aggregateAndProof.ts +19 -5
- package/src/chain/validation/executionPayloadBid.ts +40 -42
- package/src/chain/validation/payloadAttestationMessage.ts +10 -0
- package/src/chain/validatorMonitor.ts +43 -43
- package/src/metrics/metrics/lodestar.ts +9 -0
- package/src/network/gossip/topic.ts +1 -14
- package/src/network/network.ts +33 -11
- package/src/network/processor/gossipHandlers.ts +14 -10
- package/src/network/processor/gossipValidatorFn.ts +4 -0
- package/src/network/reqresp/utils/collect.ts +16 -8
- package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +3 -2
- package/src/sync/unknownBlock.ts +2 -1
|
@@ -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],
|
|
@@ -1784,6 +1784,15 @@ export function createLodestarMetrics(
|
|
|
1784
1784
|
help: "Time from promise insertion until promise resolution when shuffling was ready in seconds",
|
|
1785
1785
|
buckets: [0.5, 1, 1.5, 2],
|
|
1786
1786
|
}),
|
|
1787
|
+
committeePubkeysComputeTime: register.histogram({
|
|
1788
|
+
name: "lodestar_shuffling_cache_committee_pubkeys_compute_seconds",
|
|
1789
|
+
help: "Time to aggregate the committee pubkeys of a shuffling off the main thread in seconds",
|
|
1790
|
+
buckets: [0.1, 0.25, 0.5, 1, 2, 5],
|
|
1791
|
+
}),
|
|
1792
|
+
committeePubkeysErrors: register.counter({
|
|
1793
|
+
name: "lodestar_shuffling_cache_committee_pubkeys_errors_total",
|
|
1794
|
+
help: "Total number of shufflings whose committee pubkeys could not be computed",
|
|
1795
|
+
}),
|
|
1787
1796
|
},
|
|
1788
1797
|
|
|
1789
1798
|
seenCache: {
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
isForkPostGloas,
|
|
13
13
|
} from "@lodestar/params";
|
|
14
14
|
import {TypeSizes} from "@lodestar/reqresp";
|
|
15
|
-
import {
|
|
15
|
+
import {SingleAttestation, ssz, sszTypesFor} from "@lodestar/types";
|
|
16
16
|
import {GossipAction, GossipActionError, GossipErrorCode} from "../../chain/errors/gossipValidation.js";
|
|
17
17
|
import {computeMaxGloasDataColumnSidecarSize} from "../../util/sszBytes.js";
|
|
18
18
|
import {NetworkConfig} from "../networkConfig.js";
|
|
@@ -173,19 +173,6 @@ export function sszDeserialize<T extends GossipTopic>(topic: T, serializedData:
|
|
|
173
173
|
}
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
/**
|
|
177
|
-
* @deprecated
|
|
178
|
-
* Deserialize a gossip serialized data into an Attestation object.
|
|
179
|
-
* No longer used post-electra. Use `sszDeserializeSingleAttestation` instead
|
|
180
|
-
*/
|
|
181
|
-
export function sszDeserializeAttestation(fork: ForkName, serializedData: Uint8Array): Attestation {
|
|
182
|
-
try {
|
|
183
|
-
return sszTypesFor(fork).Attestation.deserialize(serializedData);
|
|
184
|
-
} catch (_e) {
|
|
185
|
-
throw new GossipActionError(GossipAction.REJECT, {code: GossipErrorCode.INVALID_SERIALIZED_BYTES_ERROR_CODE});
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
|
|
189
176
|
/**
|
|
190
177
|
* Deserialize a gossip seralized data into an SingleAttestation object.
|
|
191
178
|
*/
|
package/src/network/network.ts
CHANGED
|
@@ -596,7 +596,8 @@ export class Network implements INetwork {
|
|
|
596
596
|
request
|
|
597
597
|
),
|
|
598
598
|
request,
|
|
599
|
-
this.chain.serializedCache
|
|
599
|
+
this.chain.serializedCache,
|
|
600
|
+
() => this.reportInvalidResponse(peerId)
|
|
600
601
|
);
|
|
601
602
|
}
|
|
602
603
|
|
|
@@ -611,7 +612,8 @@ export class Network implements INetwork {
|
|
|
611
612
|
),
|
|
612
613
|
request.length,
|
|
613
614
|
responseSszTypeByMethod[ReqRespMethod.BeaconBlocksByRoot],
|
|
614
|
-
this.chain.serializedCache
|
|
615
|
+
this.chain.serializedCache,
|
|
616
|
+
() => this.reportInvalidResponse(peerId)
|
|
615
617
|
);
|
|
616
618
|
}
|
|
617
619
|
|
|
@@ -623,28 +625,32 @@ export class Network implements INetwork {
|
|
|
623
625
|
this.sendReqRespRequest(peerId, ReqRespMethod.BeaconBlocksByHead, [Version.V1], request),
|
|
624
626
|
Math.min(request.count, this.config.MAX_REQUEST_BLOCKS_DENEB),
|
|
625
627
|
responseSszTypeByMethod[ReqRespMethod.BeaconBlocksByHead],
|
|
626
|
-
this.chain.serializedCache
|
|
628
|
+
this.chain.serializedCache,
|
|
629
|
+
() => this.reportInvalidResponse(peerId)
|
|
627
630
|
);
|
|
628
631
|
}
|
|
629
632
|
|
|
630
633
|
async sendLightClientBootstrap(peerId: PeerIdStr, request: Root): Promise<LightClientBootstrap> {
|
|
631
634
|
return collectExactOneTyped(
|
|
632
635
|
this.sendReqRespRequest(peerId, ReqRespMethod.LightClientBootstrap, [Version.V1], request),
|
|
633
|
-
responseSszTypeByMethod[ReqRespMethod.LightClientBootstrap]
|
|
636
|
+
responseSszTypeByMethod[ReqRespMethod.LightClientBootstrap],
|
|
637
|
+
() => this.reportInvalidResponse(peerId)
|
|
634
638
|
);
|
|
635
639
|
}
|
|
636
640
|
|
|
637
641
|
async sendLightClientOptimisticUpdate(peerId: PeerIdStr): Promise<LightClientOptimisticUpdate> {
|
|
638
642
|
return collectExactOneTyped(
|
|
639
643
|
this.sendReqRespRequest(peerId, ReqRespMethod.LightClientOptimisticUpdate, [Version.V1], null),
|
|
640
|
-
responseSszTypeByMethod[ReqRespMethod.LightClientOptimisticUpdate]
|
|
644
|
+
responseSszTypeByMethod[ReqRespMethod.LightClientOptimisticUpdate],
|
|
645
|
+
() => this.reportInvalidResponse(peerId)
|
|
641
646
|
);
|
|
642
647
|
}
|
|
643
648
|
|
|
644
649
|
async sendLightClientFinalityUpdate(peerId: PeerIdStr): Promise<LightClientFinalityUpdate> {
|
|
645
650
|
return collectExactOneTyped(
|
|
646
651
|
this.sendReqRespRequest(peerId, ReqRespMethod.LightClientFinalityUpdate, [Version.V1], null),
|
|
647
|
-
responseSszTypeByMethod[ReqRespMethod.LightClientFinalityUpdate]
|
|
652
|
+
responseSszTypeByMethod[ReqRespMethod.LightClientFinalityUpdate],
|
|
653
|
+
() => this.reportInvalidResponse(peerId)
|
|
648
654
|
);
|
|
649
655
|
}
|
|
650
656
|
|
|
@@ -655,7 +661,9 @@ export class Network implements INetwork {
|
|
|
655
661
|
return collectMaxResponseTyped(
|
|
656
662
|
this.sendReqRespRequest(peerId, ReqRespMethod.LightClientUpdatesByRange, [Version.V1], request),
|
|
657
663
|
request.count,
|
|
658
|
-
responseSszTypeByMethod[ReqRespMethod.LightClientUpdatesByRange]
|
|
664
|
+
responseSszTypeByMethod[ReqRespMethod.LightClientUpdatesByRange],
|
|
665
|
+
undefined,
|
|
666
|
+
() => this.reportInvalidResponse(peerId)
|
|
659
667
|
);
|
|
660
668
|
}
|
|
661
669
|
|
|
@@ -666,7 +674,9 @@ export class Network implements INetwork {
|
|
|
666
674
|
return collectMaxResponseTyped(
|
|
667
675
|
this.sendReqRespRequest(peerId, ReqRespMethod.DataColumnSidecarsByRange, [Version.V1], request),
|
|
668
676
|
request.count * request.columns.length,
|
|
669
|
-
responseSszTypeByMethod[ReqRespMethod.DataColumnSidecarsByRange]
|
|
677
|
+
responseSszTypeByMethod[ReqRespMethod.DataColumnSidecarsByRange],
|
|
678
|
+
undefined,
|
|
679
|
+
() => this.reportInvalidResponse(peerId)
|
|
670
680
|
);
|
|
671
681
|
}
|
|
672
682
|
|
|
@@ -678,7 +688,8 @@ export class Network implements INetwork {
|
|
|
678
688
|
this.sendReqRespRequest(peerId, ReqRespMethod.DataColumnSidecarsByRoot, [Version.V1], request),
|
|
679
689
|
request.reduce((total, {columns}) => total + columns.length, 0),
|
|
680
690
|
responseSszTypeByMethod[ReqRespMethod.DataColumnSidecarsByRoot],
|
|
681
|
-
this.chain.serializedCache
|
|
691
|
+
this.chain.serializedCache,
|
|
692
|
+
() => this.reportInvalidResponse(peerId)
|
|
682
693
|
);
|
|
683
694
|
}
|
|
684
695
|
|
|
@@ -689,7 +700,9 @@ export class Network implements INetwork {
|
|
|
689
700
|
return collectMaxResponseTyped(
|
|
690
701
|
this.sendReqRespRequest(peerId, ReqRespMethod.ExecutionPayloadEnvelopesByRange, [Version.V1], request),
|
|
691
702
|
request.count,
|
|
692
|
-
responseSszTypeByMethod[ReqRespMethod.ExecutionPayloadEnvelopesByRange]
|
|
703
|
+
responseSszTypeByMethod[ReqRespMethod.ExecutionPayloadEnvelopesByRange],
|
|
704
|
+
undefined,
|
|
705
|
+
() => this.reportInvalidResponse(peerId)
|
|
693
706
|
);
|
|
694
707
|
}
|
|
695
708
|
|
|
@@ -701,10 +714,19 @@ export class Network implements INetwork {
|
|
|
701
714
|
this.sendReqRespRequest(peerId, ReqRespMethod.ExecutionPayloadEnvelopesByRoot, [Version.V1], request),
|
|
702
715
|
request.length,
|
|
703
716
|
responseSszTypeByMethod[ReqRespMethod.ExecutionPayloadEnvelopesByRoot],
|
|
704
|
-
this.chain.serializedCache
|
|
717
|
+
this.chain.serializedCache,
|
|
718
|
+
() => this.reportInvalidResponse(peerId)
|
|
705
719
|
);
|
|
706
720
|
}
|
|
707
721
|
|
|
722
|
+
private async reportInvalidResponse(peerId: PeerIdStr): Promise<void> {
|
|
723
|
+
try {
|
|
724
|
+
await this.core.reportPeer(peerId, PeerAction.LowToleranceError, "InvalidResponseSsz");
|
|
725
|
+
} catch (error) {
|
|
726
|
+
this.logger.debug("Failed to report invalid response", {peerId}, error as Error);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
|
|
708
730
|
private sendReqRespRequest<Req>(
|
|
709
731
|
peerId: PeerIdStr,
|
|
710
732
|
method: ReqRespMethod,
|
|
@@ -1301,13 +1301,16 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1301
1301
|
}
|
|
1302
1302
|
}
|
|
1303
1303
|
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1304
|
+
// Gossip accepts adjacent slots within the clock disparity but fork choice only counts the current slot
|
|
1305
|
+
if (payloadAttestationMessage.data.slot === chain.clock.currentSlot) {
|
|
1306
|
+
chain.forkChoice.notifyPtcMessages(
|
|
1307
|
+
toRootHex(payloadAttestationMessage.data.beaconBlockRoot),
|
|
1308
|
+
payloadAttestationMessage.data.slot,
|
|
1309
|
+
validationResult.validatorCommitteeIndices,
|
|
1310
|
+
payloadAttestationMessage.data.payloadPresent,
|
|
1311
|
+
payloadAttestationMessage.data.blobDataAvailable
|
|
1312
|
+
);
|
|
1313
|
+
}
|
|
1311
1314
|
|
|
1312
1315
|
chain.emitter.emit(routes.events.EventType.payloadAttestationMessage, {
|
|
1313
1316
|
version: config.getForkName(payloadAttestationMessage.data.slot),
|
|
@@ -1422,12 +1425,13 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
|
|
|
1422
1425
|
try {
|
|
1423
1426
|
metrics?.inclusionListsValid.inc({source: InclusionListSource.gossip});
|
|
1424
1427
|
metrics?.inclusionListsValidSize.inc(totalBytes);
|
|
1425
|
-
//
|
|
1426
|
-
//
|
|
1428
|
+
// A list received before its slot within clock disparity is timely, the spec delays it until the slot
|
|
1429
|
+
// starts. Bounded on receipt time as validation checks the slot after queueing. Late lists are untimely
|
|
1427
1430
|
const secFromSlot = chain.clock.secFromSlot(slot, seenTimestampSec);
|
|
1428
1431
|
metrics?.inclusionListArrivalTime.observe(secFromSlot);
|
|
1429
1432
|
const isTimely =
|
|
1430
|
-
secFromSlot
|
|
1433
|
+
secFromSlot * 1000 >= -config.MAXIMUM_GOSSIP_CLOCK_DISPARITY &&
|
|
1434
|
+
secFromSlot * 1000 < config.getInclusionListDueMs(config.getForkName(slot));
|
|
1431
1435
|
|
|
1432
1436
|
const insertOutcome = chain.inclusionListStore.process(signedInclusionList, committeeIndices, isTimely);
|
|
1433
1437
|
metrics?.inclusionListStore.insertOutcome.inc({insertOutcome});
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
ExecutionPayloadEnvelopeErrorCode,
|
|
13
13
|
GossipAction,
|
|
14
14
|
GossipActionError,
|
|
15
|
+
GossipErrorCode,
|
|
15
16
|
InclusionListErrorCode,
|
|
16
17
|
PayloadAttestationErrorCode,
|
|
17
18
|
ProposerPreferencesErrorCode,
|
|
@@ -116,6 +117,9 @@ const gossipRejectPeerAction: Record<GossipType, RejectPeerActionRule> = {
|
|
|
116
117
|
};
|
|
117
118
|
|
|
118
119
|
export function rejectPeerAction(type: GossipType, code: string): PeerAction {
|
|
120
|
+
if (code === GossipErrorCode.INVALID_SERIALIZED_BYTES_ERROR_CODE) {
|
|
121
|
+
return PeerAction.LowToleranceError;
|
|
122
|
+
}
|
|
119
123
|
const rule = gossipRejectPeerAction[type];
|
|
120
124
|
return rule.byCode?.[code] ?? rule.default;
|
|
121
125
|
}
|
|
@@ -12,11 +12,12 @@ import {ResponseTypeGetter} from "../types.js";
|
|
|
12
12
|
*/
|
|
13
13
|
export async function collectExactOneTyped<T>(
|
|
14
14
|
source: AsyncIterable<ResponseIncoming>,
|
|
15
|
-
typeFn: ResponseTypeGetter<T
|
|
15
|
+
typeFn: ResponseTypeGetter<T>,
|
|
16
|
+
onInvalidResponse?: (chunk: ResponseIncoming) => void
|
|
16
17
|
): Promise<T> {
|
|
17
18
|
for await (const chunk of source) {
|
|
18
19
|
const type = typeFn(chunk.fork, chunk.protocolVersion);
|
|
19
|
-
const response = sszDeserializeResponse(type, chunk
|
|
20
|
+
const response = sszDeserializeResponse(type, chunk, onInvalidResponse);
|
|
20
21
|
return response;
|
|
21
22
|
}
|
|
22
23
|
throw new RequestError({code: RequestErrorCode.EMPTY_RESPONSE});
|
|
@@ -33,13 +34,14 @@ export async function collectMaxResponseTyped<T>(
|
|
|
33
34
|
source: AsyncIterable<ResponseIncoming>,
|
|
34
35
|
maxResponses: number,
|
|
35
36
|
typeFn: ResponseTypeGetter<T>,
|
|
36
|
-
serializedCache?: SerializedCache
|
|
37
|
+
serializedCache?: SerializedCache,
|
|
38
|
+
onInvalidResponse?: (chunk: ResponseIncoming) => void
|
|
37
39
|
): Promise<T[]> {
|
|
38
40
|
// else: zero or more responses
|
|
39
41
|
const responses: T[] = [];
|
|
40
42
|
for await (const chunk of source) {
|
|
41
43
|
const type = typeFn(chunk.fork, chunk.protocolVersion);
|
|
42
|
-
const response = sszDeserializeResponse(type, chunk
|
|
44
|
+
const response = sszDeserializeResponse(type, chunk, onInvalidResponse);
|
|
43
45
|
// optionally cache the serialized response if the cache is available
|
|
44
46
|
serializedCache?.set(response as object, chunk.data);
|
|
45
47
|
responses.push(response);
|
|
@@ -62,13 +64,14 @@ export async function collectMaxResponseTypedWithBytes<T>(
|
|
|
62
64
|
source: AsyncIterable<ResponseIncoming>,
|
|
63
65
|
maxResponses: number,
|
|
64
66
|
typeFn: ResponseTypeGetter<T>,
|
|
65
|
-
serializedCache?: SerializedCache
|
|
67
|
+
serializedCache?: SerializedCache,
|
|
68
|
+
onInvalidResponse?: (chunk: ResponseIncoming) => void
|
|
66
69
|
): Promise<T[]> {
|
|
67
70
|
// else: zero or more responses
|
|
68
71
|
const responses: T[] = [];
|
|
69
72
|
for await (const chunk of source) {
|
|
70
73
|
const type = typeFn(chunk.fork, chunk.protocolVersion);
|
|
71
|
-
const data = sszDeserializeResponse(type, chunk
|
|
74
|
+
const data = sszDeserializeResponse(type, chunk, onInvalidResponse);
|
|
72
75
|
responses.push(data);
|
|
73
76
|
// optionally cache the serialized response if the cache is available
|
|
74
77
|
serializedCache?.set(data as object, chunk.data);
|
|
@@ -81,10 +84,15 @@ export async function collectMaxResponseTypedWithBytes<T>(
|
|
|
81
84
|
}
|
|
82
85
|
|
|
83
86
|
/** Light wrapper on type to wrap deserialize errors */
|
|
84
|
-
export function sszDeserializeResponse<T>(
|
|
87
|
+
export function sszDeserializeResponse<T>(
|
|
88
|
+
type: Type<T>,
|
|
89
|
+
chunk: ResponseIncoming,
|
|
90
|
+
onInvalidResponse?: (chunk: ResponseIncoming) => void
|
|
91
|
+
): T {
|
|
85
92
|
try {
|
|
86
|
-
return type.deserialize(
|
|
93
|
+
return type.deserialize(chunk.data);
|
|
87
94
|
} catch (e) {
|
|
95
|
+
onInvalidResponse?.(chunk);
|
|
88
96
|
throw new RequestError({code: RequestErrorCode.INVALID_RESPONSE_SSZ, errorMessage: (e as Error).message});
|
|
89
97
|
}
|
|
90
98
|
}
|
|
@@ -12,13 +12,14 @@ import {sszDeserializeResponse} from "./collect.js";
|
|
|
12
12
|
export async function collectSequentialBlocksInRange(
|
|
13
13
|
blockStream: AsyncIterable<ResponseIncoming>,
|
|
14
14
|
{count, startSlot}: Pick<phase0.BeaconBlocksByRangeRequest, "count" | "startSlot">,
|
|
15
|
-
serializedCache?: SerializedCache
|
|
15
|
+
serializedCache?: SerializedCache,
|
|
16
|
+
onInvalidResponse?: (chunk: ResponseIncoming) => void
|
|
16
17
|
): Promise<SignedBeaconBlock[]> {
|
|
17
18
|
const blocks: SignedBeaconBlock[] = [];
|
|
18
19
|
|
|
19
20
|
for await (const chunk of blockStream) {
|
|
20
21
|
const blockType = responseSszTypeByMethod[ReqRespMethod.BeaconBlocksByRange](chunk.fork, chunk.protocolVersion);
|
|
21
|
-
const block = sszDeserializeResponse(blockType, chunk
|
|
22
|
+
const block = sszDeserializeResponse(blockType, chunk, onInvalidResponse);
|
|
22
23
|
|
|
23
24
|
const blockSlot = block.message.slot;
|
|
24
25
|
|
package/src/sync/unknownBlock.ts
CHANGED
|
@@ -376,7 +376,8 @@ export class BlockInputSync {
|
|
|
376
376
|
// because the payload at the finalized block is not finalized
|
|
377
377
|
const finalizedSlot = this.chain.forkChoice.getFinalizedBlock().slot;
|
|
378
378
|
const nowSec = Date.now() / 1000;
|
|
379
|
-
const
|
|
379
|
+
const slotDurationMs = this.config.getSlotDurationMs(this.config.getForkName(this.chain.clock.currentSlot));
|
|
380
|
+
const maxSecInCache = (PRUNE_UNRESOLVED_SLOT_EPOCHS * SLOTS_PER_EPOCH * slotDurationMs) / 1000;
|
|
380
381
|
|
|
381
382
|
let belowFinalizedPayloads = 0;
|
|
382
383
|
let agedOutPayloads = 0;
|