@lodestar/beacon-node 1.51.0-dev.4e12403e39 → 1.51.0-dev.50ed45c251
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/validator/index.d.ts.map +1 -1
- package/lib/api/impl/validator/index.js +4 -1
- package/lib/api/impl/validator/index.js.map +1 -1
- package/lib/chain/GetBlobsTracker.d.ts +11 -0
- package/lib/chain/GetBlobsTracker.d.ts.map +1 -1
- package/lib/chain/GetBlobsTracker.js +83 -27
- package/lib/chain/GetBlobsTracker.js.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts +4 -0
- package/lib/chain/archiveStore/utils/archiveBlocks.d.ts.map +1 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js +7 -1
- package/lib/chain/archiveStore/utils/archiveBlocks.js.map +1 -1
- package/lib/chain/blocks/importExecutionPayload.js +1 -1
- package/lib/chain/blocks/importExecutionPayload.js.map +1 -1
- package/lib/chain/blocks/index.js +2 -2
- package/lib/chain/blocks/index.js.map +1 -1
- package/lib/chain/blocks/payloadEnvelopeProcessor.d.ts +5 -5
- package/lib/chain/blocks/payloadEnvelopeProcessor.js +5 -5
- package/lib/chain/blocks/verifyBlock.d.ts.map +1 -1
- package/lib/chain/blocks/verifyBlock.js +1 -1
- package/lib/chain/blocks/verifyBlock.js.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts +3 -3
- package/lib/chain/blocks/verifyPayloadsDataAvailability.d.ts.map +1 -1
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js +6 -6
- package/lib/chain/blocks/verifyPayloadsDataAvailability.js.map +1 -1
- package/lib/db/beacon.d.ts +7 -0
- package/lib/db/beacon.d.ts.map +1 -1
- package/lib/db/beacon.js +32 -0
- package/lib/db/beacon.js.map +1 -1
- package/lib/db/dataColumnStore.d.ts +1 -1
- package/lib/db/dataColumnStore.d.ts.map +1 -1
- package/lib/db/dataColumnStore.js +1 -4
- package/lib/db/dataColumnStore.js.map +1 -1
- package/lib/db/interface.d.ts +1 -0
- package/lib/db/interface.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts +6 -0
- package/lib/db/repositories/dataColumnSidecarArchive.d.ts.map +1 -1
- package/lib/db/repositories/dataColumnSidecarArchive.js +19 -0
- package/lib/db/repositories/dataColumnSidecarArchive.js.map +1 -1
- package/lib/node/nodejs.d.ts.map +1 -1
- package/lib/node/nodejs.js +9 -1
- package/lib/node/nodejs.js.map +1 -1
- package/package.json +15 -15
- package/src/api/impl/validator/index.ts +4 -1
- package/src/chain/GetBlobsTracker.ts +95 -38
- package/src/chain/archiveStore/utils/archiveBlocks.ts +12 -4
- package/src/chain/blocks/importExecutionPayload.ts +1 -1
- package/src/chain/blocks/index.ts +6 -2
- package/src/chain/blocks/payloadEnvelopeProcessor.ts +5 -5
- package/src/chain/blocks/verifyBlock.ts +1 -0
- package/src/chain/blocks/verifyPayloadsDataAvailability.ts +7 -6
- package/src/db/beacon.ts +39 -0
- package/src/db/dataColumnStore.ts +2 -4
- package/src/db/interface.ts +2 -0
- package/src/db/repositories/dataColumnSidecarArchive.ts +20 -0
- package/src/node/nodejs.ts +18 -1
|
@@ -12,6 +12,7 @@ const SLOT_BYTE_SIZE = 8;
|
|
|
12
12
|
* Indexed data by `slot` + `columnIndex`
|
|
13
13
|
*/
|
|
14
14
|
export class DataColumnSidecarArchiveRepository extends PrefixedRepository {
|
|
15
|
+
prunedBeforeSlot = null;
|
|
15
16
|
constructor(config, db) {
|
|
16
17
|
const bucket = Bucket.allForks_dataColumnSidecarsArchive;
|
|
17
18
|
// Type won't be used since we select it dynamically based on fork
|
|
@@ -60,5 +61,23 @@ export class DataColumnSidecarArchiveRepository extends PrefixedRepository {
|
|
|
60
61
|
encodeNumberForDbKey(0, COLUMN_INDEX_BYTE_SIZE),
|
|
61
62
|
]);
|
|
62
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* Deletes all entries before `slot`. Prunes only delete from the start of the bucket, so the first prune
|
|
66
|
+
* compacts the range to drop tombstones of earlier runs and later prunes resume where the previous one ended.
|
|
67
|
+
*/
|
|
68
|
+
async pruneBefore(slot) {
|
|
69
|
+
if (this.prunedBeforeSlot === null) {
|
|
70
|
+
await this.db.compactRange(this.wrapKey(this.getMinKeyRaw(0)), this.wrapKey(this.getMinKeyRaw(slot)));
|
|
71
|
+
}
|
|
72
|
+
else if (slot <= this.prunedBeforeSlot) {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
const keys = await this.keys({ gte: { prefix: this.prunedBeforeSlot ?? 0, id: 0 }, lt: { prefix: slot, id: 0 } });
|
|
76
|
+
const slots = [...new Set(keys.map(({ prefix }) => prefix))];
|
|
77
|
+
if (slots.length > 0)
|
|
78
|
+
await this.deleteMany(slots);
|
|
79
|
+
this.prunedBeforeSlot = slot;
|
|
80
|
+
return slots;
|
|
81
|
+
}
|
|
63
82
|
}
|
|
64
83
|
//# sourceMappingURL=dataColumnSidecarArchive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataColumnSidecarArchive.js","sourceRoot":"","sources":["../../../src/db/repositories/dataColumnSidecarArchive.ts"],"names":[],"mappings":"AACA,OAAO,EAAK,kBAAkB,EAAE,oBAAoB,EAAE,oBAAoB,EAAC,MAAM,cAAc,CAAC;AAChG,OAAO,EAAC,iBAAiB,EAAC,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAuC,wBAAwB,EAAE,GAAG,EAAC,MAAM,iBAAiB,CAAC;AACpG,OAAO,EAAC,6BAA6B,EAAC,MAAM,yBAAyB,CAAC;AACtE,OAAO,EAAC,MAAM,EAAE,oBAAoB,EAAC,MAAM,eAAe,CAAC;AAE3D,MAAM,sBAAsB,GAAG,CAAC,CAAC;AACjC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,OAAO,kCAAmC,SAAQ,kBAAwD;
|
|
1
|
+
{"version":3,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;IAC1C,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,YAAY,CAAC;IACpB,GAAG,EAAE,gBAAgB,CAAC;IACtB,OAAO,CAAC,EAAE,mBAAmB,CAAC;IAC9B,IAAI,EAAE,WAAW,CAAC;IAElB,MAAM,EAAE,gBAAgB,CAAC;IACzB,OAAO,CAAC,UAAU,CAAC,CAAkB;IAErC,YAAY,EACV,IAAI,EACJ,MAAM,EACN,EAAE,EACF,OAAO,EACP,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,OAAO,EACP,KAAK,EACL,GAAG,EACH,OAAO,EACP,IAAI,EACJ,UAAU,GACX,EAAE,iBAAiB,EAgBnB;IAED;;;OAGG;IACH,OAAa,IAAI,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,EAAE,EACnD,IAAI,EACJ,MAAM,EACN,WAAW,EACX,EAAE,EACF,MAAM,EACN,uBAAuB,EACvB,UAAU,EACV,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,iBAAsB,GACvB,EAAE,qBAAqB,GAAG,OAAO,CAAC,CAAC,CAAC,CA0NpC;IAED;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAkB3B;CACF"}
|
package/lib/node/nodejs.js
CHANGED
|
@@ -2,9 +2,10 @@ import { setMaxListeners } from "node:events";
|
|
|
2
2
|
import { init as initNativeMetrics, registerLocalValidator as registerNativeLocalValidator, scrapeMetrics as scrapeNativeMetrics, unregisterLocalValidator as unregisterNativeLocalValidator, } from "@chainsafe/lodestar-z/metrics";
|
|
3
3
|
import { hasher } from "@chainsafe/persistent-merkle-tree";
|
|
4
4
|
import { ZERO_HASH_HEX } from "@lodestar/params";
|
|
5
|
-
import { isStatePostBellatrix, isStatePostGloas } from "@lodestar/state-transition";
|
|
5
|
+
import { computeStartSlotAtEpoch, isStatePostBellatrix, isStatePostGloas, } from "@lodestar/state-transition";
|
|
6
6
|
import { sleep, toRootHex } from "@lodestar/utils";
|
|
7
7
|
import { BeaconRestApiServer, getApi } from "../api/index.js";
|
|
8
|
+
import { getDataColumnSidecarsMinEpoch } from "../chain/archiveStore/utils/archiveBlocks.js";
|
|
8
9
|
import { BeaconChain, initBeaconMetrics } from "../chain/index.js";
|
|
9
10
|
import { createValidatorMonitor } from "../chain/validatorMonitor.js";
|
|
10
11
|
import { initializeExecutionBuilder, initializeExecutionEngine } from "../execution/index.js";
|
|
@@ -112,6 +113,13 @@ export class BeaconNode {
|
|
|
112
113
|
: null)
|
|
113
114
|
: null;
|
|
114
115
|
const clock = new Clock({ config, genesisTime: anchorState.genesisTime, signal });
|
|
116
|
+
// Before any lookup into the legacy column buckets, which can be slow until compacted
|
|
117
|
+
const columnsMinEpoch = opts.chain.archiveDataEpochs === Infinity
|
|
118
|
+
? null
|
|
119
|
+
: getDataColumnSidecarsMinEpoch(config, clock.currentEpoch, opts.chain.archiveDataEpochs);
|
|
120
|
+
await db.compactLegacyDataColumns(columnsMinEpoch !== null && columnsMinEpoch >= config.FULU_FORK_EPOCH
|
|
121
|
+
? computeStartSlotAtEpoch(columnsMinEpoch)
|
|
122
|
+
: 0);
|
|
115
123
|
await db.init();
|
|
116
124
|
// Prune hot db repos
|
|
117
125
|
// TODO: Should this call be awaited?
|
package/lib/node/nodejs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nodejs.js","sourceRoot":"","sources":["../../src/node/nodejs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,aAAa,CAAC;AAG5C,OAAO,EACL,IAAI,IAAI,iBAAiB,EACzB,sBAAsB,IAAI,4BAA4B,EACtD,aAAa,IAAI,mBAAmB,EACpC,wBAAwB,IAAI,8BAA8B,GAC3D,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAIzD,OAAO,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AA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@@
|
|
|
11
11
|
"bugs": {
|
|
12
12
|
"url": "https://github.com/ChainSafe/lodestar/issues"
|
|
13
13
|
},
|
|
14
|
-
"version": "1.51.0-dev.
|
|
14
|
+
"version": "1.51.0-dev.50ed45c251",
|
|
15
15
|
"type": "module",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
@@ -127,17 +127,17 @@
|
|
|
127
127
|
"@libp2p/prometheus-metrics": "^5.0.31",
|
|
128
128
|
"@libp2p/tcp": "^11.0.30",
|
|
129
129
|
"@libp2p/utils": "^7.4.3",
|
|
130
|
-
"@lodestar/api": "^1.51.0-dev.
|
|
131
|
-
"@lodestar/config": "^1.51.0-dev.
|
|
132
|
-
"@lodestar/db": "^1.51.0-dev.
|
|
133
|
-
"@lodestar/fork-choice": "^1.51.0-dev.
|
|
134
|
-
"@lodestar/logger": "^1.51.0-dev.
|
|
135
|
-
"@lodestar/params": "^1.51.0-dev.
|
|
136
|
-
"@lodestar/reqresp": "^1.51.0-dev.
|
|
137
|
-
"@lodestar/state-transition": "^1.51.0-dev.
|
|
138
|
-
"@lodestar/types": "^1.51.0-dev.
|
|
139
|
-
"@lodestar/utils": "^1.51.0-dev.
|
|
140
|
-
"@lodestar/validator": "^1.51.0-dev.
|
|
130
|
+
"@lodestar/api": "^1.51.0-dev.50ed45c251",
|
|
131
|
+
"@lodestar/config": "^1.51.0-dev.50ed45c251",
|
|
132
|
+
"@lodestar/db": "^1.51.0-dev.50ed45c251",
|
|
133
|
+
"@lodestar/fork-choice": "^1.51.0-dev.50ed45c251",
|
|
134
|
+
"@lodestar/logger": "^1.51.0-dev.50ed45c251",
|
|
135
|
+
"@lodestar/params": "^1.51.0-dev.50ed45c251",
|
|
136
|
+
"@lodestar/reqresp": "^1.51.0-dev.50ed45c251",
|
|
137
|
+
"@lodestar/state-transition": "^1.51.0-dev.50ed45c251",
|
|
138
|
+
"@lodestar/types": "^1.51.0-dev.50ed45c251",
|
|
139
|
+
"@lodestar/utils": "^1.51.0-dev.50ed45c251",
|
|
140
|
+
"@lodestar/validator": "^1.51.0-dev.50ed45c251",
|
|
141
141
|
"@multiformats/multiaddr": "^13.0.1",
|
|
142
142
|
"datastore-core": "^12.0.1",
|
|
143
143
|
"datastore-level": "^13.0.1",
|
|
@@ -159,8 +159,8 @@
|
|
|
159
159
|
"@ethereumjs/rlp": "^4.0.1",
|
|
160
160
|
"@libp2p/interface-internal": "^3.2.0",
|
|
161
161
|
"@libp2p/logger": "^6.2.15",
|
|
162
|
-
"@lodestar/spec-test-util": "^1.51.0-dev.
|
|
163
|
-
"@lodestar/test-utils": "^1.51.0-dev.
|
|
162
|
+
"@lodestar/spec-test-util": "^1.51.0-dev.50ed45c251",
|
|
163
|
+
"@lodestar/test-utils": "^1.51.0-dev.50ed45c251",
|
|
164
164
|
"@types/js-yaml": "^4.0.5",
|
|
165
165
|
"@types/qs": "^6.9.7",
|
|
166
166
|
"@types/tmp": "^0.2.3",
|
|
@@ -175,5 +175,5 @@
|
|
|
175
175
|
"beacon",
|
|
176
176
|
"blockchain"
|
|
177
177
|
],
|
|
178
|
-
"gitHead": "
|
|
178
|
+
"gitHead": "f64d95d13c6961326acb42fe1fc455403b22f8fd"
|
|
179
179
|
}
|
|
@@ -1756,7 +1756,10 @@ export function getValidatorApi(
|
|
|
1756
1756
|
}
|
|
1757
1757
|
}
|
|
1758
1758
|
|
|
1759
|
-
|
|
1759
|
+
// The fork epoch PTC is computed at the fork from effective balances updated at the end of the
|
|
1760
|
+
// last pre-fork epoch, so its dependent root is one epoch later than for other epochs
|
|
1761
|
+
const dependentRootEpoch = epoch === config.GLOAS_FORK_EPOCH ? epoch + 1 : epoch;
|
|
1762
|
+
const dependentRoot = fromHex(state.getShufflingDecisionRoot(dependentRootEpoch));
|
|
1760
1763
|
|
|
1761
1764
|
return {
|
|
1762
1765
|
data: duties,
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {ChainForkConfig} from "@lodestar/config";
|
|
2
2
|
import {computeEpochAtSlot} from "@lodestar/state-transition";
|
|
3
|
-
import {Logger} from "@lodestar/utils";
|
|
3
|
+
import {Logger, pruneSetToMax} from "@lodestar/utils";
|
|
4
4
|
import {BLOB_AND_PROOF_V2_RPC_BYTES} from "../execution/engine/types.js";
|
|
5
5
|
import {IExecutionEngine} from "../execution/index.js";
|
|
6
6
|
import {Metrics} from "../metrics/metrics.js";
|
|
7
|
-
import {callInNextEventLoop} from "../util/eventLoop.js";
|
|
8
7
|
import {
|
|
9
8
|
DataColumnEngineResult,
|
|
10
9
|
getBlobSidecarsFromExecution,
|
|
@@ -14,6 +13,11 @@ import {IBlockInput, isBlockInputBlobs} from "./blocks/blockInput/index.js";
|
|
|
14
13
|
import {PayloadEnvelopeInput} from "./blocks/payloadEnvelopeInput/index.js";
|
|
15
14
|
import {ChainEventEmitter} from "./emitter.js";
|
|
16
15
|
|
|
16
|
+
/** A `null` answer only changes if the EL receives the transactions later, so retries are few and spaced out */
|
|
17
|
+
export const MAX_GET_BLOBS_ATTEMPTS = 3;
|
|
18
|
+
export const GET_BLOBS_RETRY_INTERVAL_MS = 1000;
|
|
19
|
+
const MAX_TRACKED_BLOCK_ROOTS = 64;
|
|
20
|
+
|
|
17
21
|
export type GetBlobsTrackerInit = {
|
|
18
22
|
logger: Logger;
|
|
19
23
|
executionEngine: IExecutionEngine;
|
|
@@ -32,6 +36,8 @@ export class GetBlobsTracker {
|
|
|
32
36
|
metrics: Metrics | null;
|
|
33
37
|
config: ChainForkConfig;
|
|
34
38
|
activeReconstructions = new Set<string>();
|
|
39
|
+
failedAttempts = new Map<string, {count: number; lastAttemptMs: number; retryTimer?: NodeJS.Timeout}>();
|
|
40
|
+
pendingTriggers = new Set<string>();
|
|
35
41
|
// Preallocate buffers for getBlobsV2 RPC calls
|
|
36
42
|
// See https://github.com/ChainSafe/lodestar/pull/8282 for context
|
|
37
43
|
blobsAndProofsBuffers: {buffers: Uint8Array[]; inUse: boolean}[] = [];
|
|
@@ -46,23 +52,55 @@ export class GetBlobsTracker {
|
|
|
46
52
|
|
|
47
53
|
triggerGetBlobs(input: IBlockInput | PayloadEnvelopeInput): void {
|
|
48
54
|
if (this.activeReconstructions.has(input.blockRootHex)) {
|
|
55
|
+
this.pendingTriggers.add(input.blockRootHex);
|
|
49
56
|
return;
|
|
50
57
|
}
|
|
51
58
|
|
|
59
|
+
const failed = this.failedAttempts.get(input.blockRootHex);
|
|
60
|
+
if (failed) {
|
|
61
|
+
if (failed.count >= MAX_GET_BLOBS_ATTEMPTS) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
const waitMs = GET_BLOBS_RETRY_INTERVAL_MS - (Date.now() - failed.lastAttemptMs);
|
|
65
|
+
if (waitMs > 0) {
|
|
66
|
+
// Columns tend to arrive in one burst, so keep a single trailing retry instead of relying on a later trigger
|
|
67
|
+
failed.retryTimer ??= setTimeout(() => {
|
|
68
|
+
failed.retryTimer = undefined;
|
|
69
|
+
if (this.failedAttempts.get(input.blockRootHex) === failed && !input.hasAllData()) {
|
|
70
|
+
this.triggerGetBlobs(input);
|
|
71
|
+
}
|
|
72
|
+
}, waitMs).unref();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// The request is sent right away, before block processing issues newPayload: ELs that drop a
|
|
78
|
+
// transaction's blobs once the payload is validated can only answer a request that gets there first
|
|
52
79
|
if (!(input instanceof PayloadEnvelopeInput) && isBlockInputBlobs(input)) {
|
|
53
80
|
// there is not preallocation for blob sidecars like there is for columns sidecars so no need to
|
|
54
81
|
// store the index for the preallocated buffers
|
|
55
82
|
this.activeReconstructions.add(input.blockRootHex);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
83
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
84
|
+
this.logger.verbose("Trigger getBlobsV1 for block", logCtx);
|
|
85
|
+
let requestFailed = false;
|
|
86
|
+
getBlobSidecarsFromExecution(this.config, this.executionEngine, this.metrics, this.emitter, input)
|
|
87
|
+
.then(() => {
|
|
88
|
+
// EL errors and misses are handled inside the helper, blobs still missing means the attempt failed
|
|
89
|
+
if (!input.hasAllData()) {
|
|
90
|
+
requestFailed = true;
|
|
91
|
+
this.recordFailedAttempt(input.blockRootHex);
|
|
63
92
|
}
|
|
64
|
-
)
|
|
65
|
-
|
|
93
|
+
})
|
|
94
|
+
.catch((error) => {
|
|
95
|
+
this.logger.debug("Error during getBlobsV1 for block", logCtx, error as Error);
|
|
96
|
+
requestFailed = true;
|
|
97
|
+
this.recordFailedAttempt(input.blockRootHex);
|
|
98
|
+
})
|
|
99
|
+
.finally(() => {
|
|
100
|
+
this.logger.verbose("Completed getBlobsV1 for block", logCtx);
|
|
101
|
+
this.activeReconstructions.delete(input.blockRootHex);
|
|
102
|
+
this.retryPendingTrigger(input, requestFailed);
|
|
103
|
+
});
|
|
66
104
|
|
|
67
105
|
return;
|
|
68
106
|
}
|
|
@@ -83,34 +121,53 @@ export class GetBlobsTracker {
|
|
|
83
121
|
}
|
|
84
122
|
timer?.();
|
|
85
123
|
|
|
86
|
-
// We don't care about the outcome of this call,
|
|
87
|
-
// just that it has been triggered for this block root.
|
|
88
124
|
this.activeReconstructions.add(input.blockRootHex);
|
|
89
125
|
this.blobsAndProofsBuffers[freeIndex].inUse = true;
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
this.
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
126
|
+
const logCtx = {slot: input.slot, root: input.blockRootHex};
|
|
127
|
+
this.logger.verbose("Trigger getBlobsV2 for block", logCtx);
|
|
128
|
+
let requestFailed = false;
|
|
129
|
+
getDataColumnSidecarsFromExecution(
|
|
130
|
+
this.config,
|
|
131
|
+
this.executionEngine,
|
|
132
|
+
this.emitter,
|
|
133
|
+
input,
|
|
134
|
+
this.metrics,
|
|
135
|
+
this.blobsAndProofsBuffers[freeIndex].buffers
|
|
136
|
+
)
|
|
137
|
+
.then((result) => {
|
|
138
|
+
this.logger.debug("getBlobsV2 result for block", {...logCtx, result});
|
|
139
|
+
this.metrics?.dataColumns.dataColumnEngineResult.inc({result});
|
|
140
|
+
if (result === DataColumnEngineResult.NullResponse) {
|
|
141
|
+
requestFailed = true;
|
|
142
|
+
this.recordFailedAttempt(input.blockRootHex);
|
|
143
|
+
}
|
|
144
|
+
})
|
|
145
|
+
.catch((error) => {
|
|
146
|
+
this.logger.debug("Error during getBlobsV2 for block", logCtx, error as Error);
|
|
147
|
+
this.metrics?.dataColumns.dataColumnEngineResult.inc({result: DataColumnEngineResult.Failed});
|
|
148
|
+
requestFailed = true;
|
|
149
|
+
this.recordFailedAttempt(input.blockRootHex);
|
|
150
|
+
})
|
|
151
|
+
.finally(() => {
|
|
152
|
+
this.logger.verbose("Completed getBlobsV2 for block", logCtx);
|
|
153
|
+
this.activeReconstructions.delete(input.blockRootHex);
|
|
154
|
+
this.blobsAndProofsBuffers[freeIndex].inUse = false;
|
|
155
|
+
this.retryPendingTrigger(input, requestFailed);
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
private retryPendingTrigger(input: IBlockInput | PayloadEnvelopeInput, requestFailed: boolean): void {
|
|
160
|
+
// Triggers dropped while the request was in flight re-enter once it failed, the attempt that was just
|
|
161
|
+
// recorded makes this arm the trailing retry instead of sending another request right away
|
|
162
|
+
if (this.pendingTriggers.delete(input.blockRootHex) && requestFailed) {
|
|
163
|
+
this.triggerGetBlobs(input);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
private recordFailedAttempt(blockRootHex: string): void {
|
|
168
|
+
const failed = this.failedAttempts.get(blockRootHex);
|
|
169
|
+
clearTimeout(failed?.retryTimer);
|
|
170
|
+
this.failedAttempts.set(blockRootHex, {count: (failed?.count ?? 0) + 1, lastAttemptMs: Date.now()});
|
|
171
|
+
pruneSetToMax(this.failedAttempts, MAX_TRACKED_BLOCK_ROOTS);
|
|
115
172
|
}
|
|
116
173
|
}
|
|
@@ -56,6 +56,17 @@ async function persistOrphanedBlock(
|
|
|
56
56
|
await writeIfNotExist(filepath, bytes);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* Oldest epoch for which data column sidecars are kept
|
|
61
|
+
*/
|
|
62
|
+
export function getDataColumnSidecarsMinEpoch(
|
|
63
|
+
config: ChainForkConfig,
|
|
64
|
+
currentEpoch: Epoch,
|
|
65
|
+
archiveDataEpochs?: number
|
|
66
|
+
): Epoch {
|
|
67
|
+
return Math.min(getBlobDataRetentionStartEpoch(config, currentEpoch), currentEpoch - (archiveDataEpochs ?? 0));
|
|
68
|
+
}
|
|
69
|
+
|
|
59
70
|
/**
|
|
60
71
|
* Archives finalized blocks from active bucket to archive bucket.
|
|
61
72
|
*
|
|
@@ -260,10 +271,7 @@ export async function archiveBlocks(
|
|
|
260
271
|
// Keep only `[min(compute_blob_data_retention_start_epoch(current_epoch), current_epoch - archiveDataEpochs)]`
|
|
261
272
|
if (finalizedPostFulu) {
|
|
262
273
|
if (archiveDataEpochs !== Infinity) {
|
|
263
|
-
const dataColumnSidecarsMinEpoch =
|
|
264
|
-
getBlobDataRetentionStartEpoch(config, currentEpoch),
|
|
265
|
-
currentEpoch - (archiveDataEpochs ?? 0)
|
|
266
|
-
);
|
|
274
|
+
const dataColumnSidecarsMinEpoch = getDataColumnSidecarsMinEpoch(config, currentEpoch, archiveDataEpochs);
|
|
267
275
|
if (dataColumnSidecarsMinEpoch >= config.FULU_FORK_EPOCH) {
|
|
268
276
|
const columnsPruneSlot = computeStartSlotAtEpoch(dataColumnSidecarsMinEpoch);
|
|
269
277
|
const prunedColumnSlots = await db.dataColumns.pruneBefore(columnsPruneSlot);
|
|
@@ -383,6 +383,6 @@ export async function processExecutionPayload(
|
|
|
383
383
|
signal: AbortSignal,
|
|
384
384
|
opts: ImportPayloadOpts = {}
|
|
385
385
|
): Promise<void> {
|
|
386
|
-
const {dataAvailabilityStatuses} = await verifyPayloadsDataAvailability([payloadInput], signal);
|
|
386
|
+
const {dataAvailabilityStatuses} = await verifyPayloadsDataAvailability(this.config, [payloadInput], signal);
|
|
387
387
|
await importExecutionPayload.call(this, payloadInput, dataAvailabilityStatuses[0], opts);
|
|
388
388
|
}
|
|
@@ -147,7 +147,7 @@ export async function processBlocks(
|
|
|
147
147
|
proposerBalanceDelta: proposerBalanceDeltas[i],
|
|
148
148
|
indexedAttestations: indexedAttestationsByBlock[i],
|
|
149
149
|
// TODO: Make this param mandatory and capture in gossip
|
|
150
|
-
seenTimestampSec: opts.seenTimestampSec ??
|
|
150
|
+
seenTimestampSec: opts.seenTimestampSec ?? Date.now() / 1000,
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
|
|
@@ -292,7 +292,11 @@ async function importPayloadEnvelopesOfKnownBlocks(
|
|
|
292
292
|
return result;
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
const {dataAvailabilityStatuses} = await verifyPayloadsDataAvailability(
|
|
295
|
+
const {dataAvailabilityStatuses} = await verifyPayloadsDataAvailability(
|
|
296
|
+
this.config,
|
|
297
|
+
payloadInputs,
|
|
298
|
+
new AbortController().signal
|
|
299
|
+
);
|
|
296
300
|
for (let i = 0; i < payloadInputs.length; i++) {
|
|
297
301
|
this.logger.debug("Importing payload envelope of known block", {
|
|
298
302
|
slot: payloadInputs[i].slot,
|
|
@@ -13,11 +13,11 @@ const QUEUE_MAX_LENGTH = 16;
|
|
|
13
13
|
*
|
|
14
14
|
* Jobs are enqueued only on envelope arrival (gossip or API). The envelope may reach us before
|
|
15
15
|
* the sampled data columns; importExecutionPayload awaits `verifyPayloadsDataAvailability`
|
|
16
|
-
* internally, so a queued job can pend for up to
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
16
|
+
* internally, so a queued job can pend for up to one slot while waiting for columns. Duplicate
|
|
17
|
+
* triggers for the same payloadInput are deduped by sharing the in-flight import promise: every
|
|
18
|
+
* caller observes the real import outcome. Resolving duplicates early instead would let
|
|
19
|
+
* BlockInputSync mark a still-pending payload as processed, re-queue it, and spin re-processing
|
|
20
|
+
* the same root until OOM while the import is blocked (e.g. EL syncing).
|
|
21
21
|
*/
|
|
22
22
|
export class PayloadEnvelopeProcessor {
|
|
23
23
|
readonly jobQueue: JobItemQueue<[PayloadEnvelopeInput, ImportPayloadOpts], void>;
|
|
@@ -143,6 +143,7 @@ export async function verifyBlocksInEpoch(
|
|
|
143
143
|
? Array.from(payloadEnvelopes.values()).filter((payloadInput) => payloadInput.hasPayloadEnvelope())
|
|
144
144
|
: [];
|
|
145
145
|
const {dataAvailabilityStatuses, availableTime} = await verifyPayloadsDataAvailability(
|
|
146
|
+
this.config,
|
|
146
147
|
payloadInputsForDa,
|
|
147
148
|
abortController.signal
|
|
148
149
|
);
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
+
import {ChainForkConfig} from "@lodestar/config";
|
|
1
2
|
import {DataAvailabilityStatus} from "@lodestar/state-transition";
|
|
2
3
|
import {gloas} from "@lodestar/types";
|
|
3
4
|
import {PayloadEnvelopeInput} from "../seenCache/seenPayloadEnvelopeInput.js";
|
|
4
5
|
|
|
5
|
-
// we can now wait for full 12 seconds because sync and reconstruction will try pulling
|
|
6
|
-
// the data columns from the network anyway while the envelope is being processed
|
|
7
|
-
export const PAYLOAD_DATA_AVAILABILITY_TIMEOUT = 12_000;
|
|
8
|
-
|
|
9
6
|
/**
|
|
10
7
|
* Verifies that all payload envelope inputs have their data columns available.
|
|
11
|
-
* - Waits a max of
|
|
8
|
+
* - Waits a max of one slot duration of the payload's fork for all data to be available
|
|
12
9
|
* - Returns the time at which all data was available
|
|
13
10
|
* - Returns the data availability status for each payload input
|
|
14
11
|
*/
|
|
15
12
|
export async function verifyPayloadsDataAvailability(
|
|
13
|
+
config: ChainForkConfig,
|
|
16
14
|
payloadInputs: PayloadEnvelopeInput[],
|
|
17
15
|
signal: AbortSignal
|
|
18
16
|
): Promise<{
|
|
@@ -22,7 +20,10 @@ export async function verifyPayloadsDataAvailability(
|
|
|
22
20
|
const promises: Promise<gloas.DataColumnSidecar[]>[] = [];
|
|
23
21
|
for (const payloadInput of payloadInputs) {
|
|
24
22
|
if (!payloadInput.hasAllData()) {
|
|
25
|
-
|
|
23
|
+
// Sync and reconstruction keep pulling the data columns from the network while we wait. The wait is
|
|
24
|
+
// capped at one slot because the payload queue is serial: a longer wait lets consecutive unavailable
|
|
25
|
+
// payloads push every later payload import further behind with each slot.
|
|
26
|
+
promises.push(payloadInput.waitForAllData(config.getSlotDurationMs(payloadInput.forkName), signal));
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
await Promise.all(promises);
|
package/src/db/beacon.ts
CHANGED
|
@@ -30,6 +30,9 @@ import {
|
|
|
30
30
|
VoluntaryExitRepository,
|
|
31
31
|
} from "./repositories/index.js";
|
|
32
32
|
|
|
33
|
+
/** Below this size, seeks over leftover legacy column data stay cheap */
|
|
34
|
+
const LEGACY_DATA_COLUMNS_COMPACTION_MIN_BYTES = 1024 ** 3;
|
|
35
|
+
|
|
33
36
|
export type BeaconDbOpts = {
|
|
34
37
|
dataColumnDir: string;
|
|
35
38
|
logger: Logger;
|
|
@@ -67,6 +70,7 @@ export class BeaconDb implements IBeaconDb {
|
|
|
67
70
|
readonly dataColumns: IDataColumnStore;
|
|
68
71
|
lastLegacyArchiveSlot: Slot | null = null;
|
|
69
72
|
private readonly flatFileStore: FlatFileStore;
|
|
73
|
+
private readonly logger: Logger;
|
|
70
74
|
|
|
71
75
|
constructor(
|
|
72
76
|
config: ChainForkConfig,
|
|
@@ -100,6 +104,7 @@ export class BeaconDb implements IBeaconDb {
|
|
|
100
104
|
this.syncCommittee = new SyncCommitteeRepository(config, db);
|
|
101
105
|
this.syncCommitteeWitness = new SyncCommitteeWitnessRepository(config, db);
|
|
102
106
|
|
|
107
|
+
this.logger = opts.logger;
|
|
103
108
|
this.flatFileStore = new FlatFileStore(opts.dataColumnDir, config, opts.logger, opts.metrics);
|
|
104
109
|
this.dataColumns = new LegacyDataColumnStore(
|
|
105
110
|
this.flatFileStore,
|
|
@@ -125,6 +130,40 @@ export class BeaconDb implements IBeaconDb {
|
|
|
125
130
|
this.flatFileStore.setMetrics(flatFileStoreMetrics);
|
|
126
131
|
}
|
|
127
132
|
|
|
133
|
+
/**
|
|
134
|
+
* Deletes made while an iterator held a snapshot can stay in the bottom LevelDB level, which `compactRange` never
|
|
135
|
+
* rewrites, so every seek into the legacy column buckets walks them. Writing a key at each end of the pruned range
|
|
136
|
+
* makes the compaction overlap those files and rewrite them.
|
|
137
|
+
*/
|
|
138
|
+
async compactLegacyDataColumns(
|
|
139
|
+
prunedBeforeSlot: Slot,
|
|
140
|
+
minSizeBytes = LEGACY_DATA_COLUMNS_COMPACTION_MIN_BYTES
|
|
141
|
+
): Promise<void> {
|
|
142
|
+
const archiveBucket = Bucket.allForks_dataColumnSidecarsArchive;
|
|
143
|
+
const start = encodeKey(Bucket.allForks_dataColumnSidecars, Buffer.alloc(0));
|
|
144
|
+
const end = encodeKey(archiveBucket, this.dataColumnSidecarArchive.getMinKeyRaw(prunedBeforeSlot));
|
|
145
|
+
const sizeBytes = await this.db.approximateSize(start, end);
|
|
146
|
+
if (sizeBytes < minSizeBytes) return;
|
|
147
|
+
|
|
148
|
+
// Column indices stay below 0xffff and hot column keys are shorter, so no sentinel matches a real key
|
|
149
|
+
const upperSentinel =
|
|
150
|
+
prunedBeforeSlot > 0
|
|
151
|
+
? encodeKey(archiveBucket, this.dataColumnSidecarArchive.encodeKeyRaw(prunedBeforeSlot - 1, 0xffff))
|
|
152
|
+
: encodeKey(Bucket.allForks_dataColumnSidecars, Buffer.alloc(35, 0xff));
|
|
153
|
+
const sentinels = [start, upperSentinel];
|
|
154
|
+
|
|
155
|
+
this.logger.info("Compacting legacy data columns, this may take a while", {sizeBytes});
|
|
156
|
+
const startTime = Date.now();
|
|
157
|
+
await this.db.batchPut(sentinels.map((key) => ({key, value: new Uint8Array()})));
|
|
158
|
+
await this.db.compactRange(start, end);
|
|
159
|
+
await this.db.batchDelete(sentinels);
|
|
160
|
+
await this.db.compactRange(start, end);
|
|
161
|
+
this.logger.verbose("Compacted legacy data columns", {
|
|
162
|
+
durationMs: Date.now() - startTime,
|
|
163
|
+
sizeBytes: await this.db.approximateSize(start, end),
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
|
|
128
167
|
async pruneHotDb(): Promise<void> {
|
|
129
168
|
// Prune all hot blobs
|
|
130
169
|
await this.blobSidecars.batchDelete(await this.blobSidecars.keys());
|
|
@@ -13,7 +13,7 @@ export type IndexedDataColumnBytes = {index: ColumnIndex; data: Uint8Array};
|
|
|
13
13
|
type LegacyHotDataColumnStore = Pick<DataColumnSidecarRepository, "values" | "getManyBinary" | "deleteMany">;
|
|
14
14
|
type LegacyArchiveDataColumnStore = Pick<
|
|
15
15
|
DataColumnSidecarArchiveRepository,
|
|
16
|
-
"values" | "getManyBinary" | "
|
|
16
|
+
"values" | "getManyBinary" | "pruneBefore"
|
|
17
17
|
>;
|
|
18
18
|
type BlockRootIndex = Pick<BlockArchiveRepository, "getSlotByRoot">;
|
|
19
19
|
|
|
@@ -86,9 +86,7 @@ export class LegacyDataColumnStore implements IDataColumnStore {
|
|
|
86
86
|
|
|
87
87
|
async pruneBefore(slot: Slot): Promise<Slot[]> {
|
|
88
88
|
const flatFileSlots = await this.flatFiles.pruneBefore(slot);
|
|
89
|
-
const
|
|
90
|
-
const slots = [...new Set(prefixedKeys.map(({prefix}) => prefix))];
|
|
91
|
-
if (slots.length > 0) await this.legacyArchive.deleteMany(slots);
|
|
89
|
+
const slots = await this.legacyArchive.pruneBefore(slot);
|
|
92
90
|
return [...new Set([...flatFileSlots, ...slots])].sort((a, b) => a - b);
|
|
93
91
|
}
|
|
94
92
|
}
|
package/src/db/interface.ts
CHANGED
|
@@ -68,6 +68,8 @@ export interface IBeaconDb {
|
|
|
68
68
|
readonly lastLegacyArchiveSlot: Slot | null;
|
|
69
69
|
init(): Promise<void>;
|
|
70
70
|
|
|
71
|
+
compactLegacyDataColumns(prunedBeforeSlot: Slot, minSizeBytes?: number): Promise<void>;
|
|
72
|
+
|
|
71
73
|
pruneHotDb(): Promise<void>;
|
|
72
74
|
|
|
73
75
|
deleteDeprecatedEth1Data(): Promise<void>;
|
|
@@ -15,6 +15,8 @@ const SLOT_BYTE_SIZE = 8;
|
|
|
15
15
|
* Indexed data by `slot` + `columnIndex`
|
|
16
16
|
*/
|
|
17
17
|
export class DataColumnSidecarArchiveRepository extends PrefixedRepository<Slot, ColumnIndex, DataColumnSidecar> {
|
|
18
|
+
private prunedBeforeSlot: Slot | null = null;
|
|
19
|
+
|
|
18
20
|
constructor(config: ChainForkConfig, db: Db) {
|
|
19
21
|
const bucket = Bucket.allForks_dataColumnSidecarsArchive;
|
|
20
22
|
// Type won't be used since we select it dynamically based on fork
|
|
@@ -70,4 +72,22 @@ export class DataColumnSidecarArchiveRepository extends PrefixedRepository<Slot,
|
|
|
70
72
|
encodeNumberForDbKey(0, COLUMN_INDEX_BYTE_SIZE),
|
|
71
73
|
]);
|
|
72
74
|
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Deletes all entries before `slot`. Prunes only delete from the start of the bucket, so the first prune
|
|
78
|
+
* compacts the range to drop tombstones of earlier runs and later prunes resume where the previous one ended.
|
|
79
|
+
*/
|
|
80
|
+
async pruneBefore(slot: Slot): Promise<Slot[]> {
|
|
81
|
+
if (this.prunedBeforeSlot === null) {
|
|
82
|
+
await this.db.compactRange(this.wrapKey(this.getMinKeyRaw(0)), this.wrapKey(this.getMinKeyRaw(slot)));
|
|
83
|
+
} else if (slot <= this.prunedBeforeSlot) {
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
const keys = await this.keys({gte: {prefix: this.prunedBeforeSlot ?? 0, id: 0}, lt: {prefix: slot, id: 0}});
|
|
88
|
+
const slots = [...new Set(keys.map(({prefix}) => prefix))];
|
|
89
|
+
if (slots.length > 0) await this.deleteMany(slots);
|
|
90
|
+
this.prunedBeforeSlot = slot;
|
|
91
|
+
return slots;
|
|
92
|
+
}
|
|
73
93
|
}
|