@aztec/bb-prover 3.0.0-nightly.20250917 → 3.0.0-nightly.20250918
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/prover/server/bb_prover.d.ts +13 -23
- package/dest/prover/server/bb_prover.d.ts.map +1 -1
- package/dest/prover/server/bb_prover.js +48 -99
- package/dest/stats.d.ts.map +1 -1
- package/dest/stats.js +16 -6
- package/dest/test/delay_values.d.ts.map +1 -1
- package/dest/test/delay_values.js +18 -8
- package/dest/test/test_circuit_prover.d.ts +12 -22
- package/dest/test/test_circuit_prover.d.ts.map +1 -1
- package/dest/test/test_circuit_prover.js +55 -38
- package/package.json +16 -16
- package/src/prover/server/bb_prover.ts +166 -188
- package/src/stats.ts +16 -6
- package/src/test/delay_values.ts +18 -8
- package/src/test/test_circuit_prover.ts +154 -79
|
@@ -8,7 +8,7 @@ import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, AVM_V2_VERIFICATION_KEY_LENGTH_IN
|
|
|
8
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
9
9
|
import { sleep } from '@aztec/foundation/sleep';
|
|
10
10
|
import { Timer } from '@aztec/foundation/timer';
|
|
11
|
-
import { convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap,
|
|
11
|
+
import { convertBaseParityInputsToWitnessMap, convertBaseParityOutputsFromWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap, convertBlockMergeRollupPrivateInputsToWitnessMap, convertBlockRootEmptyTxFirstRollupOutputsFromWitnessMap, convertBlockRootEmptyTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootFirstRollupOutputsFromWitnessMap, convertBlockRootFirstRollupPrivateInputsToWitnessMap, convertBlockRootRollupOutputsFromWitnessMap, convertBlockRootRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxFirstRollupOutputsFromWitnessMap, convertBlockRootSingleTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxRollupOutputsFromWitnessMap, convertBlockRootSingleTxRollupPrivateInputsToWitnessMap, convertCheckpointMergeRollupOutputsFromWitnessMap, convertCheckpointMergeRollupPrivateInputsToWitnessMap, convertCheckpointPaddingRollupOutputsFromWitnessMap, convertCheckpointPaddingRollupPrivateInputsToWitnessMap, convertCheckpointRootRollupOutputsFromWitnessMap, convertCheckpointRootRollupPrivateInputsToWitnessMap, convertCheckpointRootSingleBlockRollupOutputsFromWitnessMap, convertCheckpointRootSingleBlockRollupPrivateInputsToWitnessMap, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap, convertRootParityInputsToWitnessMap, convertRootParityOutputsFromWitnessMap, convertRootRollupOutputsFromWitnessMap, convertRootRollupPrivateInputsToWitnessMap, convertSimulatedPrivateBaseRollupInputsToWitnessMap, convertSimulatedPrivateBaseRollupOutputsFromWitnessMap, convertSimulatedPublicBaseRollupInputsToWitnessMap, convertSimulatedPublicBaseRollupOutputsFromWitnessMap, foreignCallHandler, getSimulatedServerCircuitArtifact } from '@aztec/noir-protocol-circuits-types/server';
|
|
12
12
|
import { ProtocolCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks';
|
|
13
13
|
import { WASMSimulatorWithBlobs, emitCircuitSimulationStats } from '@aztec/simulator/server';
|
|
14
14
|
import { makeProofAndVerificationKey, makePublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
@@ -70,39 +70,42 @@ import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
|
|
|
70
70
|
*/ getMergeRollupProof(input) {
|
|
71
71
|
return this.applyDelay(ProvingRequestType.MERGE_ROLLUP, ()=>this.simulate(input, 'MergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertMergeRollupInputsToWitnessMap, convertMergeRollupOutputsFromWitnessMap));
|
|
72
72
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
* @param input - Inputs to the circuit.
|
|
76
|
-
* @returns The public inputs as outputs of the simulation.
|
|
77
|
-
*/ getBlockRootRollupProof(input) {
|
|
78
|
-
return this.applyDelay(ProvingRequestType.BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'BlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertSimulatedBlockRootRollupInputsToWitnessMap, convertSimulatedBlockRootRollupOutputsFromWitnessMap));
|
|
73
|
+
getBlockRootFirstRollupProof(input) {
|
|
74
|
+
return this.applyDelay(ProvingRequestType.BLOCK_ROOT_FIRST_ROLLUP, ()=>this.simulate(input, 'BlockRootFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootFirstRollupPrivateInputsToWitnessMap, convertBlockRootFirstRollupOutputsFromWitnessMap));
|
|
79
75
|
}
|
|
80
|
-
async
|
|
81
|
-
return await this.applyDelay(ProvingRequestType.
|
|
76
|
+
async getBlockRootSingleTxFirstRollupProof(input) {
|
|
77
|
+
return await this.applyDelay(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_FIRST_ROLLUP, ()=>this.simulate(input, 'BlockRootSingleTxFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootSingleTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxFirstRollupOutputsFromWitnessMap));
|
|
82
78
|
}
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
* @param input - Inputs to the circuit.
|
|
86
|
-
* @returns The public inputs as outputs of the simulation.
|
|
87
|
-
*/ getEmptyBlockRootRollupProof(input) {
|
|
88
|
-
return this.applyDelay(ProvingRequestType.EMPTY_BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'EmptyBlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertEmptyBlockRootRollupInputsToWitnessMap, convertEmptyBlockRootRollupOutputsFromWitnessMap));
|
|
79
|
+
getBlockRootEmptyTxFirstRollupProof(input) {
|
|
80
|
+
return this.applyDelay(ProvingRequestType.BLOCK_ROOT_EMPTY_TX_FIRST_ROLLUP, ()=>this.simulate(input, 'BlockRootEmptyTxFirstRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootEmptyTxFirstRollupPrivateInputsToWitnessMap, convertBlockRootEmptyTxFirstRollupOutputsFromWitnessMap));
|
|
89
81
|
}
|
|
90
|
-
|
|
91
|
-
return this.applyDelay(ProvingRequestType.
|
|
82
|
+
getBlockRootRollupProof(input) {
|
|
83
|
+
return this.applyDelay(ProvingRequestType.BLOCK_ROOT_ROLLUP, ()=>this.simulate(input, 'BlockRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootRollupPrivateInputsToWitnessMap, convertBlockRootRollupOutputsFromWitnessMap));
|
|
92
84
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
async getBlockRootSingleTxRollupProof(input) {
|
|
86
|
+
return await this.applyDelay(ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP, ()=>this.simulate(input, 'BlockRootSingleTxRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockRootSingleTxRollupPrivateInputsToWitnessMap, convertBlockRootSingleTxRollupOutputsFromWitnessMap));
|
|
87
|
+
}
|
|
88
|
+
getBlockMergeRollupProof(input) {
|
|
89
|
+
return this.applyDelay(ProvingRequestType.BLOCK_MERGE_ROLLUP, ()=>this.simulate(input, 'BlockMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertBlockMergeRollupPrivateInputsToWitnessMap, convertBlockMergeRollupOutputsFromWitnessMap));
|
|
90
|
+
}
|
|
91
|
+
getCheckpointRootRollupProof(input) {
|
|
92
|
+
return this.applyDelay(ProvingRequestType.CHECKPOINT_ROOT_ROLLUP, ()=>this.simulate(input, 'CheckpointRootRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointRootRollupPrivateInputsToWitnessMap, convertCheckpointRootRollupOutputsFromWitnessMap));
|
|
93
|
+
}
|
|
94
|
+
getCheckpointRootSingleBlockRollupProof(input) {
|
|
95
|
+
return this.applyDelay(ProvingRequestType.CHECKPOINT_ROOT_SINGLE_BLOCK_ROLLUP, ()=>this.simulate(input, 'CheckpointRootSingleBlockRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointRootSingleBlockRollupPrivateInputsToWitnessMap, convertCheckpointRootSingleBlockRollupOutputsFromWitnessMap));
|
|
96
|
+
}
|
|
97
|
+
getCheckpointPaddingRollupProof(input) {
|
|
98
|
+
return this.applyDelay(ProvingRequestType.CHECKPOINT_PADDING_ROLLUP, ()=>this.simulate(input, 'CheckpointPaddingRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointPaddingRollupPrivateInputsToWitnessMap, convertCheckpointPaddingRollupOutputsFromWitnessMap));
|
|
99
|
+
}
|
|
100
|
+
getCheckpointMergeRollupProof(input) {
|
|
101
|
+
return this.applyDelay(ProvingRequestType.CHECKPOINT_MERGE_ROLLUP, ()=>this.simulate(input, 'CheckpointMergeRollupArtifact', NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, convertCheckpointMergeRollupPrivateInputsToWitnessMap, convertCheckpointMergeRollupOutputsFromWitnessMap));
|
|
99
102
|
}
|
|
100
103
|
/**
|
|
101
104
|
* Simulates the root rollup circuit from its inputs.
|
|
102
105
|
* @param input - Inputs to the circuit.
|
|
103
106
|
* @returns The public inputs as outputs of the simulation.
|
|
104
107
|
*/ getRootRollupProof(input) {
|
|
105
|
-
return this.applyDelay(ProvingRequestType.ROOT_ROLLUP, ()=>this.simulate(input, 'RootRollupArtifact', NESTED_RECURSIVE_PROOF_LENGTH,
|
|
108
|
+
return this.applyDelay(ProvingRequestType.ROOT_ROLLUP, ()=>this.simulate(input, 'RootRollupArtifact', NESTED_RECURSIVE_PROOF_LENGTH, convertRootRollupPrivateInputsToWitnessMap, convertRootRollupOutputsFromWitnessMap));
|
|
106
109
|
}
|
|
107
110
|
getAvmProof(_inputs) {
|
|
108
111
|
// We can't simulate the AVM because we don't have enough context to do so (e.g., DBs).
|
|
@@ -128,21 +131,20 @@ import { PROOF_DELAY_MS, WITGEN_DELAY_MS } from './delay_values.js';
|
|
|
128
131
|
}
|
|
129
132
|
async simulate(input, artifactName, proofLength, convertInput, convertOutput) {
|
|
130
133
|
const timer = new Timer();
|
|
131
|
-
const witnessMap = convertInput(input);
|
|
134
|
+
const witnessMap = convertInput(input, true);
|
|
132
135
|
const circuitName = mapProtocolArtifactNameToCircuitName(artifactName);
|
|
133
136
|
let witness;
|
|
134
137
|
if ([
|
|
135
|
-
'
|
|
136
|
-
'
|
|
138
|
+
'CheckpointRootRollupArtifact',
|
|
139
|
+
'CheckpointRootSingleBlockRollupArtifact'
|
|
137
140
|
].includes(artifactName) || this.simulator == undefined) {
|
|
138
141
|
// TODO(#10323): Native ACVM simulator does not support foreign call handler so we use the wasm simulator
|
|
139
|
-
// when simulating
|
|
140
|
-
// is not provided.
|
|
142
|
+
// when simulating checkpoint root rollup circuits or when the native ACVM simulator is not provided.
|
|
141
143
|
witness = (await this.wasmSimulator.executeProtocolCircuit(witnessMap, getSimulatedServerCircuitArtifact(artifactName), foreignCallHandler)).witness;
|
|
142
144
|
} else {
|
|
143
145
|
witness = (await this.simulator.executeProtocolCircuit(witnessMap, getSimulatedServerCircuitArtifact(artifactName), undefined)).witness;
|
|
144
146
|
}
|
|
145
|
-
const result = convertOutput(witness);
|
|
147
|
+
const result = convertOutput(witness, true);
|
|
146
148
|
this.instrumentation.recordDuration('simulationDuration', circuitName, timer);
|
|
147
149
|
emitCircuitSimulationStats(circuitName, timer.ms(), input.toBuffer().length, result.toBuffer().length, this.logger);
|
|
148
150
|
return makePublicInputsAndRecursiveProof(result, makeRecursiveProof(proofLength), ProtocolCircuitVks[artifactName]);
|
|
@@ -164,20 +166,35 @@ _ts_decorate([
|
|
|
164
166
|
trackSpan('TestCircuitProver.getMergeRollupProof')
|
|
165
167
|
], TestCircuitProver.prototype, "getMergeRollupProof", null);
|
|
166
168
|
_ts_decorate([
|
|
167
|
-
trackSpan('TestCircuitProver.
|
|
168
|
-
], TestCircuitProver.prototype, "
|
|
169
|
+
trackSpan('TestCircuitProver.getBlockRootFirstRollupProof')
|
|
170
|
+
], TestCircuitProver.prototype, "getBlockRootFirstRollupProof", null);
|
|
169
171
|
_ts_decorate([
|
|
170
|
-
trackSpan('TestCircuitProver.
|
|
171
|
-
], TestCircuitProver.prototype, "
|
|
172
|
+
trackSpan('TestCircuitProver.getBlockRootSingleTxFirstRollupProof')
|
|
173
|
+
], TestCircuitProver.prototype, "getBlockRootSingleTxFirstRollupProof", null);
|
|
172
174
|
_ts_decorate([
|
|
173
|
-
trackSpan('TestCircuitProver.
|
|
174
|
-
], TestCircuitProver.prototype, "
|
|
175
|
+
trackSpan('TestCircuitProver.getBlockRootEmptyTxFirstRollupProof')
|
|
176
|
+
], TestCircuitProver.prototype, "getBlockRootEmptyTxFirstRollupProof", null);
|
|
175
177
|
_ts_decorate([
|
|
176
|
-
trackSpan('TestCircuitProver.
|
|
177
|
-
], TestCircuitProver.prototype, "
|
|
178
|
+
trackSpan('TestCircuitProver.getBlockRootRollupProof')
|
|
179
|
+
], TestCircuitProver.prototype, "getBlockRootRollupProof", null);
|
|
180
|
+
_ts_decorate([
|
|
181
|
+
trackSpan('TestCircuitProver.getBlockRootSingleTxRollupProof')
|
|
182
|
+
], TestCircuitProver.prototype, "getBlockRootSingleTxRollupProof", null);
|
|
178
183
|
_ts_decorate([
|
|
179
184
|
trackSpan('TestCircuitProver.getBlockMergeRollupProof')
|
|
180
185
|
], TestCircuitProver.prototype, "getBlockMergeRollupProof", null);
|
|
186
|
+
_ts_decorate([
|
|
187
|
+
trackSpan('TestCircuitProver.getCheckpointRootRollupProof')
|
|
188
|
+
], TestCircuitProver.prototype, "getCheckpointRootRollupProof", null);
|
|
189
|
+
_ts_decorate([
|
|
190
|
+
trackSpan('TestCircuitProver.getCheckpointRootSingleBlockRollupProof')
|
|
191
|
+
], TestCircuitProver.prototype, "getCheckpointRootSingleBlockRollupProof", null);
|
|
192
|
+
_ts_decorate([
|
|
193
|
+
trackSpan('TestCircuitProver.getCheckpointPaddingRollupProof')
|
|
194
|
+
], TestCircuitProver.prototype, "getCheckpointPaddingRollupProof", null);
|
|
195
|
+
_ts_decorate([
|
|
196
|
+
trackSpan('TestCircuitProver.getCheckpointMergeRollupProof')
|
|
197
|
+
], TestCircuitProver.prototype, "getCheckpointMergeRollupProof", null);
|
|
181
198
|
_ts_decorate([
|
|
182
199
|
trackSpan('TestCircuitProver.getRootRollupProof')
|
|
183
200
|
], TestCircuitProver.prototype, "getRootRollupProof", null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/bb-prover",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250918",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -69,27 +69,27 @@
|
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/bb.js": "3.0.0-nightly.
|
|
73
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
74
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
75
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
76
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
77
|
-
"@aztec/noir-types": "3.0.0-nightly.
|
|
78
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
79
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
80
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
81
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
72
|
+
"@aztec/bb.js": "3.0.0-nightly.20250918",
|
|
73
|
+
"@aztec/constants": "3.0.0-nightly.20250918",
|
|
74
|
+
"@aztec/foundation": "3.0.0-nightly.20250918",
|
|
75
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250918",
|
|
76
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250918",
|
|
77
|
+
"@aztec/noir-types": "3.0.0-nightly.20250918",
|
|
78
|
+
"@aztec/simulator": "3.0.0-nightly.20250918",
|
|
79
|
+
"@aztec/stdlib": "3.0.0-nightly.20250918",
|
|
80
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250918",
|
|
81
|
+
"@aztec/world-state": "3.0.0-nightly.20250918",
|
|
82
82
|
"commander": "^12.1.0",
|
|
83
83
|
"pako": "^2.1.0",
|
|
84
84
|
"source-map-support": "^0.5.21",
|
|
85
85
|
"tslib": "^2.4.0"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
89
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
90
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
91
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
92
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
88
|
+
"@aztec/ethereum": "3.0.0-nightly.20250918",
|
|
89
|
+
"@aztec/kv-store": "3.0.0-nightly.20250918",
|
|
90
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250918",
|
|
91
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250918",
|
|
92
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250918",
|
|
93
93
|
"@jest/globals": "^30.0.0",
|
|
94
94
|
"@types/jest": "^30.0.0",
|
|
95
95
|
"@types/node": "^22.15.17",
|