@aztec/prover-client 2.1.0-rc.9 → 3.0.0-devnet.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/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/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 +125 -81
- package/dest/orchestrator/orchestrator.d.ts +26 -25
- package/dest/orchestrator/orchestrator.d.ts.map +1 -1
- package/dest/orchestrator/orchestrator.js +350 -218
- 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 +8 -7
- package/dest/prover-client/server-epoch-prover.d.ts.map +1 -1
- package/dest/prover-client/server-epoch-prover.js +7 -7
- 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 +4 -4
- 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/mocks/fixtures.ts +39 -11
- package/src/mocks/test_context.ts +137 -31
- package/src/orchestrator/block-building-helpers.ts +213 -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 +169 -126
- package/src/orchestrator/orchestrator.ts +519 -286
- package/src/orchestrator/tx-proving-state.ts +45 -43
- package/src/prover-client/server-epoch-prover.ts +26 -16
- package/src/proving_broker/broker_prover_facade.ts +157 -88
- package/src/proving_broker/config.ts +6 -6
- 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 -62
- 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
|
@@ -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_TUBE]: 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_TUBE,
|
|
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_TUBE: {
|
|
132
|
+
return await this.circuitProver.getPublicTubeProof(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
|
+
PublicTubePrivateInputs,
|
|
37
|
+
PublicTubePublicInputs,
|
|
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
|
+
makePublicTubePublicInputs,
|
|
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,208 @@ export class MockProver implements ServerCircuitProver {
|
|
|
131
139
|
);
|
|
132
140
|
}
|
|
133
141
|
|
|
134
|
-
|
|
135
|
-
|
|
142
|
+
getPublicTubeProof(
|
|
143
|
+
_inputs: PublicTubePrivateInputs,
|
|
136
144
|
_signal?: AbortSignal,
|
|
137
145
|
_epochNumber?: number,
|
|
138
|
-
): Promise<
|
|
139
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
140
|
-
> {
|
|
146
|
+
): Promise<PublicInputsAndRecursiveProof<PublicTubePublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
141
147
|
return Promise.resolve(
|
|
142
148
|
makePublicInputsAndRecursiveProof(
|
|
143
|
-
|
|
149
|
+
makePublicTubePublicInputs(),
|
|
144
150
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
145
151
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
146
152
|
),
|
|
147
153
|
);
|
|
148
154
|
}
|
|
149
155
|
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
getPrivateTxBaseRollupProof(
|
|
157
|
+
_baseRollupInput: PrivateTxBaseRollupPrivateInputs,
|
|
152
158
|
_signal?: AbortSignal,
|
|
153
159
|
_epochNumber?: number,
|
|
154
|
-
): Promise<
|
|
155
|
-
PublicInputsAndRecursiveProof<BaseOrMergeRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
156
|
-
> {
|
|
160
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
157
161
|
return Promise.resolve(
|
|
158
162
|
makePublicInputsAndRecursiveProof(
|
|
159
|
-
|
|
163
|
+
makeTxRollupPublicInputs(),
|
|
160
164
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
161
165
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
162
166
|
),
|
|
163
167
|
);
|
|
164
168
|
}
|
|
165
169
|
|
|
166
|
-
|
|
167
|
-
|
|
170
|
+
getPublicTxBaseRollupProof(
|
|
171
|
+
_inputs: PublicTxBaseRollupPrivateInputs,
|
|
168
172
|
_signal?: AbortSignal,
|
|
169
173
|
_epochNumber?: number,
|
|
170
|
-
): Promise<
|
|
171
|
-
|
|
172
|
-
|
|
174
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
175
|
+
return Promise.resolve(
|
|
176
|
+
makePublicInputsAndRecursiveProof(
|
|
177
|
+
makeTxRollupPublicInputs(),
|
|
178
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
179
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
180
|
+
),
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
getTxMergeRollupProof(
|
|
185
|
+
_input: TxMergeRollupPrivateInputs,
|
|
186
|
+
_signal?: AbortSignal,
|
|
187
|
+
_epochNumber?: number,
|
|
188
|
+
): Promise<PublicInputsAndRecursiveProof<TxRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
189
|
+
return Promise.resolve(
|
|
190
|
+
makePublicInputsAndRecursiveProof(
|
|
191
|
+
makeTxRollupPublicInputs(),
|
|
192
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
193
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
194
|
+
),
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
getBlockRootFirstRollupProof(
|
|
199
|
+
_input: BlockRootFirstRollupPrivateInputs,
|
|
200
|
+
_signal?: AbortSignal,
|
|
201
|
+
_epochNumber?: number,
|
|
202
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
203
|
+
return Promise.resolve(
|
|
204
|
+
makePublicInputsAndRecursiveProof(
|
|
205
|
+
makeBlockRollupPublicInputs(),
|
|
206
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
207
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
208
|
+
),
|
|
209
|
+
);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
getBlockRootSingleTxFirstRollupProof(
|
|
213
|
+
_input: BlockRootSingleTxFirstRollupPrivateInputs,
|
|
214
|
+
_signal?: AbortSignal,
|
|
215
|
+
_epochNumber?: number,
|
|
216
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
217
|
+
return Promise.resolve(
|
|
218
|
+
makePublicInputsAndRecursiveProof(
|
|
219
|
+
makeBlockRollupPublicInputs(),
|
|
220
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
221
|
+
VerificationKeyData.makeFakeHonk(),
|
|
222
|
+
),
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
getBlockRootEmptyTxFirstRollupProof(
|
|
227
|
+
_input: BlockRootEmptyTxFirstRollupPrivateInputs,
|
|
228
|
+
_signal?: AbortSignal,
|
|
229
|
+
_epochNumber?: number,
|
|
230
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
173
231
|
return Promise.resolve(
|
|
174
232
|
makePublicInputsAndRecursiveProof(
|
|
175
|
-
|
|
233
|
+
makeBlockRollupPublicInputs(),
|
|
176
234
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
177
235
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
178
236
|
),
|
|
179
237
|
);
|
|
180
238
|
}
|
|
181
239
|
|
|
182
|
-
|
|
240
|
+
getBlockRootRollupProof(
|
|
241
|
+
_input: BlockRootRollupPrivateInputs,
|
|
242
|
+
_signal?: AbortSignal,
|
|
243
|
+
_epochNumber?: number,
|
|
244
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
183
245
|
return Promise.resolve(
|
|
184
246
|
makePublicInputsAndRecursiveProof(
|
|
185
|
-
|
|
247
|
+
makeBlockRollupPublicInputs(),
|
|
186
248
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
187
249
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
188
250
|
),
|
|
189
251
|
);
|
|
190
252
|
}
|
|
191
253
|
|
|
192
|
-
|
|
193
|
-
_input:
|
|
254
|
+
getBlockRootSingleTxRollupProof(
|
|
255
|
+
_input: BlockRootSingleTxRollupPrivateInputs,
|
|
256
|
+
_signal?: AbortSignal,
|
|
257
|
+
_epochNumber?: number,
|
|
258
|
+
): Promise<PublicInputsAndRecursiveProof<BlockRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>> {
|
|
259
|
+
return Promise.resolve(
|
|
260
|
+
makePublicInputsAndRecursiveProof(
|
|
261
|
+
makeBlockRollupPublicInputs(),
|
|
262
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
263
|
+
VerificationKeyData.makeFakeHonk(),
|
|
264
|
+
),
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
getBlockMergeRollupProof(_input: BlockMergeRollupPrivateInputs, _signal?: AbortSignal, _epochNumber?: number) {
|
|
269
|
+
return Promise.resolve(
|
|
270
|
+
makePublicInputsAndRecursiveProof(
|
|
271
|
+
makeBlockRollupPublicInputs(),
|
|
272
|
+
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
273
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
274
|
+
),
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
getCheckpointRootRollupProof(
|
|
279
|
+
_input: CheckpointRootRollupPrivateInputs,
|
|
194
280
|
_signal?: AbortSignal,
|
|
195
281
|
_epochNumber?: number,
|
|
196
282
|
): Promise<
|
|
197
|
-
PublicInputsAndRecursiveProof<
|
|
283
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
198
284
|
> {
|
|
199
285
|
return Promise.resolve(
|
|
200
286
|
makePublicInputsAndRecursiveProof(
|
|
201
|
-
|
|
287
|
+
makeCheckpointRollupPublicInputs(),
|
|
202
288
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
203
289
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
204
290
|
),
|
|
205
291
|
);
|
|
206
292
|
}
|
|
207
293
|
|
|
208
|
-
|
|
209
|
-
_input:
|
|
294
|
+
getCheckpointRootSingleBlockRollupProof(
|
|
295
|
+
_input: CheckpointRootSingleBlockRollupPrivateInputs,
|
|
210
296
|
_signal?: AbortSignal,
|
|
211
297
|
_epochNumber?: number,
|
|
212
298
|
): Promise<
|
|
213
|
-
PublicInputsAndRecursiveProof<
|
|
299
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
214
300
|
> {
|
|
215
301
|
return Promise.resolve(
|
|
216
302
|
makePublicInputsAndRecursiveProof(
|
|
217
|
-
|
|
303
|
+
makeCheckpointRollupPublicInputs(),
|
|
218
304
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
219
305
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
220
306
|
),
|
|
221
307
|
);
|
|
222
308
|
}
|
|
223
309
|
|
|
224
|
-
|
|
225
|
-
_input:
|
|
310
|
+
getCheckpointMergeRollupProof(
|
|
311
|
+
_input: CheckpointMergeRollupPrivateInputs,
|
|
226
312
|
_signal?: AbortSignal,
|
|
227
313
|
_epochNumber?: number,
|
|
228
314
|
): Promise<
|
|
229
|
-
PublicInputsAndRecursiveProof<
|
|
315
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
230
316
|
> {
|
|
231
317
|
return Promise.resolve(
|
|
232
318
|
makePublicInputsAndRecursiveProof(
|
|
233
|
-
|
|
319
|
+
makeCheckpointRollupPublicInputs(),
|
|
234
320
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
235
321
|
VerificationKeyData.makeFakeRollupHonk(),
|
|
236
322
|
),
|
|
237
323
|
);
|
|
238
324
|
}
|
|
239
325
|
|
|
240
|
-
|
|
241
|
-
_input:
|
|
326
|
+
getCheckpointPaddingRollupProof(
|
|
327
|
+
_input: CheckpointPaddingRollupPrivateInputs,
|
|
242
328
|
_signal?: AbortSignal,
|
|
243
329
|
_epochNumber?: number,
|
|
244
330
|
): Promise<
|
|
245
|
-
PublicInputsAndRecursiveProof<
|
|
331
|
+
PublicInputsAndRecursiveProof<CheckpointRollupPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>
|
|
246
332
|
> {
|
|
247
333
|
return Promise.resolve(
|
|
248
334
|
makePublicInputsAndRecursiveProof(
|
|
249
|
-
|
|
335
|
+
makeCheckpointRollupPublicInputs(),
|
|
250
336
|
makeRecursiveProof(NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH),
|
|
251
|
-
VerificationKeyData.
|
|
337
|
+
VerificationKeyData.makeFakeRollupHonk(),
|
|
252
338
|
),
|
|
253
339
|
);
|
|
254
340
|
}
|
|
255
341
|
|
|
256
342
|
getRootRollupProof(
|
|
257
|
-
_input:
|
|
343
|
+
_input: RootRollupPrivateInputs,
|
|
258
344
|
_signal?: AbortSignal,
|
|
259
345
|
_epochNumber?: number,
|
|
260
346
|
): Promise<PublicInputsAndRecursiveProof<RootRollupPublicInputs>> {
|
|
@@ -266,10 +352,4 @@ export class MockProver implements ServerCircuitProver {
|
|
|
266
352
|
),
|
|
267
353
|
);
|
|
268
354
|
}
|
|
269
|
-
|
|
270
|
-
getTubeProof(): Promise<ProofAndVerificationKey<typeof TUBE_PROOF_LENGTH>> {
|
|
271
|
-
return Promise.resolve(
|
|
272
|
-
makeProofAndVerificationKey(makeRecursiveProof(TUBE_PROOF_LENGTH), VerificationKeyData.makeFakeRollupHonk()),
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
355
|
}
|
|
@@ -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
|
-
});
|