@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.
- package/lib/chain/archiveStore/utils/pruneHistory.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js +5 -1
- package/lib/chain/archiveStore/utils/pruneHistory.js.map +1 -1
- package/lib/chain/emitter.d.ts +10 -0
- package/lib/chain/emitter.d.ts.map +1 -1
- package/lib/chain/emitter.js +4 -0
- package/lib/chain/emitter.js.map +1 -1
- package/lib/db/repositories/blockArchive.d.ts +5 -0
- package/lib/db/repositories/blockArchive.d.ts.map +1 -1
- package/lib/db/repositories/blockArchive.js +36 -1
- package/lib/db/repositories/blockArchive.js.map +1 -1
- package/lib/network/processor/index.d.ts +6 -2
- package/lib/network/processor/index.d.ts.map +1 -1
- package/lib/network/processor/index.js +26 -9
- package/lib/network/processor/index.js.map +1 -1
- package/lib/sync/types.d.ts +4 -0
- package/lib/sync/types.d.ts.map +1 -1
- package/lib/sync/types.js +4 -0
- package/lib/sync/types.js.map +1 -1
- package/lib/sync/unknownBlock.d.ts +1 -0
- package/lib/sync/unknownBlock.d.ts.map +1 -1
- package/lib/sync/unknownBlock.js +15 -0
- package/lib/sync/unknownBlock.js.map +1 -1
- package/package.json +14 -14
- package/src/chain/archiveStore/utils/pruneHistory.ts +5 -2
- package/src/chain/emitter.ts +7 -2
- package/src/db/repositories/blockArchive.ts +38 -1
- package/src/network/processor/index.ts +37 -9
- package/src/sync/types.ts +6 -3
- package/src/sync/unknownBlock.ts +15 -0
package/src/sync/unknownBlock.ts
CHANGED
|
@@ -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);
|