@lodestar/beacon-node 1.49.0-dev.b27f498c2c → 1.49.0-dev.ceea36c6f2

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.
@@ -152,6 +152,7 @@ export class BlockInputSync {
152
152
  this.logger.verbose("BlockInputSync enabled.");
153
153
  this.chain.emitter.on(ChainEvent.unknownBlockRoot, this.onUnknownBlockRoot);
154
154
  this.chain.emitter.on(ChainEvent.unknownEnvelopeBlockRoot, this.onUnknownEnvelopeBlockRoot);
155
+ this.chain.emitter.on(ChainEvent.unknownEnvelopeBlockRootSlot, this.onUnknownEnvelopeBlockRootSlot);
155
156
  this.chain.emitter.on(ChainEvent.incompleteBlockInput, this.onIncompleteBlockInput);
156
157
  this.chain.emitter.on(ChainEvent.incompletePayloadEnvelope, this.onIncompletePayloadEnvelope);
157
158
  this.chain.emitter.on(ChainEvent.blockUnknownParent, this.onUnknownParent);
@@ -179,6 +180,7 @@ export class BlockInputSync {
179
180
  this.clearRateLimitBackoffTimer();
180
181
  this.chain.emitter.off(ChainEvent.unknownBlockRoot, this.onUnknownBlockRoot);
181
182
  this.chain.emitter.off(ChainEvent.unknownEnvelopeBlockRoot, this.onUnknownEnvelopeBlockRoot);
183
+ this.chain.emitter.off(ChainEvent.unknownEnvelopeBlockRootSlot, this.onUnknownEnvelopeBlockRootSlot);
182
184
  this.chain.emitter.off(ChainEvent.incompleteBlockInput, this.onIncompleteBlockInput);
183
185
  this.chain.emitter.off(ChainEvent.incompletePayloadEnvelope, this.onIncompletePayloadEnvelope);
184
186
  this.chain.emitter.off(ChainEvent.blockUnknownParent, this.onUnknownParent);
@@ -242,6 +244,19 @@ export class BlockInputSync {
242
244
  }
243
245
  };
244
246
 
247
+ private onUnknownEnvelopeBlockRootSlot = (data: ChainEventData[ChainEvent.unknownEnvelopeBlockRootSlot]): void => {
248
+ try {
249
+ const isNewRoot = this.addByPayloadRootHex(data.rootHex, data.peer, data.slot);
250
+ if (isNewRoot) {
251
+ this.triggerUnknownBlockSearch();
252
+ this.metrics?.blockInputSync.requests.inc({type: PendingBlockType.UNKNOWN_PAYLOAD_BLOCK_ROOT_SLOT});
253
+ this.metrics?.blockInputSync.payloadSource.inc({source: data.source});
254
+ }
255
+ } catch (e) {
256
+ this.logger.debug("Error handling unknownEnvelopeBlockRootSlot event", {}, e as Error);
257
+ }
258
+ };
259
+
245
260
  private onIncompletePayloadEnvelope = (data: ChainEventData[ChainEvent.incompletePayloadEnvelope]): void => {
246
261
  try {
247
262
  this.addByPayloadInput(data.payloadInput, data.peer);