Skip to content

Commit

Permalink
Add skipParamsLog
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Mar 1, 2023
1 parent 7ebea24 commit 86450f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion packages/beacon-node/src/network/gossip/gossipsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export type Eth2GossipsubOpts = {
gossipsubDLow?: number;
gossipsubDHigh?: number;
gossipsubAwaitHandler?: boolean;
skipParamsLog?: boolean;
};

/**
Expand Down Expand Up @@ -138,7 +139,9 @@ export class Eth2Gossipsub extends GossipSub implements GossipBeaconNode {

// Having access to this data is CRUCIAL for debugging. While this is a massive log, it must not be deleted.
// Scoring issues require this dump + current peer score stats to re-calculate scores.
this.logger.debug("Gossipsub score params", {params: JSON.stringify(scoreParams)});
if (!opts.skipParamsLog) {
this.logger.debug("Gossipsub score params", {params: JSON.stringify(scoreParams)});
}
}

/**
Expand Down
6 changes: 3 additions & 3 deletions packages/beacon-node/test/e2e/network/gossipsub.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {capella, phase0, ssz, allForks} from "@lodestar/types";
import {sleep} from "@lodestar/utils";

import {computeStartSlotAtEpoch} from "@lodestar/state-transition";
import {getReqRespHandlers, Network} from "../../../src/network/index.js";
import {getReqRespHandlers, Network, NetworkInitModules} from "../../../src/network/index.js";
import {defaultNetworkOptions, NetworkOptions} from "../../../src/network/options.js";
import {GossipType, GossipHandlers} from "../../../src/network/gossip/index.js";

Expand All @@ -25,6 +25,7 @@ const opts: NetworkOptions = {
localMultiaddrs: [],
discv5FirstQueryDelayMs: 0,
discv5: null,
skipParamsLog: true,
};

// Schedule all forks at ALTAIR_FORK_EPOCH to avoid generating the pubkeys cache
Expand Down Expand Up @@ -86,10 +87,9 @@ describe("gossipsub", function () {
const loggerA = testLogger("A");
const loggerB = testLogger("B");

const modules = {
const modules: Omit<NetworkInitModules, "opts" | "peerId" | "logger"> = {
config: beaconConfig,
chain,
db,
reqRespHandlers,
gossipHandlers,
signal: controller.signal,
Expand Down

0 comments on commit 86450f8

Please sign in to comment.