@chainsafe/lodestar 1.49.0-dev.09a1892a85 → 1.49.0-dev.0a27fd270f
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 +1 -2
- package/lib/cmds/beacon/handler.js.map +1 -1
- package/lib/cmds/beacon/initBeaconState.d.ts +0 -2
- package/lib/cmds/beacon/initBeaconState.d.ts.map +1 -1
- package/lib/cmds/beacon/initBeaconState.js +1 -2
- 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 +16 -3
- package/lib/cmds/beacon/initPeerIdAndEnr.js.map +1 -1
- package/lib/cmds/bootnode/options.js +1 -1
- package/lib/cmds/bootnode/options.js.map +1 -1
- package/lib/cmds/dev/options.d.ts +1 -2
- package/lib/cmds/dev/options.d.ts.map +1 -1
- package/lib/cmds/validator/options.js +1 -1
- package/lib/cmds/validator/options.js.map +1 -1
- package/lib/options/beaconNodeOptions/chain.d.ts +1 -1
- package/lib/options/beaconNodeOptions/chain.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/chain.js +7 -7
- package/lib/options/beaconNodeOptions/chain.js.map +1 -1
- package/lib/options/beaconNodeOptions/index.d.ts +1 -2
- package/lib/options/beaconNodeOptions/index.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/network.d.ts +8 -1
- package/lib/options/beaconNodeOptions/network.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/network.js +34 -4
- package/lib/options/beaconNodeOptions/network.js.map +1 -1
- package/lib/options/beaconNodeOptions/sync.d.ts +0 -1
- package/lib/options/beaconNodeOptions/sync.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/sync.js +0 -8
- package/lib/options/beaconNodeOptions/sync.js.map +1 -1
- package/lib/util/proposerConfig.d.ts +1 -1
- package/lib/util/proposerConfig.d.ts.map +1 -1
- package/lib/util/proposerConfig.js +6 -5
- package/lib/util/proposerConfig.js.map +1 -1
- package/package.json +14 -14
- package/src/cmds/beacon/handler.ts +0 -2
- package/src/cmds/beacon/initBeaconState.ts +4 -6
- package/src/cmds/beacon/initPeerIdAndEnr.ts +20 -7
- package/src/cmds/bootnode/options.ts +1 -1
- package/src/cmds/validator/options.ts +1 -1
- package/src/options/beaconNodeOptions/chain.ts +10 -9
- package/src/options/beaconNodeOptions/network.ts +37 -4
- package/src/options/beaconNodeOptions/sync.ts +0 -10
- package/src/util/proposerConfig.ts +7 -5
|
@@ -5,7 +5,6 @@ export type SyncArgs = {
|
|
|
5
5
|
"sync.isSingleNode"?: boolean;
|
|
6
6
|
"sync.disableProcessAsChainSegment"?: boolean;
|
|
7
7
|
"sync.disableRangeSync"?: boolean;
|
|
8
|
-
"sync.backfillBatchSize"?: number;
|
|
9
8
|
"sync.slotImportTolerance"?: number;
|
|
10
9
|
};
|
|
11
10
|
|
|
@@ -13,7 +12,6 @@ export function parseArgs(args: SyncArgs): IBeaconNodeOptions["sync"] {
|
|
|
13
12
|
return {
|
|
14
13
|
isSingleNode: args["sync.isSingleNode"],
|
|
15
14
|
disableProcessAsChainSegment: args["sync.disableProcessAsChainSegment"],
|
|
16
|
-
backfillBatchSize: args["sync.backfillBatchSize"] ?? defaultOptions.sync.backfillBatchSize,
|
|
17
15
|
disableRangeSync: args["sync.disableRangeSync"],
|
|
18
16
|
slotImportTolerance: args["sync.slotImportTolerance"] ?? defaultOptions.sync.slotImportTolerance,
|
|
19
17
|
};
|
|
@@ -54,12 +52,4 @@ Use only for local networks with a single node, can be dangerous in regular netw
|
|
|
54
52
|
defaultDescription: String(defaultOptions.sync.disableProcessAsChainSegment),
|
|
55
53
|
group: "sync",
|
|
56
54
|
},
|
|
57
|
-
|
|
58
|
-
"sync.backfillBatchSize": {
|
|
59
|
-
hidden: true,
|
|
60
|
-
type: "number",
|
|
61
|
-
description: "Batch size for backfill sync to sync/process blocks, set non zero to enable backfill sync",
|
|
62
|
-
defaultDescription: String(defaultOptions.sync.backfillBatchSize),
|
|
63
|
-
group: "sync",
|
|
64
|
-
},
|
|
65
55
|
};
|
|
@@ -3,7 +3,7 @@ import path from "node:path";
|
|
|
3
3
|
import {routes} from "@lodestar/api";
|
|
4
4
|
import {BuilderEntryConfig, builderConfigDataFromJson} from "@lodestar/api/keymanager";
|
|
5
5
|
import {MAX_BUILDER_AUTH_DATA_SIZE, MAX_BUILDER_ENTRIES, MAX_BUILDER_URL_SIZE} from "@lodestar/params";
|
|
6
|
-
import {fromHex, isValidAsciiHttpUrl, toHex} from "@lodestar/utils";
|
|
6
|
+
import {fromHex, isValidAsciiHttpUrl, toAsciiHttpUrl, toHex} from "@lodestar/utils";
|
|
7
7
|
import {ValidatorProposerConfig} from "@lodestar/validator";
|
|
8
8
|
import {parseFeeRecipient} from "./feeRecipient.js";
|
|
9
9
|
import {readFile} from "./file.js";
|
|
@@ -226,7 +226,8 @@ export function parseBuilderEntries(builders?: unknown): BuilderEntryConfig[] |
|
|
|
226
226
|
if (!isValidAsciiHttpUrl(entry.url)) {
|
|
227
227
|
throw Error(`Invalid builder url: ${entry.url}`);
|
|
228
228
|
}
|
|
229
|
-
const authData =
|
|
229
|
+
const authData =
|
|
230
|
+
entry.authData !== undefined ? toHex(fromHex(entry.authData)) : toHex(Buffer.from(new URL(entry.url).hostname));
|
|
230
231
|
const entryKey = `${entry.url}|${authData}`;
|
|
231
232
|
if (seenEntries.has(entryKey)) {
|
|
232
233
|
throw Error(`Duplicate builder entry url=${entry.url}`);
|
|
@@ -239,7 +240,7 @@ export function parseBuilderEntries(builders?: unknown): BuilderEntryConfig[] |
|
|
|
239
240
|
/**
|
|
240
241
|
* Parse builder urls into builder entries. Auth data agreed with a builder out of band may be
|
|
241
242
|
* appended as a hex fragment (`https://builder.example.com#0x0123`), it is stripped from the url
|
|
242
|
-
* and never sent on the wire. Without a fragment the auth data derives from the url.
|
|
243
|
+
* and never sent on the wire. Without a fragment the auth data derives from the url hostname.
|
|
243
244
|
*/
|
|
244
245
|
export function parseBuilderUrls(urls?: string[]): BuilderEntryConfig[] | undefined {
|
|
245
246
|
if (urls === undefined) return undefined;
|
|
@@ -251,7 +252,8 @@ export function parseBuilderUrls(urls?: string[]): BuilderEntryConfig[] | undefi
|
|
|
251
252
|
const url = fragmentIndex === -1 ? value : value.slice(0, fragmentIndex);
|
|
252
253
|
const authData = fragmentIndex === -1 ? undefined : value.slice(fragmentIndex + 1);
|
|
253
254
|
if (!isValidAsciiHttpUrl(url)) {
|
|
254
|
-
|
|
255
|
+
const asciiUrl = toAsciiHttpUrl(url);
|
|
256
|
+
throw Error(`Invalid builder url: ${url}` + (asciiUrl !== null ? `, use ${asciiUrl} instead` : ""));
|
|
255
257
|
}
|
|
256
258
|
if (Buffer.byteLength(url, "utf8") > MAX_BUILDER_URL_SIZE) {
|
|
257
259
|
throw Error(`Invalid builder url, must not exceed ${MAX_BUILDER_URL_SIZE} bytes: ${url}`);
|
|
@@ -261,7 +263,7 @@ export function parseBuilderUrls(urls?: string[]): BuilderEntryConfig[] | undefi
|
|
|
261
263
|
`Invalid builder url auth data, must be a 0x-prefixed hex string of 1 to ${MAX_BUILDER_AUTH_DATA_SIZE} bytes: ${url}`
|
|
262
264
|
);
|
|
263
265
|
}
|
|
264
|
-
const entryKey = `${url}|${authData !== undefined ? toHex(fromHex(authData)) : toHex(Buffer.from(url))}`;
|
|
266
|
+
const entryKey = `${url}|${authData !== undefined ? toHex(fromHex(authData)) : toHex(Buffer.from(new URL(url).hostname))}`;
|
|
265
267
|
if (seenEntries.has(entryKey)) {
|
|
266
268
|
throw Error(`Duplicate builder url: ${url}`);
|
|
267
269
|
}
|