@chainsafe/lodestar 1.36.0-dev.f657221d88 → 1.36.0-dev.faac5550fb

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 (38) hide show
  1. package/.git-data.json +1 -1
  2. package/lib/cmds/beacon/handler.d.ts.map +1 -1
  3. package/lib/cmds/beacon/handler.js +16 -9
  4. package/lib/cmds/beacon/handler.js.map +1 -1
  5. package/lib/cmds/beacon/initBeaconState.d.ts +6 -1
  6. package/lib/cmds/beacon/initBeaconState.d.ts.map +1 -1
  7. package/lib/cmds/beacon/initBeaconState.js +126 -21
  8. package/lib/cmds/beacon/initBeaconState.js.map +1 -1
  9. package/lib/cmds/beacon/options.d.ts +2 -0
  10. package/lib/cmds/beacon/options.d.ts.map +1 -1
  11. package/lib/cmds/beacon/options.js +13 -1
  12. package/lib/cmds/beacon/options.js.map +1 -1
  13. package/lib/cmds/dev/options.d.ts +1 -0
  14. package/lib/cmds/dev/options.d.ts.map +1 -1
  15. package/lib/options/beaconNodeOptions/chain.d.ts +1 -0
  16. package/lib/options/beaconNodeOptions/chain.d.ts.map +1 -1
  17. package/lib/options/beaconNodeOptions/chain.js +8 -1
  18. package/lib/options/beaconNodeOptions/chain.js.map +1 -1
  19. package/lib/options/beaconNodeOptions/index.d.ts +1 -0
  20. package/lib/options/beaconNodeOptions/index.d.ts.map +1 -1
  21. package/lib/options/globalOptions.d.ts +2 -0
  22. package/lib/options/globalOptions.d.ts.map +1 -1
  23. package/lib/options/globalOptions.js +6 -0
  24. package/lib/options/globalOptions.js.map +1 -1
  25. package/lib/util/file.d.ts.map +1 -1
  26. package/lib/util/file.js +4 -1
  27. package/lib/util/file.js.map +1 -1
  28. package/lib/util/hasher_bun.d.ts.map +1 -1
  29. package/lib/util/hasher_bun.js +2 -1
  30. package/lib/util/hasher_bun.js.map +1 -1
  31. package/package.json +15 -14
  32. package/src/cmds/beacon/handler.ts +25 -10
  33. package/src/cmds/beacon/initBeaconState.ts +166 -21
  34. package/src/cmds/beacon/options.ts +17 -1
  35. package/src/options/beaconNodeOptions/chain.ts +10 -1
  36. package/src/options/globalOptions.ts +9 -0
  37. package/src/util/file.ts +4 -1
  38. package/src/util/hasher_bun.ts +3 -1
@@ -10,6 +10,8 @@ type BeaconExtraArgs = {
10
10
  bootnodesFile?: string;
11
11
  checkpointSyncUrl?: string;
12
12
  checkpointState?: string;
13
+ unsafeCheckpointState?: string;
14
+ lastPersistedCheckpointState?: boolean;
13
15
  wssCheckpoint?: string;
14
16
  forceCheckpointSync?: boolean;
15
17
  ignoreWeakSubjectivityCheck?: boolean;
@@ -58,11 +60,25 @@ export const beaconExtraOptions: CliCommandOptions<BeaconExtraArgs> = {
58
60
  },
59
61
 
60
62
  checkpointState: {
61
- description: "Set a checkpoint state to start syncing from",
63
+ description: "File path or url to finalized checkpoint state to start syncing from",
62
64
  type: "string",
63
65
  group: "weak subjectivity",
64
66
  },
65
67
 
68
+ unsafeCheckpointState: {
69
+ hidden: true,
70
+ description: "File path or url to unfinalized checkpoint state to start syncing from",
71
+ type: "string",
72
+ group: "weak subjectivity",
73
+ },
74
+
75
+ lastPersistedCheckpointState: {
76
+ hidden: true,
77
+ description: "Use the last safe persisted checkpoint state to start syncing from",
78
+ type: "boolean",
79
+ group: "weak subjectivity",
80
+ },
81
+
66
82
  wssCheckpoint: {
67
83
  description:
68
84
  "Start beacon node off a state at the provided weak subjectivity checkpoint, to be supplied in <blockRoot>:<epoch> format. For example, 0x1234:100 will sync and start off from the weak subjectivity state at checkpoint of epoch 100 with block root 0x1234.",
@@ -35,6 +35,7 @@ export type ChainArgs = {
35
35
  "chain.nHistoricalStatesFileDataStore"?: boolean;
36
36
  "chain.maxBlockStates"?: number;
37
37
  "chain.maxCPStateEpochsInMemory"?: number;
38
+ "chain.maxCPStateEpochsOnDisk"?: number;
38
39
 
39
40
  "chain.pruneHistory"?: boolean;
40
41
  };
@@ -76,6 +77,7 @@ export function parseArgs(args: ChainArgs): IBeaconNodeOptions["chain"] {
76
77
  args["chain.nHistoricalStatesFileDataStore"] ?? defaultOptions.chain.nHistoricalStatesFileDataStore,
77
78
  maxBlockStates: args["chain.maxBlockStates"] ?? defaultOptions.chain.maxBlockStates,
78
79
  maxCPStateEpochsInMemory: args["chain.maxCPStateEpochsInMemory"] ?? defaultOptions.chain.maxCPStateEpochsInMemory,
80
+ maxCPStateEpochsOnDisk: args["chain.maxCPStateEpochsOnDisk"] ?? defaultOptions.chain.maxCPStateEpochsOnDisk,
79
81
  pruneHistory: args["chain.pruneHistory"],
80
82
  };
81
83
  }
@@ -316,8 +318,15 @@ Will double processing times. Use only for debugging purposes.",
316
318
  group: "chain",
317
319
  },
