@chainsafe/lodestar 1.47.0-dev.90204c280d → 1.47.0-dev.9d19aee2e7
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 +13 -2
- package/lib/cmds/builder/handler.js.map +1 -1
- package/lib/cmds/builder/options.d.ts +2 -0
- package/lib/cmds/builder/options.d.ts.map +1 -1
- package/lib/cmds/builder/options.js +10 -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 +21 -2
- package/src/cmds/builder/options.ts +14 -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":"AAMA,OAAO,EAAC,UAAU,EAAC,MAAM,wBAAwB,CAAC;AAIlD,OAAO,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAI7C,wBAAsB,cAAc,CAAC,IAAI,EAAE,eAAe,GAAG,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDtF"}
|
|
@@ -2,12 +2,17 @@ import path from "node:path";
|
|
|
2
2
|
import { getClient } from "@lodestar/api";
|
|
3
3
|
import { Builder } from "@lodestar/builder";
|
|
4
4
|
import { getNodeLogger } from "@lodestar/logger/node";
|
|
5
|
+
import { fromHex, toPrintableUrl } from "@lodestar/utils";
|
|
5
6
|
import { getBeaconConfigFromArgs } from "../../config/beaconParams.js";
|
|
6
7
|
import { getGlobalPaths } from "../../paths/global.js";
|
|
7
|
-
import { cleanOldLogFiles, onGracefulShutdown, parseLoggerArgs } from "../../util/index.js";
|
|
8
|
+
import { cleanOldLogFiles, onGracefulShutdown, parseFeeRecipient, parseLoggerArgs } from "../../util/index.js";
|
|
8
9
|
import { loadBuilderKeypair } from "./loadKeypair.js";
|
|
10
|
+
const ZERO_ADDRESS = "0x" + "0".repeat(40);
|
|
9
11
|
export async function builderHandler(args) {
|
|
10
12
|
const { config, network } = getBeaconConfigFromArgs(args);
|
|
13
|
+
if (config.GLOAS_FORK_EPOCH === Infinity) {
|
|
14
|
+
throw Error(`Gloas must be scheduled via GLOAS_FORK_EPOCH for network=${network}`);
|
|
15
|
+
}
|
|
11
16
|
const globalPaths = getGlobalPaths(args, network);
|
|
12
17
|
const defaultLogFilepath = path.join(globalPaths.dataDir, "builder.log");
|
|
13
18
|
const logger = getNodeLogger(parseLoggerArgs(args, { defaultLogFilepath }, config));
|
|
@@ -17,6 +22,10 @@ export async function builderHandler(args) {
|
|
|
17
22
|
catch (e) {
|
|
18
23
|
logger.debug("Not able to delete log files", {}, e);
|
|
19
24
|
}
|
|
25
|
+
const executionFeeRecipient = parseFeeRecipient(args.executionFeeRecipient);
|
|
26
|
+
if (executionFeeRecipient === ZERO_ADDRESS) {
|
|
27
|
+
throw Error("Cannot put zero address as an executionFeeRecipient");
|
|
28
|
+
}
|
|
20
29
|
const keypair = await loadBuilderKeypair(args.keystore, args.keystorePassword, args.builderPubkey);
|
|
21
30
|
const onGracefulShutdownCbs = [];
|
|
22
31
|
onGracefulShutdown(async () => {
|
|
@@ -25,13 +34,15 @@ export async function builderHandler(args) {
|
|
|
25
34
|
}, logger.info.bind(logger));
|
|
26
35
|
const abortController = new AbortController();
|
|
27
36
|
onGracefulShutdownCbs.push(async () => abortController.abort());
|
|
28
|
-
const api = getClient({ urls: [args.beaconNodeUrl], globalInit: { signal: abortController.signal } }, { config, logger });
|
|
37
|
+
const api = getClient({ urls: [args.beaconNodeUrl], globalInit: { signal: abortController.signal, timeoutMs: args.requestTimeout } }, { config, logger });
|
|
38
|
+
logger.info("Beacon node", { beaconNode: toPrintableUrl(args.beaconNodeUrl), timeoutMs: args.requestTimeout });
|
|
29
39
|
const builder = await Builder.init({
|
|
30
40
|
keypair,
|
|
31
41
|
logger,
|
|
32
42
|
config,
|
|
33
43
|
abortController,
|
|
34
44
|
api,
|
|
45
|
+
executionFeeRecipient: fromHex(executionFeeRecipient),
|
|
35
46
|
});
|
|
36
47
|
onGracefulShutdownCbs.push(() => builder.close());
|
|
37
48
|
}
|
|
@@ -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;AAC1C,OAAO,EAAC,aAAa,EAAC,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAC,uBAAuB,EAAC,MAAM,8BAA8B,CAAC;AAErE,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAC,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAC,MAAM,qBAAqB,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,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAC1C,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,C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
requestTimeout: number;
|
|
8
10
|
};
|
|
9
11
|
export declare const builderOptions: CliCommandOptions<IBuilderCliArgs>;
|
|
10
12
|
//# 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;CACxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,eAAe,
|
|
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;IACvB,qBAAqB,EAAE,MAAM,CAAC;IAC9B,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,iBAAiB,CAAC,eAAe,CAqC7D,CAAC"}
|
|
@@ -21,5 +21,15 @@ export const builderOptions = {
|
|
|
21
21
|
description: "Builder's expected public key based on the keystore from 'keystore' option",
|
|
22
22
|
type: "string",
|
|
23
23
|
},
|
|
24
|
+
executionFeeRecipient: {
|
|
25
|
+
description: "Execution address for receiving the payload rewards",
|
|
26
|
+
type: "string",
|
|
27
|
+
demandOption: true,
|
|
28
|
+
},
|
|
29
|
+
requestTimeout: {
|
|
30
|
+
description: "Timeout in milliseconds for HTTP requests to the beacon node",
|
|
31
|
+
type: "number",
|
|
32
|
+
default: defaultOptions.requestTimeout,
|
|
33
|
+
},
|
|
24
34
|
};
|
|
25
35
|
//# 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;AAWhE,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;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 allowed within `faultInspectionWindow` before ignoring the external builder (pre-gloas). Post-gloas, sets the tolerated rate of
|
|
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
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../src/options/beaconNodeOptions/builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,+BAA+B,EAAC,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAC;AAa/C,MAAM,UAAU,SAAS,CAAC,IAA0B;IAClD,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,IAAI,IAAI,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACjF,MAAM,IAAI,UAAU,CAClB,gIAAgI,CACjI,CAAC;IACJ,CAAC;IAED,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,+BAA+B,CAAC,GAAG;QAC/D,OAAO,EAA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AC,IAAI,+BAA+B,CAAC,GAAG;QAC/D,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC;QAChC,qBAAqB,EAAE,IAAI,CAAC,+BAA+B,CAAC;QAC5D,aAAa,EAAE,IAAI,CAAC,uBAAuB,CAAC;KAC7C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAA4C;IAC9D,OAAO,EAAE;QACP,WAAW,EAAE,yBAAyB;QACtC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,+BAA+B,CAAC,OAAO;QAChD,KAAK,EAAE,SAAS;KACjB;IAED,aAAa,EAAE;QACb,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,WAAW,EAAE,6BAA6B;QAC1C,kBAAkB,EAAE,+BAA+B,CAAC,GAAG;QACvD,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,SAAS;KACjB;IAED,iBAAiB,EAAE;QACjB,WAAW,EAAE,qDAAqD;QAClE,IAAI,EAAE,QAAQ;QACd,kBAAkB,EAAE,MAAM,CAAC,+BAA+B,CAAC,OAAO,CAAC;QACnE,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.9d19aee2e7",
|
|
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.9d19aee2e7",
|
|
72
|
+
"@lodestar/beacon-node": "^1.47.0-dev.9d19aee2e7",
|
|
73
|
+
"@lodestar/builder": "^1.47.0-dev.9d19aee2e7",
|
|
74
|
+
"@lodestar/config": "^1.47.0-dev.9d19aee2e7",
|
|
75
|
+
"@lodestar/db": "^1.47.0-dev.9d19aee2e7",
|
|
76
|
+
"@lodestar/logger": "^1.47.0-dev.9d19aee2e7",
|
|
77
|
+
"@lodestar/params": "^1.47.0-dev.9d19aee2e7",
|
|
78
|
+
"@lodestar/state-transition": "^1.47.0-dev.9d19aee2e7",
|
|
79
|
+
"@lodestar/types": "^1.47.0-dev.9d19aee2e7",
|
|
80
|
+
"@lodestar/utils": "^1.47.0-dev.9d19aee2e7",
|
|
81
|
+
"@lodestar/validator": "^1.47.0-dev.9d19aee2e7",
|
|
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.9d19aee2e7",
|
|
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": "7bcb13bb1874a0d514f22c13a8629eabc69eabe8"
|
|
112
112
|
}
|
|
@@ -2,16 +2,23 @@ import path from "node:path";
|
|
|
2
2
|
import {getClient} from "@lodestar/api";
|
|
3
3
|
import {Builder} from "@lodestar/builder";
|
|
4
4
|
import {getNodeLogger} from "@lodestar/logger/node";
|
|
5
|
+
import {fromHex, toPrintableUrl} from "@lodestar/utils";
|
|
5
6
|
import {getBeaconConfigFromArgs} from "../../config/beaconParams.js";
|
|
6
7
|
import {GlobalArgs} from "../../options/index.js";
|
|
7
8
|
import {getGlobalPaths} from "../../paths/global.js";
|
|
8
|
-
import {cleanOldLogFiles, onGracefulShutdown, parseLoggerArgs} from "../../util/index.js";
|
|
9
|
+
import {cleanOldLogFiles, onGracefulShutdown, parseFeeRecipient, parseLoggerArgs} from "../../util/index.js";
|
|
9
10
|
import {loadBuilderKeypair} from "./loadKeypair.js";
|
|
10
11
|
import {IBuilderCliArgs} from "./options.js";
|
|
11
12
|
|
|
13
|
+
const ZERO_ADDRESS = "0x" + "0".repeat(40);
|
|
14
|
+
|
|
12
15
|
export async function builderHandler(args: IBuilderCliArgs & GlobalArgs): Promise<void> {
|
|
13
16
|
const {config, network} = getBeaconConfigFromArgs(args);
|
|
14
17
|
|
|
18
|
+
if (config.GLOAS_FORK_EPOCH === Infinity) {
|
|
19
|
+
throw Error(`Gloas must be scheduled via GLOAS_FORK_EPOCH for network=${network}`);
|
|
20
|
+
}
|
|
21
|
+
|
|
15
22
|
const globalPaths = getGlobalPaths(args, network);
|
|
16
23
|
const defaultLogFilepath = path.join(globalPaths.dataDir, "builder.log");
|
|
17
24
|
const logger = getNodeLogger(parseLoggerArgs(args, {defaultLogFilepath}, config));
|
|
@@ -22,6 +29,12 @@ export async function builderHandler(args: IBuilderCliArgs & GlobalArgs): Promis
|
|
|
22
29
|
logger.debug("Not able to delete log files", {}, e as Error);
|
|
23
30
|
}
|
|
24
31
|
|
|
32
|
+
const executionFeeRecipient = parseFeeRecipient(args.executionFeeRecipient);
|
|
33
|
+
|
|
34
|
+
if (executionFeeRecipient === ZERO_ADDRESS) {
|
|
35
|
+
throw Error("Cannot put zero address as an executionFeeRecipient");
|
|
36
|
+
}
|
|
37
|
+
|
|
25
38
|
const keypair = await loadBuilderKeypair(args.keystore, args.keystorePassword, args.builderPubkey);
|
|
26
39
|
|
|
27
40
|
const onGracefulShutdownCbs: (() => Promise<void> | void)[] = [];
|
|
@@ -32,7 +45,12 @@ export async function builderHandler(args: IBuilderCliArgs & GlobalArgs): Promis
|
|
|
32
45
|
const abortController = new AbortController();
|
|
33
46
|
onGracefulShutdownCbs.push(async () => abortController.abort());
|
|
34
47
|
|
|
35
|
-
const api = getClient(
|
|
48
|
+
const api = getClient(
|
|
49
|
+
{urls: [args.beaconNodeUrl], globalInit: {signal: abortController.signal, timeoutMs: args.requestTimeout}},
|
|
50
|
+
{config, logger}
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
logger.info("Beacon node", {beaconNode: toPrintableUrl(args.beaconNodeUrl), timeoutMs: args.requestTimeout});
|
|
36
54
|
|
|
37
55
|
const builder = await Builder.init({
|
|
38
56
|
keypair,
|
|
@@ -40,6 +58,7 @@ export async function builderHandler(args: IBuilderCliArgs & GlobalArgs): Promis
|
|
|
40
58
|
config,
|
|
41
59
|
abortController,
|
|
42
60
|
api,
|
|
61
|
+
executionFeeRecipient: fromHex(executionFeeRecipient),
|
|
43
62
|
});
|
|
44
63
|
|
|
45
64
|
onGracefulShutdownCbs.push(() => builder.close());
|
|
@@ -7,6 +7,8 @@ export type IBuilderCliArgs = LogArgs & {
|
|
|
7
7
|
keystore: string;
|
|
8
8
|
keystorePassword: string;
|
|
9
9
|
builderPubkey?: string;
|
|
10
|
+
executionFeeRecipient: string;
|
|
11
|
+
requestTimeout: number;
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export const builderOptions: CliCommandOptions<IBuilderCliArgs> = {
|
|
@@ -34,4 +36,16 @@ export const builderOptions: CliCommandOptions<IBuilderCliArgs> = {
|
|
|
34
36
|
description: "Builder's expected public key based on the keystore from 'keystore' option",
|
|
35
37
|
type: "string",
|
|
36
38
|
},
|
|
39
|
+
|
|
40
|
+
executionFeeRecipient: {
|
|
41
|
+
description: "Execution address for receiving the payload rewards",
|
|
42
|
+
type: "string",
|
|
43
|
+
demandOption: true,
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
requestTimeout: {
|
|
47
|
+
description: "Timeout in milliseconds for HTTP requests to the beacon node",
|
|
48
|
+
type: "number",
|
|
49
|
+
default: defaultOptions.requestTimeout,
|
|
50
|
+
},
|
|
37
51
|
};
|
|
@@ -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 allowed within `faultInspectionWindow` before ignoring the external builder (pre-gloas). Post-gloas, sets the tolerated rate of
|
|
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
|
};
|