@chainsafe/lodestar 1.51.0-dev.1b1888604e → 1.51.0-dev.2531f8fae8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/.git-data.json +1 -1
  2. package/README.md +9 -7
  3. package/lib/cmds/beacon/handler.js +2 -2
  4. package/lib/cmds/beacon/handler.js.map +1 -1
  5. package/lib/cmds/builder/handler.d.ts.map +1 -1
  6. package/lib/cmds/builder/handler.js +48 -3
  7. package/lib/cmds/builder/handler.js.map +1 -1
  8. package/lib/cmds/builder/options.d.ts +13 -0
  9. package/lib/cmds/builder/options.d.ts.map +1 -1
  10. package/lib/cmds/builder/options.js +83 -1
  11. package/lib/cmds/builder/options.js.map +1 -1
  12. package/lib/cmds/dev/options.d.ts +1 -1
  13. package/lib/cmds/dev/options.d.ts.map +1 -1
  14. package/lib/cmds/dev/options.js +1 -3
  15. package/lib/cmds/dev/options.js.map +1 -1
  16. package/lib/cmds/validator/handler.d.ts.map +1 -1
  17. package/lib/cmds/validator/handler.js +12 -2
  18. package/lib/cmds/validator/handler.js.map +1 -1
  19. package/lib/cmds/validator/keymanager/decryptKeystores/threadPool.d.ts +1 -1
  20. package/lib/cmds/validator/keymanager/decryptKeystores/threadPool.d.ts.map +1 -1
  21. package/lib/cmds/validator/keymanager/decryptKeystores/threadPool.js.map +1 -1
  22. package/lib/cmds/validator/keymanager/persistedKeys.d.ts +1 -1
  23. package/lib/cmds/validator/keymanager/persistedKeys.d.ts.map +1 -1
  24. package/lib/cmds/validator/keymanager/persistedKeys.js +1 -1
  25. package/lib/cmds/validator/keymanager/persistedKeys.js.map +1 -1
  26. package/lib/cmds/validator/options.d.ts.map +1 -1
  27. package/lib/cmds/validator/options.js +3 -9
  28. package/lib/cmds/validator/options.js.map +1 -1
  29. package/lib/cmds/validator/slashingProtection/export.d.ts.map +1 -1
  30. package/lib/cmds/validator/slashingProtection/export.js +1 -3
  31. package/lib/cmds/validator/slashingProtection/export.js.map +1 -1
  32. package/lib/cmds/validator/voluntaryExit.d.ts.map +1 -1
  33. package/lib/cmds/validator/voluntaryExit.js +1 -3
  34. package/lib/cmds/validator/voluntaryExit.js.map +1 -1
  35. package/lib/options/beaconNodeOptions/api.d.ts +1 -0
  36. package/lib/options/beaconNodeOptions/api.d.ts.map +1 -1
  37. package/lib/options/beaconNodeOptions/api.js +8 -0
  38. package/lib/options/beaconNodeOptions/api.js.map +1 -1
  39. package/lib/options/beaconNodeOptions/chain.d.ts +0 -1
  40. package/lib/options/beaconNodeOptions/chain.d.ts.map +1 -1
  41. package/lib/options/beaconNodeOptions/chain.js +0 -8
  42. package/lib/options/beaconNodeOptions/chain.js.map +1 -1
  43. package/lib/options/beaconNodeOptions/index.d.ts +1 -1
  44. package/package.json +21 -18
  45. package/src/cmds/beacon/handler.ts +2 -2
  46. package/src/cmds/builder/handler.ts +68 -3
  47. package/src/cmds/builder/options.ts +118 -1
  48. package/src/cmds/dev/options.ts +1 -3
  49. package/src/cmds/validator/handler.ts +10 -1
  50. package/src/cmds/validator/keymanager/decryptKeystores/threadPool.ts +1 -1
  51. package/src/cmds/validator/keymanager/persistedKeys.ts +1 -1
  52. package/src/cmds/validator/options.ts +3 -9
  53. package/src/cmds/validator/slashingProtection/export.ts +1 -3
  54. package/src/cmds/validator/voluntaryExit.ts +1 -3
  55. package/src/options/beaconNodeOptions/api.ts +11 -0
  56. package/src/options/beaconNodeOptions/chain.ts +0 -11
