@chainsafe/lodestar 1.36.0-dev.f657221d88 → 1.36.0-rc.1
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 +2 -2
- package/lib/cmds/beacon/handler.d.ts.map +1 -1
- package/lib/cmds/beacon/handler.js +16 -9
- package/lib/cmds/beacon/handler.js.map +1 -1
- package/lib/cmds/beacon/initBeaconState.d.ts +6 -1
- package/lib/cmds/beacon/initBeaconState.d.ts.map +1 -1
- package/lib/cmds/beacon/initBeaconState.js +126 -21
- package/lib/cmds/beacon/initBeaconState.js.map +1 -1
- package/lib/cmds/beacon/options.d.ts +2 -0
- package/lib/cmds/beacon/options.d.ts.map +1 -1
- package/lib/cmds/beacon/options.js +13 -1
- package/lib/cmds/beacon/options.js.map +1 -1
- package/lib/options/beaconNodeOptions/chain.d.ts.map +1 -1
- package/lib/options/beaconNodeOptions/chain.js +0 -1
- package/lib/options/beaconNodeOptions/chain.js.map +1 -1
- package/lib/options/globalOptions.d.ts +2 -0
- package/lib/options/globalOptions.d.ts.map +1 -1
- package/lib/options/globalOptions.js +6 -0
- package/lib/options/globalOptions.js.map +1 -1
- package/lib/util/file.d.ts.map +1 -1
- package/lib/util/file.js +4 -1
- package/lib/util/file.js.map +1 -1
- package/lib/util/hasher_bun.d.ts.map +1 -1
- package/lib/util/hasher_bun.js +2 -1
- package/lib/util/hasher_bun.js.map +1 -1
- package/package.json +15 -14
- package/src/cmds/beacon/handler.ts +25 -10
- package/src/cmds/beacon/initBeaconState.ts +166 -21
- package/src/cmds/beacon/options.ts +17 -1
- package/src/options/beaconNodeOptions/chain.ts +0 -1
- package/src/options/globalOptions.ts +9 -0
- package/src/util/file.ts +4 -1
- package/src/util/hasher_bun.ts +3 -1
package/src/util/file.ts
CHANGED
|
@@ -149,7 +149,10 @@ export async function downloadFile(pathDest: string, url: string): Promise<void>
|
|
|
149
149
|
*/
|
|
150
150
|
export async function downloadOrLoadFile(pathOrUrl: string): Promise<Uint8Array> {
|
|
151
151
|
if (isUrl(pathOrUrl)) {
|
|
152
|
-
const res = await fetch(pathOrUrl
|
|
152
|
+
const res = await fetch(pathOrUrl, {
|
|
153
|
+
// Ensure we only receive SSZ responses if REST API is queried
|
|
154
|
+
headers: {accept: "application/octet-stream"},
|
|
155
|
+
});
|
|
153
156
|
if (!res.ok) {
|
|
154
157
|
throw new Error(`Failed to download file from ${pathOrUrl}: ${res.status} ${res.statusText}`);
|
|
155
158
|
}
|
package/src/util/hasher_bun.ts
CHANGED
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
doMerkleizeBlockArray,
|
|
9
9
|
doMerkleizeBlocksBytes,
|
|
10
10
|
} from "@chainsafe/persistent-merkle-tree";
|
|
11
|
-
import {
|
|
11
|
+
import {hashtree} from "@lodestar/bun";
|
|
12
|
+
|
|
13
|
+
const {digest2Bytes32, digest2Bytes32Into, hashInto} = hashtree;
|
|
12
14
|
|
|
13
15
|
/**
|
|
14
16
|
* Best SIMD implementation is in 512 bits = 64 bytes
|