@aztec/stdlib 0.87.4 → 0.87.6
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/abi/decoder.d.ts +1 -1
- package/dest/abi/decoder.d.ts.map +1 -1
- package/dest/abi/decoder.js +4 -3
- package/dest/tx/profiling.d.ts +213 -4
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +58 -29
- package/dest/tx/proven_tx.d.ts +3 -3
- package/dest/tx/proven_tx.d.ts.map +1 -1
- package/dest/tx/proven_tx.js +3 -3
- package/dest/tx/simulated_tx.d.ts +4 -4
- package/dest/tx/simulated_tx.d.ts.map +1 -1
- package/dest/tx/simulated_tx.js +8 -8
- package/package.json +7 -7
- package/src/abi/decoder.ts +5 -4
- package/src/tx/profiling.ts +58 -27
- package/src/tx/proven_tx.ts +2 -2
- package/src/tx/simulated_tx.ts +6 -6
package/dest/abi/decoder.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { ABIParameter, AbiType } from './abi.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* The type of our decoded ABI.
|
|
6
6
|
*/
|
|
7
|
-
export type AbiDecoded = bigint | boolean | AztecAddress | AbiDecoded[] | {
|
|
7
|
+
export type AbiDecoded = bigint | boolean | string | AztecAddress | AbiDecoded[] | {
|
|
8
8
|
[key: string]: AbiDecoded;
|
|
9
9
|
};
|
|
10
10
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/abi/decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAe,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,UAAU,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"decoder.d.ts","sourceRoot":"","sources":["../../src/abi/decoder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAe,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAAA;CAAE,CAAC;AAkGjH;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,cAEzD;AAED;;GAEG;AACH,qBAAa,wBAAwB;IAGjC,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,YAAY;IAJtB,OAAO,CAAC,SAAS,CAAS;gBAEhB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,YAAY,EAAE,EAC1B,YAAY,UAAQ;IAK9B;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAsBxB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAKvB;;;OAGG;IACI,MAAM,IAAI,MAAM;CAGxB;AAED;;;;;GAKG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,UAE/E;AAED;;;;;GAKG;AACH,wBAAgB,yCAAyC,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY,EAAE,UAEjG"}
|
package/dest/abi/decoder.js
CHANGED
|
@@ -49,11 +49,12 @@ import { isAztecAddressStruct, parseSignedInt } from './utils.js';
|
|
|
49
49
|
}
|
|
50
50
|
case 'string':
|
|
51
51
|
{
|
|
52
|
-
|
|
52
|
+
let str = '';
|
|
53
53
|
for(let i = 0; i < abiType.length; i += 1){
|
|
54
|
-
|
|
54
|
+
const charCode = Number(this.getNextField().toBigInt());
|
|
55
|
+
str += String.fromCharCode(charCode);
|
|
55
56
|
}
|
|
56
|
-
return
|
|
57
|
+
return str;
|
|
57
58
|
}
|
|
58
59
|
case 'tuple':
|
|
59
60
|
{
|
package/dest/tx/profiling.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { type ZodFor } from '@aztec/foundation/schemas';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import type { AbiDecoded } from '../abi/decoder.js';
|
|
4
|
+
import type { AztecNode } from '../interfaces/aztec-node.js';
|
|
4
5
|
import { type PrivateExecutionStep } from '../kernel/private_kernel_prover_output.js';
|
|
6
|
+
export type NodeStats = Partial<Record<keyof AztecNode, {
|
|
7
|
+
times: number[];
|
|
8
|
+
}>>;
|
|
5
9
|
type FunctionTiming = {
|
|
6
10
|
functionName: string;
|
|
7
11
|
time: number;
|
|
@@ -69,6 +73,106 @@ export declare const ProvingTimingsSchema: z.ZodObject<{
|
|
|
69
73
|
sync?: number | undefined;
|
|
70
74
|
proving?: number | undefined;
|
|
71
75
|
}>;
|
|
76
|
+
export interface ProvingStats {
|
|
77
|
+
timings: ProvingTimings;
|
|
78
|
+
nodeRPCCalls?: NodeStats;
|
|
79
|
+
}
|
|
80
|
+
export declare const ProvingStatsSchema: z.ZodObject<{
|
|
81
|
+
timings: z.ZodObject<{
|
|
82
|
+
sync: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodNumber>;
|
|
83
|
+
proving: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodNumber>;
|
|
84
|
+
perFunction: z.ZodArray<z.ZodObject<{
|
|
85
|
+
functionName: z.ZodString;
|
|
86
|
+
time: z.ZodNumber;
|
|
87
|
+
oracles: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
88
|
+
times: z.ZodArray<z.ZodNumber, "many">;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
times: number[];
|
|
91
|
+
}, {
|
|
92
|
+
times: number[];
|
|
93
|
+
}>>>;
|
|
94
|
+
}, "strip", z.ZodTypeAny, {
|
|
95
|
+
functionName: string;
|
|
96
|
+
time: number;
|
|
97
|
+
oracles?: Record<string, {
|
|
98
|
+
times: number[];
|
|
99
|
+
}> | undefined;
|
|
100
|
+
}, {
|
|
101
|
+
functionName: string;
|
|
102
|
+
time: number;
|
|
103
|
+
oracles?: Record<string, {
|
|
104
|
+
times: number[];
|
|
105
|
+
}> | undefined;
|
|
106
|
+
}>, "many">;
|
|
107
|
+
unaccounted: z.ZodNumber;
|
|
108
|
+
total: z.ZodNumber;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
perFunction: {
|
|
111
|
+
functionName: string;
|
|
112
|
+
time: number;
|
|
113
|
+
oracles?: Record<string, {
|
|
114
|
+
times: number[];
|
|
115
|
+
}> | undefined;
|
|
116
|
+
}[];
|
|
117
|
+
unaccounted: number;
|
|
118
|
+
total: number;
|
|
119
|
+
sync?: number | undefined;
|
|
120
|
+
proving?: number | undefined;
|
|
121
|
+
}, {
|
|
122
|
+
perFunction: {
|
|
123
|
+
functionName: string;
|
|
124
|
+
time: number;
|
|
125
|
+
oracles?: Record<string, {
|
|
126
|
+
times: number[];
|
|
127
|
+
}> | undefined;
|
|
128
|
+
}[];
|
|
129
|
+
unaccounted: number;
|
|
130
|
+
total: number;
|
|
131
|
+
sync?: number | undefined;
|
|
132
|
+
proving?: number | undefined;
|
|
133
|
+
}>;
|
|
134
|
+
nodeRPCCalls: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
135
|
+
times: z.ZodArray<z.ZodNumber, "many">;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
times: number[];
|
|
138
|
+
}, {
|
|
139
|
+
times: number[];
|
|
140
|
+
}>>>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
timings: {
|
|
143
|
+
perFunction: {
|
|
144
|
+
functionName: string;
|
|
145
|
+
time: number;
|
|
146
|
+
oracles?: Record<string, {
|
|
147
|
+
times: number[];
|
|
148
|
+
}> | undefined;
|
|
149
|
+
}[];
|
|
150
|
+
unaccounted: number;
|
|
151
|
+
total: number;
|
|
152
|
+
sync?: number | undefined;
|
|
153
|
+
proving?: number | undefined;
|
|
154
|
+
};
|
|
155
|
+
nodeRPCCalls?: Record<string, {
|
|
156
|
+
times: number[];
|
|
157
|
+
}> | undefined;
|
|
158
|
+
}, {
|
|
159
|
+
timings: {
|
|
160
|
+
perFunction: {
|
|
161
|
+
functionName: string;
|
|
162
|
+
time: number;
|
|
163
|
+
oracles?: Record<string, {
|
|
164
|
+
times: number[];
|
|
165
|
+
}> | undefined;
|
|
166
|
+
}[];
|
|
167
|
+
unaccounted: number;
|
|
168
|
+
total: number;
|
|
169
|
+
sync?: number | undefined;
|
|
170
|
+
proving?: number | undefined;
|
|
171
|
+
};
|
|
172
|
+
nodeRPCCalls?: Record<string, {
|
|
173
|
+
times: number[];
|
|
174
|
+
}> | undefined;
|
|
175
|
+
}>;
|
|
72
176
|
export interface SimulationTimings {
|
|
73
177
|
sync: number;
|
|
74
178
|
publicSimulation?: number;
|
|
@@ -133,17 +237,122 @@ export declare const SimulationTimingsSchema: z.ZodObject<{
|
|
|
133
237
|
validation?: number | undefined;
|
|
134
238
|
publicSimulation?: number | undefined;
|
|
135
239
|
}>;
|
|
240
|
+
export interface SimulationStats {
|
|
241
|
+
timings: SimulationTimings;
|
|
242
|
+
nodeRPCCalls: NodeStats;
|
|
243
|
+
}
|
|
244
|
+
export declare const SimulationStatsSchema: z.ZodObject<{
|
|
245
|
+
timings: z.ZodObject<{
|
|
246
|
+
sync: z.ZodNumber;
|
|
247
|
+
publicSimulation: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodNumber>;
|
|
248
|
+
validation: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodNumber>;
|
|
249
|
+
perFunction: z.ZodArray<z.ZodObject<{
|
|
250
|
+
functionName: z.ZodString;
|
|
251
|
+
time: z.ZodNumber;
|
|
252
|
+
oracles: import("@aztec/foundation/schemas").ZodNullableOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
253
|
+
times: z.ZodArray<z.ZodNumber, "many">;
|
|
254
|
+
}, "strip", z.ZodTypeAny, {
|
|
255
|
+
times: number[];
|
|
256
|
+
}, {
|
|
257
|
+
times: number[];
|
|
258
|
+
}>>>;
|
|
259
|
+
}, "strip", z.ZodTypeAny, {
|
|
260
|
+
functionName: string;
|
|
261
|
+
time: number;
|
|
262
|
+
oracles?: Record<string, {
|
|
263
|
+
times: number[];
|
|
264
|
+
}> | undefined;
|
|
265
|
+
}, {
|
|
266
|
+
functionName: string;
|
|
267
|
+
time: number;
|
|
268
|
+
oracles?: Record<string, {
|
|
269
|
+
times: number[];
|
|
270
|
+
}> | undefined;
|
|
271
|
+
}>, "many">;
|
|
272
|
+
unaccounted: z.ZodNumber;
|
|
273
|
+
total: z.ZodNumber;
|
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
|
275
|
+
sync: number;
|
|
276
|
+
perFunction: {
|
|
277
|
+
functionName: string;
|
|
278
|
+
time: number;
|
|
279
|
+
oracles?: Record<string, {
|
|
280
|
+
times: number[];
|
|
281
|
+
}> | undefined;
|
|
282
|
+
}[];
|
|
283
|
+
unaccounted: number;
|
|
284
|
+
total: number;
|
|
285
|
+
validation?: number | undefined;
|
|
286
|
+
publicSimulation?: number | undefined;
|
|
287
|
+
}, {
|
|
288
|
+
sync: number;
|
|
289
|
+
perFunction: {
|
|
290
|
+
functionName: string;
|
|
291
|
+
time: number;
|
|
292
|
+
oracles?: Record<string, {
|
|
293
|
+
times: number[];
|
|
294
|
+
}> | undefined;
|
|
295
|
+
}[];
|
|
296
|
+
unaccounted: number;
|
|
297
|
+
total: number;
|
|
298
|
+
validation?: number | undefined;
|
|
299
|
+
publicSimulation?: number | undefined;
|
|
300
|
+
}>;
|
|
301
|
+
nodeRPCCalls: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
302
|
+
times: z.ZodArray<z.ZodNumber, "many">;
|
|
303
|
+
}, "strip", z.ZodTypeAny, {
|
|
304
|
+
times: number[];
|
|
305
|
+
}, {
|
|
306
|
+
times: number[];
|
|
307
|
+
}>>;
|
|
308
|
+
}, "strip", z.ZodTypeAny, {
|
|
309
|
+
timings: {
|
|
310
|
+
sync: number;
|
|
311
|
+
perFunction: {
|
|
312
|
+
functionName: string;
|
|
313
|
+
time: number;
|
|
314
|
+
oracles?: Record<string, {
|
|
315
|
+
times: number[];
|
|
316
|
+
}> | undefined;
|
|
317
|
+
}[];
|
|
318
|
+
unaccounted: number;
|
|
319
|
+
total: number;
|
|
320
|
+
validation?: number | undefined;
|
|
321
|
+
publicSimulation?: number | undefined;
|
|
322
|
+
};
|
|
323
|
+
nodeRPCCalls: Record<string, {
|
|
324
|
+
times: number[];
|
|
325
|
+
}>;
|
|
326
|
+
}, {
|
|
327
|
+
timings: {
|
|
328
|
+
sync: number;
|
|
329
|
+
perFunction: {
|
|
330
|
+
functionName: string;
|
|
331
|
+
time: number;
|
|
332
|
+
oracles?: Record<string, {
|
|
333
|
+
times: number[];
|
|
334
|
+
}> | undefined;
|
|
335
|
+
}[];
|
|
336
|
+
unaccounted: number;
|
|
337
|
+
total: number;
|
|
338
|
+
validation?: number | undefined;
|
|
339
|
+
publicSimulation?: number | undefined;
|
|
340
|
+
};
|
|
341
|
+
nodeRPCCalls: Record<string, {
|
|
342
|
+
times: number[];
|
|
343
|
+
}>;
|
|
344
|
+
}>;
|
|
136
345
|
export declare class TxProfileResult {
|
|
137
346
|
executionSteps: PrivateExecutionStep[];
|
|
138
|
-
|
|
139
|
-
constructor(executionSteps: PrivateExecutionStep[],
|
|
347
|
+
stats: ProvingStats;
|
|
348
|
+
constructor(executionSteps: PrivateExecutionStep[], stats: ProvingStats);
|
|
140
349
|
static get schema(): ZodFor<TxProfileResult>;
|
|
141
350
|
static random(): TxProfileResult;
|
|
142
351
|
}
|
|
143
352
|
export declare class UtilitySimulationResult {
|
|
144
353
|
result: AbiDecoded;
|
|
145
|
-
|
|
146
|
-
constructor(result: AbiDecoded,
|
|
354
|
+
stats?: SimulationStats | undefined;
|
|
355
|
+
constructor(result: AbiDecoded, stats?: SimulationStats | undefined);
|
|
147
356
|
static get schema(): ZodFor<UtilitySimulationResult>;
|
|
148
357
|
static random(): UtilitySimulationResult;
|
|
149
358
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiling.d.ts","sourceRoot":"","sources":["../../src/tx/profiling.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,MAAM,EAAY,MAAM,2BAA2B,CAAC;AAElE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,oBAAoB,EAA8B,MAAM,2CAA2C,CAAC;AAGlH,KAAK,cAAc,GAAG;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAC/C,CAAC;AAQF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,cAAc,EAAE,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;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AM,CAAC,eAAe,CAAC,CAO3C;IAED,MAAM,CAAC,MAAM,IAAI,eAAe;CA+BjC;AAED,qBAAa,uBAAuB;IAEzB,MAAM,EAAE,UAAU;IAClB,KAAK,CAAC,EAAE,eAAe;gBADvB,MAAM,EAAE,UAAU,EAClB,KAAK,CAAC,EAAE,eAAe,YAAA;IAGhC,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,uBAAuB,CAAC,CAOnD;IAED,MAAM,CAAC,MAAM,IAAI,uBAAuB;CAkBzC"}
|
package/dest/tx/profiling.js
CHANGED
|
@@ -3,6 +3,9 @@ import { optional } from '@aztec/foundation/schemas';
|
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
import { PrivateExecutionStepSchema } from '../kernel/private_kernel_prover_output.js';
|
|
5
5
|
import { AbiDecodedSchema } from '../schemas/schemas.js';
|
|
6
|
+
const NodeStatsSchema = z.record(z.string(), z.object({
|
|
7
|
+
times: z.array(z.number())
|
|
8
|
+
}));
|
|
6
9
|
const FunctionTimingSchema = z.object({
|
|
7
10
|
functionName: z.string(),
|
|
8
11
|
time: z.number(),
|
|
@@ -17,6 +20,10 @@ export const ProvingTimingsSchema = z.object({
|
|
|
17
20
|
unaccounted: z.number(),
|
|
18
21
|
total: z.number()
|
|
19
22
|
});
|
|
23
|
+
export const ProvingStatsSchema = z.object({
|
|
24
|
+
timings: ProvingTimingsSchema,
|
|
25
|
+
nodeRPCCalls: optional(NodeStatsSchema)
|
|
26
|
+
});
|
|
20
27
|
export const SimulationTimingsSchema = z.object({
|
|
21
28
|
sync: z.number(),
|
|
22
29
|
publicSimulation: optional(z.number()),
|
|
@@ -25,18 +32,22 @@ export const SimulationTimingsSchema = z.object({
|
|
|
25
32
|
unaccounted: z.number(),
|
|
26
33
|
total: z.number()
|
|
27
34
|
});
|
|
35
|
+
export const SimulationStatsSchema = z.object({
|
|
36
|
+
timings: SimulationTimingsSchema,
|
|
37
|
+
nodeRPCCalls: NodeStatsSchema
|
|
38
|
+
});
|
|
28
39
|
export class TxProfileResult {
|
|
29
40
|
executionSteps;
|
|
30
|
-
|
|
31
|
-
constructor(executionSteps,
|
|
41
|
+
stats;
|
|
42
|
+
constructor(executionSteps, stats){
|
|
32
43
|
this.executionSteps = executionSteps;
|
|
33
|
-
this.
|
|
44
|
+
this.stats = stats;
|
|
34
45
|
}
|
|
35
46
|
static get schema() {
|
|
36
47
|
return z.object({
|
|
37
48
|
executionSteps: z.array(PrivateExecutionStepSchema),
|
|
38
|
-
|
|
39
|
-
}).transform(({ executionSteps,
|
|
49
|
+
stats: ProvingStatsSchema
|
|
50
|
+
}).transform(({ executionSteps, stats })=>new TxProfileResult(executionSteps, stats));
|
|
40
51
|
}
|
|
41
52
|
static random() {
|
|
42
53
|
return new TxProfileResult([
|
|
@@ -56,45 +67,63 @@ export class TxProfileResult {
|
|
|
56
67
|
}
|
|
57
68
|
}
|
|
58
69
|
], {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
time: 1
|
|
70
|
+
nodeRPCCalls: {
|
|
71
|
+
getBlockHeader: {
|
|
72
|
+
times: [
|
|
73
|
+
1
|
|
74
|
+
]
|
|
65
75
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
76
|
+
},
|
|
77
|
+
timings: {
|
|
78
|
+
sync: 1,
|
|
79
|
+
proving: 1,
|
|
80
|
+
perFunction: [
|
|
81
|
+
{
|
|
82
|
+
functionName: 'random',
|
|
83
|
+
time: 1
|
|
84
|
+
}
|
|
85
|
+
],
|
|
86
|
+
unaccounted: 1,
|
|
87
|
+
total: 4
|
|
88
|
+
}
|
|
69
89
|
});
|
|
70
90
|
}
|
|
71
91
|
}
|
|
72
92
|
export class UtilitySimulationResult {
|
|
73
93
|
result;
|
|
74
|
-
|
|
75
|
-
constructor(result,
|
|
94
|
+
stats;
|
|
95
|
+
constructor(result, stats){
|
|
76
96
|
this.result = result;
|
|
77
|
-
this.
|
|
97
|
+
this.stats = stats;
|
|
78
98
|
}
|
|
79
99
|
static get schema() {
|
|
80
100
|
return z.object({
|
|
81
101
|
result: AbiDecodedSchema,
|
|
82
|
-
|
|
83
|
-
}).transform(({ result,
|
|
102
|
+
stats: optional(SimulationStatsSchema)
|
|
103
|
+
}).transform(({ result, stats })=>new UtilitySimulationResult(result, stats));
|
|
84
104
|
}
|
|
85
105
|
static random() {
|
|
86
106
|
return new UtilitySimulationResult(Fr.random().toBigInt(), {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
functionName: 'random',
|
|
93
|
-
time: 1
|
|
107
|
+
nodeRPCCalls: {
|
|
108
|
+
getBlockHeader: {
|
|
109
|
+
times: [
|
|
110
|
+
1
|
|
111
|
+
]
|
|
94
112
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
113
|
+
},
|
|
114
|
+
timings: {
|
|
115
|
+
sync: 1,
|
|
116
|
+
publicSimulation: 1,
|
|
117
|
+
validation: 1,
|
|
118
|
+
perFunction: [
|
|
119
|
+
{
|
|
120
|
+
functionName: 'random',
|
|
121
|
+
time: 1
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
unaccounted: 1,
|
|
125
|
+
total: 5
|
|
126
|
+
}
|
|
98
127
|
});
|
|
99
128
|
}
|
|
100
129
|
}
|
package/dest/tx/proven_tx.d.ts
CHANGED
|
@@ -3,14 +3,14 @@ import { z } from 'zod';
|
|
|
3
3
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
4
4
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
5
5
|
import { PrivateExecutionResult } from './private_execution_result.js';
|
|
6
|
-
import { type
|
|
6
|
+
import { type ProvingStats } from './profiling.js';
|
|
7
7
|
import { Tx } from './tx.js';
|
|
8
8
|
export declare class TxProvingResult {
|
|
9
9
|
privateExecutionResult: PrivateExecutionResult;
|
|
10
10
|
publicInputs: PrivateKernelTailCircuitPublicInputs;
|
|
11
11
|
clientIvcProof: ClientIvcProof;
|
|
12
|
-
|
|
13
|
-
constructor(privateExecutionResult: PrivateExecutionResult, publicInputs: PrivateKernelTailCircuitPublicInputs, clientIvcProof: ClientIvcProof,
|
|
12
|
+
stats?: ProvingStats | undefined;
|
|
13
|
+
constructor(privateExecutionResult: PrivateExecutionResult, publicInputs: PrivateKernelTailCircuitPublicInputs, clientIvcProof: ClientIvcProof, stats?: ProvingStats | undefined);
|
|
14
14
|
toTx(): Tx;
|
|
15
15
|
static get schema(): z.ZodEffects<z.ZodObject<{
|
|
16
16
|
privateExecutionResult: import("@aztec/foundation/schemas").ZodFor<PrivateExecutionResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proven_tx.d.ts","sourceRoot":"","sources":["../../src/tx/proven_tx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oCAAoC,EAAE,MAAM,wDAAwD,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAkC,MAAM,+BAA+B,CAAC;AACvG,OAAO,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"proven_tx.d.ts","sourceRoot":"","sources":["../../src/tx/proven_tx.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,oCAAoC,EAAE,MAAM,wDAAwD,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAkC,MAAM,+BAA+B,CAAC;AACvG,OAAO,EAAE,KAAK,YAAY,EAAwB,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qBAAa,eAAe;IAEjB,sBAAsB,EAAE,sBAAsB;IAC9C,YAAY,EAAE,oCAAoC;IAClD,cAAc,EAAE,cAAc;IAC9B,KAAK,CAAC,EAAE,YAAY;gBAHpB,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,oCAAoC,EAClD,cAAc,EAAE,cAAc,EAC9B,KAAK,CAAC,EAAE,YAAY,YAAA;IAG7B,IAAI,IAAI,EAAE;IAYV,MAAM,KAAK,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAShB;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,eAAe,CAAC;WAIhC,MAAM;CAOpB"}
|
package/dest/tx/proven_tx.js
CHANGED
|
@@ -9,12 +9,12 @@ export class TxProvingResult {
|
|
|
9
9
|
privateExecutionResult;
|
|
10
10
|
publicInputs;
|
|
11
11
|
clientIvcProof;
|
|
12
|
-
|
|
13
|
-
constructor(privateExecutionResult, publicInputs, clientIvcProof,
|
|
12
|
+
stats;
|
|
13
|
+
constructor(privateExecutionResult, publicInputs, clientIvcProof, stats){
|
|
14
14
|
this.privateExecutionResult = privateExecutionResult;
|
|
15
15
|
this.publicInputs = publicInputs;
|
|
16
16
|
this.clientIvcProof = clientIvcProof;
|
|
17
|
-
this.
|
|
17
|
+
this.stats = stats;
|
|
18
18
|
}
|
|
19
19
|
toTx() {
|
|
20
20
|
const contractClassLogs = collectSortedContractClassLogs(this.privateExecutionResult);
|
|
@@ -3,7 +3,7 @@ import type { FieldsOf } from '@aztec/foundation/types';
|
|
|
3
3
|
import type { GasUsed } from '../gas/gas_used.js';
|
|
4
4
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
5
5
|
import { PrivateExecutionResult } from './private_execution_result.js';
|
|
6
|
-
import { type
|
|
6
|
+
import { type SimulationStats } from './profiling.js';
|
|
7
7
|
import { NestedProcessReturnValues, PublicSimulationOutput } from './public_simulation_output.js';
|
|
8
8
|
import { Tx } from './tx.js';
|
|
9
9
|
export declare class PrivateSimulationResult {
|
|
@@ -17,12 +17,12 @@ export declare class TxSimulationResult {
|
|
|
17
17
|
privateExecutionResult: PrivateExecutionResult;
|
|
18
18
|
publicInputs: PrivateKernelTailCircuitPublicInputs;
|
|
19
19
|
publicOutput?: PublicSimulationOutput | undefined;
|
|
20
|
-
|
|
21
|
-
constructor(privateExecutionResult: PrivateExecutionResult, publicInputs: PrivateKernelTailCircuitPublicInputs, publicOutput?: PublicSimulationOutput | undefined,
|
|
20
|
+
stats?: SimulationStats | undefined;
|
|
21
|
+
constructor(privateExecutionResult: PrivateExecutionResult, publicInputs: PrivateKernelTailCircuitPublicInputs, publicOutput?: PublicSimulationOutput | undefined, stats?: SimulationStats | undefined);
|
|
22
22
|
get gasUsed(): GasUsed;
|
|
23
23
|
static get schema(): ZodFor<TxSimulationResult>;
|
|
24
24
|
static from(fields: Omit<FieldsOf<TxSimulationResult>, 'gasUsed'>): TxSimulationResult;
|
|
25
|
-
static fromPrivateSimulationResultAndPublicOutput(privateSimulationResult: PrivateSimulationResult, publicOutput?: PublicSimulationOutput,
|
|
25
|
+
static fromPrivateSimulationResultAndPublicOutput(privateSimulationResult: PrivateSimulationResult, publicOutput?: PublicSimulationOutput, stats?: SimulationStats): TxSimulationResult;
|
|
26
26
|
static random(): Promise<TxSimulationResult>;
|
|
27
27
|
getPrivateReturnValues(): NestedProcessReturnValues;
|
|
28
28
|
toSimulatedTx(): Tx;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulated_tx.d.ts","sourceRoot":"","sources":["../../src/tx/simulated_tx.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,M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,sBAAsB,YAAA,EACrC,KAAK,CAAC,EAAE,eAAe,YAAA;IAGhC,IAAI,OAAO,IAAI,OAAO,CASrB;IAED,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,kBAAkB,CAAC,CAS9C;IAED,MAAM,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,EAAE,SAAS,CAAC;IASjE,MAAM,CAAC,0CAA0C,CAC/C,uBAAuB,EAAE,uBAAuB,EAChD,YAAY,CAAC,EAAE,sBAAsB,EACrC,KAAK,CAAC,EAAE,eAAe;WAUZ,MAAM;IAQnB,sBAAsB;IAItB,aAAa,IAAI,EAAE;IAInB,qBAAqB;CAGtB;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,eAAe,EAAE,sBAAsB,GAAG,yBAAyB,CAWhH"}
|
package/dest/tx/simulated_tx.js
CHANGED
|
@@ -4,7 +4,7 @@ import { Gas } from '../gas/gas.js';
|
|
|
4
4
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
5
5
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
6
6
|
import { PrivateExecutionResult, collectSortedContractClassLogs } from './private_execution_result.js';
|
|
7
|
-
import {
|
|
7
|
+
import { SimulationStatsSchema } from './profiling.js';
|
|
8
8
|
import { NestedProcessReturnValues, PublicSimulationOutput } from './public_simulation_output.js';
|
|
9
9
|
import { Tx } from './tx.js';
|
|
10
10
|
export class PrivateSimulationResult {
|
|
@@ -27,12 +27,12 @@ export class TxSimulationResult {
|
|
|
27
27
|
privateExecutionResult;
|
|
28
28
|
publicInputs;
|
|
29
29
|
publicOutput;
|
|
30
|
-
|
|
31
|
-
constructor(privateExecutionResult, publicInputs, publicOutput,
|
|
30
|
+
stats;
|
|
31
|
+
constructor(privateExecutionResult, publicInputs, publicOutput, stats){
|
|
32
32
|
this.privateExecutionResult = privateExecutionResult;
|
|
33
33
|
this.publicInputs = publicInputs;
|
|
34
34
|
this.publicOutput = publicOutput;
|
|
35
|
-
this.
|
|
35
|
+
this.stats = stats;
|
|
36
36
|
}
|
|
37
37
|
get gasUsed() {
|
|
38
38
|
return this.publicOutput?.gasUsed ?? {
|
|
@@ -47,14 +47,14 @@ export class TxSimulationResult {
|
|
|
47
47
|
privateExecutionResult: PrivateExecutionResult.schema,
|
|
48
48
|
publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
|
|
49
49
|
publicOutput: PublicSimulationOutput.schema.optional(),
|
|
50
|
-
|
|
50
|
+
stats: optional(SimulationStatsSchema)
|
|
51
51
|
}).transform(TxSimulationResult.from);
|
|
52
52
|
}
|
|
53
53
|
static from(fields) {
|
|
54
|
-
return new TxSimulationResult(fields.privateExecutionResult, fields.publicInputs, fields.publicOutput, fields.
|
|
54
|
+
return new TxSimulationResult(fields.privateExecutionResult, fields.publicInputs, fields.publicOutput, fields.stats);
|
|
55
55
|
}
|
|
56
|
-
static fromPrivateSimulationResultAndPublicOutput(privateSimulationResult, publicOutput,
|
|
57
|
-
return new TxSimulationResult(privateSimulationResult.privateExecutionResult, privateSimulationResult.publicInputs, publicOutput,
|
|
56
|
+
static fromPrivateSimulationResultAndPublicOutput(privateSimulationResult, publicOutput, stats) {
|
|
57
|
+
return new TxSimulationResult(privateSimulationResult.privateExecutionResult, privateSimulationResult.publicInputs, publicOutput, stats);
|
|
58
58
|
}
|
|
59
59
|
static async random() {
|
|
60
60
|
return new TxSimulationResult(await PrivateExecutionResult.random(), PrivateKernelTailCircuitPublicInputs.empty(), await PublicSimulationOutput.random());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.87.
|
|
3
|
+
"version": "0.87.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -67,12 +67,12 @@
|
|
|
67
67
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@aztec/bb.js": "0.87.
|
|
71
|
-
"@aztec/blob-lib": "0.87.
|
|
72
|
-
"@aztec/constants": "0.87.
|
|
73
|
-
"@aztec/ethereum": "0.87.
|
|
74
|
-
"@aztec/foundation": "0.87.
|
|
75
|
-
"@aztec/noir-noirc_abi": "0.87.
|
|
70
|
+
"@aztec/bb.js": "0.87.6",
|
|
71
|
+
"@aztec/blob-lib": "0.87.6",
|
|
72
|
+
"@aztec/constants": "0.87.6",
|
|
73
|
+
"@aztec/ethereum": "0.87.6",
|
|
74
|
+
"@aztec/foundation": "0.87.6",
|
|
75
|
+
"@aztec/noir-noirc_abi": "0.87.6",
|
|
76
76
|
"@google-cloud/storage": "^7.15.0",
|
|
77
77
|
"axios": "^1.9.0",
|
|
78
78
|
"json-stringify-deterministic": "1.0.12",
|
package/src/abi/decoder.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { isAztecAddressStruct, parseSignedInt } from './utils.js';
|
|
|
7
7
|
/**
|
|
8
8
|
* The type of our decoded ABI.
|
|
9
9
|
*/
|
|
10
|
-
export type AbiDecoded = bigint | boolean | AztecAddress | AbiDecoded[] | { [key: string]: AbiDecoded };
|
|
10
|
+
export type AbiDecoded = bigint | boolean | string | AztecAddress | AbiDecoded[] | { [key: string]: AbiDecoded };
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Decodes values using a provided ABI.
|
|
@@ -58,11 +58,12 @@ class AbiDecoder {
|
|
|
58
58
|
return struct;
|
|
59
59
|
}
|
|
60
60
|
case 'string': {
|
|
61
|
-
|
|
61
|
+
let str = '';
|
|
62
62
|
for (let i = 0; i < abiType.length; i += 1) {
|
|
63
|
-
|
|
63
|
+
const charCode = Number(this.getNextField().toBigInt());
|
|
64
|
+
str += String.fromCharCode(charCode);
|
|
64
65
|
}
|
|
65
|
-
return
|
|
66
|
+
return str;
|
|
66
67
|
}
|
|
67
68
|
case 'tuple': {
|
|
68
69
|
const array = [];
|
package/src/tx/profiling.ts
CHANGED
|
@@ -4,9 +4,14 @@ import { type ZodFor, optional } from '@aztec/foundation/schemas';
|
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
|
|
6
6
|
import type { AbiDecoded } from '../abi/decoder.js';
|
|
7
|
+
import type { AztecNode } from '../interfaces/aztec-node.js';
|
|
7
8
|
import { type PrivateExecutionStep, PrivateExecutionStepSchema } from '../kernel/private_kernel_prover_output.js';
|
|
8
9
|
import { AbiDecodedSchema } from '../schemas/schemas.js';
|
|
9
10
|
|
|
11
|
+
export type NodeStats = Partial<Record<keyof AztecNode, { times: number[] }>>;
|
|
12
|
+
|
|
13
|
+
const NodeStatsSchema = z.record(z.string(), z.object({ times: z.array(z.number()) }));
|
|
14
|
+
|
|
10
15
|
type FunctionTiming = {
|
|
11
16
|
functionName: string;
|
|
12
17
|
time: number;
|
|
@@ -35,6 +40,16 @@ export const ProvingTimingsSchema = z.object({
|
|
|
35
40
|
total: z.number(),
|
|
36
41
|
});
|
|
37
42
|
|
|
43
|
+
export interface ProvingStats {
|
|
44
|
+
timings: ProvingTimings;
|
|
45
|
+
nodeRPCCalls?: NodeStats;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const ProvingStatsSchema = z.object({
|
|
49
|
+
timings: ProvingTimingsSchema,
|
|
50
|
+
nodeRPCCalls: optional(NodeStatsSchema),
|
|
51
|
+
});
|
|
52
|
+
|
|
38
53
|
export interface SimulationTimings {
|
|
39
54
|
sync: number;
|
|
40
55
|
publicSimulation?: number;
|
|
@@ -53,19 +68,29 @@ export const SimulationTimingsSchema = z.object({
|
|
|
53
68
|
total: z.number(),
|
|
54
69
|
});
|
|
55
70
|
|
|
71
|
+
export interface SimulationStats {
|
|
72
|
+
timings: SimulationTimings;
|
|
73
|
+
nodeRPCCalls: NodeStats;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export const SimulationStatsSchema = z.object({
|
|
77
|
+
timings: SimulationTimingsSchema,
|
|
78
|
+
nodeRPCCalls: NodeStatsSchema,
|
|
79
|
+
});
|
|
80
|
+
|
|
56
81
|
export class TxProfileResult {
|
|
57
82
|
constructor(
|
|
58
83
|
public executionSteps: PrivateExecutionStep[],
|
|
59
|
-
public
|
|
84
|
+
public stats: ProvingStats,
|
|
60
85
|
) {}
|
|
61
86
|
|
|
62
87
|
static get schema(): ZodFor<TxProfileResult> {
|
|
63
88
|
return z
|
|
64
89
|
.object({
|
|
65
90
|
executionSteps: z.array(PrivateExecutionStepSchema),
|
|
66
|
-
|
|
91
|
+
stats: ProvingStatsSchema,
|
|
67
92
|
})
|
|
68
|
-
.transform(({ executionSteps,
|
|
93
|
+
.transform(({ executionSteps, stats }) => new TxProfileResult(executionSteps, stats));
|
|
69
94
|
}
|
|
70
95
|
|
|
71
96
|
static random(): TxProfileResult {
|
|
@@ -83,16 +108,19 @@ export class TxProfileResult {
|
|
|
83
108
|
},
|
|
84
109
|
],
|
|
85
110
|
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
111
|
+
nodeRPCCalls: { getBlockHeader: { times: [1] } },
|
|
112
|
+
timings: {
|
|
113
|
+
sync: 1,
|
|
114
|
+
proving: 1,
|
|
115
|
+
perFunction: [
|
|
116
|
+
{
|
|
117
|
+
functionName: 'random',
|
|
118
|
+
time: 1,
|
|
119
|
+
},
|
|
120
|
+
],
|
|
121
|
+
unaccounted: 1,
|
|
122
|
+
total: 4,
|
|
123
|
+
},
|
|
96
124
|
},
|
|
97
125
|
);
|
|
98
126
|
}
|
|
@@ -101,31 +129,34 @@ export class TxProfileResult {
|
|
|
101
129
|
export class UtilitySimulationResult {
|
|
102
130
|
constructor(
|
|
103
131
|
public result: AbiDecoded,
|
|
104
|
-
public
|
|
132
|
+
public stats?: SimulationStats,
|
|
105
133
|
) {}
|
|
106
134
|
|
|
107
135
|
static get schema(): ZodFor<UtilitySimulationResult> {
|
|
108
136
|
return z
|
|
109
137
|
.object({
|
|
110
138
|
result: AbiDecodedSchema,
|
|
111
|
-
|
|
139
|
+
stats: optional(SimulationStatsSchema),
|
|
112
140
|
})
|
|
113
|
-
.transform(({ result,
|
|
141
|
+
.transform(({ result, stats }) => new UtilitySimulationResult(result, stats));
|
|
114
142
|
}
|
|
115
143
|
|
|
116
144
|
static random(): UtilitySimulationResult {
|
|
117
145
|
return new UtilitySimulationResult(Fr.random().toBigInt(), {
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
146
|
+
nodeRPCCalls: { getBlockHeader: { times: [1] } },
|
|
147
|
+
timings: {
|
|
148
|
+
sync: 1,
|
|
149
|
+
publicSimulation: 1,
|
|
150
|
+
validation: 1,
|
|
151
|
+
perFunction: [
|
|
152
|
+
{
|
|
153
|
+
functionName: 'random',
|
|
154
|
+
time: 1,
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
unaccounted: 1,
|
|
158
|
+
total: 5,
|
|
159
|
+
},
|
|
129
160
|
});
|
|
130
161
|
}
|
|
131
162
|
}
|
package/src/tx/proven_tx.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { z } from 'zod';
|
|
|
6
6
|
import { PrivateKernelTailCircuitPublicInputs } from '../kernel/private_kernel_tail_circuit_public_inputs.js';
|
|
7
7
|
import { ClientIvcProof } from '../proofs/client_ivc_proof.js';
|
|
8
8
|
import { PrivateExecutionResult, collectSortedContractClassLogs } from './private_execution_result.js';
|
|
9
|
-
import { type
|
|
9
|
+
import { type ProvingStats, ProvingTimingsSchema } from './profiling.js';
|
|
10
10
|
import { Tx } from './tx.js';
|
|
11
11
|
|
|
12
12
|
export class TxProvingResult {
|
|
@@ -14,7 +14,7 @@ export class TxProvingResult {
|
|
|
14
14
|
public privateExecutionResult: PrivateExecutionResult,
|
|
15
15
|
public publicInputs: PrivateKernelTailCircuitPublicInputs,
|
|
16
16
|
public clientIvcProof: ClientIvcProof,
|
|
17
|
-
public
|
|
17
|
+
public stats?: ProvingStats,
|
|
18
18
|
) {}
|
|
19
19
|
|
|
20
20
|
toTx(): Tx {
|
package/src/tx/simulated_tx.ts
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
PrivateExecutionResult,
|
|
13
13
|
collectSortedContractClassLogs,
|
|
14
14
|
} from './private_execution_result.js';
|
|
15
|
-
import { type
|
|
15
|
+
import { type SimulationStats, SimulationStatsSchema } from './profiling.js';
|
|
16
16
|
import { NestedProcessReturnValues, PublicSimulationOutput } from './public_simulation_output.js';
|
|
17
17
|
import { Tx } from './tx.js';
|
|
18
18
|
|
|
@@ -44,7 +44,7 @@ export class TxSimulationResult {
|
|
|
44
44
|
public privateExecutionResult: PrivateExecutionResult,
|
|
45
45
|
public publicInputs: PrivateKernelTailCircuitPublicInputs,
|
|
46
46
|
public publicOutput?: PublicSimulationOutput,
|
|
47
|
-
public
|
|
47
|
+
public stats?: SimulationStats,
|
|
48
48
|
) {}
|
|
49
49
|
|
|
50
50
|
get gasUsed(): GasUsed {
|
|
@@ -64,7 +64,7 @@ export class TxSimulationResult {
|
|
|
64
64
|
privateExecutionResult: PrivateExecutionResult.schema,
|
|
65
65
|
publicInputs: PrivateKernelTailCircuitPublicInputs.schema,
|
|
66
66
|
publicOutput: PublicSimulationOutput.schema.optional(),
|
|
67
|
-
|
|
67
|
+
stats: optional(SimulationStatsSchema),
|
|
68
68
|
})
|
|
69
69
|
.transform(TxSimulationResult.from);
|
|
70
70
|
}
|
|
@@ -74,20 +74,20 @@ export class TxSimulationResult {
|
|
|
74
74
|
fields.privateExecutionResult,
|
|
75
75
|
fields.publicInputs,
|
|
76
76
|
fields.publicOutput,
|
|
77
|
-
fields.
|
|
77
|
+
fields.stats,
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
static fromPrivateSimulationResultAndPublicOutput(
|
|
82
82
|
privateSimulationResult: PrivateSimulationResult,
|
|
83
83
|
publicOutput?: PublicSimulationOutput,
|
|
84
|
-
|
|
84
|
+
stats?: SimulationStats,
|
|
85
85
|
) {
|
|
86
86
|
return new TxSimulationResult(
|
|
87
87
|
privateSimulationResult.privateExecutionResult,
|
|
88
88
|
privateSimulationResult.publicInputs,
|
|
89
89
|
publicOutput,
|
|
90
|
-
|
|
90
|
+
stats,
|
|
91
91
|
);
|
|
92
92
|
}
|
|
93
93
|
|