@lodestar/beacon-node 1.49.0-dev.33d8e7d3cd → 1.49.0-dev.46b983948a

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 (39) hide show
  1. package/lib/api/impl/beacon/blocks/index.js +2 -2
  2. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  3. package/lib/api/impl/validator/index.js +6 -6
  4. package/lib/api/impl/validator/index.js.map +1 -1
  5. package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
  6. package/lib/chain/archiveStore/utils/pruneHistory.js +5 -1
  7. package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
  8. package/lib/chain/blocks/index.js +2 -2
  9. package/lib/chain/blocks/index.js.map +1 -1
  10. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +1 -1
  11. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
  12. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  13. package/lib/chain/produceBlock/produceBlockBody.js +6 -6
  14. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  15. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +2 -1
  16. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
  17. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +3 -2
  18. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
  19. package/lib/chain/validatorMonitor.d.ts.map +1 -1
  20. package/lib/chain/validatorMonitor.js +2 -2
  21. package/lib/chain/validatorMonitor.js.map +1 -1
  22. package/lib/network/gossip/topic.d.ts +1 -1
  23. package/lib/network/gossip/topic.d.ts.map +1 -1
  24. package/lib/network/gossip/topic.js +1 -1
  25. package/lib/network/gossip/topic.js.map +1 -1
  26. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  27. package/lib/network/processor/gossipHandlers.js +16 -5
  28. package/lib/network/processor/gossipHandlers.js.map +1 -1
  29. package/package.json +14 -14
  30. package/src/api/impl/beacon/blocks/index.ts +2 -2
  31. package/src/api/impl/validator/index.ts +6 -6
  32. package/src/chain/archiveStore/utils/pruneHistory.ts +5 -1
  33. package/src/chain/blocks/index.ts +2 -2
  34. package/src/chain/blocks/payloadEnvelopeInput/types.ts +1 -1
  35. package/src/chain/produceBlock/produceBlockBody.ts +17 -6
  36. package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +3 -2
  37. package/src/chain/validatorMonitor.ts +12 -2
  38. package/src/network/gossip/topic.ts +2 -2
  39. package/src/network/processor/gossipHandlers.ts +18 -5
@@ -244,8 +244,20 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
244
244
 
245
245
  // IGNORE means the block is acceptable (e.g. FUTURE_SLOT, ALREADY_KNOWN), just not propagated.
246
246
  // Keep the optimistically-added cache entries; they are pruned on finalization. Only REJECT
247
- // (provably invalid) and unexpected errors prune below.
247
+ // (provably invalid), unexpected errors and repeat proposals that are not imported prune.
248
248
  if (e.action === GossipAction.IGNORE) {
249
+ // Only a signature-verified sibling is imported by the beacon_block handler, any other repeat proposal
250
+ // is dropped from the caches and re-downloaded by sync if it ever becomes relevant. Its signature was not
251
+ // verified, so only its own entry is removed, never its claimed ancestors
252
+ if (
253
+ e.type.code === BlockErrorCode.REPEAT_PROPOSAL &&
254
+ !chain.seenBlockProposers.hasBlockRoot(slot, signedBlock.message.proposerIndex, blockRootHex)
255
+ ) {
256
+ chain.seenBlockInputCache.remove(blockRootHex);
257
+ if (isForkPostGloas(fork)) {
258
+ chain.seenPayloadEnvelopeInputCache.remove(blockRootHex);
259
+ }
260
+ }
249
261
  throw e;
250
262
  }
251
263
 
@@ -258,10 +270,10 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
258
270
  }
259
271
 
260
272
  // REJECT or unexpected (non-BlockGossipError) error: drop the optimistically-added entries from
261
- // both caches, keeping them consistent.
262
- chain.seenBlockInputCache.prune(blockRootHex);
273
+ // both caches, keeping them consistent. The block may carry any parent root, so only its own entry is removed
274
+ chain.seenBlockInputCache.remove(blockRootHex);
263
275
  if (isForkPostGloas(fork)) {
264
- chain.seenPayloadEnvelopeInputCache.prune(blockRootHex);
276
+ chain.seenPayloadEnvelopeInputCache.remove(blockRootHex);
265
277
  }
266
278
  throw e;
267
279
  } finally {
@@ -738,7 +750,8 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
738
750
  if (
739
751
  e instanceof BlockGossipError &&
740
752
  e.type.code === BlockErrorCode.REPEAT_PROPOSAL &&
741
- // this is make sure the block's proposer signature was verified, it should be true anyway
753
+ // Only a signature-verified sibling recorded in the seen cache is imported. The cache holds at most two
754
+ // roots per proposer and slot, which bounds full imports over gossip to one alternate
742
755
  chain.seenBlockProposers.hasBlockRoot(signedBlock.message.slot, e.type.proposerIndex, e.type.root)
743
756
  ) {
744
757
  // blockInput was optimistically seeded in validateBeaconBlock and retained on IGNORE