@aztec/prover-client 3.0.0-canary.a9708bd → 3.0.0-manual.20251030
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/block-factory/light.d.ts +5 -3
- package/dest/block-factory/light.d.ts.map +1 -1
- package/dest/block-factory/light.js +16 -9
- package/dest/config.js +1 -1
- package/dest/mocks/fixtures.d.ts +4 -1
- package/dest/mocks/fixtures.d.ts.map +1 -1
- package/dest/mocks/fixtures.js +31 -3
- package/dest/mocks/test_context.d.ts +32 -9
- package/dest/mocks/test_context.d.ts.map +1 -1
- package/dest/mocks/test_context.js +78 -22
- package/dest/orchestrator/block-building-helpers.d.ts +33 -31
- package/dest/orchestrator/block-building-helpers.d.ts.map +1 -1
- package/dest/orchestrator/block-building-helpers.js +126 -137
- package/dest/orchestrator/block-proving-state.d.ts +60 -53
- package/dest/orchestrator/block-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/block-proving-state.js +214 -187
- package/dest/orchestrator/checkpoint-proving-state.d.ts +63 -0
- package/dest/orchestrator/checkpoint-proving-state.d.ts.map +1 -0
- package/dest/orchestrator/checkpoint-proving-state.js +211 -0
- package/dest/orchestrator/epoch-proving-state.d.ts +34 -28
- package/dest/orchestrator/epoch-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/epoch-proving-state.js +128 -84
- package/dest/orchestrator/orchestrator.d.ts +31 -30
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +368 -236
- package/dest/orchestrator/tx-proving-state.d.ts +11 -9
- package/dest/orchestrator/tx-proving-state.d.ts.map +1 -1
- package/dest/orchestrator/tx-proving-state.js +26 -23
- package/dest/prover-client/server-epoch-prover.d.ts +9 -8
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.js +9 -9
- package/dest/proving_broker/broker_prover_facade.d.ts +20 -15
- package/dest/proving_broker/broker_prover_facade.d.ts.map +1 -1
- package/dest/proving_broker/broker_prover_facade.js +36 -21
- package/dest/proving_broker/config.d.ts +8 -8
- package/dest/proving_broker/config.js +5 -5
- package/dest/proving_broker/factory.js +1 -1
- package/dest/proving_broker/fixtures.js +1 -1
- package/dest/proving_broker/proof_store/index.d.ts +1 -0
- package/dest/proving_broker/proof_store/index.d.ts.map +1 -1
- package/dest/proving_broker/proof_store/index.js +1 -0
- package/dest/proving_broker/proving_broker.d.ts.map +1 -1
- package/dest/proving_broker/proving_broker.js +29 -18
- package/dest/proving_broker/proving_broker_database/persisted.js +5 -5
- package/dest/proving_broker/proving_job_controller.d.ts.map +1 -1
- package/dest/proving_broker/proving_job_controller.js +38 -18
- package/dest/test/mock_prover.d.ts +22 -17
- package/dest/test/mock_prover.d.ts.map +1 -1
- package/dest/test/mock_prover.js +35 -20
- package/package.json +16 -17
- package/src/block-factory/light.ts +35 -9
- package/src/config.ts +1 -1
- package/src/mocks/fixtures.ts +39 -11
- package/src/mocks/test_context.ts +137 -31
- package/src/orchestrator/block-building-helpers.ts +211 -211
- package/src/orchestrator/block-proving-state.ts +235 -245
- package/src/orchestrator/checkpoint-proving-state.ts +299 -0
- package/src/orchestrator/epoch-proving-state.ts +172 -127
- package/src/orchestrator/orchestrator.ts +545 -303
- package/src/orchestrator/tx-proving-state.ts +49 -43
- package/src/prover-client/server-epoch-prover.ts +28 -18
- package/src/proving_broker/broker_prover_facade.ts +157 -86
- package/src/proving_broker/config.ts +7 -7
- package/src/proving_broker/factory.ts +1 -1
- package/src/proving_broker/fixtures.ts +1 -1
- package/src/proving_broker/proof_store/index.ts +1 -0
- package/src/proving_broker/proving_broker.ts +36 -18
- package/src/proving_broker/proving_broker_database/persisted.ts +5 -5
- package/src/proving_broker/proving_job_controller.ts +38 -18
- package/src/test/mock_prover.ts +142 -60
- package/dest/bin/get-proof-inputs.d.ts +0 -2
- package/dest/bin/get-proof-inputs.d.ts.map +0 -1
- package/dest/bin/get-proof-inputs.js +0 -51
- package/src/bin/get-proof-inputs.ts +0 -59
|
@@ -9,7 +9,7 @@ export async function createAndStartProvingBroker(
|
|
|
9
9
|
_config: ProverBrokerConfig,
|
|
10
10
|
client: TelemetryClient,
|
|
11
11
|
): Promise<ProvingBroker> {
|
|
12
|
-
const config = { ..._config,
|
|
12
|
+
const config = { ..._config, dataStoreMapSizeKb: _config.proverBrokerStoreMapSizeKb ?? _config.dataStoreMapSizeKb };
|
|
13
13
|
const database = config.dataDirectory ? await KVBrokerDatabase.new(config, client) : new InMemoryBrokerDatabase();
|
|
14
14
|
|
|
15
15
|
const broker = new ProvingBroker(database, config, client);
|
|
@@ -3,7 +3,7 @@ import { type ProofUri, type ProvingJobId, makeProvingJobId } from '@aztec/stdli
|
|
|
3
3
|
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
4
4
|
|
|
5
5
|
export function makeRandomProvingJobId(epochNumber?: number): ProvingJobId {
|
|
6
|
-
return makeProvingJobId(epochNumber ?? 1, ProvingRequestType.
|
|
6
|
+
return makeProvingJobId(epochNumber ?? 1, ProvingRequestType.PARITY_BASE, randomBytes(8).toString('hex'));
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
export function makeInputsUri(): ProofUri {
|
|
@@ -44,21 +44,33 @@ type EnqueuedProvingJob = Pick<ProvingJob, 'id' | 'epochNumber'>;
|
|
|
44
44
|
export class ProvingBroker implements ProvingJobProducer, ProvingJobConsumer, Traceable {
|
|
45
45
|
private queues: ProvingQueues = {
|
|
46
46
|
[ProvingRequestType.PUBLIC_VM]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
47
|
-
[ProvingRequestType.
|
|
47
|
+
[ProvingRequestType.PUBLIC_CHONK_VERIFIER]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
48
48
|
|
|
49
|
-
[ProvingRequestType.
|
|
50
|
-
[ProvingRequestType.
|
|
51
|
-
[ProvingRequestType.
|
|
49
|
+
[ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
50
|
+
[ProvingRequestType.PUBLIC_TX_BASE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
51
|
+
[ProvingRequestType.TX_MERGE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
52
52
|
[ProvingRequestType.ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
53
53
|
|
|
54
54
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
55
|
+
[ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
56
|
+
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(
|
|
57
|
+
provingJobComparator,
|
|
58
|
+
),
|
|
59
|
+
[ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(
|
|
60
|
+
provingJobComparator,
|
|
61
|
+
),
|
|
55
62
|
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
56
|
-
[ProvingRequestType.
|
|
57
|
-
[ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
58
|
-
[ProvingRequestType.PADDING_BLOCK_ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
63
|
+
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
59
64
|
|
|
60
|
-
[ProvingRequestType.
|
|
61
|
-
[ProvingRequestType.
|
|
65
|
+
[ProvingRequestType.CHECKPOINT_ROOT_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
66
|
+
[ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(
|
|
67
|
+
provingJobComparator,
|
|
68
|
+
),
|
|
69
|
+
[ProvingRequestType.CHECKPOINT_MERGE_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
70
|
+
[ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
71
|
+
|
|
72
|
+
[ProvingRequestType.PARITY_BASE]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
73
|
+
[ProvingRequestType.PARITY_ROOT]: new PriorityMemoryQueue<EnqueuedProvingJob>(provingJobComparator),
|
|
62
74
|
};
|
|
63
75
|
|
|
64
76
|
// holds a copy of the database in memory in order to quickly fulfill requests
|
|
@@ -673,16 +685,22 @@ function proofTypeComparator(a: ProvingRequestType, b: ProvingRequestType): -1 |
|
|
|
673
685
|
* is to get picked up by agents
|
|
674
686
|
*/
|
|
675
687
|
export const PROOF_TYPES_IN_PRIORITY_ORDER: ProvingRequestType[] = [
|
|
688
|
+
ProvingRequestType.ROOT_ROLLUP,
|
|
689
|
+
ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP,
|
|
690
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP,
|
|
691
|
+
ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP,
|
|
676
692
|
ProvingRequestType.BLOCK_ROOT_ROLLUP,
|
|
677
|
-
ProvingRequestType.
|
|
693
|
+
ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP,
|
|
678
694
|
ProvingRequestType.BLOCK_MERGE_ROLLUP,
|
|
679
|
-
ProvingRequestType.
|
|
680
|
-
ProvingRequestType.
|
|
681
|
-
ProvingRequestType.
|
|
682
|
-
ProvingRequestType.
|
|
695
|
+
ProvingRequestType.CHECKPOINT_ROOT_ROLLUP,
|
|
696
|
+
ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP,
|
|
697
|
+
ProvingRequestType.CHECKPOINT_MERGE_ROLLUP,
|
|
698
|
+
ProvingRequestType.CHECKPOINT_PADDING_ROLLUP,
|
|
699
|
+
ProvingRequestType.TX_MERGE_ROLLUP,
|
|
700
|
+
ProvingRequestType.PUBLIC_TX_BASE_ROLLUP,
|
|
701
|
+
ProvingRequestType.PRIVATE_TX_BASE_ROLLUP,
|
|
683
702
|
ProvingRequestType.PUBLIC_VM,
|
|
684
|
-
ProvingRequestType.
|
|
685
|
-
ProvingRequestType.
|
|
686
|
-
ProvingRequestType.
|
|
687
|
-
ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP,
|
|
703
|
+
ProvingRequestType.PUBLIC_CHONK_VERIFIER,
|
|
704
|
+
ProvingRequestType.PARITY_ROOT,
|
|
705
|
+
ProvingRequestType.PARITY_BASE,
|
|
688
706
|
];
|
|
@@ -111,7 +111,7 @@ export class KVBrokerDatabase implements ProvingBrokerDatabase {
|
|
|
111
111
|
private async estimateSize() {
|
|
112
112
|
const sizes = await Promise.all(Array.from(this.epochs.values()).map(x => x.estimateSize()));
|
|
113
113
|
return {
|
|
114
|
-
mappingSize: this.config.
|
|
114
|
+
mappingSize: this.config.dataStoreMapSizeKb,
|
|
115
115
|
physicalFileSize: sizes.reduce((prev, curr) => prev + curr.physicalFileSize, 0),
|
|
116
116
|
numItems: sizes.reduce((prev, curr) => prev + curr.numItems, 0),
|
|
117
117
|
actualSize: sizes.reduce((prev, curr) => prev + curr.actualSize, 0),
|
|
@@ -137,13 +137,13 @@ export class KVBrokerDatabase implements ProvingBrokerDatabase {
|
|
|
137
137
|
continue;
|
|
138
138
|
}
|
|
139
139
|
logger.info(
|
|
140
|
-
`Loading broker database for epoch ${epochNumber} from ${fullDirectory} with map size ${config.
|
|
140
|
+
`Loading broker database for epoch ${epochNumber} from ${fullDirectory} with map size ${config.dataStoreMapSizeKb}KB`,
|
|
141
141
|
);
|
|
142
142
|
const db = await openVersionedStoreAt(
|
|
143
143
|
fullDirectory,
|
|
144
144
|
SingleEpochDatabase.SCHEMA_VERSION,
|
|
145
145
|
config.l1Contracts.rollupAddress,
|
|
146
|
-
config.
|
|
146
|
+
config.dataStoreMapSizeKb,
|
|
147
147
|
);
|
|
148
148
|
const epochDb = new SingleEpochDatabase(db);
|
|
149
149
|
epochs.set(epochNumber, epochDb);
|
|
@@ -202,13 +202,13 @@ export class KVBrokerDatabase implements ProvingBrokerDatabase {
|
|
|
202
202
|
const newEpochDirectory = join(this.config.dataDirectory!, epochNumber.toString());
|
|
203
203
|
await mkdir(newEpochDirectory, { recursive: true });
|
|
204
204
|
this.logger.info(
|
|
205
|
-
`Creating broker database for epoch ${epochNumber} at ${newEpochDirectory} with map size ${this.config.
|
|
205
|
+
`Creating broker database for epoch ${epochNumber} at ${newEpochDirectory} with map size ${this.config.dataStoreMapSizeKb}`,
|
|
206
206
|
);
|
|
207
207
|
const db = await openVersionedStoreAt(
|
|
208
208
|
newEpochDirectory,
|
|
209
209
|
SingleEpochDatabase.SCHEMA_VERSION,
|
|
210
210
|
this.config.l1Contracts.rollupAddress,
|
|
211
|
-
this.config.
|
|
211
|
+
this.config.dataStoreMapSizeKb,
|
|
212
212
|
);
|
|
213
213
|
epochDb = new SingleEpochDatabase(db);
|
|
214
214
|
this.epochs.set(epochNumber, epochDb);
|
|
@@ -128,54 +128,74 @@ export class ProvingJobController {
|
|
|
128
128
|
return await this.circuitProver.getAvmProof(inputs, undefined, signal, this.epochNumber);
|
|
129
129
|
}
|
|
130
130
|
|
|
131
|
-
case ProvingRequestType.
|
|
132
|
-
return await this.circuitProver.
|
|
131
|
+
case ProvingRequestType.PUBLIC_CHONK_VERIFIER: {
|
|
132
|
+
return await this.circuitProver.getPublicChonkVerifierProof(inputs, signal, this.epochNumber);
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
-
case ProvingRequestType.
|
|
136
|
-
return await this.circuitProver.
|
|
135
|
+
case ProvingRequestType.PRIVATE_TX_BASE_ROLLUP: {
|
|
136
|
+
return await this.circuitProver.getPrivateTxBaseRollupProof(inputs, signal, this.epochNumber);
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
case ProvingRequestType.
|
|
140
|
-
return await this.circuitProver.
|
|
139
|
+
case ProvingRequestType.PUBLIC_TX_BASE_ROLLUP: {
|
|
140
|
+
return await this.circuitProver.getPublicTxBaseRollupProof(inputs, signal, this.epochNumber);
|
|
141
141
|
}
|
|
142
142
|
|
|
143
|
-
case ProvingRequestType.
|
|
144
|
-
return await this.circuitProver.
|
|
143
|
+
case ProvingRequestType.TX_MERGE_ROLLUP: {
|
|
144
|
+
return await this.circuitProver.getTxMergeRollupProof(inputs, signal, this.epochNumber);
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
case ProvingRequestType.
|
|
148
|
-
return await this.circuitProver.
|
|
147
|
+
case ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP: {
|
|
148
|
+
return await this.circuitProver.getBlockRootFirstRollupProof(inputs, signal, this.epochNumber);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
case ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP: {
|
|
152
|
+
return await this.circuitProver.getBlockRootSingleTxFirstRollupProof(inputs, signal, this.epochNumber);
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
case ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP: {
|
|
156
|
+
return await this.circuitProver.getBlockRootEmptyTxFirstRollupProof(inputs, signal, this.epochNumber);
|
|
149
157
|
}
|
|
150
158
|
|
|
151
159
|
case ProvingRequestType.BLOCK_ROOT_ROLLUP: {
|
|
152
160
|
return await this.circuitProver.getBlockRootRollupProof(inputs, signal, this.epochNumber);
|
|
153
161
|
}
|
|
154
162
|
|
|
155
|
-
case ProvingRequestType.
|
|
156
|
-
return await this.circuitProver.
|
|
163
|
+
case ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP: {
|
|
164
|
+
return await this.circuitProver.getBlockRootSingleTxRollupProof(inputs, signal, this.epochNumber);
|
|
157
165
|
}
|
|
158
166
|
|
|
159
167
|
case ProvingRequestType.BLOCK_MERGE_ROLLUP: {
|
|
160
168
|
return await this.circuitProver.getBlockMergeRollupProof(inputs, signal, this.epochNumber);
|
|
161
169
|
}
|
|
162
170
|
|
|
171
|
+
case ProvingRequestType.CHECKPOINT_ROOT_ROLLUP: {
|
|
172
|
+
return await this.circuitProver.getCheckpointRootRollupProof(inputs, signal, this.epochNumber);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
case ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP: {
|
|
176
|
+
return await this.circuitProver.getCheckpointRootSingleBlockRollupProof(inputs, signal, this.epochNumber);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
case ProvingRequestType.CHECKPOINT_PADDING_ROLLUP: {
|
|
180
|
+
return await this.circuitProver.getCheckpointPaddingRollupProof(inputs, signal, this.epochNumber);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
case ProvingRequestType.CHECKPOINT_MERGE_ROLLUP: {
|
|
184
|
+
return await this.circuitProver.getCheckpointMergeRollupProof(inputs, signal, this.epochNumber);
|
|
185
|
+
}
|
|
186
|
+
|
|
163
187
|
case ProvingRequestType.ROOT_ROLLUP: {
|
|
164
188
|
return await this.circuitProver.getRootRollupProof(inputs, signal, this.epochNumber);
|
|
165
189
|
}
|
|
166
190
|
|
|
167
|
-
case ProvingRequestType.
|
|
191
|
+
case ProvingRequestType.PARITY_BASE: {
|
|
168
192
|
return await this.circuitProver.getBaseParityProof(inputs, signal, this.epochNumber);
|
|
169
193
|
}
|
|
170
194
|
|
|
171
|
-
case ProvingRequestType.
|
|
195
|
+
case ProvingRequestType.PARITY_ROOT: {
|
|
172
196
|
return await this.circuitProver.getRootParityProof(inputs, signal, this.epochNumber);
|
|
173
197
|
}
|
|
174
198
|
|
|
175
|
-
case ProvingRequestType.TUBE_PROOF: {
|
|
176
|
-
return await this.circuitProver.getTubeProof(inputs, signal, this.epochNumber);
|
|
177
|
-
}
|
|
178
|
-
|
|
179
199
|
default: {
|
|
180
200
|
const _exhaustive: never = type;
|
|
181
201
|
return Promise.reject(new Error(`Invalid proof request type: ${type}`));
|
package/src/test/mock_prover.ts
CHANGED
|
@@ -4,12 +4,10 @@ import {
|
|
|
4
4
|
NESTED_RECURSIVE_PROOF_LENGTH,
|
|
5
5
|
NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH,
|
|
6
6
|
RECURSIVE_PROOF_LENGTH,
|
|
7
|
-
TUBE_PROOF_LENGTH,
|
|
8
7
|
} from '@aztec/constants';
|
|
9
8
|
import { times } from '@aztec/foundation/collection';
|
|
10
9
|
import type { AvmCircuitInputs } from '@aztec/stdlib/avm';
|
|
11
10
|
import {
|
|
12
|
-
type ProofAndVerificationKey,
|
|
13
11
|
type ProvingJob,
|
|
14
12
|
type ProvingJobId,
|
|
15
13
|
type ProvingJobProducer,
|
|
@@ -19,27 +17,37 @@ import {
|
|
|
19
17
|
makeProofAndVerificationKey,
|
|
20
18
|
makePublicInputsAndRecursiveProof,
|
|
21
19
|
} from '@aztec/stdlib/interfaces/server';
|
|
22
|
-
import type {
|
|
20
|
+
import type { ParityBasePrivateInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
23
21
|
import { makeEmptyRecursiveProof, makeRecursiveProof } from '@aztec/stdlib/proofs';
|
|
24
22
|
import type {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
BlockMergeRollupPrivateInputs,
|
|
24
|
+
BlockRollupPublicInputs,
|
|
25
|
+
BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
26
|
+
BlockRootFirstRollupPrivateInputs,
|
|
27
|
+
BlockRootRollupPrivateInputs,
|
|
28
|
+
BlockRootSingleTxFirstRollupPrivateInputs,
|
|
29
|
+
BlockRootSingleTxRollupPrivateInputs,
|
|
30
|
+
CheckpointMergeRollupPrivateInputs,
|
|
31
|
+
CheckpointPaddingRollupPrivateInputs,
|
|
32
|
+
CheckpointRollupPublicInputs,
|
|
33
|
+
CheckpointRootRollupPrivateInputs,
|
|
34
|
+
CheckpointRootSingleBlockRollupPrivateInputs,
|
|
35
|
+
PrivateTxBaseRollupPrivateInputs,
|
|
36
|
+
PublicChonkVerifierPrivateInputs,
|
|
37
|
+
PublicChonkVerifierPublicInputs,
|
|
38
|
+
PublicTxBaseRollupPrivateInputs,
|
|
39
|
+
RootRollupPrivateInputs,
|
|
35
40
|
RootRollupPublicInputs,
|
|
36
|
-
|
|
41
|
+
TxMergeRollupPrivateInputs,
|
|
42
|
+
TxRollupPublicInputs,
|
|
37
43
|
} from '@aztec/stdlib/rollup';
|
|
38
44
|
import {
|
|
39
|
-
|
|
40
|
-
|
|
45
|
+
makeBlockRollupPublicInputs,
|
|
46
|
+
makeCheckpointRollupPublicInputs,
|
|
41
47
|
makeParityPublicInputs,
|
|
48
|
+
makePublicChonkVerifierPublicInputs,
|
|
42
49
|
makeRootRollupPublicInputs,
|
|
50
|
+
makeTxRollupPublicInputs,
|
|
43
51
|
} from '@aztec/stdlib/testing';
|
|
44
52
|
import { VerificationKeyData } from '@aztec/stdlib/vks';
|
|
45
53
|
|
|
@@ -111,7 +119,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
111
119
|
);
|
|
112
120
|
}
|
|
113
121
|
|
|
114
|
-
getBaseParityProof(_inputs:
|
|
122
|
+
getBaseParityProof(_inputs: ParityBasePrivateInputs, _signal?: AbortSignal, _epochNumber?: number) {
|
|
115
123
|
return Promise.resolve(
|
|
116
124
|
makePublicInputsAndRecursiveProof(
|
|
117
125
|
makeParityPublicInputs(),
|
|
@@ -121,7 +129,7 @@ export class MockProver implements ServerCircuitProver {
|
|
|
121
129
|
);
|
|
122
130
|
}
|
|
123
131
|
|
|
124
|
-
getRootParityProof(_inputs:
|
|
132
|
+
getRootParityProof(_inputs: ParityRootPrivateInputs, _signal?: AbortSignal, _epochNumber?: number) {
|
|
125
133
|
return Promise.resolve(
|
|
126
134
|
makePublicInputsAndRecursiveProof(
|
|
127
135
|
makeParityPublicInputs(),
|
|
@@ -131,130 +139,210 @@ export class MockProver implements ServerCircuitProver {
|
|
|
131
139
|
);
|
|
132
140
|
}
|
|
133
141
|
|
|
134
|
-
|
|
135
|
-
|
|
142
|
+
getPublicChonkVerifierProof(
|
|
143
|
+
_inputs: PublicChonkVerifierPrivateInputs,
|
|
136
144
|
_signal?: AbortSignal,
|
|
137
145
|
_epochNumber?: number,
|
|
138
146
|
): Promise<
|
|
139
|
-
PublicInputsAndRecursiveProof<
|
|
147
|
+
PublicInputsAndRecursiveProof<PublicChonkVerifierPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
140
148
|
> {
|
|
141
149
|
return Promise.resolve(
|
|
142
150
|
makePublicInputsAndRecursiveProof(
|
|
143
|
-
|
|
151
|
+
makePublicChonkVerifierPublicInputs(),
|
|
144
152
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
145
153
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
146
154
|
),
|
|
147
155
|
);
|
|
148
156
|
}
|
|
149
157
|
|
|
150
|
-
|
|
151
|
-
|
|
158
|
+
getPrivateTxBaseRollupProof(
|
|
159
|
+
_baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
152
160
|
_signal?: AbortSignal,
|
|
153
161
|
_epochNumber?: number,
|
|
154
|
-
): Promise<
|
|
155
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
156
|
-
> {
|
|
162
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
157
163
|
return Promise.resolve(
|
|
158
164
|
makePublicInputsAndRecursiveProof(
|
|
159
|
-
|
|
165
|
+
makeTxRollupPublicInputs(),
|
|
160
166
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
161
167
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
162
168
|
),
|
|
163
169
|
);
|
|
164
170
|
}
|
|
165
171
|
|
|
166
|
-
|
|
167
|
-
|
|
172
|
+
getPublicTxBaseRollupProof(
|
|
173
|
+
_inputs: PublicTxBaseRollupPrivateInputs,
|
|
168
174
|
_signal?: AbortSignal,
|
|
169
175
|
_epochNumber?: number,
|
|
170
|
-
): Promise<
|
|
171
|
-
|
|
172
|
-
|
|
176
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
177
|
+
return Promise.resolve(
|
|
178
|
+
makePublicInputsAndRecursiveProof(
|
|
179
|
+
makeTxRollupPublicInputs(),
|
|
180
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
181
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
182
|
+
),
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
getTxMergeRollupProof(
|
|
187
|
+
_input: TxMergeRollupPrivateInputs,
|
|
188
|
+
_signal?: AbortSignal,
|
|
189
|
+
_epochNumber?: number,
|
|
190
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
191
|
+
return Promise.resolve(
|
|
192
|
+
makePublicInputsAndRecursiveProof(
|
|
193
|
+
makeTxRollupPublicInputs(),
|
|
194
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
195
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
196
|
+
),
|
|
197
|
+
);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
getBlockRootFirstRollupProof(
|
|
201
|
+
_input: BlockRootFirstRollupPrivateInputs,
|
|
202
|
+
_signal?: AbortSignal,
|
|
203
|
+
_epochNumber?: number,
|
|
204
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
205
|
+
return Promise.resolve(
|
|
206
|
+
makePublicInputsAndRecursiveProof(
|
|
207
|
+
makeBlockRollupPublicInputs(),
|
|
208
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
209
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
210
|
+
),
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
getBlockRootSingleTxFirstRollupProof(
|
|
215
|
+
_input: BlockRootSingleTxFirstRollupPrivateInputs,
|
|
216
|
+
_signal?: AbortSignal,
|
|
217
|
+
_epochNumber?: number,
|
|
218
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
219
|
+
return Promise.resolve(
|
|
220
|
+
makePublicInputsAndRecursiveProof(
|
|
221
|
+
makeBlockRollupPublicInputs(),
|
|
222
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
223
|
+
VerificationKeyData.makeFakeHonk(),
|
|
224
|
+
),
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
getBlockRootEmptyTxFirstRollupProof(
|
|
229
|
+
_input: BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
230
|
+
_signal?: AbortSignal,
|
|
231
|
+
_epochNumber?: number,
|
|
232
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
233
|
+
return Promise.resolve(
|
|
234
|
+
makePublicInputsAndRecursiveProof(
|
|
235
|
+
makeBlockRollupPublicInputs(),
|
|
236
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
237
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
238
|
+
),
|
|
239
|
+
);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
getBlockRootRollupProof(
|
|
243
|
+
_input: BlockRootRollupPrivateInputs,
|
|
244
|
+
_signal?: AbortSignal,
|
|
245
|
+
_epochNumber?: number,
|
|
246
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
173
247
|
return Promise.resolve(
|
|
174
248
|
makePublicInputsAndRecursiveProof(
|
|
175
|
-
|
|
249
|
+
makeBlockRollupPublicInputs(),
|
|
176
250
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
177
251
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
178
252
|
),
|
|
179
253
|
);
|
|
180
254
|
}
|
|
181
255
|
|
|
182
|
-
|
|
256
|
+
getBlockRootSingleTxRollupProof(
|
|
257
|
+
_input: BlockRootSingleTxRollupPrivateInputs,
|
|
258
|
+
_signal?: AbortSignal,
|
|
259
|
+
_epochNumber?: number,
|
|
260
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
261
|
+
return Promise.resolve(
|
|
262
|
+
makePublicInputsAndRecursiveProof(
|
|
263
|
+
makeBlockRollupPublicInputs(),
|
|
264
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
265
|
+
VerificationKeyData.makeFakeHonk(),
|
|
266
|
+
),
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
getBlockMergeRollupProof(_input: BlockMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number) {
|
|
183
271
|
return Promise.resolve(
|
|
184
272
|
makePublicInputsAndRecursiveProof(
|
|
185
|
-
|
|
273
|
+
makeBlockRollupPublicInputs(),
|
|
186
274
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
187
275
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
188
276
|
),
|
|
189
277
|
);
|
|
190
278
|
}
|
|
191
279
|
|
|
192
|
-
|
|
193
|
-
_input:
|
|
280
|
+
getCheckpointRootRollupProof(
|
|
281
|
+
_input: CheckpointRootRollupPrivateInputs,
|
|
194
282
|
_signal?: AbortSignal,
|
|
195
283
|
_epochNumber?: number,
|
|
196
284
|
): Promise<
|
|
197
|
-
PublicInputsAndRecursiveProof<
|
|
285
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
198
286
|
> {
|
|
199
287
|
return Promise.resolve(
|
|
200
288
|
makePublicInputsAndRecursiveProof(
|
|
201
|
-
|
|
289
|
+
makeCheckpointRollupPublicInputs(),
|
|
202
290
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
203
291
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
204
292
|
),
|
|
205
293
|
);
|
|
206
294
|
}
|
|
207
295
|
|
|
208
|
-
|
|
209
|
-
_input:
|
|
296
|
+
getCheckpointRootSingleBlockRollupProof(
|
|
297
|
+
_input: CheckpointRootSingleBlockRollupPrivateInputs,
|
|
210
298
|
_signal?: AbortSignal,
|
|
211
299
|
_epochNumber?: number,
|
|
212
300
|
): Promise<
|
|
213
|
-
PublicInputsAndRecursiveProof<
|
|
301
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
214
302
|
> {
|
|
215
303
|
return Promise.resolve(
|
|
216
304
|
makePublicInputsAndRecursiveProof(
|
|
217
|
-
|
|
305
|
+
makeCheckpointRollupPublicInputs(),
|
|
218
306
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
219
307
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
220
308
|
),
|
|
221
309
|
);
|
|
222
310
|
}
|
|
223
311
|
|
|
224
|
-
|
|
225
|
-
_input:
|
|
312
|
+
getCheckpointMergeRollupProof(
|
|
313
|
+
_input: CheckpointMergeRollupPrivateInputs,
|
|
226
314
|
_signal?: AbortSignal,
|
|
227
315
|
_epochNumber?: number,
|
|
228
316
|
): Promise<
|
|
229
|
-
PublicInputsAndRecursiveProof<
|
|
317
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
230
318
|
> {
|
|
231
319
|
return Promise.resolve(
|
|
232
320
|
makePublicInputsAndRecursiveProof(
|
|
233
|
-
|
|
321
|
+
makeCheckpointRollupPublicInputs(),
|
|
234
322
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
235
323
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
236
324
|
),
|
|
237
325
|
);
|
|
238
326
|
}
|
|
239
327
|
|
|
240
|
-
|
|
241
|
-
_input:
|
|
328
|
+
getCheckpointPaddingRollupProof(
|
|
329
|
+
_input: CheckpointPaddingRollupPrivateInputs,
|
|
242
330
|
_signal?: AbortSignal,
|
|
243
331
|
_epochNumber?: number,
|
|
244
332
|
): Promise<
|
|
245
|
-
PublicInputsAndRecursiveProof<
|
|
333
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
246
334
|
> {
|
|
247
335
|
return Promise.resolve(
|
|
248
336
|
makePublicInputsAndRecursiveProof(
|
|
249
|
-
|
|
337
|
+
makeCheckpointRollupPublicInputs(),
|
|
250
338
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
251
|
-
VerificationKeyData.
|
|
339
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
252
340
|
),
|
|
253
341
|
);
|
|
254
342
|
}
|
|
255
343
|
|
|
256
344
|
getRootRollupProof(
|
|
257
|
-
_input:
|
|
345
|
+
_input: RootRollupPrivateInputs,
|
|
258
346
|
_signal?: AbortSignal,
|
|
259
347
|
_epochNumber?: number,
|
|
260
348
|
): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs>> {
|
|
@@ -266,10 +354,4 @@ export class MockProver implements ServerCircuitProver {
|
|
|
266
354
|
),
|
|
267
355
|
);
|
|
268
356
|
}
|
|
269
|
-
|
|
270
|
-
getTubeProof(): Promise<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>> {
|
|
271
|
-
return Promise.resolve(
|
|
272
|
-
makeProofAndVerificationKey(makeRecursiveProof(TUBE_PROOF_LENGTH), VerificationKeyData.makeFakeRollupHonk()),
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
357
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-proof-inputs.d.ts","sourceRoot":"","sources":["../../src/bin/get-proof-inputs.ts"],"names":[],"mappings":""}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */ import { AVM_INPUTS_FILENAME } from '@aztec/bb-prover';
|
|
2
|
-
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
|
-
import { createLogger } from '@aztec/foundation/log';
|
|
4
|
-
import { ProvingJobInputs } from '@aztec/stdlib/interfaces/server';
|
|
5
|
-
import { ProvingRequestType } from '@aztec/stdlib/proofs';
|
|
6
|
-
import { mkdirSync, writeFileSync } from 'fs';
|
|
7
|
-
import { createProofStoreForUri } from '../proving_broker/index.js';
|
|
8
|
-
const logger = createLogger('prover-client:get-proof-inputs');
|
|
9
|
-
function printUsage() {
|
|
10
|
-
console.error('Usage: get-proof-inputs <proof-uri> [out-dir=.]');
|
|
11
|
-
}
|
|
12
|
-
async function main() {
|
|
13
|
-
if (process.argv[2] === '--help') {
|
|
14
|
-
printUsage();
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
const uri = process.argv[2];
|
|
18
|
-
const outDir = process.argv[3] || '.';
|
|
19
|
-
if (!uri) {
|
|
20
|
-
printUsage();
|
|
21
|
-
throw new Error('Missing proof URI');
|
|
22
|
-
}
|
|
23
|
-
mkdirSync(outDir, {
|
|
24
|
-
recursive: true
|
|
25
|
-
});
|
|
26
|
-
const proofStore = createProofStoreForUri(uri);
|
|
27
|
-
logger.info(`Processing uri ${uri}`);
|
|
28
|
-
const input = await proofStore.getProofInput(uri);
|
|
29
|
-
logger.info(`Found inputs for ${ProvingRequestType[input.type]}`);
|
|
30
|
-
writeProofInputs(input, outDir);
|
|
31
|
-
console.log(jsonParseWithSchema(jsonStringify(input), ProvingJobInputs).inputs);
|
|
32
|
-
}
|
|
33
|
-
// This mimics the behavior of bb-prover/src/bb/execute.ts
|
|
34
|
-
function writeProofInputs(input, outDir) {
|
|
35
|
-
switch(input.type){
|
|
36
|
-
case ProvingRequestType.PUBLIC_VM:
|
|
37
|
-
{
|
|
38
|
-
writeFileSync(`${outDir}/${AVM_INPUTS_FILENAME}`, input.inputs.serializeWithMessagePack());
|
|
39
|
-
logger.info(`Wrote AVM inputs to ${AVM_INPUTS_FILENAME}`);
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
default:
|
|
43
|
-
{
|
|
44
|
-
throw new Error(`Unimplemented proving request type: ${ProvingRequestType[input.type]}`);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
main().catch((err)=>{
|
|
49
|
-
console.error(err);
|
|
50
|
-
process.exit(1);
|
|
51
|
-
});
|