@lodestar/beacon-node 1.51.0-dev.5e25b73306 → 1.51.0-dev.708700cdf6

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 (49) hide show
  1. package/lib/api/impl/validator/index.js +7 -5
  2. package/lib/api/impl/validator/index.js.map +1 -1
  3. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  4. package/lib/chain/blocks/importExecutionPayload.js +2 -1
  5. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  6. package/lib/chain/opPools/inclusionListStore.d.ts.map +1 -1
  7. package/lib/chain/opPools/inclusionListStore.js +2 -2
  8. package/lib/chain/opPools/inclusionListStore.js.map +1 -1
  9. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  10. package/lib/chain/produceBlock/produceBlockBody.js +0 -1
  11. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  12. package/lib/chain/validation/inclusionList.d.ts.map +1 -1
  13. package/lib/chain/validation/inclusionList.js +11 -2
  14. package/lib/chain/validation/inclusionList.js.map +1 -1
  15. package/lib/execution/engine/blobVersionedHashes.d.ts +1 -1
  16. package/lib/execution/engine/blobVersionedHashes.d.ts.map +1 -1
  17. package/lib/execution/engine/blobVersionedHashes.js.map +1 -1
  18. package/lib/execution/engine/http.d.ts.map +1 -1
  19. package/lib/execution/engine/http.js +0 -1
  20. package/lib/execution/engine/http.js.map +1 -1
  21. package/lib/execution/engine/mock.d.ts.map +1 -1
  22. package/lib/execution/engine/mock.js +6 -4
  23. package/lib/execution/engine/mock.js.map +1 -1
  24. package/lib/execution/engine/payloadIdCache.d.ts +1 -2
  25. package/lib/execution/engine/payloadIdCache.d.ts.map +1 -1
  26. package/lib/execution/engine/payloadIdCache.js +3 -3
  27. package/lib/execution/engine/payloadIdCache.js.map +1 -1
  28. package/lib/execution/engine/sszTypes.d.ts +38 -38
  29. package/lib/execution/engine/types.d.ts +1 -1
  30. package/lib/execution/engine/types.d.ts.map +1 -1
  31. package/lib/execution/engine/types.js +7 -6
  32. package/lib/execution/engine/types.js.map +1 -1
  33. package/lib/network/gossip/topic.d.ts +6 -6
  34. package/lib/network/processor/index.d.ts.map +1 -1
  35. package/lib/network/processor/index.js +26 -25
  36. package/lib/network/processor/index.js.map +1 -1
  37. package/package.json +30 -30
  38. package/src/api/impl/validator/index.ts +7 -7
  39. package/src/chain/blocks/importExecutionPayload.ts +2 -1
  40. package/src/chain/opPools/inclusionListStore.ts +3 -3
  41. package/src/chain/produceBlock/produceBlockBody.ts +0 -1
  42. package/src/chain/validation/inclusionList.ts +11 -2
  43. package/src/execution/engine/blobVersionedHashes.ts +1 -1
  44. package/src/execution/engine/http.ts +0 -1
  45. package/src/execution/engine/mock.ts +6 -4
  46. package/src/execution/engine/payloadIdCache.ts +6 -7
  47. package/src/execution/engine/types.ts +8 -8
  48. package/src/network/processor/index.ts +22 -23
  49. package/src/network/processor/types.ts +1 -1
