@chainsafe/lodestar 1.47.0-dev.a27526c22a → 1.47.0-dev.bd3a76e069
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/builder/handler.d.ts.map +1 -1
- package/lib/cmds/builder/handler.js +31 -4
- package/lib/cmds/builder/handler.js.map +1 -1
- package/lib/cmds/builder/loadKeypair.d.ts +2 -1
- package/lib/cmds/builder/loadKeypair.d.ts.map +1 -1
- package/lib/cmds/builder/loadKeypair.js +2 -1
- package/lib/cmds/builder/loadKeypair.js.map +1 -1
- package/lib/cmds/builder/options.d.ts +10 -0
- package/lib/cmds/builder/options.d.ts.map +1 -1
- package/lib/cmds/builder/options.js +34 -0
- package/lib/cmds/builder/options.js.map +1 -1
- package/lib/options/beaconNodeOptions/builder.js +2 -2
- package/lib/options/beaconNodeOptions/builder.js.map +1 -1
- package/package.json +14 -14
- package/src/cmds/builder/handler.ts +44 -5
- package/src/cmds/builder/loadKeypair.ts +4 -0
- package/src/cmds/builder/options.ts +47 -0
- package/src/options/beaconNodeOptions/builder.ts +2 -2
package/.git-data.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/cmds/builder/handler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/cmds/builder/handler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAKlD,OAAO,EAAC,eAAe,EAA+B,MAAM,cAAc,CAAC;AAI3E,wBAAsB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAoEtF"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import { getClient } from "@lodestar/api";
|
|
3
|
-
import {
|
|
3
|
+
import { RegistryMetricCreator, collectNodeJSMetrics, getHttpMetricsServer } from "@lodestar/beacon-node";
|
|
4
|
+
import { Builder, getMetrics } from "@lodestar/builder";
|
|
4
5
|
import { getNodeLogger } from "@lodestar/logger/node";
|
|
6
|
+
import { fromHex, toPrintableUrl } from "@lodestar/utils";
|
|
5
7
|
import { getBeaconConfigFromArgs } from "../../config/beaconParams.js";
|
|
6
8
|
import { getGlobalPaths } from "../../paths/global.js";
|
|
7
|
-
import { cleanOldLogFiles, onGracefulShutdown, parseLoggerArgs } from "../../util/index.js";
|
|
9
|
+
import { cleanOldLogFiles, onGracefulShutdown, parseFeeRecipient, parseLoggerArgs } from "../../util/index.js";
|
|
10
|
+
import { getVersionData } from "../../util/version.js";
|
|
8
11
|
import { loadBuilderKeypair } from "./loadKeypair.js";
|
|
12
|
+
import { builderMetricsDefaultOptions } from "./options.js";
|
|
13
|
+
const ZERO_ADDRESS = "0x" + "0".repeat(40);
|
|
9
14
|
export async function builderHandler(args) {
|
|
10
15
|
const { config, network } = getBeaconConfigFromArgs(args);
|
|
16
|
+
if (config.GLOAS_FORK_EPOCH === Infinity) {
|
|
17
|
+
throw Error(`Gloas must be scheduled via GLOAS_FORK_EPOCH for network=${network}`);
|
|
18
|
+
}
|
|
11
19
|
const globalPaths = getGlobalPaths(args, network);
|
|
12
20
|
const defaultLogFilepath = path.join(globalPaths.dataDir, "builder.log");
|
|
13
21
|
const logger = getNodeLogger(parseLoggerArgs(args, { defaultLogFilepath }, config));
|
|
@@ -17,7 +25,13 @@ export async function builderHandler(args) {
|
|
|
17
25
|
catch (e) {
|
|
18
26
|
logger.debug("Not able to delete log files", {}, e);
|
|
19
27
|
}
|
|
20
|
-
const
|
|
28
|
+
const { version, commit } = getVersionData();
|
|
29
|
+
logger.info("Lodestar", { network, version, commit });
|
|
30
|
+
const executionFeeRecipient = parseFeeRecipient(args.executionFeeRecipient);
|
|
31
|
+
if (executionFeeRecipient === ZERO_ADDRESS) {
|
|
32
|
+
throw Error("Cannot put zero address as an executionFeeRecipient");
|
|
33
|
+
}
|
|
34
|
+
const keypair = await loadBuilderKeypair(logger, args.keystore, args.keystorePassword, args.builderPubkey);
|
|
21
35
|
const onGracefulShutdownCbs = [];
|
|
22
36
|
onGracefulShutdown(async () => {
|
|
23
37
|
for (const cb of onGracefulShutdownCbs)
|
|
@@ -25,13 +39,26 @@ export async function builderHandler(args) {
|
|
|
25
39
|
}, logger.info.bind(logger));
|
|
26
40
|
const abortController = new AbortController();
|
|
27
41
|
onGracefulShutdownCbs.push(async () => abortController.abort());
|
|
28
|
-
const
|
|
42
|
+
const register = args.metrics ? new RegistryMetricCreator() : null;
|
|
43
|
+
const metrics = register && getMetrics(register, { version, commit, network });
|
|
44
|
+
if (metrics) {
|
|
45
|
+
const closeMetrics = collectNodeJSMetrics(register);
|
|
46
|
+
onGracefulShutdownCbs.push(() => closeMetrics());
|
|
47
|
+
const port = args["metrics.port"] ?? builderMetricsDefaultOptions.port;
|
|
48
|
+
const address = args["metrics.address"] ?? builderMetricsDefaultOptions.address;
|
|
49
|
+
const metricsServer = await getHttpMetricsServer({ port, address }, { register, logger });
|
|
50
|
+
onGracefulShutdownCbs.push(() => metricsServer.close());
|
|
51
|
+
}
|
|
52
|
+
const api = getClient({ urls: [args.beaconNodeUrl], globalInit: { signal: abortController.signal, timeoutMs: args.requestTimeout } }, { config, logger, metrics: metrics?.restApiClient });
|
|
53
|
+
logger.info("Beacon node", { beaconNode: toPrintableUrl(args.beaconNodeUrl), timeoutMs: args.requestTimeout });
|
|
29
54
|
const builder = await Builder.init({
|
|
30
55
|
keypair,
|
|
31
56
|
logger,
|
|
32
57
|
config,
|
|
33
58
|
abortController,
|
|
34
59
|
api,
|
|
60
|
+
executionFeeRecipient: fromHex(executionFeeRecipient),
|
|
61
|
+
metrics,
|
|
35
62
|
});
|
|
36
63
|
onGracefulShutdownCbs.push(() => builder.close());
|
|
37
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/cmds/builder/handler.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../../src/cmds/builder/handler.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAC,SAAS,EAAC,MAAM,eAAe,CAAC;AACxC,OAAO,EAAC,qBAAqB,EAAE,oBAAoB,EAAE,oBAAoB,EAAC,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAC,OAAO,EAAE,UAAU,EAAC,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,eAAe,EAAC,MAAM,qBAAqB,CAAC;AAC7G,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAkB,4BAA4B,EAAC,MAAM,cAAc,CAAC;AAE3E,MAAM,YAAY,GAAG,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE3C,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,IAAkC;IACrE,MAAM,EAAC,MAAM,EAAE,OAAO,EAAC,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;IAExD,IAAI,MAAM,CAAC,gBAAgB,KAAK,QAAQ,EAAE,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AAM,CAAC,IAAI,CAAC,aAAa,EAAE,EAAC,UAAU,EAAE,cAAc,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,SAAS,EAAE,IAAI,CAAC,cAAc,EAAC,CAAC,CAAC;IAE7G,MAAM,OAAO,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC;QACjC,OAAO;QACP,MAAM;QACN,MAAM;QACN,eAAe;QACf,GAAG;QACH,qBAAqB,EAAE,OAAO,CAAC,qBAAqB,CAAC;QACrD,OAAO;KACR,CAAC,CAAC;IAEH,qBAAqB,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Keypair } from "@lodestar/builder";
|
|
2
|
-
|
|
2
|
+
import { Logger } from "@lodestar/utils";
|
|
3
|
+
export declare function loadBuilderKeypair(logger: Logger, keystorePath: string, passwordPath: string, expectedPubkey?: string): Promise<Keypair>;
|
|
3
4
|
//# sourceMappingURL=loadKeypair.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadKeypair.d.ts","sourceRoot":"","sources":["../../../src/cmds/builder/loadKeypair.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"loadKeypair.d.ts","sourceRoot":"","sources":["../../../src/cmds/builder/loadKeypair.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AAIvC,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,YAAY,EAAE,MAAM,EACpB,cAAc,CAAC,EAAE,MAAM,GACtB,OAAO,CAAC,OAAO,CAAC,CAsBlB"}
|
|
@@ -3,7 +3,7 @@ import { Keystore } from "@chainsafe/bls-keystore";
|
|
|
3
3
|
import { SecretKey } from "@chainsafe/blst";
|
|
4
4
|
import { ensure0xPrefix } from "../../util/format.js";
|
|
5
5
|
import { readPassphraseFile } from "../../util/passphrase.js";
|
|
6
|
-
export async function loadBuilderKeypair(keystorePath, passwordPath, expectedPubkey) {
|
|
6
|
+
export async function loadBuilderKeypair(logger, keystorePath, passwordPath, expectedPubkey) {
|
|
7
7
|
const password = readPassphraseFile(passwordPath);
|
|
8
8
|
const keystoreStr = fs.readFileSync(keystorePath, "utf8");
|
|
9
9
|
const keystore = Keystore.parse(keystoreStr);
|
|
@@ -17,6 +17,7 @@ export async function loadBuilderKeypair(keystorePath, passwordPath, expectedPub
|
|
|
17
17
|
if (expectedPubkey && publicKeyHex !== ensure0xPrefix(expectedPubkey.toLowerCase())) {
|
|
18
18
|
throw Error(`Pubkey mismatch: keystore ${publicKeyHex}, expected ${expectedPubkey}`);
|
|
19
19
|
}
|
|
20
|
+
logger.info("Loaded builder keystore", { pubkey: publicKeyHex });
|
|
20
21
|
return { secretKey, publicKey };
|
|
21
22
|
}
|
|
22
23
|
//# sourceMappingURL=loadKeypair.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadKeypair.js","sourceRoot":"","sources":["../../../src/cmds/builder/loadKeypair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"loadKeypair.js","sourceRoot":"","sources":["../../../src/cmds/builder/loadKeypair.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAC,QAAQ,EAAC,MAAM,yBAAyB,CAAC;AACjD,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAG1C,OAAO,EAAC,cAAc,EAAC,MAAM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ions: {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
port: number;
|
|
6
|
+
address: string;
|
|
7
|
+
};
|
|
3
8
|
export type IBuilderCliArgs = LogArgs & {
|
|
4
9
|
beaconNodeUrl: string;
|
|
5
10
|
keystore: string;
|
|
6
11
|
keystorePassword: string;
|
|
7
12
|
builderPubkey?: string;
|
|
13
|
+
executionFeeRecipient: string;
|
|
14
|
+
requestTimeout: number;
|
|
15
|
+
metrics?: boolean;
|
|
16
|
+
"metrics.port"?: number;
|
|
17
|
+
"metrics.address"?: string;
|
|
8
18
|
};
|
|
9
19
|
export declare const builderOptions: CliCommandOptions<IBuilderCliArgs>;
|
|
10
20
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/cmds/builder/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,EAAa,MAAM,6BAA6B,CAAC;AAEhE,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/cmds/builder/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAC,OAAO,EAAa,MAAM,6BAA6B,CAAC;AAEhE,eAAO,MAAM,4BAA4B;IACvC,OAAO;IACP,IAAI;IACJ,OAAO;CACR,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG;IACtC,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;IAEvB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,eAAe,CA4D7D,CAAC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { defaultOptions } from "@lodestar/builder";
|
|
2
2
|
import { logOptions } from "../../options/logOptions.js";
|
|
3
|
+
export const builderMetricsDefaultOptions = {
|
|
4
|
+
enabled: false,
|
|
5
|
+
port: 5065,
|
|
6
|
+
address: "127.0.0.1",
|
|
7
|
+
};
|
|
3
8
|
export const builderOptions = {
|
|
4
9
|
...logOptions,
|
|
5
10
|
beaconNodeUrl: {
|
|
@@ -21,5 +26,34 @@ export const builderOptions = {
|
|
|
21
26
|
description: "Builder's expected public key based on the keystore from 'keystore' option",
|
|
22
27
|
type: "string",
|
|
23
28
|
},
|
|
29
|
+
executionFeeRecipient: {
|
|
30
|
+
description: "Execution address for receiving the payload rewards",
|
|
31
|
+
type: "string",
|
|
32
|
+
demandOption: true,
|
|
33
|
+
},
|
|
34
|
+
requestTimeout: {
|
|
35
|
+
description: "Timeout in milliseconds for HTTP requests to the beacon node",
|
|
36
|
+
type: "number",
|
|
37
|
+
default: defaultOptions.requestTimeout,
|
|
38
|
+
},
|
|
39
|
+
// Metrics
|
|
40
|
+
metrics: {
|
|
41
|
+
description: "Enable the Prometheus metrics HTTP server",
|
|
42
|
+
type: "boolean",
|
|
43
|
+
defaultDescription: String(builderMetricsDefaultOptions.enabled),
|
|
44
|
+
group: "metrics",
|
|
45
|
+
},
|
|
46
|
+
"metrics.port": {
|
|
47
|
+
description: "Listen TCP port for the Prometheus metrics HTTP server",
|
|
48
|
+
type: "number",
|
|
49
|
+
defaultDescription: String(builderMetricsDefaultOptions.port),
|
|
50
|
+
group: "metrics",
|
|
51
|
+
},
|
|
52
|
+
"metrics.address": {
|
|
53
|
+
description: "Listen address for the Prometheus metrics HTTP server",
|
|
54
|
+
type: "string",
|
|
55
|
+
defaultDescription: String(builderMetricsDefaultOptions.address),
|
|
56
|
+
group: "metrics",
|
|
57
|
+
},
|
|
24
58
|
};
|
|
25
59
|
//# sourceMappingURL=options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/cmds/builder/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAU,UAAU,EAAC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/cmds/builder/options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEjD,OAAO,EAAU,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAEhE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,IAAI;IACV,OAAO,EAAE,WAAW;CACrB,CAAC;AAeF,MAAM,CAAC,MAAM,cAAc,GAAuC;IAChE,GAAG,UAAU;IAEb,aAAa,EAAE;QACb,WAAW,EAAE,8BAA8B;QAC3C,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,cAAc,CAAC,aAAa;KACtC;IAED,QAAQ,EAAE;QACR,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB;IAED,gBAAgB,EAAE;QAChB,WAAW,EAAE,6EAA6E;QAC1F,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB;IAED,aAAa,EAAE;QACb,WAAW,EAAE,4EAA4E;QACzF,IAAI,EAAE,QAAQ;KACf;IAED,qBAAqB,EAAE;QACrB,WAAW,EAAE,qDAAqD;QAClE,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;KACnB;IAED,cAAc,EAAE;QACd,WAAW,EAAE,8DAA8D;QAC3E,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,cAAc,CAAC,cAAc;KACvC;IAED,UAAU;IAEV,OAAO,EAAE;QACP,WAAW,EAAE,2CAA2C;QACxD,IAAI,EAAE,SAAS;QACf,kBAAkB,EAAE,MAAM,CAAC,4BAA4B,CAAC,OAAO,CAAC;QAChE,KAAK,EAAE,SAAS;KACjB;IAED,cAAc,EAAE;QACd,WAAW,EAAE,wDAAwD;QACrE,IAAI,EAAE,QAAQ;QACd,kBAAkB,EAAE,MAAM,CAAC,4BAA4B,CAAC,IAAI,CAAC;QAC7D,KAAK,EAAE,SAAS;KACjB;IAED,iBAAiB,EAAE;QACjB,WAAW,EAAE,uDAAuD;QACpE,IAAI,EAAE,QAAQ;QACd,kBAAkB,EAAE,MAAM,CAAC,4BAA4B,CAAC,OAAO,CAAC;QAChE,KAAK,EAAE,SAAS;KACjB;CACF,CAAC"}
|
|
@@ -34,12 +34,12 @@ export const options = {
|
|
|
34
34
|
},
|
|
35
35
|
"builder.faultInspectionWindow": {
|
|
36
36
|
type: "number",
|
|
37
|
-
description: "Window to inspect missed slots (pre-gloas) or
|
|
37
|
+
description: "Window used to inspect missed slots (pre-gloas) or calculate the canonical EMPTY block rate (post-gloas) for enabling/disabling the builder circuit breaker",
|
|
38
38
|
group: "builder",
|
|
39
39
|
},
|
|
40
40
|
"builder.allowedFaults": {
|
|
41
41
|
type: "number",
|
|
42
|
-
description: "Number of missed slots
|
|
42
|
+
description: "Number of missed slots allowed within `faultInspectionWindow` before ignoring the external builder (pre-gloas). Post-gloas, sets the tolerated rate of canonical EMPTY blocks, defined as `allowedFaults` out of `faultInspectionWindow` and applied to canonical blocks in the window",
|
|
43
43
|
group: "builder",
|
|
44
44
|
},
|
|
45
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1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E,KAAK,EAAE,SAAS;KACjB;IAED,+BAA+B,EAAE;QAC/B,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,6JAA6J;QAC/J,KAAK,EAAE,SAAS;KACjB;IAED,uBAAuB,EAAE;QACvB,IAAI,EAAE,QAAQ;QACd,WAAW,EACT,wRAAwR;QAC1R,KAAK,EAAE,SAAS;KACjB;CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chainsafe/lodestar",
|
|
3
|
-
"version": "1.47.0-dev.
|
|
3
|
+
"version": "1.47.0-dev.bd3a76e069",
|
|
4
4
|
"description": "Command line interface for lodestar",
|
|
5
5
|
"author": "ChainSafe Systems",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -68,17 +68,17 @@
|
|
|
68
68
|
"@libp2p/crypto": "^5.1.13",
|
|
69
69
|
"@libp2p/interface": "^3.1.0",
|
|
70
70
|
"@libp2p/peer-id": "^6.0.4",
|
|
71
|
-
"@lodestar/api": "^1.47.0-dev.
|
|
72
|
-
"@lodestar/beacon-node": "^1.47.0-dev.
|
|
73
|
-
"@lodestar/builder": "^1.47.0-dev.
|
|
74
|
-
"@lodestar/config": "^1.47.0-dev.
|
|
75
|
-
"@lodestar/db": "^1.47.0-dev.
|
|
76
|
-
"@lodestar/logger": "^1.47.0-dev.
|
|
77
|
-
"@lodestar/params": "^1.47.0-dev.
|
|
78
|
-
"@lodestar/state-transition": "^1.47.0-dev.
|
|
79
|
-
"@lodestar/types": "^1.47.0-dev.
|
|
80
|
-
"@lodestar/utils": "^1.47.0-dev.
|
|
81
|
-
"@lodestar/validator": "^1.47.0-dev.
|
|
71
|
+
"@lodestar/api": "^1.47.0-dev.bd3a76e069",
|
|
72
|
+
"@lodestar/beacon-node": "^1.47.0-dev.bd3a76e069",
|
|
73
|
+
"@lodestar/builder": "^1.47.0-dev.bd3a76e069",
|
|
74
|
+
"@lodestar/config": "^1.47.0-dev.bd3a76e069",
|
|
75
|
+
"@lodestar/db": "^1.47.0-dev.bd3a76e069",
|
|
76
|
+
"@lodestar/logger": "^1.47.0-dev.bd3a76e069",
|
|
77
|
+
"@lodestar/params": "^1.47.0-dev.bd3a76e069",
|
|
78
|
+
"@lodestar/state-transition": "^1.47.0-dev.bd3a76e069",
|
|
79
|
+
"@lodestar/types": "^1.47.0-dev.bd3a76e069",
|
|
80
|
+
"@lodestar/utils": "^1.47.0-dev.bd3a76e069",
|
|
81
|
+
"@lodestar/validator": "^1.47.0-dev.bd3a76e069",
|
|
82
82
|
"@multiformats/multiaddr": "^13.0.1",
|
|
83
83
|
"deepmerge": "^4.3.1",
|
|
84
84
|
"ethers": "^6.7.0",
|
|
@@ -94,7 +94,7 @@
|
|
|
94
94
|
"devDependencies": {
|
|
95
95
|
"@chainsafe/as-sha256": "^1.2.4",
|
|
96
96
|
"@ethereumjs/rlp": "^4.0.1",
|
|
97
|
-
"@lodestar/test-utils": "^1.47.0-dev.
|
|
97
|
+
"@lodestar/test-utils": "^1.47.0-dev.bd3a76e069",
|
|
98
98
|
"@types/debug": "^4.1.7",
|
|
99
99
|
"@types/inquirer": "^9.0.3",
|
|
100
100
|
"@types/js-yaml": "^4.0.5",
|
|
@@ -108,5 +108,5 @@
|
|
|
108
108
|
"web3": "^4.0.3",
|
|
109
109
|
"web3-eth-accounts": "^4.0.3"
|
|
110
110
|
},
|
|
111
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "99312f78bbcb5df572ba8d6c0fcba5ef05c914cc"
|
|
112
112
|
}
|
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import {getClient} from "@lodestar/api";
|
|
3
|
-
import {
|
|
3
|
+
import {RegistryMetricCreator, collectNodeJSMetrics, getHttpMetricsServer} from "@lodestar/beacon-node";
|
|
4
|
+
import {Builder, getMetrics} from "@lodestar/builder";
|
|
4
5
|
import {getNodeLogger} from "@lodestar/logger/node";
|
|
6
|
+
import {fromHex, toPrintableUrl} from "@lodestar/utils";
|
|
5
7
|
import {getBeaconConfigFromArgs} from "../../config/beaconParams.js";
|
|
6
8
|
import {GlobalArgs} from "../../options/index.js";
|
|
7
9
|
import {getGlobalPaths} from "../../paths/global.js";
|
|
8
|
-
import {cleanOldLogFiles, onGracefulShutdown, parseLoggerArgs} from "../../util/index.js";
|
|
10
|
+
import {cleanOldLogFiles, onGracefulShutdown, parseFeeRecipient, parseLoggerArgs} from "../../util/index.js";
|
|
11
|
+
import {getVersionData} from "../../util/version.js";
|
|
9
12
|
import {loadBuilderKeypair} from "./loadKeypair.js";
|
|
10
|
-
import {IBuilderCliArgs} from "./options.js";
|
|
13
|
+
import {IBuilderCliArgs, builderMetricsDefaultOptions} from "./options.js";
|
|
14
|
+
|
|
15
|
+
const ZERO_ADDRESS = "0x" + "0".repeat(40);
|
|
11
16
|
|
|
12
17
|
export async function builderHandler(args: IBuilderCliArgs & GlobalArgs): Promise<void> {
|
|
13
18
|
const {config, network} = getBeaconConfigFromArgs(args);
|
|
14
19
|
|
|
20
|
+
if (config.GLOAS_FORK_EPOCH === Infinity) {
|
|
21
|
+
throw Error(`Gloas must be scheduled via GLOAS_FORK_EPOCH for network=${network}`);
|
|
22
|
+
}
|
|
23
|
+
|
|
15
24
|
const globalPaths = getGlobalPaths(args, network);
|
|
16
25
|
const defaultLogFilepath = path.join(globalPaths.dataDir, "builder.log");
|
|
17
26
|
const logger = getNodeLogger(parseLoggerArgs(args, {defaultLogFilepath}, config));
|
|
@@ -22,7 +31,16 @@ export async function builderHandler(args: IBuilderCliArgs & GlobalArgs): Promis
|
|
|
22
31
|
logger.debug("Not able to delete log files", {}, e as Error);
|
|
23
32
|
}
|
|
24
33
|
|
|
25
|
-
const
|
|
34
|
+
const {version, commit} = getVersionData();
|
|
35
|
+
logger.info("Lodestar", {network, version, commit});
|
|
36
|
+
|
|
37
|
+
const executionFeeRecipient = parseFeeRecipient(args.executionFeeRecipient);
|
|
38
|
+
|
|
39
|
+
if (executionFeeRecipient === ZERO_ADDRESS) {
|
|
40
|
+
throw Error("Cannot put zero address as an executionFeeRecipient");
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const keypair = await loadBuilderKeypair(logger, args.keystore, args.keystorePassword, args.builderPubkey);
|
|
26
44
|
|
|
27
45
|
const onGracefulShutdownCbs: (() => Promise<void> | void)[] = [];
|
|
28
46
|
onGracefulShutdown(async () => {
|
|
@@ -32,7 +50,26 @@ export async function builderHandler(args: IBuilderCliArgs & GlobalArgs): Promis
|
|
|
32
50
|
const abortController = new AbortController();
|
|
33
51
|
onGracefulShutdownCbs.push(async () => abortController.abort());
|
|
34
52
|
|
|
35
|
-
const
|
|
53
|
+
const register = args.metrics ? new RegistryMetricCreator() : null;
|
|
54
|
+
const metrics = register && getMetrics(register, {version, commit, network});
|
|
55
|
+
|
|
56
|
+
if (metrics) {
|
|
57
|
+
const closeMetrics = collectNodeJSMetrics(register);
|
|
58
|
+
onGracefulShutdownCbs.push(() => closeMetrics());
|
|
59
|
+
|
|
60
|
+
const port = args["metrics.port"] ?? builderMetricsDefaultOptions.port;
|
|
61
|
+
const address = args["metrics.address"] ?? builderMetricsDefaultOptions.address;
|
|
62
|
+
const metricsServer = await getHttpMetricsServer({port, address}, {register, logger});
|
|
63
|
+
|
|
64
|
+
onGracefulShutdownCbs.push(() => metricsServer.close());
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const api = getClient(
|
|
68
|
+
{urls: [args.beaconNodeUrl], globalInit: {signal: abortController.signal, timeoutMs: args.requestTimeout}},
|
|
69
|
+
{config, logger, metrics: metrics?.restApiClient}
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
logger.info("Beacon node", {beaconNode: toPrintableUrl(args.beaconNodeUrl), timeoutMs: args.requestTimeout});
|
|
36
73
|
|
|
37
74
|
const builder = await Builder.init({
|
|
38
75
|
keypair,
|
|
@@ -40,6 +77,8 @@ export async function builderHandler(args: IBuilderCliArgs & GlobalArgs): Promis
|
|
|
40
77
|
config,
|
|
41
78
|
abortController,
|
|
42
79
|
api,
|
|
80
|
+
executionFeeRecipient: fromHex(executionFeeRecipient),
|
|
81
|
+
metrics,
|
|
43
82
|
});
|
|
44
83
|
|
|
45
84
|
onGracefulShutdownCbs.push(() => builder.close());
|
|
@@ -2,10 +2,12 @@ import fs from "node:fs";
|
|
|
2
2
|
import {Keystore} from "@chainsafe/bls-keystore";
|
|
3
3
|
import {SecretKey} from "@chainsafe/blst";
|
|
4
4
|
import {Keypair} from "@lodestar/builder";
|
|
5
|
+
import {Logger} from "@lodestar/utils";
|
|
5
6
|
import {ensure0xPrefix} from "../../util/format.js";
|
|
6
7
|
import {readPassphraseFile} from "../../util/passphrase.js";
|
|
7
8
|
|
|
8
9
|
export async function loadBuilderKeypair(
|
|
10
|
+
logger: Logger,
|
|
9
11
|
keystorePath: string,
|
|
10
12
|
passwordPath: string,
|
|
11
13
|
expectedPubkey?: string
|
|
@@ -28,5 +30,7 @@ export async function loadBuilderKeypair(
|
|
|
28
30
|
throw Error(`Pubkey mismatch: keystore ${publicKeyHex}, expected ${expectedPubkey}`);
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
logger.info("Loaded builder keystore", {pubkey: publicKeyHex});
|
|
34
|
+
|
|
31
35
|
return {secretKey, publicKey};
|
|
32
36
|
}
|
|
@@ -2,11 +2,23 @@ import {defaultOptions} from "@lodestar/builder";
|
|
|
2
2
|
import {CliCommandOptions} from "@lodestar/utils";
|
|
3
3
|
import {LogArgs, logOptions} from "../../options/logOptions.js";
|
|
4
4
|
|
|
5
|
+
export const builderMetricsDefaultOptions = {
|
|
6
|
+
enabled: false,
|
|
7
|
+
port: 5065,
|
|
8
|
+
address: "127.0.0.1",
|
|
9
|
+
};
|
|
10
|
+
|
|
5
11
|
export type IBuilderCliArgs = LogArgs & {
|
|
6
12
|
beaconNodeUrl: string;
|
|
7
13
|
keystore: string;
|
|
8
14
|
keystorePassword: string;
|
|
9
15
|
builderPubkey?: string;
|
|
16
|
+
executionFeeRecipient: string;
|
|
17
|
+
requestTimeout: number;
|
|
18
|
+
|
|
19
|
+
metrics?: boolean;
|
|
20
|
+
"metrics.port"?: number;
|
|
21
|
+
"metrics.address"?: string;
|
|
10
22
|
};
|
|
11
23
|
|
|
12
24
|
export const builderOptions: CliCommandOptions<IBuilderCliArgs> = {
|
|
@@ -34,4 +46,39 @@ export const builderOptions: CliCommandOptions<IBuilderCliArgs> = {
|
|
|
34
46
|
description: "Builder's expected public key based on the keystore from 'keystore' option",
|
|
35
47
|
type: "string",
|
|
36
48
|
},
|
|
49
|
+
|
|
50
|
+
executionFeeRecipient: {
|
|
51
|
+
description: "Execution address for receiving the payload rewards",
|
|
52
|
+
type: "string",
|
|
53
|
+
demandOption: true,
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
requestTimeout: {
|
|
57
|
+
description: "Timeout in milliseconds for HTTP requests to the beacon node",
|
|
58
|
+
type: "number",
|
|
59
|
+
default: defaultOptions.requestTimeout,
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
// Metrics
|
|
63
|
+
|
|
64
|
+
metrics: {
|
|
65
|
+
description: "Enable the Prometheus metrics HTTP server",
|
|
66
|
+
type: "boolean",
|
|
67
|
+
defaultDescription: String(builderMetricsDefaultOptions.enabled),
|
|
68
|
+
group: "metrics",
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
"metrics.port": {
|
|
72
|
+
description: "Listen TCP port for the Prometheus metrics HTTP server",
|
|
73
|
+
type: "number",
|
|
74
|
+
defaultDescription: String(builderMetricsDefaultOptions.port),
|
|
75
|
+
group: "metrics",
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
"metrics.address": {
|
|
79
|
+
description: "Listen address for the Prometheus metrics HTTP server",
|
|
80
|
+
type: "string",
|
|
81
|
+
defaultDescription: String(builderMetricsDefaultOptions.address),
|
|
82
|
+
group: "metrics",
|
|
83
|
+
},
|
|
37
84
|
};
|
|
@@ -55,14 +55,14 @@ export const options: CliCommandOptions<ExecutionBuilderArgs> = {
|
|
|
55
55
|
"builder.faultInspectionWindow": {
|
|
56
56
|
type: "number",
|
|
57
57
|
description:
|
|
58
|
-
"Window to inspect missed slots (pre-gloas) or
|
|
58
|
+
"Window used to inspect missed slots (pre-gloas) or calculate the canonical EMPTY block rate (post-gloas) for enabling/disabling the builder circuit breaker",
|
|
59
59
|
group: "builder",
|
|
60
60
|
},
|
|
61
61
|
|
|
62
62
|
"builder.allowedFaults": {
|
|
63
63
|
type: "number",
|
|
64
64
|
description:
|
|
65
|
-
"Number of missed slots
|
|
65
|
+
"Number of missed slots allowed within `faultInspectionWindow` before ignoring the external builder (pre-gloas). Post-gloas, sets the tolerated rate of canonical EMPTY blocks, defined as `allowedFaults` out of `faultInspectionWindow` and applied to canonical blocks in the window",
|
|
66
66
|
group: "builder",
|
|
67
67
|
},
|
|
68
68
|
};
|