@lodestar/prover 1.16.0-dev.1e67579442 → 1.16.0-dev.227930cdf6
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/README.md +5 -6
- package/lib/cli/cli.js +3 -1
- package/lib/cli/cli.js.map +1 -1
- package/lib/cli/cmds/index.d.ts +1 -0
- package/lib/cli/cmds/index.js +1 -0
- package/lib/cli/cmds/index.js.map +1 -1
- package/lib/cli/cmds/start/handler.js +2 -10
- package/lib/cli/cmds/start/handler.js.map +1 -1
- package/lib/cli/cmds/start/index.js +1 -1
- package/lib/cli/cmds/start/options.d.ts +2 -6
- package/lib/cli/cmds/start/options.js +3 -14
- package/lib/cli/cmds/start/options.js.map +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
> This package is part of [ChainSafe's Lodestar](https://lodestar.chainsafe.io) project
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
A set of tools allowing to verify EL client JSON-RPC calls.
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
@@ -37,13 +37,12 @@ console.log({balance, address});
|
|
|
37
37
|
You can also invoke the package as binary.
|
|
38
38
|
|
|
39
39
|
```bash
|
|
40
|
-
npm
|
|
40
|
+
npm i -g @lodestar/prover
|
|
41
41
|
|
|
42
|
-
lodestar-prover
|
|
42
|
+
lodestar-prover proxy \
|
|
43
43
|
--network sepolia \
|
|
44
|
-
--
|
|
45
|
-
--
|
|
46
|
-
--beacon-rpc https://lodestar-sepolia.chainsafe.io \
|
|
44
|
+
--executionRpcUrl https://lodestar-sepoliarpc.chainsafe.io \
|
|
45
|
+
--beaconUrls https://lodestar-sepolia.chainsafe.io \
|
|
47
46
|
--port 8080
|
|
48
47
|
```
|
|
49
48
|
|
package/lib/cli/cli.js
CHANGED
|
@@ -3,7 +3,7 @@ import yargs from "yargs";
|
|
|
3
3
|
import { hideBin } from "yargs/helpers";
|
|
4
4
|
import { registerCommandToYargs } from "../utils/command.js";
|
|
5
5
|
import { getVersionData } from "../utils/version.js";
|
|
6
|
-
import { cmds } from "./cmds/index.js";
|
|
6
|
+
import { cmds, proverProxyStartCommand } from "./cmds/index.js";
|
|
7
7
|
import { globalOptions } from "./options.js";
|
|
8
8
|
const { version } = getVersionData();
|
|
9
9
|
const topBanner = `🌟 Lodestar Prover Proxy: Ethereum RPC proxy for RPC responses, verified against the trusted block hashes.
|
|
@@ -43,6 +43,8 @@ export function getLodestarProverCli() {
|
|
|
43
43
|
for (const cmd of cmds) {
|
|
44
44
|
registerCommandToYargs(prover, cmd);
|
|
45
45
|
}
|
|
46
|
+
// Register the proxy command as the default one
|
|
47
|
+
registerCommandToYargs(prover, { ...proverProxyStartCommand, command: "*" });
|
|
46
48
|
// throw an error if we see an unrecognized cmd
|
|
47
49
|
prover.recommendCommands().strict();
|
|
48
50
|
return prover;
|
package/lib/cli/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAC,IAAI,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../src/cli/cli.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,OAAO,EAAC,MAAM,eAAe,CAAC;AACtC,OAAO,EAAC,sBAAsB,EAAC,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAC,cAAc,EAAC,MAAM,qBAAqB,CAAC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AAC;IAEpC,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/lib/cli/cmds/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CliCommand } from "../../utils/command.js";
|
|
2
2
|
import { GlobalArgs } from "../options.js";
|
|
3
|
+
export { proverProxyStartCommand } from "./start/index.js";
|
|
3
4
|
export declare const cmds: Required<CliCommand<GlobalArgs, Record<never, never>>>["subcommands"];
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/cli/cmds/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/cmds/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,uBAAuB,EAAC,MAAM,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,IAAI,GAA0E,CAAC,uBAAuB,CAAC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cli/cmds/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,uBAAuB,EAAC,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAC,uBAAuB,EAAC,MAAM,kBAAkB,CAAC;AAEzD,MAAM,CAAC,MAAM,IAAI,GAA0E,CAAC,uBAAuB,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { chainConfigFromJson } from "@lodestar/config";
|
|
2
|
-
import { LCTransport } from "../../../interfaces.js";
|
|
3
2
|
import { readFile } from "../../../utils/file.js";
|
|
4
3
|
import { createVerifiedExecutionProxy } from "../../../web3_proxy.js";
|
|
5
4
|
import { parseGlobalArgs } from "../../options.js";
|
|
@@ -10,21 +9,14 @@ import { parseStartArgs } from "./options.js";
|
|
|
10
9
|
export async function proverProxyStartHandler(args) {
|
|
11
10
|
const { network, logLevel, paramsFile } = parseGlobalArgs(args);
|
|
12
11
|
const opts = parseStartArgs(args);
|
|
13
|
-
const { executionRpcUrl, port, wsCheckpoint } = opts;
|
|
14
12
|
const config = paramsFile ? chainConfigFromJson(readFile(paramsFile)) : {};
|
|
15
13
|
const options = {
|
|
14
|
+
...opts,
|
|
16
15
|
logLevel,
|
|
17
|
-
executionRpcUrl,
|
|
18
|
-
wsCheckpoint,
|
|
19
|
-
unverifiedWhitelist: opts.unverifiedWhitelist,
|
|
20
|
-
requestTimeout: opts.requestTimeout,
|
|
21
16
|
...(network ? { network } : { config }),
|
|
22
|
-
...(opts.transport === LCTransport.Rest
|
|
23
|
-
? { transport: LCTransport.Rest, urls: opts.urls }
|
|
24
|
-
: { transport: LCTransport.P2P, bootnodes: opts.bootnodes }),
|
|
25
17
|
};
|
|
26
18
|
const { server, proofProvider } = createVerifiedExecutionProxy(options);
|
|
27
|
-
server.listen(port);
|
|
19
|
+
server.listen(opts.port);
|
|
28
20
|
await proofProvider.waitToBeReady();
|
|
29
21
|
}
|
|
30
22
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/cli/cmds/start/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../../src/cli/cmds/start/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,mBAAmB,EAAC,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAC,4BAA4B,EAAuB,MAAM,wBAAwB,CAAC;AAC1F,OAAO,EAAa,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAC,cAAc,EAAY,MAAM,cAAc,CAAC;AAEvD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,IAA4B;IACxE,MAAM,EAAC,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAC,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9D,MAAM,IAAI,GAAG,cAAc,CAAC,IAAI,CAAC,CAAC;IAElC,MAAM,MAAM,GAAyB,UAAU,CAAC,CAAC,CAAC,mBAAmB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAEjG,MAAM,OAAO,GAAyB;QACpC,GAAG,IAAI;QACP,QAAQ;QACR,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC,CAAC,EAAC,MAAM,EAAC,CAAC;KACpC,CAAC;IAEF,MAAM,EAAC,MAAM,EAAE,aAAa,EAAC,GAAG,4BAA4B,CAAC,OAAO,CAAC,CAAC;IAEtE,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEzB,MAAM,aAAa,CAAC,aAAa,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -4,7 +4,6 @@ export type StartArgs = {
|
|
|
4
4
|
port: number;
|
|
5
5
|
executionRpcUrl: string;
|
|
6
6
|
beaconUrls?: string[];
|
|
7
|
-
beaconBootnodes?: string[];
|
|
8
7
|
wsCheckpoint?: string;
|
|
9
8
|
unverifiedWhitelist?: string[];
|
|
10
9
|
requestTimeout: number;
|
|
@@ -15,13 +14,10 @@ export type StartOptions = {
|
|
|
15
14
|
wsCheckpoint?: string;
|
|
16
15
|
unverifiedWhitelist?: string[];
|
|
17
16
|
requestTimeout: number;
|
|
18
|
-
} &
|
|
17
|
+
} & {
|
|
19
18
|
transport: LCTransport.Rest;
|
|
20
19
|
urls: string[];
|
|
21
|
-
}
|
|
22
|
-
transport: LCTransport.P2P;
|
|
23
|
-
bootnodes: string[];
|
|
24
|
-
});
|
|
20
|
+
};
|
|
25
21
|
export declare const startOptions: CliCommandOptions<StartArgs>;
|
|
26
22
|
export declare function parseStartArgs(args: StartArgs): StartOptions;
|
|
27
23
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -27,17 +27,10 @@ export const startOptions = {
|
|
|
27
27
|
group: "execution",
|
|
28
28
|
},
|
|
29
29
|
beaconUrls: {
|
|
30
|
-
description: "
|
|
31
|
-
type: "string",
|
|
32
|
-
array: true,
|
|
33
|
-
conflicts: ["beaconBootnodes"],
|
|
34
|
-
group: "beacon",
|
|
35
|
-
},
|
|
36
|
-
beaconBootnodes: {
|
|
37
|
-
description: "The beacon node PRC urls for 'p2p' mode.",
|
|
30
|
+
description: "Urls of the beacon nodes to connect to.",
|
|
38
31
|
type: "string",
|
|
32
|
+
demandOption: true,
|
|
39
33
|
array: true,
|
|
40
|
-
conflicts: ["beaconUrls"],
|
|
41
34
|
group: "beacon",
|
|
42
35
|
},
|
|
43
36
|
wsCheckpoint: {
|
|
@@ -48,16 +41,12 @@ export const startOptions = {
|
|
|
48
41
|
},
|
|
49
42
|
};
|
|
50
43
|
export function parseStartArgs(args) {
|
|
51
|
-
if (!args.beaconUrls && !args.beaconBootnodes) {
|
|
52
|
-
throw new Error("Either --beaconUrls or --beaconBootnodes must be provided");
|
|
53
|
-
}
|
|
54
44
|
// Remove undefined values to allow deepmerge to inject default values downstream
|
|
55
45
|
return {
|
|
56
46
|
port: args.port,
|
|
57
47
|
executionRpcUrl: args.executionRpcUrl,
|
|
58
|
-
transport:
|
|
48
|
+
transport: LCTransport.Rest,
|
|
59
49
|
urls: args.beaconUrls ?? [],
|
|
60
|
-
bootnodes: args.beaconBootnodes ?? [],
|
|
61
50
|
wsCheckpoint: args.wsCheckpoint,
|
|
62
51
|
unverifiedWhitelist: args.unverifiedWhitelist,
|
|
63
52
|
requestTimeout: args.requestTimeout ?? DEFAULT_PROXY_REQUEST_TIMEOUT,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../../src/cli/cmds/start/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,6BAA6B,EAAC,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAC,WAAW,E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F,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,eAAe,EAAE,IAAI,CAAC,eAAe;QACrC,SAAS,EAAE,WAAW,CAAC,IAAI;QAC3B,IAAI,EAAE,IAAI,CAAC,UAAU,IAAI,EAAE;QAC3B,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,mBAAmB,EAAE,IAAI,CAAC,mBAAmB;QAC7C,cAAc,EAAE,IAAI,CAAC,cAAc,IAAI,6BAA6B;KACrE,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.16.0-dev.
|
|
14
|
+
"version": "1.16.0-dev.227930cdf6",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
"@ethereumjs/tx": "^4.1.2",
|
|
71
71
|
"@ethereumjs/util": "^8.0.6",
|
|
72
72
|
"@ethereumjs/vm": "^6.4.2",
|
|
73
|
-
"@lodestar/api": "1.16.0-dev.
|
|
74
|
-
"@lodestar/config": "1.16.0-dev.
|
|
75
|
-
"@lodestar/light-client": "1.16.0-dev.
|
|
76
|
-
"@lodestar/logger": "1.16.0-dev.
|
|
77
|
-
"@lodestar/params": "1.16.0-dev.
|
|
78
|
-
"@lodestar/types": "1.16.0-dev.
|
|
79
|
-
"@lodestar/utils": "1.16.0-dev.
|
|
73
|
+
"@lodestar/api": "1.16.0-dev.227930cdf6",
|
|
74
|
+
"@lodestar/config": "1.16.0-dev.227930cdf6",
|
|
75
|
+
"@lodestar/light-client": "1.16.0-dev.227930cdf6",
|
|
76
|
+
"@lodestar/logger": "1.16.0-dev.227930cdf6",
|
|
77
|
+
"@lodestar/params": "1.16.0-dev.227930cdf6",
|
|
78
|
+
"@lodestar/types": "1.16.0-dev.227930cdf6",
|
|
79
|
+
"@lodestar/utils": "1.16.0-dev.227930cdf6",
|
|
80
80
|
"ethereum-cryptography": "^2.0.0",
|
|
81
81
|
"find-up": "^6.3.0",
|
|
82
82
|
"http-proxy": "^1.18.1",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"yargs": "^17.7.1"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@lodestar/test-utils": "1.16.0-dev.
|
|
88
|
+
"@lodestar/test-utils": "1.16.0-dev.227930cdf6",
|
|
89
89
|
"@types/http-proxy": "^1.17.10",
|
|
90
90
|
"@types/yargs": "^17.0.24",
|
|
91
91
|
"axios": "^1.3.4",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"blockchain",
|
|
101
101
|
"prover"
|
|
102
102
|
],
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "0647d71c4b4a7634d7e7f4809468ccf5c656b9ca"
|
|
104
104
|
}
|