@lodestar/beacon-node 1.23.0-dev.de0d6ab89b → 1.23.0-dev.e01142b1f8
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/archiver/archiver.d.ts +40 -0
- package/lib/chain/archiver/archiver.js +117 -0
- package/lib/chain/archiver/archiver.js.map +1 -0
- package/lib/chain/archiver/index.d.ts +2 -54
- package/lib/chain/archiver/index.js +2 -104
- package/lib/chain/archiver/index.js.map +1 -1
- package/lib/chain/archiver/interface.d.ts +39 -0
- package/lib/chain/archiver/interface.js +8 -0
- package/lib/chain/archiver/interface.js.map +1 -0
- package/lib/chain/archiver/{archiveStates.d.ts → strategies/frequencyStateArchiveStrategy.d.ts} +16 -14
- package/lib/chain/archiver/{archiveStates.js → strategies/frequencyStateArchiveStrategy.js} +8 -6
- package/lib/chain/archiver/strategies/frequencyStateArchiveStrategy.js.map +1 -0
- package/lib/chain/chain.js +1 -1
- package/lib/chain/chain.js.map +1 -1
- package/lib/chain/options.d.ts +3 -1
- package/lib/chain/options.js +4 -0
- package/lib/chain/options.js.map +1 -1
- package/lib/chain/produceBlock/produceBlockBody.js +7 -1
- package/lib/chain/produceBlock/produceBlockBody.js.map +1 -1
- package/lib/execution/builder/http.d.ts +2 -1
- package/lib/execution/builder/http.js +2 -1
- package/lib/execution/builder/http.js.map +1 -1
- package/lib/execution/builder/interface.d.ts +2 -1
- package/lib/execution/engine/types.d.ts +16 -24
- package/lib/execution/engine/types.js +31 -52
- package/lib/execution/engine/types.js.map +1 -1
- package/lib/node/options.d.ts +2 -2
- package/lib/node/options.js +2 -2
- package/lib/node/options.js.map +1 -1
- package/lib/sync/sync.js +2 -1
- package/lib/sync/sync.js.map +1 -1
- package/package.json +15 -15
- package/lib/chain/archiver/archiveStates.js.map +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Logger } from "@lodestar/utils";
|
|
2
|
+
import { IBeaconDb } from "../../db/index.js";
|
|
3
|
+
import { IBeaconChain } from "../interface.js";
|
|
4
|
+
import { Metrics } from "../../metrics/metrics.js";
|
|
5
|
+
import { StateArchiveMode, ArchiverOpts } from "./interface.js";
|
|
6
|
+
export declare const DEFAULT_STATE_ARCHIVE_MODE = StateArchiveMode.Frequency;
|
|
7
|
+
export declare const PROCESS_FINALIZED_CHECKPOINT_QUEUE_LEN = 256;
|
|
8
|
+
/**
|
|
9
|
+
* Used for running tasks that depends on some events or are executed
|
|
10
|
+
* periodically.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Archiver {
|
|
13
|
+
private readonly db;
|
|
14
|
+
private readonly chain;
|
|
15
|
+
private readonly logger;
|
|
16
|
+
private readonly metrics?;
|
|
17
|
+
private stateArchiveMode;
|
|
18
|
+
private jobQueue;
|
|
19
|
+
private prevFinalized;
|
|
20
|
+
private readonly statesArchiverStrategy;
|
|
21
|
+
private archiveBlobEpochs?;
|
|
22
|
+
constructor(db: IBeaconDb, chain: IBeaconChain, logger: Logger, signal: AbortSignal, opts: ArchiverOpts, metrics?: Metrics | null | undefined);
|
|
23
|
+
/** Archive latest finalized state */
|
|
24
|
+
persistToDisk(): Promise<void>;
|
|
25
|
+
private onFinalizedCheckpoint;
|
|
26
|
+
private onCheckpoint;
|
|
27
|
+
private processFinalizedCheckpoint;
|
|
28
|
+
/**
|
|
29
|
+
* Backfill sync relies on verified connected ranges (which are represented as key,value
|
|
30
|
+
* with a verified jump from a key back to value). Since the node could have progressed
|
|
31
|
+
* ahead from, we need to save the forward progress of this node as another backfill
|
|
32
|
+
* range entry, that backfill sync will use to jump back if this node is restarted
|
|
33
|
+
* for any reason.
|
|
34
|
+
* The current backfill has its own backfill entry from anchor slot to last backfilled
|
|
35
|
+
* slot. And this would create the entry from the current finalized slot to the anchor
|
|
36
|
+
* slot.
|
|
37
|
+
*/
|
|
38
|
+
private updateBackfillRange;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=archiver.d.ts.map
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { JobItemQueue } from "../../util/queue/index.js";
|
|
2
|
+
import { ChainEvent } from "../emitter.js";
|
|
3
|
+
import { FrequencyStateArchiveStrategy } from "./strategies/frequencyStateArchiveStrategy.js";
|
|
4
|
+
import { archiveBlocks } from "./archiveBlocks.js";
|
|
5
|
+
import { StateArchiveMode } from "./interface.js";
|
|
6
|
+
export const DEFAULT_STATE_ARCHIVE_MODE = StateArchiveMode.Frequency;
|
|
7
|
+
export const PROCESS_FINALIZED_CHECKPOINT_QUEUE_LEN = 256;
|
|
8
|
+
/**
|
|
9
|
+
* Used for running tasks that depends on some events or are executed
|
|
10
|
+
* periodically.
|
|
11
|
+
*/
|
|
12
|
+
export class Archiver {
|
|
13
|
+
constructor(db, chain, logger, signal, opts, metrics) {
|
|
14
|
+
this.db = db;
|
|
15
|
+
this.chain = chain;
|
|
16
|
+
this.logger = logger;
|
|
17
|
+
this.metrics = metrics;
|
|
18
|
+
this.onFinalizedCheckpoint = async (finalized) => {
|
|
19
|
+
return this.jobQueue.push(finalized);
|
|
20
|
+
};
|
|
21
|
+
this.onCheckpoint = () => {
|
|
22
|
+
const headStateRoot = this.chain.forkChoice.getHead().stateRoot;
|
|
23
|
+
this.chain.regen.pruneOnCheckpoint(this.chain.forkChoice.getFinalizedCheckpoint().epoch, this.chain.forkChoice.getJustifiedCheckpoint().epoch, headStateRoot);
|
|
24
|
+
this.statesArchiverStrategy.onCheckpoint(headStateRoot, this.metrics).catch((err) => {
|
|
25
|
+
this.logger.error("Error during state archive", { stateArchiveMode: this.stateArchiveMode }, err);
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
this.processFinalizedCheckpoint = async (finalized) => {
|
|
29
|
+
try {
|
|
30
|
+
const finalizedEpoch = finalized.epoch;
|
|
31
|
+
this.logger.verbose("Start processing finalized checkpoint", { epoch: finalizedEpoch, rootHex: finalized.rootHex });
|
|
32
|
+
await archiveBlocks(this.chain.config, this.db, this.chain.forkChoice, this.chain.lightClientServer, this.logger, finalized, this.chain.clock.currentEpoch, this.archiveBlobEpochs);
|
|
33
|
+
this.prevFinalized = finalized;
|
|
34
|
+
await this.statesArchiverStrategy.onFinalizedCheckpoint(finalized, this.metrics);
|
|
35
|
+
// should be after ArchiveBlocksTask to handle restart cleanly
|
|
36
|
+
await this.statesArchiverStrategy.maybeArchiveState(finalized, this.metrics);
|
|
37
|
+
this.chain.regen.pruneOnFinalized(finalizedEpoch);
|
|
38
|
+
// tasks rely on extended fork choice
|
|
39
|
+
const prunedBlocks = this.chain.forkChoice.prune(finalized.rootHex);
|
|
40
|
+
await this.updateBackfillRange(finalized);
|
|
41
|
+
this.logger.verbose("Finish processing finalized checkpoint", {
|
|
42
|
+
epoch: finalizedEpoch,
|
|
43
|
+
rootHex: finalized.rootHex,
|
|
44
|
+
prunedBlocks: prunedBlocks.length,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
this.logger.error("Error processing finalized checkpoint", { epoch: finalized.epoch }, e);
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Backfill sync relies on verified connected ranges (which are represented as key,value
|
|
53
|
+
* with a verified jump from a key back to value). Since the node could have progressed
|
|
54
|
+
* ahead from, we need to save the forward progress of this node as another backfill
|
|
55
|
+
* range entry, that backfill sync will use to jump back if this node is restarted
|
|
56
|
+
* for any reason.
|
|
57
|
+
* The current backfill has its own backfill entry from anchor slot to last backfilled
|
|
58
|
+
* slot. And this would create the entry from the current finalized slot to the anchor
|
|
59
|
+
* slot.
|
|
60
|
+
*/
|
|
61
|
+
this.updateBackfillRange = async (finalized) => {
|
|
62
|
+
try {
|
|
63
|
+
// Mark the sequence in backfill db from finalized block's slot till anchor slot as
|
|
64
|
+
// filled.
|
|
65
|
+
const finalizedBlockFC = this.chain.forkChoice.getBlockHex(finalized.rootHex);
|
|
66
|
+
if (finalizedBlockFC && finalizedBlockFC.slot > this.chain.anchorStateLatestBlockSlot) {
|
|
67
|
+
await this.db.backfilledRanges.put(finalizedBlockFC.slot, this.chain.anchorStateLatestBlockSlot);
|
|
68
|
+
// Clear previously marked sequence till anchorStateLatestBlockSlot, without
|
|
69
|
+
// touching backfill sync process sequence which are at
|
|
70
|
+
// <=anchorStateLatestBlockSlot i.e. clear >anchorStateLatestBlockSlot
|
|
71
|
+
// and < currentSlot
|
|
72
|
+
const filteredSeqs = await this.db.backfilledRanges.entries({
|
|
73
|
+
gt: this.chain.anchorStateLatestBlockSlot,
|
|
74
|
+
lt: finalizedBlockFC.slot,
|
|
75
|
+
});
|
|
76
|
+
this.logger.debug("updated backfilledRanges", {
|
|
77
|
+
key: finalizedBlockFC.slot,
|
|
78
|
+
value: this.chain.anchorStateLatestBlockSlot,
|
|
79
|
+
});
|
|
80
|
+
if (filteredSeqs.length > 0) {
|
|
81
|
+
await this.db.backfilledRanges.batchDelete(filteredSeqs.map((entry) => entry.key));
|
|
82
|
+
this.logger.debug(`Forward Sync - cleaned up backfilledRanges between ${finalizedBlockFC.slot},${this.chain.anchorStateLatestBlockSlot}`, { seqs: JSON.stringify(filteredSeqs) });
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
catch (e) {
|
|
87
|
+
this.logger.error("Error updating backfilledRanges on finalization", { epoch: finalized.epoch }, e);
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
if (opts.stateArchiveMode === StateArchiveMode.Frequency) {
|
|
91
|
+
this.statesArchiverStrategy = new FrequencyStateArchiveStrategy(chain.regen, db, logger, opts, chain.bufferPool);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
throw new Error(`State archive strategy "${opts.stateArchiveMode}" currently not supported.`);
|
|
95
|
+
}
|
|
96
|
+
this.stateArchiveMode = opts.stateArchiveMode;
|
|
97
|
+
this.archiveBlobEpochs = opts.archiveBlobEpochs;
|
|
98
|
+
this.prevFinalized = chain.forkChoice.getFinalizedCheckpoint();
|
|
99
|
+
this.jobQueue = new JobItemQueue(this.processFinalizedCheckpoint, {
|
|
100
|
+
maxLength: PROCESS_FINALIZED_CHECKPOINT_QUEUE_LEN,
|
|
101
|
+
signal,
|
|
102
|
+
});
|
|
103
|
+
if (!opts.disableArchiveOnCheckpoint) {
|
|
104
|
+
this.chain.emitter.on(ChainEvent.forkChoiceFinalized, this.onFinalizedCheckpoint);
|
|
105
|
+
this.chain.emitter.on(ChainEvent.checkpoint, this.onCheckpoint);
|
|
106
|
+
signal.addEventListener("abort", () => {
|
|
107
|
+
this.chain.emitter.off(ChainEvent.forkChoiceFinalized, this.onFinalizedCheckpoint);
|
|
108
|
+
this.chain.emitter.off(ChainEvent.checkpoint, this.onCheckpoint);
|
|
109
|
+
}, { once: true });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** Archive latest finalized state */
|
|
113
|
+
async persistToDisk() {
|
|
114
|
+
return this.statesArchiverStrategy.maybeArchiveState(this.chain.forkChoice.getFinalizedCheckpoint());
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
//# sourceMappingURL=archiver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"archiver.js","sourceRoot":"","sources":["../../../src/chain/archiver/archiver.ts"],"names":[],"mappings":"AAGA,OAAO,EAAC,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAEvD,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAC,6BAA6B,EAAC,MAAM,+CAA+C,CAAC;AAC5F,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAC,gBAAgB,EAAqC,MAAM,gBAAgB,CAAC;AAEpF,MAAM,CAAC,MAAM,0BAA0B,GAAG,gBAAgB,CAAC,SAAS,CAAC;AAErE,MAAM,CAAC,MAAM,sCAAsC,GAAG,GAAG,CAAC;AAE1D;;;GAGG;AACH,MAAM,OAAO,QAAQ;IAQnB,YACmB,EAAa,EACb,KAAmB,EACnB,MAAc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BAAqB,CAAC,CAAC;gBACnF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;YACnE,CAAC,EACD,EAAC,IAAI,EAAE,IAAI,EAAC,CACb,CAAC;QACJ,CAAC;IACH,CAAC;IAED,qCAAqC;IACrC,KAAK,CAAC,aAAa;QACjB,OAAO,IAAI,CAAC,sBAAsB,CAAC,iBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,sBAAsB,EAAE,CAAC,CAAC;IACvG,CAAC;CAkGF"}
|
|
@@ -1,55 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { IBeaconChain } from "../interface.js";
|
|
4
|
-
import { Metrics } from "../../metrics/metrics.js";
|
|
5
|
-
import { StatesArchiverOpts } from "./archiveStates.js";
|
|
6
|
-
export type ArchiverOpts = StatesArchiverOpts & {
|
|
7
|
-
disableArchiveOnCheckpoint?: boolean;
|
|
8
|
-
archiveBlobEpochs?: number;
|
|
9
|
-
};
|
|
10
|
-
type ProposalStats = {
|
|
11
|
-
total: number;
|
|
12
|
-
finalized: number;
|
|
13
|
-
orphaned: number;
|
|
14
|
-
missed: number;
|
|
15
|
-
};
|
|
16
|
-
export type FinalizedStats = {
|
|
17
|
-
allValidators: ProposalStats;
|
|
18
|
-
attachedValidators: ProposalStats;
|
|
19
|
-
finalizedCanonicalCheckpointsCount: number;
|
|
20
|
-
finalizedFoundCheckpointsInStateCache: number;
|
|
21
|
-
finalizedAttachedValidatorsCount: number;
|
|
22
|
-
};
|
|
23
|
-
/**
|
|
24
|
-
* Used for running tasks that depends on some events or are executed
|
|
25
|
-
* periodically.
|
|
26
|
-
*/
|
|
27
|
-
export declare class Archiver {
|
|
28
|
-
private readonly db;
|
|
29
|
-
private readonly chain;
|
|
30
|
-
private readonly logger;
|
|
31
|
-
private readonly metrics?;
|
|
32
|
-
private jobQueue;
|
|
33
|
-
private prevFinalized;
|
|
34
|
-
private readonly statesArchiver;
|
|
35
|
-
private archiveBlobEpochs?;
|
|
36
|
-
constructor(db: IBeaconDb, chain: IBeaconChain, logger: Logger, signal: AbortSignal, opts: ArchiverOpts, metrics?: Metrics | null | undefined);
|
|
37
|
-
/** Archive latest finalized state */
|
|
38
|
-
persistToDisk(): Promise<void>;
|
|
39
|
-
private onFinalizedCheckpoint;
|
|
40
|
-
private onCheckpoint;
|
|
41
|
-
private processFinalizedCheckpoint;
|
|
42
|
-
/**
|
|
43
|
-
* Backfill sync relies on verified connected ranges (which are represented as key,value
|
|
44
|
-
* with a verified jump from a key back to value). Since the node could have progressed
|
|
45
|
-
* ahead from, we need to save the forward progress of this node as another backfill
|
|
46
|
-
* range entry, that backfill sync will use to jump back if this node is restarted
|
|
47
|
-
* for any reason.
|
|
48
|
-
* The current backfill has its own backfill entry from anchor slot to last backfilled
|
|
49
|
-
* slot. And this would create the entry from the current finalized slot to the anchor
|
|
50
|
-
* slot.
|
|
51
|
-
*/
|
|
52
|
-
private updateBackfillRange;
|
|
53
|
-
}
|
|
54
|
-
export {};
|
|
1
|
+
export * from "./archiver.js";
|
|
2
|
+
export * from "./interface.js";
|
|
55
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,105 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { StatesArchiver } from "./archiveStates.js";
|
|
4
|
-
import { archiveBlocks } from "./archiveBlocks.js";
|
|
5
|
-
const PROCESS_FINALIZED_CHECKPOINT_QUEUE_LEN = 256;
|
|
6
|
-
/**
|
|
7
|
-
* Used for running tasks that depends on some events or are executed
|
|
8
|
-
* periodically.
|
|
9
|
-
*/
|
|
10
|
-
export class Archiver {
|
|
11
|
-
constructor(db, chain, logger, signal, opts, metrics) {
|
|
12
|
-
this.db = db;
|
|
13
|
-
this.chain = chain;
|
|
14
|
-
this.logger = logger;
|
|
15
|
-
this.metrics = metrics;
|
|
16
|
-
this.onFinalizedCheckpoint = async (finalized) => {
|
|
17
|
-
return this.jobQueue.push(finalized);
|
|
18
|
-
};
|
|
19
|
-
this.onCheckpoint = () => {
|
|
20
|
-
const headStateRoot = this.chain.forkChoice.getHead().stateRoot;
|
|
21
|
-
this.chain.regen.pruneOnCheckpoint(this.chain.forkChoice.getFinalizedCheckpoint().epoch, this.chain.forkChoice.getJustifiedCheckpoint().epoch, headStateRoot);
|
|
22
|
-
};
|
|
23
|
-
this.processFinalizedCheckpoint = async (finalized) => {
|
|
24
|
-
try {
|
|
25
|
-
const finalizedEpoch = finalized.epoch;
|
|
26
|
-
this.logger.verbose("Start processing finalized checkpoint", { epoch: finalizedEpoch, rootHex: finalized.rootHex });
|
|
27
|
-
await archiveBlocks(this.chain.config, this.db, this.chain.forkChoice, this.chain.lightClientServer, this.logger, finalized, this.chain.clock.currentEpoch, this.archiveBlobEpochs);
|
|
28
|
-
this.prevFinalized = finalized;
|
|
29
|
-
// should be after ArchiveBlocksTask to handle restart cleanly
|
|
30
|
-
await this.statesArchiver.maybeArchiveState(finalized, this.metrics);
|
|
31
|
-
this.chain.regen.pruneOnFinalized(finalizedEpoch);
|
|
32
|
-
// tasks rely on extended fork choice
|
|
33
|
-
const prunedBlocks = this.chain.forkChoice.prune(finalized.rootHex);
|
|
34
|
-
await this.updateBackfillRange(finalized);
|
|
35
|
-
this.logger.verbose("Finish processing finalized checkpoint", {
|
|
36
|
-
epoch: finalizedEpoch,
|
|
37
|
-
rootHex: finalized.rootHex,
|
|
38
|
-
prunedBlocks: prunedBlocks.length,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
this.logger.error("Error processing finalized checkpoint", { epoch: finalized.epoch }, e);
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
/**
|
|
46
|
-
* Backfill sync relies on verified connected ranges (which are represented as key,value
|
|
47
|
-
* with a verified jump from a key back to value). Since the node could have progressed
|
|
48
|
-
* ahead from, we need to save the forward progress of this node as another backfill
|
|
49
|
-
* range entry, that backfill sync will use to jump back if this node is restarted
|
|
50
|
-
* for any reason.
|
|
51
|
-
* The current backfill has its own backfill entry from anchor slot to last backfilled
|
|
52
|
-
* slot. And this would create the entry from the current finalized slot to the anchor
|
|
53
|
-
* slot.
|
|
54
|
-
*/
|
|
55
|
-
this.updateBackfillRange = async (finalized) => {
|
|
56
|
-
try {
|
|
57
|
-
// Mark the sequence in backfill db from finalized block's slot till anchor slot as
|
|
58
|
-
// filled.
|
|
59
|
-
const finalizedBlockFC = this.chain.forkChoice.getBlockHex(finalized.rootHex);
|
|
60
|
-
if (finalizedBlockFC && finalizedBlockFC.slot > this.chain.anchorStateLatestBlockSlot) {
|
|
61
|
-
await this.db.backfilledRanges.put(finalizedBlockFC.slot, this.chain.anchorStateLatestBlockSlot);
|
|
62
|
-
// Clear previously marked sequence till anchorStateLatestBlockSlot, without
|
|
63
|
-
// touching backfill sync process sequence which are at
|
|
64
|
-
// <=anchorStateLatestBlockSlot i.e. clear >anchorStateLatestBlockSlot
|
|
65
|
-
// and < currentSlot
|
|
66
|
-
const filteredSeqs = await this.db.backfilledRanges.entries({
|
|
67
|
-
gt: this.chain.anchorStateLatestBlockSlot,
|
|
68
|
-
lt: finalizedBlockFC.slot,
|
|
69
|
-
});
|
|
70
|
-
this.logger.debug("updated backfilledRanges", {
|
|
71
|
-
key: finalizedBlockFC.slot,
|
|
72
|
-
value: this.chain.anchorStateLatestBlockSlot,
|
|
73
|
-
});
|
|
74
|
-
if (filteredSeqs.length > 0) {
|
|
75
|
-
await this.db.backfilledRanges.batchDelete(filteredSeqs.map((entry) => entry.key));
|
|
76
|
-
this.logger.debug(`Forward Sync - cleaned up backfilledRanges between ${finalizedBlockFC.slot},${this.chain.anchorStateLatestBlockSlot}`, { seqs: JSON.stringify(filteredSeqs) });
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (e) {
|
|
81
|
-
this.logger.error("Error updating backfilledRanges on finalization", { epoch: finalized.epoch }, e);
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
this.archiveBlobEpochs = opts.archiveBlobEpochs;
|
|
85
|
-
this.statesArchiver = new StatesArchiver(chain.regen, db, logger, opts, chain.bufferPool);
|
|
86
|
-
this.prevFinalized = chain.forkChoice.getFinalizedCheckpoint();
|
|
87
|
-
this.jobQueue = new JobItemQueue(this.processFinalizedCheckpoint, {
|
|
88
|
-
maxLength: PROCESS_FINALIZED_CHECKPOINT_QUEUE_LEN,
|
|
89
|
-
signal,
|
|
90
|
-
});
|
|
91
|
-
if (!opts.disableArchiveOnCheckpoint) {
|
|
92
|
-
this.chain.emitter.on(ChainEvent.forkChoiceFinalized, this.onFinalizedCheckpoint);
|
|
93
|
-
this.chain.emitter.on(ChainEvent.checkpoint, this.onCheckpoint);
|
|
94
|
-
signal.addEventListener("abort", () => {
|
|
95
|
-
this.chain.emitter.off(ChainEvent.forkChoiceFinalized, this.onFinalizedCheckpoint);
|
|
96
|
-
this.chain.emitter.off(ChainEvent.checkpoint, this.onCheckpoint);
|
|
97
|
-
}, { once: true });
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
/** Archive latest finalized state */
|
|
101
|
-
async persistToDisk() {
|
|
102
|
-
await this.statesArchiver.archiveState(this.chain.forkChoice.getFinalizedCheckpoint());
|
|
103
|
-
}
|
|
104
|
-
}
|
|
1
|
+
export * from "./archiver.js";
|
|
2
|
+
export * from "./interface.js";
|
|
105
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/chain/archiver/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/chain/archiver/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { CheckpointWithHex } from "@lodestar/fork-choice";
|
|
2
|
+
import { Metrics } from "../../metrics/metrics.js";
|
|
3
|
+
import { RootHex } from "@lodestar/types";
|
|
4
|
+
export declare enum StateArchiveMode {
|
|
5
|
+
Frequency = "frequency"
|
|
6
|
+
}
|
|
7
|
+
export interface StatesArchiverOpts {
|
|
8
|
+
/**
|
|
9
|
+
* Minimum number of epochs between archived states
|
|
10
|
+
*/
|
|
11
|
+
archiveStateEpochFrequency: number;
|
|
12
|
+
/**
|
|
13
|
+
* Strategy to store archive states
|
|
14
|
+
*/
|
|
15
|
+
stateArchiveMode: StateArchiveMode;
|
|
16
|
+
}
|
|
17
|
+
export type ArchiverOpts = StatesArchiverOpts & {
|
|
18
|
+
disableArchiveOnCheckpoint?: boolean;
|
|
19
|
+
archiveBlobEpochs?: number;
|
|
20
|
+
};
|
|
21
|
+
export type ProposalStats = {
|
|
22
|
+
total: number;
|
|
23
|
+
finalized: number;
|
|
24
|
+
orphaned: number;
|
|
25
|
+
missed: number;
|
|
26
|
+
};
|
|
27
|
+
export type FinalizedStats = {
|
|
28
|
+
allValidators: ProposalStats;
|
|
29
|
+
attachedValidators: ProposalStats;
|
|
30
|
+
finalizedCanonicalCheckpointsCount: number;
|
|
31
|
+
finalizedFoundCheckpointsInStateCache: number;
|
|
32
|
+
finalizedAttachedValidatorsCount: number;
|
|
33
|
+
};
|
|
34
|
+
export interface StateArchiveStrategy {
|
|
35
|
+
onCheckpoint(stateRoot: RootHex, metrics?: Metrics | null): Promise<void>;
|
|
36
|
+
onFinalizedCheckpoint(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void>;
|
|
37
|
+
maybeArchiveState(finalized: CheckpointWithHex, metrics?: Metrics | null): Promise<void>;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=interface.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export var StateArchiveMode;
|
|
2
|
+
(function (StateArchiveMode) {
|
|
3
|
+
StateArchiveMode["Frequency"] = "frequency";
|
|
4
|
+
// New strategy to be implemented
|
|
5
|
+
// WIP: https://github.com/ChainSafe/lodestar/pull/7005
|
|
6
|
+
// Differential = "diff",
|
|
7
|
+
})(StateArchiveMode || (StateArchiveMode = {}));
|
|
8
|
+
//# sourceMappingURL=interface.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interface.js","sourceRoot":"","sources":["../../../src/chain/archiver/interface.ts"],"names":[],"mappings":"AAIA,MAAM,CAAN,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,2CAAuB,CAAA;IACvB,iCAAiC;IACjC,uDAAuD;IACvD,yBAAyB;AAC3B,CAAC,EALW,gBAAgB,KAAhB,gBAAgB,QAK3B"}
|
package/lib/chain/archiver/{archiveStates.d.ts → strategies/frequencyStateArchiveStrategy.d.ts}
RENAMED
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { Logger } from "@lodestar/utils";
|
|
2
|
-
import { Slot, Epoch } from "@lodestar/types";
|
|
2
|
+
import { Slot, Epoch, RootHex } from "@lodestar/types";
|
|
3
3
|
import { CheckpointWithHex } from "@lodestar/fork-choice";
|
|
4
|
-
import { IBeaconDb } from "
|
|
5
|
-
import { IStateRegenerator } from "
|
|
6
|
-
import { BufferPool } from "
|
|
7
|
-
import { Metrics } from "
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import { IBeaconDb } from "../../../db/index.js";
|
|
5
|
+
import { IStateRegenerator } from "../../regen/interface.js";
|
|
6
|
+
import { BufferPool } from "../../../util/bufferPool.js";
|
|
7
|
+
import { Metrics } from "../../../metrics/metrics.js";
|
|
8
|
+
import { StateArchiveStrategy, StatesArchiverOpts } from "../interface.js";
|
|
9
|
+
/**
|
|
10
|
+
* Minimum number of epochs between single temp archived states
|
|
11
|
+
* These states will be pruned once a new state is persisted
|
|
12
|
+
*/
|
|
13
|
+
export declare const PERSIST_TEMP_STATE_EVERY_EPOCHS = 32;
|
|
14
14
|
/**
|
|
15
15
|
* Archives finalized states from active bucket to archive bucket.
|
|
16
16
|
*
|
|
17
17
|
* Only the new finalized state is stored to disk
|
|
18
18
|
*/
|
|
19
|
-
export declare class
|
|
19
|
+
export declare class FrequencyStateArchiveStrategy implements StateArchiveStrategy {
|
|
20
20
|
private readonly regen;
|
|
21
21
|
private readonly db;
|
|
22
22
|
private readonly logger;
|
|
23
23
|
private readonly opts;
|
|
24
24
|
private readonly bufferPool?;
|
|
25
25
|
constructor(regen: IStateRegenerator, db: IBeaconDb, logger: Logger, opts: StatesArchiverOpts, bufferPool?: BufferPool | null | undefined);
|
|
26
|
+
onFinalizedCheckpoint(_finalized: CheckpointWithHex, _metrics?: Metrics | null): Promise<void>;
|
|
27
|
+
onCheckpoint(_stateRoot: RootHex, _metrics?: Metrics | null): Promise<void>;
|
|
26
28
|
/**
|
|
27
29
|
* Persist states every some epochs to
|
|
28
30
|
* - Minimize disk space, storing the least states possible
|
|
@@ -40,10 +42,10 @@ export declare class StatesArchiver {
|
|
|
40
42
|
* Archives finalized states from active bucket to archive bucket.
|
|
41
43
|
* Only the new finalized state is stored to disk
|
|
42
44
|
*/
|
|
43
|
-
archiveState
|
|
45
|
+
private archiveState;
|
|
44
46
|
}
|
|
45
47
|
/**
|
|
46
48
|
* Keeps first epoch per interval of persistEveryEpochs, deletes the rest
|
|
47
49
|
*/
|
|
48
50
|
export declare function computeStateSlotsToDelete(storedStateSlots: Slot[], persistEveryEpochs: Epoch): Slot[];
|
|
49
|
-
//# sourceMappingURL=
|
|
51
|
+
//# sourceMappingURL=frequencyStateArchiveStrategy.d.ts.map
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { SLOTS_PER_EPOCH } from "@lodestar/params";
|
|
2
2
|
import { computeEpochAtSlot, computeStartSlotAtEpoch } from "@lodestar/state-transition";
|
|
3
|
-
import { getStateSlotFromBytes } from "
|
|
4
|
-
import { serializeState } from "
|
|
5
|
-
import { AllocSource } from "
|
|
3
|
+
import { getStateSlotFromBytes } from "../../../util/multifork.js";
|
|
4
|
+
import { serializeState } from "../../serializeState.js";
|
|
5
|
+
import { AllocSource } from "../../../util/bufferPool.js";
|
|
6
6
|
/**
|
|
7
7
|
* Minimum number of epochs between single temp archived states
|
|
8
8
|
* These states will be pruned once a new state is persisted
|
|
9
9
|
*/
|
|
10
|
-
const PERSIST_TEMP_STATE_EVERY_EPOCHS = 32;
|
|
10
|
+
export const PERSIST_TEMP_STATE_EVERY_EPOCHS = 32;
|
|
11
11
|
/**
|
|
12
12
|
* Archives finalized states from active bucket to archive bucket.
|
|
13
13
|
*
|
|
14
14
|
* Only the new finalized state is stored to disk
|
|
15
15
|
*/
|
|
16
|
-
export class
|
|
16
|
+
export class FrequencyStateArchiveStrategy {
|
|
17
17
|
constructor(regen, db, logger, opts, bufferPool) {
|
|
18
18
|
this.regen = regen;
|
|
19
19
|
this.db = db;
|
|
@@ -21,6 +21,8 @@ export class StatesArchiver {
|
|
|
21
21
|
this.opts = opts;
|
|
22
22
|
this.bufferPool = bufferPool;
|
|
23
23
|
}
|
|
24
|
+
async onFinalizedCheckpoint(_finalized, _metrics) { }
|
|
25
|
+
async onCheckpoint(_stateRoot, _metrics) { }
|
|
24
26
|
/**
|
|
25
27
|
* Persist states every some epochs to
|
|
26
28
|
* - Minimize disk space, storing the least states possible
|
|
@@ -108,4 +110,4 @@ export function computeStateSlotsToDelete(storedStateSlots, persistEveryEpochs)
|
|
|
108
110
|
}
|
|
109
111
|
return Array.from(stateSlotsToDelete.values());
|
|
110
112
|
}
|
|
111
|
-
//# sourceMappingURL=
|
|
113
|
+
//# sourceMappingURL=frequencyStateArchiveStrategy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frequencyStateArchiveStrategy.js","sourceRoot":"","sources":["../../../../src/chain/archiver/strategies/frequencyStateArchiveStrategy.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,eAAe,EAAC,MAAM,kBAAkB,CAAC;AAEjD,OAAO,EAA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AG,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,iBAAiB,CAAC,CAAC;QACtD,IAAI,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YACtC,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;aAAM,CAAC;YACN,mBAAmB,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,kBAAkB,CAAC,MAAM,EAAE,CAAC,CAAC;AACjD,CAAC"}
|
package/lib/chain/chain.js
CHANGED
|
@@ -19,7 +19,7 @@ import { BlsSingleThreadVerifier, BlsMultiThreadWorkerPool } from "./bls/index.j
|
|
|
19
19
|
import { SeenAttesters, SeenAggregators, SeenBlockProposers, SeenSyncCommitteeMessages, SeenContributionAndProof, } from "./seenCache/index.js";
|
|
20
20
|
import { AggregatedAttestationPool, AttestationPool, SyncCommitteeMessagePool, SyncContributionAndProofPool, OpPool, } from "./opPools/index.js";
|
|
21
21
|
import { LightClientServer } from "./lightClient/index.js";
|
|
22
|
-
import { Archiver } from "./archiver/
|
|
22
|
+
import { Archiver } from "./archiver/archiver.js";
|
|
23
23
|
import { PrepareNextSlotScheduler } from "./prepareNextSlot.js";
|
|
24
24
|
import { ReprocessController } from "./reprocess.js";
|
|
25
25
|
import { SeenAggregatedAttestations } from "./seenCache/seenAggregateAndProof.js";
|