Skip to content

Commit

Permalink
Add flag network.maxGossipTopicConcurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
dapplion committed Mar 1, 2023
1 parent b69f44f commit a0e9faf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/beacon-node/src/network/options.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import {generateKeypair, IDiscv5DiscoveryInputOptions, KeypairType, SignableENR} from "@chainsafe/discv5";
import {Eth2GossipsubOpts} from "./gossip/gossipsub.js";
import {defaultGossipHandlerOpts, GossipHandlerOpts} from "./processor/gossipHandlers.js";
import {defaultGossipHandlerOpts} from "./processor/gossipHandlers.js";
import {PeerManagerOpts} from "./peers/index.js";
import {ReqRespBeaconNodeOpts} from "./reqresp/ReqRespBeaconNode.js";
import {NetworkProcessorOpts} from "./processor/index.js";

// Since Network is eventually intended to be run in a separate thread, ensure that all options are cloneable using structuredClone
export interface NetworkOptions
extends PeerManagerOpts,
// remove all Functions
Omit<ReqRespBeaconNodeOpts, "getPeerLogMetadata" | "onRateLimit">,
GossipHandlerOpts,
NetworkProcessorOpts,
Eth2GossipsubOpts {
localMultiaddrs: string[];
bootMultiaddrs?: string[];
Expand Down
8 changes: 8 additions & 0 deletions packages/cli/src/options/beaconNodeOptions/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export type NetworkArgs = {
"network.gossipsubDHigh": number;
"network.gossipsubAwaitHandler": boolean;
"network.rateLimitMultiplier": number;
"network.maxGossipTopicConcurrency"?: number;

/** @deprecated This option is deprecated and should be removed in next major release. */
"network.requestCountPeerLimit": number;
Expand Down Expand Up @@ -67,6 +68,7 @@ export function parseArgs(args: NetworkArgs): IBeaconNodeOptions["network"] {
gossipsubAwaitHandler: args["network.gossipsubAwaitHandler"],
mdns: args["mdns"],
rateLimitMultiplier: args["network.rateLimitMultiplier"],
maxGossipTopicConcurrency: args["network.maxGossipTopicConcurrency"],
};
}

Expand Down Expand Up @@ -237,4 +239,10 @@ export const options: CliCommandOptions<NetworkArgs> = {
defaultDescription: String(defaultOptions.network.rateLimitMultiplier),
group: "network",
},

"network.maxGossipTopicConcurrency": {
type: "number",
hidden: true,
group: "network",
},
};
2 changes: 2 additions & 0 deletions packages/cli/test/unit/options/beaconNodeOptions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ describe("options / beaconNodeOptions", () => {
"network.gossipsubDHigh": 6,
"network.gossipsubAwaitHandler": true,
"network.rateLimitMultiplier": 1,
"network.maxGossipTopicConcurrency": 64,

"sync.isSingleNode": true,
"sync.disableProcessAsChainSegment": true,
Expand Down Expand Up @@ -171,6 +172,7 @@ describe("options / beaconNodeOptions", () => {
gossipsubAwaitHandler: true,
mdns: false,
rateLimitMultiplier: 1,
maxGossipTopicConcurrency: 64,
},
sync: {
isSingleNode: true,
Expand Down

0 comments on commit a0e9faf

Please sign in to comment.