@chainsafe/lodestar 1.36.0-dev.f259361847 → 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.
- package/.git-data.json +1 -1
- package/lib/cmds/beacon/handler.d.ts.map +1 -1
- package/lib/cmds/beacon/handler.js +14 -7
- package/lib/cmds/beacon/handler.js.map +1 -1
- package/lib/cmds/beacon/initBeaconState.d.ts +6 -1
- package/lib/cmds/beacon/initBeaconState.d.ts.map +1 -1
- package/lib/cmds/beacon/initBeaconState.js +126 -21
- package/lib/cmds/beacon/initBeaconState.js.map +1 -1
- package/lib/cmds/beacon/options.d.ts +2 -0
- package/lib/cmds/beacon/options.d.ts.map +1 -1
- package/lib/cmds/beacon/options.js +13 -1
- package/lib/cmds/beacon/options.js.map +1 -1
- package/lib/cmds/dev/options.d.ts +1 -0
- package/lib/cmds/dev/options.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/chain.d.ts +1 -0
- package/lib/options/beaconNodeOptions/chain.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/chain.js +8 -1
- package/lib/options/beaconNodeOptions/chain.js.map +1 -1
- package/lib/options/beaconNodeOptions/index.d.ts +1 -0
- package/lib/options/beaconNodeOptions/index.d.ts.map +1 -1
- package/lib/options/globalOptions.d.ts +2 -0
- package/lib/options/globalOptions.d.ts.map +1 -1
- package/lib/options/globalOptions.js +6 -0
- package/lib/options/globalOptions.js.map +1 -1
- package/lib/util/file.d.ts.map +1 -1
- package/lib/util/file.js +4 -1
- package/lib/util/file.js.map +1 -1
- package/lib/util/hasher_bun.d.ts.map +1 -1
- package/lib/util/hasher_bun.js +2 -1
- package/lib/util/hasher_bun.js.map +1 -1
- package/package.json +15 -14
- package/src/cmds/beacon/handler.ts +23 -8
- package/src/cmds/beacon/initBeaconState.ts +166 -21
- package/src/cmds/beacon/options.ts +17 -1
- package/src/options/beaconNodeOptions/chain.ts +10 -1
- package/src/options/globalOptions.ts +9 -0
- package/src/util/file.ts +4 -1
- package/src/util/hasher_bun.ts +3 -1
|
@@ -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.
|
|
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
|
}
|
package/src/util/hasher_bun.ts
CHANGED
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
doMerkleizeBlockArray,
|
|
9
9
|
doMerkleizeBlocksBytes,
|
|
10
10
|
} from "@chainsafe/persistent-merkle-tree";
|
|
11
|
-
import {
|
|
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
|