318
320
 
319
- "chain.pruneHistory": {
321
+ "chain.maxCPStateEpochsOnDisk": {
320
322
  hidden: true,
323
+ description: "Max epochs to cache checkpoint states on disk, used for PersistentCheckpointStateCache",
324
+ type: "number",
325
+ default: defaultOptions.chain.maxCPStateEpochsOnDisk,
326
+ group: "chain",
327
+ },
328
+
329
+ "chain.pruneHistory": {
321
330
  description: "Prune historical blocks and state",
322
331
  type: "boolean",
323
332
  default: defaultOptions.chain.pruneHistory,
@@ -12,6 +12,7 @@ type GlobalSingleArgs = {
12
12
  presetFile?: string;
13
13
  rcConfig?: string;
14
14
  supernode?: boolean;
15
+ semiSupernode?: boolean;
15
16
  };
16
17
 
17
18
  export const defaultNetwork: NetworkName = "mainnet";
@@ -55,6 +56,14 @@ const globalSingleOptions: CliCommandOptions<GlobalSingleArgs> = {
55
56
  supernode: {
56
57
  description: "Subscribe to and custody all data column sidecar subnets",
57
58
  type: "boolean",
59
+ conflicts: ["semiSupernode"],
60
+ },
61
+
62
+ semiSupernode: {
63
+ description:
64
+ "Subscribe to and custody half of the data column sidecar subnets to support blob reconstruction, enabling more efficient data availability with lower bandwidth and storage requirements compared to a supernode.",
65
+ type: "boolean",
66
+ conflicts: ["supernode"],
58
67
  },
59
68
  };
60
69
 
package/src/util/file.ts CHANGED
@@ -149,7 +149,10 @@ export async function downloadFile(pathDest: string, url: string): Promise<void>
149
149
  */
150
150
  export async function downloadOrLoadFile(pathOrUrl: string): Promise<Uint8Array> {
151
151
  if (isUrl(pathOrUrl)) {
152
- const res = await fetch(pathOrUrl);
152
+ const res = await fetch(pathOrUrl, {
153
+ // Ensure we only receive SSZ responses if REST API is queried
154
+ headers: {accept: "application/octet-stream"},
155
+ });
153
156
  if (!res.ok) {
154
157
  throw new Error(`Failed to download file from ${pathOrUrl}: ${res.status} ${res.statusText}`);
155
158
  }
@@ -8,7 +8,9 @@ import {
8
8
  doMerkleizeBlockArray,
9
9
  doMerkleizeBlocksBytes,
10
10
  } from "@chainsafe/persistent-merkle-tree";
11
- import {digest2Bytes32, digest2Bytes32Into, hashInto} from "@lodestar/bun";
11
+ import {hashtree} from "@lodestar/bun";
12
+
13
+ const {digest2Bytes32, digest2Bytes32Into, hashInto} = hashtree;
12
14
 
13
15
  /**
14
16
  * Best SIMD implementation is in 512 bits = 64 bytes