@lodestar/beacon-node 1.52.0-dev.6ab73fec0a → 1.52.0-dev.7dd7051260

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.
Files changed (160) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +63 -39
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/api/impl/beacon/pool/index.d.ts.map +1 -1
  5. package/lib/api/impl/beacon/pool/index.js +3 -1
  6. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  7. package/lib/api/impl/beacon/state/utils.d.ts.map +1 -1
  8. package/lib/api/impl/beacon/state/utils.js +2 -1
  9. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  10. package/lib/api/impl/debug/index.d.ts.map +1 -1
  11. package/lib/api/impl/debug/index.js +6 -2
  12. package/lib/api/impl/debug/index.js.map +1 -1
  13. package/lib/api/impl/validator/index.d.ts.map +1 -1
  14. package/lib/api/impl/validator/index.js +6 -4
  15. package/lib/api/impl/validator/index.js.map +1 -1
  16. package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
  17. package/lib/chain/blocks/blockInput/blockInput.js +3 -1
  18. package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
  19. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  20. package/lib/chain/blocks/importExecutionPayload.js +17 -3
  21. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  22. package/lib/chain/blocks/index.d.ts.map +1 -1
  23. package/lib/chain/blocks/index.js +3 -16
  24. package/lib/chain/blocks/index.js.map +1 -1
  25. package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
  26. package/lib/chain/blocks/verifyBlock.js +21 -17
  27. package/lib/chain/blocks/verifyBlock.js.map +1 -1
  28. package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts +2 -2
  29. package/lib/chain/blocks/verifyBlocksDataAvailability.d.ts.map +1 -1
  30. package/lib/chain/blocks/verifyBlocksDataAvailability.js +3 -3
  31. package/lib/chain/blocks/verifyBlocksDataAvailability.js.map +1 -1
  32. package/lib/chain/blocks/verifyBlocksExecutionPayloads.d.ts.map +1 -1
  33. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js +7 -5
  34. package/lib/chain/blocks/verifyBlocksExecutionPayloads.js.map +1 -1
  35. package/lib/chain/blocks/verifyBlocksSignatures.d.ts +2 -2
  36. package/lib/chain/blocks/verifyBlocksSignatures.d.ts.map +1 -1
  37. package/lib/chain/blocks/verifyBlocksSignatures.js +2 -1
  38. package/lib/chain/blocks/verifyBlocksSignatures.js.map +1 -1
  39. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +2 -2
  40. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
  41. package/lib/chain/blocks/verifyPayloadsDataAvailability.js +3 -3
  42. package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
  43. package/lib/chain/bls/utils.js +1 -1
  44. package/lib/chain/bls/utils.js.map +1 -1
  45. package/lib/chain/chain.d.ts +3 -3
  46. package/lib/chain/chain.d.ts.map +1 -1
  47. package/lib/chain/chain.js +53 -24
  48. package/lib/chain/chain.js.map +1 -1
  49. package/lib/chain/errors/executionPayloadBid.d.ts +3 -2
  50. package/lib/chain/errors/executionPayloadBid.d.ts.map +1 -1
  51. package/lib/chain/errors/executionPayloadBid.js +1 -1
  52. package/lib/chain/errors/executionPayloadBid.js.map +1 -1
  53. package/lib/chain/forkChoice/index.d.ts +1 -4
  54. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  55. package/lib/chain/forkChoice/index.js +1 -4
  56. package/lib/chain/forkChoice/index.js.map +1 -1
  57. package/lib/chain/forkChoiceExecutionEngine.d.ts +5 -3
  58. package/lib/chain/forkChoiceExecutionEngine.d.ts.map +1 -1
  59. package/lib/chain/forkChoiceExecutionEngine.js +34 -11
  60. package/lib/chain/forkChoiceExecutionEngine.js.map +1 -1
  61. package/lib/chain/interface.d.ts +1 -1
  62. package/lib/chain/interface.d.ts.map +1 -1
  63. package/lib/chain/opPools/inclusionListStore.d.ts +4 -1
  64. package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -1
  65. package/lib/chain/opPools/inclusionListStore.js +5 -2
  66. package/lib/chain/opPools/inclusionListStore.js.map +1 -1
  67. package/lib/chain/opPools/opPool.js +6 -6
  68. package/lib/chain/opPools/opPool.js.map +1 -1
  69. package/lib/chain/options.js +1 -1
  70. package/lib/chain/options.js.map +1 -1
  71. package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts +13 -4
  72. package/lib/chain/seenCache/seenExecutionPayloadBids.d.ts.map +1 -1
  73. package/lib/chain/seenCache/seenExecutionPayloadBids.js +13 -12
  74. package/lib/chain/seenCache/seenExecutionPayloadBids.js.map +1 -1
  75. package/lib/chain/shufflingCache.d.ts +5 -0
  76. package/lib/chain/shufflingCache.d.ts.map +1 -1
  77. package/lib/chain/shufflingCache.js +39 -1
  78. package/lib/chain/shufflingCache.js.map +1 -1
  79. package/lib/chain/validation/aggregateAndProof.d.ts.map +1 -1
  80. package/lib/chain/validation/aggregateAndProof.js +13 -2
  81. package/lib/chain/validation/aggregateAndProof.js.map +1 -1
  82. package/lib/chain/validation/dataColumnSidecar.d.ts.map +1 -1
  83. package/lib/chain/validation/dataColumnSidecar.js +8 -1
  84. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  85. package/lib/chain/validation/executionPayloadBid.d.ts.map +1 -1
  86. package/lib/chain/validation/executionPayloadBid.js +30 -40
  87. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  88. package/lib/chain/validation/payloadAttestationMessage.js +9 -0
  89. package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
  90. package/lib/metrics/metrics/beacon.d.ts +4 -0
  91. package/lib/metrics/metrics/beacon.d.ts.map +1 -1
  92. package/lib/metrics/metrics/beacon.js +11 -2
  93. package/lib/metrics/metrics/beacon.js.map +1 -1
  94. package/lib/metrics/metrics/lodestar.d.ts +2 -0
  95. package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
  96. package/lib/metrics/metrics/lodestar.js +37 -28
  97. package/lib/metrics/metrics/lodestar.js.map +1 -1
  98. package/lib/network/gossip/topic.d.ts +1 -7
  99. package/lib/network/gossip/topic.d.ts.map +1 -1
  100. package/lib/network/gossip/topic.js +0 -13
  101. package/lib/network/gossip/topic.js.map +1 -1
  102. package/lib/network/network.d.ts +1 -0
  103. package/lib/network/network.d.ts.map +1 -1
  104. package/lib/network/network.js +20 -11
  105. package/lib/network/network.js.map +1 -1
  106. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  107. package/lib/network/processor/gossipHandlers.js +8 -4
  108. package/lib/network/processor/gossipHandlers.js.map +1 -1
  109. package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
  110. package/lib/network/processor/gossipValidatorFn.js +4 -1
  111. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  112. package/lib/network/reqresp/utils/collect.d.ts +4 -4
  113. package/lib/network/reqresp/utils/collect.d.ts.map +1 -1
  114. package/lib/network/reqresp/utils/collect.js +9 -8
  115. package/lib/network/reqresp/utils/collect.js.map +1 -1
  116. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts +1 -1
  117. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts.map +1 -1
  118. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js +2 -2
  119. package/lib/network/reqresp/utils/collectSequentialBlocksInRange.js.map +1 -1
  120. package/lib/sync/unknownBlock.d.ts.map +1 -1
  121. package/lib/sync/unknownBlock.js +2 -1
  122. package/lib/sync/unknownBlock.js.map +1 -1
  123. package/package.json +16 -16
  124. package/src/api/impl/beacon/blocks/index.ts +74 -47
  125. package/src/api/impl/beacon/pool/index.ts +9 -7
  126. package/src/api/impl/beacon/state/utils.ts +2 -1
  127. package/src/api/impl/debug/index.ts +6 -2
  128. package/src/api/impl/validator/index.ts +6 -3
  129. package/src/chain/blocks/blockInput/blockInput.ts +4 -1
  130. package/src/chain/blocks/importExecutionPayload.ts +21 -2
  131. package/src/chain/blocks/index.ts +3 -30
  132. package/src/chain/blocks/verifyBlock.ts +24 -17
  133. package/src/chain/blocks/verifyBlocksDataAvailability.ts +4 -4
  134. package/src/chain/blocks/verifyBlocksExecutionPayloads.ts +7 -4
  135. package/src/chain/blocks/verifyBlocksSignatures.ts +3 -0
  136. package/src/chain/blocks/verifyPayloadsDataAvailability.ts +5 -4
  137. package/src/chain/bls/utils.ts +1 -1
  138. package/src/chain/chain.ts +81 -40
  139. package/src/chain/errors/executionPayloadBid.ts +3 -2
  140. package/src/chain/forkChoice/index.ts +1 -4
  141. package/src/chain/forkChoiceExecutionEngine.ts +48 -15
  142. package/src/chain/interface.ts +1 -1
  143. package/src/chain/opPools/inclusionListStore.ts +5 -2
  144. package/src/chain/opPools/opPool.ts +6 -6
  145. package/src/chain/options.ts +1 -1
  146. package/src/chain/seenCache/seenExecutionPayloadBids.ts +35 -15
  147. package/src/chain/shufflingCache.ts +40 -1
  148. package/src/chain/validation/aggregateAndProof.ts +19 -5
  149. package/src/chain/validation/dataColumnSidecar.ts +7 -1
  150. package/src/chain/validation/executionPayloadBid.ts +40 -42
  151. package/src/chain/validation/payloadAttestationMessage.ts +10 -0
  152. package/src/metrics/metrics/beacon.ts +11 -2
  153. package/src/metrics/metrics/lodestar.ts +37 -28
  154. package/src/network/gossip/topic.ts +1 -14
  155. package/src/network/network.ts +33 -11
  156. package/src/network/processor/gossipHandlers.ts +14 -10
  157. package/src/network/processor/gossipValidatorFn.ts +4 -0
  158. package/src/network/reqresp/utils/collect.ts +16 -8
  159. package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +3 -2
  160. package/src/sync/unknownBlock.ts +2 -1
