@lodestar/beacon-node 2.1.0-dev.a6c4b2f428 → 2.1.0-dev.ad0f676f6f

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 (174) hide show
  1. package/lib/api/impl/beacon/blocks/index.d.ts.map +1 -1
  2. package/lib/api/impl/beacon/blocks/index.js +1 -3
  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 +8 -0
  6. package/lib/api/impl/beacon/pool/index.js.map +1 -1
  7. package/lib/api/impl/beacon/state/index.d.ts.map +1 -1
  8. package/lib/api/impl/beacon/state/index.js +3 -2
  9. package/lib/api/impl/beacon/state/index.js.map +1 -1
  10. package/lib/api/impl/beacon/state/utils.js +1 -1
  11. package/lib/api/impl/beacon/state/utils.js.map +1 -1
  12. package/lib/api/impl/errors.d.ts +7 -0
  13. package/lib/api/impl/errors.d.ts.map +1 -1
  14. package/lib/api/impl/errors.js +9 -0
  15. package/lib/api/impl/errors.js.map +1 -1
  16. package/lib/api/impl/validator/index.js +1 -1
  17. package/lib/api/impl/validator/index.js.map +1 -1
  18. package/lib/api/rest/base.d.ts.map +1 -1
  19. package/lib/api/rest/base.js +5 -2
  20. package/lib/api/rest/base.js.map +1 -1
  21. package/lib/chain/ColumnReconstructionTracker.d.ts +3 -0
  22. package/lib/chain/ColumnReconstructionTracker.d.ts.map +1 -1
  23. package/lib/chain/ColumnReconstructionTracker.js +3 -1
  24. package/lib/chain/ColumnReconstructionTracker.js.map +1 -1
  25. package/lib/chain/GetBlobsTracker.d.ts +3 -0
  26. package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
  27. package/lib/chain/GetBlobsTracker.js +3 -1
  28. package/lib/chain/GetBlobsTracker.js.map +1 -1
  29. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts +2 -1
  30. package/lib/chain/blocks/payloadEnvelopeInput/types.d.ts.map +1 -1
  31. package/lib/chain/chain.d.ts +2 -1
  32. package/lib/chain/chain.d.ts.map +1 -1
  33. package/lib/chain/chain.js +16 -5
  34. package/lib/chain/chain.js.map +1 -1
  35. package/lib/chain/errors/dataColumnSidecarError.d.ts +7 -0
  36. package/lib/chain/errors/dataColumnSidecarError.d.ts.map +1 -1
  37. package/lib/chain/errors/dataColumnSidecarError.js +1 -0
  38. package/lib/chain/errors/dataColumnSidecarError.js.map +1 -1
  39. package/lib/chain/forkChoice/index.d.ts.map +1 -1
  40. package/lib/chain/forkChoice/index.js +19 -12
  41. package/lib/chain/forkChoice/index.js.map +1 -1
  42. package/lib/chain/interface.d.ts +2 -1
  43. package/lib/chain/interface.d.ts.map +1 -1
  44. package/lib/chain/interface.js.map +1 -1
  45. package/lib/chain/options.d.ts.map +1 -1
  46. package/lib/chain/options.js +0 -2
  47. package/lib/chain/options.js.map +1 -1
  48. package/lib/chain/seenCache/index.d.ts +1 -0
  49. package/lib/chain/seenCache/index.d.ts.map +1 -1
  50. package/lib/chain/seenCache/index.js +1 -0
  51. package/lib/chain/seenCache/index.js.map +1 -1
  52. package/lib/chain/seenCache/seenBlockProposers.d.ts +3 -0
  53. package/lib/chain/seenCache/seenBlockProposers.d.ts.map +1 -1
  54. package/lib/chain/seenCache/seenBlockProposers.js +6 -2
  55. package/lib/chain/seenCache/seenBlockProposers.js.map +1 -1
  56. package/lib/chain/seenCache/seenDataColumnSidecars.d.ts +17 -0
  57. package/lib/chain/seenCache/seenDataColumnSidecars.d.ts.map +1 -0
  58. package/lib/chain/seenCache/seenDataColumnSidecars.js +61 -0
  59. package/lib/chain/seenCache/seenDataColumnSidecars.js.map +1 -0
  60. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts +11 -2
  61. package/lib/chain/seenCache/seenPayloadEnvelopeInput.d.ts.map +1 -1
  62. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js +28 -2
  63. package/lib/chain/seenCache/seenPayloadEnvelopeInput.js.map +1 -1
  64. package/lib/chain/validation/attestation.d.ts.map +1 -1
  65. package/lib/chain/validation/attestation.js +4 -2
  66. package/lib/chain/validation/attestation.js.map +1 -1
  67. package/lib/chain/validation/block.d.ts.map +1 -1
  68. package/lib/chain/validation/block.js +12 -2
  69. package/lib/chain/validation/block.js.map +1 -1
  70. package/lib/chain/validation/dataColumnSidecar.js +1 -1
  71. package/lib/chain/validation/dataColumnSidecar.js.map +1 -1
  72. package/lib/index.d.ts +1 -0
  73. package/lib/index.d.ts.map +1 -1
  74. package/lib/index.js +1 -0
  75. package/lib/index.js.map +1 -1
  76. package/lib/network/core/networkCore.d.ts +1 -3
  77. package/lib/network/core/networkCore.d.ts.map +1 -1
  78. package/lib/network/core/networkCore.js +1 -3
  79. package/lib/network/core/networkCore.js.map +1 -1
  80. package/lib/network/forks.d.ts +2 -2
  81. package/lib/network/forks.d.ts.map +1 -1
  82. package/lib/network/forks.js +3 -3
  83. package/lib/network/forks.js.map +1 -1
  84. package/lib/network/gossip/scoringParameters.js +19 -14
  85. package/lib/network/gossip/scoringParameters.js.map +1 -1
  86. package/lib/network/network.d.ts +1 -6
  87. package/lib/network/network.d.ts.map +1 -1
  88. package/lib/network/network.js +16 -40
  89. package/lib/network/network.js.map +1 -1
  90. package/lib/network/options.d.ts +0 -1
  91. package/lib/network/options.d.ts.map +1 -1
  92. package/lib/network/options.js +0 -1
  93. package/lib/network/options.js.map +1 -1
  94. package/lib/network/peers/discover.d.ts +1 -0
  95. package/lib/network/peers/discover.d.ts.map +1 -1
  96. package/lib/network/peers/discover.js +44 -48
  97. package/lib/network/peers/discover.js.map +1 -1
  98. package/lib/network/peers/score/store.d.ts.map +1 -1
  99. package/lib/network/peers/score/store.js +1 -2
  100. package/lib/network/peers/score/store.js.map +1 -1
  101. package/lib/network/processor/gossipHandlers.d.ts.map +1 -1
  102. package/lib/network/processor/gossipHandlers.js +76 -10
  103. package/lib/network/processor/gossipHandlers.js.map +1 -1
  104. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.d.ts.map +1 -1
  105. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js +3 -1
  106. package/lib/network/reqresp/handlers/dataColumnSidecarsByRange.js.map +1 -1
  107. package/lib/sync/range/chain.d.ts.map +1 -1
  108. package/lib/sync/range/chain.js +1 -0
  109. package/lib/sync/range/chain.js.map +1 -1
  110. package/lib/sync/range/range.d.ts.map +1 -1
  111. package/lib/sync/range/range.js +5 -1
  112. package/lib/sync/range/range.js.map +1 -1
  113. package/lib/sync/unknownBlock.d.ts.map +1 -1
  114. package/lib/sync/unknownBlock.js +14 -1
  115. package/lib/sync/unknownBlock.js.map +1 -1
  116. package/lib/sync/utils/downloadByRange.d.ts +6 -0
  117. package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
  118. package/lib/sync/utils/downloadByRange.js +17 -8
  119. package/lib/sync/utils/downloadByRange.js.map +1 -1
  120. package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
  121. package/lib/sync/utils/downloadByRoot.js +1 -1
  122. package/lib/sync/utils/downloadByRoot.js.map +1 -1
  123. package/lib/sync/utils/pendingBlocksTree.d.ts.map +1 -1
  124. package/lib/sync/utils/pendingBlocksTree.js +6 -1
  125. package/lib/sync/utils/pendingBlocksTree.js.map +1 -1
  126. package/lib/util/dataColumns.d.ts +2 -1
  127. package/lib/util/dataColumns.d.ts.map +1 -1
  128. package/lib/util/dataColumns.js +7 -2
  129. package/lib/util/dataColumns.js.map +1 -1
  130. package/lib/util/execution.d.ts +2 -1
  131. package/lib/util/execution.d.ts.map +1 -1
  132. package/lib/util/execution.js +7 -2
  133. package/lib/util/execution.js.map +1 -1
  134. package/package.json +18 -21
  135. package/src/api/impl/beacon/blocks/index.ts +1 -5
  136. package/src/api/impl/beacon/pool/index.ts +11 -0
  137. package/src/api/impl/beacon/state/index.ts +3 -7
  138. package/src/api/impl/beacon/state/utils.ts +1 -1
  139. package/src/api/impl/errors.ts +10 -0
  140. package/src/api/impl/validator/index.ts +1 -1
  141. package/src/api/rest/base.ts +4 -2
  142. package/src/chain/ColumnReconstructionTracker.ts +5 -1
  143. package/src/chain/GetBlobsTracker.ts +5 -0
  144. package/src/chain/blocks/payloadEnvelopeInput/types.ts +8 -1
  145. package/src/chain/chain.ts +21 -4
  146. package/src/chain/errors/dataColumnSidecarError.ts +8 -0
  147. package/src/chain/forkChoice/index.ts +19 -13
  148. package/src/chain/interface.ts +2 -0
  149. package/src/chain/options.ts +0 -2
  150. package/src/chain/seenCache/index.ts +1 -0
  151. package/src/chain/seenCache/seenBlockProposers.ts +12 -2
  152. package/src/chain/seenCache/seenDataColumnSidecars.ts +69 -0
  153. package/src/chain/seenCache/seenPayloadEnvelopeInput.ts +28 -2
  154. package/src/chain/validation/attestation.ts +4 -2
  155. package/src/chain/validation/block.ts +11 -2
  156. package/src/chain/validation/dataColumnSidecar.ts +1 -1
  157. package/src/index.ts +1 -0
  158. package/src/network/core/networkCore.ts +1 -3
  159. package/src/network/forks.ts +7 -3
  160. package/src/network/gossip/scoringParameters.ts +23 -14
  161. package/src/network/network.ts +20 -44
  162. package/src/network/options.ts +0 -2
  163. package/src/network/peers/discover.ts +42 -52
  164. package/src/network/peers/score/store.ts +1 -2
  165. package/src/network/processor/gossipHandlers.ts +135 -18
  166. package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +4 -1
  167. package/src/sync/range/chain.ts +1 -0
  168. package/src/sync/range/range.ts +7 -1
  169. package/src/sync/unknownBlock.ts +20 -1
  170. package/src/sync/utils/downloadByRange.ts +30 -7
  171. package/src/sync/utils/downloadByRoot.ts +12 -9
  172. package/src/sync/utils/pendingBlocksTree.ts +6 -1
  173. package/src/util/dataColumns.ts +13 -1
  174. package/src/util/execution.ts +16 -1
