mirror of
https://github.com/ChainSafe/lodestar.git
synced 2026-01-09 15:48:08 -05:00
fix: update logs if block not found while handling unavailable data columns (#8337)
**Motivation** Don't spam the logs with uninformative errors **Description** Update logs if block not found while handling unavailable data columns - move log from `error` to `verbose` as it's network related log and to avoid spam - make log actually useful by adding context like slot and block root Closes https://github.com/ChainSafe/lodestar/issues/8333
This commit is contained in:
@@ -85,6 +85,7 @@ export enum FindHeadFnName {
|
||||
export interface IBeaconChain {
|
||||
readonly genesisTime: UintNum64;
|
||||
readonly genesisValidatorsRoot: Root;
|
||||
readonly earliestAvailableSlot: Slot;
|
||||
readonly eth1: IEth1ForBlockProduction;
|
||||
readonly executionEngine: IExecutionEngine;
|
||||
readonly executionBuilder?: IExecutionBuilder;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {LogData} from "@lodestar/logger";
|
||||
import {RespStatus, ResponseError} from "@lodestar/reqresp";
|
||||
import {ColumnIndex, Slot} from "@lodestar/types";
|
||||
import {prettyBytes, prettyPrintIndices} from "@lodestar/utils";
|
||||
import {prettyBytes, prettyPrintIndices, toRootHex} from "@lodestar/utils";
|
||||
import {IBeaconChain} from "../../../chain/interface.js";
|
||||
import {IBeaconDb} from "../../../db/interface.js";
|
||||
import {getBlobKzgCommitmentsCountFromSignedBeaconBlockSerialized} from "../../../util/sszBytes.js";
|
||||
@@ -27,10 +27,10 @@ export async function handleColumnSidecarUnavailability({
|
||||
availableColumns: ColumnIndex[];
|
||||
}): Promise<void> {
|
||||
const logData: LogData = {
|
||||
slot,
|
||||
unavailableColumnIndices: prettyPrintIndices(unavailableColumnIndices),
|
||||
requestedColumns: prettyPrintIndices(requestedColumns),
|
||||
availableColumns: prettyPrintIndices(availableColumns),
|
||||
slot,
|
||||
};
|
||||
if (blockRoot) {
|
||||
logData.blockRoot = prettyBytes(blockRoot);
|
||||
@@ -40,8 +40,13 @@ export async function handleColumnSidecarUnavailability({
|
||||
|
||||
const blockBytes = blockRoot ? await db.block.getBinary(blockRoot) : await db.blockArchive.getBinary(slot);
|
||||
if (!blockBytes) {
|
||||
chain.logger.error(
|
||||
`Expected ${blockRoot ? "unfinalized" : "finalized"} block not found while handling unavailable dataColumnSidecar`
|
||||
chain.logger.verbose(
|
||||
`Expected ${blockRoot ? "unfinalized" : "finalized"} block not found while handling unavailable dataColumnSidecar`,
|
||||
{
|
||||
slot,
|
||||
blockRoot: blockRoot ? toRootHex(blockRoot) : "unknown",
|
||||
earliestAvailableSlot: chain.earliestAvailableSlot,
|
||||
}
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -57,7 +62,7 @@ export async function handleColumnSidecarUnavailability({
|
||||
metrics?.dataColumns.missingCustodyColumns.inc(unavailableColumnIndices.length);
|
||||
chain.logger.verbose("dataColumnSidecar requested and within custody but not available", {
|
||||
unavailableColumnIndices: prettyPrintIndices(unavailableColumnIndices),
|
||||
blockRoot: blockRoot ? prettyBytes(blockRoot) : "unknown blockRoot",
|
||||
blockRoot: blockRoot ? prettyBytes(blockRoot) : "unknown",
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +334,7 @@ describe("getBlobKzgCommitmentsCountFromSignedBeaconBlockSerialized", () => {
|
||||
FULU_FORK_EPOCH: 15,
|
||||
});
|
||||
|
||||
it("should return blob count pre electra", async () => {
|
||||
it("should return 0 blob count pre deneb", async () => {
|
||||
const slot = 1;
|
||||
const block = config.getForkTypes(slot).SignedBeaconBlock.defaultValue();
|
||||
block.message.slot = slot;
|
||||
|
||||
Reference in New Issue
Block a user