@@ -152,12 +152,15 @@ export async function validateGossipFuluDataColumnSidecar(
152
152
 
153
153
  // 5) [REJECT] The proposer signature of sidecar.signed_block_header, is valid with respect to the block_header.proposer_index pubkey.
154
154
  const signature = dataColumnSidecar.signedBlockHeader.signature;
155
- if (!chain.seenBlockInputCache.isVerifiedProposerSignature(blockHeader.slot, blockRootHex, signature)) {
155
+ if (chain.seenBlockInputCache.isVerifiedProposerSignature(blockHeader.slot, blockRootHex, signature)) {
156
+ metrics?.peerDas.dataColumnSidecarProposerSignatureChecks.inc({result: "cache_hit"});
157
+ } else {
156
158
  const signatureSet = getBlockHeaderProposerSignatureSetByHeaderSlot(
157
159
  chain.config,
158
160
  dataColumnSidecar.signedBlockHeader
159
161
  );
160
162
 
163
+ metrics?.peerDas.dataColumnSidecarProposerSignatureChecks.inc({result: "verification"});
161
164
  if (
162
165
  !(await chain.bls.verifySignatureSets([signatureSet], {
163
166
  // verify on main thread so that we only need to verify block proposer signature once per block
@@ -172,6 +175,9 @@ export async function validateGossipFuluDataColumnSidecar(
172
175
  });
173
176
  }
174
177
 
178
+ if (metrics && !chain.seenBlockInputCache.isVerifiedProposerSignature(blockHeader.slot, blockRootHex, signature)) {
179
+ metrics.peerDas.dataColumnSidecarProposerSignatureBlocks.inc();
180
+ }
175
181
  chain.seenBlockInputCache.markVerifiedProposerSignature(blockHeader.slot, blockRootHex, signature);
176
182
  }
177
183
 
@@ -16,33 +16,6 @@ import {ExecutionPayloadBidError, ExecutionPayloadBidErrorCode, GossipAction} fr
16
16
  import {IBeaconChain} from "../index.js";
17
17
  import {RegenCaller} from "../regen/index.js";
18
18
 
19
- /**
20
- * Relative increment over the current highest bid required to forward a bid, in basis points.
21
- * With 3%, laddering from 1 gwei to 1 ETH takes ~256 bids given the floor and cap below, see
22
- * https://github.com/ethereum/consensus-specs/pull/4792#issuecomment-3714553549.
23
- */
24
- const BID_INCREMENT_BPS = 300;
25
- /**
26
- * Minimum absolute increment (0.0001 ETH). Covers low bid values where the relative increment
27
- * is tiny and provides weak spam protection.
28
- */
29
- const BID_INCREMENT_FLOOR_GWEI = 100_000;
30
- /**
31
- * Maximum absolute increment (0.01 ETH). Bounds the barrier for legitimate competition on
32
- * high value blocks where the relative increment would suppress closely competing bids.
33
- */
34
- const BID_INCREMENT_CAP_GWEI = 10_000_000;
35
-
36
- /**
37
- * Return the minimum value a new bid must have to be forwarded given the current highest bid.
38
- * Division before multiplication to stay within safe integer range for max gwei values.
39
- */
40
- function getMinBidValue(currentHighestBid: number): number {
41
- const relativeIncrement = Math.floor(currentHighestBid / 10_000) * BID_INCREMENT_BPS;
42
- const increment = Math.min(Math.max(BID_INCREMENT_FLOOR_GWEI, relativeIncrement), BID_INCREMENT_CAP_GWEI);
43
- return currentHighestBid + increment;
44
- }
45
-
46
19
  /**
47
20
  * Check whether a bid builds on one of the paths compatible with the local head branch.
48
21
  *
@@ -165,27 +138,30 @@ async function validateExecutionPayloadBid(
165
138
  });
166
139
  }
167
140
 
168
- // [IGNORE] this is the first signed bid seen with a valid signature from the given builder for
169
- // the tuple `(bid.slot, bid.parent_block_hash, bid.parent_block_root)`.
170
- // Entries are only added after signature verification, so known tuples can be dropped before
171
- // state regeneration and the other expensive validation steps.
172
- if (chain.seenExecutionPayloadBids.isKnown(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot)) {
141
+ // [IGNORE] The builder has not reached its bid limit, checked against the limit of its last valid bid.
142
+ // Bids for the same slot and parent root are validated against the same state, so bids past the
143
+ // limit can be dropped before state regeneration and the other expensive validation steps.
144
+ const seenBids = chain.seenExecutionPayloadBids.get(
145
+ bid.slot,
146
+ bid.builderIndex,
147
+ bidParentBlockHash,
148
+ bidParentBlockRoot
149
+ );
150
+ if (seenBids !== undefined && seenBids.count >= seenBids.limit) {
173
151
  throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
174
- code: ExecutionPayloadBidErrorCode.BID_ALREADY_KNOWN,
152
+ code: ExecutionPayloadBidErrorCode.BID_LIMIT_REACHED,
175
153
  builderIndex: bid.builderIndex,
176
154
  slot: bid.slot,
177
155
  parentBlockRoot: bidParentBlockRoot,
178
156
  parentBlockHash: bidParentBlockHash,
157
+ bidLimit: seenBids.limit,
179
158
  });
180
159
  }
181
160
 
182
161
  // [IGNORE] this bid is the highest value bid seen for the tuple
183
162
  // `(bid.slot, bid.parent_block_hash, bid.parent_block_root)`.
184
- // As a DoS prevention measure, the bid must also exceed the current highest bid by a minimum
185
- // increment, see https://github.com/ethereum/consensus-specs/pull/4831. This prevents spam
186
- // from builders submitting numerous bids with minimal value increments.
187
163
  const bestBid = chain.executionPayloadBidPool.getBestBid(bid.slot, bidParentBlockHash, bidParentBlockRoot);
188
- if (bestBid !== null && bid.value < getMinBidValue(bestBid.signedBid.message.value)) {
164
+ if (bestBid !== null && bid.value <= bestBid.signedBid.message.value) {
189
165
  throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
190
166
  code: ExecutionPayloadBidErrorCode.BID_TOO_LOW,
191
167
  bidValue: bid.value,
@@ -366,6 +342,24 @@ async function validateExecutionPayloadBid(
366
342
  });
367
343
  }
368
344
 
345
+ // [IGNORE] The builder has not reached its bid limit for the tuple
346
+ // `(bid.slot, bid.parent_block_hash, bid.parent_block_root)` -- i.e. one bid per ETH of builder balance
347
+ // not owed in pending withdrawals, `get_builder_bid_limit(state, bid.builder_index)`.
348
+ const bidLimit = state.getBuilderBidLimit(bid.builderIndex);
349
+ if (
350
+ (chain.seenExecutionPayloadBids.get(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot)?.count ??
351
+ 0) >= bidLimit
352
+ ) {
353
+ throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
354
+ code: ExecutionPayloadBidErrorCode.BID_LIMIT_REACHED,
355
+ builderIndex: bid.builderIndex,
356
+ slot: bid.slot,
357
+ parentBlockRoot: bidParentBlockRoot,
358
+ parentBlockHash: bidParentBlockHash,
359
+ bidLimit,
360
+ });
361
+ }
362
+
369
363
  // [IGNORE] `bid.value` is less or equal than the builder's excess balance --
370
364
  // i.e. `can_builder_cover_bid(state, builder_index, amount)` returns `True`.
371
365
  if (!state.canBuilderCoverBid(bid.builderIndex, bid.value)) {
@@ -426,20 +420,24 @@ async function validateExecutionPayloadBid(
426
420
  });
427
421
  }
428
422
 
429
- // Repeat the seen check after the awaited signature verification to prevent concurrent bids
430
- // for the same builder and tuple from both passing validation.
431
- if (chain.seenExecutionPayloadBids.isKnown(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot)) {
423
+ // Repeat the bid limit check after the awaited signature verification to prevent concurrent bids
424
+ // for the same builder and tuple from all passing validation.
425
+ if (
426
+ (chain.seenExecutionPayloadBids.get(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot)?.count ??
427
+ 0) >= bidLimit
428
+ ) {
432
429
  throw new ExecutionPayloadBidError(GossipAction.IGNORE, {
433
- code: ExecutionPayloadBidErrorCode.BID_ALREADY_KNOWN,
430
+ code: ExecutionPayloadBidErrorCode.BID_LIMIT_REACHED,
434
431
  builderIndex: bid.builderIndex,
435
432
  slot: bid.slot,
436
433
  parentBlockRoot: bidParentBlockRoot,
437
434
  parentBlockHash: bidParentBlockHash,
435
+ bidLimit,
438
436
  });
439
437
  }
440
438
 
441
439
  // Valid
442
- chain.seenExecutionPayloadBids.add(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot);
440
+ chain.seenExecutionPayloadBids.add(bid.slot, bid.builderIndex, bidParentBlockHash, bidParentBlockRoot, bidLimit);
443
441
 
444
442
  return {proposerIndex: proposerPreferences.message.validatorIndex};
445
443
  }
@@ -131,6 +131,16 @@ async function validatePayloadAttestationMessage(
131
131
  });
132
132
  }
133
133
 
134
+ // Re-check after the await: concurrent messages from the same validator all pass the check above
135
+ if (chain.seenPayloadAttesters.isKnown(data.slot, validatorIndex)) {
136
+ throw new PayloadAttestationError(GossipAction.IGNORE, {
137
+ code: PayloadAttestationErrorCode.PAYLOAD_ATTESTATION_ALREADY_KNOWN,
138
+ validatorIndex,
139
+ slot: data.slot,
140
+ blockRoot: toRootHex(data.beaconBlockRoot),
141
+ });
142
+ }
143
+
134
144
  // Valid
135
145
  chain.seenPayloadAttesters.add(data.slot, validatorIndex);
136
146
 
@@ -160,7 +160,7 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
160
160
 
161
161
  blockPayload: {
162
162
  payloadAdvancePrepTime: register.histogram({
163
- name: "beacon_block_payload_prepare_time",
163
+ name: "beacon_block_payload_prepare_time_seconds",
164
164
  help: "Time for preparing payload in advance",
165
165
  buckets: [0.1, 1, 3, 5, 10],
166
166
  }),
@@ -170,7 +170,7 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
170
170
  buckets: [0.005, 0.01, 0.05, 0.1, 0.2, 0.5, 1],
171
171
  }),
172
172
  payloadFetchedTime: register.histogram<{prepType: PayloadPreparationType}>({
173
- name: "beacon_block_payload_fetched_time",
173
+ name: "beacon_block_payload_fetched_time_seconds",
174
174
  help: "Time to fetch the payload from EL",
175
175
  labelNames: ["prepType"],
176
176
  buckets: [0.1, 0.2, 0.3, 0.5, 0.7, 1, 2],
@@ -334,6 +334,15 @@ export function createBeaconMetrics(register: RegistryMetricCreator) {
334
334
  help: "Time taken to compute data column sidecars, including cells and inclusion proof",
335
335
  buckets: [0.1, 0.25, 0.5, 0.75, 1, 2, 5],
336
336
  }),
337
+ dataColumnSidecarProposerSignatureChecks: register.counter<{result: "cache_hit" | "verification"}>({
338
+ name: "beacon_data_column_sidecar_proposer_signature_checks_total",
339
+ help: "Gossip data column proposer signature checks answered by the cache or by a started verification",
340
+ labelNames: ["result"],
341
+ }),
342
+ dataColumnSidecarProposerSignatureBlocks: register.counter({
343
+ name: "beacon_data_column_sidecar_proposer_signature_blocks_total",
344
+ help: "Blocks whose proposer signature a gossip data column verified and cached first",
345
+ }),
337
346
  dataColumnSidecarInclusionProofVerificationTime: register.histogram({
338
347
  name: "beacon_data_column_sidecar_inclusion_proof_verification_seconds",
339
348
  help: "Time taken to verify data_column sidecar inclusion proof",
@@ -68,7 +68,7 @@ export function createLodestarMetrics(
68
68
  if (genesisTime) {
69
69
  register
70
70
  .gauge({
71
- name: "lodestar_genesis_time",
71
+ name: "lodestar_genesis_time_seconds",
72
72
  help: "Genesis time in seconds",
73
73
  })
74
74
  .set(genesisTime);
@@ -565,13 +565,13 @@ export function createLodestarMetrics(
565
565
  }),
566
566
  // To measure the time cost of main thread <-> worker message passing
567
567
  latencyToWorker: register.histogram({
568
- name: "lodestar_bls_thread_pool_latency_to_worker",
568
+ name: "lodestar_bls_thread_pool_latency_to_worker_seconds",
569
569
  help: "Time from sending the job to the worker and the worker receiving it",
570
570
  // The dashboard treats 20ms as slow; values above 100ms only need severe-stall classification.
571
571
  buckets: [0.00025, 0.001, 0.005, 0.02, 0.1],
572
572
  }),
573
573
  latencyFromWorker: register.histogram({
574
- name: "lodestar_bls_thread_pool_latency_from_worker",
574
+ name: "lodestar_bls_thread_pool_latency_from_worker_seconds",
575
575
  help: "Time from the worker sending the result and the main thread receiving it",
576
576
  buckets: [0.00025, 0.001, 0.005, 0.02, 0.1],
577
577
  }),
@@ -775,7 +775,7 @@ export function createLodestarMetrics(
775
775
  labelNames: ["reason"],
776
776
  }),
777
777
  elapsedTimeTillReceived: register.histogram({
778
- name: "lodestar_sync_unknown_block_elapsed_time_till_received",
778
+ name: "lodestar_sync_unknown_block_elapsed_time_till_received_seconds",
779
779
  help: "Time elapsed between block slot time and the time block received via unknown block sync",
780
780
  buckets: [0.5, 1, 2, 4, 6, 12],
781
781
  }),
@@ -930,86 +930,86 @@ export function createLodestarMetrics(
930
930
  // Gossip block
931
931
  gossipBlock: {
932
932
  elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
933
- name: "lodestar_gossip_block_elapsed_time_till_received",
933
+ name: "lodestar_gossip_block_elapsed_time_till_received_seconds",
934
934
  help: "Time elapsed between block slot time and the time block received via gossip",
935
935
  labelNames: ["source"],
936
936
  buckets: [0.5, 1, 2, 4, 6, 12],
937
937
  }),
938
938
  elapsedTimeTillProcessed: register.histogram({
939
- name: "lodestar_gossip_block_elapsed_time_till_processed",
939
+ name: "lodestar_gossip_block_elapsed_time_till_processed_seconds",
940
940
  help: "Time elapsed between block slot time and the time block processed",
941
941
  buckets: [0.5, 1, 2, 4, 6, 12],
942
942
  }),
943
943
 
944
944
  gossipValidation: {
945
945
  recvToValidation: register.histogram({
946
- name: "lodestar_gossip_block_received_to_gossip_validate",
946
+ name: "lodestar_gossip_block_received_to_gossip_validate_seconds",
947
947
  help: "Time elapsed between block received and block validated",
948
948
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
949
949
  }),
950
950
  validationTime: register.histogram({
951
- name: "lodestar_gossip_block_gossip_validate_time",
951
+ name: "lodestar_gossip_block_gossip_validate_time_seconds",
952
952
  help: "Time to apply gossip validations",
953
953
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
954
954
  }),
955
955
  },
956
956
  stateTransition: {
957
957
  recvToValidation: register.histogram({
958
- name: "lodestar_gossip_block_received_to_state_transition",
958
+ name: "lodestar_gossip_block_received_to_state_transition_seconds",
959
959
  help: "Time elapsed between block received and block state transition",
960
960
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
961
961
  }),
962
962
  validationTime: register.histogram({
963
- name: "lodestar_gossip_block_state_transition_time",
963
+ name: "lodestar_gossip_block_state_transition_time_seconds",
964
964
  help: "Time to validate block state transition",
965
965
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
966
966
  }),
967
967
  },
968
968
  signatureVerification: {
969
969
  recvToValidation: register.histogram({
970
- name: "lodestar_gossip_block_received_to_signatures_verification",
970
+ name: "lodestar_gossip_block_received_to_signatures_verification_seconds",
971
971
  help: "Time elapsed between block received and block signatures verification",
972
972
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
973
973
  }),
974
974
  validationTime: register.histogram({
975
- name: "lodestar_gossip_block_signatures_verification_time",
975
+ name: "lodestar_gossip_block_signatures_verification_time_seconds",
976
976
  help: "Time elapsed for block signatures verification",
977
977
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
978
978
  }),
979
979
  },
980
980
  executionPayload: {
981
981
  recvToValidation: register.histogram({
982
- name: "lodestar_gossip_block_received_to_execution_payload_verification",
982
+ name: "lodestar_gossip_block_received_to_execution_payload_verification_seconds",
983
983
  help: "Time elapsed between block received and execution payload verification",
984
984
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
985
985
  }),
986
986
  validationTime: register.histogram({
987
- name: "lodestar_gossip_execution_payload_verification_time",
987
+ name: "lodestar_gossip_execution_payload_verification_time_seconds",
988
988
  help: "Time elapsed for execution payload verification",
989
989
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
990
990
  }),
991
991
  },
992
992
  blockImport: {
993
993
  recvToValidation: register.histogram({
994
- name: "lodestar_gossip_block_received_to_block_import",
994
+ name: "lodestar_gossip_block_received_to_block_import_seconds",
995
995
  help: "Time elapsed between block received and block import",
996
996
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
997
997
  }),
998
998
  validationTime: register.histogram({
999
- name: "lodestar_gossip_block_block_import_time",
999
+ name: "lodestar_gossip_block_block_import_time_seconds",
1000
1000
  help: "Time elapsed for block import",
1001
1001
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
1002
1002
  }),
1003
1003
  },
1004
1004
 
1005
1005
  receivedToBlobsAvailabilityTime: register.histogram<{numBlobs: number}>({
1006
- name: "lodestar_gossip_block_received_to_blobs_availability_time",
1006
+ name: "lodestar_gossip_block_received_to_blobs_availability_time_seconds",
1007
1007
  help: "Time elapsed between block received and blobs became available",
1008
1008
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
1009
1009
  labelNames: ["numBlobs"],
1010
1010
  }),
1011
1011
  receivedToFullyVerifiedTime: register.histogram({
1012
- name: "lodestar_gossip_block_received_to_fully_verified_time",
1012
+ name: "lodestar_gossip_block_received_to_fully_verified_time_seconds",
1013
1013
  help: "Time elapsed between block received and fully verified state, signatures and payload",
1014
1014
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
1015
1015
  }),
@@ -1019,7 +1019,7 @@ export function createLodestarMetrics(
1019
1019
  buckets: [0.01, 0.015, 0.02, 0.025, 0.03, 0.04, 0.5, 1],
1020
1020
  }),
1021
1021
  verifiedToBlobsAvailabiltyTime: register.histogram<{numBlobs: number}>({
1022
- name: "lodestar_gossip_block_verified_to_blobs_availability_time",
1022
+ name: "lodestar_gossip_block_verified_to_blobs_availability_time_seconds",
1023
1023
  help: "Time elapsed between block verified and blobs became available",
1024
1024
  buckets: [0.05, 0.1, 0.3, 0.5, 0.7, 1, 1.3, 1.6, 2, 2.5, 3, 3.5, 4],
1025
1025
  labelNames: ["numBlobs"],
@@ -1045,12 +1045,12 @@ export function createLodestarMetrics(
1045
1045
  },
1046
1046
  gossipBlob: {
1047
1047
  recvToValidation: register.histogram({
1048
- name: "lodestar_gossip_blob_received_to_gossip_validate",
1048
+ name: "lodestar_gossip_blob_received_to_gossip_validate_seconds",
1049
1049
  help: "Time elapsed between blob received and blob validation",
1050
1050
  buckets: [0.05, 0.1, 0.2, 0.5, 1, 1.5, 2, 4],
1051
1051
  }),
1052
1052
  validationTime: register.histogram({
1053
- name: "lodestar_gossip_blob_gossip_validate_time",
1053
+ name: "lodestar_gossip_blob_gossip_validate_time_seconds",
1054
1054
  help: "Time elapsed for blob validation",
1055
1055
  buckets: [0.05, 0.1, 0.2, 0.5, 1, 1.5, 2, 4],
1056
1056
  }),
@@ -1058,7 +1058,7 @@ export function createLodestarMetrics(
1058
1058
  // Gossip execution payload envelope
1059
1059
  gossipExecutionPayloadEnvelope: {
1060
1060
  elapsedTimeTillReceived: register.histogram<{source: OpSource}>({
1061
- name: "lodestar_gossip_execution_payload_envelope_elapsed_time_till_received",
1061
+ name: "lodestar_gossip_execution_payload_envelope_elapsed_time_till_received_seconds",
1062
1062
  help: "Time elapsed between slot time and the time execution payload envelope received",
1063
1063
  labelNames: ["source"],
1064
1064
  buckets: [0.5, 1, 2, 4, 6, 12],
@@ -1157,7 +1157,7 @@ export function createLodestarMetrics(
1157
1157
  help: "Count persisting block with serialized data",
1158
1158
  }),
1159
1159
  elapsedTimeTillBecomeHead: register.histogram({
1160
- name: "lodestar_gossip_block_elapsed_time_till_become_head",
1160
+ name: "lodestar_gossip_block_elapsed_time_till_become_head_seconds",
1161
1161
  help: "Time elapsed between block slot time and the time block becomes head",
1162
1162
  buckets: [0.5, 1, 2, 4, 6, 12],
1163
1163
  }),
@@ -1595,7 +1595,7 @@ export function createLodestarMetrics(
1595
1595
  help: "Avg min max of all state cache items total read count",
1596
1596
  }),
1597
1597
  secondsSinceLastRead: register.avgMinMax({
1598
- name: "lodestar_state_cache_seconds_since_last_read",
1598
+ name: "lodestar_state_cache_since_last_read_seconds",
1599
1599
  help: "Avg min max of all state cache items seconds since last reads",
1600
1600
  }),
1601
1601
  stateClonedCount: register.histogram({
@@ -1664,7 +1664,7 @@ export function createLodestarMetrics(
1664
1664
  help: "Avg min max of all state cache items total read count",
1665
1665
  }),
1666
1666
  secondsSinceLastRead: register.avgMinMax({
1667
- name: "lodestar_cp_state_epoch_seconds_since_last_read",
1667
+ name: "lodestar_cp_state_epoch_since_last_read_seconds",
1668
1668
  help: "Avg min max of all state cache items seconds since last reads",
1669
1669
  }),
1670
1670
  stateClonedCount: register.histogram({
@@ -1682,7 +1682,7 @@ export function createLodestarMetrics(
1682
1682
  help: "Total number of states pruned from memory",
1683
1683
  }),
1684
1684
  statePersistSecFromSlot: register.histogram({
1685
- name: "lodestar_cp_state_cache_state_persist_seconds_from_slot",
1685
+ name: "lodestar_cp_state_cache_state_persist_from_slot_seconds",
1686
1686
  help: "Histogram of time to persist state to db since the clock slot",
1687
1687
  buckets: [0, 2, 4, 6, 8, 10, 12],
1688
1688
  }),
@@ -1710,7 +1710,7 @@ export function createLodestarMetrics(
1710
1710
  buckets: [0, 1, 2, 4, 8, 16, 32],
1711
1711
  }),
1712
1712
  stateReloadSecFromSlot: register.histogram({
1713
- name: "lodestar_cp_state_cache_state_reload_seconds_from_slot",
1713
+ name: "lodestar_cp_state_cache_state_reload_from_slot_seconds",
1714
1714
  help: "Histogram of time to load state from db since the clock slot",
1715
1715
  buckets: [0, 2, 4, 6, 8, 10, 12],
1716
1716
  }),
@@ -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: {
@@ -1916,7 +1925,7 @@ export function createLodestarMetrics(
1916
1925
  labelNames: ["entrypoint", "caller"],
1917
1926
  }),
1918
1927
  regenFnCallDuration: register.histogram<{entrypoint: RegenFnName; caller: RegenCaller}>({
1919
- name: "lodestar_regen_fn_call_duration",
1928
+ name: "lodestar_regen_fn_call_duration_seconds",
1920
1929
  help: "regen function duration",
1921
1930
  labelNames: ["entrypoint", "caller"],
1922
1931
  buckets: [0.1, 1, 10, 100],
@@ -12,7 +12,7 @@ import {
12
12
  isForkPostGloas,
13
13
  } from "@lodestar/params";
14
14
  import {TypeSizes} from "@lodestar/reqresp";
15
- import {Attestation, SingleAttestation, ssz, sszTypesFor} from "@lodestar/types";
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
  */
@@ -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
- chain.forkChoice.notifyPtcMessages(
1305
- toRootHex(payloadAttestationMessage.data.beaconBlockRoot),
1306
- payloadAttestationMessage.data.slot,
1307
- validationResult.validatorCommitteeIndices,
1308
- payloadAttestationMessage.data.payloadPresent,
1309
- payloadAttestationMessage.data.blobDataAvailable
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
- // Timely only if received within its own slot before the deadline, so a list for the next slot that
1426
- // passed validation under clock disparity is untimely. Late lists are still stored, marked untimely
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 >= 0 && secFromSlot * 1000 < config.getInclusionListDueMs(config.getForkName(slot));
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
  }