@aztec/stdlib 0.86.0-nightly.20250511 → 0.86.0-nightly.20250513
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/interfaces/pxe.d.ts +2 -3
- package/dest/interfaces/pxe.d.ts.map +1 -1
- package/dest/interfaces/pxe.js +2 -2
- package/dest/tx/profiling.d.ts +8 -0
- package/dest/tx/profiling.d.ts.map +1 -1
- package/dest/tx/profiling.js +31 -0
- package/package.json +7 -7
- package/src/interfaces/pxe.ts +3 -4
- package/src/tx/profiling.ts +32 -0
package/dest/interfaces/pxe.d.ts
CHANGED
|
@@ -3,7 +3,6 @@ import type { Fr } from '@aztec/foundation/fields';
|
|
|
3
3
|
import type { ApiSchemaFor } from '@aztec/foundation/schemas';
|
|
4
4
|
import { SiblingPath } from '@aztec/foundation/trees';
|
|
5
5
|
import { type AbiType, type ContractArtifact } from '../abi/abi.js';
|
|
6
|
-
import type { AbiDecoded } from '../abi/decoder.js';
|
|
7
6
|
import type { EventSelector } from '../abi/event_selector.js';
|
|
8
7
|
import { AuthWitness } from '../auth_witness/auth_witness.js';
|
|
9
8
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
@@ -14,7 +13,7 @@ import { type LogFilter } from '../logs/log_filter.js';
|
|
|
14
13
|
import { UniqueNote } from '../note/extended_note.js';
|
|
15
14
|
import { type NotesFilter } from '../note/notes_filter.js';
|
|
16
15
|
import { type IndexedTxEffect, PrivateExecutionResult, Tx, TxExecutionRequest, TxHash, TxReceipt, TxSimulationResult } from '../tx/index.js';
|
|
17
|
-
import { TxProfileResult } from '../tx/profiling.js';
|
|
16
|
+
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
18
17
|
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
19
18
|
import { type GetContractClassLogsResponse, type GetPublicLogsResponse } from './get_logs_response.js';
|
|
20
19
|
/**
|
|
@@ -218,7 +217,7 @@ export interface PXE {
|
|
|
218
217
|
* default to all.
|
|
219
218
|
* @returns The result of the utility function call, structured based on the function ABI.
|
|
220
219
|
*/
|
|
221
|
-
simulateUtility(functionName: string, args: any[], to: AztecAddress, authwits?: AuthWitness[], from?: AztecAddress, scopes?: AztecAddress[]): Promise<
|
|
220
|
+
simulateUtility(functionName: string, args: any[], to: AztecAddress, authwits?: AuthWitness[], from?: AztecAddress, scopes?: AztecAddress[]): Promise<UtilitySimulationResult>;
|
|
222
221
|
/**
|
|
223
222
|
* Gets public logs based on the provided filter.
|
|
224
223
|
* @param filter - The filter to apply to the logs.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../src/interfaces/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD,OAAO,EAAE,KAAK,OAAO,EAAiB,KAAK,gBAAgB,EAA0B,MAAM,eAAe,CAAC;AAC3G,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../../src/interfaces/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAItD,OAAO,EAAE,KAAK,OAAO,EAAiB,KAAK,gBAAgB,EAA0B,MAAM,eAAe,CAAC;AAC3G,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,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QF,oDAAoD;AACpD,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,WAAW,gBAAgB;CAC5B;AAED,wDAAwD;AACxD,MAAM,WAAW,OAAO;IACtB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,kCAAkC;IAClC,yBAAyB,EAAE,yBAAyB,CAAC;CACtD;AAED,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,CAAC,EAAE,2BAA2B,GAAG,SAAS,CAAC;IAC3D,qBAAqB,EAAE,OAAO,CAAC;IAC/B,0BAA0B,EAAE,OAAO,CAAC;CACrC;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAC;IAChD,iCAAiC,EAAE,OAAO,CAAC;IAC3C,QAAQ,CAAC,EAAE,gBAAgB,GAAG,SAAS,CAAC;CACzC;AAmBD,eAAO,MAAM,SAAS,EAAE,YAAY,CAAC,GAAG,CAoFvC,CAAC"}
|
package/dest/interfaces/pxe.js
CHANGED
|
@@ -11,7 +11,7 @@ import { UniqueNote } from '../note/extended_note.js';
|
|
|
11
11
|
import { NotesFilterSchema } from '../note/notes_filter.js';
|
|
12
12
|
import { AbiDecodedSchema, optional, schemas } from '../schemas/schemas.js';
|
|
13
13
|
import { PrivateExecutionResult, Tx, TxExecutionRequest, TxHash, TxReceipt, TxSimulationResult, indexedTxSchema } from '../tx/index.js';
|
|
14
|
-
import { TxProfileResult } from '../tx/profiling.js';
|
|
14
|
+
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
15
15
|
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
16
16
|
import { GetContractClassLogsResponseSchema, GetPublicLogsResponseSchema } from './get_logs_response.js';
|
|
17
17
|
const EventMetadataDefinitionSchema = z.object({
|
|
@@ -86,7 +86,7 @@ export const PXESchema = {
|
|
|
86
86
|
z.undefined()
|
|
87
87
|
])),
|
|
88
88
|
getCurrentBaseFees: z.function().returns(GasFees.schema),
|
|
89
|
-
simulateUtility: z.function().args(z.string(), z.array(z.any()), schemas.AztecAddress, optional(z.array(AuthWitness.schema)), optional(schemas.AztecAddress), optional(z.array(schemas.AztecAddress))).returns(
|
|
89
|
+
simulateUtility: z.function().args(z.string(), z.array(z.any()), schemas.AztecAddress, optional(z.array(AuthWitness.schema)), optional(schemas.AztecAddress), optional(z.array(schemas.AztecAddress))).returns(UtilitySimulationResult.schema),
|
|
90
90
|
getPublicLogs: z.function().args(LogFilterSchema).returns(GetPublicLogsResponseSchema),
|
|
91
91
|
getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
|
|
92
92
|
getBlockNumber: z.function().returns(z.number()),
|
package/dest/tx/profiling.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ZodFor } from '@aztec/foundation/schemas';
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
+
import type { AbiDecoded } from '../abi/decoder.js';
|
|
3
4
|
import { type PrivateExecutionStep } from '../kernel/private_kernel_prover_output.js';
|
|
4
5
|
type FunctionTiming = {
|
|
5
6
|
functionName: string;
|
|
@@ -98,5 +99,12 @@ export declare class TxProfileResult {
|
|
|
98
99
|
static get schema(): ZodFor<TxProfileResult>;
|
|
99
100
|
static random(): TxProfileResult;
|
|
100
101
|
}
|
|
102
|
+
export declare class UtilitySimulationResult {
|
|
103
|
+
result: AbiDecoded;
|
|
104
|
+
timings?: SimulationTimings | undefined;
|
|
105
|
+
constructor(result: AbiDecoded, timings?: SimulationTimings | undefined);
|
|
106
|
+
static get schema(): ZodFor<UtilitySimulationResult>;
|
|
107
|
+
static random(): UtilitySimulationResult;
|
|
108
|
+
}
|
|
101
109
|
export {};
|
|
102
110
|
//# sourceMappingURL=profiling.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"profiling.d.ts","sourceRoot":"","sources":["../../src/tx/profiling.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"profiling.d.ts","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AAM,EAAE,UAAU;IAAS,OAAO,CAAC;gBAAnC,MAAM,EAAE,UAAU,EAAS,OAAO,CAAC,+BAAmB;IAEzE,MAAM,KAAK,MAAM,IAAI,MAAM,CAAC,uBAAuB,CAAC,CAOnD;IAED,MAAM,CAAC,MAAM,IAAI,uBAAuB;CAezC"}
|
package/dest/tx/profiling.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
1
2
|
import { optional } from '@aztec/foundation/schemas';
|
|
2
3
|
import { z } from 'zod';
|
|
3
4
|
import { PrivateExecutionStepSchema } from '../kernel/private_kernel_prover_output.js';
|
|
5
|
+
import { AbiDecodedSchema } from '../schemas/schemas.js';
|
|
4
6
|
const FunctionTimingSchema = z.object({
|
|
5
7
|
functionName: z.string(),
|
|
6
8
|
time: z.number()
|
|
@@ -64,3 +66,32 @@ export class TxProfileResult {
|
|
|
64
66
|
});
|
|
65
67
|
}
|
|
66
68
|
}
|
|
69
|
+
export class UtilitySimulationResult {
|
|
70
|
+
result;
|
|
71
|
+
timings;
|
|
72
|
+
constructor(result, timings){
|
|
73
|
+
this.result = result;
|
|
74
|
+
this.timings = timings;
|
|
75
|
+
}
|
|
76
|
+
static get schema() {
|
|
77
|
+
return z.object({
|
|
78
|
+
result: AbiDecodedSchema,
|
|
79
|
+
timings: optional(SimulationTimingsSchema)
|
|
80
|
+
}).transform(({ result, timings })=>new UtilitySimulationResult(result, timings));
|
|
81
|
+
}
|
|
82
|
+
static random() {
|
|
83
|
+
return new UtilitySimulationResult(Fr.random().toBigInt(), {
|
|
84
|
+
sync: 1,
|
|
85
|
+
publicSimulation: 1,
|
|
86
|
+
validation: 1,
|
|
87
|
+
perFunction: [
|
|
88
|
+
{
|
|
89
|
+
functionName: 'random',
|
|
90
|
+
time: 1
|
|
91
|
+
}
|
|
92
|
+
],
|
|
93
|
+
unaccounted: 1,
|
|
94
|
+
total: 5
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/stdlib",
|
|
3
|
-
"version": "0.86.0-nightly.
|
|
3
|
+
"version": "0.86.0-nightly.20250513",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"inherits": [
|
|
6
6
|
"../package.common.json",
|
|
@@ -66,12 +66,12 @@
|
|
|
66
66
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
67
67
|
},
|
|
68
68
|
"dependencies": {
|
|
69
|
-
"@aztec/bb.js": "0.86.0-nightly.
|
|
70
|
-
"@aztec/blob-lib": "0.86.0-nightly.
|
|
71
|
-
"@aztec/constants": "0.86.0-nightly.
|
|
72
|
-
"@aztec/ethereum": "0.86.0-nightly.
|
|
73
|
-
"@aztec/foundation": "0.86.0-nightly.
|
|
74
|
-
"@aztec/noir-noirc_abi": "0.86.0-nightly.
|
|
69
|
+
"@aztec/bb.js": "0.86.0-nightly.20250513",
|
|
70
|
+
"@aztec/blob-lib": "0.86.0-nightly.20250513",
|
|
71
|
+
"@aztec/constants": "0.86.0-nightly.20250513",
|
|
72
|
+
"@aztec/ethereum": "0.86.0-nightly.20250513",
|
|
73
|
+
"@aztec/foundation": "0.86.0-nightly.20250513",
|
|
74
|
+
"@aztec/noir-noirc_abi": "0.86.0-nightly.20250513",
|
|
75
75
|
"@google-cloud/storage": "^7.15.0",
|
|
76
76
|
"lodash.chunk": "^4.2.0",
|
|
77
77
|
"lodash.isequal": "^4.5.0",
|
package/src/interfaces/pxe.ts
CHANGED
|
@@ -6,7 +6,6 @@ import { SiblingPath } from '@aztec/foundation/trees';
|
|
|
6
6
|
import { z } from 'zod';
|
|
7
7
|
|
|
8
8
|
import { type AbiType, AbiTypeSchema, type ContractArtifact, ContractArtifactSchema } from '../abi/abi.js';
|
|
9
|
-
import type { AbiDecoded } from '../abi/decoder.js';
|
|
10
9
|
import type { EventSelector } from '../abi/event_selector.js';
|
|
11
10
|
import { AuthWitness } from '../auth_witness/auth_witness.js';
|
|
12
11
|
import type { AztecAddress } from '../aztec-address/index.js';
|
|
@@ -38,7 +37,7 @@ import {
|
|
|
38
37
|
TxSimulationResult,
|
|
39
38
|
indexedTxSchema,
|
|
40
39
|
} from '../tx/index.js';
|
|
41
|
-
import { TxProfileResult } from '../tx/profiling.js';
|
|
40
|
+
import { TxProfileResult, UtilitySimulationResult } from '../tx/profiling.js';
|
|
42
41
|
import { TxProvingResult } from '../tx/proven_tx.js';
|
|
43
42
|
import {
|
|
44
43
|
type GetContractClassLogsResponse,
|
|
@@ -291,7 +290,7 @@ export interface PXE {
|
|
|
291
290
|
authwits?: AuthWitness[],
|
|
292
291
|
from?: AztecAddress,
|
|
293
292
|
scopes?: AztecAddress[],
|
|
294
|
-
): Promise<
|
|
293
|
+
): Promise<UtilitySimulationResult>;
|
|
295
294
|
|
|
296
295
|
/**
|
|
297
296
|
* Gets public logs based on the provided filter.
|
|
@@ -510,7 +509,7 @@ export const PXESchema: ApiSchemaFor<PXE> = {
|
|
|
510
509
|
optional(schemas.AztecAddress),
|
|
511
510
|
optional(z.array(schemas.AztecAddress)),
|
|
512
511
|
)
|
|
513
|
-
.returns(
|
|
512
|
+
.returns(UtilitySimulationResult.schema),
|
|
514
513
|
getPublicLogs: z.function().args(LogFilterSchema).returns(GetPublicLogsResponseSchema),
|
|
515
514
|
getContractClassLogs: z.function().args(LogFilterSchema).returns(GetContractClassLogsResponseSchema),
|
|
516
515
|
getBlockNumber: z.function().returns(z.number()),
|
package/src/tx/profiling.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/fields';
|
|
1
2
|
import { type ZodFor, optional } from '@aztec/foundation/schemas';
|
|
2
3
|
|
|
3
4
|
import { z } from 'zod';
|
|
4
5
|
|
|
6
|
+
import type { AbiDecoded } from '../abi/decoder.js';
|
|
5
7
|
import { type PrivateExecutionStep, PrivateExecutionStepSchema } from '../kernel/private_kernel_prover_output.js';
|
|
8
|
+
import { AbiDecodedSchema } from '../schemas/schemas.js';
|
|
6
9
|
|
|
7
10
|
type FunctionTiming = {
|
|
8
11
|
functionName: string;
|
|
@@ -86,3 +89,32 @@ export class TxProfileResult {
|
|
|
86
89
|
);
|
|
87
90
|
}
|
|
88
91
|
}
|
|
92
|
+
|
|
93
|
+
export class UtilitySimulationResult {
|
|
94
|
+
constructor(public result: AbiDecoded, public timings?: SimulationTimings) {}
|
|
95
|
+
|
|
96
|
+
static get schema(): ZodFor<UtilitySimulationResult> {
|
|
97
|
+
return z
|
|
98
|
+
.object({
|
|
99
|
+
result: AbiDecodedSchema,
|
|
100
|
+
timings: optional(SimulationTimingsSchema),
|
|
101
|
+
})
|
|
102
|
+
.transform(({ result, timings }) => new UtilitySimulationResult(result, timings));
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
static random(): UtilitySimulationResult {
|
|
106
|
+
return new UtilitySimulationResult(Fr.random().toBigInt(), {
|
|
107
|
+
sync: 1,
|
|
108
|
+
publicSimulation: 1,
|
|
109
|
+
validation: 1,
|
|
110
|
+
perFunction: [
|
|
111
|
+
{
|
|
112
|
+
functionName: 'random',
|
|
113
|
+
time: 1,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
unaccounted: 1,
|
|
117
|
+
total: 5,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|