@aztec/bb-prover 0.0.1-commit.c7c42ec → 0.0.1-commit.cd76b27
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/avm_proving_tests/avm_proving_tester.d.ts +1 -1
- package/dest/avm_proving_tests/avm_proving_tester.d.ts.map +1 -1
- package/dest/avm_proving_tests/avm_proving_tester.js +5 -2
- package/dest/bb/execute.d.ts +6 -6
- package/dest/bb/execute.d.ts.map +1 -1
- package/dest/bb/execute.js +46 -75
- package/dest/instrumentation.d.ts +1 -1
- package/dest/instrumentation.d.ts.map +1 -1
- package/dest/instrumentation.js +21 -43
- package/dest/prover/client/bb_private_kernel_prover.d.ts +9 -3
- package/dest/prover/client/bb_private_kernel_prover.d.ts.map +1 -1
- package/dest/prover/client/bb_private_kernel_prover.js +16 -4
- package/dest/prover/client/bundle.d.ts +3 -3
- package/dest/prover/client/bundle.d.ts.map +1 -1
- package/dest/prover/client/bundle.js +2 -3
- package/dest/prover/client/lazy.d.ts +3 -3
- package/dest/prover/client/lazy.d.ts.map +1 -1
- package/dest/prover/client/lazy.js +2 -3
- package/dest/prover/server/bb_prover.d.ts +6 -9
- package/dest/prover/server/bb_prover.d.ts.map +1 -1
- package/dest/prover/server/bb_prover.js +414 -38
- package/dest/test/delay_values.js +2 -2
- package/dest/test/test_circuit_prover.d.ts +4 -4
- package/dest/test/test_circuit_prover.d.ts.map +1 -1
- package/dest/test/test_circuit_prover.js +462 -59
- package/dest/verification_key/verification_key_data.d.ts +1 -8
- package/dest/verification_key/verification_key_data.d.ts.map +1 -1
- package/dest/verification_key/verification_key_data.js +0 -19
- package/dest/verifier/bb_verifier.d.ts +1 -1
- package/dest/verifier/bb_verifier.d.ts.map +1 -1
- package/dest/verifier/bb_verifier.js +1 -4
- package/dest/verifier/queued_chonk_verifier.d.ts +1 -1
- package/dest/verifier/queued_chonk_verifier.d.ts.map +1 -1
- package/dest/verifier/queued_chonk_verifier.js +9 -40
- package/package.json +17 -17
- package/src/avm_proving_tests/avm_proving_tester.ts +6 -16
- package/src/bb/execute.ts +31 -59
- package/src/instrumentation.ts +20 -43
- package/src/prover/client/bb_private_kernel_prover.ts +20 -6
- package/src/prover/client/bundle.ts +3 -4
- package/src/prover/client/lazy.ts +3 -4
- package/src/prover/server/bb_prover.ts +22 -32
- package/src/test/delay_values.ts +2 -2
- package/src/test/test_circuit_prover.ts +10 -13
- package/src/verification_key/verification_key_data.ts +0 -25
- package/src/verifier/bb_verifier.ts +1 -5
- package/src/verifier/queued_chonk_verifier.ts +9 -40
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, RECURSIVE_PROOF_LENGTH } from '@aztec/constants';
|
|
2
2
|
import { type ServerProtocolArtifact } from '@aztec/noir-protocol-circuits-types/server';
|
|
3
3
|
import type { AvmCircuitInputs, AvmCircuitPublicInputs } from '@aztec/stdlib/avm';
|
|
4
|
-
import { type
|
|
4
|
+
import { type PublicInputsAndRecursiveProof, type ServerCircuitProver } from '@aztec/stdlib/interfaces/server';
|
|
5
5
|
import type { ParityBasePrivateInputs, ParityPublicInputs, ParityRootPrivateInputs } from '@aztec/stdlib/parity';
|
|
6
|
-
import { Proof } from '@aztec/stdlib/proofs';
|
|
6
|
+
import { Proof, RecursiveProof } from '@aztec/stdlib/proofs';
|
|
7
7
|
import { BlockMergeRollupPrivateInputs, BlockRollupPublicInputs, BlockRootEmptyTxFirstRollupPrivateInputs, BlockRootFirstRollupPrivateInputs, BlockRootRollupPrivateInputs, BlockRootSingleTxFirstRollupPrivateInputs, BlockRootSingleTxRollupPrivateInputs, CheckpointMergeRollupPrivateInputs, CheckpointPaddingRollupPrivateInputs, CheckpointRollupPublicInputs, CheckpointRootRollupPrivateInputs, CheckpointRootSingleBlockRollupPrivateInputs, type PrivateTxBaseRollupPrivateInputs, PublicChonkVerifierPrivateInputs, PublicChonkVerifierPublicInputs, PublicTxBaseRollupPrivateInputs, type RootRollupPrivateInputs, type RootRollupPublicInputs, type TxMergeRollupPrivateInputs, type TxRollupPublicInputs } from '@aztec/stdlib/rollup';
|
|
8
|
-
import type { VerificationKeyData } from '@aztec/stdlib/vks';
|
|
9
8
|
import { type TelemetryClient } from '@aztec/telemetry-client';
|
|
10
9
|
import type { ACVMConfig, BBConfig } from '../../config.js';
|
|
11
|
-
import { type UltraHonkFlavor } from '../../honk.js';
|
|
12
10
|
export interface BBProverConfig extends BBConfig, ACVMConfig {
|
|
13
11
|
circuitFilter?: ServerProtocolArtifact[];
|
|
14
12
|
}
|
|
@@ -38,7 +36,7 @@ export declare class BBNativeRollupProver implements ServerCircuitProver {
|
|
|
38
36
|
* @param inputs - The inputs to the AVM circuit.
|
|
39
37
|
* @returns The proof.
|
|
40
38
|
*/
|
|
41
|
-
getAvmProof(inputs: AvmCircuitInputs): Promise<
|
|
39
|
+
getAvmProof(inputs: AvmCircuitInputs): Promise<RecursiveProof<typeof AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED>>;
|
|
42
40
|
getPublicChonkVerifierProof(inputs: PublicChonkVerifierPrivateInputs): Promise<PublicInputsAndRecursiveProof<PublicChonkVerifierPublicInputs, typeof NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH>>;
|
|
43
41
|
/**
|
|
44
42
|
* Simulates the base rollup circuit from its inputs.
|
|
@@ -85,9 +83,8 @@ export declare class BBNativeRollupProver implements ServerCircuitProver {
|
|
|
85
83
|
* @param proof - The proof to be verified
|
|
86
84
|
*/
|
|
87
85
|
verifyProof(circuitType: ServerProtocolArtifact, proof: Proof): Promise<void>;
|
|
88
|
-
verifyAvmProof(proof: Proof,
|
|
89
|
-
|
|
90
|
-
private verifyWithKeyInternal;
|
|
86
|
+
verifyAvmProof(proof: Proof, publicInputs: AvmCircuitPublicInputs): Promise<void>;
|
|
87
|
+
private verifyInternal;
|
|
91
88
|
/**
|
|
92
89
|
* Returns the verification key data for a circuit.
|
|
93
90
|
* @param circuitType - The type of circuit for which the verification key is required
|
|
@@ -97,4 +94,4 @@ export declare class BBNativeRollupProver implements ServerCircuitProver {
|
|
|
97
94
|
private readAvmProofAsFields;
|
|
98
95
|
private runInDirectory;
|
|
99
96
|
}
|
|
100
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
97
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmJfcHJvdmVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcHJvdmVyL3NlcnZlci9iYl9wcm92ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUNMLG9DQUFvQyxFQUNwQyw2QkFBNkIsRUFDN0IseUNBQXlDLEVBRXpDLHNCQUFzQixFQUV2QixNQUFNLGtCQUFrQixDQUFDO0FBSzFCLE9BQU8sRUFDTCxLQUFLLHNCQUFzQixFQW9DNUIsTUFBTSw0Q0FBNEMsQ0FBQztBQUtwRCxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxzQkFBc0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBRWxGLE9BQU8sRUFDTCxLQUFLLDZCQUE2QixFQUNsQyxLQUFLLG1CQUFtQixFQUV6QixNQUFNLGlDQUFpQyxDQUFDO0FBQ3pDLE9BQU8sS0FBSyxFQUFFLHVCQUF1QixFQUFFLGtCQUFrQixFQUFFLHVCQUF1QixFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDakgsT0FBTyxFQUFFLEtBQUssRUFBRSxjQUFjLEVBQWdDLE1BQU0sc0JBQXNCLENBQUM7QUFDM0YsT0FBTyxFQUNMLDZCQUE2QixFQUM3Qix1QkFBdUIsRUFDdkIsd0NBQXdDLEVBQ3hDLGlDQUFpQyxFQUNqQyw0QkFBNEIsRUFDNUIse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CAAC,CActG;YAEa,6BAA6B;YA0B7B,mBAAmB;YAqEnB,sBAAsB;YAatB,cAAc;YA0Cd,oBAAoB;IAqDlC;;;;OAIG;IACU,WAAW,CAAC,WAAW,EAAE,sBAAsB,EAAE,KAAK,EAAE,KAAK,iBAKzE;IAEY,cAAc,CAAC,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,sBAAsB,iBAI7E;YACa,cAAc;IA6B5B;;;;OAIG;IACH,OAAO,CAAC,gCAAgC;YAQ1B,oBAAoB;IAuBlC,OAAO,CAAC,cAAc;CAYvB"}
|
|
@@ -1,9 +1,376 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function applyDecs2203RFactory() {
|
|
2
|
+
function createAddInitializerMethod(initializers, decoratorFinishedRef) {
|
|
3
|
+
return function addInitializer(initializer) {
|
|
4
|
+
assertNotFinished(decoratorFinishedRef, "addInitializer");
|
|
5
|
+
assertCallable(initializer, "An initializer");
|
|
6
|
+
initializers.push(initializer);
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
function memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value) {
|
|
10
|
+
var kindStr;
|
|
11
|
+
switch(kind){
|
|
12
|
+
case 1:
|
|
13
|
+
kindStr = "accessor";
|
|
14
|
+
break;
|
|
15
|
+
case 2:
|
|
16
|
+
kindStr = "method";
|
|
17
|
+
break;
|
|
18
|
+
case 3:
|
|
19
|
+
kindStr = "getter";
|
|
20
|
+
break;
|
|
21
|
+
case 4:
|
|
22
|
+
kindStr = "setter";
|
|
23
|
+
break;
|
|
24
|
+
default:
|
|
25
|
+
kindStr = "field";
|
|
26
|
+
}
|
|
27
|
+
var ctx = {
|
|
28
|
+
kind: kindStr,
|
|
29
|
+
name: isPrivate ? "#" + name : name,
|
|
30
|
+
static: isStatic,
|
|
31
|
+
private: isPrivate,
|
|
32
|
+
metadata: metadata
|
|
33
|
+
};
|
|
34
|
+
var decoratorFinishedRef = {
|
|
35
|
+
v: false
|
|
36
|
+
};
|
|
37
|
+
ctx.addInitializer = createAddInitializerMethod(initializers, decoratorFinishedRef);
|
|
38
|
+
var get, set;
|
|
39
|
+
if (kind === 0) {
|
|
40
|
+
if (isPrivate) {
|
|
41
|
+
get = desc.get;
|
|
42
|
+
set = desc.set;
|
|
43
|
+
} else {
|
|
44
|
+
get = function() {
|
|
45
|
+
return this[name];
|
|
46
|
+
};
|
|
47
|
+
set = function(v) {
|
|
48
|
+
this[name] = v;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
} else if (kind === 2) {
|
|
52
|
+
get = function() {
|
|
53
|
+
return desc.value;
|
|
54
|
+
};
|
|
55
|
+
} else {
|
|
56
|
+
if (kind === 1 || kind === 3) {
|
|
57
|
+
get = function() {
|
|
58
|
+
return desc.get.call(this);
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (kind === 1 || kind === 4) {
|
|
62
|
+
set = function(v) {
|
|
63
|
+
desc.set.call(this, v);
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
ctx.access = get && set ? {
|
|
68
|
+
get: get,
|
|
69
|
+
set: set
|
|
70
|
+
} : get ? {
|
|
71
|
+
get: get
|
|
72
|
+
} : {
|
|
73
|
+
set: set
|
|
74
|
+
};
|
|
75
|
+
try {
|
|
76
|
+
return dec(value, ctx);
|
|
77
|
+
} finally{
|
|
78
|
+
decoratorFinishedRef.v = true;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
function assertNotFinished(decoratorFinishedRef, fnName) {
|
|
82
|
+
if (decoratorFinishedRef.v) {
|
|
83
|
+
throw new Error("attempted to call " + fnName + " after decoration was finished");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function assertCallable(fn, hint) {
|
|
87
|
+
if (typeof fn !== "function") {
|
|
88
|
+
throw new TypeError(hint + " must be a function");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function assertValidReturnValue(kind, value) {
|
|
92
|
+
var type = typeof value;
|
|
93
|
+
if (kind === 1) {
|
|
94
|
+
if (type !== "object" || value === null) {
|
|
95
|
+
throw new TypeError("accessor decorators must return an object with get, set, or init properties or void 0");
|
|
96
|
+
}
|
|
97
|
+
if (value.get !== undefined) {
|
|
98
|
+
assertCallable(value.get, "accessor.get");
|
|
99
|
+
}
|
|
100
|
+
if (value.set !== undefined) {
|
|
101
|
+
assertCallable(value.set, "accessor.set");
|
|
102
|
+
}
|
|
103
|
+
if (value.init !== undefined) {
|
|
104
|
+
assertCallable(value.init, "accessor.init");
|
|
105
|
+
}
|
|
106
|
+
} else if (type !== "function") {
|
|
107
|
+
var hint;
|
|
108
|
+
if (kind === 0) {
|
|
109
|
+
hint = "field";
|
|
110
|
+
} else if (kind === 10) {
|
|
111
|
+
hint = "class";
|
|
112
|
+
} else {
|
|
113
|
+
hint = "method";
|
|
114
|
+
}
|
|
115
|
+
throw new TypeError(hint + " decorators must return a function or void 0");
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata) {
|
|
119
|
+
var decs = decInfo[0];
|
|
120
|
+
var desc, init, value;
|
|
121
|
+
if (isPrivate) {
|
|
122
|
+
if (kind === 0 || kind === 1) {
|
|
123
|
+
desc = {
|
|
124
|
+
get: decInfo[3],
|
|
125
|
+
set: decInfo[4]
|
|
126
|
+
};
|
|
127
|
+
} else if (kind === 3) {
|
|
128
|
+
desc = {
|
|
129
|
+
get: decInfo[3]
|
|
130
|
+
};
|
|
131
|
+
} else if (kind === 4) {
|
|
132
|
+
desc = {
|
|
133
|
+
set: decInfo[3]
|
|
134
|
+
};
|
|
135
|
+
} else {
|
|
136
|
+
desc = {
|
|
137
|
+
value: decInfo[3]
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
} else if (kind !== 0) {
|
|
141
|
+
desc = Object.getOwnPropertyDescriptor(base, name);
|
|
142
|
+
}
|
|
143
|
+
if (kind === 1) {
|
|
144
|
+
value = {
|
|
145
|
+
get: desc.get,
|
|
146
|
+
set: desc.set
|
|
147
|
+
};
|
|
148
|
+
} else if (kind === 2) {
|
|
149
|
+
value = desc.value;
|
|
150
|
+
} else if (kind === 3) {
|
|
151
|
+
value = desc.get;
|
|
152
|
+
} else if (kind === 4) {
|
|
153
|
+
value = desc.set;
|
|
154
|
+
}
|
|
155
|
+
var newValue, get, set;
|
|
156
|
+
if (typeof decs === "function") {
|
|
157
|
+
newValue = memberDec(decs, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
158
|
+
if (newValue !== void 0) {
|
|
159
|
+
assertValidReturnValue(kind, newValue);
|
|
160
|
+
if (kind === 0) {
|
|
161
|
+
init = newValue;
|
|
162
|
+
} else if (kind === 1) {
|
|
163
|
+
init = newValue.init;
|
|
164
|
+
get = newValue.get || value.get;
|
|
165
|
+
set = newValue.set || value.set;
|
|
166
|
+
value = {
|
|
167
|
+
get: get,
|
|
168
|
+
set: set
|
|
169
|
+
};
|
|
170
|
+
} else {
|
|
171
|
+
value = newValue;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
for(var i = decs.length - 1; i >= 0; i--){
|
|
176
|
+
var dec = decs[i];
|
|
177
|
+
newValue = memberDec(dec, name, desc, initializers, kind, isStatic, isPrivate, metadata, value);
|
|
178
|
+
if (newValue !== void 0) {
|
|
179
|
+
assertValidReturnValue(kind, newValue);
|
|
180
|
+
var newInit;
|
|
181
|
+
if (kind === 0) {
|
|
182
|
+
newInit = newValue;
|
|
183
|
+
} else if (kind === 1) {
|
|
184
|
+
newInit = newValue.init;
|
|
185
|
+
get = newValue.get || value.get;
|
|
186
|
+
set = newValue.set || value.set;
|
|
187
|
+
value = {
|
|
188
|
+
get: get,
|
|
189
|
+
set: set
|
|
190
|
+
};
|
|
191
|
+
} else {
|
|
192
|
+
value = newValue;
|
|
193
|
+
}
|
|
194
|
+
if (newInit !== void 0) {
|
|
195
|
+
if (init === void 0) {
|
|
196
|
+
init = newInit;
|
|
197
|
+
} else if (typeof init === "function") {
|
|
198
|
+
init = [
|
|
199
|
+
init,
|
|
200
|
+
newInit
|
|
201
|
+
];
|
|
202
|
+
} else {
|
|
203
|
+
init.push(newInit);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
if (kind === 0 || kind === 1) {
|
|
210
|
+
if (init === void 0) {
|
|
211
|
+
init = function(instance, init) {
|
|
212
|
+
return init;
|
|
213
|
+
};
|
|
214
|
+
} else if (typeof init !== "function") {
|
|
215
|
+
var ownInitializers = init;
|
|
216
|
+
init = function(instance, init) {
|
|
217
|
+
var value = init;
|
|
218
|
+
for(var i = 0; i < ownInitializers.length; i++){
|
|
219
|
+
value = ownInitializers[i].call(instance, value);
|
|
220
|
+
}
|
|
221
|
+
return value;
|
|
222
|
+
};
|
|
223
|
+
} else {
|
|
224
|
+
var originalInitializer = init;
|
|
225
|
+
init = function(instance, init) {
|
|
226
|
+
return originalInitializer.call(instance, init);
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
ret.push(init);
|
|
230
|
+
}
|
|
231
|
+
if (kind !== 0) {
|
|
232
|
+
if (kind === 1) {
|
|
233
|
+
desc.get = value.get;
|
|
234
|
+
desc.set = value.set;
|
|
235
|
+
} else if (kind === 2) {
|
|
236
|
+
desc.value = value;
|
|
237
|
+
} else if (kind === 3) {
|
|
238
|
+
desc.get = value;
|
|
239
|
+
} else if (kind === 4) {
|
|
240
|
+
desc.set = value;
|
|
241
|
+
}
|
|
242
|
+
if (isPrivate) {
|
|
243
|
+
if (kind === 1) {
|
|
244
|
+
ret.push(function(instance, args) {
|
|
245
|
+
return value.get.call(instance, args);
|
|
246
|
+
});
|
|
247
|
+
ret.push(function(instance, args) {
|
|
248
|
+
return value.set.call(instance, args);
|
|
249
|
+
});
|
|
250
|
+
} else if (kind === 2) {
|
|
251
|
+
ret.push(value);
|
|
252
|
+
} else {
|
|
253
|
+
ret.push(function(instance, args) {
|
|
254
|
+
return value.call(instance, args);
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
} else {
|
|
258
|
+
Object.defineProperty(base, name, desc);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
function applyMemberDecs(Class, decInfos, metadata) {
|
|
263
|
+
var ret = [];
|
|
264
|
+
var protoInitializers;
|
|
265
|
+
var staticInitializers;
|
|
266
|
+
var existingProtoNonFields = new Map();
|
|
267
|
+
var existingStaticNonFields = new Map();
|
|
268
|
+
for(var i = 0; i < decInfos.length; i++){
|
|
269
|
+
var decInfo = decInfos[i];
|
|
270
|
+
if (!Array.isArray(decInfo)) continue;
|
|
271
|
+
var kind = decInfo[1];
|
|
272
|
+
var name = decInfo[2];
|
|
273
|
+
var isPrivate = decInfo.length > 3;
|
|
274
|
+
var isStatic = kind >= 5;
|
|
275
|
+
var base;
|
|
276
|
+
var initializers;
|
|
277
|
+
if (isStatic) {
|
|
278
|
+
base = Class;
|
|
279
|
+
kind = kind - 5;
|
|
280
|
+
staticInitializers = staticInitializers || [];
|
|
281
|
+
initializers = staticInitializers;
|
|
282
|
+
} else {
|
|
283
|
+
base = Class.prototype;
|
|
284
|
+
protoInitializers = protoInitializers || [];
|
|
285
|
+
initializers = protoInitializers;
|
|
286
|
+
}
|
|
287
|
+
if (kind !== 0 && !isPrivate) {
|
|
288
|
+
var existingNonFields = isStatic ? existingStaticNonFields : existingProtoNonFields;
|
|
289
|
+
var existingKind = existingNonFields.get(name) || 0;
|
|
290
|
+
if (existingKind === true || existingKind === 3 && kind !== 4 || existingKind === 4 && kind !== 3) {
|
|
291
|
+
throw new Error("Attempted to decorate a public method/accessor that has the same name as a previously decorated public method/accessor. This is not currently supported by the decorators plugin. Property name was: " + name);
|
|
292
|
+
} else if (!existingKind && kind > 2) {
|
|
293
|
+
existingNonFields.set(name, kind);
|
|
294
|
+
} else {
|
|
295
|
+
existingNonFields.set(name, true);
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
applyMemberDec(ret, base, decInfo, name, kind, isStatic, isPrivate, initializers, metadata);
|
|
299
|
+
}
|
|
300
|
+
pushInitializers(ret, protoInitializers);
|
|
301
|
+
pushInitializers(ret, staticInitializers);
|
|
302
|
+
return ret;
|
|
303
|
+
}
|
|
304
|
+
function pushInitializers(ret, initializers) {
|
|
305
|
+
if (initializers) {
|
|
306
|
+
ret.push(function(instance) {
|
|
307
|
+
for(var i = 0; i < initializers.length; i++){
|
|
308
|
+
initializers[i].call(instance);
|
|
309
|
+
}
|
|
310
|
+
return instance;
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
function applyClassDecs(targetClass, classDecs, metadata) {
|
|
315
|
+
if (classDecs.length > 0) {
|
|
316
|
+
var initializers = [];
|
|
317
|
+
var newClass = targetClass;
|
|
318
|
+
var name = targetClass.name;
|
|
319
|
+
for(var i = classDecs.length - 1; i >= 0; i--){
|
|
320
|
+
var decoratorFinishedRef = {
|
|
321
|
+
v: false
|
|
322
|
+
};
|
|
323
|
+
try {
|
|
324
|
+
var nextNewClass = classDecs[i](newClass, {
|
|
325
|
+
kind: "class",
|
|
326
|
+
name: name,
|
|
327
|
+
addInitializer: createAddInitializerMethod(initializers, decoratorFinishedRef),
|
|
328
|
+
metadata
|
|
329
|
+
});
|
|
330
|
+
} finally{
|
|
331
|
+
decoratorFinishedRef.v = true;
|
|
332
|
+
}
|
|
333
|
+
if (nextNewClass !== undefined) {
|
|
334
|
+
assertValidReturnValue(10, nextNewClass);
|
|
335
|
+
newClass = nextNewClass;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return [
|
|
339
|
+
defineMetadata(newClass, metadata),
|
|
340
|
+
function() {
|
|
341
|
+
for(var i = 0; i < initializers.length; i++){
|
|
342
|
+
initializers[i].call(newClass);
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
];
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
function defineMetadata(Class, metadata) {
|
|
349
|
+
return Object.defineProperty(Class, Symbol.metadata || Symbol.for("Symbol.metadata"), {
|
|
350
|
+
configurable: true,
|
|
351
|
+
enumerable: true,
|
|
352
|
+
value: metadata
|
|
353
|
+
});
|
|
354
|
+
}
|
|
355
|
+
return function applyDecs2203R(targetClass, memberDecs, classDecs, parentClass) {
|
|
356
|
+
if (parentClass !== void 0) {
|
|
357
|
+
var parentMetadata = parentClass[Symbol.metadata || Symbol.for("Symbol.metadata")];
|
|
358
|
+
}
|
|
359
|
+
var metadata = Object.create(parentMetadata === void 0 ? null : parentMetadata);
|
|
360
|
+
var e = applyMemberDecs(targetClass, memberDecs, metadata);
|
|
361
|
+
if (!classDecs.length) defineMetadata(targetClass, metadata);
|
|
362
|
+
return {
|
|
363
|
+
e: e,
|
|
364
|
+
get c () {
|
|
365
|
+
return applyClassDecs(targetClass, classDecs, metadata);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
|
|
371
|
+
return (_apply_decs_2203_r = applyDecs2203RFactory())(targetClass, memberDecs, classDecs, parentClass);
|
|
6
372
|
}
|
|
373
|
+
var _dec, _dec1, _dec2, _initProto;
|
|
7
374
|
import { AVM_V2_PROOF_LENGTH_IN_FIELDS_PADDED, NESTED_RECURSIVE_PROOF_LENGTH, NESTED_RECURSIVE_ROLLUP_HONK_PROOF_LENGTH, PAIRING_POINTS_SIZE, RECURSIVE_PROOF_LENGTH, ULTRA_KECCAK_PROOF_LENGTH } from '@aztec/constants';
|
|
8
375
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
9
376
|
import { runInDirectory } from '@aztec/foundation/fs';
|
|
@@ -14,7 +381,7 @@ import { ServerCircuitVks } from '@aztec/noir-protocol-circuits-types/server/vks
|
|
|
14
381
|
import { mapProtocolArtifactNameToCircuitName } from '@aztec/noir-protocol-circuits-types/types';
|
|
15
382
|
import { NativeACVMSimulator } from '@aztec/simulator/server';
|
|
16
383
|
import { ProvingError } from '@aztec/stdlib/errors';
|
|
17
|
-
import {
|
|
384
|
+
import { makePublicInputsAndRecursiveProof } from '@aztec/stdlib/interfaces/server';
|
|
18
385
|
import { Proof, RecursiveProof, makeRecursiveProofFromBinary } from '@aztec/stdlib/proofs';
|
|
19
386
|
import { Attributes, getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
|
|
20
387
|
import { promises as fs } from 'fs';
|
|
@@ -22,16 +389,42 @@ import * as path from 'path';
|
|
|
22
389
|
import { BB_RESULT, PROOF_FILENAME, PUBLIC_INPUTS_FILENAME, VK_FILENAME, generateAvmProof, generateProof, verifyAvmProof, verifyProof } from '../../bb/execute.js';
|
|
23
390
|
import { getUltraHonkFlavorForCircuit } from '../../honk.js';
|
|
24
391
|
import { ProverInstrumentation } from '../../instrumentation.js';
|
|
25
|
-
import { extractAvmVkData } from '../../verification_key/verification_key_data.js';
|
|
26
392
|
import { readProofsFromOutputDirectory } from '../proof_utils.js';
|
|
27
393
|
const logger = createLogger('bb-prover');
|
|
394
|
+
_dec = trackSpan('BBNativeRollupProver.getBaseParityProof', {
|
|
395
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'parity-base'
|
|
396
|
+
}), _dec1 = trackSpan('BBNativeRollupProver.getRootParityProof', {
|
|
397
|
+
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'parity-root'
|
|
398
|
+
}), _dec2 = trackSpan('BBNativeRollupProver.getAvmProof', (inputs)=>({
|
|
399
|
+
[Attributes.APP_CIRCUIT_NAME]: inputs.hints.tx.hash
|
|
400
|
+
}));
|
|
28
401
|
/**
|
|
29
402
|
* Prover implementation that uses barretenberg native proving
|
|
30
403
|
*/ export class BBNativeRollupProver {
|
|
31
404
|
config;
|
|
405
|
+
static{
|
|
406
|
+
({ e: [_initProto] } = _apply_decs_2203_r(this, [
|
|
407
|
+
[
|
|
408
|
+
_dec,
|
|
409
|
+
2,
|
|
410
|
+
"getBaseParityProof"
|
|
411
|
+
],
|
|
412
|
+
[
|
|
413
|
+
_dec1,
|
|
414
|
+
2,
|
|
415
|
+
"getRootParityProof"
|
|
416
|
+
],
|
|
417
|
+
[
|
|
418
|
+
_dec2,
|
|
419
|
+
2,
|
|
420
|
+
"getAvmProof"
|
|
421
|
+
]
|
|
422
|
+
], []));
|
|
423
|
+
}
|
|
32
424
|
instrumentation;
|
|
33
425
|
constructor(config, telemetry){
|
|
34
426
|
this.config = config;
|
|
427
|
+
_initProto(this);
|
|
35
428
|
this.instrumentation = new ProverInstrumentation(telemetry, 'BBNativeRollupProver');
|
|
36
429
|
}
|
|
37
430
|
get tracer() {
|
|
@@ -69,9 +462,9 @@ const logger = createLogger('bb-prover');
|
|
|
69
462
|
* @param inputs - The inputs to the AVM circuit.
|
|
70
463
|
* @returns The proof.
|
|
71
464
|
*/ async getAvmProof(inputs) {
|
|
72
|
-
const
|
|
73
|
-
await this.verifyAvmProof(
|
|
74
|
-
return
|
|
465
|
+
const proof = await this.createAvmProof(inputs);
|
|
466
|
+
await this.verifyAvmProof(proof.binaryProof, inputs.publicInputs);
|
|
467
|
+
return proof;
|
|
75
468
|
}
|
|
76
469
|
async getPublicChonkVerifierProof(inputs) {
|
|
77
470
|
const artifactName = 'PublicChonkVerifier';
|
|
@@ -156,7 +549,7 @@ const logger = createLogger('bb-prover');
|
|
|
156
549
|
const outputWitnessFile = path.join(workingDirectory, 'partial-witness.gz');
|
|
157
550
|
// Generate the partial witness using the ACVM
|
|
158
551
|
// A further temp directory will be created beneath ours and then cleaned up after the partial witness has been copied to our specified location
|
|
159
|
-
const simulator = new NativeACVMSimulator(this.config.acvmWorkingDirectory, this.config.acvmBinaryPath, outputWitnessFile);
|
|
552
|
+
const simulator = new NativeACVMSimulator(this.config.acvmWorkingDirectory, this.config.acvmBinaryPath, outputWitnessFile, logger);
|
|
160
553
|
const artifact = getServerCircuitArtifact(circuitType);
|
|
161
554
|
logger.debug(`Generating witness data for ${circuitType}`);
|
|
162
555
|
const inputWitness = convertInput(input);
|
|
@@ -198,7 +591,6 @@ const logger = createLogger('bb-prover');
|
|
|
198
591
|
async createAvmProof(input) {
|
|
199
592
|
const operation = async (bbWorkingDirectory)=>{
|
|
200
593
|
const provingResult = await this.generateAvmProofWithBB(input, bbWorkingDirectory);
|
|
201
|
-
const avmVK = await extractAvmVkData(provingResult.vkDirectoryPath);
|
|
202
594
|
const avmProof = await this.readAvmProofAsFields(provingResult.proofPath);
|
|
203
595
|
const circuitType = 'avm-circuit';
|
|
204
596
|
const appCircuitName = 'unknown';
|
|
@@ -215,7 +607,7 @@ const logger = createLogger('bb-prover');
|
|
|
215
607
|
circuitSize: 1 << 21,
|
|
216
608
|
numPublicInputs: 0
|
|
217
609
|
});
|
|
218
|
-
return
|
|
610
|
+
return avmProof;
|
|
219
611
|
};
|
|
220
612
|
return await this.runInDirectory(operation);
|
|
221
613
|
}
|
|
@@ -261,23 +653,22 @@ const logger = createLogger('bb-prover');
|
|
|
261
653
|
* @param proof - The proof to be verified
|
|
262
654
|
*/ async verifyProof(circuitType, proof) {
|
|
263
655
|
const verificationKey = this.getVerificationKeyDataForCircuit(circuitType);
|
|
264
|
-
return await this.
|
|
265
|
-
}
|
|
266
|
-
async verifyAvmProof(proof, verificationKey, publicInputs) {
|
|
267
|
-
return await this.verifyWithKeyInternal(proof, verificationKey, (proofPath, vkPath)=>verifyAvmProof(this.config.bbBinaryPath, this.config.bbWorkingDirectory, proofPath, publicInputs, vkPath, logger));
|
|
656
|
+
return await this.verifyInternal(proof, verificationKey, (proofPath, vkPath)=>verifyProof(this.config.bbBinaryPath, proofPath, vkPath, getUltraHonkFlavorForCircuit(circuitType), logger));
|
|
268
657
|
}
|
|
269
|
-
async
|
|
270
|
-
return await this.
|
|
658
|
+
async verifyAvmProof(proof, publicInputs) {
|
|
659
|
+
return await this.verifyInternal(proof, /*verificationKey=*/ undefined, (proofPath, /*unused*/ _vkPath)=>verifyAvmProof(this.config.bbBinaryPath, this.config.bbWorkingDirectory, proofPath, publicInputs, logger));
|
|
271
660
|
}
|
|
272
|
-
async
|
|
661
|
+
async verifyInternal(proof, verificationKey, verificationFunction) {
|
|
273
662
|
const operation = async (bbWorkingDirectory)=>{
|
|
274
663
|
const publicInputsFileName = path.join(bbWorkingDirectory, PUBLIC_INPUTS_FILENAME);
|
|
275
664
|
const proofFileName = path.join(bbWorkingDirectory, PROOF_FILENAME);
|
|
276
665
|
const verificationKeyPath = path.join(bbWorkingDirectory, VK_FILENAME);
|
|
277
666
|
// TODO(https://github.com/AztecProtocol/aztec-packages/issues/13189): Put this proof parsing logic in the proof class.
|
|
278
|
-
await fs.writeFile(publicInputsFileName, proof.buffer.
|
|
279
|
-
await fs.writeFile(proofFileName, proof.buffer.
|
|
280
|
-
|
|
667
|
+
await fs.writeFile(publicInputsFileName, proof.buffer.subarray(0, proof.numPublicInputs * 32));
|
|
668
|
+
await fs.writeFile(proofFileName, proof.buffer.subarray(proof.numPublicInputs * 32));
|
|
669
|
+
if (verificationKey !== undefined) {
|
|
670
|
+
await fs.writeFile(verificationKeyPath, verificationKey.keyAsBytes);
|
|
671
|
+
}
|
|
281
672
|
const result = await verificationFunction(proofFileName, verificationKeyPath);
|
|
282
673
|
if (result.status === BB_RESULT.FAILURE) {
|
|
283
674
|
const errorMessage = `Failed to verify proof from key!`;
|
|
@@ -319,18 +710,3 @@ const logger = createLogger('bb-prover');
|
|
|
319
710
|
}), this.config.bbSkipCleanup, logger);
|
|
320
711
|
}
|
|
321
712
|
}
|
|
322
|
-
_ts_decorate([
|
|
323
|
-
trackSpan('BBNativeRollupProver.getBaseParityProof', {
|
|
324
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'parity-base'
|
|
325
|
-
})
|
|
326
|
-
], BBNativeRollupProver.prototype, "getBaseParityProof", null);
|
|
327
|
-
_ts_decorate([
|
|
328
|
-
trackSpan('BBNativeRollupProver.getRootParityProof', {
|
|
329
|
-
[Attributes.PROTOCOL_CIRCUIT_NAME]: 'parity-root'
|
|
330
|
-
})
|
|
331
|
-
], BBNativeRollupProver.prototype, "getRootParityProof", null);
|
|
332
|
-
_ts_decorate([
|
|
333
|
-
trackSpan('BBNativeRollupProver.getAvmProof', (inputs)=>({
|
|
334
|
-
[Attributes.APP_CIRCUIT_NAME]: inputs.hints.tx.hash
|
|
335
|
-
}))
|
|
336
|
-
], BBNativeRollupProver.prototype, "getAvmProof", null);
|
|
@@ -32,12 +32,12 @@ export const PROOF_DELAY_MS = {
|
|
|
32
32
|
[ProvingRequestType.ROOT_ROLLUP]: 93_000,
|
|
33
33
|
[ProvingRequestType.TX_MERGE_ROLLUP]: 10_000,
|
|
34
34
|
[ProvingRequestType.PUBLIC_TX_BASE_ROLLUP]: 44_500,
|
|
35
|
-
[ProvingRequestType.PUBLIC_VM]:
|
|
35
|
+
[ProvingRequestType.PUBLIC_VM]: 180_000,
|
|
36
36
|
// TBD
|
|
37
37
|
[ProvingRequestType.BLOCK_MERGE_ROLLUP]: 15_000,
|
|
38
38
|
[ProvingRequestType.BLOCK_ROOT_ROLLUP]: 35_000,
|
|
39
39
|
[ProvingRequestType.BLOCK_ROOT_SINGLE_TX_ROLLUP]: 15_000,
|
|
40
40
|
[ProvingRequestType.CHECKPOINT_ROOT_ROLLUP]: 35_000,
|
|
41
41
|
[ProvingRequestType.CHECKPOINT_PADDING_ROLLUP]: 0,
|
|
42
|
-
[ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]:
|
|
42
|
+
[ProvingRequestType.PRIVATE_TX_BASE_ROLLUP]: 22_000
|
|
43
43
|
};
|