@aztec/simulator 0.60.0 → 0.61.0
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/acvm/oracle/oracle.d.ts +2 -0
- package/dest/acvm/oracle/oracle.d.ts.map +1 -1
- package/dest/acvm/oracle/oracle.js +9 -1
- package/dest/acvm/oracle/typed_oracle.d.ts +3 -1
- package/dest/acvm/oracle/typed_oracle.d.ts.map +1 -1
- package/dest/acvm/oracle/typed_oracle.js +7 -1
- package/dest/avm/avm_gas.d.ts.map +1 -1
- package/dest/avm/avm_gas.js +6 -3
- package/dest/avm/avm_machine_state.d.ts +2 -0
- package/dest/avm/avm_machine_state.d.ts.map +1 -1
- package/dest/avm/avm_machine_state.js +3 -1
- package/dest/avm/avm_simulator.d.ts +15 -0
- package/dest/avm/avm_simulator.d.ts.map +1 -1
- package/dest/avm/avm_simulator.js +45 -4
- package/dest/avm/fixtures/index.d.ts +1 -1
- package/dest/avm/fixtures/index.d.ts.map +1 -1
- package/dest/avm/fixtures/index.js +7 -7
- package/dest/avm/journal/journal.d.ts +5 -6
- package/dest/avm/journal/journal.d.ts.map +1 -1
- package/dest/avm/journal/journal.js +42 -17
- package/dest/avm/opcodes/contract.d.ts +8 -1
- package/dest/avm/opcodes/contract.d.ts.map +1 -1
- package/dest/avm/opcodes/contract.js +41 -21
- package/dest/avm/opcodes/conversion.d.ts +1 -1
- package/dest/avm/opcodes/conversion.d.ts.map +1 -1
- package/dest/avm/opcodes/conversion.js +12 -9
- package/dest/avm/opcodes/environment_getters.d.ts +1 -1
- package/dest/avm/opcodes/environment_getters.d.ts.map +1 -1
- package/dest/avm/opcodes/environment_getters.js +5 -1
- package/dest/avm/opcodes/external_calls.d.ts +3 -6
- package/dest/avm/opcodes/external_calls.d.ts.map +1 -1
- package/dest/avm/opcodes/external_calls.js +23 -43
- package/dest/avm/opcodes/memory.d.ts +20 -0
- package/dest/avm/opcodes/memory.d.ts.map +1 -1
- package/dest/avm/opcodes/memory.js +59 -3
- package/dest/avm/serialization/bytecode_serialization.d.ts.map +1 -1
- package/dest/avm/serialization/bytecode_serialization.js +5 -3
- package/dest/avm/serialization/instruction_serialization.d.ts +36 -34
- package/dest/avm/serialization/instruction_serialization.d.ts.map +1 -1
- package/dest/avm/serialization/instruction_serialization.js +37 -35
- package/dest/avm/test_utils.d.ts +2 -1
- package/dest/avm/test_utils.d.ts.map +1 -1
- package/dest/avm/test_utils.js +4 -1
- package/dest/client/client_execution_context.d.ts +0 -8
- package/dest/client/client_execution_context.d.ts.map +1 -1
- package/dest/client/client_execution_context.js +1 -18
- package/dest/client/db_oracle.d.ts +17 -1
- package/dest/client/db_oracle.d.ts.map +1 -1
- package/dest/client/db_oracle.js +1 -1
- package/dest/client/view_data_oracle.d.ts +17 -1
- package/dest/client/view_data_oracle.d.ts.map +1 -1
- package/dest/client/view_data_oracle.js +21 -1
- package/dest/common/index.d.ts +0 -1
- package/dest/common/index.d.ts.map +1 -1
- package/dest/common/index.js +1 -2
- package/dest/public/dual_side_effect_trace.d.ts +3 -5
- package/dest/public/dual_side_effect_trace.d.ts.map +1 -1
- package/dest/public/dual_side_effect_trace.js +8 -4
- package/dest/public/enqueued_call_side_effect_trace.d.ts +4 -6
- package/dest/public/enqueued_call_side_effect_trace.d.ts.map +1 -1
- package/dest/public/enqueued_call_side_effect_trace.js +19 -7
- package/dest/public/enqueued_call_simulator.d.ts +2 -2
- package/dest/public/enqueued_call_simulator.d.ts.map +1 -1
- package/dest/public/enqueued_call_simulator.js +21 -29
- package/dest/public/enqueued_calls_processor.d.ts +2 -3
- package/dest/public/enqueued_calls_processor.d.ts.map +1 -1
- package/dest/public/enqueued_calls_processor.js +18 -25
- package/dest/public/public_kernel.d.ts +0 -1
- package/dest/public/public_kernel.d.ts.map +1 -1
- package/dest/public/public_kernel.js +5 -8
- package/dest/public/public_kernel_tail_simulator.d.ts +1 -5
- package/dest/public/public_kernel_tail_simulator.d.ts.map +1 -1
- package/dest/public/public_kernel_tail_simulator.js +6 -12
- package/dest/public/public_processor.js +4 -4
- package/dest/public/side_effect_trace.d.ts +4 -3
- package/dest/public/side_effect_trace.d.ts.map +1 -1
- package/dest/public/side_effect_trace.js +27 -16
- package/dest/public/side_effect_trace_interface.d.ts +3 -3
- package/dest/public/side_effect_trace_interface.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/acvm/oracle/oracle.ts +13 -0
- package/src/acvm/oracle/typed_oracle.ts +9 -0
- package/src/avm/avm_gas.ts +5 -2
- package/src/avm/avm_machine_state.ts +2 -0
- package/src/avm/avm_simulator.ts +69 -6
- package/src/avm/fixtures/index.ts +7 -7
- package/src/avm/journal/journal.ts +62 -19
- package/src/avm/opcodes/contract.ts +45 -21
- package/src/avm/opcodes/conversion.ts +9 -6
- package/src/avm/opcodes/environment_getters.ts +7 -2
- package/src/avm/opcodes/external_calls.ts +21 -45
- package/src/avm/opcodes/memory.ts +69 -2
- package/src/avm/serialization/bytecode_serialization.ts +6 -2
- package/src/avm/serialization/instruction_serialization.ts +3 -1
- package/src/avm/test_utils.ts +5 -1
- package/src/client/client_execution_context.ts +0 -27
- package/src/client/db_oracle.ts +26 -0
- package/src/client/view_data_oracle.ts +31 -1
- package/src/common/index.ts +0 -1
- package/src/public/dual_side_effect_trace.ts +20 -6
- package/src/public/enqueued_call_side_effect_trace.ts +46 -8
- package/src/public/enqueued_call_simulator.ts +42 -26
- package/src/public/enqueued_calls_processor.ts +26 -38
- package/src/public/public_kernel.ts +9 -12
- package/src/public/public_kernel_tail_simulator.ts +6 -15
- package/src/public/public_processor.ts +3 -3
- package/src/public/side_effect_trace.ts +54 -15
- package/src/public/side_effect_trace_interface.ts +9 -4
- package/dest/client/test_utils.d.ts +0 -9
- package/dest/client/test_utils.d.ts.map +0 -1
- package/dest/client/test_utils.js +0 -27
- package/dest/common/side_effect_counter.d.ts +0 -10
- package/dest/common/side_effect_counter.d.ts.map +0 -1
- package/dest/common/side_effect_counter.js +0 -18
- package/dest/rollup/index.d.ts +0 -2
- package/dest/rollup/index.d.ts.map +0 -1
- package/dest/rollup/index.js +0 -2
- package/dest/rollup/rollup.d.ts +0 -101
- package/dest/rollup/rollup.d.ts.map +0 -1
- package/dest/rollup/rollup.js +0 -100
- package/src/client/test_utils.ts +0 -57
- package/src/common/side_effect_counter.ts +0 -17
- package/src/rollup/index.ts +0 -1
- package/src/rollup/rollup.ts +0 -228
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type AvmProvingRequest,
|
|
2
3
|
type MerkleTreeReadOperations,
|
|
3
4
|
type NestedProcessReturnValues,
|
|
4
5
|
type ProcessedTx,
|
|
5
|
-
ProvingRequestType,
|
|
6
6
|
type PublicExecutionRequest,
|
|
7
|
-
type PublicKernelMergeRequest,
|
|
8
7
|
PublicKernelPhase,
|
|
9
|
-
type PublicProvingRequest,
|
|
10
8
|
type SimulationError,
|
|
11
9
|
type Tx,
|
|
12
10
|
} from '@aztec/circuit-types';
|
|
@@ -23,12 +21,13 @@ import {
|
|
|
23
21
|
type PublicKernelCircuitPublicInputs,
|
|
24
22
|
PublicKernelData,
|
|
25
23
|
type VMCircuitPublicInputs,
|
|
24
|
+
VerificationKeyData,
|
|
26
25
|
makeEmptyProof,
|
|
27
26
|
makeEmptyRecursiveProof,
|
|
28
27
|
} from '@aztec/circuits.js';
|
|
29
28
|
import { type DebugLogger, createDebugLogger } from '@aztec/foundation/log';
|
|
30
29
|
import { Timer } from '@aztec/foundation/timer';
|
|
31
|
-
import {
|
|
30
|
+
import { getVKSiblingPath } from '@aztec/noir-protocol-circuits-types';
|
|
32
31
|
|
|
33
32
|
import { inspect } from 'util';
|
|
34
33
|
|
|
@@ -45,10 +44,9 @@ const PhaseIsRevertible: Record<PublicKernelPhase, boolean> = {
|
|
|
45
44
|
};
|
|
46
45
|
|
|
47
46
|
type PublicPhaseResult = {
|
|
47
|
+
avmProvingRequest: AvmProvingRequest;
|
|
48
48
|
/** The output of the public kernel circuit simulation for this phase */
|
|
49
49
|
publicKernelOutput: PublicKernelCircuitPublicInputs;
|
|
50
|
-
/** The collection of public proving requests */
|
|
51
|
-
provingRequests: PublicProvingRequest[];
|
|
52
50
|
/** Return values of simulating complete callstack */
|
|
53
51
|
returnValues: NestedProcessReturnValues[];
|
|
54
52
|
/** Gas used during the execution this phase */
|
|
@@ -66,8 +64,7 @@ export type ProcessedPhase = {
|
|
|
66
64
|
};
|
|
67
65
|
|
|
68
66
|
export type TxPublicCallsResult = {
|
|
69
|
-
|
|
70
|
-
provingRequests: PublicProvingRequest[];
|
|
67
|
+
avmProvingRequest: AvmProvingRequest;
|
|
71
68
|
/** The output of the public kernel tail circuit simulation for this tx */
|
|
72
69
|
tailKernelOutput: KernelCircuitPublicInputs;
|
|
73
70
|
/** Return values of simulating complete callstack */
|
|
@@ -158,8 +155,8 @@ export class EnqueuedCallsProcessor {
|
|
|
158
155
|
PublicKernelPhase.TEARDOWN,
|
|
159
156
|
];
|
|
160
157
|
const processedPhases: ProcessedPhase[] = [];
|
|
161
|
-
const provingRequests: PublicProvingRequest[] = [];
|
|
162
158
|
const gasUsed: ProcessedTx['gasUsed'] = {};
|
|
159
|
+
let avmProvingRequest: AvmProvingRequest;
|
|
163
160
|
let publicKernelOutput = tx.data.toPublicKernelCircuitPublicInputs();
|
|
164
161
|
let isFromPrivate = true;
|
|
165
162
|
let returnValues: NestedProcessReturnValues[] = [];
|
|
@@ -184,7 +181,9 @@ export class EnqueuedCallsProcessor {
|
|
|
184
181
|
publicKernelOutput = result.publicKernelOutput;
|
|
185
182
|
isFromPrivate = false;
|
|
186
183
|
|
|
187
|
-
|
|
184
|
+
// Propagate only one avmProvingRequest of a function call for now, so that we know it's still provable.
|
|
185
|
+
// Eventually this will be the proof for the entire public call stack.
|
|
186
|
+
avmProvingRequest = result.avmProvingRequest;
|
|
188
187
|
if (phase === PublicKernelPhase.APP_LOGIC) {
|
|
189
188
|
returnValues = result.returnValues;
|
|
190
189
|
}
|
|
@@ -201,19 +200,16 @@ export class EnqueuedCallsProcessor {
|
|
|
201
200
|
}
|
|
202
201
|
}
|
|
203
202
|
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
},
|
|
212
|
-
);
|
|
213
|
-
provingRequests.push(provingRequest);
|
|
203
|
+
const tailKernelOutput = await this.publicKernelTailSimulator.simulate(publicKernelOutput).catch(
|
|
204
|
+
// the abstract phase manager throws if simulation gives error in non-revertible phase
|
|
205
|
+
async err => {
|
|
206
|
+
await this.worldStateDB.rollbackToCommit();
|
|
207
|
+
throw err;
|
|
208
|
+
},
|
|
209
|
+
);
|
|
214
210
|
|
|
215
211
|
return {
|
|
216
|
-
|
|
212
|
+
avmProvingRequest: avmProvingRequest!,
|
|
217
213
|
tailKernelOutput,
|
|
218
214
|
returnValues,
|
|
219
215
|
gasUsed,
|
|
@@ -233,8 +229,8 @@ export class EnqueuedCallsProcessor {
|
|
|
233
229
|
this.log.debug(`Beginning processing in phase ${PublicKernelPhase[phase]} for tx ${tx.getTxHash()}`);
|
|
234
230
|
|
|
235
231
|
const phaseTimer = new Timer();
|
|
236
|
-
const provingRequests: PublicProvingRequest[] = [];
|
|
237
232
|
const returnValues: NestedProcessReturnValues[] = [];
|
|
233
|
+
let avmProvingRequest: AvmProvingRequest;
|
|
238
234
|
let publicKernelOutput = previousPublicKernelOutput;
|
|
239
235
|
let gasUsed = Gas.empty();
|
|
240
236
|
let revertReason: SimulationError | undefined;
|
|
@@ -270,7 +266,7 @@ export class EnqueuedCallsProcessor {
|
|
|
270
266
|
throw enqueuedCallResult.revertReason;
|
|
271
267
|
}
|
|
272
268
|
|
|
273
|
-
|
|
269
|
+
avmProvingRequest = enqueuedCallResult.avmProvingRequest;
|
|
274
270
|
returnValues.push(enqueuedCallResult.returnValues);
|
|
275
271
|
gasUsed = gasUsed.add(enqueuedCallResult.gasUsed);
|
|
276
272
|
revertReason ??= enqueuedCallResult.revertReason;
|
|
@@ -286,14 +282,13 @@ export class EnqueuedCallsProcessor {
|
|
|
286
282
|
tx.unencryptedLogs.addFunctionLogs([enqueuedCallResult.newUnencryptedLogs]);
|
|
287
283
|
}
|
|
288
284
|
|
|
289
|
-
const
|
|
285
|
+
const output = await this.runMergeKernelCircuit(
|
|
290
286
|
publicKernelOutput,
|
|
291
287
|
enqueuedCallResult.kernelOutput,
|
|
292
288
|
isFromPrivate,
|
|
293
289
|
);
|
|
294
290
|
publicKernelOutput = output;
|
|
295
291
|
isFromPrivate = false;
|
|
296
|
-
provingRequests.push(provingRequest);
|
|
297
292
|
}
|
|
298
293
|
|
|
299
294
|
if (phase === PublicKernelPhase.SETUP) {
|
|
@@ -301,8 +296,8 @@ export class EnqueuedCallsProcessor {
|
|
|
301
296
|
}
|
|
302
297
|
|
|
303
298
|
return {
|
|
299
|
+
avmProvingRequest: avmProvingRequest!,
|
|
304
300
|
publicKernelOutput,
|
|
305
|
-
provingRequests,
|
|
306
301
|
durationMs: phaseTimer.ms(),
|
|
307
302
|
gasUsed,
|
|
308
303
|
returnValues: revertReason ? [] : returnValues,
|
|
@@ -349,7 +344,7 @@ export class EnqueuedCallsProcessor {
|
|
|
349
344
|
previousOutput: PublicKernelCircuitPublicInputs,
|
|
350
345
|
enqueuedCallData: VMCircuitPublicInputs,
|
|
351
346
|
isFromPrivate: boolean,
|
|
352
|
-
): Promise<
|
|
347
|
+
): Promise<PublicKernelCircuitPublicInputs> {
|
|
353
348
|
const previousKernel = this.getPreviousKernelData(previousOutput, isFromPrivate);
|
|
354
349
|
|
|
355
350
|
// The proof is not used in simulation.
|
|
@@ -358,25 +353,18 @@ export class EnqueuedCallsProcessor {
|
|
|
358
353
|
|
|
359
354
|
const inputs = new PublicKernelCircuitPrivateInputs(previousKernel, callData);
|
|
360
355
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
const provingRequest: PublicKernelMergeRequest = {
|
|
364
|
-
type: ProvingRequestType.PUBLIC_KERNEL_MERGE,
|
|
365
|
-
inputs,
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
return { output, provingRequest };
|
|
356
|
+
return await this.publicKernelSimulator.publicKernelCircuitMerge(inputs);
|
|
369
357
|
}
|
|
370
358
|
|
|
371
359
|
private getPreviousKernelData(
|
|
372
360
|
previousOutput: PublicKernelCircuitPublicInputs,
|
|
373
|
-
|
|
361
|
+
_isFromPrivate: boolean,
|
|
374
362
|
): PublicKernelData {
|
|
375
363
|
// The proof is not used in simulation.
|
|
376
364
|
const proof = makeEmptyRecursiveProof(NESTED_RECURSIVE_PROOF_LENGTH);
|
|
377
365
|
|
|
378
|
-
const vk =
|
|
379
|
-
const vkIndex =
|
|
366
|
+
const vk = VerificationKeyData.makeFakeHonk();
|
|
367
|
+
const vkIndex = 0;
|
|
380
368
|
const siblingPath = getVKSiblingPath(vkIndex);
|
|
381
369
|
|
|
382
370
|
return new PublicKernelData(previousOutput, proof, vk, vkIndex, siblingPath);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { type CircuitSimulationStats } from '@aztec/circuit-types/stats';
|
|
2
1
|
import {
|
|
3
2
|
type KernelCircuitPublicInputs,
|
|
4
3
|
type PublicKernelCircuitPrivateInputs,
|
|
@@ -10,7 +9,9 @@ import {
|
|
|
10
9
|
import { createDebugLogger } from '@aztec/foundation/log';
|
|
11
10
|
import { elapsed } from '@aztec/foundation/timer';
|
|
12
11
|
import {
|
|
13
|
-
|
|
12
|
+
SimulatedPublicKernelInnerArtifact,
|
|
13
|
+
SimulatedPublicKernelMergeArtifact,
|
|
14
|
+
SimulatedPublicKernelTailArtifact,
|
|
14
15
|
convertSimulatedPublicInnerInputsToWitnessMap,
|
|
15
16
|
convertSimulatedPublicInnerOutputFromWitnessMap,
|
|
16
17
|
convertSimulatedPublicMergeInputsToWitnessMap,
|
|
@@ -19,7 +20,6 @@ import {
|
|
|
19
20
|
convertSimulatedPublicTailOutputFromWitnessMap,
|
|
20
21
|
} from '@aztec/noir-protocol-circuits-types';
|
|
21
22
|
|
|
22
|
-
import { WASMSimulator } from '../providers/acvm_wasm.js';
|
|
23
23
|
import { type SimulationProvider } from '../providers/simulation_provider.js';
|
|
24
24
|
import { type PublicKernelCircuitSimulator } from './public_kernel_circuit_simulator.js';
|
|
25
25
|
|
|
@@ -29,9 +29,6 @@ import { type PublicKernelCircuitSimulator } from './public_kernel_circuit_simul
|
|
|
29
29
|
export class RealPublicKernelCircuitSimulator implements PublicKernelCircuitSimulator {
|
|
30
30
|
private log = createDebugLogger('aztec:public-kernel-simulator');
|
|
31
31
|
|
|
32
|
-
// Some circuits are so small it is faster to use WASM
|
|
33
|
-
private wasmSimulator: WASMSimulator = new WASMSimulator();
|
|
34
|
-
|
|
35
32
|
constructor(private simulator: SimulationProvider) {}
|
|
36
33
|
|
|
37
34
|
/**
|
|
@@ -42,7 +39,7 @@ export class RealPublicKernelCircuitSimulator implements PublicKernelCircuitSimu
|
|
|
42
39
|
public async publicKernelCircuitInner(input: PublicKernelInnerCircuitPrivateInputs): Promise<VMCircuitPublicInputs> {
|
|
43
40
|
const inputWitness = convertSimulatedPublicInnerInputsToWitnessMap(input);
|
|
44
41
|
const [duration, witness] = await elapsed(() =>
|
|
45
|
-
this.
|
|
42
|
+
this.simulator.simulateCircuit(inputWitness, SimulatedPublicKernelInnerArtifact),
|
|
46
43
|
);
|
|
47
44
|
const result = convertSimulatedPublicInnerOutputFromWitnessMap(witness);
|
|
48
45
|
this.log.debug(`Simulated public kernel inner circuit`, {
|
|
@@ -51,7 +48,7 @@ export class RealPublicKernelCircuitSimulator implements PublicKernelCircuitSimu
|
|
|
51
48
|
duration,
|
|
52
49
|
inputSize: input.toBuffer().length,
|
|
53
50
|
outputSize: result.toBuffer().length,
|
|
54
|
-
}
|
|
51
|
+
});
|
|
55
52
|
return result;
|
|
56
53
|
}
|
|
57
54
|
|
|
@@ -65,7 +62,7 @@ export class RealPublicKernelCircuitSimulator implements PublicKernelCircuitSimu
|
|
|
65
62
|
): Promise<PublicKernelCircuitPublicInputs> {
|
|
66
63
|
const inputWitness = convertSimulatedPublicMergeInputsToWitnessMap(input);
|
|
67
64
|
const [duration, witness] = await elapsed(() =>
|
|
68
|
-
this.
|
|
65
|
+
this.simulator.simulateCircuit(inputWitness, SimulatedPublicKernelMergeArtifact),
|
|
69
66
|
);
|
|
70
67
|
const result = convertSimulatedPublicMergeOutputFromWitnessMap(witness);
|
|
71
68
|
this.log.debug(`Simulated public kernel merge circuit`, {
|
|
@@ -74,7 +71,7 @@ export class RealPublicKernelCircuitSimulator implements PublicKernelCircuitSimu
|
|
|
74
71
|
duration,
|
|
75
72
|
inputSize: input.toBuffer().length,
|
|
76
73
|
outputSize: result.toBuffer().length,
|
|
77
|
-
}
|
|
74
|
+
});
|
|
78
75
|
return result;
|
|
79
76
|
}
|
|
80
77
|
|
|
@@ -88,7 +85,7 @@ export class RealPublicKernelCircuitSimulator implements PublicKernelCircuitSimu
|
|
|
88
85
|
): Promise<KernelCircuitPublicInputs> {
|
|
89
86
|
const inputWitness = convertSimulatedPublicTailInputsToWitnessMap(input);
|
|
90
87
|
const [duration, witness] = await elapsed(() =>
|
|
91
|
-
this.
|
|
88
|
+
this.simulator.simulateCircuit(inputWitness, SimulatedPublicKernelTailArtifact),
|
|
92
89
|
);
|
|
93
90
|
const result = convertSimulatedPublicTailOutputFromWitnessMap(witness);
|
|
94
91
|
this.log.debug(`Simulated public kernel tail circuit`, {
|
|
@@ -97,7 +94,7 @@ export class RealPublicKernelCircuitSimulator implements PublicKernelCircuitSimu
|
|
|
97
94
|
duration,
|
|
98
95
|
inputSize: input.toBuffer().length,
|
|
99
96
|
outputSize: result.toBuffer().length,
|
|
100
|
-
}
|
|
97
|
+
});
|
|
101
98
|
return result;
|
|
102
99
|
}
|
|
103
100
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ProvingRequestType, type PublicKernelTailRequest } from '@aztec/circuit-types';
|
|
2
1
|
import {
|
|
3
2
|
type KernelCircuitPublicInputs,
|
|
4
3
|
MAX_NULLIFIERS_PER_TX,
|
|
@@ -7,10 +6,11 @@ import {
|
|
|
7
6
|
type PublicKernelCircuitPublicInputs,
|
|
8
7
|
PublicKernelData,
|
|
9
8
|
PublicKernelTailCircuitPrivateInputs,
|
|
9
|
+
VerificationKeyData,
|
|
10
10
|
makeEmptyRecursiveProof,
|
|
11
11
|
mergeAccumulatedData,
|
|
12
12
|
} from '@aztec/circuits.js';
|
|
13
|
-
import {
|
|
13
|
+
import { getVKSiblingPath } from '@aztec/noir-protocol-circuits-types';
|
|
14
14
|
import { type MerkleTreeReadOperations } from '@aztec/world-state';
|
|
15
15
|
|
|
16
16
|
import { HintsBuilder } from './hints_builder.js';
|
|
@@ -28,19 +28,10 @@ export class PublicKernelTailSimulator {
|
|
|
28
28
|
return new PublicKernelTailSimulator(db, publicKernelSimulator, hintsBuilder);
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
async simulate(
|
|
32
|
-
previousOutput: PublicKernelCircuitPublicInputs,
|
|
33
|
-
): Promise<{ output: KernelCircuitPublicInputs; provingRequest: PublicKernelTailRequest }> {
|
|
31
|
+
async simulate(previousOutput: PublicKernelCircuitPublicInputs): Promise<KernelCircuitPublicInputs> {
|
|
34
32
|
const inputs = await this.buildPrivateInputs(previousOutput);
|
|
35
33
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const provingRequest: PublicKernelTailRequest = {
|
|
39
|
-
type: ProvingRequestType.PUBLIC_KERNEL_TAIL,
|
|
40
|
-
inputs,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
return { output, provingRequest };
|
|
34
|
+
return await this.publicKernelSimulator.publicKernelCircuitTail(inputs);
|
|
44
35
|
}
|
|
45
36
|
|
|
46
37
|
private async buildPrivateInputs(previousOutput: PublicKernelCircuitPublicInputs) {
|
|
@@ -98,8 +89,8 @@ export class PublicKernelTailSimulator {
|
|
|
98
89
|
|
|
99
90
|
private getPreviousKernelData(previousOutput: PublicKernelCircuitPublicInputs): PublicKernelData {
|
|
100
91
|
const proof = makeEmptyRecursiveProof(NESTED_RECURSIVE_PROOF_LENGTH);
|
|
101
|
-
const vk =
|
|
102
|
-
const vkIndex =
|
|
92
|
+
const vk = VerificationKeyData.makeFakeHonk();
|
|
93
|
+
const vkIndex = 0;
|
|
103
94
|
const siblingPath = getVKSiblingPath(vkIndex);
|
|
104
95
|
return new PublicKernelData(previousOutput, proof, vk, vkIndex, siblingPath);
|
|
105
96
|
}
|
|
@@ -152,7 +152,7 @@ export class PublicProcessor {
|
|
|
152
152
|
}
|
|
153
153
|
try {
|
|
154
154
|
const [processedTx, returnValues] = !tx.hasPublicCalls()
|
|
155
|
-
? [makeProcessedTx(tx, tx.data.toKernelCircuitPublicInputs()
|
|
155
|
+
? [makeProcessedTx(tx, tx.data.toKernelCircuitPublicInputs())]
|
|
156
156
|
: await this.processTxWithPublicCalls(tx);
|
|
157
157
|
this.log.debug(`Processed tx`, {
|
|
158
158
|
txHash: processedTx.hash,
|
|
@@ -253,7 +253,7 @@ export class PublicProcessor {
|
|
|
253
253
|
private async processTxWithPublicCalls(tx: Tx): Promise<[ProcessedTx, NestedProcessReturnValues[]]> {
|
|
254
254
|
const timer = new Timer();
|
|
255
255
|
|
|
256
|
-
const { tailKernelOutput, returnValues, revertReason,
|
|
256
|
+
const { avmProvingRequest, tailKernelOutput, returnValues, revertReason, gasUsed, processedPhases } =
|
|
257
257
|
await this.enqueuedCallsProcessor.process(tx);
|
|
258
258
|
|
|
259
259
|
if (!tailKernelOutput) {
|
|
@@ -279,7 +279,7 @@ export class PublicProcessor {
|
|
|
279
279
|
const phaseCount = processedPhases.length;
|
|
280
280
|
this.metrics.recordTx(phaseCount, timer.ms());
|
|
281
281
|
|
|
282
|
-
const processedTx = makeProcessedTx(tx, tailKernelOutput,
|
|
282
|
+
const processedTx = makeProcessedTx(tx, tailKernelOutput, { avmProvingRequest, revertReason, gasUsed });
|
|
283
283
|
return [processedTx, returnValues];
|
|
284
284
|
}
|
|
285
285
|
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { PublicExecutionRequest, UnencryptedFunctionL2Logs, UnencryptedL2Log } from '@aztec/circuit-types';
|
|
2
2
|
import {
|
|
3
|
+
AvmContractBytecodeHints,
|
|
3
4
|
AvmContractInstanceHint,
|
|
4
5
|
AvmExecutionHints,
|
|
5
6
|
AvmExternalCallHint,
|
|
6
7
|
AvmKeyValueHint,
|
|
7
8
|
AztecAddress,
|
|
8
9
|
CallContext,
|
|
10
|
+
type ContractClassIdPreimage,
|
|
9
11
|
type ContractInstanceWithAddress,
|
|
10
12
|
ContractStorageRead,
|
|
11
13
|
ContractStorageUpdateRequest,
|
|
@@ -27,6 +29,7 @@ import {
|
|
|
27
29
|
Nullifier,
|
|
28
30
|
type PublicInnerCallRequest,
|
|
29
31
|
ReadRequest,
|
|
32
|
+
SerializableContractInstance,
|
|
30
33
|
TreeLeafReadRequest,
|
|
31
34
|
} from '@aztec/circuits.js';
|
|
32
35
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -42,7 +45,7 @@ import { type PublicSideEffectTraceInterface } from './side_effect_trace_interfa
|
|
|
42
45
|
export type TracedContractInstance = { exists: boolean } & ContractInstanceWithAddress;
|
|
43
46
|
|
|
44
47
|
export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
45
|
-
public
|
|
48
|
+
public log = createDebugLogger('aztec:public_side_effect_trace');
|
|
46
49
|
|
|
47
50
|
/** The side effect counter increments with every call to the trace. */
|
|
48
51
|
private sideEffectCounter: number; // kept as number until finalized for efficiency
|
|
@@ -90,8 +93,6 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
90
93
|
this.sideEffectCounter++;
|
|
91
94
|
}
|
|
92
95
|
|
|
93
|
-
// TODO(dbanks12): checks against tx-wide limit need access to parent trace's length
|
|
94
|
-
|
|
95
96
|
public tracePublicStorageRead(contractAddress: Fr, slot: Fr, value: Fr, _exists: boolean, _cached: boolean) {
|
|
96
97
|
// NOTE: exists and cached are unused for now but may be used for optimizations or kernel hints later
|
|
97
98
|
if (this.contractStorageReads.length >= MAX_PUBLIC_DATA_READS_PER_TX) {
|
|
@@ -103,7 +104,7 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
103
104
|
this.avmCircuitHints.storageValues.items.push(
|
|
104
105
|
new AvmKeyValueHint(/*key=*/ new Fr(this.sideEffectCounter), /*value=*/ value),
|
|
105
106
|
);
|
|
106
|
-
this.
|
|
107
|
+
this.log.debug(`SLOAD cnt: ${this.sideEffectCounter} val: ${value} slot: ${slot}`);
|
|
107
108
|
this.incrementSideEffectCounter();
|
|
108
109
|
}
|
|
109
110
|
|
|
@@ -114,7 +115,7 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
114
115
|
this.contractStorageUpdateRequests.push(
|
|
115
116
|
new ContractStorageUpdateRequest(slot, value, this.sideEffectCounter, contractAddress),
|
|
116
117
|
);
|
|
117
|
-
this.
|
|
118
|
+
this.log.debug(`SSTORE cnt: ${this.sideEffectCounter} val: ${value} slot: ${slot}`);
|
|
118
119
|
this.incrementSideEffectCounter();
|
|
119
120
|
}
|
|
120
121
|
|
|
@@ -136,7 +137,7 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
136
137
|
throw new SideEffectLimitReachedError('note hash', MAX_NOTE_HASHES_PER_TX);
|
|
137
138
|
}
|
|
138
139
|
this.noteHashes.push(new NoteHash(noteHash, this.sideEffectCounter));
|
|
139
|
-
this.
|
|
140
|
+
this.log.debug(`NEW_NOTE_HASH cnt: ${this.sideEffectCounter}`);
|
|
140
141
|
this.incrementSideEffectCounter();
|
|
141
142
|
}
|
|
142
143
|
|
|
@@ -161,7 +162,7 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
161
162
|
this.avmCircuitHints.nullifierExists.items.push(
|
|
162
163
|
new AvmKeyValueHint(/*key=*/ new Fr(this.sideEffectCounter), /*value=*/ new Fr(exists ? 1 : 0)),
|
|
163
164
|
);
|
|
164
|
-
this.
|
|
165
|
+
this.log.debug(`NULLIFIER_EXISTS cnt: ${this.sideEffectCounter}`);
|
|
165
166
|
this.incrementSideEffectCounter();
|
|
166
167
|
}
|
|
167
168
|
|
|
@@ -171,7 +172,7 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
171
172
|
throw new SideEffectLimitReachedError('nullifier', MAX_NULLIFIERS_PER_TX);
|
|
172
173
|
}
|
|
173
174
|
this.nullifiers.push(new Nullifier(nullifier, this.sideEffectCounter, /*noteHash=*/ Fr.ZERO));
|
|
174
|
-
this.
|
|
175
|
+
this.log.debug(`NEW_NULLIFIER cnt: ${this.sideEffectCounter}`);
|
|
175
176
|
this.incrementSideEffectCounter();
|
|
176
177
|
}
|
|
177
178
|
|
|
@@ -194,7 +195,7 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
194
195
|
}
|
|
195
196
|
const recipientAddress = EthAddress.fromField(recipient);
|
|
196
197
|
this.newL2ToL1Messages.push(new L2ToL1Message(recipientAddress, content, this.sideEffectCounter));
|
|
197
|
-
this.
|
|
198
|
+
this.log.debug(`NEW_L2_TO_L1_MSG cnt: ${this.sideEffectCounter}`);
|
|
198
199
|
this.incrementSideEffectCounter();
|
|
199
200
|
}
|
|
200
201
|
|
|
@@ -212,18 +213,21 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
212
213
|
// This length is for charging DA and is checked on-chain - has to be length of log preimage + 4 bytes.
|
|
213
214
|
// The .length call also has a +4 but that is unrelated
|
|
214
215
|
this.unencryptedLogsHashes.push(new LogHash(basicLogHash, this.sideEffectCounter, new Fr(ulog.length + 4)));
|
|
215
|
-
this.
|
|
216
|
+
this.log.debug(`NEW_UNENCRYPTED_LOG cnt: ${this.sideEffectCounter}`);
|
|
216
217
|
this.incrementSideEffectCounter();
|
|
217
218
|
}
|
|
218
219
|
|
|
219
|
-
public traceGetContractInstance(
|
|
220
|
+
public traceGetContractInstance(
|
|
221
|
+
contractAddress: Fr,
|
|
222
|
+
exists: boolean,
|
|
223
|
+
instance: SerializableContractInstance = SerializableContractInstance.default(),
|
|
224
|
+
) {
|
|
220
225
|
this.enforceLimitOnNullifierChecks('(contract address nullifier from GETCONTRACTINSTANCE)');
|
|
221
|
-
// TODO(dbanks12): should emit a nullifier read request
|
|
222
226
|
|
|
223
227
|
this.avmCircuitHints.contractInstances.items.push(
|
|
224
228
|
new AvmContractInstanceHint(
|
|
225
|
-
|
|
226
|
-
|
|
229
|
+
contractAddress,
|
|
230
|
+
exists,
|
|
227
231
|
instance.salt,
|
|
228
232
|
instance.deployer,
|
|
229
233
|
instance.contractClassId,
|
|
@@ -231,10 +235,44 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
231
235
|
instance.publicKeys,
|
|
232
236
|
),
|
|
233
237
|
);
|
|
234
|
-
this.
|
|
238
|
+
this.log.debug(`CONTRACT_INSTANCE cnt: ${this.sideEffectCounter}`);
|
|
235
239
|
this.incrementSideEffectCounter();
|
|
236
240
|
}
|
|
237
241
|
|
|
242
|
+
// This tracing function gets called everytime we start simulation/execution.
|
|
243
|
+
// This happens both when starting a new top-level trace and the start of every nested trace
|
|
244
|
+
// We use this to collect the AvmContractBytecodeHints
|
|
245
|
+
public traceGetBytecode(
|
|
246
|
+
contractAddress: Fr,
|
|
247
|
+
exists: boolean,
|
|
248
|
+
bytecode: Buffer = Buffer.alloc(0),
|
|
249
|
+
contractInstance: SerializableContractInstance = SerializableContractInstance.default(),
|
|
250
|
+
contractClass: ContractClassIdPreimage = {
|
|
251
|
+
artifactHash: Fr.zero(),
|
|
252
|
+
privateFunctionsRoot: Fr.zero(),
|
|
253
|
+
publicBytecodeCommitment: Fr.zero(),
|
|
254
|
+
},
|
|
255
|
+
) {
|
|
256
|
+
const instance = new AvmContractInstanceHint(
|
|
257
|
+
contractAddress,
|
|
258
|
+
exists,
|
|
259
|
+
contractInstance.salt,
|
|
260
|
+
contractInstance.deployer,
|
|
261
|
+
contractInstance.contractClassId,
|
|
262
|
+
contractInstance.initializationHash,
|
|
263
|
+
contractInstance.publicKeys,
|
|
264
|
+
);
|
|
265
|
+
// We need to deduplicate the contract instances based on addresses
|
|
266
|
+
this.avmCircuitHints.contractBytecodeHints.items.push(
|
|
267
|
+
new AvmContractBytecodeHints(bytecode, instance, contractClass),
|
|
268
|
+
);
|
|
269
|
+
this.log.debug(
|
|
270
|
+
`Bytecode retrieval for contract execution traced: exists=${exists}, instance=${JSON.stringify(
|
|
271
|
+
contractInstance,
|
|
272
|
+
)}`,
|
|
273
|
+
);
|
|
274
|
+
}
|
|
275
|
+
|
|
238
276
|
/**
|
|
239
277
|
* Trace a nested call.
|
|
240
278
|
* Accept some results from a finished nested call's trace into this one.
|
|
@@ -288,6 +326,7 @@ export class PublicSideEffectTrace implements PublicSideEffectTraceInterface {
|
|
|
288
326
|
result.returnValues,
|
|
289
327
|
gasUsed,
|
|
290
328
|
result.endSideEffectCounter,
|
|
329
|
+
nestedEnvironment.address,
|
|
291
330
|
),
|
|
292
331
|
);
|
|
293
332
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { type Gas } from '@aztec/circuits.js';
|
|
1
|
+
import { type ContractClassIdPreimage, type Gas, type SerializableContractInstance } from '@aztec/circuits.js';
|
|
2
2
|
import { type Fr } from '@aztec/foundation/fields';
|
|
3
3
|
|
|
4
4
|
import { type AvmContractCallResult } from '../avm/avm_contract_call_result.js';
|
|
5
5
|
import { type AvmExecutionEnvironment } from '../avm/avm_execution_environment.js';
|
|
6
|
-
import { type TracedContractInstance } from './side_effect_trace.js';
|
|
7
6
|
|
|
8
7
|
export interface PublicSideEffectTraceInterface {
|
|
9
8
|
fork(): PublicSideEffectTraceInterface;
|
|
@@ -18,8 +17,14 @@ export interface PublicSideEffectTraceInterface {
|
|
|
18
17
|
traceL1ToL2MessageCheck(contractAddress: Fr, msgHash: Fr, msgLeafIndex: Fr, exists: boolean): void;
|
|
19
18
|
traceNewL2ToL1Message(contractAddress: Fr, recipient: Fr, content: Fr): void;
|
|
20
19
|
traceUnencryptedLog(contractAddress: Fr, log: Fr[]): void;
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
traceGetContractInstance(contractAddress: Fr, exists: boolean, instance?: SerializableContractInstance): void;
|
|
21
|
+
traceGetBytecode(
|
|
22
|
+
contractAddress: Fr,
|
|
23
|
+
exists: boolean,
|
|
24
|
+
bytecode?: Buffer,
|
|
25
|
+
contractInstance?: SerializableContractInstance,
|
|
26
|
+
contractClass?: ContractClassIdPreimage,
|
|
27
|
+
): void;
|
|
23
28
|
traceNestedCall(
|
|
24
29
|
/** The trace of the nested call. */
|
|
25
30
|
nestedCallTrace: PublicSideEffectTraceInterface,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/circuits.js';
|
|
2
|
-
/**
|
|
3
|
-
* Computes a note hiding point as is done by the default implementation injected by macros.
|
|
4
|
-
* @param storageSlot - The slot to which the note was inserted.
|
|
5
|
-
* @param noteContent - The note content (e.g. note.items).
|
|
6
|
-
* @returns A note hash.
|
|
7
|
-
*/
|
|
8
|
-
export declare function computeNoteHash(storageSlot: Fr, noteContent: Fr[]): Fr;
|
|
9
|
-
//# sourceMappingURL=test_utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test_utils.d.ts","sourceRoot":"","sources":["../../src/client/test_utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAM,EAAE,EAAS,MAAM,oBAAoB,CAAC;AAsCnD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,WAAW,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,GAAG,EAAE,CAYtE"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Fq, Fr, Point } from '@aztec/circuits.js';
|
|
2
|
-
import { Grumpkin } from '@aztec/circuits.js/barretenberg';
|
|
3
|
-
// Copied over from `noir-projects/aztec-nr/aztec/src/generators.nr`
|
|
4
|
-
const GENERATORS = [
|
|
5
|
-
new Point(new Fr(0x30426e64aee30e998c13c8ceecda3a77807dbead52bc2f3bf0eae851b4b710c1n), new Fr(0x113156a068f603023240c96b4da5474667db3b8711c521c748212a15bc034ea6n), false),
|
|
6
|
-
new Point(new Fr(0x2825c79cc6a5cbbeef7d6a8f1b6a12b312aa338440aefeb4396148c89147c049n), new Fr(0x129bfd1da54b7062d6b544e7e36b90736350f6fba01228c41c72099509f5701en), false),
|
|
7
|
-
new Point(new Fr(0x0edb1e293c3ce91bfc04e3ceaa50d2c541fa9d091c72eb403efb1cfa2cb3357fn), new Fr(0x1341d675fa030ece3113ad53ca34fd13b19b6e9762046734f414824c4d6ade35n), false),
|
|
8
|
-
new Point(new Fr(0x0e0dad2250583f2a9f0acb04ededf1701b85b0393cae753fe7e14b88af81cb52n), new Fr(0x0973b02c5caac339ee4ad5dab51329920f7bf1b6a07e1dabe5df67040b300962n), false),
|
|
9
|
-
new Point(new Fr(0x2f3342e900e8c488a28931aae68970738fdc68afde2910de7b320c00c902087dn), new Fr(0x1bf958dc63cb09d59230603a0269ae86d6f92494da244910351f1132df20fc08n), false),
|
|
10
|
-
];
|
|
11
|
-
const G_SLOT = new Point(new Fr(0x041223147b680850dc82e8a55a952d4df20256fe0593d949a9541ca00f0abf15n), new Fr(0x0a8c72e60d0e60f5d804549d48f3044d06140b98ed717a9b532af630c1530791n), false);
|
|
12
|
-
/**
|
|
13
|
-
* Computes a note hiding point as is done by the default implementation injected by macros.
|
|
14
|
-
* @param storageSlot - The slot to which the note was inserted.
|
|
15
|
-
* @param noteContent - The note content (e.g. note.items).
|
|
16
|
-
* @returns A note hash.
|
|
17
|
-
*/
|
|
18
|
-
export function computeNoteHash(storageSlot, noteContent) {
|
|
19
|
-
const grumpkin = new Grumpkin();
|
|
20
|
-
const noteHidingPointBeforeSlotting = noteContent
|
|
21
|
-
.slice(1)
|
|
22
|
-
.reduce((acc, item, i) => grumpkin.add(acc, grumpkin.mul(GENERATORS[i + 1], new Fq(item.toBigInt()))), grumpkin.mul(GENERATORS[0], new Fq(noteContent[0].toBigInt())));
|
|
23
|
-
const slotPoint = grumpkin.mul(G_SLOT, new Fq(storageSlot.toBigInt()));
|
|
24
|
-
const noteHidingPoint = grumpkin.add(noteHidingPointBeforeSlotting, slotPoint);
|
|
25
|
-
return noteHidingPoint.x;
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdF91dGlscy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbGllbnQvdGVzdF91dGlscy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLEVBQUUsRUFBRSxLQUFLLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUNuRCxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFM0Qsb0VBQW9FO0FBQ3BFLE1BQU0sVUFBVSxHQUFHO0lBQ2pCLElBQUksS0FBSyxDQUNQLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLEtBQUssQ0FDTjtJQUNELElBQUksS0FBSyxDQUNQLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLEtBQUssQ0FDTjtJQUNELElBQUksS0FBSyxDQUNQLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLEtBQUssQ0FDTjtJQUNELElBQUksS0FBSyxDQUNQLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLEtBQUssQ0FDTjtJQUNELElBQUksS0FBSyxDQUNQLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLElBQUksRUFBRSxDQUFDLG1FQUFtRSxDQUFDLEVBQzNFLEtBQUssQ0FDTjtDQUNGLENBQUM7QUFFRixNQUFNLE1BQU0sR0FBRyxJQUFJLEtBQUssQ0FDdEIsSUFBSSxFQUFFLENBQUMsbUVBQW1FLENBQUMsRUFDM0UsSUFBSSxFQUFFLENBQUMsbUVBQW1FLENBQUMsRUFDM0UsS0FBSyxDQUNOLENBQUM7QUFFRjs7Ozs7R0FLRztBQUNILE1BQU0sVUFBVSxlQUFlLENBQUMsV0FBZSxFQUFFLFdBQWlCO0lBQ2hFLE1BQU0sUUFBUSxHQUFHLElBQUksUUFBUSxFQUFFLENBQUM7SUFDaEMsTUFBTSw2QkFBNkIsR0FBRyxXQUFXO1NBQzlDLEtBQUssQ0FBQyxDQUFDLENBQUM7U0FDUixNQUFNLENBQ0wsQ0FBQyxHQUFHLEVBQUUsSUFBSSxFQUFFLENBQUMsRUFBRSxFQUFFLENBQUMsUUFBUSxDQUFDLEdBQUcsQ0FBQyxHQUFHLEVBQUUsUUFBUSxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQyxHQUFHLENBQUMsQ0FBQyxFQUFFLElBQUksRUFBRSxDQUFDLElBQUksQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDLENBQUMsRUFDN0YsUUFBUSxDQUFDLEdBQUcsQ0FBQyxVQUFVLENBQUMsQ0FBQyxDQUFDLEVBQUUsSUFBSSxFQUFFLENBQUMsV0FBVyxDQUFDLENBQUMsQ0FBQyxDQUFDLFFBQVEsRUFBRSxDQUFDLENBQUMsQ0FDL0QsQ0FBQztJQUVKLE1BQU0sU0FBUyxHQUFHLFFBQVEsQ0FBQyxHQUFHLENBQUMsTUFBTSxFQUFFLElBQUksRUFBRSxDQUFDLFdBQVcsQ0FBQyxRQUFRLEVBQUUsQ0FBQyxDQUFDLENBQUM7SUFDdkUsTUFBTSxlQUFlLEdBQUcsUUFBUSxDQUFDLEdBQUcsQ0FBQyw2QkFBNkIsRUFBRSxTQUFTLENBQUMsQ0FBQztJQUMvRSxPQUFPLGVBQWUsQ0FBQyxDQUFDLENBQUM7QUFDM0IsQ0FBQyJ9
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Keep track of the number of side effects across execution contexts.
|
|
3
|
-
*/
|
|
4
|
-
export declare class SideEffectCounter {
|
|
5
|
-
private value;
|
|
6
|
-
constructor(value?: number);
|
|
7
|
-
current(): number;
|
|
8
|
-
count(): number;
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=side_effect_counter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"side_effect_counter.d.ts","sourceRoot":"","sources":["../../src/common/side_effect_counter.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,qBAAa,iBAAiB;IAChB,OAAO,CAAC,KAAK;gBAAL,KAAK,SAAI;IAG7B,OAAO;IAIP,KAAK;CAKN"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Keep track of the number of side effects across execution contexts.
|
|
3
|
-
*/
|
|
4
|
-
export class SideEffectCounter {
|
|
5
|
-
constructor(value = 0) {
|
|
6
|
-
this.value = value;
|
|
7
|
-
}
|
|
8
|
-
// TODO(alexg) remove this once public side effect counters is fully accounted for on Noir side
|
|
9
|
-
current() {
|
|
10
|
-
return this.value;
|
|
11
|
-
}
|
|
12
|
-
count() {
|
|
13
|
-
const value = this.value;
|
|
14
|
-
this.value++;
|
|
15
|
-
return value;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2lkZV9lZmZlY3RfY291bnRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tb24vc2lkZV9lZmZlY3RfY291bnRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUNILE1BQU0sT0FBTyxpQkFBaUI7SUFDNUIsWUFBb0IsUUFBUSxDQUFDO1FBQVQsVUFBSyxHQUFMLEtBQUssQ0FBSTtJQUFHLENBQUM7SUFFakMsK0ZBQStGO0lBQy9GLE9BQU87UUFDTCxPQUFPLElBQUksQ0FBQyxLQUFLLENBQUM7SUFDcEIsQ0FBQztJQUVELEtBQUs7UUFDSCxNQUFNLEtBQUssR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDO1FBQ3pCLElBQUksQ0FBQyxLQUFLLEVBQUUsQ0FBQztRQUNiLE9BQU8sS0FBSyxDQUFDO0lBQ2YsQ0FBQztDQUNGIn0=
|
package/dest/rollup/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rollup/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/dest/rollup/index.js
DELETED