@lodestar/beacon-node 1.47.0-dev.6325e4e1fe → 1.47.0-dev.6585f8e881

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.
@@ -908,6 +908,22 @@ export function createLodestarMetrics(
908
908
  labelNames: ["error"],
909
909
  }),
910
910
  },
911
+ gossipExecutionPayloadBid: {
912
+ elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
913
+ name: "lodestar_gossip_execution_payload_bid_elapsed_time_till_received_seconds",
914
+ help: "Time elapsed between the bid's slot start and the time the execution payload bid was received (negative = received before its slot, broadcast in the previous slot; positive = received during its own slot, late)",
915
+ labelNames: ["source"],
916
+ buckets: [-6, -3, -1, 0, 3],
917
+ }),
918
+ },
919
+ gossipPayloadAttestationMessage: {
920
+ elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
921
+ name: "lodestar_gossip_payload_attestation_message_elapsed_time_till_received_seconds",
922
+ help: "Time elapsed between slot time and the time the payload attestation message was received",
923
+ labelNames: ["source"],
924
+ buckets: [3, 6, 9, 12],
925
+ }),
926
+ },
911
927
  // recovery in the case of specific blob rows required
912
928
  recoverBlobSidecars: {
913
929
  blobsReconstructed: register.counter({
@@ -1255,11 +1255,15 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
1255
1255
  [GossipType.payload_attestation_message]: async ({
1256
1256
  gossipData,
1257
1257
  topic,
1258
+ seenTimestampSec,
1258
1259
  }: GossipHandlerParamGeneric<GossipType.payload_attestation_message>) => {
1259
1260
  const {serializedData} = gossipData;
1260
1261
  const payloadAttestationMessage = sszDeserialize(topic, serializedData);
1261
1262
  const validationResult = await validateGossipPayloadAttestationMessage(chain, payloadAttestationMessage);
1262
1263
 
1264
+ const delaySec = chain.clock.secFromSlot(payloadAttestationMessage.data.slot, seenTimestampSec);
1265
+ metrics?.gossipPayloadAttestationMessage.elapsedTimeTillReceived.observe({source: OpSource.gossip}, delaySec);
1266
+
1263
1267
  try {
1264
1268
  const insertOutcome = chain.payloadAttestationPool.add(
1265
1269
  payloadAttestationMessage,
@@ -1286,11 +1290,16 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
1286
1290
  [GossipType.execution_payload_bid]: async ({
1287
1291
  gossipData,
1288
1292
  topic,
1293
+ seenTimestampSec,
1289
1294
  }: GossipHandlerParamGeneric<GossipType.execution_payload_bid>) => {
1290
1295
  const {serializedData} = gossipData;
1291
1296
  const executionPayloadBid = sszDeserialize(topic, serializedData);
1292
1297
  const {proposerIndex} = await validateGossipExecutionPayloadBid(chain, executionPayloadBid);
1293
1298
 
1299
+ // this could be negative, because it's most likely the bid of next slot comes at this clock slot
1300
+ const elapsedSec = chain.clock.secFromSlot(executionPayloadBid.message.slot, seenTimestampSec);
1301
+ metrics?.gossipExecutionPayloadBid.elapsedTimeTillReceived.observe({source: OpSource.gossip}, elapsedSec);
1302
+
1294
1303
  // Handle valid payload bid by storing in a bid pool
1295
1304
  try {
1296
1305
  const insertOutcome = chain.executionPayloadBidPool.add(executionPayloadBid);