@@ -77,7 +77,16 @@ export async function validatorHandler(args: IValidatorCliArgs & GlobalArgs): Pr
77
77
 
78
78
  const onGracefulShutdownCbs: (() => Promise<void> | void)[] = [];
79
79
  onGracefulShutdown(async () => {
80
- for (const cb of onGracefulShutdownCbs) await cb();
80
+ let exitCode = 0;
81
+ try {
82
+ for (const cb of onGracefulShutdownCbs) await cb();
83
+ logger.debug("Validator client closed");
84
+ } catch (e) {
85
+ logger.warn("Error closing validator client", {}, e as Error);
86
+ exitCode = 1;
87
+ }
88
+ // Explicitly exit process due to potential active handles (e.g. EventSource / in-flight HTTP via DVT middleware)
89
+ process.exit(exitCode);
81
90
  }, logger.info.bind(logger));
82
91
 
83
92
  // Callback for validator to request forced exit, in case of doppelganger detection
@@ -45,7 +45,7 @@ export class DecryptKeystoresThreadPool {
45
45
  */
46
46
  queue(
47
47
  args: DecryptKeystoreArgs,
48
- onDecrypted: (secretKeyBytes: Uint8Array) => void,
48
+ onDecrypted: (secretKeyBytes: Uint8Array) => void | Promise<void>,
49
49
  onError: (e: Error) => void
50
50
  ): void {
51
51
  const task = this.pool.queue((thread) => thread.decryptKeystore(args));
@@ -14,7 +14,7 @@ import {
14
14
  import {lockFilepath} from "../../../util/lockfile.js";
15
15
  import {IPersistedKeysBackend, LocalKeystoreDefinition} from "./interface.js";
16
16
 
17
- export {ImportStatus, DeletionStatus};
17
+ export {DeletionStatus, ImportStatus};
18
18
 
19
19
  type PathArgs = {
20
20
  keystoresDir: string;
@@ -416,9 +416,7 @@ export const validatorOptions: CliCommandOptions<IValidatorCliArgs> = {
416
416
  string: true, // Ensures the pubkey string is not automatically converted to numbers
417
417
  coerce: (pubkeys: string[]): string[] =>
418
418
  // Parse ["0x11,0x22"] to ["0x11", "0x22"]
419
- pubkeys
420
- .flatMap((item) => item.split(","))
421
- .map(ensure0xPrefix),
419
+ pubkeys.flatMap((item) => item.split(",")).map(ensure0xPrefix),
422
420
  group: "externalSigner",
423
421
  },
424
422
 
@@ -518,9 +516,7 @@ export const validatorOptions: CliCommandOptions<IValidatorCliArgs> = {
518
516
  type: "array",
519
517
  coerce: (indexes: string[]): number[] =>
520
518
  // Parse ["11..13,15..17"] to ["11..13", "15..17"]
521
- indexes
522
- .flatMap((item) => item.split(","))
523
- .flatMap(parseRange),
519
+ indexes.flatMap((item) => item.split(",")).flatMap(parseRange),
524
520
  },
525
521
 
526
522
  fromMnemonic: {
@@ -535,8 +531,6 @@ export const validatorOptions: CliCommandOptions<IValidatorCliArgs> = {
535
531
  type: "array",
536
532
  coerce: (indexes: string[]): number[] =>
537
533
  // Parse ["11..13,15..17"] to ["11..13", "15..17"]
538
- indexes
539
- .flatMap((item) => item.split(","))
540
- .flatMap(parseRange),
534
+ indexes.flatMap((item) => item.split(",")).flatMap(parseRange),
541
535
  },
542
536
  };
@@ -42,9 +42,7 @@ export const exportCmd: CliCommand<ExportArgs, ISlashingProtectionArgs & Account
42
42
  string: true, // Ensures the pubkey string is not automatically converted to numbers
43
43
  coerce: (pubkeys: string[]): string[] =>
44
44
  // Parse ["0x11,0x22"] to ["0x11", "0x22"]
45
- pubkeys
46
- .flatMap((item) => item.split(","))
47
- .map(ensure0xPrefix),
45
+ pubkeys.flatMap((item) => item.split(",")).map(ensure0xPrefix),
48
46
  },
49
47
  },
50
48
 
@@ -59,9 +59,7 @@ If no `pubkeys` are provided, it will exit all validators that have been importe
59
59
  string: true, // Ensures the pubkey string is not automatically converted to numbers
60
60
  coerce: (pubkeys: string[]): string[] =>
61
61
  // Parse ["0x11,0x22"] to ["0x11", "0x22"]
62
- pubkeys
63
- .flatMap((item) => item.split(","))
64
- .map(ensure0xPrefix),
62
+ pubkeys.flatMap((item) => item.split(",")).map(ensure0xPrefix),
65
63
  },
66
64
 
67
65
  yes: {
@@ -13,6 +13,7 @@ export function coerceCors(cors: string): string {
13
13
 
14
14
  export type ApiArgs = {
15
15
  "api.maxGindicesInProof"?: number;
16
+ "api.disableBidValidation"?: boolean;
16
17
  "rest.namespace"?: string[];
17
18
  "rest.cors"?: string;
18
19
  rest: boolean;
@@ -27,6 +28,7 @@ export type ApiArgs = {
27
28
  export function parseArgs(args: ApiArgs): IBeaconNodeOptions["api"] {
28
29
  return {
29
30
  maxGindicesInProof: args["api.maxGindicesInProof"],
31
+ disableBidValidation: args["api.disableBidValidation"],
30
32
  rest: {
31
33
  api: args["rest.namespace"] as IBeaconNodeOptions["api"]["rest"]["api"],
32
34
  cors: args["rest.cors"],
@@ -57,6 +59,15 @@ export const options: CliCommandOptions<ApiArgs> = {
57
59
  group: "api",
58
60
  },
59
61
 
62
+ "api.disableBidValidation": {
63
+ hidden: true,
64
+ type: "boolean",
65
+ description:
66
+ "Broadcast execution payload bids submitted via the API without running gossip validation. Only enable if the API is exclusively used by a trusted local builder, forwarding invalid bids gets the node penalized by peers",
67
+ defaultDescription: String(defaultOptions.api.disableBidValidation),
68
+ group: "api",
69
+ },
70
+
60
71
  "rest.namespace": {
61
72
  type: "array",
62
73
  choices: [...allNamespaces, enabledAll, enabledAllBashFriendly],
@@ -29,7 +29,6 @@ export type ChainArgs = {
29
29
  "chain.maxSkipSlots"?: number;
30
30
  "chain.disableProposerSlashings"?: boolean;
31
31
  emitPayloadAttributes?: boolean;
32
- broadcastValidationStrictness?: string;
33
32
  "chain.minSameMessageSignatureSetsToBatch"?: number;
34
33
  "chain.maxShufflingCacheEpochs"?: number;
35
34
  "chain.archiveStateEpochFrequency": number;
@@ -72,7 +71,6 @@ export function parseArgs(args: ChainArgs & CircuitBreakerArgs): IBeaconNodeOpti
72
71
  maxSkipSlots: args["chain.maxSkipSlots"],
73
72
  disableProposerSlashings: args["chain.disableProposerSlashings"],
74
73
  emitPayloadAttributes: args.emitPayloadAttributes,
75
- broadcastValidationStrictness: args.broadcastValidationStrictness,
76
74
  minSameMessageSignatureSetsToBatch:
77
75
  args["chain.minSameMessageSignatureSetsToBatch"] ?? defaultOptions.chain.minSameMessageSignatureSetsToBatch,
78
76
  maxShufflingCacheEpochs: args["chain.maxShufflingCacheEpochs"] ?? defaultOptions.chain.maxShufflingCacheEpochs,
@@ -286,15 +284,6 @@ Will double processing times. Use only for debugging purposes.",
286
284
  group: "chain",
287
285
  },
288
286
 
289
- broadcastValidationStrictness: {
290
- // TODO: hide the option till validations fully implemented
291
- hidden: true,
292
- description:
293
- "'warn' or 'error' - options to either throw error or to log warning when broadcast validation can't be performed",
294
- type: "string",
295
- default: "warn",
296
- },
297
-
298
287
  "chain.minSameMessageSignatureSetsToBatch": {
299
288
  hidden: true,
300
289
  description: "Minimum number of same message signature sets to batch",