chore: remove else condition and TODO from importBlock for metrics (#8138)

**Motivation**

Addresses peerDAS PR comment
https://github.com/ChainSafe/lodestar/pull/6353#discussion_r2255231189
This commit is contained in:
Matthew Keil
2025-08-08 04:43:44 -04:00
committed by GitHub
parent e121330b75
commit d4175c78f1

View File

@@ -513,13 +513,12 @@ export async function importBlock(
// dataPromise will not end up here, but preDeneb could. In future we might also allow syncing
// out of data range blocks and import then in forkchoice although one would not be able to
// attest and propose with such head similar to optimistic sync
if (blockInput.type === BlockInputType.availableData) {
if (blockInput.blockData.fork === ForkName.deneb || blockInput.blockData.fork === ForkName.electra) {
const {blobsSource} = blockInput.blockData;
this.metrics?.importBlock.blobsBySource.inc({blobsSource});
} else {
// TODO add data columns metrics
}
if (
blockInput.type === BlockInputType.availableData &&
(blockInput.blockData.fork === ForkName.deneb || blockInput.blockData.fork === ForkName.electra)
) {
const {blobsSource} = blockInput.blockData;
this.metrics?.importBlock.blobsBySource.inc({blobsSource});
}
const advancedSlot = this.clock.slotWithFutureTolerance(REPROCESS_MIN_TIME_TO_NEXT_SLOT_SEC);