@lodestar/beacon-node 1.41.0-dev.bb273175f2 → 1.41.0-dev.be5acbb8f7
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/lib/chain/blocks/blockInput/blockInput.d.ts +5 -0
- package/lib/chain/blocks/blockInput/blockInput.d.ts.map +1 -1
- package/lib/chain/blocks/blockInput/blockInput.js +24 -0
- package/lib/chain/blocks/blockInput/blockInput.js.map +1 -1
- package/lib/chain/blocks/blockInput/types.d.ts +5 -0
- package/lib/chain/blocks/blockInput/types.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +1 -12
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/chain.d.ts +1 -1
- package/lib/chain/chain.js +2 -1
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/errors/executionPayloadBid.d.ts +1 -1
- package/lib/chain/errors/payloadAttestation.d.ts +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts +0 -1
- package/lib/chain/produceBlock/computeNewStateRoot.d.ts.map +1 -1
- package/lib/chain/produceBlock/computeNewStateRoot.js +4 -3
- package/lib/chain/produceBlock/computeNewStateRoot.js.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts +5 -1
- package/lib/chain/seenCache/seenGossipBlockInput.d.ts.map +1 -1
- package/lib/chain/seenCache/seenGossipBlockInput.js +21 -8
- package/lib/chain/seenCache/seenGossipBlockInput.js.map +1 -1
- package/lib/db/index.d.ts +1 -0
- package/lib/db/index.d.ts.map +1 -1
- package/lib/db/index.js +1 -0
- package/lib/db/index.js.map +1 -1
- package/lib/metrics/metrics/lodestar.d.ts +1 -0
- package/lib/metrics/metrics/lodestar.d.ts.map +1 -1
- package/lib/metrics/metrics/lodestar.js +4 -0
- package/lib/metrics/metrics/lodestar.js.map +1 -1
- package/lib/network/network.d.ts.map +1 -1
- package/lib/network/network.js +1 -1
- package/lib/network/network.js.map +1 -1
- package/lib/network/reqresp/utils/collect.d.ts +1 -1
- package/lib/network/reqresp/utils/collectSequentialBlocksInRange.d.ts +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +1 -1
- package/lib/sync/utils/remoteSyncType.d.ts +1 -1
- package/lib/util/serializedCache.d.ts +4 -4
- package/lib/util/serializedCache.d.ts.map +1 -1
- package/lib/util/serializedCache.js +6 -4
- package/lib/util/serializedCache.js.map +1 -1
- package/package.json +15 -15
- package/src/chain/blocks/blockInput/blockInput.ts +35 -0
- package/src/chain/blocks/blockInput/types.ts +5 -0
- package/src/chain/blocks/writeBlockInputToDb.ts +1 -18
- package/src/chain/chain.ts +6 -6
- package/src/chain/errors/executionPayloadBid.ts +1 -1
- package/src/chain/errors/payloadAttestation.ts +1 -1
- package/src/chain/produceBlock/computeNewStateRoot.ts +4 -3
- package/src/chain/seenCache/seenGossipBlockInput.ts +38 -10
- package/src/db/index.ts +1 -0
- package/src/metrics/metrics/lodestar.ts +4 -0
- package/src/network/network.ts +2 -1
- package/src/network/processor/gossipHandlers.ts +1 -1
- package/src/network/processor/gossipValidatorFn.ts +1 -1
- package/src/network/reqresp/ReqRespBeaconNode.ts +1 -1
- package/src/network/reqresp/handlers/beaconBlocksByRange.ts +1 -1
- package/src/network/reqresp/handlers/dataColumnSidecarsByRange.ts +1 -1
- package/src/network/reqresp/handlers/dataColumnSidecarsByRoot.ts +1 -1
- package/src/network/reqresp/utils/collect.ts +1 -1
- package/src/network/reqresp/utils/collectSequentialBlocksInRange.ts +1 -1
- package/src/sync/utils/downloadByRoot.ts +1 -1
- package/src/sync/utils/remoteSyncType.ts +1 -1
- package/src/util/serializedCache.ts +7 -5
|
@@ -6,7 +6,7 @@ import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
|
6
6
|
import {deneb, phase0} from "@lodestar/types";
|
|
7
7
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
8
8
|
import {IBeaconDb} from "../../../db/index.js";
|
|
9
|
-
import {prettyPrintPeerId} from "../../util.
|
|
9
|
+
import {prettyPrintPeerId} from "../../util.js";
|
|
10
10
|
|
|
11
11
|
// TODO: Unit test
|
|
12
12
|
|
|
@@ -7,7 +7,7 @@ import {ColumnIndex, fulu} from "@lodestar/types";
|
|
|
7
7
|
import {fromHex} from "@lodestar/utils";
|
|
8
8
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
9
9
|
import {IBeaconDb} from "../../../db/index.js";
|
|
10
|
-
import {prettyPrintPeerId} from "../../util.
|
|
10
|
+
import {prettyPrintPeerId} from "../../util.js";
|
|
11
11
|
import {
|
|
12
12
|
handleColumnSidecarUnavailability,
|
|
13
13
|
validateRequestedDataColumns,
|
|
@@ -6,7 +6,7 @@ import {toRootHex} from "@lodestar/utils";
|
|
|
6
6
|
import {IBeaconChain} from "../../../chain/index.js";
|
|
7
7
|
import {IBeaconDb} from "../../../db/index.js";
|
|
8
8
|
import {DataColumnSidecarsByRootRequest} from "../../../util/types.js";
|
|
9
|
-
import {prettyPrintPeerId} from "../../util.
|
|
9
|
+
import {prettyPrintPeerId} from "../../util.js";
|
|
10
10
|
import {
|
|
11
11
|
handleColumnSidecarUnavailability,
|
|
12
12
|
validateRequestedDataColumns,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {Type} from "@chainsafe/ssz";
|
|
2
2
|
import {RequestError, RequestErrorCode, ResponseIncoming} from "@lodestar/reqresp";
|
|
3
|
-
import {SerializedCache} from "../../../util/serializedCache.
|
|
3
|
+
import {SerializedCache} from "../../../util/serializedCache.js";
|
|
4
4
|
import {ResponseTypeGetter} from "../types.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {ResponseIncoming} from "@lodestar/reqresp";
|
|
2
2
|
import {SignedBeaconBlock, phase0} from "@lodestar/types";
|
|
3
3
|
import {LodestarError} from "@lodestar/utils";
|
|
4
|
-
import {SerializedCache} from "../../../util/serializedCache.
|
|
4
|
+
import {SerializedCache} from "../../../util/serializedCache.js";
|
|
5
5
|
import {ReqRespMethod, responseSszTypeByMethod} from "../types.js";
|
|
6
6
|
import {sszDeserializeResponse} from "./collect.js";
|
|
7
7
|
|
|
@@ -6,7 +6,7 @@ import {LodestarError, byteArrayEquals, fromHex, prettyPrintIndices, toHex, toRo
|
|
|
6
6
|
import {isBlockInputBlobs, isBlockInputColumns} from "../../chain/blocks/blockInput/blockInput.js";
|
|
7
7
|
import {BlockInputSource, IBlockInput} from "../../chain/blocks/blockInput/types.js";
|
|
8
8
|
import {ChainEventEmitter} from "../../chain/emitter.js";
|
|
9
|
-
import {IBeaconChain} from "../../chain/interface.
|
|
9
|
+
import {IBeaconChain} from "../../chain/interface.js";
|
|
10
10
|
import {validateBlockBlobSidecars} from "../../chain/validation/blobSidecar.js";
|
|
11
11
|
import {validateBlockDataColumnSidecars} from "../../chain/validation/dataColumnSidecar.js";
|
|
12
12
|
import {INetwork} from "../../network/interface.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {IForkChoice} from "@lodestar/fork-choice";
|
|
2
2
|
import {computeEpochAtSlot, computeStartSlotAtEpoch} from "@lodestar/state-transition";
|
|
3
3
|
import {Slot, Status} from "@lodestar/types";
|
|
4
|
-
import {IBeaconChain} from "../../chain/interface.
|
|
4
|
+
import {IBeaconChain} from "../../chain/interface.js";
|
|
5
5
|
import {ChainTarget} from "../range/utils/index.js";
|
|
6
6
|
|
|
7
7
|
/** The type of peer relative to our current state */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* This is a thin wrapper around WeakMap
|
|
5
5
|
*/
|
|
6
6
|
export class SerializedCache {
|
|
7
|
-
map: WeakMap<object, Uint8Array> = new WeakMap();
|
|
7
|
+
private map: WeakMap<object, Uint8Array> = new WeakMap();
|
|
8
8
|
|
|
9
9
|
get(obj: object): Uint8Array | undefined {
|
|
10
10
|
return this.map.get(obj);
|
|
@@ -15,11 +15,13 @@ export class SerializedCache {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
|
-
*
|
|
19
|
-
* Must only be called after all DB writes that
|
|
18
|
+
* Delete cached serialized entries for the provided object references.
|
|
19
|
+
* Must only be called after all DB writes that read from this cache for these objects have completed,
|
|
20
20
|
* otherwise cached serialized bytes will be unavailable and data will be re-serialized unnecessarily.
|
|
21
21
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
delete(objs: object[]): void {
|
|
23
|
+
for (const obj of objs) {
|
|
24
|
+
this.map.delete(obj);
|
|
25
|
+
}
|
|
24
26
|
}
|
|
25
27
|
}
|