@@ -867,19 +867,20 @@ export class NetworkProcessor {
867
867
  const nowSec = Date.now() / 1000;
868
868
  const minSlot = clockSlot - MAX_UNKNOWN_ROOTS_SLOT_CACHE_SIZE;
869
869
 
870
- for (const [slot, searchedRoots] of this.searchedRootsBySlot) {
870
+ for (const [slot, bufferedRoots] of this.bufferedRootsBySlot) {
871
871
  if (slot > minSlot) continue;
872
872
 
873
- // expire messages awaiting an unknown block for these roots. Only roots this slot did a BLOCK search
874
- // for (blockPeerIds set) have block waits keyed here; skipping the rest avoids deleting a payload wait
875
- // that a newer slot created for the same root (block/envelope searches share searchedRootsBySlot).
876
- for (const [rootHex, entry] of searchedRoots) {
877
- if (entry.blockPeerIds === undefined) continue;
873
+ for (const rootHex of bufferedRoots) {
878
874
  const messagesByTopic = this.awaitingMessagesByBlockRoot.get(rootHex);
879
875
  if (messagesByTopic === undefined) continue;
880
- let removed = 0;
876
+ let remaining = 0;
881
877
  for (const messages of messagesByTopic.values()) {
882
878
  for (const message of messages) {
879
+ // the same root may be buffered again from a newer slot, keep those messages.
880
+ // msgSlot is always set before buffering, a missing one expires rather than leaks
881
+ if ((message.msgSlot ?? minSlot) > minSlot) continue;
882
+ messages.delete(message);
883
+ this.awaitingBlockMessageCount--;
883
884
  const topicType = message.topic.type;
884
885
  this.metrics?.awaitingBlockGossipMessages.reject.inc({
885
886
  topic: topicType,
@@ -891,22 +892,22 @@ export class NetworkProcessor {
891
892
  );
892
893
  // No need to report the dropped job to gossip. It will be eventually pruned from the mcache
893
894
  }
894
- removed += messages.size;
895
- }
896
- if (this.awaitingMessagesByBlockRoot.delete(rootHex)) {
897
- this.awaitingBlockMessageCount -= removed;
895
+ remaining += messages.size;
898
896
  }
897
+ if (remaining === 0) this.awaitingMessagesByBlockRoot.delete(rootHex);
899
898
  }
900
899
 
901
- // expire messages awaiting an unknown payload envelope for these roots. Symmetric to the block pass:
902
- // only roots this slot did an ENVELOPE search for (envelopePeerIds set) have payload waits keyed here.
903
- for (const [rootHex, entry] of searchedRoots) {
904
- if (entry.envelopePeerIds === undefined) continue;
900
+ for (const rootHex of bufferedRoots) {
905
901
  const messagesByTopic = this.awaitingMessagesByPayloadBlockRoot.get(rootHex);
906
902
  if (messagesByTopic === undefined) continue;
907
- let removed = 0;
903
+ let remaining = 0;
908
904
  for (const messages of messagesByTopic.values()) {
909
905
  for (const message of messages) {
906
+ // the same root may be buffered again from a newer slot, keep those messages.
907
+ // msgSlot is always set before buffering, a missing one expires rather than leaks
908
+ if ((message.msgSlot ?? minSlot) > minSlot) continue;
909
+ messages.delete(message);
910
+ this.awaitingPayloadMessageCount--;
910
911
  const topicType = message.topic.type;
911
912
  this.metrics?.awaitingPayloadGossipMessages.reject.inc({
912
913
  topic: topicType,
@@ -918,18 +919,16 @@ export class NetworkProcessor {
918
919
  );
919
920
  // No need to report the dropped job to gossip. It will be eventually pruned from the mcache
920
921
  }
921
- removed += messages.size;
922
- }
923
- if (this.awaitingMessagesByPayloadBlockRoot.delete(rootHex)) {
924
- this.awaitingPayloadMessageCount -= removed;
922
+ remaining += messages.size;
925
923
  }
924
+ if (remaining === 0) this.awaitingMessagesByPayloadBlockRoot.delete(rootHex);
926
925
  }
927
926
 
928
- this.searchedRootsBySlot.delete(slot);
927
+ this.bufferedRootsBySlot.delete(slot);
929
928
  }
930
929
 
931
- for (const slot of this.bufferedRootsBySlot.keys()) {
932
- if (slot <= minSlot) this.bufferedRootsBySlot.delete(slot);
930
+ for (const slot of this.searchedRootsBySlot.keys()) {
931
+ if (slot <= minSlot) this.searchedRootsBySlot.delete(slot);
933
932
  }
934
933
 
935
934
  for (const [peer, slot] of this.fatalPeers) {
@@ -11,7 +11,7 @@ export type GossipAttestationsWork = {
11
11
  export type PendingGossipsubMessage = {
12
12
  topic: GossipTopic;
13
13
  msg: Message;
14
- // only available for beacon_attestation and aggregate_and_proof
14
+ // set for every topic with a slot, held messages expire by it
15
15
  msgSlot?: Slot;
16
16
  msgId: string;
17
17
  propagationSource: PeerIdStr;