Skip to content

Commit

Permalink
add supernode flag to configure node custody requirement and make it …
Browse files Browse the repository at this point in the history
…not required for validator
  • Loading branch information
g11tech committed Aug 27, 2024
1 parent e6c613f commit a3533f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/cli/src/config/beaconParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
ChainForkConfig,
chainConfigFromJson,
} from "@lodestar/config";
import {DATA_COLUMN_SIDECAR_SUBNET_COUNT} from "@lodestar/params";
import {readFile} from "../util/index.js";
import {getNetworkBeaconParams, NetworkName} from "../networks/index.js";
import {
Expand Down Expand Up @@ -39,14 +40,18 @@ export function getBeaconConfigFromArgs(args: GlobalArgs): {config: ChainForkCon
* @see getBeaconParams
*/
export function getBeaconParamsFromArgs(args: GlobalArgs): ChainConfig {
return getBeaconParams({
const beaconParams = getBeaconParams({
network: args.network,
paramsFile: args.paramsFile,
additionalParamsCli: {
...parseBeaconParamsArgs(args as IBeaconParamsUnparsed),
...parseTerminalPowArgs(args as ITerminalPowArgs),
},
});
if (args.supernode) {
beaconParams["NODE_CUSTODY_REQUIREMENT"] = DATA_COLUMN_SIDECAR_SUBNET_COUNT;
}
return beaconParams;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions packages/cli/src/options/globalOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ type GlobalSingleArgs = {
paramsFile?: string;
preset: string;
presetFile?: string;
supernode?: boolean;
};

export const defaultNetwork: NetworkName = "mainnet";
Expand Down Expand Up @@ -44,6 +45,11 @@ const globalSingleOptions: CliCommandOptions<GlobalSingleArgs> = {
description: "Preset configuration file to override the active preset with custom values",
type: "string",
},

supernode: {
description: "custody all subnets, alias to params.NODE_CUSTODY_REQUIREMENT for all subnets",
type: "boolean",
},
};

export const rcConfigOption: [string, string, (configPath: string) => Record<string, unknown>] = [
Expand Down
2 changes: 1 addition & 1 deletion packages/validator/src/util/params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,6 @@ function getSpecCriticalParams(localConfig: ChainConfig): Record<keyof ConfigWit
// Peerdas
SAMPLES_PER_SLOT: peerdasForkRelevant,
CUSTODY_REQUIREMENT: peerdasForkRelevant,
NODE_CUSTODY_REQUIREMENT: peerdasForkRelevant,
NODE_CUSTODY_REQUIREMENT: false,
};
}

0 comments on commit a3533f8

Please sign in to comment.