@chainsafe/lodestar 1.39.0-dev.aceb5b7416 → 1.39.0-dev.b37f2bd1bd
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 +8 -3
- package/lib/cmds/beacon/handler.js.map +1 -1
- package/lib/cmds/beacon/initBeaconState.d.ts +3 -2
- package/lib/cmds/beacon/initBeaconState.d.ts.map +1 -1
- package/lib/cmds/beacon/initBeaconState.js +6 -3
- package/lib/cmds/beacon/initBeaconState.js.map +1 -1
- package/lib/cmds/beacon/options.js +1 -1
- package/lib/cmds/beacon/options.js.map +1 -1
- package/lib/cmds/dev/files.js +1 -1
- package/lib/cmds/dev/files.js.map +1 -1
- package/lib/cmds/dev/handler.js +1 -1
- package/lib/cmds/dev/handler.js.map +1 -1
- package/lib/cmds/dev/options.d.ts +6 -6
- package/lib/cmds/dev/options.d.ts.map +1 -1
- package/lib/cmds/dev/options.js +5 -0
- package/lib/cmds/dev/options.js.map +1 -1
- package/lib/networks/chiado.d.ts +1 -0
- package/lib/networks/chiado.d.ts.map +1 -1
- package/lib/networks/chiado.js +2 -0
- package/lib/networks/chiado.js.map +1 -1
- package/lib/networks/dev.d.ts +1 -0
- package/lib/networks/dev.d.ts.map +1 -1
- package/lib/networks/dev.js +1 -0
- package/lib/networks/dev.js.map +1 -1
- package/lib/networks/ephemery.d.ts +1 -0
- package/lib/networks/ephemery.d.ts.map +1 -1
- package/lib/networks/ephemery.js +1 -0
- package/lib/networks/ephemery.js.map +1 -1
- package/lib/networks/gnosis.d.ts +1 -0
- package/lib/networks/gnosis.d.ts.map +1 -1
- package/lib/networks/gnosis.js +2 -0
- package/lib/networks/gnosis.js.map +1 -1
- package/lib/networks/hoodi.d.ts +1 -0
- package/lib/networks/hoodi.d.ts.map +1 -1
- package/lib/networks/hoodi.js +1 -0
- package/lib/networks/hoodi.js.map +1 -1
- package/lib/networks/index.d.ts +1 -0
- package/lib/networks/index.d.ts.map +1 -1
- package/lib/networks/index.js.map +1 -1
- package/lib/networks/mainnet.d.ts +1 -0
- package/lib/networks/mainnet.d.ts.map +1 -1
- package/lib/networks/mainnet.js +1 -0
- package/lib/networks/mainnet.js.map +1 -1
- package/lib/networks/sepolia.d.ts +1 -0
- package/lib/networks/sepolia.d.ts.map +1 -1
- package/lib/networks/sepolia.js +1 -0
- package/lib/networks/sepolia.js.map +1 -1
- package/lib/options/beaconNodeOptions/eth1.d.ts +3 -12
- package/lib/options/beaconNodeOptions/eth1.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/eth1.js +32 -11
- package/lib/options/beaconNodeOptions/eth1.js.map +1 -1
- package/lib/options/beaconNodeOptions/index.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/index.js +1 -0
- package/lib/options/beaconNodeOptions/index.js.map +1 -1
- package/package.json +14 -14
- package/src/cmds/beacon/handler.ts +11 -3
- package/src/cmds/beacon/initBeaconState.ts +9 -2
- package/src/cmds/beacon/options.ts +1 -1
- package/src/cmds/dev/files.ts +1 -1
- package/src/cmds/dev/handler.ts +1 -1
- package/src/cmds/dev/options.ts +5 -0
- package/src/networks/chiado.ts +2 -0
- package/src/networks/dev.ts +1 -0
- package/src/networks/ephemery.ts +1 -0
- package/src/networks/gnosis.ts +2 -0
- package/src/networks/hoodi.ts +1 -0
- package/src/networks/index.ts +1 -0
- package/src/networks/mainnet.ts +1 -0
- package/src/networks/sepolia.ts +1 -0
- package/src/options/beaconNodeOptions/eth1.ts +37 -20
- package/src/options/beaconNodeOptions/index.ts +1 -0
package/lib/networks/sepolia.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { sepoliaChainConfig as chainConfig } from "@lodestar/config/networks";
|
|
2
|
+
export const depositContractDeployBlock = 1273020;
|
|
2
3
|
export const genesisFileUrl = "https://github.com/eth-clients/sepolia/raw/main/metadata/genesis.ssz";
|
|
3
4
|
export const genesisStateRoot = "0xfb9afe32150fa39f4b346be2519a67e2a4f5efcd50a1dc192c3f6b3d013d2798";
|
|
4
5
|
export const bootnodesFileUrl = "https://raw.githubusercontent.com/eth-clients/sepolia/main/metadata/bootstrap_nodes.yaml";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sepolia.js","sourceRoot":"","sources":["../../src/networks/sepolia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAE5E,MAAM,CAAC,MAAM,cAAc,GAAG,sEAAsE,CAAC;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAAG,oEAAoE,CAAC;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAC3B,0FAA0F,CAAC;AAE7F,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,kOAAkO;IAClO,6OAA6O;IAC7O,6OAA6O;IAC7O,6OAA6O;IAC7O,6OAA6O;IAC7O,6OAA6O;IAC7O,gOAAgO;CACjO,CAAC"}
|
|
1
|
+
{"version":3,"file":"sepolia.js","sourceRoot":"","sources":["../../src/networks/sepolia.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,kBAAkB,IAAI,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAE5E,MAAM,CAAC,MAAM,0BAA0B,GAAG,OAAO,CAAC;AAClD,MAAM,CAAC,MAAM,cAAc,GAAG,sEAAsE,CAAC;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAAG,oEAAoE,CAAC;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAC3B,0FAA0F,CAAC;AAE7F,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB,kOAAkO;IAClO,6OAA6O;IAC7O,6OAA6O;IAC7O,6OAA6O;IAC7O,6OAA6O;IAC7O,6OAA6O;IAC7O,gOAAgO;CACjO,CAAC"}
|
|
@@ -1,23 +1,14 @@
|
|
|
1
|
+
import { IBeaconNodeOptions } from "@lodestar/beacon-node";
|
|
1
2
|
import { CliCommandOptions } from "@lodestar/utils";
|
|
2
|
-
|
|
3
|
-
* @deprecated These options are no longer used since eth1 deposit tracking was removed.
|
|
4
|
-
*/
|
|
3
|
+
import { ExecutionEngineArgs } from "./execution.js";
|
|
5
4
|
export type Eth1Args = {
|
|
6
|
-
/** @deprecated */
|
|
7
5
|
eth1?: boolean;
|
|
8
|
-
/** @deprecated */
|
|
9
6
|
"eth1.providerUrls"?: string[];
|
|
10
|
-
/** @deprecated */
|
|
11
7
|
"eth1.depositContractDeployBlock"?: number;
|
|
12
|
-
/** @deprecated */
|
|
13
8
|
"eth1.disableEth1DepositDataTracker"?: boolean;
|
|
14
|
-
/** @deprecated */
|
|
15
9
|
"eth1.unsafeAllowDepositDataOverwrite"?: boolean;
|
|
16
|
-
/** @deprecated */
|
|
17
10
|
"eth1.forcedEth1DataVote"?: string;
|
|
18
11
|
};
|
|
19
|
-
|
|
20
|
-
* @deprecated These options are no longer used since eth1 deposit tracking was removed.
|
|
21
|
-
*/
|
|
12
|
+
export declare function parseArgs(args: Eth1Args & Partial<ExecutionEngineArgs>): IBeaconNodeOptions["eth1"];
|
|
22
13
|
export declare const options: CliCommandOptions<Eth1Args>;
|
|
23
14
|
//# sourceMappingURL=eth1.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth1.d.ts","sourceRoot":"","sources":["../../../src/options/beaconNodeOptions/eth1.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eth1.d.ts","sourceRoot":"","sources":["../../../src/options/beaconNodeOptions/eth1.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAiB,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAElD,OAAO,EAAC,mBAAmB,EAAC,MAAM,gBAAgB,CAAC;AAEnD,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC/B,iCAAiC,CAAC,EAAE,MAAM,CAAC;IAC3C,oCAAoC,CAAC,EAAE,OAAO,CAAC;IAC/C,sCAAsC,CAAC,EAAE,OAAO,CAAC;IACjD,yBAAyB,CAAC,EAAE,MAAM,CAAC;CACpC,CAAC;AAEF,wBAAgB,SAAS,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC,mBAAmB,CAAC,GAAG,kBAAkB,CAAC,MAAM,CAAC,CA0BnG;AAED,eAAO,MAAM,OAAO,EAAE,iBAAiB,CAAC,QAAQ,CAmD/C,CAAC"}
|
|
@@ -1,18 +1,40 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import { defaultOptions } from "@lodestar/beacon-node";
|
|
3
|
+
import { extractJwtHexSecret } from "../../util/index.js";
|
|
4
|
+
export function parseArgs(args) {
|
|
5
|
+
let jwtSecretHex;
|
|
6
|
+
let jwtId;
|
|
7
|
+
let providerUrls = args["eth1.providerUrls"];
|
|
8
|
+
// If no providerUrls are explicitly provided, we should pick the execution endpoint
|
|
9
|
+
// because as per Kiln spec v2.1, execution *must* host the `eth_` methods necessary
|
|
10
|
+
// for deposit and merge trackers on engine endpoints as well protected by a
|
|
11
|
+
// jwt auth mechanism.
|
|
12
|
+
if (providerUrls === undefined && args["execution.urls"]) {
|
|
13
|
+
providerUrls = args["execution.urls"];
|
|
14
|
+
jwtSecretHex = args.jwtSecret ? extractJwtHexSecret(fs.readFileSync(args.jwtSecret, "utf-8").trim()) : undefined;
|
|
15
|
+
jwtId = args.jwtId;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
enabled: args.eth1,
|
|
19
|
+
providerUrls,
|
|
20
|
+
jwtSecretHex,
|
|
21
|
+
jwtId,
|
|
22
|
+
depositContractDeployBlock: args["eth1.depositContractDeployBlock"],
|
|
23
|
+
disableEth1DepositDataTracker: args["eth1.disableEth1DepositDataTracker"],
|
|
24
|
+
unsafeAllowDepositDataOverwrite: args["eth1.unsafeAllowDepositDataOverwrite"],
|
|
25
|
+
forcedEth1DataVote: args["eth1.forcedEth1DataVote"],
|
|
26
|
+
};
|
|
27
|
+
}
|
|
4
28
|
export const options = {
|
|
5
29
|
eth1: {
|
|
6
|
-
hidden: true,
|
|
7
|
-
deprecated: true,
|
|
8
30
|
description: "Whether to follow the eth1 chain",
|
|
9
31
|
type: "boolean",
|
|
32
|
+
defaultDescription: String(defaultOptions.eth1.enabled),
|
|
10
33
|
group: "eth1",
|
|
11
34
|
},
|
|
12
35
|
"eth1.providerUrls": {
|
|
13
|
-
hidden: true,
|
|
14
|
-
deprecated: true,
|
|
15
36
|
description: "Urls to Eth1 node with enabled rpc. If not explicitly provided and execution endpoint provided via execution.urls, it will use execution.urls. Otherwise will try connecting on the specified default(s)",
|
|
37
|
+
defaultDescription: defaultOptions.eth1.providerUrls?.join(","),
|
|
16
38
|
type: "array",
|
|
17
39
|
string: true,
|
|
18
40
|
coerce: (urls) =>
|
|
@@ -22,28 +44,27 @@ export const options = {
|
|
|
22
44
|
},
|
|
23
45
|
"eth1.depositContractDeployBlock": {
|
|
24
46
|
hidden: true,
|
|
25
|
-
deprecated: true,
|
|
26
47
|
description: "Block number at which the deposit contract contract was deployed",
|
|
27
48
|
type: "number",
|
|
49
|
+
defaultDescription: String(defaultOptions.eth1.depositContractDeployBlock),
|
|
28
50
|
group: "eth1",
|
|
29
51
|
},
|
|
30
52
|
"eth1.disableEth1DepositDataTracker": {
|
|
31
53
|
hidden: true,
|
|
32
|
-
deprecated: true,
|
|
33
54
|
description: "Disable Eth1DepositDataTracker modules",
|
|
34
55
|
type: "boolean",
|
|
56
|
+
defaultDescription: String(defaultOptions.eth1.disableEth1DepositDataTracker),
|
|
35
57
|
group: "eth1",
|
|
36
58
|
},
|
|
37
59
|
"eth1.unsafeAllowDepositDataOverwrite": {
|
|
38
60
|
hidden: true,
|
|
39
|
-
deprecated: true,
|
|
40
61
|
description: "Allow the deposit tracker to overwrite previously fetched and saved deposit event data. Warning!!! This is an unsafe operation, so enable this flag only if you know what you are doing.",
|
|
41
62
|
type: "boolean",
|
|
63
|
+
defaultDescription: String(defaultOptions.eth1.unsafeAllowDepositDataOverwrite),
|
|
42
64
|
group: "eth1",
|
|
43
65
|
},
|
|
44
66
|
"eth1.forcedEth1DataVote": {
|
|
45
67
|
hidden: true,
|
|
46
|
-
deprecated: true,
|
|
47
68
|
description: "Vote for a specific eth1_data regardless of all conditions. Hex encoded ssz serialized Eth1Data type",
|
|
48
69
|
type: "string",
|
|
49
70
|
group: "eth1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eth1.js","sourceRoot":"","sources":["../../../src/options/beaconNodeOptions/eth1.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"eth1.js","sourceRoot":"","sources":["../../../src/options/beaconNodeOptions/eth1.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAqB,cAAc,EAAC,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAC;AAYxD,MAAM,UAAU,SAAS,CAAC,IAA6C;IACrE,IAAI,YAAgC,CAAC;IACrC,IAAI,KAAyB,CAAC;IAE9B,IAAI,YAAY,GAAG,IAAI,CAAC,mBAAmB,CAAC,CAAC;IAE7C,oFAAoF;IACpF,oFAAoF;IACpF,4EAA4E;IAC5E,sBAAsB;IACtB,IAAI,YAAY,KAAK,SAAS,IAAI,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACzD,YAAY,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACtC,YAAY,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,mBAAmB,CAAC,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC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;;;;;CAU7B,CAAC"}
|
|
@@ -14,6 +14,7 @@ export function parseBeaconNodeArgs(args) {
|
|
|
14
14
|
api: api.parseArgs(args),
|
|
15
15
|
chain: chain.parseArgs(args),
|
|
16
16
|
// db: {},
|
|
17
|
+
eth1: eth1.parseArgs(args),
|
|
17
18
|
executionEngine: execution.parseArgs(args),
|
|
18
19
|
executionBuilder: builder.parseArgs(args),
|
|
19
20
|
metrics: metrics.parseArgs(args),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/options/beaconNodeOptions/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,wBAAwB,EAAC,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,GAAG,MAAM,UAAU,CAAC;AAChC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AACpC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,SAAS,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,OAAO,MAAM,cAAc,CAAC;AACxC,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAYlC,MAAM,UAAU,mBAAmB,CAAC,IAAoB;IACtD,iFAAiF;IACjF,OAAO,wBAAwB,CAAC;QAC9B,GAAG,EAAE,GAAG,CAAC,SAAS,CAAC,IAAI,CAAC;QACxB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC;QAC5B,UAAU;QACV,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC;QAC1C,gBAAgB,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACzC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QAChC,UAAU,EAAE,UAAU,CAAC,SAA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,CAAC,SAAS,CAAC,IAAI,CAAC;QAC1B,eAAe,EAAE,SAAS,CAAC,SAAS,CAAC,IAAI,CAAC;QAC1C,gBAAgB,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QACzC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QAChC,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;QACtC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC;QAChC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;KAC3B,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,GAAG,GAAG,CAAC,OAAO;IACd,GAAG,KAAK,CAAC,OAAO;IAChB,GAAG,IAAI,CAAC,OAAO;IACf,GAAG,SAAS,CAAC,OAAO;IACpB,GAAG,OAAO,CAAC,OAAO;IAClB,GAAG,OAAO,CAAC,OAAO;IAClB,GAAG,UAAU,CAAC,OAAO;IACrB,GAAG,OAAO,CAAC,OAAO;IAClB,GAAG,IAAI,CAAC,OAAO;CAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainsafe/lodestar",
|
|
3
|
-
"version": "1.39.0-dev.
|
|
3
|
+
"version": "1.39.0-dev.b37f2bd1bd",
|
|
4
4
|
"description": "Command line interface for lodestar",
|
|
5
5
|
"author": "ChainSafe Systems",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -69,17 +69,17 @@
|
|
|
69
69
|
"@libp2p/crypto": "^5.0.15",
|
|
70
70
|
"@libp2p/interface": "^2.7.0",
|
|
71
71
|
"@libp2p/peer-id": "^5.1.0",
|
|
72
|
-
"@lodestar/api": "1.39.0-dev.
|
|
73
|
-
"@lodestar/beacon-node": "1.39.0-dev.
|
|
74
|
-
"@lodestar/config": "1.39.0-dev.
|
|
75
|
-
"@lodestar/db": "1.39.0-dev.
|
|
76
|
-
"@lodestar/light-client": "1.39.0-dev.
|
|
77
|
-
"@lodestar/logger": "1.39.0-dev.
|
|
78
|
-
"@lodestar/params": "1.39.0-dev.
|
|
79
|
-
"@lodestar/state-transition": "1.39.0-dev.
|
|
80
|
-
"@lodestar/types": "1.39.0-dev.
|
|
81
|
-
"@lodestar/utils": "1.39.0-dev.
|
|
82
|
-
"@lodestar/validator": "1.39.0-dev.
|
|
72
|
+
"@lodestar/api": "1.39.0-dev.b37f2bd1bd",
|
|
73
|
+
"@lodestar/beacon-node": "1.39.0-dev.b37f2bd1bd",
|
|
74
|
+
"@lodestar/config": "1.39.0-dev.b37f2bd1bd",
|
|
75
|
+
"@lodestar/db": "1.39.0-dev.b37f2bd1bd",
|
|
76
|
+
"@lodestar/light-client": "1.39.0-dev.b37f2bd1bd",
|
|
77
|
+
"@lodestar/logger": "1.39.0-dev.b37f2bd1bd",
|
|
78
|
+
"@lodestar/params": "1.39.0-dev.b37f2bd1bd",
|
|
79
|
+
"@lodestar/state-transition": "1.39.0-dev.b37f2bd1bd",
|
|
80
|
+
"@lodestar/types": "1.39.0-dev.b37f2bd1bd",
|
|
81
|
+
"@lodestar/utils": "1.39.0-dev.b37f2bd1bd",
|
|
82
|
+
"@lodestar/validator": "1.39.0-dev.b37f2bd1bd",
|
|
83
83
|
"@multiformats/multiaddr": "^12.1.3",
|
|
84
84
|
"deepmerge": "^4.3.1",
|
|
85
85
|
"ethers": "^6.7.0",
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
"yargs": "^17.7.1"
|
|
95
95
|
},
|
|
96
96
|
"devDependencies": {
|
|
97
|
-
"@lodestar/test-utils": "1.39.0-dev.
|
|
97
|
+
"@lodestar/test-utils": "1.39.0-dev.b37f2bd1bd",
|
|
98
98
|
"@types/debug": "^4.1.7",
|
|
99
99
|
"@types/inquirer": "^9.0.3",
|
|
100
100
|
"@types/proper-lockfile": "^4.1.4",
|
|
101
101
|
"@types/yargs": "^17.0.24",
|
|
102
102
|
"fastify": "^5.2.1"
|
|
103
103
|
},
|
|
104
|
-
"gitHead": "
|
|
104
|
+
"gitHead": "d2d0808597a7c8e20703a9b6ee4041a4e25ed638"
|
|
105
105
|
}
|
|
@@ -10,7 +10,7 @@ import {ACTIVE_PRESET, PresetName} from "@lodestar/params";
|
|
|
10
10
|
import {ErrorAborted, bytesToInt, formatBytes} from "@lodestar/utils";
|
|
11
11
|
import {ProcessShutdownCallback} from "@lodestar/validator";
|
|
12
12
|
import {BeaconNodeOptions, getBeaconConfigFromArgs} from "../../config/index.js";
|
|
13
|
-
import {getNetworkBootnodes, isKnownNetworkName, readBootnodes} from "../../networks/index.js";
|
|
13
|
+
import {getNetworkBootnodes, getNetworkData, isKnownNetworkName, readBootnodes} from "../../networks/index.js";
|
|
14
14
|
import {GlobalArgs, parseBeaconNodeArgs} from "../../options/index.js";
|
|
15
15
|
import {LogArgs} from "../../options/logOptions.js";
|
|
16
16
|
import {
|
|
@@ -71,11 +71,13 @@ export async function beaconHandler(args: BeaconArgs & GlobalArgs): Promise<void
|
|
|
71
71
|
// BeaconNode setup
|
|
72
72
|
try {
|
|
73
73
|
const {anchorState, isFinalized, wsCheckpoint} = await initBeaconState(
|
|
74
|
+
options,
|
|
74
75
|
args,
|
|
75
76
|
beaconPaths.dataDir,
|
|
76
77
|
config,
|
|
77
78
|
db,
|
|
78
|
-
logger
|
|
79
|
+
logger,
|
|
80
|
+
abortController.signal
|
|
79
81
|
);
|
|
80
82
|
const beaconConfig = createBeaconConfig(config, anchorState.genesisValidatorsRoot);
|
|
81
83
|
const node = await BeaconNode.init({
|
|
@@ -187,6 +189,12 @@ export async function beaconHandlerInit(args: BeaconArgs & GlobalArgs) {
|
|
|
187
189
|
// Add detailed version string for API node/version endpoint
|
|
188
190
|
beaconNodeOptions.set({api: {commit, version}});
|
|
189
191
|
|
|
192
|
+
// Set known depositContractDeployBlock
|
|
193
|
+
if (isKnownNetworkName(network)) {
|
|
194
|
+
const {depositContractDeployBlock} = getNetworkData(network);
|
|
195
|
+
beaconNodeOptions.set({eth1: {depositContractDeployBlock}});
|
|
196
|
+
}
|
|
197
|
+
|
|
190
198
|
const logger = initLogger(args, beaconPaths.dataDir, config);
|
|
191
199
|
const {privateKey, enr} = await initPrivateKeyAndEnr(args, beaconPaths.beaconDir, logger);
|
|
192
200
|
|
|
@@ -218,7 +226,7 @@ export async function beaconHandlerInit(args: BeaconArgs & GlobalArgs) {
|
|
|
218
226
|
// Add User-Agent header to all builder requests
|
|
219
227
|
beaconNodeOptions.set({executionBuilder: {userAgent: versionStr}});
|
|
220
228
|
// Set jwt version with version string
|
|
221
|
-
beaconNodeOptions.set({executionEngine: {jwtVersion: versionStr}});
|
|
229
|
+
beaconNodeOptions.set({executionEngine: {jwtVersion: versionStr}, eth1: {jwtVersion: versionStr}});
|
|
222
230
|
// Set commit and version for ClientVersion
|
|
223
231
|
beaconNodeOptions.set({executionEngine: {commit, version}});
|
|
224
232
|
}
|
|
@@ -2,8 +2,10 @@ import {
|
|
|
2
2
|
DbCPStateDatastore,
|
|
3
3
|
FileCPStateDatastore,
|
|
4
4
|
IBeaconDb,
|
|
5
|
+
IBeaconNodeOptions,
|
|
5
6
|
checkAndPersistAnchorState,
|
|
6
7
|
getStateTypeFromBytes,
|
|
8
|
+
initStateFromEth1,
|
|
7
9
|
} from "@lodestar/beacon-node";
|
|
8
10
|
import {BeaconConfig, ChainForkConfig, createBeaconConfig} from "@lodestar/config";
|
|
9
11
|
import {
|
|
@@ -92,17 +94,20 @@ async function initAndVerifyWeakSubjectivityState(
|
|
|
92
94
|
* 1. restore from weak subjectivity state (possibly downloaded from a remote beacon node)
|
|
93
95
|
* 2. restore from db
|
|
94
96
|
* 3. restore from genesis state (possibly downloaded via URL)
|
|
97
|
+
* 4. create genesis state from eth1
|
|
95
98
|
*
|
|
96
99
|
* The returned anchorState could be finalized or not.
|
|
97
100
|
* - if we load from checkpointState, checkpointSyncUrl, genesisStateFile or archived db, it is finalized
|
|
98
101
|
* - it's not finalized if we load from unsafeCheckpointState or lastPersistedCheckpointState
|
|
99
102
|
*/
|
|
100
103
|
export async function initBeaconState(
|
|
104
|
+
options: IBeaconNodeOptions,
|
|
101
105
|
args: BeaconArgs & GlobalArgs,
|
|
102
106
|
dataDir: string,
|
|
103
107
|
chainForkConfig: ChainForkConfig,
|
|
104
108
|
db: IBeaconDb,
|
|
105
|
-
logger: Logger
|
|
109
|
+
logger: Logger,
|
|
110
|
+
signal: AbortSignal
|
|
106
111
|
): Promise<{anchorState: BeaconStateAllForks; isFinalized: boolean; wsCheckpoint?: Checkpoint}> {
|
|
107
112
|
if (args.forceCheckpointSync && !(args.checkpointState || args.checkpointSyncUrl || args.unsafeCheckpointState)) {
|
|
108
113
|
throw new Error("Forced checkpoint sync without specifying a checkpointState or checkpointSyncUrl");
|
|
@@ -328,7 +333,9 @@ export async function initBeaconState(
|
|
|
328
333
|
return {anchorState, isFinalized};
|
|
329
334
|
}
|
|
330
335
|
|
|
331
|
-
|
|
336
|
+
// Only place we will not bother checking isWithinWeakSubjectivityPeriod as forceGenesis passed by user
|
|
337
|
+
const anchorState = await initStateFromEth1({config: chainForkConfig, db, logger, opts: options.eth1, signal});
|
|
338
|
+
return {anchorState, isFinalized: true};
|
|
332
339
|
}
|
|
333
340
|
|
|
334
341
|
async function readWSState(
|
|
@@ -150,7 +150,7 @@ export const beaconExtraOptions: CliCommandOptions<BeaconExtraArgs> = {
|
|
|
150
150
|
|
|
151
151
|
private: {
|
|
152
152
|
description:
|
|
153
|
-
"Do not send implementation details over p2p identify protocol
|
|
153
|
+
"Do not send implementation details over p2p identify protocol and in builder, execution engine and eth1 requests",
|
|
154
154
|
type: "boolean",
|
|
155
155
|
},
|
|
156
156
|
|
package/src/cmds/dev/files.ts
CHANGED
|
@@ -15,7 +15,7 @@ export async function writeTestnetFiles(
|
|
|
15
15
|
const genesisTime = Math.floor(Date.now() / 1000);
|
|
16
16
|
const eth1BlockHash = Buffer.alloc(32, 0);
|
|
17
17
|
|
|
18
|
-
const state = nodeUtils.initDevState(config, genesisValidators, {genesisTime, eth1BlockHash});
|
|
18
|
+
const {state} = nodeUtils.initDevState(config, genesisValidators, {genesisTime, eth1BlockHash});
|
|
19
19
|
|
|
20
20
|
// Write testnet data
|
|
21
21
|
fs.mkdirSync(targetDir, {recursive: true});
|
package/src/cmds/dev/handler.ts
CHANGED
|
@@ -60,7 +60,7 @@ export async function devHandler(args: IDevArgs & GlobalArgs): Promise<void> {
|
|
|
60
60
|
const genesisTime = args.genesisTime ?? Math.floor(Date.now() / 1000) + 5;
|
|
61
61
|
const eth1BlockHash = fromHex(args.genesisEth1Hash ?? toHex(Buffer.alloc(32, 0x0b)));
|
|
62
62
|
|
|
63
|
-
const state = nodeUtils.initDevState(config, validatorCount, {genesisTime, eth1BlockHash});
|
|
63
|
+
const {state} = nodeUtils.initDevState(config, validatorCount, {genesisTime, eth1BlockHash});
|
|
64
64
|
|
|
65
65
|
args.genesisStateFile = "genesis.ssz";
|
|
66
66
|
fs.writeFileSync(args.genesisStateFile, state.serialize());
|
package/src/cmds/dev/options.ts
CHANGED
|
@@ -80,6 +80,11 @@ const externalOptionsOverrides: Partial<Record<"network" | keyof typeof beaconNo
|
|
|
80
80
|
defaultDescription: undefined,
|
|
81
81
|
default: true,
|
|
82
82
|
},
|
|
83
|
+
eth1: {
|
|
84
|
+
...beaconNodeOptions.eth1,
|
|
85
|
+
defaultDescription: undefined,
|
|
86
|
+
default: false,
|
|
87
|
+
},
|
|
83
88
|
rest: {
|
|
84
89
|
...beaconNodeOptions.rest,
|
|
85
90
|
defaultDescription: undefined,
|
package/src/networks/chiado.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export {chiadoChainConfig as chainConfig} from "@lodestar/config/networks";
|
|
2
2
|
|
|
3
|
+
// eth1.providerUrls suggestion: https://rpc.chiado.gnosis.gateway.fm
|
|
4
|
+
export const depositContractDeployBlock = 155435;
|
|
3
5
|
export const genesisFileUrl = "https://raw.githubusercontent.com/gnosischain/configs/main/chiado/genesis.ssz";
|
|
4
6
|
export const genesisStateRoot = "0xa48419160f8f146ecaa53d12a5d6e1e6af414a328afdc56b60d5002bb472a077";
|
|
5
7
|
export const bootnodesFileUrl = "https://raw.githubusercontent.com/gnosischain/configs/main/chiado/bootnodes.yaml";
|
package/src/networks/dev.ts
CHANGED
package/src/networks/ephemery.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export {ephemeryChainConfig as chainConfig} from "@lodestar/config/networks";
|
|
2
2
|
|
|
3
|
+
export const depositContractDeployBlock = 0;
|
|
3
4
|
export const genesisFileUrl = "https://ephemery.dev/latest/genesis.ssz";
|
|
4
5
|
export const genesisStateRoot = null;
|
|
5
6
|
export const bootnodesFileUrl = "https://ephemery.dev/latest/bootstrap_nodes.txt";
|
package/src/networks/gnosis.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export {gnosisChainConfig as chainConfig} from "@lodestar/config/networks";
|
|
2
2
|
|
|
3
|
+
// eth1.providerUrls suggestion: https://rpc.gnosischain.com
|
|
4
|
+
export const depositContractDeployBlock = 19469077;
|
|
3
5
|
export const genesisFileUrl = "https://raw.githubusercontent.com/gnosischain/configs/main/mainnet/genesis.ssz";
|
|
4
6
|
export const genesisStateRoot = "0x1511578d6de70428bf3529ab92102f21070694cb205443437fae359a7f220537";
|
|
5
7
|
export const bootnodesFileUrl = "https://raw.githubusercontent.com/gnosischain/configs/main/mainnet/bootnodes.yaml";
|
package/src/networks/hoodi.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export {hoodiChainConfig as chainConfig} from "@lodestar/config/networks";
|
|
2
2
|
|
|
3
|
+
export const depositContractDeployBlock = 0;
|
|
3
4
|
export const genesisFileUrl = "https://media.githubusercontent.com/media/eth-clients/hoodi/main/metadata/genesis.ssz";
|
|
4
5
|
export const genesisStateRoot = "0x2683ebc120f91f740c7bed4c866672d01e1ba51b4cc360297138465ee5df40f0";
|
|
5
6
|
export const bootnodesFileUrl =
|
package/src/networks/index.ts
CHANGED
|
@@ -49,6 +49,7 @@ const GET_STATE_LOG_INTERVAL = 30 * 1000;
|
|
|
49
49
|
|
|
50
50
|
export function getNetworkData(network: NetworkName): {
|
|
51
51
|
chainConfig: ChainConfig;
|
|
52
|
+
depositContractDeployBlock: number;
|
|
52
53
|
genesisFileUrl: string | null;
|
|
53
54
|
genesisStateRoot: string | null;
|
|
54
55
|
bootnodesFileUrl: string | null;
|
package/src/networks/mainnet.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export {mainnetChainConfig as chainConfig} from "@lodestar/config/networks";
|
|
2
2
|
|
|
3
|
+
export const depositContractDeployBlock = 11052984;
|
|
3
4
|
export const genesisFileUrl =
|
|
4
5
|
"https://raw.githubusercontent.com/eth-clients/mainnet/refs/heads/main/metadata/genesis.ssz";
|
|
5
6
|
export const genesisStateRoot = "0x7e76880eb67bbdc86250aa578958e9d0675e64e714337855204fb5abaaf82c2b";
|
package/src/networks/sepolia.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export {sepoliaChainConfig as chainConfig} from "@lodestar/config/networks";
|
|
2
2
|
|
|
3
|
+
export const depositContractDeployBlock = 1273020;
|
|
3
4
|
export const genesisFileUrl = "https://github.com/eth-clients/sepolia/raw/main/metadata/genesis.ssz";
|
|
4
5
|
export const genesisStateRoot = "0xfb9afe32150fa39f4b346be2519a67e2a4f5efcd50a1dc192c3f6b3d013d2798";
|
|
5
6
|
export const bootnodesFileUrl =
|
|
@@ -1,40 +1,58 @@
|
|
|
1
|
+
import fs from "node:fs";
|
|
2
|
+
import {IBeaconNodeOptions, defaultOptions} from "@lodestar/beacon-node";
|
|
1
3
|
import {CliCommandOptions} from "@lodestar/utils";
|
|
4
|
+
import {extractJwtHexSecret} from "../../util/index.js";
|
|
5
|
+
import {ExecutionEngineArgs} from "./execution.js";
|
|
2
6
|
|
|
3
|
-
/**
|
|
4
|
-
* @deprecated These options are no longer used since eth1 deposit tracking was removed.
|
|
5
|
-
*/
|
|
6
7
|
export type Eth1Args = {
|
|
7
|
-
/** @deprecated */
|
|
8
8
|
eth1?: boolean;
|
|
9
|
-
/** @deprecated */
|
|
10
9
|
"eth1.providerUrls"?: string[];
|
|
11
|
-
/** @deprecated */
|
|
12
10
|
"eth1.depositContractDeployBlock"?: number;
|
|
13
|
-
/** @deprecated */
|
|
14
11
|
"eth1.disableEth1DepositDataTracker"?: boolean;
|
|
15
|
-
/** @deprecated */
|
|
16
12
|
"eth1.unsafeAllowDepositDataOverwrite"?: boolean;
|
|
17
|
-
/** @deprecated */
|
|
18
13
|
"eth1.forcedEth1DataVote"?: string;
|
|
19
14
|
};
|
|
20
15
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
export function parseArgs(args: Eth1Args & Partial<ExecutionEngineArgs>): IBeaconNodeOptions["eth1"] {
|
|
17
|
+
let jwtSecretHex: string | undefined;
|
|
18
|
+
let jwtId: string | undefined;
|
|
19
|
+
|
|
20
|
+
let providerUrls = args["eth1.providerUrls"];
|
|
21
|
+
|
|
22
|
+
// If no providerUrls are explicitly provided, we should pick the execution endpoint
|
|
23
|
+
// because as per Kiln spec v2.1, execution *must* host the `eth_` methods necessary
|
|
24
|
+
// for deposit and merge trackers on engine endpoints as well protected by a
|
|
25
|
+
// jwt auth mechanism.
|
|
26
|
+
if (providerUrls === undefined && args["execution.urls"]) {
|
|
27
|
+
providerUrls = args["execution.urls"];
|
|
28
|
+
jwtSecretHex = args.jwtSecret ? extractJwtHexSecret(fs.readFileSync(args.jwtSecret, "utf-8").trim()) : undefined;
|
|
29
|
+
jwtId = args.jwtId;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
return {
|
|
33
|
+
enabled: args.eth1,
|
|
34
|
+
providerUrls,
|
|
35
|
+
jwtSecretHex,
|
|
36
|
+
jwtId,
|
|
37
|
+
depositContractDeployBlock: args["eth1.depositContractDeployBlock"],
|
|
38
|
+
disableEth1DepositDataTracker: args["eth1.disableEth1DepositDataTracker"],
|
|
39
|
+
unsafeAllowDepositDataOverwrite: args["eth1.unsafeAllowDepositDataOverwrite"],
|
|
40
|
+
forcedEth1DataVote: args["eth1.forcedEth1DataVote"],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
24
44
|
export const options: CliCommandOptions<Eth1Args> = {
|
|
25
45
|
eth1: {
|
|
26
|
-
hidden: true,
|
|
27
|
-
deprecated: true,
|
|
28
46
|
description: "Whether to follow the eth1 chain",
|
|
29
47
|
type: "boolean",
|
|
48
|
+
defaultDescription: String(defaultOptions.eth1.enabled),
|
|
30
49
|
group: "eth1",
|
|
31
50
|
},
|
|
32
51
|
|
|
33
52
|
"eth1.providerUrls": {
|
|
34
|
-
hidden: true,
|
|
35
|
-
deprecated: true,
|
|
36
53
|
description:
|
|
37
54
|
"Urls to Eth1 node with enabled rpc. If not explicitly provided and execution endpoint provided via execution.urls, it will use execution.urls. Otherwise will try connecting on the specified default(s)",
|
|
55
|
+
defaultDescription: defaultOptions.eth1.providerUrls?.join(","),
|
|
38
56
|
type: "array",
|
|
39
57
|
string: true,
|
|
40
58
|
coerce: (urls: string[]): string[] =>
|
|
@@ -45,32 +63,31 @@ export const options: CliCommandOptions<Eth1Args> = {
|
|
|
45
63
|
|
|
46
64
|
"eth1.depositContractDeployBlock": {
|
|
47
65
|
hidden: true,
|
|
48
|
-
deprecated: true,
|
|
49
66
|
description: "Block number at which the deposit contract contract was deployed",
|
|
50
67
|
type: "number",
|
|
68
|
+
defaultDescription: String(defaultOptions.eth1.depositContractDeployBlock),
|
|
51
69
|
group: "eth1",
|
|
52
70
|
},
|
|
53
71
|
|
|
54
72
|
"eth1.disableEth1DepositDataTracker": {
|
|
55
73
|
hidden: true,
|
|
56
|
-
deprecated: true,
|
|
57
74
|
description: "Disable Eth1DepositDataTracker modules",
|
|
58
75
|
type: "boolean",
|
|
76
|
+
defaultDescription: String(defaultOptions.eth1.disableEth1DepositDataTracker),
|
|
59
77
|
group: "eth1",
|
|
60
78
|
},
|
|
61
79
|
|
|
62
80
|
"eth1.unsafeAllowDepositDataOverwrite": {
|
|
63
81
|
hidden: true,
|
|
64
|
-
deprecated: true,
|
|
65
82
|
description:
|
|
66
83
|
"Allow the deposit tracker to overwrite previously fetched and saved deposit event data. Warning!!! This is an unsafe operation, so enable this flag only if you know what you are doing.",
|
|
67
84
|
type: "boolean",
|
|
85
|
+
defaultDescription: String(defaultOptions.eth1.unsafeAllowDepositDataOverwrite),
|
|
68
86
|
group: "eth1",
|
|
69
87
|
},
|
|
70
88
|
|
|
71
89
|
"eth1.forcedEth1DataVote": {
|
|
72
90
|
hidden: true,
|
|
73
|
-
deprecated: true,
|
|
74
91
|
description: "Vote for a specific eth1_data regardless of all conditions. Hex encoded ssz serialized Eth1Data type",
|
|
75
92
|
type: "string",
|
|
76
93
|
group: "eth1",
|
|
@@ -27,6 +27,7 @@ export function parseBeaconNodeArgs(args: BeaconNodeArgs): RecursivePartial<IBea
|
|
|
27
27
|
api: api.parseArgs(args),
|
|
28
28
|
chain: chain.parseArgs(args),
|
|
29
29
|
// db: {},
|
|
30
|
+
eth1: eth1.parseArgs(args),
|
|
30
31
|
executionEngine: execution.parseArgs(args),
|
|
31
32
|
executionBuilder: builder.parseArgs(args),
|
|
32
33
|
metrics: metrics.parseArgs(args),
|