@aztec/prover-node 5.0.0-private.20260319 → 5.0.0-rc.1
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/README.md +506 -0
- package/dest/actions/download-epoch-proving-job.js +1 -1
- package/dest/actions/rerun-epoch-proving-job.d.ts +4 -3
- package/dest/actions/rerun-epoch-proving-job.d.ts.map +1 -1
- package/dest/actions/rerun-epoch-proving-job.js +103 -21
- package/dest/bin/run-failed-epoch.js +1 -3
- package/dest/checkpoint-store.d.ts +83 -0
- package/dest/checkpoint-store.d.ts.map +1 -0
- package/dest/checkpoint-store.js +181 -0
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +1 -1
- package/dest/factory.d.ts +1 -1
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +22 -8
- package/dest/index.d.ts +2 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -0
- package/dest/job/checkpoint-prover.d.ts +134 -0
- package/dest/job/checkpoint-prover.d.ts.map +1 -0
- package/dest/job/checkpoint-prover.js +350 -0
- package/dest/job/epoch-session.d.ts +146 -0
- package/dest/job/epoch-session.d.ts.map +1 -0
- package/dest/job/epoch-session.js +709 -0
- package/dest/job/top-tree-job.d.ts +82 -0
- package/dest/job/top-tree-job.d.ts.map +1 -0
- package/dest/job/top-tree-job.js +152 -0
- package/dest/metrics.d.ts +29 -5
- package/dest/metrics.d.ts.map +1 -1
- package/dest/metrics.js +73 -9
- package/dest/monitors/epoch-monitor.js +6 -2
- package/dest/proof-publishing-service.d.ts +159 -0
- package/dest/proof-publishing-service.d.ts.map +1 -0
- package/dest/proof-publishing-service.js +334 -0
- package/dest/prover-node-publisher.d.ts +18 -11
- package/dest/prover-node-publisher.d.ts.map +1 -1
- package/dest/prover-node-publisher.js +195 -57
- package/dest/prover-node.d.ts +96 -68
- package/dest/prover-node.d.ts.map +1 -1
- package/dest/prover-node.js +382 -227
- package/dest/prover-publisher-factory.d.ts +2 -2
- package/dest/prover-publisher-factory.d.ts.map +1 -1
- package/dest/prover-publisher-factory.js +3 -3
- package/dest/session-manager.d.ts +158 -0
- package/dest/session-manager.d.ts.map +1 -0
- package/dest/session-manager.js +452 -0
- package/dest/test/index.d.ts +7 -6
- package/dest/test/index.d.ts.map +1 -1
- package/package.json +23 -23
- package/src/actions/download-epoch-proving-job.ts +1 -1
- package/src/actions/rerun-epoch-proving-job.ts +114 -28
- package/src/bin/run-failed-epoch.ts +1 -2
- package/src/checkpoint-store.ts +213 -0
- package/src/config.ts +2 -1
- package/src/factory.ts +18 -10
- package/src/index.ts +1 -0
- package/src/job/checkpoint-prover.ts +465 -0
- package/src/job/epoch-session.ts +424 -0
- package/src/job/top-tree-job.ts +227 -0
- package/src/metrics.ts +88 -12
- package/src/monitors/epoch-monitor.ts +2 -2
- package/src/proof-publishing-service.ts +424 -0
- package/src/prover-node-publisher.ts +220 -67
- package/src/prover-node.ts +439 -249
- package/src/prover-publisher-factory.ts +3 -3
- package/src/session-manager.ts +552 -0
- package/src/test/index.ts +6 -6
- package/dest/job/epoch-proving-job.d.ts +0 -63
- package/dest/job/epoch-proving-job.d.ts.map +0 -1
- package/dest/job/epoch-proving-job.js +0 -762
- package/src/job/epoch-proving-job.ts +0 -465
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { type ARCHIVE_HEIGHT } from '@aztec/constants';
|
|
2
|
+
import { type EpochNumber, type SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
6
|
+
import type { Tuple } from '@aztec/foundation/serialize';
|
|
7
|
+
import { type DateProvider } from '@aztec/foundation/timer';
|
|
8
|
+
import type { EpochProverFactory } from '@aztec/prover-client';
|
|
9
|
+
import type { ChonkCache, SubTreeResult } from '@aztec/prover-client/orchestrator';
|
|
10
|
+
import type { PublicProcessorFactory } from '@aztec/simulator/server';
|
|
11
|
+
import type { CommitteeAttestation } from '@aztec/stdlib/block';
|
|
12
|
+
import type { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
13
|
+
import type { ForkMerkleTreeOperations, ITxProvider } from '@aztec/stdlib/interfaces/server';
|
|
14
|
+
import type { BlockHeader, Tx } from '@aztec/stdlib/tx';
|
|
15
|
+
import type { ProverNodeJobMetrics } from '../metrics.js';
|
|
16
|
+
/** Dependencies a `CheckpointProver` needs at construction. */
|
|
17
|
+
export type CheckpointProverDeps = {
|
|
18
|
+
proverFactory: EpochProverFactory;
|
|
19
|
+
/** Shared chonk-verifier cache. Survives across all sessions / epochs. */
|
|
20
|
+
chonkCache: ChonkCache;
|
|
21
|
+
publicProcessorFactory: PublicProcessorFactory;
|
|
22
|
+
dbProvider: Pick<ForkMerkleTreeOperations, 'fork'>;
|
|
23
|
+
txProvider: ITxProvider;
|
|
24
|
+
/** Clock the prover-node operates against — e2e fixtures inject a cheat-controlled one. */
|
|
25
|
+
dateProvider: DateProvider;
|
|
26
|
+
proverId: EthAddress;
|
|
27
|
+
metrics: ProverNodeJobMetrics;
|
|
28
|
+
/** Tx gathering deadline. */
|
|
29
|
+
txGatheringTimeoutMs: number;
|
|
30
|
+
/** Public processor deadline. */
|
|
31
|
+
deadline: Date | undefined;
|
|
32
|
+
log: Logger;
|
|
33
|
+
};
|
|
34
|
+
/** Inputs that fully describe a checkpoint at register time. */
|
|
35
|
+
export type CheckpointProverArgs = {
|
|
36
|
+
checkpoint: Checkpoint;
|
|
37
|
+
/** Epoch the checkpoint belongs to (derivable from slot + L1 constants; cached at register time). */
|
|
38
|
+
epochNumber: EpochNumber;
|
|
39
|
+
attestations: CommitteeAttestation[];
|
|
40
|
+
previousBlockHeader: BlockHeader;
|
|
41
|
+
l1ToL2Messages: Fr[];
|
|
42
|
+
previousArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Self-contained per-checkpoint prover, content-addressed by
|
|
46
|
+
* `(checkpoint number, slot number, checkpoint archive root)`.
|
|
47
|
+
*
|
|
48
|
+
* The store creates a CheckpointProver once per content-key. Keying on the checkpoint's
|
|
49
|
+
* own archive root (its post-state) means two checkpoints are "the same" iff they
|
|
50
|
+
* produce the same archive — so a reorg branch, or a replacement built on the same
|
|
51
|
+
* predecessor but with different content, keys to a distinct prover; an identical
|
|
52
|
+
* re-add keys to the same one and reuses its in-flight sub-tree work.
|
|
53
|
+
*
|
|
54
|
+
* The prover eagerly starts its own tx gather and sub-tree work in the constructor, so
|
|
55
|
+
* callers only need to call `whenBlockProofsReady()` to obtain the resulting block-rollup
|
|
56
|
+
* proofs.
|
|
57
|
+
*
|
|
58
|
+
* The prover survives prune/re-add cycles via `markPruned()` / `markCanonical()` —
|
|
59
|
+
* sub-tree proving keeps running underneath, so a checkpoint that is re-added after
|
|
60
|
+
* a brief reorg can be re-consumed with no re-proving.
|
|
61
|
+
*
|
|
62
|
+
* `cancel()` is idempotent. It aborts the gather + sub-tree, rejects the block-proof
|
|
63
|
+
* promise, and exposes a `whenDone()` that resolves once teardown has unwound.
|
|
64
|
+
*/
|
|
65
|
+
export declare class CheckpointProver {
|
|
66
|
+
private readonly deps;
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly checkpoint: Checkpoint;
|
|
69
|
+
readonly epochNumber: EpochNumber;
|
|
70
|
+
readonly slotNumber: SlotNumber;
|
|
71
|
+
readonly attestations: CommitteeAttestation[];
|
|
72
|
+
readonly previousBlockHeader: BlockHeader;
|
|
73
|
+
readonly l1ToL2Messages: Fr[];
|
|
74
|
+
readonly previousArchiveSiblingPath: Tuple<Fr, typeof ARCHIVE_HEIGHT>;
|
|
75
|
+
/** Per-prover tx map — populated by the internal gather. Empty until then. */
|
|
76
|
+
readonly txs: Map<string, Tx>;
|
|
77
|
+
/** Resolved by the sub-tree on success, rejected on cancel/failure. */
|
|
78
|
+
private readonly blockProofs;
|
|
79
|
+
private cancelled;
|
|
80
|
+
private subTree?;
|
|
81
|
+
private completed;
|
|
82
|
+
/** Pruned in the canonical chain but not yet reaped — sub-tree continues running. */
|
|
83
|
+
private pruned;
|
|
84
|
+
private readonly abortController;
|
|
85
|
+
/** Tracks the eager gather+execute task so `cancel()` and `whenDone()` can await its unwind. */
|
|
86
|
+
private readonly runPromise;
|
|
87
|
+
/** Tracks the cancel-driven teardown so `whenDone()` can await it. */
|
|
88
|
+
private cancelPromise?;
|
|
89
|
+
constructor(args: CheckpointProverArgs, deps: CheckpointProverDeps);
|
|
90
|
+
/**
|
|
91
|
+
* Stable content-addressed identifier: `${checkpoint number}:${slot}:${archive root}`.
|
|
92
|
+
* The archive root is the checkpoint's post-state, so it distinguishes any two
|
|
93
|
+
* checkpoints that differ in history or content while collapsing identical re-adds.
|
|
94
|
+
*/
|
|
95
|
+
static idFor(checkpoint: Checkpoint): string;
|
|
96
|
+
isCancelled(): boolean;
|
|
97
|
+
/** True once block-level proving has been fully *enqueued* (sub-tree completion may still be pending). */
|
|
98
|
+
isCompleted(): boolean;
|
|
99
|
+
isPruned(): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Mark this prover as no longer present in the canonical chain. Sub-tree proving keeps
|
|
102
|
+
* running so the work survives if the checkpoint is re-added. Idempotent.
|
|
103
|
+
*/
|
|
104
|
+
markPruned(): void;
|
|
105
|
+
/** Mark this prover as part of the canonical chain again after a re-add. Idempotent. */
|
|
106
|
+
markCanonical(): void;
|
|
107
|
+
/** AbortSignal that fires on cancel — for callers that want to wire their own tasks. */
|
|
108
|
+
getAbortSignal(): AbortSignal;
|
|
109
|
+
/** Promise that resolves with the block-rollup proofs for this checkpoint (or rejects on cancel/failure). */
|
|
110
|
+
whenBlockProofsReady(): Promise<SubTreeResult['blockProofOutputs']>;
|
|
111
|
+
/** Resolves when all in-flight work for this prover has fully unwound. */
|
|
112
|
+
whenDone(): Promise<void>;
|
|
113
|
+
private gatherAndExecute;
|
|
114
|
+
private gatherTxs;
|
|
115
|
+
private executeCheckpoint;
|
|
116
|
+
/**
|
|
117
|
+
* Mark cancelled. Idempotent. Aborts in-flight work, rejects the block-proof promise,
|
|
118
|
+
* and kicks off a background teardown of the sub-tree. The teardown promise is exposed
|
|
119
|
+
* via `whenDone()`.
|
|
120
|
+
*
|
|
121
|
+
* `routine` distinguishes a post-finalize teardown (sub-tree already proven, fires
|
|
122
|
+
* once at prover exit) from a real abort (reorg, prune, deadline). Behaviour is
|
|
123
|
+
* identical either way; the flag only adjusts log verbosity.
|
|
124
|
+
*/
|
|
125
|
+
cancel({ routine }?: {
|
|
126
|
+
routine?: boolean;
|
|
127
|
+
}): void;
|
|
128
|
+
private runCancel;
|
|
129
|
+
private teardownSubTree;
|
|
130
|
+
private getTxsForBlock;
|
|
131
|
+
private processTxs;
|
|
132
|
+
private createFork;
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2twb2ludC1wcm92ZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9qb2IvY2hlY2twb2ludC1wcm92ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLEtBQUssY0FBYyxFQUF1QyxNQUFNLGtCQUFrQixDQUFDO0FBQzVGLE9BQU8sRUFBZSxLQUFLLFdBQVcsRUFBRSxLQUFLLFVBQVUsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRWpHLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUVwRCxPQUFPLEtBQUssRUFBR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AAwF;IACjF,cAAc,IAAI,WAAW,CAEnC;IAED,6GAA6G;IACtG,oBAAoB,IAAI,OAAO,CAAC,aAAa,CAAC,mBAAmB,CAAC,CAAC,CAEzE;IAED,0EAA0E;IAC7D,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAKrC;YAEa,gBAAgB;YAqBhB,SAAS;YAgBT,iBAAiB;IAmI/B;;;;;;;;OAQG;IACI,MAAM,CAAC,EAAE,OAAe,EAAE,GAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI,CAqBnE;YAEa,SAAS;YAcT,eAAe;IAe7B,OAAO,CAAC,cAAc;YAIR,UAAU;YAmBV,UAAU;CAezB"}
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
4
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
|
+
import { promiseWithResolvers } from '@aztec/foundation/promise';
|
|
6
|
+
import { Timer } from '@aztec/foundation/timer';
|
|
7
|
+
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
8
|
+
import { protocolContractsHash } from '@aztec/protocol-contracts';
|
|
9
|
+
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
10
|
+
import { CheckpointConstantData } from '@aztec/stdlib/rollup';
|
|
11
|
+
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
12
|
+
/**
|
|
13
|
+
* Self-contained per-checkpoint prover, content-addressed by
|
|
14
|
+
* `(checkpoint number, slot number, checkpoint archive root)`.
|
|
15
|
+
*
|
|
16
|
+
* The store creates a CheckpointProver once per content-key. Keying on the checkpoint's
|
|
17
|
+
* own archive root (its post-state) means two checkpoints are "the same" iff they
|
|
18
|
+
* produce the same archive — so a reorg branch, or a replacement built on the same
|
|
19
|
+
* predecessor but with different content, keys to a distinct prover; an identical
|
|
20
|
+
* re-add keys to the same one and reuses its in-flight sub-tree work.
|
|
21
|
+
*
|
|
22
|
+
* The prover eagerly starts its own tx gather and sub-tree work in the constructor, so
|
|
23
|
+
* callers only need to call `whenBlockProofsReady()` to obtain the resulting block-rollup
|
|
24
|
+
* proofs.
|
|
25
|
+
*
|
|
26
|
+
* The prover survives prune/re-add cycles via `markPruned()` / `markCanonical()` —
|
|
27
|
+
* sub-tree proving keeps running underneath, so a checkpoint that is re-added after
|
|
28
|
+
* a brief reorg can be re-consumed with no re-proving.
|
|
29
|
+
*
|
|
30
|
+
* `cancel()` is idempotent. It aborts the gather + sub-tree, rejects the block-proof
|
|
31
|
+
* promise, and exposes a `whenDone()` that resolves once teardown has unwound.
|
|
32
|
+
*/ export class CheckpointProver {
|
|
33
|
+
deps;
|
|
34
|
+
id;
|
|
35
|
+
checkpoint;
|
|
36
|
+
epochNumber;
|
|
37
|
+
slotNumber;
|
|
38
|
+
attestations;
|
|
39
|
+
previousBlockHeader;
|
|
40
|
+
l1ToL2Messages;
|
|
41
|
+
previousArchiveSiblingPath;
|
|
42
|
+
/** Per-prover tx map — populated by the internal gather. Empty until then. */ txs;
|
|
43
|
+
/** Resolved by the sub-tree on success, rejected on cancel/failure. */ blockProofs;
|
|
44
|
+
cancelled;
|
|
45
|
+
subTree;
|
|
46
|
+
completed;
|
|
47
|
+
/** Pruned in the canonical chain but not yet reaped — sub-tree continues running. */ pruned;
|
|
48
|
+
abortController;
|
|
49
|
+
/** Tracks the eager gather+execute task so `cancel()` and `whenDone()` can await its unwind. */ runPromise;
|
|
50
|
+
/** Tracks the cancel-driven teardown so `whenDone()` can await it. */ cancelPromise;
|
|
51
|
+
constructor(args, deps){
|
|
52
|
+
this.deps = deps;
|
|
53
|
+
this.txs = new Map();
|
|
54
|
+
this.blockProofs = promiseWithResolvers();
|
|
55
|
+
this.cancelled = false;
|
|
56
|
+
this.completed = false;
|
|
57
|
+
this.pruned = false;
|
|
58
|
+
this.abortController = new AbortController();
|
|
59
|
+
this.checkpoint = args.checkpoint;
|
|
60
|
+
this.epochNumber = args.epochNumber;
|
|
61
|
+
this.slotNumber = args.checkpoint.header.slotNumber;
|
|
62
|
+
this.attestations = args.attestations;
|
|
63
|
+
this.previousBlockHeader = args.previousBlockHeader;
|
|
64
|
+
this.l1ToL2Messages = args.l1ToL2Messages;
|
|
65
|
+
this.previousArchiveSiblingPath = args.previousArchiveSiblingPath;
|
|
66
|
+
this.id = CheckpointProver.idFor(args.checkpoint);
|
|
67
|
+
// Mark blockProofs as observed so a cancel that lands before any consumer awaits
|
|
68
|
+
// does not surface as an unhandled rejection.
|
|
69
|
+
this.blockProofs.promise.catch(()=>{});
|
|
70
|
+
deps.log.info(`Created CheckpointProver ${this.id}`, {
|
|
71
|
+
checkpointNumber: this.checkpoint.number,
|
|
72
|
+
epochNumber: this.epochNumber,
|
|
73
|
+
slotNumber: this.slotNumber,
|
|
74
|
+
blockCount: this.checkpoint.blocks.length,
|
|
75
|
+
l1ToL2MessageCount: this.l1ToL2Messages.length,
|
|
76
|
+
archiveRoot: this.checkpoint.archive.root.toString()
|
|
77
|
+
});
|
|
78
|
+
// Kick off the eager gather + sub-tree pipeline.
|
|
79
|
+
this.runPromise = this.gatherAndExecute();
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Stable content-addressed identifier: `${checkpoint number}:${slot}:${archive root}`.
|
|
83
|
+
* The archive root is the checkpoint's post-state, so it distinguishes any two
|
|
84
|
+
* checkpoints that differ in history or content while collapsing identical re-adds.
|
|
85
|
+
*/ static idFor(checkpoint) {
|
|
86
|
+
return `${checkpoint.number}:${checkpoint.header.slotNumber}:${checkpoint.archive.root.toString()}`;
|
|
87
|
+
}
|
|
88
|
+
isCancelled() {
|
|
89
|
+
return this.cancelled;
|
|
90
|
+
}
|
|
91
|
+
/** True once block-level proving has been fully *enqueued* (sub-tree completion may still be pending). */ isCompleted() {
|
|
92
|
+
return this.completed;
|
|
93
|
+
}
|
|
94
|
+
isPruned() {
|
|
95
|
+
return this.pruned;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Mark this prover as no longer present in the canonical chain. Sub-tree proving keeps
|
|
99
|
+
* running so the work survives if the checkpoint is re-added. Idempotent.
|
|
100
|
+
*/ markPruned() {
|
|
101
|
+
if (this.pruned) {
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
this.pruned = true;
|
|
105
|
+
this.deps.log.info(`Marking CheckpointProver ${this.id} as pruned`, {
|
|
106
|
+
checkpointNumber: this.checkpoint.number,
|
|
107
|
+
slotNumber: this.slotNumber
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
/** Mark this prover as part of the canonical chain again after a re-add. Idempotent. */ markCanonical() {
|
|
111
|
+
if (!this.pruned) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
this.pruned = false;
|
|
115
|
+
this.deps.log.info(`Marking CheckpointProver ${this.id} as canonical`, {
|
|
116
|
+
checkpointNumber: this.checkpoint.number,
|
|
117
|
+
slotNumber: this.slotNumber
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
/** AbortSignal that fires on cancel — for callers that want to wire their own tasks. */ getAbortSignal() {
|
|
121
|
+
return this.abortController.signal;
|
|
122
|
+
}
|
|
123
|
+
/** Promise that resolves with the block-rollup proofs for this checkpoint (or rejects on cancel/failure). */ whenBlockProofsReady() {
|
|
124
|
+
return this.blockProofs.promise;
|
|
125
|
+
}
|
|
126
|
+
/** Resolves when all in-flight work for this prover has fully unwound. */ async whenDone() {
|
|
127
|
+
await this.runPromise.catch(()=>{});
|
|
128
|
+
if (this.cancelPromise) {
|
|
129
|
+
await this.cancelPromise;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
async gatherAndExecute() {
|
|
133
|
+
try {
|
|
134
|
+
const txs = await this.gatherTxs();
|
|
135
|
+
if (this.cancelled) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
await this.executeCheckpoint(txs);
|
|
139
|
+
} catch (err) {
|
|
140
|
+
if (this.cancelled) {
|
|
141
|
+
this.deps.log.debug(`CheckpointProver ${this.id} cancelled during gather/execute`, {
|
|
142
|
+
checkpointNumber: this.checkpoint.number
|
|
143
|
+
});
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
this.deps.log.error(`Error in CheckpointProver ${this.id}`, err, {
|
|
147
|
+
checkpointNumber: this.checkpoint.number
|
|
148
|
+
});
|
|
149
|
+
this.blockProofs.reject(err instanceof Error ? err : new Error(String(err)));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
async gatherTxs() {
|
|
153
|
+
const deadline = new Date(this.deps.dateProvider.now() + this.deps.txGatheringTimeoutMs);
|
|
154
|
+
const txsByBlock = await Promise.all(this.checkpoint.blocks.map((block)=>this.deps.txProvider.getTxsForBlock(block, {
|
|
155
|
+
deadline
|
|
156
|
+
})));
|
|
157
|
+
const txs = txsByBlock.map(({ txs })=>txs).flat();
|
|
158
|
+
const missingTxs = txsByBlock.map(({ missingTxs })=>missingTxs).flat();
|
|
159
|
+
if (missingTxs.length > 0) {
|
|
160
|
+
throw new Error(`Txs not found for checkpoint ${this.checkpoint.number}: ${missingTxs.map((hash)=>hash.toString()).join(', ')}`);
|
|
161
|
+
}
|
|
162
|
+
return new Map(txs.map((tx)=>[
|
|
163
|
+
tx.getTxHash().toString(),
|
|
164
|
+
tx
|
|
165
|
+
]));
|
|
166
|
+
}
|
|
167
|
+
async executeCheckpoint(txs) {
|
|
168
|
+
const signal = this.abortController.signal;
|
|
169
|
+
const checkpointTimer = new Timer();
|
|
170
|
+
let subTreeStarted = false;
|
|
171
|
+
try {
|
|
172
|
+
for (const [hash, tx] of txs){
|
|
173
|
+
this.txs.set(hash, tx);
|
|
174
|
+
}
|
|
175
|
+
const { chainId, version } = this.checkpoint.blocks[0].header.globalVariables;
|
|
176
|
+
const checkpointConstants = CheckpointConstantData.from({
|
|
177
|
+
chainId,
|
|
178
|
+
version,
|
|
179
|
+
vkTreeRoot: getVKTreeRoot(),
|
|
180
|
+
protocolContractsHash: protocolContractsHash,
|
|
181
|
+
proverId: this.deps.proverId.toField(),
|
|
182
|
+
slotNumber: this.checkpoint.header.slotNumber,
|
|
183
|
+
coinbase: this.checkpoint.header.coinbase,
|
|
184
|
+
feeRecipient: this.checkpoint.header.feeRecipient,
|
|
185
|
+
gasFees: this.checkpoint.header.gasFees
|
|
186
|
+
});
|
|
187
|
+
this.deps.log.info(`Starting processing checkpoint ${this.checkpoint.number}`, {
|
|
188
|
+
checkpointNumber: this.checkpoint.number,
|
|
189
|
+
checkpointHash: this.checkpoint.hash().toString(),
|
|
190
|
+
blockCount: this.checkpoint.blocks.length
|
|
191
|
+
});
|
|
192
|
+
this.subTree = await this.deps.proverFactory.createCheckpointSubTreeOrchestrator(this.deps.chonkCache, this.epochNumber, checkpointConstants, this.l1ToL2Messages, this.checkpoint.blocks.length, this.previousBlockHeader);
|
|
193
|
+
subTreeStarted = true;
|
|
194
|
+
// Bridge the sub-tree's result onto blockProofs.
|
|
195
|
+
void this.subTree.getSubTreeResult().then((result)=>{
|
|
196
|
+
this.deps.log.info(`Sub-tree block proofs ready for checkpoint ${this.checkpoint.number}`, {
|
|
197
|
+
checkpointNumber: this.checkpoint.number,
|
|
198
|
+
blockProofCount: result.blockProofOutputs.length
|
|
199
|
+
});
|
|
200
|
+
this.blockProofs.resolve(result.blockProofOutputs);
|
|
201
|
+
}, (err)=>this.blockProofs.reject(err));
|
|
202
|
+
if (signal.aborted) {
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
205
|
+
const allTxs = this.checkpoint.blocks.flatMap((block)=>block.body.txEffects.map((txEffect)=>txs.get(txEffect.txHash.toString())));
|
|
206
|
+
const publicTxs = allTxs.filter((tx)=>tx?.data.forPublic);
|
|
207
|
+
if (publicTxs.length > 0) {
|
|
208
|
+
await this.subTree.startChonkVerifierCircuits(publicTxs);
|
|
209
|
+
if (signal.aborted) {
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
for(let blockIndex = 0; blockIndex < this.checkpoint.blocks.length; blockIndex++){
|
|
214
|
+
const blockTimer = new Timer();
|
|
215
|
+
const block = this.checkpoint.blocks[blockIndex];
|
|
216
|
+
const globalVariables = block.header.globalVariables;
|
|
217
|
+
const blockTxs = this.getTxsForBlock(block, txs);
|
|
218
|
+
await this.subTree.startNewBlock(block.number, globalVariables.timestamp, blockTxs.length);
|
|
219
|
+
if (signal.aborted) {
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
const db = await this.createFork(BlockNumber(block.number - 1), blockIndex === 0 ? this.l1ToL2Messages : undefined);
|
|
223
|
+
try {
|
|
224
|
+
if (signal.aborted) {
|
|
225
|
+
return;
|
|
226
|
+
}
|
|
227
|
+
const config = PublicSimulatorConfig.from({
|
|
228
|
+
proverId: this.deps.proverId.toField(),
|
|
229
|
+
skipFeeEnforcement: false,
|
|
230
|
+
collectDebugLogs: false,
|
|
231
|
+
collectHints: true,
|
|
232
|
+
collectPublicInputs: true,
|
|
233
|
+
collectStatistics: false
|
|
234
|
+
});
|
|
235
|
+
const publicProcessor = this.deps.publicProcessorFactory.create(db, globalVariables, config);
|
|
236
|
+
const processed = await this.processTxs(publicProcessor, blockTxs);
|
|
237
|
+
if (signal.aborted) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
await this.subTree.addTxs(processed);
|
|
241
|
+
} finally{
|
|
242
|
+
await db.close();
|
|
243
|
+
}
|
|
244
|
+
if (signal.aborted) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
await this.subTree.setBlockCompleted(block.number, block.header);
|
|
248
|
+
this.deps.metrics.recordBlockProcessing(blockTimer.ms());
|
|
249
|
+
if (signal.aborted) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
this.completed = true;
|
|
254
|
+
this.deps.metrics.recordCheckpointProcessing(checkpointTimer.ms());
|
|
255
|
+
this.deps.log.info(`Finished enqueueing block-level proving for checkpoint ${this.checkpoint.number} in ${checkpointTimer.ms()}ms`, {
|
|
256
|
+
checkpointNumber: this.checkpoint.number,
|
|
257
|
+
blockCount: this.checkpoint.blocks.length,
|
|
258
|
+
durationMs: checkpointTimer.ms()
|
|
259
|
+
});
|
|
260
|
+
} finally{
|
|
261
|
+
if (!this.completed) {
|
|
262
|
+
if (subTreeStarted) {
|
|
263
|
+
await this.teardownSubTree();
|
|
264
|
+
}
|
|
265
|
+
this.blockProofs.reject(new Error(`Checkpoint ${this.id} did not complete block processing`));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Mark cancelled. Idempotent. Aborts in-flight work, rejects the block-proof promise,
|
|
271
|
+
* and kicks off a background teardown of the sub-tree. The teardown promise is exposed
|
|
272
|
+
* via `whenDone()`.
|
|
273
|
+
*
|
|
274
|
+
* `routine` distinguishes a post-finalize teardown (sub-tree already proven, fires
|
|
275
|
+
* once at prover exit) from a real abort (reorg, prune, deadline). Behaviour is
|
|
276
|
+
* identical either way; the flag only adjusts log verbosity.
|
|
277
|
+
*/ cancel({ routine = false } = {}) {
|
|
278
|
+
if (this.cancelled) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this.cancelled = true;
|
|
282
|
+
// A teardown of a completed prover is routine regardless of the caller's flag —
|
|
283
|
+
// we logged the work as done already, so don't relabel it as a mid-flight cancel.
|
|
284
|
+
if (routine || this.completed) {
|
|
285
|
+
this.deps.log.verbose(`Tearing down CheckpointProver ${this.id}`, {
|
|
286
|
+
checkpointNumber: this.checkpoint.number,
|
|
287
|
+
wasCompleted: this.completed
|
|
288
|
+
});
|
|
289
|
+
} else {
|
|
290
|
+
this.deps.log.info(`Cancelling in-flight CheckpointProver ${this.id}`, {
|
|
291
|
+
checkpointNumber: this.checkpoint.number,
|
|
292
|
+
wasCompleted: this.completed
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
this.abortController.abort();
|
|
296
|
+
this.blockProofs.reject(new Error(`Checkpoint ${this.id} cancelled`));
|
|
297
|
+
this.cancelPromise = this.runCancel().catch(()=>{});
|
|
298
|
+
}
|
|
299
|
+
async runCancel() {
|
|
300
|
+
if (this.subTree) {
|
|
301
|
+
try {
|
|
302
|
+
this.subTree.cancel();
|
|
303
|
+
} catch (err) {
|
|
304
|
+
this.deps.log.error('Error cancelling sub-tree', err);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
await this.runPromise.catch(()=>{});
|
|
308
|
+
if (this.subTree) {
|
|
309
|
+
await this.teardownSubTree();
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
async teardownSubTree() {
|
|
313
|
+
const { subTree } = this;
|
|
314
|
+
this.subTree = undefined;
|
|
315
|
+
if (subTree) {
|
|
316
|
+
this.deps.log.debug(`Tearing down sub-tree for checkpoint ${this.checkpoint.number}`, {
|
|
317
|
+
checkpointNumber: this.checkpoint.number
|
|
318
|
+
});
|
|
319
|
+
try {
|
|
320
|
+
await subTree.stop();
|
|
321
|
+
} catch (err) {
|
|
322
|
+
this.deps.log.error('Error stopping sub-tree', err);
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
getTxsForBlock(block, txs) {
|
|
327
|
+
return block.body.txEffects.map((txEffect)=>txs.get(txEffect.txHash.toString()));
|
|
328
|
+
}
|
|
329
|
+
async processTxs(publicProcessor, txs) {
|
|
330
|
+
const [processedTxs, failedTxs] = await publicProcessor.process(txs, {
|
|
331
|
+
deadline: this.deps.deadline
|
|
332
|
+
});
|
|
333
|
+
if (failedTxs.length) {
|
|
334
|
+
const failedTxHashes = await Promise.all(failedTxs.map(({ tx })=>tx.getTxHash()));
|
|
335
|
+
throw new Error(`Txs failed processing: ${failedTxs.map(({ error }, index)=>`${failedTxHashes[index]} (${error})`).join(', ')}`);
|
|
336
|
+
}
|
|
337
|
+
if (processedTxs.length !== txs.length) {
|
|
338
|
+
throw new Error(`Failed to process all txs: processed ${processedTxs.length} out of ${txs.length}`);
|
|
339
|
+
}
|
|
340
|
+
return processedTxs;
|
|
341
|
+
}
|
|
342
|
+
async createFork(blockNumber, l1ToL2Messages) {
|
|
343
|
+
const db = await this.deps.dbProvider.fork(blockNumber);
|
|
344
|
+
if (l1ToL2Messages !== undefined) {
|
|
345
|
+
const l1ToL2MessagesPadded = padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP, 'Too many L1 to L2 messages');
|
|
346
|
+
await db.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, l1ToL2MessagesPadded);
|
|
347
|
+
}
|
|
348
|
+
return db;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { BlockNumber, type EpochNumber, type SlotNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import { type LoggerBindings } from '@aztec/foundation/log';
|
|
4
|
+
import { type DateProvider } from '@aztec/foundation/timer';
|
|
5
|
+
import type { EpochProverFactory } from '@aztec/prover-client';
|
|
6
|
+
import { type EpochProvingJobState } from '@aztec/stdlib/interfaces/server';
|
|
7
|
+
import { type Traceable, type Tracer } from '@aztec/telemetry-client';
|
|
8
|
+
import type { ProverNodeJobMetrics } from '../metrics.js';
|
|
9
|
+
import type { ProofPublishingService } from '../proof-publishing-service.js';
|
|
10
|
+
import { CheckpointProver } from './checkpoint-prover.js';
|
|
11
|
+
import { type TopTreeProof } from './top-tree-job.js';
|
|
12
|
+
export type { EpochProvingJobState };
|
|
13
|
+
/** Full vs partial — the only behavioural difference is at the L1 submission step. */
|
|
14
|
+
export type SessionKind = 'full' | 'partial';
|
|
15
|
+
/**
|
|
16
|
+
* Identifies what a session proves: a contiguous slot range within an epoch. The
|
|
17
|
+
* concrete prover set the session holds is the *implementation* of the spec — frozen
|
|
18
|
+
* at construction time, derived from the canonical content for `[fromSlot, toSlot]`.
|
|
19
|
+
*
|
|
20
|
+
* Reconciliation in `ProverNode` is uniform across kinds: whenever the canonical
|
|
21
|
+
* content for the slot range changes, the session is cancelled and replaced with a
|
|
22
|
+
* fresh session that **preserves the slot range** but adopts the new checkpoints.
|
|
23
|
+
*
|
|
24
|
+
* Kind affects only the publishing decision (see `EpochSession`).
|
|
25
|
+
*/
|
|
26
|
+
export interface SessionSpec {
|
|
27
|
+
kind: SessionKind;
|
|
28
|
+
epochNumber: EpochNumber;
|
|
29
|
+
fromSlot: SlotNumber;
|
|
30
|
+
toSlot: SlotNumber;
|
|
31
|
+
}
|
|
32
|
+
/** Stable string key for use in maps. */
|
|
33
|
+
export declare function specKey(spec: SessionSpec): string;
|
|
34
|
+
/** Hooks tests use to interpose around the top-tree prove without monkey-patching. */
|
|
35
|
+
export type EpochSessionHooks = {
|
|
36
|
+
beforeTopTreeProve?: () => Promise<void> | void;
|
|
37
|
+
afterTopTreeProve?: () => Promise<void> | void;
|
|
38
|
+
topTreeProveOverride?: (defaultProve: () => Promise<TopTreeProof>) => Promise<TopTreeProof>;
|
|
39
|
+
};
|
|
40
|
+
export type EpochSessionOptions = {
|
|
41
|
+
/**
|
|
42
|
+
* If set, the session sleeps this many ms after `start()` (before the TopTreeJob is
|
|
43
|
+
* constructed). Lets late-arriving events (e.g. a prune) be processed before
|
|
44
|
+
* top-tree proving begins.
|
|
45
|
+
*/
|
|
46
|
+
finalizationDelayMs?: number;
|
|
47
|
+
};
|
|
48
|
+
/** Dependencies an `EpochSession` needs at construction. */
|
|
49
|
+
export type EpochSessionDeps = {
|
|
50
|
+
proverFactory: EpochProverFactory;
|
|
51
|
+
proverId: EthAddress;
|
|
52
|
+
publishingService: Pick<ProofPublishingService, 'submit' | 'withdraw'>;
|
|
53
|
+
metrics: ProverNodeJobMetrics;
|
|
54
|
+
dateProvider: DateProvider;
|
|
55
|
+
/** Optional proving deadline. The session enters `timed-out` if exceeded. */
|
|
56
|
+
deadline: Date | undefined;
|
|
57
|
+
config: EpochSessionOptions;
|
|
58
|
+
bindings?: LoggerBindings;
|
|
59
|
+
hooks?: EpochSessionHooks;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* One attempt at proving and publishing a contiguous slot range. The `SessionSpec` and
|
|
63
|
+
* the prover set are both frozen at construction time; the session does not adapt to
|
|
64
|
+
* reorgs or extensions of canonical content. Instead, `SessionManager` owns the
|
|
65
|
+
* reconciliation loop and replaces invalidated sessions wholesale (cancel + construct
|
|
66
|
+
* a fresh session with the new prover set).
|
|
67
|
+
*
|
|
68
|
+
* Each session does three things in sequence:
|
|
69
|
+
*
|
|
70
|
+
* 1. Run a `TopTreeJob` over its frozen prover subset to produce the epoch proof.
|
|
71
|
+
* 2. Hand the proof to the shared `ProofPublishingService` as a `PublishCandidate`.
|
|
72
|
+
* 3. Translate the service's outcome into a terminal session state.
|
|
73
|
+
*
|
|
74
|
+
* Everything to do with submission — predecessor gating, same-epoch dedup, deadline
|
|
75
|
+
* enforcement, and the L1 transaction itself — is the publishing service's concern.
|
|
76
|
+
* The session is just the producer of one candidate and the observer of its outcome.
|
|
77
|
+
*
|
|
78
|
+
* Lifecycle (happy path):
|
|
79
|
+
*
|
|
80
|
+
* initialized → awaiting-checkpoints → completed
|
|
81
|
+
*
|
|
82
|
+
* Terminal states map the publishing outcome: `published` → `completed`, `superseded` →
|
|
83
|
+
* `superseded`, `failed` → `failed`, `expired` → `timed-out`, `withdrawn` → `cancelled`.
|
|
84
|
+
* Additionally, the session-level deadline fires `cancel('deadline')` and transitions
|
|
85
|
+
* to `timed-out` for the pre-submit window (top-tree proving) — the publishing service
|
|
86
|
+
* handles the post-submit window via the candidate's `deadline`.
|
|
87
|
+
*
|
|
88
|
+
* `cancel()` is idempotent. It marks the session terminal, calls
|
|
89
|
+
* `publishingService.withdraw(uuid)` to drop any queued candidate (an in-flight publish
|
|
90
|
+
* runs to natural completion; the session has already settled), and tears down the
|
|
91
|
+
* top-tree job if proving is still in progress.
|
|
92
|
+
*/
|
|
93
|
+
export declare class EpochSession implements Traceable {
|
|
94
|
+
private readonly spec;
|
|
95
|
+
private readonly deps;
|
|
96
|
+
readonly tracer: Tracer;
|
|
97
|
+
private readonly uuid;
|
|
98
|
+
private readonly log;
|
|
99
|
+
private state;
|
|
100
|
+
private deadlineTimeoutHandler;
|
|
101
|
+
private topTreeJob;
|
|
102
|
+
/** Cancelled top-tree jobs whose teardown is still in flight. Awaited at session stop. */
|
|
103
|
+
private readonly pendingTopTreeCleanups;
|
|
104
|
+
private readonly completionPromise;
|
|
105
|
+
private resolveCompletion;
|
|
106
|
+
/** Stable reference; never mutated after construction. */
|
|
107
|
+
private readonly checkpoints;
|
|
108
|
+
constructor(spec: SessionSpec, checkpoints: readonly CheckpointProver[], deps: EpochSessionDeps);
|
|
109
|
+
getId(): string;
|
|
110
|
+
getSpec(): SessionSpec;
|
|
111
|
+
getState(): EpochProvingJobState;
|
|
112
|
+
getEpochNumber(): EpochNumber;
|
|
113
|
+
getKind(): SessionKind;
|
|
114
|
+
getDeadline(): Date | undefined;
|
|
115
|
+
getCheckpoints(): readonly CheckpointProver[];
|
|
116
|
+
/** Resolves when the session reaches a terminal state. */
|
|
117
|
+
whenDone(): Promise<EpochProvingJobState>;
|
|
118
|
+
/** True if the session is in a terminal state. */
|
|
119
|
+
isTerminal(): boolean;
|
|
120
|
+
/** First block this session proves. */
|
|
121
|
+
getStartBlockNumber(): BlockNumber;
|
|
122
|
+
/** Last block this session proves. */
|
|
123
|
+
getEndBlockNumber(): BlockNumber;
|
|
124
|
+
/**
|
|
125
|
+
* Kicks off proving + submission. Fires and forgets — callers should await `whenDone()`.
|
|
126
|
+
* Returns a promise that resolves to the final state for callers that want to wait inline.
|
|
127
|
+
*/
|
|
128
|
+
start(): Promise<EpochProvingJobState>;
|
|
129
|
+
/**
|
|
130
|
+
* Cancels the session. Idempotent. Withdraws any submitted candidate from the
|
|
131
|
+
* publishing service so the in-flight publisher (if any) is interrupted.
|
|
132
|
+
*/
|
|
133
|
+
cancel(reason?: string): Promise<void>;
|
|
134
|
+
private run;
|
|
135
|
+
private submitProof;
|
|
136
|
+
private teardownTopTreeIfNeeded;
|
|
137
|
+
private scheduleDeadlineStop;
|
|
138
|
+
/**
|
|
139
|
+
* Returns a promise that resolves once cancellation has propagated and the state has
|
|
140
|
+
* been flipped from 'cancelled' to 'timed-out'. Protected so unit tests can drive the
|
|
141
|
+
* deadline path without waiting on the real `setTimeout` to fire.
|
|
142
|
+
*/
|
|
143
|
+
protected handleDeadline(): Promise<void>;
|
|
144
|
+
private toTopTreeHooks;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXBvY2gtc2Vzc2lvbi5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2pvYi9lcG9jaC1zZXNzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQXlCLEtBQUssV0FBVyxFQUFFLEtBQUssVUFBVSxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDeEgsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFDaEUsT0FBTyxFQUFlLEtBQUssY0FBYyxFQUFnQixNQUFNLHVCQUF1QixDQUFDO0FBRXZGLE9BQU8sRUFBRSxLQUFLLFlBQVksRUFBUyxNQUFNLHlCQUF5QixDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFFL0QsT0FBTyxFQUFFLEtBQUssb0JBQW9CLEVBQWdDLE1BQU0saUNBQWlDLENBQUM7QUFDMUcsT0FBTyxFQUFjLEtBQUssU0FBUyxFQUFFLEtBQUssTUFBTSxFQUFhLE1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