@lodestar/beacon-node 1.50.0-dev.d86161f63c → 1.50.0-dev.d99080f29a

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 (74) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +6 -1
  3. package/lib/api/impl/beacon/blocks/index.js.map +1 -1
  4. package/lib/chain/blocks/importBlock.d.ts.map +1 -1
  5. package/lib/chain/blocks/importBlock.js +4 -0
  6. package/lib/chain/blocks/importBlock.js.map +1 -1
  7. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
  8. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
  9. package/lib/chain/chain.d.ts +5 -4
  10. package/lib/chain/chain.d.ts.map +1 -1
  11. package/lib/chain/chain.js +11 -13
  12. package/lib/chain/chain.js.map +1 -1
  13. package/lib/chain/errors/envelopeReconstructionError.d.ts +5 -0
  14. package/lib/chain/errors/envelopeReconstructionError.d.ts.map +1 -1
  15. package/lib/chain/errors/envelopeReconstructionError.js +2 -0
  16. package/lib/chain/errors/envelopeReconstructionError.js.map +1 -1
  17. package/lib/chain/errors/gossipValidation.d.ts +3 -1
  18. package/lib/chain/errors/gossipValidation.d.ts.map +1 -1
  19. package/lib/chain/errors/gossipValidation.js +2 -0
  20. package/lib/chain/errors/gossipValidation.js.map +1 -1
  21. package/lib/chain/interface.d.ts +2 -2
  22. package/lib/chain/interface.d.ts.map +1 -1
  23. package/lib/chain/prepareNextSlot.d.ts.map +1 -1
  24. package/lib/chain/prepareNextSlot.js +5 -2
  25. package/lib/chain/prepareNextSlot.js.map +1 -1
  26. package/lib/chain/produceBlock/produceBlockBody.d.ts +3 -1
  27. package/lib/chain/produceBlock/produceBlockBody.d.ts.map +1 -1
  28. package/lib/chain/produceBlock/produceBlockBody.js +6 -2
  29. package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
  30. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +9 -2
  31. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
  32. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +23 -13
  33. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
  34. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  35. package/lib/network/processor/gossipHandlers.js +3 -0
  36. package/lib/network/processor/gossipHandlers.js.map +1 -1
  37. package/lib/network/processor/gossipValidatorFn.d.ts +7 -3
  38. package/lib/network/processor/gossipValidatorFn.d.ts.map +1 -1
  39. package/lib/network/processor/gossipValidatorFn.js +7 -3
  40. package/lib/network/processor/gossipValidatorFn.js.map +1 -1
  41. package/lib/network/processor/index.d.ts +9 -0
  42. package/lib/network/processor/index.d.ts.map +1 -1
  43. package/lib/network/processor/index.js +77 -10
  44. package/lib/network/processor/index.js.map +1 -1
  45. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js +1 -1
  46. package/lib/network/reqresp/handlers/executionPayloadEnvelopesByRoot.js.map +1 -1
  47. package/lib/sync/range/range.d.ts.map +1 -1
  48. package/lib/sync/range/range.js +50 -18
  49. package/lib/sync/range/range.js.map +1 -1
  50. package/lib/sync/unknownBlock.d.ts.map +1 -1
  51. package/lib/sync/unknownBlock.js +5 -4
  52. package/lib/sync/unknownBlock.js.map +1 -1
  53. package/lib/util/execution.d.ts +9 -11
  54. package/lib/util/execution.d.ts.map +1 -1
  55. package/lib/util/execution.js +5 -1
  56. package/lib/util/execution.js.map +1 -1
  57. package/package.json +15 -15
  58. package/src/api/impl/beacon/blocks/index.ts +7 -4
  59. package/src/chain/blocks/importBlock.ts +4 -0
  60. package/src/chain/blocks/payloadEnvelopeInput/types.ts +2 -1
  61. package/src/chain/chain.ts +14 -16
  62. package/src/chain/errors/envelopeReconstructionError.ts +3 -0
  63. package/src/chain/errors/gossipValidation.ts +2 -0
  64. package/src/chain/interface.ts +2 -2
  65. package/src/chain/prepareNextSlot.ts +6 -3
  66. package/src/chain/produceBlock/produceBlockBody.ts +8 -1
  67. package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +31 -13
  68. package/src/network/processor/gossipHandlers.ts +3 -0
  69. package/src/network/processor/gossipValidatorFn.ts +13 -3
  70. package/src/network/processor/index.ts +89 -10
  71. package/src/network/reqresp/handlers/executionPayloadEnvelopesByRoot.ts +1 -1
  72. package/src/sync/range/range.ts +50 -18
  73. package/src/sync/unknownBlock.ts +5 -4
  74. package/src/util/execution.ts +16 -8
@@ -266,14 +266,15 @@ type SlotEnvelopeBytes = {slot: Slot; envelopeBytes: Uint8Array};
266
266
 
267
267
  type RangeEntry = ArchivedEnvelope & {slot: Slot};
268
268
 
269
- /** What a body root mismatch means on a given serving path */
270
- export type ReconstructMismatchPolicy = "throw" | "omit";
269
+ /** What an envelope that cannot be rebuilt (EL-unavailable body or body root mismatch) means on a given serving path */
270
+ export type ReconstructMissPolicy = "throw" | "omit";
271
271
 
272
- export type RebuildMiss =
273
- /** EL does not have the block, or has pruned its block access list */
274
- | {slot: Slot; reason: "unavailable"}
275
- /** An EL body does not hash to its stored root (local inconsistency) */
276
- | {slot: Slot; reason: "mismatch"; error: EnvelopeReconstructionError};
272
+ /**
273
+ * An archived envelope that could not be rebuilt. `"unavailable"`: the EL does not have the block or its
274
+ * block access list (BODY_UNAVAILABLE). `"mismatch"`: an EL body does not hash to its stored root, a local
275
+ * inconsistency (BODY_ROOT_MISMATCH). `error` carries the matching code for paths that surface it.
276
+ */
277
+ export type RebuildMiss = {slot: Slot; reason: "unavailable" | "mismatch"; error: EnvelopeReconstructionError};
277
278
 
278
279
  /**
279
280
  * Stream finalized envelopes over [startSlot, endSlot) as serialized bytes, rebuilding header
@@ -405,7 +406,14 @@ async function reconstructEnvelopesBatch(
405
406
  // A zero-length block access list cannot be valid, RLP encodes an empty list as 0xc0
406
407
  if (body == null || body.withdrawals == null || body.blockAccessList == null || body.blockAccessList.length === 0) {
407
408
  metrics?.payloadEnvelopeReconstruction.envelopes.inc({result: "unavailable"});
408
- return {slot, reason: "unavailable"};
409
+ return {
410
+ slot,
411
+ reason: "unavailable",
412
+ error: new EnvelopeReconstructionError(
413
+ {code: EnvelopeReconstructionErrorCode.BODY_UNAVAILABLE, slot},
414
+ `execution client cannot serve the payload body or block access list for archived envelope slot=${slot}`
415
+ ),
416
+ };
409
417
  }
410
418
  try {
411
419
  const envelope = signedHeaderEnvelopeToFull(headerEnvelope, {