@chainsafe/lodestar 1.41.0-dev.9fa839a030 → 1.41.0-dev.aeab9f930d
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/applyPreset.js.map +1 -1
- package/lib/cli.js.map +1 -1
- package/lib/cmds/beacon/handler.d.ts +1 -1
- package/lib/cmds/beacon/handler.d.ts.map +1 -1
- package/lib/cmds/beacon/handler.js +5 -9
- package/lib/cmds/beacon/handler.js.map +1 -1
- package/lib/cmds/beacon/initBeaconState.js.map +1 -1
- package/lib/cmds/beacon/initPeerIdAndEnr.d.ts.map +1 -1
- package/lib/cmds/beacon/initPeerIdAndEnr.js +5 -12
- package/lib/cmds/beacon/initPeerIdAndEnr.js.map +1 -1
- package/lib/cmds/beacon/paths.d.ts +1 -1
- package/lib/cmds/beacon/paths.d.ts.map +1 -1
- package/lib/cmds/beacon/paths.js.map +1 -1
- package/lib/cmds/bootnode/handler.d.ts.map +1 -1
- package/lib/cmds/bootnode/handler.js.map +1 -1
- package/lib/cmds/dev/files.js.map +1 -1
- package/lib/cmds/dev/handler.js.map +1 -1
- package/lib/cmds/dev/options.d.ts +126 -126
- package/lib/cmds/lightclient/handler.js.map +1 -1
- package/lib/cmds/validator/blsToExecutionChange.js.map +1 -1
- package/lib/cmds/validator/handler.js +1 -1
- package/lib/cmds/validator/handler.js.map +1 -1
- package/lib/cmds/validator/import.js.map +1 -1
- package/lib/cmds/validator/keymanager/decryptKeystoreDefinitions.js.map +1 -1
- package/lib/cmds/validator/keymanager/decryptKeystores/threadPool.d.ts.map +1 -1
- package/lib/cmds/validator/keymanager/decryptKeystores/threadPool.js.map +1 -1
- package/lib/cmds/validator/keymanager/decryptKeystores/types.js.map +1 -1
- package/lib/cmds/validator/keymanager/decryptKeystores/worker.js.map +1 -1
- package/lib/cmds/validator/keymanager/impl.d.ts +3 -3
- package/lib/cmds/validator/keymanager/impl.d.ts.map +1 -1
- package/lib/cmds/validator/keymanager/impl.js.map +1 -1
- package/lib/cmds/validator/keymanager/keystoreCache.js.map +1 -1
- package/lib/cmds/validator/keymanager/persistedKeys.d.ts +2 -2
- package/lib/cmds/validator/keymanager/persistedKeys.d.ts.map +1 -1
- package/lib/cmds/validator/keymanager/persistedKeys.js.map +1 -1
- package/lib/cmds/validator/keymanager/server.d.ts.map +1 -1
- package/lib/cmds/validator/keymanager/server.js.map +1 -1
- package/lib/cmds/validator/list.js.map +1 -1
- package/lib/cmds/validator/options.d.ts +1 -1
- package/lib/cmds/validator/options.d.ts.map +1 -1
- package/lib/cmds/validator/options.js +16 -7
- package/lib/cmds/validator/options.js.map +1 -1
- package/lib/cmds/validator/paths.js.map +1 -1
- package/lib/cmds/validator/signers/importExternalKeystores.js.map +1 -1
- package/lib/cmds/validator/signers/index.d.ts +2 -2
- package/lib/cmds/validator/signers/index.js +68 -13
- package/lib/cmds/validator/signers/index.js.map +1 -1
- package/lib/cmds/validator/signers/logSigners.js +1 -1
- package/lib/cmds/validator/signers/logSigners.js.map +1 -1
- package/lib/cmds/validator/slashingProtection/export.js.map +1 -1
- package/lib/cmds/validator/slashingProtection/import.js.map +1 -1
- package/lib/cmds/validator/slashingProtection/utils.js.map +1 -1
- package/lib/cmds/validator/voluntaryExit.js +1 -1
- package/lib/cmds/validator/voluntaryExit.js.map +1 -1
- package/lib/config/beaconNodeOptions.d.ts.map +1 -1
- package/lib/config/beaconNodeOptions.js.map +1 -1
- package/lib/config/beaconParams.js.map +1 -1
- package/lib/config/peerId.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/networks/index.d.ts +1 -1
- package/lib/networks/index.d.ts.map +1 -1
- package/lib/networks/index.js.map +1 -1
- package/lib/options/beaconNodeOptions/api.js.map +1 -1
- package/lib/options/beaconNodeOptions/builder.js.map +1 -1
- package/lib/options/beaconNodeOptions/chain.js.map +1 -1
- package/lib/options/beaconNodeOptions/execution.js.map +1 -1
- package/lib/options/beaconNodeOptions/index.d.ts +75 -75
- package/lib/options/beaconNodeOptions/index.js.map +1 -1
- package/lib/options/beaconNodeOptions/metrics.js.map +1 -1
- package/lib/options/beaconNodeOptions/monitoring.js.map +1 -1
- package/lib/options/beaconNodeOptions/network.js.map +1 -1
- package/lib/options/beaconNodeOptions/sync.js.map +1 -1
- package/lib/options/paramsOptions.js.map +1 -1
- package/lib/paths/global.js.map +1 -1
- package/lib/paths/rootDir.js.map +1 -1
- package/lib/util/errors.js.map +1 -1
- package/lib/util/ethers.d.ts +1 -1
- package/lib/util/ethers.d.ts.map +1 -1
- package/lib/util/ethers.js.map +1 -1
- package/lib/util/feeRecipient.js.map +1 -1
- package/lib/util/file.js +2 -1
- package/lib/util/file.js.map +1 -1
- package/lib/util/format.js.map +1 -1
- package/lib/util/fs.js.map +1 -1
- package/lib/util/gitData/gitDataPath.js.map +1 -1
- package/lib/util/gitData/index.js.map +1 -1
- package/lib/util/jwt.js.map +1 -1
- package/lib/util/lockfile.js.map +1 -1
- package/lib/util/logger.js.map +1 -1
- package/lib/util/object.js.map +1 -1
- package/lib/util/passphrase.js.map +1 -1
- package/lib/util/process.js.map +1 -1
- package/lib/util/progress.d.ts +1 -1
- package/lib/util/progress.d.ts.map +1 -1
- package/lib/util/progress.js.map +1 -1
- package/lib/util/proposerConfig.js.map +1 -1
- package/lib/util/pruneOldFilesInDir.js.map +1 -1
- package/lib/util/sleep.js.map +1 -1
- package/lib/util/stripOffNewlines.js.map +1 -1
- package/lib/util/types.js.map +1 -1
- package/lib/util/version.js.map +1 -1
- package/package.json +24 -24
- package/src/cmds/beacon/handler.ts +5 -9
- package/src/cmds/beacon/initPeerIdAndEnr.ts +5 -13
- package/src/cmds/bootnode/handler.ts +2 -2
- package/src/cmds/dev/options.ts +1 -1
- package/src/cmds/validator/handler.ts +1 -1
- package/src/cmds/validator/options.ts +17 -8
- package/src/cmds/validator/signers/index.ts +80 -13
- package/src/cmds/validator/signers/logSigners.ts +1 -1
- package/src/cmds/validator/voluntaryExit.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pruneOldFilesInDir.js","sourceRoot":"","sources":["../../src/util/pruneOldFilesInDir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,QAAgB;
|
|
1
|
+
{"version":3,"file":"pruneOldFilesInDir.js","sourceRoot":"","sources":["../../src/util/pruneOldFilesInDir.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,UAAU,kBAAkB,CAAC,OAAe,EAAE,QAAgB,EAAU;IAC5E,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,OAAO,CAAC,CAAC,CAAC,mBAAmB;IAC/B,CAAC;IAED,IAAI,gBAAgB,GAAG,CAAC,CAAC;IACzB,KAAK,MAAM,SAAS,IAAI,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,EAAE,CAAC;QAChD,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAEhD,MAAM,IAAI,GAAG,EAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;QACpC,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACvB,gBAAgB,IAAI,kBAAkB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC9D,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,GAAG,QAAQ,EAAE,CAAC;YACjE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YACzB,gBAAgB,IAAI,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,iDAAiD;IACjD,IAAI,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IACD,OAAO,gBAAgB,CAAC;AAAA,CACzB"}
|
package/lib/util/sleep.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/util/sleep.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,KAAK,CAAC,EAAU;
|
|
1
|
+
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../src/util/sleep.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,KAAK,CAAC,EAAU,EAAiB;IAC/C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AAAA,CAC1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripOffNewlines.js","sourceRoot":"","sources":["../../src/util/stripOffNewlines.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAS;
|
|
1
|
+
{"version":3,"file":"stripOffNewlines.js","sourceRoot":"","sources":["../../src/util/stripOffNewlines.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,CAAS,EAAU;IAClD,OAAO,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AAAA,CACnC"}
|
package/lib/util/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/util/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,6EAA6E;AAC7E,MAAM,UAAU,UAAU,CAAiC,CAAI;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/util/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,6EAA6E;AAC7E,MAAM,UAAU,UAAU,CAAiC,CAAI,EAAe;IAC5E,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAAA,CACvB"}
|
package/lib/util/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/util/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAErD,gEAAgE;AAChE,oHAAoH;AACpH,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/util/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,SAAS,CAAC;AACnC,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AAErD,gEAAgE;AAChE,oHAAoH;AACpH,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAO/D,MAAM,aAAa,GAAG,+BAA+B,CAAC;AAEtD;;;;;;GAMG;AACH,MAAM,UAAU,cAAc,GAG5B;IACA,MAAM,KAAK,GAAa,EAAE,CAAC;IAE3B,8EAA8E;IAC9E,MAAM,YAAY,GAAG,kBAAkB,EAAE,IAAI,wBAAwB,EAAE,CAAC;IACxE,IAAI,YAAY,EAAE,CAAC;QACjB,KAAK,CAAC,IAAI,CAAC,IAAI,YAAY,EAAE,CAAC,CAAC;IACjC,CAAC;IAED,MAAM,EAAC,MAAM,EAAE,MAAM,EAAC,GAAG,iBAAiB,EAAE,CAAC;IAE7C,yDAAyD;IACzD,IAAI,MAAM,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,MAAM,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE9D,wEAAwE;IACxE,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACvC,wEAAwE;QACxE,IAAI,CAAC,YAAY,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC;YACzD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IAED,OAAO;QACL,kCAAkC;QAClC,OAAO,EAAE,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS;QACvD,MAAM;KACP,CAAC;AAAA,CACH;AAED,+CAA+C;AAC/C,SAAS,wBAAwB,GAAuB;IACtD,MAAM,QAAQ,GAAG,UAAU,CAAC,YAAY,EAAE,EAAC,GAAG,EAAE,SAAS,EAAC,CAAC,CAAC;IAC5D,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAEhC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAgB,CAAC;IAC/E,OAAO,SAAS,CAAC,OAAO,CAAC;AAAA,CAC1B;AAED,iDAAiD;AACjD,SAAS,kBAAkB,GAAuB;IAChD,MAAM,QAAQ,GAAG,UAAU,CAAC,cAAc,EAAE,EAAC,GAAG,EAAE,SAAS,EAAC,CAAC,CAAC;IAC9D,IAAI,CAAC,QAAQ;QAAE,OAAO,SAAS,CAAC;IAEhC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAgB,CAAC;IACjF,OAAO,WAAW,CAAC,OAAO,CAAC;AAAA,CAC5B"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainsafe/lodestar",
|
|
3
|
-
"version": "1.41.0-dev.
|
|
3
|
+
"version": "1.41.0-dev.aeab9f930d",
|
|
4
4
|
"description": "Command line interface for lodestar",
|
|
5
5
|
"author": "ChainSafe Systems",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
},
|
|
29
29
|
"scripts": {
|
|
30
30
|
"clean": "rm -rf lib && rm -f *.tsbuildinfo",
|
|
31
|
-
"build": "
|
|
31
|
+
"build": "tsgo -p tsconfig.build.json && pnpm write-git-data",
|
|
32
32
|
"build:release": "pnpm clean && pnpm run build",
|
|
33
|
-
"build:watch": "
|
|
33
|
+
"build:watch": "tsgo -p tsconfig.build.json --watch",
|
|
34
34
|
"write-git-data": "node lib/util/gitData/writeGitData.js",
|
|
35
35
|
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\" lodestar --help",
|
|
36
|
-
"check-types": "
|
|
36
|
+
"check-types": "tsgo",
|
|
37
37
|
"docs:build": "node --loader ts-node/esm ./docsgen/index.ts",
|
|
38
38
|
"lint": "biome check src/ test/",
|
|
39
39
|
"lint:fix": "pnpm run lint --write",
|
|
@@ -60,27 +60,27 @@
|
|
|
60
60
|
"@chainsafe/bls-keygen": "^0.4.0",
|
|
61
61
|
"@chainsafe/bls-keystore": "^3.1.0",
|
|
62
62
|
"@chainsafe/blst": "^2.2.0",
|
|
63
|
-
"@chainsafe/discv5": "^
|
|
64
|
-
"@chainsafe/enr": "^
|
|
63
|
+
"@chainsafe/discv5": "^12.0.0",
|
|
64
|
+
"@chainsafe/enr": "^6.0.0",
|
|
65
65
|
"@chainsafe/persistent-merkle-tree": "^1.2.1",
|
|
66
66
|
"@chainsafe/pubkey-index-map": "^3.0.0",
|
|
67
67
|
"@chainsafe/ssz": "^1.2.2",
|
|
68
68
|
"@chainsafe/threads": "^1.11.3",
|
|
69
|
-
"@libp2p/crypto": "^5.
|
|
70
|
-
"@libp2p/interface": "^
|
|
71
|
-
"@libp2p/peer-id": "^
|
|
72
|
-
"@lodestar/api": "^1.41.0-dev.
|
|
73
|
-
"@lodestar/beacon-node": "^1.41.0-dev.
|
|
74
|
-
"@lodestar/config": "^1.41.0-dev.
|
|
75
|
-
"@lodestar/db": "^1.41.0-dev.
|
|
76
|
-
"@lodestar/light-client": "^1.41.0-dev.
|
|
77
|
-
"@lodestar/logger": "^1.41.0-dev.
|
|
78
|
-
"@lodestar/params": "^1.41.0-dev.
|
|
79
|
-
"@lodestar/state-transition": "^1.41.0-dev.
|
|
80
|
-
"@lodestar/types": "^1.41.0-dev.
|
|
81
|
-
"@lodestar/utils": "^1.41.0-dev.
|
|
82
|
-
"@lodestar/validator": "^1.41.0-dev.
|
|
83
|
-
"@multiformats/multiaddr": "^
|
|
69
|
+
"@libp2p/crypto": "^5.1.13",
|
|
70
|
+
"@libp2p/interface": "^3.1.0",
|
|
71
|
+
"@libp2p/peer-id": "^6.0.4",
|
|
72
|
+
"@lodestar/api": "^1.41.0-dev.aeab9f930d",
|
|
73
|
+
"@lodestar/beacon-node": "^1.41.0-dev.aeab9f930d",
|
|
74
|
+
"@lodestar/config": "^1.41.0-dev.aeab9f930d",
|
|
75
|
+
"@lodestar/db": "^1.41.0-dev.aeab9f930d",
|
|
76
|
+
"@lodestar/light-client": "^1.41.0-dev.aeab9f930d",
|
|
77
|
+
"@lodestar/logger": "^1.41.0-dev.aeab9f930d",
|
|
78
|
+
"@lodestar/params": "^1.41.0-dev.aeab9f930d",
|
|
79
|
+
"@lodestar/state-transition": "^1.41.0-dev.aeab9f930d",
|
|
80
|
+
"@lodestar/types": "^1.41.0-dev.aeab9f930d",
|
|
81
|
+
"@lodestar/utils": "^1.41.0-dev.aeab9f930d",
|
|
82
|
+
"@lodestar/validator": "^1.41.0-dev.aeab9f930d",
|
|
83
|
+
"@multiformats/multiaddr": "^13.0.1",
|
|
84
84
|
"deepmerge": "^4.3.1",
|
|
85
85
|
"ethers": "^6.7.0",
|
|
86
86
|
"find-up": "^6.3.0",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"devDependencies": {
|
|
97
97
|
"@chainsafe/as-sha256": "^1.2.0",
|
|
98
98
|
"@ethereumjs/rlp": "^4.0.1",
|
|
99
|
-
"@lodestar/test-utils": "^1.41.0-dev.
|
|
99
|
+
"@lodestar/test-utils": "^1.41.0-dev.aeab9f930d",
|
|
100
100
|
"@types/debug": "^4.1.7",
|
|
101
101
|
"@types/inquirer": "^9.0.3",
|
|
102
102
|
"@types/js-yaml": "^4.0.5",
|
|
@@ -104,10 +104,10 @@
|
|
|
104
104
|
"@types/tmp": "^0.2.3",
|
|
105
105
|
"@types/yargs": "^17.0.24",
|
|
106
106
|
"ethereum-cryptography": "^2.2.1",
|
|
107
|
-
"fastify": "^5.
|
|
107
|
+
"fastify": "^5.8.1",
|
|
108
108
|
"tmp": "^0.2.4",
|
|
109
109
|
"web3": "^4.0.3",
|
|
110
110
|
"web3-eth-accounts": "^4.0.3"
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "89f360d7bf466b84570b2b831517069776a24643"
|
|
113
113
|
}
|
|
@@ -2,13 +2,12 @@ import path from "node:path";
|
|
|
2
2
|
import {getHeapStatistics} from "node:v8";
|
|
3
3
|
import {SignableENR} from "@chainsafe/enr";
|
|
4
4
|
import {hasher} from "@chainsafe/persistent-merkle-tree";
|
|
5
|
-
import {PubkeyIndexMap} from "@chainsafe/pubkey-index-map";
|
|
6
5
|
import {BeaconDb, BeaconNode} from "@lodestar/beacon-node";
|
|
7
6
|
import {ChainForkConfig, createBeaconConfig} from "@lodestar/config";
|
|
8
7
|
import {LevelDbController} from "@lodestar/db/controller/level";
|
|
9
8
|
import {LoggerNode, getNodeLogger} from "@lodestar/logger/node";
|
|
10
9
|
import {ACTIVE_PRESET, PresetName} from "@lodestar/params";
|
|
11
|
-
import {
|
|
10
|
+
import {createCachedBeaconState, createPubkeyCache, syncPubkeys} from "@lodestar/state-transition";
|
|
12
11
|
import {ErrorAborted, bytesToInt, formatBytes} from "@lodestar/utils";
|
|
13
12
|
import {ProcessShutdownCallback} from "@lodestar/validator";
|
|
14
13
|
import {BeaconNodeOptions, getBeaconConfigFromArgs} from "../../config/index.js";
|
|
@@ -80,15 +79,13 @@ export async function beaconHandler(args: BeaconArgs & GlobalArgs): Promise<void
|
|
|
80
79
|
logger
|
|
81
80
|
);
|
|
82
81
|
const beaconConfig = createBeaconConfig(config, anchorState.genesisValidatorsRoot);
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
syncPubkeys(anchorState.validators.getAllReadonlyValues(), pubkey2index, index2pubkey);
|
|
82
|
+
const pubkeyCache = createPubkeyCache();
|
|
83
|
+
syncPubkeys(pubkeyCache, anchorState.validators.getAllReadonlyValues());
|
|
86
84
|
const cachedState = createCachedBeaconState(
|
|
87
85
|
anchorState,
|
|
88
86
|
{
|
|
89
87
|
config: beaconConfig,
|
|
90
|
-
|
|
91
|
-
index2pubkey,
|
|
88
|
+
pubkeyCache,
|
|
92
89
|
},
|
|
93
90
|
{skipSyncPubkeys: true}
|
|
94
91
|
);
|
|
@@ -96,8 +93,7 @@ export async function beaconHandler(args: BeaconArgs & GlobalArgs): Promise<void
|
|
|
96
93
|
const node = await BeaconNode.init({
|
|
97
94
|
opts: options,
|
|
98
95
|
config: beaconConfig,
|
|
99
|
-
|
|
100
|
-
index2pubkey,
|
|
96
|
+
pubkeyCache,
|
|
101
97
|
db,
|
|
102
98
|
logger,
|
|
103
99
|
processShutdownCallback,
|
|
@@ -18,27 +18,19 @@ import {BeaconArgs} from "./options.js";
|
|
|
18
18
|
export function isLocalMultiAddr(multiaddr: Multiaddr | undefined): boolean {
|
|
19
19
|
if (!multiaddr) return false;
|
|
20
20
|
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const components = multiaddr.getComponents();
|
|
22
|
+
if (components.length !== 2 && components[1].name !== "udp") {
|
|
23
23
|
throw new Error("Invalid udp multiaddr");
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
const interfaces = os.networkInterfaces();
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const isIPv4: boolean = family === 4;
|
|
30
|
-
const ip = tuples[0][1];
|
|
27
|
+
const family = components[0].name === "ip4" ? 4 : 6;
|
|
28
|
+
const ipStr = components[0].value;
|
|
31
29
|
|
|
32
|
-
if (!
|
|
30
|
+
if (!ipStr) {
|
|
33
31
|
return false;
|
|
34
32
|
}
|
|
35
33
|
|
|
36
|
-
const ipStr = isIPv4
|
|
37
|
-
? Array.from(ip).join(".")
|
|
38
|
-
: Array.from(Uint16Array.from(ip))
|
|
39
|
-
.map((n) => n.toString(16))
|
|
40
|
-
.join(":");
|
|
41
|
-
|
|
42
34
|
for (const networkInterfaces of Object.values(interfaces)) {
|
|
43
35
|
for (const networkInterface of networkInterfaces || []) {
|
|
44
36
|
// since node version 18, the netowrkinterface family returns 4 | 6 instead of ipv4 | ipv6,
|
|
@@ -2,7 +2,7 @@ import path from "node:path";
|
|
|
2
2
|
import {PrivateKey} from "@libp2p/interface";
|
|
3
3
|
import {Multiaddr, multiaddr} from "@multiformats/multiaddr";
|
|
4
4
|
import {Discv5, Discv5EventEmitter} from "@chainsafe/discv5";
|
|
5
|
-
import {ENR,
|
|
5
|
+
import {ENR, SignableENR} from "@chainsafe/enr";
|
|
6
6
|
import {
|
|
7
7
|
HttpMetricsServer,
|
|
8
8
|
IBeaconNodeOptions,
|
|
@@ -87,7 +87,7 @@ export async function bootnodeHandler(args: BootnodeArgs & GlobalArgs): Promise<
|
|
|
87
87
|
void discv5.findRandomNode();
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
discv5.on("multiaddrUpdated", (addr:
|
|
90
|
+
discv5.on("multiaddrUpdated", (addr: Multiaddr) => {
|
|
91
91
|
logger.info("Advertised socket address updated", {addr: addr.toString()});
|
|
92
92
|
});
|
|
93
93
|
|
package/src/cmds/dev/options.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {CliCommandOptions, CliOptionDefinition} from "@lodestar/utils";
|
|
2
2
|
import {NetworkName} from "../../networks/index.js";
|
|
3
3
|
import {beaconNodeOptions, globalOptions} from "../../options/index.js";
|
|
4
|
-
import {parseRange} from "../../util/format.
|
|
4
|
+
import {parseRange} from "../../util/format.js";
|
|
5
5
|
import {BeaconArgs, beaconOptions} from "../beacon/options.js";
|
|
6
6
|
import {IValidatorCliArgs, validatorOptions} from "../validator/options.js";
|
|
7
7
|
|
|
@@ -179,7 +179,7 @@ export async function validatorHandler(args: IValidatorCliArgs & GlobalArgs): Pr
|
|
|
179
179
|
broadcastValidation: parseBroadcastValidation(args.broadcastValidation),
|
|
180
180
|
blindedLocal: args.blindedLocal,
|
|
181
181
|
externalSigner: {
|
|
182
|
-
|
|
182
|
+
urls: args["externalSigner.urls"],
|
|
183
183
|
fetch: args["externalSigner.fetch"],
|
|
184
184
|
fetchInterval: args["externalSigner.fetchInterval"],
|
|
185
185
|
},
|
|
@@ -63,7 +63,7 @@ export type IValidatorCliArgs = AccountValidatorArgs &
|
|
|
63
63
|
|
|
64
64
|
"clock.skipSlots"?: boolean;
|
|
65
65
|
|
|
66
|
-
"externalSigner.
|
|
66
|
+
"externalSigner.urls"?: string[];
|
|
67
67
|
"externalSigner.pubkeys"?: string[];
|
|
68
68
|
"externalSigner.fetch"?: boolean;
|
|
69
69
|
"externalSigner.fetchInterval"?: number;
|
|
@@ -341,14 +341,23 @@ export const validatorOptions: CliCommandOptions<IValidatorCliArgs> = {
|
|
|
341
341
|
|
|
342
342
|
// External signer
|
|
343
343
|
|
|
344
|
-
"externalSigner.
|
|
345
|
-
|
|
346
|
-
|
|
344
|
+
"externalSigner.urls": {
|
|
345
|
+
alias: "externalSigner.url",
|
|
346
|
+
description: "URL(s) to connect to external signing server(s)",
|
|
347
|
+
type: "array",
|
|
348
|
+
string: true,
|
|
349
|
+
// Support backward compatibility: allow string in config files, convert to array
|
|
350
|
+
coerce: (urls: string | string[]): string[] => {
|
|
351
|
+
if (typeof urls === "string") {
|
|
352
|
+
return [urls];
|
|
353
|
+
}
|
|
354
|
+
return urls;
|
|
355
|
+
},
|
|
347
356
|
group: "externalSigner",
|
|
348
357
|
},
|
|
349
358
|
|
|
350
359
|
"externalSigner.pubkeys": {
|
|
351
|
-
implies: ["externalSigner.
|
|
360
|
+
implies: ["externalSigner.urls"],
|
|
352
361
|
description:
|
|
353
362
|
"List of validator public keys used by an external signer. May also provide a single string of comma-separated public keys",
|
|
354
363
|
type: "array",
|
|
@@ -362,10 +371,10 @@ export const validatorOptions: CliCommandOptions<IValidatorCliArgs> = {
|
|
|
362
371
|
},
|
|
363
372
|
|
|
364
373
|
"externalSigner.fetch": {
|
|
365
|
-
implies: ["externalSigner.
|
|
374
|
+
implies: ["externalSigner.urls"],
|
|
366
375
|
conflicts: ["externalSigner.pubkeys"],
|
|
367
376
|
description:
|
|
368
|
-
"Fetch the list of public keys to validate from
|
|
377
|
+
"Fetch the list of public keys to validate from external signer(s). Cannot be used in combination with `--externalSigner.pubkeys`",
|
|
369
378
|
type: "boolean",
|
|
370
379
|
group: "externalSigner",
|
|
371
380
|
},
|
|
@@ -373,7 +382,7 @@ export const validatorOptions: CliCommandOptions<IValidatorCliArgs> = {
|
|
|
373
382
|
"externalSigner.fetchInterval": {
|
|
374
383
|
implies: ["externalSigner.fetch"],
|
|
375
384
|
description:
|
|
376
|
-
"Interval in milliseconds between fetching the list of public keys from external signer, once per epoch by default",
|
|
385
|
+
"Interval in milliseconds between fetching the list of public keys from external signer(s), once per epoch by default",
|
|
377
386
|
type: "number",
|
|
378
387
|
group: "externalSigner",
|
|
379
388
|
},
|
|
@@ -20,8 +20,8 @@ const KEYSTORE_IMPORT_PROGRESS_MS = 10000;
|
|
|
20
20
|
* --interopIndexes
|
|
21
21
|
* --fromMnemonic, then requires --mnemonicIndexes
|
|
22
22
|
* --importKeystores, then requires --importKeystoresPassword
|
|
23
|
-
* --externalSigner.fetch, then requires --externalSigner.
|
|
24
|
-
* --externalSigner.pubkeys, then requires --externalSigner.
|
|
23
|
+
* --externalSigner.fetch, then requires --externalSigner.urls
|
|
24
|
+
* --externalSigner.pubkeys, then requires --externalSigner.urls
|
|
25
25
|
* else load from persisted
|
|
26
26
|
* - both remote keys and local keystores
|
|
27
27
|
*
|
|
@@ -52,7 +52,7 @@ export async function getSignersFromArgs(
|
|
|
52
52
|
const indexes = args.interopIndexes;
|
|
53
53
|
// Using a remote signer with TESTNETS
|
|
54
54
|
if (args["externalSigner.pubkeys"] || args["externalSigner.fetch"]) {
|
|
55
|
-
return getRemoteSigners(args);
|
|
55
|
+
return getRemoteSigners(args, logger);
|
|
56
56
|
}
|
|
57
57
|
return indexes.map((index) => ({type: SignerType.Local, secretKey: interopSecretKey(index)}));
|
|
58
58
|
}
|
|
@@ -105,7 +105,7 @@ export async function getSignersFromArgs(
|
|
|
105
105
|
|
|
106
106
|
// Remote keys are declared manually or will be fetched from external signer
|
|
107
107
|
if (args["externalSigner.pubkeys"] || args["externalSigner.fetch"]) {
|
|
108
|
-
return getRemoteSigners(args);
|
|
108
|
+
return getRemoteSigners(args, logger);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// Read keys from local account manager
|
|
@@ -153,24 +153,91 @@ export function getSignerPubkeyHex(signer: Signer): string {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
async function getRemoteSigners(
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
async function getRemoteSigners(
|
|
157
|
+
args: IValidatorCliArgs & GlobalArgs,
|
|
158
|
+
logger: Pick<Logger, LogLevel.info | LogLevel.warn | LogLevel.debug>
|
|
159
|
+
): Promise<Signer[]> {
|
|
160
|
+
const externalSignerUrls = args["externalSigner.urls"] ?? [];
|
|
161
|
+
|
|
162
|
+
if (externalSignerUrls.length === 0) {
|
|
159
163
|
throw new YargsError(
|
|
160
|
-
`Must set externalSigner.
|
|
164
|
+
`Must set externalSigner.urls with ${
|
|
161
165
|
args["externalSigner.pubkeys"] ? "externalSigner.pubkeys" : "externalSigner.fetch"
|
|
162
166
|
}`
|
|
163
167
|
);
|
|
164
168
|
}
|
|
165
|
-
|
|
166
|
-
|
|
169
|
+
|
|
170
|
+
for (const url of externalSignerUrls) {
|
|
171
|
+
if (!isValidHttpUrl(url)) {
|
|
172
|
+
throw new YargsError(`Invalid external signer URL: ${url}`);
|
|
173
|
+
}
|
|
167
174
|
}
|
|
175
|
+
|
|
168
176
|
if (args["externalSigner.pubkeys"] && args["externalSigner.pubkeys"].length === 0) {
|
|
169
177
|
throw new YargsError("externalSigner.pubkeys is set to an empty list");
|
|
170
178
|
}
|
|
171
179
|
|
|
172
|
-
const
|
|
173
|
-
|
|
180
|
+
const signers: Signer[] = [];
|
|
181
|
+
|
|
182
|
+
if (args["externalSigner.pubkeys"]) {
|
|
183
|
+
// If pubkeys are explicitly provided with multiple URLs, warn user about limitation
|
|
184
|
+
if (externalSignerUrls.length > 1) {
|
|
185
|
+
throw new YargsError(
|
|
186
|
+
"Cannot use --externalSigner.pubkeys with multiple --externalSigner.urls. " +
|
|
187
|
+
"When using --externalSigner.pubkeys, only a single URL is allowed. " +
|
|
188
|
+
"To use multiple signers, use --externalSigner.fetch instead to fetch pubkeys from each signer."
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
// If pubkeys are explicitly provided, assign them to the first (and only) URL
|
|
192
|
+
// This maintains backward compatibility
|
|
193
|
+
const pubkeys = args["externalSigner.pubkeys"];
|
|
194
|
+
assertValidPubkeysHex(pubkeys);
|
|
195
|
+
for (const pubkey of pubkeys) {
|
|
196
|
+
signers.push({type: SignerType.Remote, pubkey, url: externalSignerUrls[0]});
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
// Fetch pubkeys from all external signer URLs, fail startup if any signer is unavailable
|
|
200
|
+
const results: {url: string; pubkeys: string[]}[] = [];
|
|
201
|
+
const failures: {url: string; error: string}[] = [];
|
|
202
|
+
await Promise.all(
|
|
203
|
+
externalSignerUrls.map(async (url) => {
|
|
204
|
+
try {
|
|
205
|
+
const pubkeys = await externalSignerGetKeys(url);
|
|
206
|
+
results.push({url, pubkeys});
|
|
207
|
+
} catch (e) {
|
|
208
|
+
const errorMsg = e instanceof Error ? e.message : String(e);
|
|
209
|
+
failures.push({url, error: errorMsg});
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
);
|
|
213
|
+
if (failures.length > 0) {
|
|
214
|
+
const errorMessages = failures.map((f) => ` ${f.url}: ${f.error}`).join("\n");
|
|
215
|
+
throw new YargsError(
|
|
216
|
+
`Failed to fetch pubkeys from external signer(s):\n${errorMessages}\n` +
|
|
217
|
+
"Please verify the signer URLs are correct and reachable."
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
const seenPubkeys = new Map<string, string>();
|
|
222
|
+
for (const {url, pubkeys} of results) {
|
|
223
|
+
if (pubkeys.length > 0) {
|
|
224
|
+
assertValidPubkeysHex(pubkeys);
|
|
225
|
+
for (const pubkey of pubkeys) {
|
|
226
|
+
const firstUrl = seenPubkeys.get(pubkey);
|
|
227
|
+
if (firstUrl !== undefined) {
|
|
228
|
+
logger.warn("Duplicate pubkey found on multiple signers, using first occurrence only", {
|
|
229
|
+
pubkey,
|
|
230
|
+
firstUrl,
|
|
231
|
+
duplicateUrl: url,
|
|
232
|
+
});
|
|
233
|
+
continue;
|
|
234
|
+
}
|
|
235
|
+
seenPubkeys.set(pubkey, url);
|
|
236
|
+
signers.push({type: SignerType.Remote, pubkey, url});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
174
241
|
|
|
175
|
-
return
|
|
242
|
+
return signers;
|
|
176
243
|
}
|
|
@@ -69,7 +69,7 @@ export function warnOrExitNoSigners(args: IValidatorCliArgs, logger: Pick<Logger
|
|
|
69
69
|
"No local keystores or remote keys found with current args, expecting to be added via keymanager or fetched from external signer later"
|
|
70
70
|
);
|
|
71
71
|
} else {
|
|
72
|
-
if (args["externalSigner.
|
|
72
|
+
if (args["externalSigner.urls"]) {
|
|
73
73
|
throw new YargsError(
|
|
74
74
|
"No remote keys found with current args, start with --externalSigner.fetch to automatically fetch from external signer"
|
|
75
75
|
);
|
|
@@ -37,7 +37,7 @@ If no `pubkeys` are provided, it will exit all validators that have been importe
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
command:
|
|
40
|
-
"validator voluntary-exit --network hoodi --externalSigner.
|
|
40
|
+
"validator voluntary-exit --network hoodi --externalSigner.urls http://signer:9000 --externalSigner.fetch --pubkeys 0xF00",
|
|
41
41
|
description:
|
|
42
42
|
"Perform a voluntary exit for the validator who has a public key 0xF00 and its secret key is on an external signer",
|
|
43
43
|
},
|