@aztec/pxe 3.0.0-devnet.2 → 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/contract_function_simulator/contract_function_simulator.d.ts +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +4 -4
- package/dest/contract_function_simulator/pxe_oracle_interface.js +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -3
- package/dest/private_kernel/private_kernel_execution_prover.js +15 -15
- package/dest/pxe.js +4 -4
- package/package.json +16 -16
- package/src/contract_function_simulator/contract_function_simulator.ts +4 -4
- package/src/contract_function_simulator/pxe_oracle_interface.ts +1 -1
- package/src/private_kernel/private_kernel_execution_prover.ts +15 -15
- package/src/pxe.ts +4 -4
|
@@ -41,7 +41,7 @@ export declare class ContractFunctionSimulator {
|
|
|
41
41
|
getStats(): import("./execution_data_provider.js").ExecutionStats;
|
|
42
42
|
}
|
|
43
43
|
/**
|
|
44
|
-
* Generates the final public inputs of the tail kernel circuit, an empty
|
|
44
|
+
* Generates the final public inputs of the tail kernel circuit, an empty Chonk proof
|
|
45
45
|
* and the execution steps for a `PrivateExecutionResult` as if it had been
|
|
46
46
|
* processed by the private kernel prover. This skips many of the checks performed by the kernels
|
|
47
47
|
* (allowing state overrides) and is much faster, while still generating a valid
|
|
@@ -14,7 +14,7 @@ import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash, siloNullifie
|
|
|
14
14
|
import { PartialPrivateTailPublicInputsForPublic, PartialPrivateTailPublicInputsForRollup, PrivateKernelTailCircuitPublicInputs, PrivateToPublicAccumulatedData, PrivateToRollupAccumulatedData, PublicCallRequest, ScopedLogHash } from '@aztec/stdlib/kernel';
|
|
15
15
|
import { PrivateLog } from '@aztec/stdlib/logs';
|
|
16
16
|
import { ScopedL2ToL1Message } from '@aztec/stdlib/messaging';
|
|
17
|
-
import {
|
|
17
|
+
import { ChonkProof } from '@aztec/stdlib/proofs';
|
|
18
18
|
import { CallContext, HashedValues, PrivateExecutionResult, TxConstantData, collectNested, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
|
|
19
19
|
import { ExecutionNoteCache } from './execution_note_cache.js';
|
|
20
20
|
import { ExecutionTaggingIndexCache } from './execution_tagging_index_cache.js';
|
|
@@ -146,7 +146,7 @@ class OrderedSideEffect {
|
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
* Generates the final public inputs of the tail kernel circuit, an empty
|
|
149
|
+
* Generates the final public inputs of the tail kernel circuit, an empty Chonk proof
|
|
150
150
|
* and the execution steps for a `PrivateExecutionResult` as if it had been
|
|
151
151
|
* processed by the private kernel prover. This skips many of the checks performed by the kernels
|
|
152
152
|
* (allowing state overrides) and is much faster, while still generating a valid
|
|
@@ -249,8 +249,8 @@ class OrderedSideEffect {
|
|
|
249
249
|
})), /*feePayer=*/ AztecAddress.zero(), /*includeByTimestamp=*/ 0n, hasPublicCalls ? inputsForPublic : undefined, !hasPublicCalls ? inputsForRollup : undefined);
|
|
250
250
|
return {
|
|
251
251
|
publicInputs,
|
|
252
|
-
|
|
253
|
-
executionSteps
|
|
252
|
+
chonkProof: ChonkProof.empty(),
|
|
253
|
+
executionSteps
|
|
254
254
|
};
|
|
255
255
|
}
|
|
256
256
|
function splitOrderedSideEffects(effects, minRevertibleSideEffectCounter) {
|
|
@@ -48,7 +48,7 @@ import { NoteValidationRequest } from './noir-structs/note_validation_request.js
|
|
|
48
48
|
const completeAddress = await this.addressDataProvider.getCompleteAddress(account);
|
|
49
49
|
if (!completeAddress) {
|
|
50
50
|
throw new Error(`No public key registered for address ${account}.
|
|
51
|
-
Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/
|
|
51
|
+
Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#simulation-error-no-public-key-registered-for-address-0x0-register-it-by-calling-pxeregisterrecipient-or-pxeregisteraccount`);
|
|
52
52
|
}
|
|
53
53
|
return completeAddress;
|
|
54
54
|
}
|
|
@@ -10,7 +10,7 @@ export interface PrivateKernelExecutionProverConfig {
|
|
|
10
10
|
/**
|
|
11
11
|
* The PrivateKernelExecutionProver class is responsible for taking a transaction request and sequencing the
|
|
12
12
|
* the execution of the private functions within, sequenced with private kernel "glue" to check protocol rules.
|
|
13
|
-
* The result can be a
|
|
13
|
+
* The result can be a chonk proof of the private transaction portion, or just a simulation that can e.g.
|
|
14
14
|
* inform state tree updates.
|
|
15
15
|
*/
|
|
16
16
|
export declare class PrivateKernelExecutionProver {
|
|
@@ -32,9 +32,9 @@ export declare class PrivateKernelExecutionProver {
|
|
|
32
32
|
*/
|
|
33
33
|
proveWithKernels(txRequest: TxRequest, executionResult: PrivateExecutionResult, { simulate, skipFeeEnforcement, profileMode }?: PrivateKernelExecutionProverConfig): Promise<PrivateKernelExecutionProofOutput<PrivateKernelTailCircuitPublicInputs>>;
|
|
34
34
|
/**
|
|
35
|
-
* Checks that the public inputs of the
|
|
35
|
+
* Checks that the public inputs of the chonk proof match the public inputs of the tail circuit.
|
|
36
36
|
* This can only mismatch if there is a circuit / noir / bb bug.
|
|
37
|
-
* @param
|
|
37
|
+
* @param chonkProof - The chonk proof with public inputs.
|
|
38
38
|
* @param tailPublicInputs - The public inputs resulting from witness generation of the tail circuit.
|
|
39
39
|
*/
|
|
40
40
|
private ensurePublicInputsMatch;
|
|
@@ -7,7 +7,7 @@ import { getVKTreeRoot } from '@aztec/noir-protocol-circuits-types/vk-tree';
|
|
|
7
7
|
import { ProtocolContractsList } from '@aztec/protocol-contracts';
|
|
8
8
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
9
9
|
import { HidingKernelToPublicPrivateInputs, HidingKernelToRollupPrivateInputs, PaddedSideEffectAmounts, PrivateCallData, PrivateKernelCircuitPublicInputs, PrivateKernelData, PrivateKernelInitCircuitPrivateInputs, PrivateKernelInnerCircuitPrivateInputs, PrivateKernelTailCircuitPrivateInputs, PrivateVerificationKeyHints } from '@aztec/stdlib/kernel';
|
|
10
|
-
import {
|
|
10
|
+
import { ChonkProof } from '@aztec/stdlib/proofs';
|
|
11
11
|
import { collectNoteHashLeafIndexMap, collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
|
|
12
12
|
import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
|
|
13
13
|
import { PrivateKernelResetPrivateInputsBuilder } from './hints/build_private_kernel_reset_private_inputs.js';
|
|
@@ -20,7 +20,7 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
20
20
|
/**
|
|
21
21
|
* The PrivateKernelExecutionProver class is responsible for taking a transaction request and sequencing the
|
|
22
22
|
* the execution of the private functions within, sequenced with private kernel "glue" to check protocol rules.
|
|
23
|
-
* The result can be a
|
|
23
|
+
* The result can be a chonk proof of the private transaction portion, or just a simulation that can e.g.
|
|
24
24
|
* inform state tree updates.
|
|
25
25
|
*/ export class PrivateKernelExecutionProver {
|
|
26
26
|
oracle;
|
|
@@ -221,40 +221,40 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
221
221
|
if (generateWitnesses) {
|
|
222
222
|
this.log.info(`Private kernel witness generation took ${timer.ms()}ms`);
|
|
223
223
|
}
|
|
224
|
-
let
|
|
224
|
+
let chonkProof;
|
|
225
225
|
// TODO(#7368) how do we 'bincode' encode these inputs?
|
|
226
226
|
let provingTime;
|
|
227
227
|
if (!skipProofGeneration) {
|
|
228
228
|
const provingTimer = new Timer();
|
|
229
|
-
const proofWithPublicInputs = await this.proofCreator.
|
|
229
|
+
const proofWithPublicInputs = await this.proofCreator.createChonkProof(executionSteps);
|
|
230
230
|
provingTime = provingTimer.ms();
|
|
231
231
|
this.ensurePublicInputsMatch(proofWithPublicInputs, tailOutput.publicInputs);
|
|
232
|
-
|
|
232
|
+
chonkProof = proofWithPublicInputs.removePublicInputs();
|
|
233
233
|
} else {
|
|
234
|
-
|
|
234
|
+
chonkProof = ChonkProof.random();
|
|
235
235
|
}
|
|
236
236
|
return {
|
|
237
237
|
publicInputs: tailOutput.publicInputs,
|
|
238
238
|
executionSteps,
|
|
239
|
-
|
|
239
|
+
chonkProof,
|
|
240
240
|
timings: provingTime ? {
|
|
241
241
|
proving: provingTime
|
|
242
242
|
} : undefined
|
|
243
243
|
};
|
|
244
244
|
}
|
|
245
245
|
/**
|
|
246
|
-
* Checks that the public inputs of the
|
|
246
|
+
* Checks that the public inputs of the chonk proof match the public inputs of the tail circuit.
|
|
247
247
|
* This can only mismatch if there is a circuit / noir / bb bug.
|
|
248
|
-
* @param
|
|
248
|
+
* @param chonkProof - The chonk proof with public inputs.
|
|
249
249
|
* @param tailPublicInputs - The public inputs resulting from witness generation of the tail circuit.
|
|
250
|
-
*/ ensurePublicInputsMatch(
|
|
251
|
-
const
|
|
250
|
+
*/ ensurePublicInputsMatch(chonkProof, tailPublicInputs) {
|
|
251
|
+
const serializedChonkProofPublicInputs = chonkProof.getPublicInputs();
|
|
252
252
|
const serializedTailPublicInputs = tailPublicInputs.publicInputs().toFields();
|
|
253
|
-
if (
|
|
254
|
-
throw new Error(`Public inputs length mismatch: ${
|
|
253
|
+
if (serializedChonkProofPublicInputs.length !== serializedTailPublicInputs.length) {
|
|
254
|
+
throw new Error(`Public inputs length mismatch: ${serializedChonkProofPublicInputs.length} !== ${serializedTailPublicInputs.length}`);
|
|
255
255
|
}
|
|
256
|
-
if (!
|
|
257
|
-
throw new Error(`Public inputs mismatch between kernel and
|
|
256
|
+
if (!serializedChonkProofPublicInputs.every((input, index)=>input.equals(serializedTailPublicInputs[index]))) {
|
|
257
|
+
throw new Error(`Public inputs mismatch between kernel and chonk proof`);
|
|
258
258
|
}
|
|
259
259
|
}
|
|
260
260
|
async getVkData(verificationKey) {
|
package/dest/pxe.js
CHANGED
|
@@ -146,7 +146,7 @@ import { Synchronizer } from './synchronizer/index.js';
|
|
|
146
146
|
async #getFunctionCall(functionName, args, to) {
|
|
147
147
|
const contract = await this.contractDataProvider.getContract(to);
|
|
148
148
|
if (!contract) {
|
|
149
|
-
throw new Error(`Unknown contract ${to}: add it to PXE by calling server.addContracts(...).\nSee docs for context: https://docs.aztec.network/developers/
|
|
149
|
+
throw new Error(`Unknown contract ${to}: add it to PXE by calling server.addContracts(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#unknown-contract-0x0-add-it-to-pxe-by-calling-serveraddcontracts`);
|
|
150
150
|
}
|
|
151
151
|
const functionDao = contract.functions.find((f)=>f.name === functionName);
|
|
152
152
|
if (!functionDao) {
|
|
@@ -232,7 +232,7 @@ import { Synchronizer } from './synchronizer/index.js';
|
|
|
232
232
|
* @param proofCreator - The proof creator to use for proving the execution.
|
|
233
233
|
* @param privateExecutionResult - The result of the private execution
|
|
234
234
|
* @param config - The configuration for the kernel execution prover.
|
|
235
|
-
* @returns An object that contains the output of the kernel execution, including the
|
|
235
|
+
* @returns An object that contains the output of the kernel execution, including the ChonkProof if proving is enabled.
|
|
236
236
|
*/ async #prove(txExecutionRequest, proofCreator, privateExecutionResult, config) {
|
|
237
237
|
const simulationAnchorBlock = privateExecutionResult.getSimulationAnchorBlockNumber();
|
|
238
238
|
const kernelOracle = new PrivateKernelOracleImpl(this.contractDataProvider, this.keyStore, this.node, simulationAnchorBlock);
|
|
@@ -488,7 +488,7 @@ import { Synchronizer } from './synchronizer/index.js';
|
|
|
488
488
|
const syncTime = syncTimer.ms();
|
|
489
489
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
490
490
|
privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest);
|
|
491
|
-
const { publicInputs,
|
|
491
|
+
const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
492
492
|
simulate: false,
|
|
493
493
|
skipFeeEnforcement: false,
|
|
494
494
|
profileMode: 'none'
|
|
@@ -509,7 +509,7 @@ import { Synchronizer } from './synchronizer/index.js';
|
|
|
509
509
|
this.log.debug(`Proving completed in ${totalTime}ms`, {
|
|
510
510
|
timings
|
|
511
511
|
});
|
|
512
|
-
const txProvingResult = new TxProvingResult(privateExecutionResult, publicInputs,
|
|
512
|
+
const txProvingResult = new TxProvingResult(privateExecutionResult, publicInputs, chonkProof, {
|
|
513
513
|
timings,
|
|
514
514
|
nodeRPCCalls: contractFunctionSimulator?.getStats().nodeRPCCalls
|
|
515
515
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "3.0.0-
|
|
3
|
+
"version": "3.0.0-manual.20251030",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/entrypoints/server/index.js",
|
|
@@ -61,19 +61,19 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aztec/bb-prover": "3.0.0-
|
|
65
|
-
"@aztec/bb.js": "3.0.0-
|
|
66
|
-
"@aztec/builder": "3.0.0-
|
|
67
|
-
"@aztec/constants": "3.0.0-
|
|
68
|
-
"@aztec/ethereum": "3.0.0-
|
|
69
|
-
"@aztec/foundation": "3.0.0-
|
|
70
|
-
"@aztec/key-store": "3.0.0-
|
|
71
|
-
"@aztec/kv-store": "3.0.0-
|
|
72
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-
|
|
73
|
-
"@aztec/noir-types": "3.0.0-
|
|
74
|
-
"@aztec/protocol-contracts": "3.0.0-
|
|
75
|
-
"@aztec/simulator": "3.0.0-
|
|
76
|
-
"@aztec/stdlib": "3.0.0-
|
|
64
|
+
"@aztec/bb-prover": "3.0.0-manual.20251030",
|
|
65
|
+
"@aztec/bb.js": "3.0.0-manual.20251030",
|
|
66
|
+
"@aztec/builder": "3.0.0-manual.20251030",
|
|
67
|
+
"@aztec/constants": "3.0.0-manual.20251030",
|
|
68
|
+
"@aztec/ethereum": "3.0.0-manual.20251030",
|
|
69
|
+
"@aztec/foundation": "3.0.0-manual.20251030",
|
|
70
|
+
"@aztec/key-store": "3.0.0-manual.20251030",
|
|
71
|
+
"@aztec/kv-store": "3.0.0-manual.20251030",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-manual.20251030",
|
|
73
|
+
"@aztec/noir-types": "3.0.0-manual.20251030",
|
|
74
|
+
"@aztec/protocol-contracts": "3.0.0-manual.20251030",
|
|
75
|
+
"@aztec/simulator": "3.0.0-manual.20251030",
|
|
76
|
+
"@aztec/stdlib": "3.0.0-manual.20251030",
|
|
77
77
|
"koa": "^2.16.1",
|
|
78
78
|
"koa-router": "^13.1.1",
|
|
79
79
|
"lodash.omit": "^4.5.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"viem": "npm:@spalladino/viem@2.38.2-eip7594.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@aztec/merkle-tree": "3.0.0-
|
|
86
|
-
"@aztec/noir-test-contracts.js": "3.0.0-
|
|
85
|
+
"@aztec/merkle-tree": "3.0.0-manual.20251030",
|
|
86
|
+
"@aztec/noir-test-contracts.js": "3.0.0-manual.20251030",
|
|
87
87
|
"@jest/globals": "^30.0.0",
|
|
88
88
|
"@types/jest": "^30.0.0",
|
|
89
89
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
} from '@aztec/stdlib/kernel';
|
|
52
52
|
import { PrivateLog } from '@aztec/stdlib/logs';
|
|
53
53
|
import { ScopedL2ToL1Message } from '@aztec/stdlib/messaging';
|
|
54
|
-
import {
|
|
54
|
+
import { ChonkProof } from '@aztec/stdlib/proofs';
|
|
55
55
|
import {
|
|
56
56
|
CallContext,
|
|
57
57
|
HashedValues,
|
|
@@ -269,7 +269,7 @@ class OrderedSideEffect<T> {
|
|
|
269
269
|
}
|
|
270
270
|
|
|
271
271
|
/**
|
|
272
|
-
* Generates the final public inputs of the tail kernel circuit, an empty
|
|
272
|
+
* Generates the final public inputs of the tail kernel circuit, an empty Chonk proof
|
|
273
273
|
* and the execution steps for a `PrivateExecutionResult` as if it had been
|
|
274
274
|
* processed by the private kernel prover. This skips many of the checks performed by the kernels
|
|
275
275
|
* (allowing state overrides) and is much faster, while still generating a valid
|
|
@@ -489,8 +489,8 @@ export async function generateSimulatedProvingResult(
|
|
|
489
489
|
|
|
490
490
|
return {
|
|
491
491
|
publicInputs,
|
|
492
|
-
|
|
493
|
-
executionSteps
|
|
492
|
+
chonkProof: ChonkProof.empty(),
|
|
493
|
+
executionSteps,
|
|
494
494
|
};
|
|
495
495
|
}
|
|
496
496
|
|
|
@@ -81,7 +81,7 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
81
81
|
if (!completeAddress) {
|
|
82
82
|
throw new Error(
|
|
83
83
|
`No public key registered for address ${account}.
|
|
84
|
-
Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/
|
|
84
|
+
Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#simulation-error-no-public-key-registered-for-address-0x0-register-it-by-calling-pxeregisterrecipient-or-pxeregisteraccount`,
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
87
|
return completeAddress;
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
type PrivateKernelTailCircuitPublicInputs,
|
|
24
24
|
PrivateVerificationKeyHints,
|
|
25
25
|
} from '@aztec/stdlib/kernel';
|
|
26
|
-
import {
|
|
26
|
+
import { ChonkProof, ChonkProofWithPublicInputs } from '@aztec/stdlib/proofs';
|
|
27
27
|
import {
|
|
28
28
|
type PrivateCallExecutionResult,
|
|
29
29
|
type PrivateExecutionResult,
|
|
@@ -53,7 +53,7 @@ export interface PrivateKernelExecutionProverConfig {
|
|
|
53
53
|
/**
|
|
54
54
|
* The PrivateKernelExecutionProver class is responsible for taking a transaction request and sequencing the
|
|
55
55
|
* the execution of the private functions within, sequenced with private kernel "glue" to check protocol rules.
|
|
56
|
-
* The result can be a
|
|
56
|
+
* The result can be a chonk proof of the private transaction portion, or just a simulation that can e.g.
|
|
57
57
|
* inform state tree updates.
|
|
58
58
|
*/
|
|
59
59
|
export class PrivateKernelExecutionProver {
|
|
@@ -347,50 +347,50 @@ export class PrivateKernelExecutionProver {
|
|
|
347
347
|
this.log.info(`Private kernel witness generation took ${timer.ms()}ms`);
|
|
348
348
|
}
|
|
349
349
|
|
|
350
|
-
let
|
|
350
|
+
let chonkProof: ChonkProof;
|
|
351
351
|
// TODO(#7368) how do we 'bincode' encode these inputs?
|
|
352
352
|
let provingTime;
|
|
353
353
|
if (!skipProofGeneration) {
|
|
354
354
|
const provingTimer = new Timer();
|
|
355
|
-
const proofWithPublicInputs = await this.proofCreator.
|
|
355
|
+
const proofWithPublicInputs = await this.proofCreator.createChonkProof(executionSteps);
|
|
356
356
|
provingTime = provingTimer.ms();
|
|
357
357
|
this.ensurePublicInputsMatch(proofWithPublicInputs, tailOutput.publicInputs);
|
|
358
|
-
|
|
358
|
+
chonkProof = proofWithPublicInputs.removePublicInputs();
|
|
359
359
|
} else {
|
|
360
|
-
|
|
360
|
+
chonkProof = ChonkProof.random();
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
return {
|
|
364
364
|
publicInputs: tailOutput.publicInputs,
|
|
365
365
|
executionSteps,
|
|
366
|
-
|
|
366
|
+
chonkProof,
|
|
367
367
|
timings: provingTime ? { proving: provingTime } : undefined,
|
|
368
368
|
};
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
/**
|
|
372
|
-
* Checks that the public inputs of the
|
|
372
|
+
* Checks that the public inputs of the chonk proof match the public inputs of the tail circuit.
|
|
373
373
|
* This can only mismatch if there is a circuit / noir / bb bug.
|
|
374
|
-
* @param
|
|
374
|
+
* @param chonkProof - The chonk proof with public inputs.
|
|
375
375
|
* @param tailPublicInputs - The public inputs resulting from witness generation of the tail circuit.
|
|
376
376
|
*/
|
|
377
377
|
private ensurePublicInputsMatch(
|
|
378
|
-
|
|
378
|
+
chonkProof: ChonkProofWithPublicInputs,
|
|
379
379
|
tailPublicInputs: PrivateKernelTailCircuitPublicInputs,
|
|
380
380
|
) {
|
|
381
|
-
const
|
|
381
|
+
const serializedChonkProofPublicInputs = chonkProof.getPublicInputs();
|
|
382
382
|
const serializedTailPublicInputs = tailPublicInputs.publicInputs().toFields();
|
|
383
|
-
if (
|
|
383
|
+
if (serializedChonkProofPublicInputs.length !== serializedTailPublicInputs.length) {
|
|
384
384
|
throw new Error(
|
|
385
|
-
`Public inputs length mismatch: ${
|
|
385
|
+
`Public inputs length mismatch: ${serializedChonkProofPublicInputs.length} !== ${serializedTailPublicInputs.length}`,
|
|
386
386
|
);
|
|
387
387
|
}
|
|
388
388
|
if (
|
|
389
|
-
!
|
|
389
|
+
!serializedChonkProofPublicInputs.every((input: Fr, index: number) =>
|
|
390
390
|
input.equals(serializedTailPublicInputs[index]),
|
|
391
391
|
)
|
|
392
392
|
) {
|
|
393
|
-
throw new Error(`Public inputs mismatch between kernel and
|
|
393
|
+
throw new Error(`Public inputs mismatch between kernel and chonk proof`);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
|
package/src/pxe.ts
CHANGED
|
@@ -250,7 +250,7 @@ export class PXE {
|
|
|
250
250
|
const contract = await this.contractDataProvider.getContract(to);
|
|
251
251
|
if (!contract) {
|
|
252
252
|
throw new Error(
|
|
253
|
-
`Unknown contract ${to}: add it to PXE by calling server.addContracts(...).\nSee docs for context: https://docs.aztec.network/developers/
|
|
253
|
+
`Unknown contract ${to}: add it to PXE by calling server.addContracts(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#unknown-contract-0x0-add-it-to-pxe-by-calling-serveraddcontracts`,
|
|
254
254
|
);
|
|
255
255
|
}
|
|
256
256
|
|
|
@@ -362,7 +362,7 @@ export class PXE {
|
|
|
362
362
|
* @param proofCreator - The proof creator to use for proving the execution.
|
|
363
363
|
* @param privateExecutionResult - The result of the private execution
|
|
364
364
|
* @param config - The configuration for the kernel execution prover.
|
|
365
|
-
* @returns An object that contains the output of the kernel execution, including the
|
|
365
|
+
* @returns An object that contains the output of the kernel execution, including the ChonkProof if proving is enabled.
|
|
366
366
|
*/
|
|
367
367
|
async #prove(
|
|
368
368
|
txExecutionRequest: TxExecutionRequest,
|
|
@@ -707,7 +707,7 @@ export class PXE {
|
|
|
707
707
|
|
|
708
708
|
const {
|
|
709
709
|
publicInputs,
|
|
710
|
-
|
|
710
|
+
chonkProof,
|
|
711
711
|
executionSteps,
|
|
712
712
|
timings: { proving } = {},
|
|
713
713
|
} = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
@@ -735,7 +735,7 @@ export class PXE {
|
|
|
735
735
|
|
|
736
736
|
this.log.debug(`Proving completed in ${totalTime}ms`, { timings });
|
|
737
737
|
|
|
738
|
-
const txProvingResult = new TxProvingResult(privateExecutionResult, publicInputs,
|
|
738
|
+
const txProvingResult = new TxProvingResult(privateExecutionResult, publicInputs, chonkProof!, {
|
|
739
739
|
timings,
|
|
740
740
|
nodeRPCCalls: contractFunctionSimulator?.getStats().nodeRPCCalls,
|
|
741
741
|
});
|