@aztec/prover-client 5.0.0-private.20260319 → 5.0.0-rc.2
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/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +16 -2
- package/dest/light/lightweight_checkpoint_builder.d.ts +1 -1
- package/dest/light/lightweight_checkpoint_builder.d.ts.map +1 -1
- package/dest/light/lightweight_checkpoint_builder.js +15 -5
- package/dest/mocks/test_context.d.ts +11 -11
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +25 -28
- package/dest/orchestrator/block-building-helpers.d.ts +1 -1
- package/dest/orchestrator/checkpoint-proving-state.d.ts +20 -36
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/checkpoint-proving-state.js +22 -120
- package/dest/orchestrator/checkpoint-sub-tree-orchestrator.d.ts +161 -0
- package/dest/orchestrator/checkpoint-sub-tree-orchestrator.d.ts.map +1 -0
- package/dest/orchestrator/{orchestrator.js → checkpoint-sub-tree-orchestrator.js} +267 -451
- package/dest/orchestrator/chonk-cache.d.ts +39 -0
- package/dest/orchestrator/chonk-cache.d.ts.map +1 -0
- package/dest/orchestrator/chonk-cache.js +80 -0
- package/dest/orchestrator/index.d.ts +4 -2
- package/dest/orchestrator/index.d.ts.map +1 -1
- package/dest/orchestrator/index.js +3 -1
- package/dest/orchestrator/proving-scheduler.d.ts +81 -0
- package/dest/orchestrator/proving-scheduler.d.ts.map +1 -0
- package/dest/orchestrator/proving-scheduler.js +120 -0
- package/dest/orchestrator/top-tree-orchestrator.d.ts +88 -0
- package/dest/orchestrator/top-tree-orchestrator.d.ts.map +1 -0
- package/dest/orchestrator/top-tree-orchestrator.js +232 -0
- package/dest/orchestrator/top-tree-proving-state.d.ts +61 -0
- package/dest/orchestrator/top-tree-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/top-tree-proving-state.js +185 -0
- package/dest/prover-client/prover-client.d.ts +61 -4
- package/dest/prover-client/prover-client.d.ts.map +1 -1
- package/dest/prover-client/prover-client.js +54 -7
- package/dest/proving_broker/broker_prover_facade.d.ts +1 -1
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +10 -16
- package/dest/proving_broker/config.d.ts +8 -72
- package/dest/proving_broker/config.d.ts.map +1 -1
- package/dest/proving_broker/config.js +2 -2
- package/dest/proving_broker/index.d.ts +2 -1
- package/dest/proving_broker/index.d.ts.map +1 -1
- package/dest/proving_broker/index.js +1 -0
- package/dest/proving_broker/proving_broker.d.ts +2 -2
- package/dest/proving_broker/proving_broker.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.js +32 -7
- package/dest/proving_broker/proving_broker_database/persisted.js +2 -2
- package/dest/proving_broker/rpc.d.ts +3 -1
- package/dest/proving_broker/rpc.d.ts.map +1 -1
- package/dest/proving_broker/rpc.js +80 -24
- package/dest/test/epoch_settlement.d.ts +36 -0
- package/dest/test/epoch_settlement.d.ts.map +1 -0
- package/dest/test/epoch_settlement.js +52 -0
- package/dest/test/index.d.ts +2 -0
- package/dest/test/index.d.ts.map +1 -0
- package/dest/test/index.js +1 -0
- package/dest/test/mock_prover.d.ts +3 -3
- package/package.json +19 -18
- package/src/config.ts +18 -2
- package/src/light/lightweight_checkpoint_builder.ts +16 -6
- package/src/mocks/test_context.ts +24 -41
- package/src/orchestrator/checkpoint-proving-state.ts +21 -162
- package/src/orchestrator/{orchestrator.ts → checkpoint-sub-tree-orchestrator.ts} +415 -661
- package/src/orchestrator/chonk-cache.ts +99 -0
- package/src/orchestrator/index.ts +8 -1
- package/src/orchestrator/proving-scheduler.ts +160 -0
- package/src/orchestrator/top-tree-orchestrator.ts +384 -0
- package/src/orchestrator/top-tree-proving-state.ts +219 -0
- package/src/prover-client/prover-client.ts +128 -18
- package/src/proving_broker/broker_prover_facade.ts +8 -16
- package/src/proving_broker/config.ts +2 -1
- package/src/proving_broker/index.ts +1 -0
- package/src/proving_broker/proving_broker.ts +27 -5
- package/src/proving_broker/proving_broker_database/persisted.ts +2 -2
- package/src/proving_broker/rpc.ts +36 -24
- package/src/test/epoch_settlement.ts +82 -0
- package/src/test/index.ts +1 -0
- package/dest/orchestrator/epoch-proving-state.d.ts +0 -75
- package/dest/orchestrator/epoch-proving-state.d.ts.map +0 -1
- package/dest/orchestrator/epoch-proving-state.js +0 -269
- package/dest/orchestrator/orchestrator.d.ts +0 -130
- package/dest/orchestrator/orchestrator.d.ts.map +0 -1
- package/dest/prover-client/server-epoch-prover.d.ts +0 -32
- package/dest/prover-client/server-epoch-prover.d.ts.map +0 -1
- package/dest/prover-client/server-epoch-prover.js +0 -40
- package/src/orchestrator/epoch-proving-state.ts +0 -380
- package/src/prover-client/server-epoch-prover.ts +0 -69
|
@@ -6,6 +6,19 @@ import { optional } from '@aztec/stdlib/schemas';
|
|
|
6
6
|
import { getVersioningResponseHandler } from '@aztec/stdlib/versioning';
|
|
7
7
|
import { makeTracedFetch } from '@aztec/telemetry-client';
|
|
8
8
|
import { z } from 'zod';
|
|
9
|
+
/** Indefinite backoff for broker communication: 1, 1, 1, 2, 4, 4, 4, ... seconds. */ export function* proverBrokerBackoff() {
|
|
10
|
+
const v = [
|
|
11
|
+
1,
|
|
12
|
+
1,
|
|
13
|
+
1,
|
|
14
|
+
2,
|
|
15
|
+
4
|
|
16
|
+
];
|
|
17
|
+
let i = 0;
|
|
18
|
+
while(true){
|
|
19
|
+
yield v[Math.min(i++, v.length - 1)];
|
|
20
|
+
}
|
|
21
|
+
}
|
|
9
22
|
const ProvingJobFilterSchema = z.object({
|
|
10
23
|
allowList: z.array(z.nativeEnum(ProvingRequestType))
|
|
11
24
|
});
|
|
@@ -14,55 +27,98 @@ const GetProvingJobResponse = z.object({
|
|
|
14
27
|
time: z.number()
|
|
15
28
|
});
|
|
16
29
|
export const ProvingJobProducerSchema = {
|
|
17
|
-
enqueueProvingJob: z.function(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
30
|
+
enqueueProvingJob: z.function({
|
|
31
|
+
input: z.tuple([
|
|
32
|
+
ProvingJob
|
|
33
|
+
]),
|
|
34
|
+
output: ProvingJobStatus
|
|
35
|
+
}),
|
|
36
|
+
getProvingJobStatus: z.function({
|
|
37
|
+
input: z.tuple([
|
|
38
|
+
ProvingJobId
|
|
39
|
+
]),
|
|
40
|
+
output: ProvingJobStatus
|
|
41
|
+
}),
|
|
42
|
+
cancelProvingJob: z.function({
|
|
43
|
+
input: z.tuple([
|
|
44
|
+
ProvingJobId
|
|
45
|
+
]),
|
|
46
|
+
output: z.void()
|
|
47
|
+
}),
|
|
48
|
+
getCompletedJobs: z.function({
|
|
49
|
+
input: z.tuple([
|
|
50
|
+
z.array(ProvingJobId)
|
|
51
|
+
]),
|
|
52
|
+
output: z.array(ProvingJobId)
|
|
53
|
+
})
|
|
21
54
|
};
|
|
22
55
|
export const ProvingJobConsumerSchema = {
|
|
23
|
-
getProvingJob: z.function(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
56
|
+
getProvingJob: z.function({
|
|
57
|
+
input: z.tuple([
|
|
58
|
+
optional(ProvingJobFilterSchema)
|
|
59
|
+
]),
|
|
60
|
+
output: GetProvingJobResponse.optional()
|
|
61
|
+
}),
|
|
62
|
+
reportProvingJobError: z.function({
|
|
63
|
+
input: z.tuple([
|
|
64
|
+
ProvingJobId,
|
|
65
|
+
z.string(),
|
|
66
|
+
optional(z.boolean()),
|
|
67
|
+
optional(ProvingJobFilterSchema)
|
|
68
|
+
]),
|
|
69
|
+
output: GetProvingJobResponse.optional()
|
|
70
|
+
}),
|
|
71
|
+
reportProvingJobProgress: z.function({
|
|
72
|
+
input: z.tuple([
|
|
73
|
+
ProvingJobId,
|
|
74
|
+
z.number(),
|
|
75
|
+
optional(ProvingJobFilterSchema)
|
|
76
|
+
]),
|
|
77
|
+
output: GetProvingJobResponse.optional()
|
|
78
|
+
}),
|
|
79
|
+
reportProvingJobSuccess: z.function({
|
|
80
|
+
input: z.tuple([
|
|
81
|
+
ProvingJobId,
|
|
82
|
+
ProofUri,
|
|
83
|
+
optional(ProvingJobFilterSchema)
|
|
84
|
+
]),
|
|
85
|
+
output: GetProvingJobResponse.optional()
|
|
86
|
+
})
|
|
27
87
|
};
|
|
28
88
|
export const ProvingJobBrokerSchema = {
|
|
29
89
|
...ProvingJobConsumerSchema,
|
|
30
90
|
...ProvingJobProducerSchema
|
|
31
91
|
};
|
|
32
92
|
export const ProvingJobBrokerDebugSchema = {
|
|
33
|
-
replayProvingJob: z.function(
|
|
93
|
+
replayProvingJob: z.function({
|
|
94
|
+
input: z.tuple([
|
|
95
|
+
ProvingJobId,
|
|
96
|
+
z.nativeEnum(ProvingRequestType),
|
|
97
|
+
EpochNumberSchema,
|
|
98
|
+
ProofUri
|
|
99
|
+
]),
|
|
100
|
+
output: ProvingJobStatus
|
|
101
|
+
})
|
|
34
102
|
};
|
|
35
103
|
export const ProvingJobBrokerSchemaWithDebug = {
|
|
36
104
|
...ProvingJobBrokerSchema,
|
|
37
105
|
...ProvingJobBrokerDebugSchema
|
|
38
106
|
};
|
|
39
|
-
export function createProvingJobBrokerClient(url, versions, fetch = makeTracedFetch(
|
|
40
|
-
1,
|
|
41
|
-
2,
|
|
42
|
-
3
|
|
43
|
-
], false)) {
|
|
107
|
+
export function createProvingJobBrokerClient(url, versions, fetch = makeTracedFetch(proverBrokerBackoff, false)) {
|
|
44
108
|
return createSafeJsonRpcClient(url, ProvingJobBrokerSchema, {
|
|
45
109
|
namespaceMethods: 'proverBroker',
|
|
46
110
|
fetch,
|
|
47
111
|
onResponse: getVersioningResponseHandler(versions)
|
|
48
112
|
});
|
|
49
113
|
}
|
|
50
|
-
export function createProvingJobProducerClient(url, versions, fetch = makeTracedFetch(
|
|
51
|
-
1,
|
|
52
|
-
2,
|
|
53
|
-
3
|
|
54
|
-
], false)) {
|
|
114
|
+
export function createProvingJobProducerClient(url, versions, fetch = makeTracedFetch(proverBrokerBackoff, false)) {
|
|
55
115
|
return createSafeJsonRpcClient(url, ProvingJobProducerSchema, {
|
|
56
116
|
namespaceMethods: 'provingJobProducer',
|
|
57
117
|
fetch,
|
|
58
118
|
onResponse: getVersioningResponseHandler(versions)
|
|
59
119
|
});
|
|
60
120
|
}
|
|
61
|
-
export function createProvingJobConsumerClient(url, versions, fetch = makeTracedFetch(
|
|
62
|
-
1,
|
|
63
|
-
2,
|
|
64
|
-
3
|
|
65
|
-
], false)) {
|
|
121
|
+
export function createProvingJobConsumerClient(url, versions, fetch = makeTracedFetch(proverBrokerBackoff, false)) {
|
|
66
122
|
return createSafeJsonRpcClient(url, ProvingJobConsumerSchema, {
|
|
67
123
|
namespaceMethods: 'provingJobConsumer',
|
|
68
124
|
fetch,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { RollupCheatCodes } from '@aztec/ethereum/test';
|
|
2
|
+
import type { CheckpointNumber, EpochNumber } from '@aztec/foundation/branded-types';
|
|
3
|
+
import type { Logger } from '@aztec/foundation/log';
|
|
4
|
+
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
5
|
+
/** Arguments for {@link settleEpochOutbox}. */
|
|
6
|
+
export type SettleEpochOutboxArgs = {
|
|
7
|
+
/** Cheat codes used to write the computed out hash directly into the L1 Outbox storage. */
|
|
8
|
+
rollupCheatCodes: RollupCheatCodes;
|
|
9
|
+
/** Source of checkpointed L2 blocks for the epoch being settled. */
|
|
10
|
+
l2BlockSource: L2BlockSource;
|
|
11
|
+
/** Epoch to settle. */
|
|
12
|
+
epoch: EpochNumber;
|
|
13
|
+
/**
|
|
14
|
+
* When set, only checkpoints up to and including this number are covered. Used to settle a partial
|
|
15
|
+
* epoch (the AZIP-14 Outbox keeps one root per `numCheckpointsInEpoch`, so a prefix of an epoch can
|
|
16
|
+
* be settled and consumed before the epoch completes). When omitted, every checkpointed block in the
|
|
17
|
+
* epoch is covered.
|
|
18
|
+
*/
|
|
19
|
+
maxCheckpoint?: CheckpointNumber;
|
|
20
|
+
log: Logger;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Computes the epoch out hash over the checkpointed blocks of an epoch (optionally only up to
|
|
24
|
+
* `maxCheckpoint`) and writes it into the L1 Outbox via cheat codes. This is the synthetic,
|
|
25
|
+
* no-prover equivalent of an epoch root proof landing on L1: it makes the L2-to-L1 messages in the
|
|
26
|
+
* covered checkpoints consumable. It does NOT advance the rollup's proven tip — callers
|
|
27
|
+
* `markAsProven` separately so a single prove call can settle multiple epochs before marking proven.
|
|
28
|
+
*
|
|
29
|
+
* Used by the test-only proving drivers: the `AutomineSequencer`'s auto-settle loop and the standalone
|
|
30
|
+
* `EpochTestSettler`. Lives here (rather than in either consumer) so both share one implementation.
|
|
31
|
+
*
|
|
32
|
+
* @returns The last checkpoint number covered by the settled range, or `undefined` if the epoch has
|
|
33
|
+
* no checkpointed blocks (within the `maxCheckpoint` bound).
|
|
34
|
+
*/
|
|
35
|
+
export declare function settleEpochOutbox({ rollupCheatCodes, l2BlockSource, epoch, maxCheckpoint, log }: SettleEpochOutboxArgs): Promise<CheckpointNumber | undefined>;
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXBvY2hfc2V0dGxlbWVudC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3Rlc3QvZXBvY2hfc2V0dGxlbWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBQzdELE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLFdBQVcsRUFBYyxNQUFNLGlDQUFpQyxDQUFDO0FBRWpHLE9BQU8sS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLHVCQUF1QixDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLHFCQUFxQixDQUFDO0FBR3pELCtDQUErQztBQUMvQyxNQUFNLE1BQU0scUJBQXFCLEdBQUc7SUFDbEMsMkZBQTJGO0lBQzNGLGdCQUFnQixFQUFFLGdCQUFnQixDQUFDO0lBQ25DLG9FQUFvRTtJQUNwRSxhQUFhLEVBQUUsYUFBYSxDQUFDO0lBQzdCLHVCQUF1QjtJQUN2QixLQUFLLEVBQUUsV0FBVyxDQUFDO0lBQ25COzs7OztPQUtHO0lBQ0gsYUFBYSxDQUFDLEVBQUUsZ0JBQWdCLENBQUM7SUFDakMsR0FBRyxFQUFFLE1BQU0sQ0FBQztDQUNiLENBQUM7QUFFRjs7Ozs7Ozs7Ozs7O0dBWUc7QUFDSCx3QkFBc0IsaUJBQWlCLENBQUMsRUFDdEMsZ0JBQWdCLEVBQ2hCLGFBQWEsRUFDYixLQUFLLEVBQ0wsYUFBYSxFQUNiLEdBQUcsRUFDSixFQUFFLHFCQUFxQixHQUFHLE9BQU8sQ0FBQyxnQkFBZ0IsR0FBRyxTQUFTLENBQUMsQ0FxQy9EIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"epoch_settlement.d.ts","sourceRoot":"","sources":["../../src/test/epoch_settlement.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAc,MAAM,iCAAiC,CAAC;AAEjG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAGzD,+CAA+C;AAC/C,MAAM,MAAM,qBAAqB,GAAG;IAClC,2FAA2F;IAC3F,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,oEAAoE;IACpE,aAAa,EAAE,aAAa,CAAC;IAC7B,uBAAuB;IACvB,KAAK,EAAE,WAAW,CAAC;IACnB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,gBAAgB,CAAC;IACjC,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,wBAAsB,iBAAiB,CAAC,EACtC,gBAAgB,EAChB,aAAa,EACb,KAAK,EACL,aAAa,EACb,GAAG,EACJ,EAAE,qBAAqB,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAqC/D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { computeEpochOutHash } from '@aztec/stdlib/messaging';
|
|
2
|
+
/**
|
|
3
|
+
* Computes the epoch out hash over the checkpointed blocks of an epoch (optionally only up to
|
|
4
|
+
* `maxCheckpoint`) and writes it into the L1 Outbox via cheat codes. This is the synthetic,
|
|
5
|
+
* no-prover equivalent of an epoch root proof landing on L1: it makes the L2-to-L1 messages in the
|
|
6
|
+
* covered checkpoints consumable. It does NOT advance the rollup's proven tip — callers
|
|
7
|
+
* `markAsProven` separately so a single prove call can settle multiple epochs before marking proven.
|
|
8
|
+
*
|
|
9
|
+
* Used by the test-only proving drivers: the `AutomineSequencer`'s auto-settle loop and the standalone
|
|
10
|
+
* `EpochTestSettler`. Lives here (rather than in either consumer) so both share one implementation.
|
|
11
|
+
*
|
|
12
|
+
* @returns The last checkpoint number covered by the settled range, or `undefined` if the epoch has
|
|
13
|
+
* no checkpointed blocks (within the `maxCheckpoint` bound).
|
|
14
|
+
*/ export async function settleEpochOutbox({ rollupCheatCodes, l2BlockSource, epoch, maxCheckpoint, log }) {
|
|
15
|
+
let blocks = await l2BlockSource.getBlocks({
|
|
16
|
+
epoch,
|
|
17
|
+
onlyCheckpointed: true
|
|
18
|
+
});
|
|
19
|
+
if (maxCheckpoint !== undefined) {
|
|
20
|
+
blocks = blocks.filter((block)=>block.checkpointNumber <= maxCheckpoint);
|
|
21
|
+
}
|
|
22
|
+
if (blocks.length === 0) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
log.info(`Settling epoch ${epoch}${maxCheckpoint !== undefined ? ` up to checkpoint ${maxCheckpoint}` : ''} with blocks ${blocks[0]?.header.getBlockNumber()} to ${blocks.at(-1)?.header.getBlockNumber()}`, {
|
|
26
|
+
epoch,
|
|
27
|
+
maxCheckpoint,
|
|
28
|
+
blocks: blocks.map((block)=>block.toBlockInfo())
|
|
29
|
+
});
|
|
30
|
+
const messagesInEpoch = [];
|
|
31
|
+
// Undefined (not SlotNumber.ZERO) so a first checkpointed block at slot 0 still opens checkpoint 0.
|
|
32
|
+
let previousSlotNumber;
|
|
33
|
+
let checkpointIndex = -1;
|
|
34
|
+
for (const block of blocks){
|
|
35
|
+
const slotNumber = block.header.globalVariables.slotNumber;
|
|
36
|
+
if (slotNumber !== previousSlotNumber) {
|
|
37
|
+
checkpointIndex++;
|
|
38
|
+
messagesInEpoch[checkpointIndex] = [];
|
|
39
|
+
previousSlotNumber = slotNumber;
|
|
40
|
+
}
|
|
41
|
+
messagesInEpoch[checkpointIndex].push(block.body.txEffects.map((txEffect)=>txEffect.l2ToL1Msgs));
|
|
42
|
+
}
|
|
43
|
+
const outHash = computeEpochOutHash(messagesInEpoch);
|
|
44
|
+
if (!outHash.isZero()) {
|
|
45
|
+
await rollupCheatCodes.insertOutbox(epoch, messagesInEpoch.length, outHash.toBigInt());
|
|
46
|
+
} else {
|
|
47
|
+
log.info(`No L2 to L1 messages in epoch ${epoch}`, {
|
|
48
|
+
epoch
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return blocks.at(-1)?.checkpointNumber;
|
|
52
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { settleEpochOutbox, type SettleEpochOutboxArgs } from './epoch_settlement.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90ZXN0L2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxLQUFLLHFCQUFxQixFQUFFLE1BQU0sdUJBQXVCLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { settleEpochOutbox } from './epoch_settlement.js';
|
|
@@ -20,8 +20,8 @@ export declare class TestBroker implements ProvingJobProducer {
|
|
|
20
20
|
export declare class MockProver implements ServerCircuitProver {
|
|
21
21
|
constructor();
|
|
22
22
|
getAvmProof(_inputs: AvmCircuitInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<import("@aztec/stdlib/proofs").RecursiveProof<16400>>;
|
|
23
|
-
getBaseParityProof(_inputs: ParityBasePrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs,
|
|
24
|
-
getRootParityProof(_inputs: ParityRootPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs,
|
|
23
|
+
getBaseParityProof(_inputs: ParityBasePrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs, 410>>;
|
|
24
|
+
getRootParityProof(_inputs: ParityRootPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<import("@aztec/stdlib/parity").ParityPublicInputs, 410>>;
|
|
25
25
|
getPublicChonkVerifierProof(_inputs: PublicChonkVerifierPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<PublicChonkVerifierPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
26
26
|
getPrivateTxBaseRollupProof(_baseRollupInput: PrivateTxBaseRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
27
27
|
getPublicTxBaseRollupProof(_inputs: PublicTxBaseRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
@@ -31,7 +31,7 @@ export declare class MockProver implements ServerCircuitProver {
|
|
|
31
31
|
getBlockRootEmptyTxFirstRollupProof(_input: BlockRootEmptyTxFirstRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
32
32
|
getBlockRootRollupProof(_input: BlockRootRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
33
33
|
getBlockRootSingleTxRollupProof(_input: BlockRootSingleTxRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
34
|
-
getBlockMergeRollupProof(_input: BlockMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs,
|
|
34
|
+
getBlockMergeRollupProof(_input: BlockMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, 480>>;
|
|
35
35
|
getCheckpointRootRollupProof(_input: CheckpointRootRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
36
36
|
getCheckpointRootSingleBlockRollupProof(_input: CheckpointRootSingleBlockRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
37
37
|
getCheckpointMergeRollupProof(_input: CheckpointMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number): Promise<PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/prover-client",
|
|
3
|
-
"version": "5.0.0-
|
|
3
|
+
"version": "5.0.0-rc.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
"./orchestrator": "./dest/orchestrator/index.js",
|
|
10
10
|
"./helpers": "./dest/orchestrator/block-building-helpers.js",
|
|
11
11
|
"./light": "./dest/light/index.js",
|
|
12
|
-
"./config": "./dest/config.js"
|
|
12
|
+
"./config": "./dest/config.js",
|
|
13
|
+
"./test": "./dest/test/index.js"
|
|
13
14
|
},
|
|
14
15
|
"typedocOptions": {
|
|
15
16
|
"entryPoints": [
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
29
30
|
"bb": "node --no-warnings ./dest/bb/index.js",
|
|
30
31
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=3500000",
|
|
31
|
-
"test:debug": "LOG_LEVEL
|
|
32
|
+
"test:debug": "LOG_LEVEL=\"debug; info: json-rpc, simulator\" NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --testTimeout=1500000 --testNamePattern prover/bb_prover/parity"
|
|
32
33
|
},
|
|
33
34
|
"jest": {
|
|
34
35
|
"moduleNameMapper": {
|
|
@@ -68,28 +69,28 @@
|
|
|
68
69
|
]
|
|
69
70
|
},
|
|
70
71
|
"dependencies": {
|
|
71
|
-
"@aztec/bb-prover": "5.0.0-
|
|
72
|
-
"@aztec/blob-lib": "5.0.0-
|
|
73
|
-
"@aztec/constants": "5.0.0-
|
|
74
|
-
"@aztec/ethereum": "5.0.0-
|
|
75
|
-
"@aztec/foundation": "5.0.0-
|
|
76
|
-
"@aztec/kv-store": "5.0.0-
|
|
77
|
-
"@aztec/noir-protocol-circuits-types": "5.0.0-
|
|
78
|
-
"@aztec/noir-types": "5.0.0-
|
|
79
|
-
"@aztec/protocol-contracts": "5.0.0-
|
|
80
|
-
"@aztec/simulator": "5.0.0-
|
|
81
|
-
"@aztec/stdlib": "5.0.0-
|
|
82
|
-
"@aztec/telemetry-client": "5.0.0-
|
|
83
|
-
"@aztec/world-state": "5.0.0-
|
|
72
|
+
"@aztec/bb-prover": "5.0.0-rc.2",
|
|
73
|
+
"@aztec/blob-lib": "5.0.0-rc.2",
|
|
74
|
+
"@aztec/constants": "5.0.0-rc.2",
|
|
75
|
+
"@aztec/ethereum": "5.0.0-rc.2",
|
|
76
|
+
"@aztec/foundation": "5.0.0-rc.2",
|
|
77
|
+
"@aztec/kv-store": "5.0.0-rc.2",
|
|
78
|
+
"@aztec/noir-protocol-circuits-types": "5.0.0-rc.2",
|
|
79
|
+
"@aztec/noir-types": "5.0.0-rc.2",
|
|
80
|
+
"@aztec/protocol-contracts": "5.0.0-rc.2",
|
|
81
|
+
"@aztec/simulator": "5.0.0-rc.2",
|
|
82
|
+
"@aztec/stdlib": "5.0.0-rc.2",
|
|
83
|
+
"@aztec/telemetry-client": "5.0.0-rc.2",
|
|
84
|
+
"@aztec/world-state": "5.0.0-rc.2",
|
|
84
85
|
"@iarna/toml": "^2.2.5",
|
|
85
86
|
"commander": "^12.1.0",
|
|
86
87
|
"lodash.chunk": "^4.2.0",
|
|
87
88
|
"source-map-support": "^0.5.21",
|
|
88
89
|
"tslib": "^2.4.0",
|
|
89
|
-
"zod": "^
|
|
90
|
+
"zod": "^4"
|
|
90
91
|
},
|
|
91
92
|
"devDependencies": {
|
|
92
|
-
"@aztec/noir-contracts.js": "5.0.0-
|
|
93
|
+
"@aztec/noir-contracts.js": "5.0.0-rc.2",
|
|
93
94
|
"@jest/globals": "^30.0.0",
|
|
94
95
|
"@types/jest": "^30.0.0",
|
|
95
96
|
"@types/node": "^22.15.17",
|
package/src/config.ts
CHANGED
|
@@ -44,14 +44,30 @@ export const bbConfigMappings: ConfigMappingsType<BBConfig & ACVMConfig> = {
|
|
|
44
44
|
},
|
|
45
45
|
numConcurrentIVCVerifiers: {
|
|
46
46
|
env: 'BB_NUM_IVC_VERIFIERS',
|
|
47
|
-
description: 'Max
|
|
47
|
+
description: 'Max concurrent verifications for the RPC verifier (QueuedIVCVerifier).',
|
|
48
48
|
...numberConfigHelper(8),
|
|
49
49
|
},
|
|
50
50
|
bbIVCConcurrency: {
|
|
51
51
|
env: 'BB_IVC_CONCURRENCY',
|
|
52
|
-
description: '
|
|
52
|
+
description: 'Thread count for the RPC IVC verifier.',
|
|
53
53
|
...numberConfigHelper(1),
|
|
54
54
|
},
|
|
55
|
+
bbChonkVerifyMaxBatch: {
|
|
56
|
+
env: 'BB_CHONK_VERIFY_MAX_BATCH',
|
|
57
|
+
description:
|
|
58
|
+
'Upper bound on proofs per batch for the peer chonk batch verifier. Proofs are verified immediately as they arrive; this only caps how many can accumulate while a batch is already being processed.',
|
|
59
|
+
...numberConfigHelper(16),
|
|
60
|
+
},
|
|
61
|
+
bbChonkVerifyConcurrency: {
|
|
62
|
+
env: 'BB_CHONK_VERIFY_BATCH_CONCURRENCY',
|
|
63
|
+
description: 'Thread count for the peer batch verifier parallel reduce. 0 = auto.',
|
|
64
|
+
...numberConfigHelper(6),
|
|
65
|
+
},
|
|
66
|
+
bbDebugOutputDir: {
|
|
67
|
+
env: 'BB_DEBUG_OUTPUT_DIR',
|
|
68
|
+
description:
|
|
69
|
+
'When set, bb.js operations write input/output files and log equivalent CLI commands to this directory',
|
|
70
|
+
},
|
|
55
71
|
};
|
|
56
72
|
|
|
57
73
|
export const proverClientConfigMappings: ConfigMappingsType<ProverClientUserConfig> = {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { SpongeBlob, computeBlobsHashFromBlobs, encodeCheckpointEndMarker, getBlobsPerL1Block } from '@aztec/blob-lib';
|
|
2
|
-
import { NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
3
2
|
import { type CheckpointNumber, IndexWithinCheckpoint } from '@aztec/foundation/branded-types';
|
|
4
|
-
import { padArrayEnd } from '@aztec/foundation/collection';
|
|
5
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
6
4
|
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
7
5
|
import { elapsed } from '@aztec/foundation/timer';
|
|
@@ -10,6 +8,7 @@ import { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
|
10
8
|
import type { MerkleTreeWriteOperations } from '@aztec/stdlib/interfaces/server';
|
|
11
9
|
import {
|
|
12
10
|
accumulateCheckpointOutHashes,
|
|
11
|
+
appendL1ToL2MessagesToTree,
|
|
13
12
|
computeCheckpointOutHash,
|
|
14
13
|
computeInHashFromL1ToL2Messages,
|
|
15
14
|
} from '@aztec/stdlib/messaging';
|
|
@@ -69,10 +68,7 @@ export class LightweightCheckpointBuilder {
|
|
|
69
68
|
feeAssetPriceModifier: bigint = 0n,
|
|
70
69
|
): Promise<LightweightCheckpointBuilder> {
|
|
71
70
|
// Insert l1-to-l2 messages into the tree.
|
|
72
|
-
await db
|
|
73
|
-
MerkleTreeId.L1_TO_L2_MESSAGE_TREE,
|
|
74
|
-
padArrayEnd<Fr, number>(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP),
|
|
75
|
-
);
|
|
71
|
+
await appendL1ToL2MessagesToTree(db, l1ToL2Messages);
|
|
76
72
|
|
|
77
73
|
return new LightweightCheckpointBuilder(
|
|
78
74
|
checkpointNumber,
|
|
@@ -117,6 +113,10 @@ export class LightweightCheckpointBuilder {
|
|
|
117
113
|
blockNumbers: existingBlocks.map(b => b.header.getBlockNumber()),
|
|
118
114
|
});
|
|
119
115
|
|
|
116
|
+
if (existingBlocks.length === 0) {
|
|
117
|
+
throw new Error(`Cannot resume checkpoint ${checkpointNumber} with no existing blocks`);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
120
|
// Validate block order and consistency
|
|
121
121
|
for (let i = 1; i < existingBlocks.length; i++) {
|
|
122
122
|
const prev = existingBlocks[i - 1];
|
|
@@ -275,6 +275,7 @@ export class LightweightCheckpointBuilder {
|
|
|
275
275
|
const timestamp = blocks[blocks.length - 1].timestamp;
|
|
276
276
|
|
|
277
277
|
const totalManaUsed = blocks.reduce((acc, block) => acc.add(block.header.totalManaUsed), Fr.ZERO);
|
|
278
|
+
const accumulatedFees = blocks.reduce((acc, block) => acc.add(block.header.totalFees), Fr.ZERO);
|
|
278
279
|
|
|
279
280
|
const header = CheckpointHeader.from({
|
|
280
281
|
lastArchiveRoot: this.lastArchives[0].root,
|
|
@@ -288,6 +289,15 @@ export class LightweightCheckpointBuilder {
|
|
|
288
289
|
feeRecipient,
|
|
289
290
|
gasFees,
|
|
290
291
|
totalManaUsed,
|
|
292
|
+
accumulatedFees,
|
|
293
|
+
});
|
|
294
|
+
|
|
295
|
+
this.logger.debug(`Completed checkpoint ${this.checkpointNumber}`, {
|
|
296
|
+
checkpointNumber: this.checkpointNumber,
|
|
297
|
+
headerHash: header.hash().toString(),
|
|
298
|
+
checkpointOutHash: checkpointOutHash.toString(),
|
|
299
|
+
numPreviousCheckpointOutHashes: this.previousCheckpointOutHashes.length,
|
|
300
|
+
...header.toInspect(),
|
|
291
301
|
});
|
|
292
302
|
|
|
293
303
|
return new Checkpoint(newArchive, header, blocks, this.checkpointNumber, this.feeAssetPriceModifier);
|
|
@@ -5,13 +5,13 @@ import { BlockNumber, CheckpointNumber } from '@aztec/foundation/branded-types';
|
|
|
5
5
|
import { padArrayEnd, times, timesAsync } from '@aztec/foundation/collection';
|
|
6
6
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
7
7
|
import type { Logger } from '@aztec/foundation/log';
|
|
8
|
+
import { SerialQueue } from '@aztec/foundation/queue';
|
|
8
9
|
import type { FieldsOf } from '@aztec/foundation/types';
|
|
9
10
|
import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
10
11
|
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
11
12
|
import { computeFeePayerBalanceLeafSlot } from '@aztec/protocol-contracts/fee-juice';
|
|
12
13
|
import { PublicDataWrite } from '@aztec/stdlib/avm';
|
|
13
14
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
14
|
-
import { EthAddress } from '@aztec/stdlib/block';
|
|
15
15
|
import type { Checkpoint } from '@aztec/stdlib/checkpoint';
|
|
16
16
|
import type { MerkleTreeWriteOperations, ServerCircuitProver } from '@aztec/stdlib/interfaces/server';
|
|
17
17
|
import type { CheckpointConstantData } from '@aztec/stdlib/rollup';
|
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
StateReference,
|
|
25
25
|
TreeSnapshots,
|
|
26
26
|
} from '@aztec/stdlib/tx';
|
|
27
|
+
import type { GenesisData } from '@aztec/stdlib/world-state';
|
|
27
28
|
import type { MerkleTreeAdminDatabase } from '@aztec/world-state';
|
|
28
29
|
import { NativeWorldStateService } from '@aztec/world-state/native';
|
|
29
30
|
|
|
@@ -35,12 +36,21 @@ import {
|
|
|
35
36
|
getTreeSnapshot,
|
|
36
37
|
insertSideEffects,
|
|
37
38
|
} from '../orchestrator/block-building-helpers.js';
|
|
38
|
-
import type { BlockProvingState } from '../orchestrator/block-proving-state.js';
|
|
39
|
-
import { ProvingOrchestrator } from '../orchestrator/index.js';
|
|
40
39
|
import { BrokerCircuitProverFacade } from '../proving_broker/broker_prover_facade.js';
|
|
41
40
|
import { TestBroker } from '../test/mock_prover.js';
|
|
42
41
|
import { getEnvironmentConfig, getSimulator, makeCheckpointConstants, makeGlobals } from './fixtures.js';
|
|
43
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Builds a started `SerialQueue` for use as an orchestrator's deferred-job queue in
|
|
45
|
+
* tests. Production wires a single shared queue via `ProverClient`; tests that construct
|
|
46
|
+
* orchestrators directly use one of these per orchestrator (or share one).
|
|
47
|
+
*/
|
|
48
|
+
export function makeTestDeferredJobQueue(concurrency = 10): SerialQueue {
|
|
49
|
+
const queue = new SerialQueue();
|
|
50
|
+
queue.start(concurrency);
|
|
51
|
+
return queue;
|
|
52
|
+
}
|
|
53
|
+
|
|
44
54
|
export class TestContext {
|
|
45
55
|
private headers: Map<number, BlockHeader> = new Map();
|
|
46
56
|
private checkpoints: Checkpoint[] = [];
|
|
@@ -56,7 +66,6 @@ export class TestContext {
|
|
|
56
66
|
public prover: ServerCircuitProver,
|
|
57
67
|
public broker: TestBroker,
|
|
58
68
|
public brokerProverFacade: BrokerCircuitProverFacade,
|
|
59
|
-
public orchestrator: TestProvingOrchestrator,
|
|
60
69
|
private feePayer: AztecAddress,
|
|
61
70
|
initialFeePayerBalance: Fr,
|
|
62
71
|
private directoriesToCleanup: string[],
|
|
@@ -65,10 +74,6 @@ export class TestContext {
|
|
|
65
74
|
this.feePayerBalance = initialFeePayerBalance;
|
|
66
75
|
}
|
|
67
76
|
|
|
68
|
-
public get epochProver() {
|
|
69
|
-
return this.orchestrator;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
77
|
static async new(
|
|
73
78
|
logger: Logger,
|
|
74
79
|
{
|
|
@@ -81,17 +86,16 @@ export class TestContext {
|
|
|
81
86
|
) {
|
|
82
87
|
const directoriesToCleanup: string[] = [];
|
|
83
88
|
|
|
84
|
-
const feePayer = AztecAddress.
|
|
89
|
+
const feePayer = AztecAddress.fromNumberUnsafe(42222);
|
|
85
90
|
const initialFeePayerBalance = new Fr(10n ** 20n);
|
|
86
91
|
const feePayerSlot = await computeFeePayerBalanceLeafSlot(feePayer);
|
|
87
|
-
const
|
|
92
|
+
const genesis: GenesisData = {
|
|
93
|
+
prefilledPublicData: [new PublicDataTreeLeaf(feePayerSlot, initialFeePayerBalance)],
|
|
94
|
+
genesisTimestamp: 0n,
|
|
95
|
+
};
|
|
88
96
|
|
|
89
97
|
// Separated dbs for public processor and prover - see public_processor for context
|
|
90
|
-
const ws = await NativeWorldStateService.tmp(
|
|
91
|
-
/*rollupAddress=*/ undefined,
|
|
92
|
-
/*cleanupTmpDir=*/ true,
|
|
93
|
-
prefilledPublicData,
|
|
94
|
-
);
|
|
98
|
+
const ws = await NativeWorldStateService.tmp(/*rollupAddress=*/ undefined, /*cleanupTmpDir=*/ true, genesis);
|
|
95
99
|
|
|
96
100
|
let localProver: ServerCircuitProver;
|
|
97
101
|
const config = await getEnvironmentConfig(logger);
|
|
@@ -104,8 +108,10 @@ export class TestContext {
|
|
|
104
108
|
bbBinaryPath: config.expectedBBPath,
|
|
105
109
|
bbWorkingDirectory: config.bbWorkingDirectory,
|
|
106
110
|
bbSkipCleanup: config.bbSkipCleanup,
|
|
107
|
-
numConcurrentIVCVerifiers:
|
|
111
|
+
numConcurrentIVCVerifiers: 8,
|
|
108
112
|
bbIVCConcurrency: 1,
|
|
113
|
+
bbChonkVerifyMaxBatch: 16,
|
|
114
|
+
bbChonkVerifyConcurrency: 6,
|
|
109
115
|
};
|
|
110
116
|
localProver = await createProver(bbConfig);
|
|
111
117
|
}
|
|
@@ -116,22 +122,11 @@ export class TestContext {
|
|
|
116
122
|
|
|
117
123
|
const broker = new TestBroker(proverCount, localProver);
|
|
118
124
|
const facade = new BrokerCircuitProverFacade(broker);
|
|
119
|
-
const orchestrator = new TestProvingOrchestrator(ws, facade, EthAddress.ZERO, false, 10);
|
|
120
125
|
|
|
121
126
|
await broker.start();
|
|
122
127
|
facade.start();
|
|
123
128
|
|
|
124
|
-
return new this(
|
|
125
|
-
ws,
|
|
126
|
-
localProver,
|
|
127
|
-
broker,
|
|
128
|
-
facade,
|
|
129
|
-
orchestrator,
|
|
130
|
-
feePayer,
|
|
131
|
-
initialFeePayerBalance,
|
|
132
|
-
directoriesToCleanup,
|
|
133
|
-
logger,
|
|
134
|
-
);
|
|
129
|
+
return new this(ws, localProver, broker, facade, feePayer, initialFeePayerBalance, directoriesToCleanup, logger);
|
|
135
130
|
}
|
|
136
131
|
|
|
137
132
|
public getFork() {
|
|
@@ -282,6 +277,7 @@ export class TestContext {
|
|
|
282
277
|
|
|
283
278
|
return {
|
|
284
279
|
constants,
|
|
280
|
+
checkpoint,
|
|
285
281
|
header: checkpoint.header,
|
|
286
282
|
blocks,
|
|
287
283
|
l1ToL2Messages,
|
|
@@ -349,16 +345,3 @@ export class TestContext {
|
|
|
349
345
|
return endStateReference;
|
|
350
346
|
}
|
|
351
347
|
}
|
|
352
|
-
|
|
353
|
-
class TestProvingOrchestrator extends ProvingOrchestrator {
|
|
354
|
-
public isVerifyBuiltBlockAgainstSyncedStateEnabled = false;
|
|
355
|
-
|
|
356
|
-
// Disable this check by default, since it requires seeding world state with the block being built
|
|
357
|
-
// This is only enabled in some tests with multiple blocks that populate the pending chain via makePendingBlock
|
|
358
|
-
protected override verifyBuiltBlockAgainstSyncedState(provingState: BlockProvingState): Promise<void> {
|
|
359
|
-
if (this.isVerifyBuiltBlockAgainstSyncedStateEnabled) {
|
|
360
|
-
return super.verifyBuiltBlockAgainstSyncedState(provingState);
|
|
361
|
-
}
|
|
362
|
-
return Promise.resolve();
|
|
363
|
-
}
|
|
364
|
-
}
|