@@ -114,16 +114,12 @@ export function getBeaconStateApi({
114
114
  if (resp.valid) {
115
115
  const validatorIndex = resp.validatorIndex;
116
116
  const validator = state.getValidator(validatorIndex);
117
- const status = getValidatorStatus(validator, currentEpoch);
117
+ const balance = state.getBalance(validatorIndex);
118
+ const status = getValidatorStatus(validator, balance, currentEpoch);
118
119
  if (statuses.length && !statuses.includes(status) && !statuses.includes(mapToGeneralStatus(status))) {
119
120
  continue;
120
121
  }
121
- const validatorResponse = toValidatorResponse(
122
- validatorIndex,
123
- validator,
124
- state.getBalance(validatorIndex),
125
- currentEpoch
126
- );
122
+ const validatorResponse = toValidatorResponse(validatorIndex, validator, balance, currentEpoch);
127
123
  validatorResponses.push(validatorResponse);
128
124
  }
129
125
  }
@@ -109,7 +109,7 @@ export function toValidatorResponse(
109
109
  ): routes.beacon.ValidatorResponse {
110
110
  return {
111
111
  index,
112
- status: getValidatorStatus(validator, currentEpoch),
112
+ status: getValidatorStatus(validator, balance, currentEpoch),
113
113
  balance,
114
114
  validator,
115
115
  };
@@ -28,6 +28,16 @@ export class NodeIsSyncing extends ApiError {
28
28
  }
29
29
  }
30
30
 
31
+ /**
32
+ * A service that is not ready to serve the request yet, e.g. while it is starting up. Expected to happen for every
33
+ * request until it is ready, the REST API server logs it at debug instead of as a warning
34
+ */
35
+ export class ServiceNotReady extends ApiError {
36
+ constructor(message: string) {
37
+ super(503, message);
38
+ }
39
+ }
40
+
31
41
  // Error thrown by beacon node APIs that are only supported by distributed validator middleware clients
32
42
  // For example https://github.com/ethereum/beacon-APIs/blob/f087fbf2764e657578a6c29bdf0261b36ee8db1e/apis/validator/beacon_committee_selections.yaml
33
43
  export class OnlySupportedByDVT extends ApiError {
@@ -2174,7 +2174,7 @@ export function getValidatorApi(
2174
2174
  if (validatorIndex === null || validatorIndex >= headState.validatorCount) return false;
2175
2175
 
2176
2176
  const validator = headState.getValidator(validatorIndex);
2177
- const status = getValidatorStatus(validator, currentEpoch);
2177
+ const status = getValidatorStatus(validator, headState.getBalance(validatorIndex), currentEpoch);
2178
2178
  return (
2179
2179
  status === "active_exiting" ||
2180
2180
  status === "active_ongoing" ||
@@ -7,7 +7,7 @@ import {NUMBER_OF_COLUMNS} from "@lodestar/params";
7
7
  import {ErrorAborted, Gauge, Histogram, Logger} from "@lodestar/utils";
8
8
  import {GossipActionError} from "../../chain/errors/gossipValidation.js";
9
9
  import {isLocalhostIP} from "../../util/ip.js";
10
- import {ApiError, FailureList, IndexedError, NodeIsSyncing} from "../impl/errors.js";
10
+ import {ApiError, FailureList, IndexedError, NodeIsSyncing, ServiceNotReady} from "../impl/errors.js";
11
11
  import {HttpActiveSocketsTracker, SocketMetrics} from "./activeSockets.js";
12
12
 
13
13
  export type RestApiServerOpts = {
@@ -178,7 +178,9 @@ export class RestApiServer {
178
178
 
179
179
  const operationId = getOperationId(req);
180
180
 
181
- if (
181
+ if (err instanceof ServiceNotReady) {
182
+ this.logger.debug(`Req ${req.id} ${operationId} failed`, {reason: err.message});
183
+ } else if (
182
184
  err instanceof ApiError ||
183
185
  err instanceof GossipActionError ||
184
186
  [INVALID_MEDIA_TYPE_CODE, SCHEMA_VALIDATION_ERROR_CODE].includes(err.code)
@@ -8,6 +8,7 @@ import {JobItemQueue} from "../util/queue/index.js";
8
8
  import {BlockInputColumns} from "./blocks/blockInput/index.js";
9
9
  import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
10
10
  import {ChainEventEmitter} from "./emitter.js";
11
+ import {SeenDataColumnSidecars} from "./seenCache/seenDataColumnSidecars.js";
11
12
 
12
13
  /**
13
14
  * Minimum time to wait before attempting reconstruction
@@ -31,6 +32,7 @@ export type ColumnReconstructionInput = BlockInputColumns | PayloadEnvelopeInput
31
32
  export type ColumnReconstructionTrackerInit = {
32
33
  logger: Logger;
33
34
  emitter: ChainEventEmitter;
35
+ seenDataColumnSidecars: SeenDataColumnSidecars;
34
36
  metrics: Metrics | null;
35
37
  config: ChainForkConfig;
36
38
  signal: AbortSignal;
@@ -44,6 +46,7 @@ export type ColumnReconstructionTrackerInit = {
44
46
  export class ColumnReconstructionTracker {
45
47
  logger: Logger;
46
48
  emitter: ChainEventEmitter;
49
+ seenDataColumnSidecars: SeenDataColumnSidecars;
47
50
  metrics: Metrics | null;
48
51
  config: ChainForkConfig;
49
52
 
@@ -54,6 +57,7 @@ export class ColumnReconstructionTracker {
54
57
  constructor(init: ColumnReconstructionTrackerInit) {
55
58
  this.logger = init.logger;
56
59
  this.emitter = init.emitter;
60
+ this.seenDataColumnSidecars = init.seenDataColumnSidecars;
57
61
  this.metrics = init.metrics;
58
62
  this.config = init.config;
59
63
  this.signal = init.signal;
@@ -104,7 +108,7 @@ export class ColumnReconstructionTracker {
104
108
  const logCtx = {slot: input.slot, root: input.blockRootHex};
105
109
  this.logger.debug("Attempting data column sidecar reconstruction", logCtx);
106
110
  try {
107
- const result = await recoverDataColumnSidecars(input, this.emitter, this.metrics);
111
+ const result = await recoverDataColumnSidecars(input, this.emitter, this.seenDataColumnSidecars, this.metrics);
108
112
  this.metrics?.recoverDataColumnSidecars.reconstructionResult.inc({result});
109
113
  this.logger.debug("Data column sidecar reconstruction complete", {...logCtx, result});
110
114
  } catch (e) {
@@ -8,6 +8,7 @@ import {DataColumnEngineResult, getDataColumnSidecarsFromExecution} from "../uti
8
8
  import {IBlockInput, isBlockInputColumns} from "./blocks/blockInput/index.js";
9
9
  import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
10
10
  import {ChainEventEmitter} from "./emitter.js";
11
+ import {SeenDataColumnSidecars} from "./seenCache/seenDataColumnSidecars.js";
11
12
 
12
13
  /** A `null` answer only changes if the EL receives the transactions later, so retries are few and spaced out */
13
14
  export const MAX_GET_BLOBS_ATTEMPTS = 3;
@@ -18,6 +19,7 @@ export type GetBlobsTrackerInit = {
18
19
  logger: Logger;
19
20
  executionEngine: Pick<IExecutionEngine, "getBlobs">;
20
21
  emitter: ChainEventEmitter;
22
+ seenDataColumnSidecars: SeenDataColumnSidecars;
21
23
  metrics: Metrics | null;
22
24
  config: ChainForkConfig;
23
25
  };
@@ -29,6 +31,7 @@ export class GetBlobsTracker {
29
31
  logger: Logger;
30
32
  executionEngine: Pick<IExecutionEngine, "getBlobs">;
31
33
  emitter: ChainEventEmitter;
34
+ seenDataColumnSidecars: SeenDataColumnSidecars;
32
35
  metrics: Metrics | null;
33
36
  config: ChainForkConfig;
34
37
  activeReconstructions = new Set<string>();
@@ -42,6 +45,7 @@ export class GetBlobsTracker {
42
45
  this.logger = init.logger;
43
46
  this.executionEngine = init.executionEngine;
44
47
  this.emitter = init.emitter;
48
+ this.seenDataColumnSidecars = init.seenDataColumnSidecars;
45
49
  this.metrics = init.metrics;
46
50
  this.config = init.config;
47
51
  }
@@ -101,6 +105,7 @@ export class GetBlobsTracker {
101
105
  this.config,
102
106
  this.executionEngine,
103
107
  this.emitter,
108
+ this.seenDataColumnSidecars,
104
109
  input,
105
110
  this.metrics,
106
111
  this.blobsAndProofsBuffers[freeIndex].buffers
@@ -22,9 +22,16 @@ export enum PayloadEnvelopeInputSource {
22
22
  * - finalized: below the finalized slot
23
23
  * - prune: explicit prune by root
24
24
  * - cap: insertion-order backstop cap (MAX_PAYLOAD_ENVELOPE_INPUT_CACHE_SIZE)
25
+ * - capUnvalidated: cap eviction of an entry whose block is not validated and imported yet, evicted before the rest
25
26
  * - invalid: the cached envelope failed import with a definitive invalid verdict
26
27
  */
27
- export type PayloadEnvelopeInputPruneReason = "belowParent" | "finalized" | "remove" | "cap" | "invalid";
28
+ export type PayloadEnvelopeInputPruneReason =
29
+ | "belowParent"
30
+ | "finalized"
31
+ | "remove"
32
+ | "cap"
33
+ | "capUnvalidated"
34
+ | "invalid";
28
35
 
29
36
  export type SourceMeta = {
30
37
  source: PayloadEnvelopeInputSource;
@@ -127,6 +127,7 @@ import {
127
127
  SeenAttesters,
128
128
  SeenBlockProposers,
129
129
  SeenContributionAndProof,
130
+ SeenDataColumnSidecars,
130
131
  SeenExecutionPayloadBids,
131
132
  SeenPayloadAttesters,
132
133
  SeenPayloadEnvelopeInput,
@@ -224,6 +225,7 @@ export class BeaconChain implements IBeaconChain {
224
225
  readonly seenAggregatedAttestations: SeenAggregatedAttestations;
225
226
  readonly seenExecutionPayloadBids = new SeenExecutionPayloadBids();
226
227
  readonly seenBlockProposers = new SeenBlockProposers();
228
+ readonly seenDataColumnSidecars = new SeenDataColumnSidecars();
227
229
  /** Proposer indexes with an in-flight proposer slashing production */
228
230
  private readonly producingProposerSlashing = new Set<ValidatorIndex>();
229
231
  readonly seenSyncCommitteeMessages = new SeenSyncCommitteeMessages();
@@ -501,12 +503,14 @@ export class BeaconChain implements IBeaconChain {
501
503
  });
502
504
 
503
505
  const anchorBlockSlot = anchorState.latestBlockHeader.slot;
504
- if (isStatePostGloas(anchorState) && anchorBlockSlot > 0) {
506
+ const anchorBlockFork = config.getForkName(anchorBlockSlot);
507
+ // A pre-Gloas anchor in a state upgraded to Gloas carried its own payload, no envelope follows it
508
+ if (isStatePostGloas(anchorState) && anchorBlockSlot > 0 && isForkPostGloas(anchorBlockFork)) {
505
509
  const anchorBid = anchorState.latestExecutionPayloadBid;
506
510
  this.seenPayloadEnvelopeInputCache.addFromBid({
507
511
  blockRootHex: toRootHex(checkpoint.root),
508
512
  slot: anchorBlockSlot,
509
- forkName: anchorState.forkName,
513
+ forkName: anchorBlockFork,
510
514
  proposerIndex: anchorState.latestBlockHeader.proposerIndex,
511
515
  bid: anchorBid,
512
516
  sampledColumns: this.custodyConfig.sampledColumns,
@@ -525,12 +529,14 @@ export class BeaconChain implements IBeaconChain {
525
529
  logger,
526
530
  executionEngine: this.executionEngine,
527
531
  emitter,
532
+ seenDataColumnSidecars: this.seenDataColumnSidecars,
528
533
  metrics,
529
534
  config,
530
535
  });
531
536
  this.columnReconstructionTracker = new ColumnReconstructionTracker({
532
537
  logger,
533
538
  emitter,
539
+ seenDataColumnSidecars: this.seenDataColumnSidecars,
534
540
  metrics,
535
541
  config,
536
542
  signal,
@@ -2037,9 +2043,18 @@ export class BeaconChain implements IBeaconChain {
2037
2043
 
2038
2044
  const finalizedSlot = computeStartSlotAtEpoch(cp.epoch);
2039
2045
  this.seenBlockProposers.prune(finalizedSlot);
2046
+ this.seenDataColumnSidecars.prune(finalizedSlot);
2040
2047
 
2041
2048
  // Update validator custody to account for effective balance changes
2042
- await this.updateValidatorsCustodyRequirement(cp);
2049
+ try {
2050
+ await this.updateValidatorsCustodyRequirement(cp);
2051
+ } catch (e) {
2052
+ this.logger.warn(
2053
+ "Error updating validators custody requirement",
2054
+ {epoch: cp.epoch, root: cp.rootHex},
2055
+ e as Error
2056
+ );
2057
+ }
2043
2058
 
2044
2059
  // TODO: Improve using regen here
2045
2060
  const {blockRoot, stateRoot, slot} = this.forkChoice.getHead();
@@ -2145,7 +2160,9 @@ export class BeaconChain implements IBeaconChain {
2145
2160
  if (stateOrBytes instanceof Uint8Array) {
2146
2161
  effectiveBalances = getEffectiveBalancesFromStateBytes(this.config, stateOrBytes, validatorIndices);
2147
2162
  } else {
2148
- effectiveBalances = validatorIndices.map((index) => stateOrBytes.getValidator(index).effectiveBalance ?? 0);
2163
+ effectiveBalances = validatorIndices.map((index) =>
2164
+ index < stateOrBytes.validatorCount ? stateOrBytes.getValidator(index).effectiveBalance : 0
2165
+ );
2149
2166
  }
2150
2167
  }
2151
2168
 
@@ -35,6 +35,7 @@ export enum DataColumnSidecarErrorCode {
35
35
 
36
36
  // following errors are adapted from the block errors
37
37
  ALREADY_KNOWN = "DATA_COLUMN_SIDECAR_ERROR_ALREADY_KNOWN",
38
+ REPEAT_PROPOSAL = "DATA_COLUMN_SIDECAR_ERROR_REPEAT_PROPOSAL",
38
39
  FUTURE_SLOT = "DATA_COLUMN_SIDECAR_ERROR_FUTURE_SLOT",
39
40
  WOULD_REVERT_FINALIZED_SLOT = "DATA_COLUMN_SIDECAR_ERROR_WOULD_REVERT_FINALIZED_SLOT",
40
41
  PARENT_UNKNOWN = "DATA_COLUMN_SIDECAR_ERROR_PARENT_UNKNOWN",
@@ -79,6 +80,13 @@ export type DataColumnSidecarErrorType =
79
80
  limit: number;
80
81
  }
81
82
  | {code: DataColumnSidecarErrorCode.ALREADY_KNOWN; columnIndex: number; slot: Slot}
83
+ | {
84
+ code: DataColumnSidecarErrorCode.REPEAT_PROPOSAL;
85
+ slot: Slot;
86
+ proposerIndex: number;
87
+ columnIndex: number;
88
+ root: RootHex;
89
+ }
82
90
  | {code: DataColumnSidecarErrorCode.FUTURE_SLOT; blockSlot: Slot; currentSlot: Slot}
83
91
  | {code: DataColumnSidecarErrorCode.WOULD_REVERT_FINALIZED_SLOT; blockSlot: Slot; finalizedSlot: Slot}
84
92
  | {
@@ -13,7 +13,7 @@ import {
13
13
  ProtoBlock,
14
14
  ForkChoiceOpts as RawForkChoiceOpts,
15
15
  } from "@lodestar/fork-choice";
16
- import {ForkSeq, SLOTS_PER_HISTORICAL_ROOT, ZERO_HASH_HEX} from "@lodestar/params";
16
+ import {ForkSeq, SLOTS_PER_HISTORICAL_ROOT, ZERO_HASH_HEX, isForkPostGloas} from "@lodestar/params";
17
17
  import {
18
18
  DataAvailabilityStatus,
19
19
  IBeaconStateView,
@@ -135,7 +135,7 @@ export function initializeForkChoiceFromFinalizedState(
135
135
  // production code use ForkChoice constructor directly
136
136
  const forkchoiceConstructor = opts.forkchoiceConstructor ?? ForkChoice;
137
137
 
138
- const isForkPostGloas = computeEpochAtSlot(state.slot) >= config.GLOAS_FORK_EPOCH;
138
+ const isPostGloasAnchor = isStatePostGloas(state) && isForkPostGloas(config.getForkName(blockHeader.slot));
139
139
 
140
140
  return new forkchoiceConstructor(
141
141
  config,
@@ -184,15 +184,20 @@ export function initializeForkChoiceFromFinalizedState(
184
184
  // TODO GLOAS: executionPayloadNumber/GasLimit are not tracked in BeaconState post-gloas
185
185
  // (EIP-7732 removed latestExecutionPayloadHeader). Using 0 as unavailable fallback —
186
186
  // see initializeForkChoiceFromUnfinalizedState for the same caveat on validation.
187
+ // A pre-Gloas anchor's gas limit is kept in the state's bid by the upgrade.
187
188
  executionPayloadNumber: isStatePostGloas(state) ? 0 : state.payloadBlockNumber,
188
- executionPayloadGasLimit: isStatePostGloas(state) ? 0 : state.latestExecutionPayloadHeader.gasLimit,
189
+ executionPayloadGasLimit: isPostGloasAnchor
190
+ ? 0
191
+ : isStatePostGloas(state)
192
+ ? Number(state.latestExecutionPayloadBid.gasLimit)
193
+ : state.latestExecutionPayloadHeader.gasLimit,
189
194
  executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
190
195
  }
191
196
  : {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
192
197
 
193
198
  dataAvailabilityStatus: DataAvailabilityStatus.PreData,
194
- payloadStatus: isForkPostGloas ? PayloadStatus.PENDING : PayloadStatus.FULL,
195
- parentBlockHash: isStatePostGloas(state) ? toRootHex(state.latestBlockHash) : null,
199
+ payloadStatus: isPostGloasAnchor ? PayloadStatus.PENDING : PayloadStatus.FULL,
200
+ parentBlockHash: isPostGloasAnchor ? toRootHex(state.latestBlockHash) : null,
196
201
  },
197
202
  currentSlot
198
203
  ),
@@ -313,9 +318,7 @@ export function initializeNativeForkChoice(
313
318
  : isPostGloas
314
319
  ? Number(state.latestExecutionPayloadBid.gasLimit)
315
320
  : state.latestExecutionPayloadHeader.gasLimit,
316
- // A Gloas payload is judged when its envelope arrives, the genesis one included
317
- executionStatus:
318
- blockHeader.slot === GENESIS_SLOT && !isPostGloasAnchor ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
321
+ executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
319
322
  }
320
323
  : {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
321
324
 
@@ -431,7 +434,7 @@ export function initializeForkChoiceFromUnfinalizedState(
431
434
  // this is not the justified state, but there is no other ways to get justified balances
432
435
  const justifiedBalances = unfinalizedState.getEffectiveBalanceIncrementsZeroInactive();
433
436
 
434
- const isForkPostGloas = computeEpochAtSlot(unfinalizedState.slot) >= config.GLOAS_FORK_EPOCH;
437
+ const isPostGloasAnchor = isStatePostGloas(unfinalizedState) && isForkPostGloas(config.getForkName(blockHeader.slot));
435
438
 
436
439
  const store = new ForkChoiceStore(
437
440
  currentSlot,
@@ -484,17 +487,20 @@ export function initializeForkChoiceFromUnfinalizedState(
484
487
  // PENDING/EMPTY convention), so gossip bids that reference the head's *own* payload
485
488
  // hash won't match this variant anyway and will IGNORE until `onExecutionPayload`
486
489
  // upgrades the head to FULL with real values.
490
+ // A pre-Gloas anchor's gas limit is kept in the state's bid by the upgrade.
487
491
  executionPayloadNumber: isStatePostGloas(unfinalizedState) ? 0 : unfinalizedState.payloadBlockNumber,
488
- executionPayloadGasLimit: isStatePostGloas(unfinalizedState)
492
+ executionPayloadGasLimit: isPostGloasAnchor
489
493
  ? 0
490
- : unfinalizedState.latestExecutionPayloadHeader.gasLimit,
494
+ : isStatePostGloas(unfinalizedState)
495
+ ? Number(unfinalizedState.latestExecutionPayloadBid.gasLimit)
496
+ : unfinalizedState.latestExecutionPayloadHeader.gasLimit,
491
497
  executionStatus: blockHeader.slot === GENESIS_SLOT ? ExecutionStatus.Valid : ExecutionStatus.Syncing,
492
498
  }
493
499
  : {executionPayloadBlockHash: null, executionStatus: ExecutionStatus.PreMerge}),
494
500
 
495
501
  dataAvailabilityStatus: DataAvailabilityStatus.PreData,
496
- payloadStatus: isForkPostGloas ? PayloadStatus.PENDING : PayloadStatus.FULL,
497
- parentBlockHash: isStatePostGloas(unfinalizedState) ? toRootHex(unfinalizedState.latestBlockHash) : null,
502
+ payloadStatus: isPostGloasAnchor ? PayloadStatus.PENDING : PayloadStatus.FULL,
503
+ parentBlockHash: isPostGloasAnchor ? toRootHex(unfinalizedState.latestBlockHash) : null,
498
504
  };
499
505
 
500
506
  const parentSlot = blockHeader.slot - 1;
@@ -68,6 +68,7 @@ import {
68
68
  SeenAttesters,
69
69
  SeenBlockProposers,
70
70
  SeenContributionAndProof,
71
+ SeenDataColumnSidecars,
71
72
  SeenExecutionPayloadBids,
72
73
  SeenPayloadAttesters,
73
74
  SeenSyncCommitteeMessages,
@@ -147,6 +148,7 @@ export interface IBeaconChain {
147
148
  readonly seenAggregatedAttestations: SeenAggregatedAttestations;
148
149
  readonly seenExecutionPayloadBids: SeenExecutionPayloadBids;
149
150
  readonly seenBlockProposers: SeenBlockProposers;
151
+ readonly seenDataColumnSidecars: SeenDataColumnSidecars;
150
152
  readonly seenSyncCommitteeMessages: SeenSyncCommitteeMessages;
151
153
  readonly seenContributionAndProof: SeenContributionAndProof;
152
154
  readonly seenAttestationDatas: SeenAttestationDatas;
@@ -123,8 +123,6 @@ export const defaultChainOptions: IChainOptions = {
123
123
  maxSkipSlots: 32,
124
124
  disableProposerSlashings: false,
125
125
  // should be less than or equal to MIN_SIGNATURE_SETS_TO_BATCH_VERIFY
126
- // batching too much may block the I/O thread so if useWorker=false, suggest this value to be 32
127
- // since this batch attestation work is designed to work with useWorker=true, make this the lowest value
128
126
  minSameMessageSignatureSetsToBatch: 2,
129
127
  // as of Feb 2025, this option turned out to be very useful:
130
128
  // - it allows to share a persisted checkpoint state to other nodes
@@ -2,6 +2,7 @@ export {SeenAggregators, SeenAttesters, SeenPayloadAttesters} from "./seenAttest
2
2
  export {SeenBlockProposers} from "./seenBlockProposers.js";
3
3
  export {SeenSyncCommitteeMessages} from "./seenCommittee.js";
4
4
  export {SeenContributionAndProof} from "./seenCommitteeContribution.js";
5
+ export {SeenDataColumnSidecars} from "./seenDataColumnSidecars.js";
5
6
  export {SeenExecutionPayloadBids} from "./seenExecutionPayloadBids.js";
6
7
  export {SeenBlockInput} from "./seenGossipBlockInput.js";
7
8
  export {PayloadEnvelopeInput, SeenPayloadEnvelopeInput} from "./seenPayloadEnvelopeInput.js";
@@ -1,9 +1,9 @@
1
1
  import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
2
2
  import {Epoch, RootHex, Slot, ValidatorIndex, phase0} from "@lodestar/types";
3
- import {MapDef} from "@lodestar/utils";
3
+ import {MapDef, byteArrayEquals} from "@lodestar/utils";
4
4
 
5
5
  /** Two distinct block roots signed by the same proposer for the same slot are sufficient to establish an equivocation */
6
- const MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL = 2;
6
+ export const MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL = 2;
7
7
 
8
8
  /**
9
9
  * Keeps a cache to filter block proposals from the same validator in the same slot.
@@ -44,6 +44,16 @@ export class SeenBlockProposers {
44
44
  return this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.has(blockRoot) === true;
45
45
  }
46
46
 
47
+ hasBlockSignature(
48
+ blockSlot: Slot,
49
+ proposerIndex: ValidatorIndex,
50
+ blockRoot: RootHex,
51
+ signature: Uint8Array
52
+ ): boolean {
53
+ const signedBlockHeader = this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.get(blockRoot);
54
+ return signedBlockHeader !== undefined && byteArrayEquals(signedBlockHeader.signature, signature);
55
+ }
56
+
47
57
  isEquivocating(blockSlot: Slot, proposerIndex: ValidatorIndex): boolean {
48
58
  return (
49
59
  (this.signedBlockHeadersBySlot.get(blockSlot)?.get(proposerIndex)?.size ?? 0) >=
@@ -0,0 +1,69 @@
1
+ import {ColumnIndex, RootHex, Slot, ValidatorIndex} from "@lodestar/types";
2
+ import {MapDef} from "@lodestar/utils";
3
+ import {MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL} from "./seenBlockProposers.js";
4
+
5
+ /**
6
+ * Tracks the column indices of valid gossip data column sidecars per slot, proposer and block root,
7
+ * to ignore sidecars of a repeated proposal. Sidecars are accepted for at most two block roots per slot and
8
+ * proposer, same as blocks. Pruned on finalization.
9
+ */
10
+ export class SeenDataColumnSidecars {
11
+ private readonly columnIndicesBySlot = new MapDef<Slot, MapDef<ValidatorIndex, MapDef<RootHex, Set<ColumnIndex>>>>(
12
+ () => new MapDef(() => new MapDef(() => new Set()))
13
+ );
14
+ private readonly evidenceChecksBySlot = new MapDef<Slot, Set<ValidatorIndex>>(() => new Set());
15
+ private finalizedSlot: Slot = 0;
16
+
17
+ isRepeatProposal(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): boolean {
18
+ const columnIndicesByRoot = this.columnIndicesBySlot.get(slot)?.get(proposerIndex);
19
+ if (columnIndicesByRoot === undefined) {
20
+ return false;
21
+ }
22
+ if (!columnIndicesByRoot.has(blockRoot) && columnIndicesByRoot.size >= MIN_EQUIVOCATION_BLOCK_ROOTS_PER_PROPOSAL) {
23
+ return true;
24
+ }
25
+ for (const [root, columnIndices] of columnIndicesByRoot) {
26
+ if (root !== blockRoot && columnIndices.has(columnIndex)) {
27
+ return true;
28
+ }
29
+ }
30
+ return false;
31
+ }
32
+
33
+ isKnown(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): boolean {
34
+ return this.columnIndicesBySlot.get(slot)?.get(proposerIndex)?.get(blockRoot)?.has(columnIndex) === true;
35
+ }
36
+
37
+ add(slot: Slot, proposerIndex: ValidatorIndex, columnIndex: ColumnIndex, blockRoot: RootHex): void {
38
+ if (slot < this.finalizedSlot || this.isRepeatProposal(slot, proposerIndex, columnIndex, blockRoot)) {
39
+ return;
40
+ }
41
+ this.columnIndicesBySlot.getOrDefault(slot).getOrDefault(proposerIndex).getOrDefault(blockRoot).add(columnIndex);
42
+ }
43
+
44
+ markEvidenceCheck(slot: Slot, proposerIndex: ValidatorIndex): boolean {
45
+ if (slot < this.finalizedSlot) {
46
+ return false;
47
+ }
48
+ const proposers = this.evidenceChecksBySlot.getOrDefault(slot);
49
+ if (proposers.has(proposerIndex)) {
50
+ return false;
51
+ }
52
+ proposers.add(proposerIndex);
53
+ return true;
54
+ }
55
+
56
+ prune(finalizedSlot: Slot): void {
57
+ this.finalizedSlot = finalizedSlot;
58
+ for (const slot of this.columnIndicesBySlot.keys()) {
59
+ if (slot < finalizedSlot) {
60
+ this.columnIndicesBySlot.delete(slot);
61
+ }
62
+ }
63
+ for (const slot of this.evidenceChecksBySlot.keys()) {
64
+ if (slot < finalizedSlot) {
65
+ this.evidenceChecksBySlot.delete(slot);
66
+ }
67
+ }
68
+ }
69
+ }
@@ -64,6 +64,7 @@ export class SeenPayloadEnvelopeInput {
64
64
  private readonly metrics: Metrics | null;
65
65
  private readonly logger?: Logger;
66
66
  private payloadInputs = new Map<RootHex, PayloadEnvelopeInput>();
67
+ private readonly unvalidatedRoots = new Set<RootHex>();
67
68
  // Dedup concurrent DB reloads of the same root so callers share one reconstructed object.
68
69
  private readonly reloading = new Map<RootHex, Promise<PayloadEnvelopeInput | undefined>>();
69
70
 
@@ -127,9 +128,17 @@ export class SeenPayloadEnvelopeInput {
127
128
  });
128
129
  };
129
130
 
130
- add(props: Omit<CreateFromBlockProps, "daOutOfRange">): PayloadEnvelopeInput {
131
+ /**
132
+ * Set `unvalidated` for a block of which only the proposer signature is verified, e.g. one retained for unknown
133
+ * parent sync. Such entries are evicted first when the cache is over its max size, until the block passes gossip
134
+ * validation or is imported. Adding an existing entry without `unvalidated` promotes it without replacing it.
135
+ */
136
+ add(props: Omit<CreateFromBlockProps, "daOutOfRange">, opts?: {unvalidated?: boolean}): PayloadEnvelopeInput {
131
137
  const existing = this.payloadInputs.get(props.blockRootHex);
132
138
  if (existing !== undefined) {
139
+ if (!opts?.unvalidated) {
140
+ this.unvalidatedRoots.delete(props.blockRootHex);
141
+ }
133
142
  this.logger?.verbose("SeenPayloadEnvelopeInput.add reused existing entry", {
134
143
  slot: existing.slot,
135
144
  root: props.blockRootHex,
@@ -139,6 +148,9 @@ export class SeenPayloadEnvelopeInput {
139
148
  const daOutOfRange = isDaOutOfRange(this.config, props.forkName, props.block.message.slot, this.clock.currentEpoch);
140
149
  const input = PayloadEnvelopeInput.createFromBlock({...props, daOutOfRange});
141
150
  this.payloadInputs.set(props.blockRootHex, input);
151
+ if (opts?.unvalidated) {
152
+ this.unvalidatedRoots.add(props.blockRootHex);
153
+ }
142
154
  this.metrics?.seenCache.payloadEnvelopeInput.created.inc({source: props.source});
143
155
  this.logger?.verbose("SeenPayloadEnvelopeInput.add created new entry", {
144
156
  slot: input.slot,
@@ -300,12 +312,25 @@ export class SeenPayloadEnvelopeInput {
300
312
 
301
313
  /**
302
314
  * Bound this cache to have at most MAX_PAYLOAD_ENVELOPE_INPUT_CACHE_SIZE items.
303
- * Evicts by insertion order so a just-reloaded old-slot entry is not evicted right after.
315
+ * Evicts entries of unvalidated blocks that are not imported yet first, then the rest by insertion order so a
316
+ * just-reloaded old-slot entry is not evicted right after.
304
317
  * On unstable network, we may need to query an evicted item, UnknownBlockInput will recover
305
318
  * it from db via getOrReload() api. Runs after every single insert, so it evicts ~1 per call.
306
319
  */
307
320
  private pruneToMaxSize(): void {
308
321
  let evicted = 0;
322
+ for (const blockRootHex of this.unvalidatedRoots) {
323
+ if (this.payloadInputs.size <= MAX_PAYLOAD_ENVELOPE_INPUT_CACHE_SIZE) {
324
+ break;
325
+ }
326
+ const input = this.payloadInputs.get(blockRootHex);
327
+ if (input === undefined || this.forkChoice.hasBlockHex(blockRootHex)) {
328
+ this.unvalidatedRoots.delete(blockRootHex);
329
+ continue;
330
+ }
331
+ this.evictPayloadInput(input, "capUnvalidated");
332
+ evicted++;
333
+ }
309
334
  for (const input of this.payloadInputs.values()) {
310
335
  if (this.payloadInputs.size <= MAX_PAYLOAD_ENVELOPE_INPUT_CACHE_SIZE) {
311
336
  break;
@@ -331,5 +356,6 @@ export class SeenPayloadEnvelopeInput {
331
356
  });
332
357
  this.serializedCache.delete(payloadInput.getSerializedCacheKeys());
333
358
  this.payloadInputs.delete(payloadInput.blockRootHex);
359
+ this.unvalidatedRoots.delete(payloadInput.blockRootHex);
334
360
  }
335
361
  }
@@ -261,10 +261,12 @@ async function validateAttestationNoSignatureCheck(
261
261
  const attSlot = attestationOrBytes.attSlot;
262
262
  attDataKey = getSeenAttDataKeyFromGossipAttestation(attestationOrBytes);
263
263
  const committeeIndexForLookup = isForkPostElectra(fork)
264
- ? (getCommitteeIndexFromAttestationOrBytes(fork, attestationOrBytes) ?? 0)
264
+ ? getCommitteeIndexFromAttestationOrBytes(fork, attestationOrBytes)
265
265
  : PRE_ELECTRA_SINGLE_ATTESTATION_COMMITTEE_INDEX;
266
266
  const cachedAttData =
267
- attDataKey !== null ? chain.seenAttestationDatas.get(attSlot, committeeIndexForLookup, attDataKey) : null;
267
+ attDataKey !== null && committeeIndexForLookup !== null
268
+ ? chain.seenAttestationDatas.get(attSlot, committeeIndexForLookup, attDataKey)
269
+ : null;
268
270
  if (cachedAttData === null) {
269
271
  const attestation = sszDeserializeSingleAttestation(fork, attestationOrBytes.serializedData);
270
272
  // only deserialize on the first AttestationData that's not cached
@@ -76,8 +76,17 @@ export async function validateGossipBlock(
76
76
  const proposerIndex = block.proposerIndex;
77
77
  if (chain.seenBlockProposers.isKnown(blockSlot, proposerIndex)) {
78
78
  if (chain.seenBlockProposers.isRepeatProposal(blockSlot, proposerIndex, blockRoot)) {
79
- const hasBlockRoot = chain.seenBlockProposers.hasBlockRoot(blockSlot, proposerIndex, blockRoot);
80
- if (!hasBlockRoot && !chain.seenBlockProposers.isEquivocating(blockSlot, proposerIndex)) {
79
+ if (chain.seenBlockProposers.hasBlockRoot(blockSlot, proposerIndex, blockRoot)) {
80
+ // The root is known with a verified signature, e.g. from the header of a data column sidecar, and a valid
81
+ // BLS signature of the same message by the same proposer is unique
82
+ if (!chain.seenBlockProposers.hasBlockSignature(blockSlot, proposerIndex, blockRoot, signedBlock.signature)) {
83
+ throw new BlockGossipError(GossipAction.REJECT, {
84
+ code: BlockErrorCode.PROPOSAL_SIGNATURE_INVALID,
85
+ slot: blockSlot,
86
+ root: blockRoot,
87
+ });
88
+ }
89
+ } else if (!chain.seenBlockProposers.isEquivocating(blockSlot, proposerIndex)) {
81
90
  await verifyBlockProposerSignature(chain, signedBlock, blockRoot, {verifyOnMainThread: false});
82
91
  chain.seenBlockProposers.observeBlockRoot(blockSlot, proposerIndex, blockRoot, signedBlockHeader);
83
92
  }
@@ -225,7 +225,7 @@ export async function validateGossipFuluDataColumnSidecar(
225
225
 
226
226
  // 12) [IGNORE] The sidecar is the first sidecar for the tuple (block_header.slot, block_header.proposer_index,
227
227
  // sidecar.index) with valid header signature, sidecar inclusion proof, and kzg proof
228
- // -- Handled in seenGossipBlockInput
228
+ // -- Handled in gossip handler with seenDataColumnSidecars
229
229
  }
230
230
 
231
231
  // SPEC FUNCTION
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  // Export generic RestApi server for CLI
2
2
 
3
+ export {ServiceNotReady} from "./api/impl/errors.js";
3
4
  export type {RestApiServerMetrics, RestApiServerModules, RestApiServerOpts} from "./api/rest/base.js";
4
5
  export {RestApiServer} from "./api/rest/base.js";
5
6
  export {persistAnchorState} from "./chain/index.js";
@@ -81,9 +81,7 @@ function formatActiveResources(): string {
81
81
  }
82
82
 
83
83
  /**
84
- * This class is meant to work both:
85
- * - In a libp2p worker
86
- * - In the main thread
84
+ * This class runs in the libp2p worker.
87
85
  *
88
86
  * libp2p holds the reference to the TCP transport socket. libp2p is in a worker, what components
89
87
  * must be in a worker too?