@lodestar/beacon-node 1.51.0-dev.5619357e93 → 1.51.0-dev.596284206a

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.
Files changed (32) hide show
  1. package/lib/chain/blocks/importExecutionPayload.d.ts +2 -10
  2. package/lib/chain/blocks/importExecutionPayload.d.ts.map +1 -1
  3. package/lib/chain/blocks/importExecutionPayload.js +2 -14
  4. package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
  5. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +10 -7
  6. package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts.map +1 -1
  7. package/lib/chain/blocks/payloadEnvelopeProcessor.js +21 -16
  8. package/lib/chain/blocks/payloadEnvelopeProcessor.js.map +1 -1
  9. package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
  10. package/lib/chain/blocks/verifyPayloadsDataAvailability.js +1 -3
  11. package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
  12. package/lib/chain/validation/executionPayloadBid.js +13 -13
  13. package/lib/chain/validation/executionPayloadBid.js.map +1 -1
  14. package/lib/db/flatFileStore/flatFileStore.js +5 -5
  15. package/lib/db/flatFileStore/flatFileStore.js.map +1 -1
  16. package/lib/db/flatFileStore/slotIndex.d.ts.map +1 -1
  17. package/lib/db/flatFileStore/slotIndex.js +2 -2
  18. package/lib/db/flatFileStore/slotIndex.js.map +1 -1
  19. package/lib/network/processor/gossipHandlers.js +3 -3
  20. package/lib/network/processor/gossipHandlers.js.map +1 -1
  21. package/lib/util/file.d.ts.map +1 -1
  22. package/lib/util/file.js +8 -9
  23. package/lib/util/file.js.map +1 -1
  24. package/package.json +16 -17
  25. package/src/chain/blocks/importExecutionPayload.ts +2 -20
  26. package/src/chain/blocks/payloadEnvelopeProcessor.ts +32 -21
  27. package/src/chain/blocks/verifyPayloadsDataAvailability.ts +1 -3
  28. package/src/chain/validation/executionPayloadBid.ts +14 -13
  29. package/src/db/flatFileStore/flatFileStore.ts +7 -7
  30. package/src/db/flatFileStore/slotIndex.ts +4 -3
  31. package/src/network/processor/gossipHandlers.ts +3 -3
  32. package/src/util/file.ts +8 -9
@@ -705,8 +705,8 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
705
705
 
706
706
  // Immediately attempt fetch of data columns from execution engine as the bid contains kzg commitments
707
707
  // which is all the information we need so there is no reason to delay until execution payload arrives
708
- // Columns fetched here feed payloadInput.addColumn, which resolves waitForAllData for any
709
- // in-flight importExecutionPayload. No processExecutionPayload trigger needed from this path.
708
+ // Columns fetched here feed payloadInput.addColumn, which resolves the waitForAllData of a
709
+ // pending payload import. No processExecutionPayload trigger needed from this path.
710
710
  chain.getBlobsTracker.triggerGetBlobs(payloadInput);
711
711
  }
712
712
  })
@@ -927,7 +927,7 @@ function getSequentialHandlers(modules: ValidatorFnsModules, options: GossipHand
927
927
  }
928
928
 
929
929
  // NOTE: we do NOT call chain.processExecutionPayload here. That is triggered only by
930
- // envelope arrival (gossip or API). An in-flight importExecutionPayload is awaiting
930
+ // envelope arrival (gossip or API). A pending payload import is awaiting
931
931
  // payloadInput.waitForAllData(); addColumn above will resolve it once hasAllData flips.
932
932
 
933
933
  scheduleIncompletePayloadEnvelope(payloadInput, peerIdStr);
package/src/util/file.ts CHANGED
@@ -1,25 +1,24 @@
1
- import fs from "node:fs";
2
- import {promisify} from "node:util";
1
+ import {readFile as fsReadFile, mkdir, readdir, stat, unlink, writeFile} from "node:fs/promises";
3
2
 
4
3
  /** Ensure a directory exists */
5
4
  export async function ensureDir(path: string): Promise<void> {
6
5
  try {
7
- await promisify(fs.stat)(path);
6
+ await stat(path);
8
7
  } catch (_) {
9
8
  // not exists
10
- await promisify(fs.mkdir)(path, {recursive: true});
9
+ await mkdir(path, {recursive: true});
11
10
  }
12
11
  }
13
12
 
14
13
  /** Write data to a file if it does not exist */
15
14
  export async function writeIfNotExist(filepath: string, bytes: Uint8Array): Promise<boolean> {
16
15
  try {
17
- await promisify(fs.stat)(filepath);
16
+ await stat(filepath);
18
17
  return false;
19
18
  // file exists, do nothing
20
19
  } catch (_) {
21
20
  // not exists
22
- await promisify(fs.writeFile)(filepath, bytes);
21
+ await writeFile(filepath, bytes);
23
22
  return true;
24
23
  }
25
24
  }
@@ -27,7 +26,7 @@ export async function writeIfNotExist(filepath: string, bytes: Uint8Array): Prom
27
26
  /** Remove a file if it exists */
28
27
  export async function removeFile(path: string): Promise<boolean> {
29
28
  try {
30
- await promisify(fs.unlink)(path);
29
+ await unlink(path);
31
30
  return true;
32
31
  } catch (_) {
33
32
  // may not exists
@@ -37,7 +36,7 @@ export async function removeFile(path: string): Promise<boolean> {
37
36
 
38
37
  export async function readFile(path: string): Promise<Uint8Array | null> {
39
38
  try {
40
- return await fs.promises.readFile(path);
39
+ return await fsReadFile(path);
41
40
  } catch (_) {
42
41
  return null;
43
42
  }
@@ -45,7 +44,7 @@ export async function readFile(path: string): Promise<Uint8Array | null> {
45
44
 
46
45
  export async function readFileNames(folderPath: string): Promise<string[]> {
47
46
  try {
48
- return await fs.promises.readdir(folderPath);
47
+ return await readdir(folderPath);
49
48
  } catch (_) {
50
49
  return [];
51
50
  }