@lodestar/beacon-node 1.40.0 → 1.41.0-dev.07f3dcc477
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/api/impl/lightclient/index.d.ts.map +1 -1
- package/lib/api/impl/lightclient/index.js +19 -2
- package/lib/api/impl/lightclient/index.js.map +1 -1
- package/lib/api/impl/node/index.d.ts +1 -1
- package/lib/api/impl/node/index.d.ts.map +1 -1
- package/lib/api/impl/node/index.js +18 -1
- package/lib/api/impl/node/index.js.map +1 -1
- package/lib/chain/blocks/importBlock.d.ts.map +1 -1
- package/lib/chain/blocks/importBlock.js +0 -2
- package/lib/chain/blocks/importBlock.js.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.d.ts.map +1 -1
- package/lib/chain/blocks/writeBlockInputToDb.js +3 -0
- package/lib/chain/blocks/writeBlockInputToDb.js.map +1 -1
- package/lib/chain/errors/blockError.d.ts +7 -1
- package/lib/chain/errors/blockError.d.ts.map +1 -1
- package/lib/chain/errors/blockError.js +2 -0
- package/lib/chain/errors/blockError.js.map +1 -1
- package/lib/chain/lightClient/index.d.ts.map +1 -1
- package/lib/chain/lightClient/index.js +1 -1
- package/lib/chain/lightClient/index.js.map +1 -1
- package/lib/chain/validation/block.d.ts.map +1 -1
- package/lib/chain/validation/block.js +27 -3
- package/lib/chain/validation/block.js.map +1 -1
- package/lib/chain/validation/executionPayloadEnvelope.js +2 -1
- package/lib/chain/validation/executionPayloadEnvelope.js.map +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js +1 -1
- package/lib/chain/validation/payloadAttestationMessage.js.map +1 -1
- package/lib/execution/engine/interface.d.ts +3 -25
- package/lib/execution/engine/interface.d.ts.map +1 -1
- package/lib/execution/engine/interface.js +2 -20
- package/lib/execution/engine/interface.js.map +1 -1
- package/lib/metrics/metrics.d.ts.map +1 -1
- package/lib/metrics/metrics.js +8 -3
- package/lib/metrics/metrics.js.map +1 -1
- package/lib/network/gossip/topic.d.ts +1 -2
- package/lib/network/gossip/topic.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.d.ts.map +1 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js +7 -1
- package/lib/network/reqresp/handlers/lightClientUpdatesByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRange.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRange.js +3 -9
- package/lib/sync/utils/downloadByRange.js.map +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts +1 -1
- package/lib/sync/utils/downloadByRoot.d.ts.map +1 -1
- package/lib/sync/utils/downloadByRoot.js +4 -4
- package/lib/sync/utils/downloadByRoot.js.map +1 -1
- package/lib/util/dataColumns.d.ts +5 -0
- package/lib/util/dataColumns.d.ts.map +1 -1
- package/lib/util/dataColumns.js +13 -5
- package/lib/util/dataColumns.js.map +1 -1
- package/lib/util/serializedCache.d.ts +5 -0
- package/lib/util/serializedCache.d.ts.map +1 -1
- package/lib/util/serializedCache.js +5 -0
- package/lib/util/serializedCache.js.map +1 -1
- package/package.json +15 -15
- package/src/api/impl/lightclient/index.ts +19 -2
- package/src/api/impl/node/index.ts +22 -1
- package/src/chain/blocks/importBlock.ts +0 -3
- package/src/chain/blocks/writeBlockInputToDb.ts +3 -0
- package/src/chain/errors/blockError.ts +4 -1
- package/src/chain/lightClient/index.ts +4 -1
- package/src/chain/validation/block.ts +32 -4
- package/src/chain/validation/executionPayloadEnvelope.ts +2 -1
- package/src/chain/validation/payloadAttestationMessage.ts +1 -1
- package/src/execution/engine/interface.ts +3 -27
- package/src/metrics/metrics.ts +8 -3
- package/src/network/reqresp/handlers/lightClientUpdatesByRange.ts +6 -1
- package/src/sync/utils/downloadByRange.ts +3 -15
- package/src/sync/utils/downloadByRoot.ts +5 -11
- package/src/util/dataColumns.ts +18 -5
- package/src/util/serializedCache.ts +5 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataColumns.js","sourceRoot":"","sources":["../../src/util/dataColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,mCAAmC,CAAC;AAEvD,OAAO,EAKL,sBAAsB,EACtB,iBAAiB,
|
|
1
|
+
{"version":3,"file":"dataColumns.js","sourceRoot":"","sources":["../../src/util/dataColumns.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,IAAI,EAAC,MAAM,mCAAmC,CAAC;AAEvD,OAAO,EAKL,sBAAsB,EACtB,iBAAiB,EACjB,eAAe,GAChB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,yBAAyB,EAAC,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAUL,GAAG,GACJ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAC,gBAAgB,EAAC,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAC,UAAU,EAAoB,MAAM,qBAAqB,CAAC;AAGlE,OAAO,EAAC,wBAAwB,EAAC,MAAM,YAAY,CAAC;AACpD,OAAO,EAAC,GAAG,EAAC,MAAM,UAAU,CAAC;AAE7B,MAAM,CAAN,IAAY,aAWX;AAXD,WAAY,aAAa;IACvB,yFAAyF;IACzF,0EAAyD,CAAA;IACzD,gEAAgE;IAChE,wDAAuC,CAAA;IACvC,6DAA6D;IAC7D,qDAAoC,CAAA;IACpC,0GAA0G;IAC1G,6CAA4B,CAAA;IAC5B,qBAAqB;IACrB,kCAAiB,CAAA;AACnB,CAAC,EAXW,aAAa,KAAb,aAAa,QAWxB;AAQD,MAAM,OAAO,aAAa;IACxB;;OAEG;IACH,uBAAuB,CAAS;IAEhC;;OAEG;IACH,cAAc,CAAgB;IAE9B;;;OAGG;IACH,mBAAmB,CAAa;IAEhC;;OAEG;IACH,iBAAiB,CAAS;IA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CAAC;gBACnB,YAAY,EAAE,UAAU,CAAC,YAAY;gBACrC,aAAa;gBACb,gBAAgB,EAAE,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI;gBACnC,MAAM,EAAE,gBAAgB,CAAC,QAAQ;aAClC,CAAC,CAAC;YACH,iBAAiB,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,kBAAkB,EAAE,iBAAiB,CAAC,CAAC;IAE/D,OAAO,4BAA4B,CAAC,eAAe,CAAC;AACtD,CAAC;AAED,MAAM,CAAN,IAAY,4BAOX;AAPD,WAAY,4BAA4B;IACtC,8EAA8C,CAAA;IAC9C,6FAA6D,CAAA;IAC7D,8DAA8B,CAAA;IAC9B,4DAA4B,CAAA;IAC5B,oEAAoC,CAAA;IACpC,iDAAiB,CAAA;AACnB,CAAC,EAPW,4BAA4B,KAA5B,4BAA4B,QAOvC"}
|
|
@@ -7,6 +7,11 @@ export declare class SerializedCache {
|
|
|
7
7
|
map: WeakMap<object, Uint8Array>;
|
|
8
8
|
get(obj: object): Uint8Array | undefined;
|
|
9
9
|
set(obj: object, serialized: Uint8Array): void;
|
|
10
|
+
/**
|
|
11
|
+
* Replace the internal WeakMap to force GC of all cached entries.
|
|
12
|
+
* Must only be called after all DB writes that may read from this cache have completed,
|
|
13
|
+
* otherwise cached serialized bytes will be unavailable and data will be re-serialized unnecessarily.
|
|
14
|
+
*/
|
|
10
15
|
clear(): void;
|
|
11
16
|
}
|
|
12
17
|
//# sourceMappingURL=serializedCache.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializedCache.d.ts","sourceRoot":"","sources":["../../src/util/serializedCache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAiB;IAEjD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI;IAI9C,KAAK,IAAI,IAAI;CAGd"}
|
|
1
|
+
{"version":3,"file":"serializedCache.d.ts","sourceRoot":"","sources":["../../src/util/serializedCache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,qBAAa,eAAe;IAC1B,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,UAAU,CAAC,CAAiB;IAEjD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS;IAIxC,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,GAAG,IAAI;IAI9C;;;;OAIG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -11,6 +11,11 @@ export class SerializedCache {
|
|
|
11
11
|
set(obj, serialized) {
|
|
12
12
|
this.map.set(obj, serialized);
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Replace the internal WeakMap to force GC of all cached entries.
|
|
16
|
+
* Must only be called after all DB writes that may read from this cache have completed,
|
|
17
|
+
* otherwise cached serialized bytes will be unavailable and data will be re-serialized unnecessarily.
|
|
18
|
+
*/
|
|
14
19
|
clear() {
|
|
15
20
|
this.map = new WeakMap();
|
|
16
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializedCache.js","sourceRoot":"","sources":["../../src/util/serializedCache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,eAAe;IAC1B,GAAG,GAAgC,IAAI,OAAO,EAAE,CAAC;IAEjD,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,UAAsB;QACrC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAChC,CAAC;IAED,KAAK;QACH,IAAI,CAAC,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
|
1
|
+
{"version":3,"file":"serializedCache.js","sourceRoot":"","sources":["../../src/util/serializedCache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,OAAO,eAAe;IAC1B,GAAG,GAAgC,IAAI,OAAO,EAAE,CAAC;IAEjD,GAAG,CAAC,GAAW;QACb,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;IAED,GAAG,CAAC,GAAW,EAAE,UAAsB;QACrC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC;IAChC,CAAC;IAED;;;;OAIG;IACH,KAAK;QACH,IAAI,CAAC,GAAG,GAAG,IAAI,OAAO,EAAE,CAAC;IAC3B,CAAC;CACF"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.
|
|
14
|
+
"version": "1.41.0-dev.07f3dcc477",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -134,18 +134,18 @@
|
|
|
134
134
|
"@libp2p/peer-id": "^5.1.0",
|
|
135
135
|
"@libp2p/prometheus-metrics": "^4.3.15",
|
|
136
136
|
"@libp2p/tcp": "^10.1.8",
|
|
137
|
-
"@lodestar/api": "^1.
|
|
138
|
-
"@lodestar/config": "^1.
|
|
139
|
-
"@lodestar/db": "^1.
|
|
140
|
-
"@lodestar/fork-choice": "^1.
|
|
141
|
-
"@lodestar/light-client": "^1.
|
|
142
|
-
"@lodestar/logger": "^1.
|
|
143
|
-
"@lodestar/params": "^1.
|
|
144
|
-
"@lodestar/reqresp": "^1.
|
|
145
|
-
"@lodestar/state-transition": "^1.
|
|
146
|
-
"@lodestar/types": "^1.
|
|
147
|
-
"@lodestar/utils": "^1.
|
|
148
|
-
"@lodestar/validator": "^1.
|
|
137
|
+
"@lodestar/api": "^1.41.0-dev.07f3dcc477",
|
|
138
|
+
"@lodestar/config": "^1.41.0-dev.07f3dcc477",
|
|
139
|
+
"@lodestar/db": "^1.41.0-dev.07f3dcc477",
|
|
140
|
+
"@lodestar/fork-choice": "^1.41.0-dev.07f3dcc477",
|
|
141
|
+
"@lodestar/light-client": "^1.41.0-dev.07f3dcc477",
|
|
142
|
+
"@lodestar/logger": "^1.41.0-dev.07f3dcc477",
|
|
143
|
+
"@lodestar/params": "^1.41.0-dev.07f3dcc477",
|
|
144
|
+
"@lodestar/reqresp": "^1.41.0-dev.07f3dcc477",
|
|
145
|
+
"@lodestar/state-transition": "^1.41.0-dev.07f3dcc477",
|
|
146
|
+
"@lodestar/types": "^1.41.0-dev.07f3dcc477",
|
|
147
|
+
"@lodestar/utils": "^1.41.0-dev.07f3dcc477",
|
|
148
|
+
"@lodestar/validator": "^1.41.0-dev.07f3dcc477",
|
|
149
149
|
"@multiformats/multiaddr": "^12.1.3",
|
|
150
150
|
"datastore-core": "^10.0.2",
|
|
151
151
|
"datastore-fs": "^10.0.6",
|
|
@@ -169,7 +169,7 @@
|
|
|
169
169
|
"@chainsafe/swap-or-not-shuffle": "^1.2.1",
|
|
170
170
|
"@libp2p/interface-internal": "^2.3.18",
|
|
171
171
|
"@libp2p/logger": "^5.1.21",
|
|
172
|
-
"@lodestar/spec-test-util": "^1.
|
|
172
|
+
"@lodestar/spec-test-util": "^1.41.0-dev.07f3dcc477",
|
|
173
173
|
"@types/js-yaml": "^4.0.5",
|
|
174
174
|
"@types/qs": "^6.9.7",
|
|
175
175
|
"@types/tmp": "^0.2.3",
|
|
@@ -188,5 +188,5 @@
|
|
|
188
188
|
"beacon",
|
|
189
189
|
"blockchain"
|
|
190
190
|
],
|
|
191
|
-
"gitHead": "
|
|
191
|
+
"gitHead": "7d2403a78934b37d982aebf9a26a2bb77f03c90c"
|
|
192
192
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
3
3
|
import {MAX_REQUEST_LIGHT_CLIENT_COMMITTEE_HASHES, MAX_REQUEST_LIGHT_CLIENT_UPDATES} from "@lodestar/params";
|
|
4
|
+
import type {LightClientUpdate} from "@lodestar/types";
|
|
4
5
|
import {fromHex} from "@lodestar/utils";
|
|
6
|
+
import {LightClientServerError, LightClientServerErrorCode} from "../../../chain/errors/lightClientError.js";
|
|
5
7
|
import {assertLightClientServer} from "../../../node/utils/lightclient.js";
|
|
6
8
|
import {ApiModules} from "../types.js";
|
|
7
9
|
// TODO: Import from lightclient/server package
|
|
@@ -16,8 +18,23 @@ export function getLightclientApi({
|
|
|
16
18
|
assertLightClientServer(lightClientServer);
|
|
17
19
|
|
|
18
20
|
const maxAllowedCount = Math.min(MAX_REQUEST_LIGHT_CLIENT_UPDATES, count);
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
+
const updates: LightClientUpdate[] = [];
|
|
22
|
+
for (let i = 0; i < maxAllowedCount; i++) {
|
|
23
|
+
try {
|
|
24
|
+
const update = await lightClientServer.getUpdate(startPeriod + i);
|
|
25
|
+
updates.push(update);
|
|
26
|
+
} catch (e) {
|
|
27
|
+
if ((e as LightClientServerError).type?.code === LightClientServerErrorCode.RESOURCE_UNAVAILABLE) {
|
|
28
|
+
// Period not available, if we already have results, stop to preserve
|
|
29
|
+
// consecutive order. If not, skip and try the next period.
|
|
30
|
+
if (updates.length > 0) break;
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
// Unexpected error
|
|
34
|
+
throw e;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
21
38
|
return {
|
|
22
39
|
data: updates,
|
|
23
40
|
meta: {versions: updates.map((update) => config.getForkName(update.attestedHeader.beacon.slot))},
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ApplicationMethods} from "@lodestar/api/server";
|
|
3
|
+
import {ClientCode, ClientVersion} from "../../../execution/index.js";
|
|
4
|
+
import {getLodestarClientVersion} from "../../../util/metadata.js";
|
|
3
5
|
import {ApiOptions} from "../../options.js";
|
|
4
6
|
import {ApiError} from "../errors.js";
|
|
5
7
|
import {ApiModules} from "../types.js";
|
|
6
8
|
|
|
7
9
|
export function getNodeApi(
|
|
8
10
|
opts: ApiOptions,
|
|
9
|
-
{network, sync}: Pick<ApiModules, "network" | "sync">
|
|
11
|
+
{network, sync, chain}: Pick<ApiModules, "network" | "sync" | "chain">
|
|
10
12
|
): ApplicationMethods<routes.node.Endpoints> {
|
|
11
13
|
return {
|
|
12
14
|
async getNetworkIdentity() {
|
|
@@ -62,6 +64,20 @@ export function getNodeApi(
|
|
|
62
64
|
};
|
|
63
65
|
},
|
|
64
66
|
|
|
67
|
+
async getNodeVersionV2() {
|
|
68
|
+
const {clientVersion} = chain.executionEngine;
|
|
69
|
+
|
|
70
|
+
return {
|
|
71
|
+
data: {
|
|
72
|
+
beaconNode: toSpecClientVersion(getLodestarClientVersion(opts)),
|
|
73
|
+
executionClient:
|
|
74
|
+
clientVersion != null && clientVersion.code !== ClientCode.XX
|
|
75
|
+
? toSpecClientVersion(clientVersion)
|
|
76
|
+
: undefined,
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
},
|
|
80
|
+
|
|
65
81
|
async getSyncingStatus() {
|
|
66
82
|
return {data: sync.getSyncStatus()};
|
|
67
83
|
},
|
|
@@ -86,3 +102,8 @@ export function getNodeApi(
|
|
|
86
102
|
},
|
|
87
103
|
};
|
|
88
104
|
}
|
|
105
|
+
|
|
106
|
+
/** Prefix commit with 0x as required by the beacon-APIs spec */
|
|
107
|
+
function toSpecClientVersion(cv: ClientVersion): routes.node.ClientVersion {
|
|
108
|
+
return {...cv, commit: `0x${cv.commit}`};
|
|
109
|
+
}
|
|
@@ -101,9 +101,6 @@ export async function importBlock(
|
|
|
101
101
|
}
|
|
102
102
|
});
|
|
103
103
|
|
|
104
|
-
// Without forcefully clearing this cache, we would rely on WeakMap to evict memory which is not reliable
|
|
105
|
-
this.serializedCache.clear();
|
|
106
|
-
|
|
107
104
|
// 2. Import block to fork choice
|
|
108
105
|
|
|
109
106
|
// Should compute checkpoint balances before forkchoice.onBlock
|
|
@@ -125,6 +125,9 @@ export async function persistBlockInputs(this: BeaconChain, blockInputs: IBlockI
|
|
|
125
125
|
for (const blockInput of blockInputs) {
|
|
126
126
|
this.seenBlockInputCache.prune(blockInput.blockRootHex);
|
|
127
127
|
}
|
|
128
|
+
// Without forcefully clearing this cache, we would rely on WeakMap to evict memory which is not reliable.
|
|
129
|
+
// Clear here (after the DB write) so that writeBlockInputToDb can still use the cached serialized bytes.
|
|
130
|
+
this.serializedCache.clear();
|
|
128
131
|
if (blockInputs.length === 1) {
|
|
129
132
|
this.logger.debug("Pruned block input", {
|
|
130
133
|
slot: blockInputs[0].slot,
|
|
@@ -68,6 +68,8 @@ export enum BlockErrorCode {
|
|
|
68
68
|
DATA_UNAVAILABLE = "BLOCK_ERROR_DATA_UNAVAILABLE",
|
|
69
69
|
/** Block contains too many kzg commitments */
|
|
70
70
|
TOO_MANY_KZG_COMMITMENTS = "BLOCK_ERROR_TOO_MANY_KZG_COMMITMENTS",
|
|
71
|
+
/** Bid parent block root does not match block parent root */
|
|
72
|
+
BID_PARENT_ROOT_MISMATCH = "BLOCK_ERROR_BID_PARENT_ROOT_MISMATCH",
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
type ExecutionErrorStatus = Exclude<
|
|
@@ -111,7 +113,8 @@ export type BlockErrorType =
|
|
|
111
113
|
| {code: BlockErrorCode.TRANSACTIONS_TOO_BIG; size: number; max: number}
|
|
112
114
|
| {code: BlockErrorCode.EXECUTION_ENGINE_ERROR; execStatus: ExecutionErrorStatus; errorMessage: string}
|
|
113
115
|
| {code: BlockErrorCode.DATA_UNAVAILABLE}
|
|
114
|
-
| {code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS; blobKzgCommitmentsLen: number; commitmentLimit: number}
|
|
116
|
+
| {code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS; blobKzgCommitmentsLen: number; commitmentLimit: number}
|
|
117
|
+
| {code: BlockErrorCode.BID_PARENT_ROOT_MISMATCH; bidParentRoot: RootHex; blockParentRoot: RootHex};
|
|
115
118
|
|
|
116
119
|
export class BlockGossipError extends GossipActionError<BlockErrorType> {}
|
|
117
120
|
|
|
@@ -355,7 +355,10 @@ export class LightClientServer {
|
|
|
355
355
|
// Signature data
|
|
356
356
|
const update = await this.db.bestLightClientUpdate.get(period);
|
|
357
357
|
if (!update) {
|
|
358
|
-
throw
|
|
358
|
+
throw new LightClientServerError(
|
|
359
|
+
{code: LightClientServerErrorCode.RESOURCE_UNAVAILABLE},
|
|
360
|
+
`No partialUpdate available for period ${period}`
|
|
361
|
+
);
|
|
359
362
|
}
|
|
360
363
|
return update;
|
|
361
364
|
}
|
|
@@ -9,8 +9,8 @@ import {
|
|
|
9
9
|
isExecutionEnabled,
|
|
10
10
|
isExecutionStateType,
|
|
11
11
|
} from "@lodestar/state-transition";
|
|
12
|
-
import {SignedBeaconBlock, deneb} from "@lodestar/types";
|
|
13
|
-
import {sleep, toRootHex} from "@lodestar/utils";
|
|
12
|
+
import {SignedBeaconBlock, deneb, gloas} from "@lodestar/types";
|
|
13
|
+
import {byteArrayEquals, sleep, toRootHex} from "@lodestar/utils";
|
|
14
14
|
import {BlockErrorCode, BlockGossipError, GossipAction} from "../errors/index.js";
|
|
15
15
|
import {IBeaconChain} from "../interface.js";
|
|
16
16
|
import {RegenCaller} from "../regen/index.js";
|
|
@@ -23,6 +23,7 @@ export async function validateGossipBlock(
|
|
|
23
23
|
): Promise<void> {
|
|
24
24
|
const block = signedBlock.message;
|
|
25
25
|
const blockSlot = block.slot;
|
|
26
|
+
const blockEpoch = computeEpochAtSlot(blockSlot);
|
|
26
27
|
|
|
27
28
|
// [IGNORE] The block is not from a future slot (with a MAXIMUM_GOSSIP_CLOCK_DISPARITY allowance) -- i.e.validate
|
|
28
29
|
// that signed_beacon_block.message.slot <= current_slot (a client MAY queue future blocks for processing at the
|
|
@@ -113,7 +114,7 @@ export async function validateGossipBlock(
|
|
|
113
114
|
// [REJECT] The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer -- i.e. validate that len(body.signed_beacon_block.message.blob_kzg_commitments) <= MAX_BLOBS_PER_BLOCK
|
|
114
115
|
if (isForkPostDeneb(fork) && !isForkPostGloas(fork)) {
|
|
115
116
|
const blobKzgCommitmentsLen = (block as deneb.BeaconBlock).body.blobKzgCommitments.length;
|
|
116
|
-
const maxBlobsPerBlock = config.getMaxBlobsPerBlock(
|
|
117
|
+
const maxBlobsPerBlock = config.getMaxBlobsPerBlock(blockEpoch);
|
|
117
118
|
if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
|
|
118
119
|
throw new BlockGossipError(GossipAction.REJECT, {
|
|
119
120
|
code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS,
|
|
@@ -123,12 +124,39 @@ export async function validateGossipBlock(
|
|
|
123
124
|
}
|
|
124
125
|
}
|
|
125
126
|
|
|
127
|
+
if (isForkPostGloas(fork)) {
|
|
128
|
+
const bid = (block as gloas.BeaconBlock).body.signedExecutionPayloadBid.message;
|
|
129
|
+
|
|
130
|
+
// [REJECT] The length of KZG commitments is less than or equal to the limitation defined in Consensus Layer
|
|
131
|
+
// -- i.e. validate that len(bid.blob_kzg_commitments) <= max_blobs_per_block
|
|
132
|
+
const blobKzgCommitmentsLen = bid.blobKzgCommitments.length;
|
|
133
|
+
const maxBlobsPerBlock = config.getMaxBlobsPerBlock(blockEpoch);
|
|
134
|
+
if (blobKzgCommitmentsLen > maxBlobsPerBlock) {
|
|
135
|
+
throw new BlockGossipError(GossipAction.REJECT, {
|
|
136
|
+
code: BlockErrorCode.TOO_MANY_KZG_COMMITMENTS,
|
|
137
|
+
blobKzgCommitmentsLen,
|
|
138
|
+
commitmentLimit: maxBlobsPerBlock,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// [REJECT] The bid's parent (defined by bid.parent_block_root) equals the block's parent (defined by block.parent_root)
|
|
143
|
+
if (!byteArrayEquals(bid.parentBlockRoot, block.parentRoot)) {
|
|
144
|
+
throw new BlockGossipError(GossipAction.REJECT, {
|
|
145
|
+
code: BlockErrorCode.BID_PARENT_ROOT_MISMATCH,
|
|
146
|
+
bidParentRoot: toRootHex(bid.parentBlockRoot),
|
|
147
|
+
blockParentRoot: parentRoot,
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
// TODO GLOAS: [REJECT] The block's execution payload parent (defined by bid.parent_block_hash) passes all validation
|
|
152
|
+
// This requires execution engine integration to verify the parent block hash
|
|
153
|
+
}
|
|
154
|
+
|
|
126
155
|
// use getPreState to reload state if needed. It also checks for whether the current finalized checkpoint is an ancestor of the block.
|
|
127
156
|
// As a result, we throw an IGNORE (whereas the spec says we should REJECT for this scenario).
|
|
128
157
|
// this is something we should change this in the future to make the code airtight to the spec.
|
|
129
158
|
// [IGNORE] The block's parent (defined by block.parent_root) has been seen (via both gossip and non-gossip sources) (a client MAY queue blocks for processing once the parent block is retrieved).
|
|
130
159
|
// [REJECT] The block's parent (defined by block.parent_root) passes validation.
|
|
131
|
-
// TODO GLOAS: post-gloas, we check the validity of bid's parent payload, not the entire beacon block
|
|
132
160
|
const blockState = await chain.regen
|
|
133
161
|
.getPreState(block, {dontTransferCache: true}, RegenCaller.validateGossipBlock)
|
|
134
162
|
.catch(() => {
|
|
@@ -35,7 +35,8 @@ async function validateExecutionPayloadEnvelope(
|
|
|
35
35
|
// [IGNORE] The envelope's block root `envelope.block_root` has been seen (via
|
|
36
36
|
// gossip or non-gossip sources) (a client MAY queue payload for processing once
|
|
37
37
|
// the block is retrieved).
|
|
38
|
-
// TODO GLOAS: Need to review this
|
|
38
|
+
// TODO GLOAS: Need to review this, we should queue the envelope for later
|
|
39
|
+
// processing if the block is not yet known, otherwise we would ignore it here
|
|
39
40
|
const block = chain.forkChoice.getBlock(envelope.beaconBlockRoot);
|
|
40
41
|
if (block === null) {
|
|
41
42
|
throw new ExecutionPayloadEnvelopeError(GossipAction.IGNORE, {
|
|
@@ -89,7 +89,7 @@ async function validatePayloadAttestationMessage(
|
|
|
89
89
|
// [REJECT] `payload_attestation_message.signature` is valid with respect to the validator's public key.
|
|
90
90
|
const signatureSet = createSingleSignatureSetFromComponents(
|
|
91
91
|
chain.index2pubkey[validatorIndex],
|
|
92
|
-
getPayloadAttestationDataSigningRoot(chain.config,
|
|
92
|
+
getPayloadAttestationDataSigningRoot(chain.config, data),
|
|
93
93
|
payloadAttestationMessage.signature
|
|
94
94
|
);
|
|
95
95
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import {routes} from "@lodestar/api";
|
|
1
2
|
import {
|
|
2
3
|
CONSOLIDATION_REQUEST_TYPE,
|
|
3
4
|
DEPOSIT_REQUEST_TYPE,
|
|
@@ -14,6 +15,8 @@ import {ExecutionPayloadBody} from "./types.js";
|
|
|
14
15
|
import {DATA} from "./utils.js";
|
|
15
16
|
|
|
16
17
|
export {PayloadIdCache, type PayloadId, type WithdrawalV1};
|
|
18
|
+
export type ClientVersion = routes.node.ClientVersion;
|
|
19
|
+
export const ClientCode = routes.node.ClientCode;
|
|
17
20
|
|
|
18
21
|
export enum ExecutionPayloadStatus {
|
|
19
22
|
/** given payload is valid */
|
|
@@ -45,26 +48,6 @@ export enum ExecutionEngineState {
|
|
|
45
48
|
AUTH_FAILED = "AUTH_FAILED",
|
|
46
49
|
}
|
|
47
50
|
|
|
48
|
-
/**
|
|
49
|
-
* Client code as defined in https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/identification.md#clientcode
|
|
50
|
-
* ClientCode.XX is dedicated to other clients which do not have their own code
|
|
51
|
-
*/
|
|
52
|
-
export enum ClientCode {
|
|
53
|
-
BU = "BU", // besu
|
|
54
|
-
EJ = "EJ", // ethereumJS
|
|
55
|
-
EG = "EG", // erigon
|
|
56
|
-
GE = "GE", // go-ethereum
|
|
57
|
-
GR = "GR", // grandine
|
|
58
|
-
LH = "LH", // lighthouse
|
|
59
|
-
LS = "LS", // lodestar
|
|
60
|
-
NM = "NM", // nethermind
|
|
61
|
-
NB = "NB", // nimbus
|
|
62
|
-
TK = "TK", // teku
|
|
63
|
-
PM = "PM", // prysm
|
|
64
|
-
RH = "RH", // reth
|
|
65
|
-
XX = "XX", // unknown
|
|
66
|
-
}
|
|
67
|
-
|
|
68
51
|
export type ExecutionRequestType =
|
|
69
52
|
| typeof DEPOSIT_REQUEST_TYPE
|
|
70
53
|
| typeof WITHDRAWAL_REQUEST_TYPE
|
|
@@ -106,13 +89,6 @@ export type PayloadAttributes = {
|
|
|
106
89
|
parentBeaconBlockRoot?: Uint8Array;
|
|
107
90
|
};
|
|
108
91
|
|
|
109
|
-
export type ClientVersion = {
|
|
110
|
-
code: ClientCode;
|
|
111
|
-
name: string;
|
|
112
|
-
version: string;
|
|
113
|
-
commit: string;
|
|
114
|
-
};
|
|
115
|
-
|
|
116
92
|
export type VersionedHashes = Uint8Array[];
|
|
117
93
|
|
|
118
94
|
/**
|
package/src/metrics/metrics.ts
CHANGED
|
@@ -19,11 +19,16 @@ export function createMetrics(opts: MetricsOptions, genesisTime: number, externa
|
|
|
19
19
|
const lodestar = createLodestarMetrics(register, opts.metadata, genesisTime);
|
|
20
20
|
const stateTransition = getMetrics(register);
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
const onUnhandledRejection = (_error: unknown): void => {
|
|
23
23
|
lodestar.unhandledPromiseRejections.inc();
|
|
24
|
-
}
|
|
24
|
+
};
|
|
25
|
+
process.on("unhandledRejection", onUnhandledRejection);
|
|
25
26
|
|
|
26
|
-
const
|
|
27
|
+
const nodeJsMetricsClose = collectNodeJSMetrics(register);
|
|
28
|
+
const close = (): void => {
|
|
29
|
+
process.removeListener("unhandledRejection", onUnhandledRejection);
|
|
30
|
+
nodeJsMetricsClose();
|
|
31
|
+
};
|
|
27
32
|
|
|
28
33
|
// Merge external registries
|
|
29
34
|
for (const externalRegister of externalRegistries) {
|
|
@@ -19,6 +19,7 @@ export async function* onLightClientUpdatesByRange(
|
|
|
19
19
|
assertLightClientServer(chain.lightClientServer);
|
|
20
20
|
|
|
21
21
|
const count = Math.min(MAX_REQUEST_LIGHT_CLIENT_UPDATES, requestBody.count);
|
|
22
|
+
let started = false;
|
|
22
23
|
for (let period = requestBody.startPeriod; period < requestBody.startPeriod + count; period++) {
|
|
23
24
|
try {
|
|
24
25
|
const update = await chain.lightClientServer.getUpdate(period);
|
|
@@ -29,9 +30,13 @@ export async function* onLightClientUpdatesByRange(
|
|
|
29
30
|
data: type.serialize(update),
|
|
30
31
|
boundary,
|
|
31
32
|
};
|
|
33
|
+
started = true;
|
|
32
34
|
} catch (e) {
|
|
33
35
|
if ((e as LightClientServerError).type?.code === LightClientServerErrorCode.RESOURCE_UNAVAILABLE) {
|
|
34
|
-
|
|
36
|
+
// Period not available, if we already started yielding, stop to
|
|
37
|
+
// preserve consecutive order. Otherwise skip leading gaps.
|
|
38
|
+
if (started) return;
|
|
39
|
+
continue;
|
|
35
40
|
}
|
|
36
41
|
throw new ResponseError(RespStatus.SERVER_ERROR, (e as Error).message);
|
|
37
42
|
}
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
|
-
import {
|
|
3
|
-
ForkPostDeneb,
|
|
4
|
-
ForkPostFulu,
|
|
5
|
-
ForkPreFulu,
|
|
6
|
-
ForkPreGloas,
|
|
7
|
-
isForkPostFulu,
|
|
8
|
-
isForkPostGloas,
|
|
9
|
-
} from "@lodestar/params";
|
|
2
|
+
import {ForkPostDeneb, ForkPostFulu, ForkPreFulu, isForkPostFulu} from "@lodestar/params";
|
|
10
3
|
import {SignedBeaconBlock, Slot, deneb, fulu, phase0} from "@lodestar/types";
|
|
11
4
|
import {LodestarError, Logger, byteArrayEquals, fromHex, prettyPrintIndices, toRootHex} from "@lodestar/utils";
|
|
12
5
|
import {
|
|
@@ -20,6 +13,7 @@ import {SeenBlockInput} from "../../chain/seenCache/seenGossipBlockInput.js";
|
|
|
20
13
|
import {validateBlockBlobSidecars} from "../../chain/validation/blobSidecar.js";
|
|
21
14
|
import {validateBlockDataColumnSidecars} from "../../chain/validation/dataColumnSidecar.js";
|
|
22
15
|
import {INetwork} from "../../network/index.js";
|
|
16
|
+
import {getBlobKzgCommitments} from "../../util/dataColumns.js";
|
|
23
17
|
import {PeerIdStr} from "../../util/peerId.js";
|
|
24
18
|
import {WarnResult} from "../../util/wrapError.js";
|
|
25
19
|
|
|
@@ -695,13 +689,7 @@ export async function validateColumnsByRangeResponse(
|
|
|
695
689
|
dataFork: dataSlot ? config.getForkName(dataSlot) : "unknown",
|
|
696
690
|
});
|
|
697
691
|
}
|
|
698
|
-
|
|
699
|
-
// TODO GLOAS: Post-gloas's blobKzgCommitments is not in beacon block body. Need to source it from somewhere else.
|
|
700
|
-
// if block without columns is passed default to zero and throw below
|
|
701
|
-
blobCount = 0;
|
|
702
|
-
} else {
|
|
703
|
-
blobCount = (block as SignedBeaconBlock<ForkPostFulu & ForkPreGloas>).message.body.blobKzgCommitments.length;
|
|
704
|
-
}
|
|
692
|
+
blobCount = getBlobKzgCommitments(forkName, block as SignedBeaconBlock<ForkPostFulu>).length;
|
|
705
693
|
|
|
706
694
|
if (columnSidecars.length === 0) {
|
|
707
695
|
if (!blobCount) {
|
|
@@ -1,14 +1,7 @@
|
|
|
1
1
|
import {routes} from "@lodestar/api";
|
|
2
2
|
import {ChainForkConfig} from "@lodestar/config";
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
ForkPostFulu,
|
|
6
|
-
ForkPreFulu,
|
|
7
|
-
ForkPreGloas,
|
|
8
|
-
isForkPostDeneb,
|
|
9
|
-
isForkPostFulu,
|
|
10
|
-
} from "@lodestar/params";
|
|
11
|
-
import {BeaconBlockBody, BlobIndex, ColumnIndex, SignedBeaconBlock, Slot, deneb, fulu} from "@lodestar/types";
|
|
3
|
+
import {ForkPostDeneb, ForkPostFulu, ForkPreFulu, isForkPostDeneb, isForkPostFulu} from "@lodestar/params";
|
|
4
|
+
import {BlobIndex, ColumnIndex, SignedBeaconBlock, Slot, deneb, fulu} from "@lodestar/types";
|
|
12
5
|
import {LodestarError, byteArrayEquals, fromHex, prettyPrintIndices, toHex, toRootHex} from "@lodestar/utils";
|
|
13
6
|
import {isBlockInputBlobs, isBlockInputColumns} from "../../chain/blocks/blockInput/blockInput.js";
|
|
14
7
|
import {BlockInputSource, IBlockInput} from "../../chain/blocks/blockInput/types.js";
|
|
@@ -19,6 +12,7 @@ import {validateBlockDataColumnSidecars} from "../../chain/validation/dataColumn
|
|
|
19
12
|
import {INetwork} from "../../network/interface.js";
|
|
20
13
|
import {PeerSyncMeta} from "../../network/peers/peersData.js";
|
|
21
14
|
import {prettyPrintPeerIdStr} from "../../network/util.js";
|
|
15
|
+
import {getBlobKzgCommitments} from "../../util/dataColumns.js";
|
|
22
16
|
import {PeerIdStr} from "../../util/peerId.js";
|
|
23
17
|
import {WarnResult} from "../../util/wrapError.js";
|
|
24
18
|
import {
|
|
@@ -378,14 +372,14 @@ export async function fetchAndValidateColumns({
|
|
|
378
372
|
chain,
|
|
379
373
|
network,
|
|
380
374
|
peerMeta,
|
|
375
|
+
forkName,
|
|
381
376
|
block,
|
|
382
377
|
blockRoot,
|
|
383
378
|
missing,
|
|
384
379
|
}: FetchByRootAndValidateColumnsProps): Promise<WarnResult<fulu.DataColumnSidecars, DownloadByRootError>> {
|
|
385
380
|
const {peerId: peerIdStr} = peerMeta;
|
|
386
381
|
const slot = block.message.slot;
|
|
387
|
-
|
|
388
|
-
const blobCount = (block.message.body as BeaconBlockBody<ForkPostFulu & ForkPreGloas>).blobKzgCommitments.length;
|
|
382
|
+
const blobCount = getBlobKzgCommitments(forkName, block).length;
|
|
389
383
|
if (blobCount === 0) {
|
|
390
384
|
return {result: [], warnings: null};
|
|
391
385
|
}
|
package/src/util/dataColumns.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
ForkPreGloas,
|
|
9
9
|
KZG_COMMITMENTS_GINDEX,
|
|
10
10
|
NUMBER_OF_COLUMNS,
|
|
11
|
+
isForkPostGloas,
|
|
11
12
|
} from "@lodestar/params";
|
|
12
13
|
import {signedBlockToSignedHeader} from "@lodestar/state-transition";
|
|
13
14
|
import {
|
|
@@ -19,6 +20,7 @@ import {
|
|
|
19
20
|
SignedBeaconBlockHeader,
|
|
20
21
|
deneb,
|
|
21
22
|
fulu,
|
|
23
|
+
gloas,
|
|
22
24
|
ssz,
|
|
23
25
|
} from "@lodestar/types";
|
|
24
26
|
import {bytesToBigInt} from "@lodestar/utils";
|
|
@@ -261,6 +263,20 @@ export async function getCellsAndProofs(
|
|
|
261
263
|
return blobsAndProofs;
|
|
262
264
|
}
|
|
263
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Get blob KZG commitments from a signed block, handling the different locations
|
|
268
|
+
* in pre-Gloas (directly in block body) vs post-Gloas (in execution payload bid).
|
|
269
|
+
*/
|
|
270
|
+
export function getBlobKzgCommitments(
|
|
271
|
+
fork: ForkName,
|
|
272
|
+
signedBlock: SignedBeaconBlock<ForkPostFulu>
|
|
273
|
+
): deneb.KZGCommitment[] {
|
|
274
|
+
if (isForkPostGloas(fork)) {
|
|
275
|
+
return (signedBlock as gloas.SignedBeaconBlock).message.body.signedExecutionPayloadBid.message.blobKzgCommitments;
|
|
276
|
+
}
|
|
277
|
+
return (signedBlock.message.body as BeaconBlockBody<ForkPostFulu & ForkPreGloas>).blobKzgCommitments;
|
|
278
|
+
}
|
|
279
|
+
|
|
264
280
|
/**
|
|
265
281
|
* Given a signed block header and the commitments, inclusion proof, cells/proofs associated with
|
|
266
282
|
* each blob in the block, assemble the sidecars which can be distributed to peers.
|
|
@@ -310,16 +326,13 @@ export function getDataColumnSidecarsFromBlock(
|
|
|
310
326
|
signedBlock: SignedBeaconBlock<ForkPostFulu>,
|
|
311
327
|
cellsAndKzgProofs: {cells: Uint8Array[]; proofs: Uint8Array[]}[]
|
|
312
328
|
): fulu.DataColumnSidecars {
|
|
313
|
-
|
|
314
|
-
const blobKzgCommitments = (signedBlock
|
|
315
|
-
.blobKzgCommitments;
|
|
329
|
+
const fork = config.getForkName(signedBlock.message.slot);
|
|
330
|
+
const blobKzgCommitments = getBlobKzgCommitments(fork, signedBlock);
|
|
316
331
|
|
|
317
332
|
// No need to create data column sidecars if there are no blobs
|
|
318
333
|
if (blobKzgCommitments.length === 0) {
|
|
319
334
|
return [];
|
|
320
335
|
}
|
|
321
|
-
|
|
322
|
-
const fork = config.getForkName(signedBlock.message.slot);
|
|
323
336
|
const signedBlockHeader = signedBlockToSignedHeader(config, signedBlock);
|
|
324
337
|
|
|
325
338
|
const kzgCommitmentsInclusionProof = computePostFuluKzgCommitmentsInclusionProof(fork, signedBlock.message.body);
|
|
@@ -14,6 +14,11 @@ export class SerializedCache {
|
|
|
14
14
|
this.map.set(obj, serialized);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Replace the internal WeakMap to force GC of all cached entries.
|
|
19
|
+
* Must only be called after all DB writes that may read from this cache have completed,
|
|
20
|
+
* otherwise cached serialized bytes will be unavailable and data will be re-serialized unnecessarily.
|
|
21
|
+
*/
|
|
17
22
|
clear(): void {
|
|
18
23
|
this.map = new WeakMap();
|
|
19
24
|
}
|