@aztec/txe 0.0.1-commit.85d7d01 → 0.0.1-commit.8655d4a
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/ContractClassRegistry-KKNT527R.js +3 -0
- package/dest/ContractClassRegistry-KKNT527R.js.map +7 -0
- package/dest/ContractInstanceRegistry-GSKBNL3Q.js +3 -0
- package/dest/ContractInstanceRegistry-GSKBNL3Q.js.map +7 -0
- package/dest/FeeJuice-GUJ5O6GB.js +3 -0
- package/dest/FeeJuice-GUJ5O6GB.js.map +7 -0
- package/dest/MultiCallEntrypoint-ZQPCKVKL.js +3 -0
- package/dest/MultiCallEntrypoint-ZQPCKVKL.js.map +7 -0
- package/dest/SchnorrAccount-QIXE5DXA.js +3 -0
- package/dest/SchnorrAccount-QIXE5DXA.js.map +7 -0
- package/dest/bin/check_txe_oracle_version.d.ts +2 -0
- package/dest/bin/check_txe_oracle_version.d.ts.map +1 -0
- package/dest/bin/check_txe_oracle_version.js +32 -0
- package/dest/bin/index.js +3 -30
- package/dest/bin/index.js.map +7 -0
- package/dest/chunk-BJVAAXNA.js +3 -0
- package/dest/chunk-BJVAAXNA.js.map +7 -0
- package/dest/chunk-DF6RMOC6.js +304 -0
- package/dest/chunk-DF6RMOC6.js.map +7 -0
- package/dest/chunk-PPJTNNUG.js +265 -0
- package/dest/chunk-PPJTNNUG.js.map +7 -0
- package/dest/constants.d.ts +3 -1
- package/dest/constants.d.ts.map +1 -1
- package/dest/constants.js +5 -0
- package/dest/dispatcher_pool.d.ts +67 -0
- package/dest/dispatcher_pool.d.ts.map +1 -0
- package/dest/dispatcher_pool.js +284 -0
- package/dest/index.d.ts +188 -7
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +160 -119
- package/dest/metafile.json +38147 -0
- package/dest/msgpackr_fr_extension.d.ts +2 -0
- package/dest/msgpackr_fr_extension.d.ts.map +1 -0
- package/dest/msgpackr_fr_extension.js +21 -0
- package/dest/oracle/interfaces.d.ts +39 -28
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.d.ts +18 -13
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +27 -12
- package/dest/oracle/txe_oracle_top_level_context.d.ts +36 -20
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +125 -66
- package/dest/oracle/txe_private_execution_oracle.d.ts +17 -0
- package/dest/oracle/txe_private_execution_oracle.d.ts.map +1 -0
- package/dest/oracle/txe_private_execution_oracle.js +15 -0
- package/dest/rpc_server.d.ts +14 -0
- package/dest/rpc_server.d.ts.map +1 -0
- package/dest/rpc_server.js +78 -0
- package/dest/rpc_translator.d.ts +139 -83
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +567 -243
- package/dest/server.bundle.js +3 -0
- package/dest/server.bundle.js.map +7 -0
- package/dest/state_machine/archiver.d.ts +4 -4
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +22 -20
- package/dest/state_machine/dummy_p2p_client.d.ts +13 -7
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +16 -4
- package/dest/state_machine/global_variable_builder.d.ts +9 -4
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/global_variable_builder.js +9 -3
- package/dest/state_machine/index.d.ts +7 -3
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +23 -5
- package/dest/state_machine/mock_epoch_cache.d.ts +18 -3
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +35 -2
- package/dest/state_machine/synchronizer.d.ts +5 -5
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/state_machine/synchronizer.js +4 -4
- package/dest/txe_oracle_version.d.ts +17 -0
- package/dest/txe_oracle_version.d.ts.map +1 -0
- package/dest/txe_oracle_version.js +14 -0
- package/dest/txe_session.d.ts +64 -6
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +159 -31
- package/dest/utils/encoding.d.ts +191 -0
- package/dest/utils/encoding.d.ts.map +1 -0
- package/dest/{util → utils}/encoding.js +7 -2
- package/dest/{util → utils}/expected_failure_error.d.ts +1 -1
- package/dest/utils/expected_failure_error.d.ts.map +1 -0
- package/dest/{util → utils}/txe_account_store.d.ts +1 -1
- package/dest/utils/txe_account_store.d.ts.map +1 -0
- package/dest/utils/txe_public_contract_data_source.d.ts +20 -0
- package/dest/utils/txe_public_contract_data_source.d.ts.map +1 -0
- package/dest/{util → utils}/txe_public_contract_data_source.js +1 -3
- package/dest/worker.bundle.js +3 -0
- package/dest/worker.bundle.js.map +7 -0
- package/dest/worker.d.ts +2 -0
- package/dest/worker.d.ts.map +1 -0
- package/dest/worker.js +92 -0
- package/package.json +37 -21
- package/src/bin/check_txe_oracle_version.ts +37 -0
- package/src/bin/index.ts +11 -2
- package/src/constants.ts +6 -0
- package/src/dispatcher_pool.ts +316 -0
- package/src/index.ts +178 -126
- package/src/msgpackr_fr_extension.ts +23 -0
- package/src/oracle/interfaces.ts +43 -34
- package/src/oracle/txe_oracle_public_context.ts +42 -12
- package/src/oracle/txe_oracle_top_level_context.ts +146 -77
- package/src/oracle/txe_private_execution_oracle.ts +30 -0
- package/src/rpc_server.ts +87 -0
- package/src/rpc_translator.ts +646 -326
- package/src/state_machine/archiver.ts +33 -18
- package/src/state_machine/dummy_p2p_client.ts +31 -11
- package/src/state_machine/global_variable_builder.ts +18 -3
- package/src/state_machine/index.ts +25 -6
- package/src/state_machine/mock_epoch_cache.ts +46 -3
- package/src/state_machine/synchronizer.ts +5 -5
- package/src/txe_oracle_version.ts +17 -0
- package/src/txe_session.ts +253 -33
- package/src/{util → utils}/encoding.ts +8 -2
- package/src/{util → utils}/txe_public_contract_data_source.ts +0 -2
- package/src/worker.ts +98 -0
- package/dest/util/encoding.d.ts +0 -720
- package/dest/util/encoding.d.ts.map +0 -1
- package/dest/util/expected_failure_error.d.ts.map +0 -1
- package/dest/util/txe_account_store.d.ts.map +0 -1
- package/dest/util/txe_public_contract_data_source.d.ts +0 -20
- package/dest/util/txe_public_contract_data_source.d.ts.map +0 -1
- /package/dest/{util → utils}/expected_failure_error.js +0 -0
- /package/dest/{util → utils}/txe_account_store.js +0 -0
- /package/src/{util → utils}/expected_failure_error.ts +0 -0
- /package/src/{util → utils}/txe_account_store.ts +0 -0
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
|
+
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
6
|
+
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
7
|
+
import { z } from 'zod';
|
|
8
|
+
export type ForeignCallSingle = string;
|
|
9
|
+
export type ForeignCallArray = string[];
|
|
10
|
+
export type ForeignCallArgs = (ForeignCallSingle | ForeignCallArray | ContractArtifact | ContractInstanceWithAddress)[];
|
|
11
|
+
export type ForeignCallResult = {
|
|
12
|
+
values: (ForeignCallSingle | ForeignCallArray)[];
|
|
13
|
+
};
|
|
14
|
+
export declare function fromSingle(obj: ForeignCallSingle): Fr;
|
|
15
|
+
export declare function addressFromSingle(obj: ForeignCallSingle): AztecAddress;
|
|
16
|
+
export declare function blockHashFromSingle(obj: ForeignCallSingle): BlockHash;
|
|
17
|
+
export declare function fromArray(obj: ForeignCallArray): Fr[];
|
|
18
|
+
/**
|
|
19
|
+
* Converts an array of Noir unsigned integers to a single tightly-packed buffer.
|
|
20
|
+
* @param uintBitSize If it's an array of Noir u8's, put `8`, etc.
|
|
21
|
+
* @returns A buffer where each byte is correctly represented as a single byte in the buffer.
|
|
22
|
+
*/
|
|
23
|
+
export declare function fromUintArray(obj: ForeignCallArray, uintBitSize: number): Buffer;
|
|
24
|
+
/**
|
|
25
|
+
* Converts a Noir BoundedVec of unsigned integers into a Buffer. Note that BoundedVecs are structs, and therefore
|
|
26
|
+
* translated as two separate ForeignCallArray and ForeignCallSingle values (an array and a single field).
|
|
27
|
+
*
|
|
28
|
+
* @param storage The array with the BoundedVec's storage (i.e. BoundedVec::storage())
|
|
29
|
+
* @param length The length of the BoundedVec (i.e. BoundedVec::len())
|
|
30
|
+
* @param uintBitSize If it's an array of Noir u8's, put `8`, etc.
|
|
31
|
+
* @returns A buffer containing the unsigned integers tightly packed
|
|
32
|
+
*/
|
|
33
|
+
export declare function fromUintBoundedVec(storage: ForeignCallArray, length: ForeignCallSingle, uintBitSize: number): Buffer;
|
|
34
|
+
export declare function toSingle(value: AztecAddress | EthAddress | Fr | Buffer | boolean | number | bigint): ForeignCallSingle;
|
|
35
|
+
export declare function toArray(objs: Fr[]): ForeignCallArray;
|
|
36
|
+
export declare function toSingleOrArray(value: Fr | Fr[]): string | string[];
|
|
37
|
+
export declare function bufferToU8Array(buffer: Buffer): ForeignCallArray;
|
|
38
|
+
/**
|
|
39
|
+
* Converts a ForeignCallArray into a tuple which represents a nr BoundedVec.
|
|
40
|
+
* If the input array is shorter than the maxLen, it pads the result with zeros,
|
|
41
|
+
* so that nr can correctly coerce this result into a BoundedVec.
|
|
42
|
+
* @param bVecStorage - The array underlying the BoundedVec.
|
|
43
|
+
* @param maxLen - the max length of the BoundedVec.
|
|
44
|
+
* @returns a tuple representing a BoundedVec.
|
|
45
|
+
*/
|
|
46
|
+
export declare function arrayToBoundedVec(bVecStorage: ForeignCallArray, maxLen: number): [ForeignCallArray, ForeignCallSingle];
|
|
47
|
+
/**
|
|
48
|
+
* Converts an array of arrays representing Noir BoundedVec of nested arrays into its Noir serialized form.
|
|
49
|
+
* @param bVecStorage - The array underlying the BoundedVec.
|
|
50
|
+
* @param maxLen - The max length of the BoundedVec (max num of the nested arrays in the BoundedVec).
|
|
51
|
+
* @param nestedArrayLength - The length of the nested arrays (each nested array has to have the same length).
|
|
52
|
+
* @returns Serialized BoundedVec following Noir intrinsic serialization.
|
|
53
|
+
*/
|
|
54
|
+
export declare function arrayOfArraysToBoundedVecOfArrays(bVecStorage: ForeignCallArray[], maxLen: number, nestedArrayLength: number): [ForeignCallArray, ForeignCallSingle];
|
|
55
|
+
export declare function toForeignCallResult(obj: (ForeignCallSingle | ForeignCallArray)[]): {
|
|
56
|
+
values: (string | ForeignCallArray)[];
|
|
57
|
+
};
|
|
58
|
+
export declare const ForeignCallSingleSchema: z.ZodString;
|
|
59
|
+
export declare const ForeignCallArraySchema: z.ZodArray<z.ZodString>;
|
|
60
|
+
export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>, z.ZodObject<{
|
|
61
|
+
name: z.ZodString;
|
|
62
|
+
aztecVersion: z.ZodDefault<z.ZodString>;
|
|
63
|
+
functions: z.ZodArray<z.ZodIntersection<z.ZodObject<{
|
|
64
|
+
name: z.ZodString;
|
|
65
|
+
functionType: z.ZodEnum<typeof import("@aztec/stdlib/abi").FunctionType>;
|
|
66
|
+
isOnlySelf: z.ZodBoolean;
|
|
67
|
+
isStatic: z.ZodBoolean;
|
|
68
|
+
isInitializer: z.ZodBoolean;
|
|
69
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
type: z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>;
|
|
72
|
+
visibility: z.ZodEnum<{
|
|
73
|
+
databus: "databus";
|
|
74
|
+
private: "private";
|
|
75
|
+
public: "public";
|
|
76
|
+
}>;
|
|
77
|
+
}, z.core.$strip>>;
|
|
78
|
+
returnTypes: z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>;
|
|
79
|
+
errorTypes: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
80
|
+
error_kind: z.ZodLiteral<"string">;
|
|
81
|
+
string: z.ZodString;
|
|
82
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
83
|
+
error_kind: z.ZodLiteral<"fmtstring">;
|
|
84
|
+
length: z.ZodNumber;
|
|
85
|
+
item_types: z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>;
|
|
86
|
+
}, z.core.$strip>, z.ZodIntersection<z.ZodObject<{
|
|
87
|
+
error_kind: z.ZodLiteral<"custom">;
|
|
88
|
+
}, z.core.$strip>, z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>]>>>;
|
|
89
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
90
|
+
bytecode: import("@aztec/foundation/schemas").ZodFor<Buffer<ArrayBufferLike>>;
|
|
91
|
+
verificationKey: z.ZodOptional<z.ZodString>;
|
|
92
|
+
debugSymbols: z.ZodString;
|
|
93
|
+
debug: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
debugSymbols: z.ZodObject<{
|
|
95
|
+
location_tree: z.ZodObject<{
|
|
96
|
+
locations: z.ZodArray<z.ZodObject<{
|
|
97
|
+
parent: z.ZodNullable<z.ZodNumber>;
|
|
98
|
+
value: z.ZodObject<{
|
|
99
|
+
span: z.ZodObject<{
|
|
100
|
+
start: z.ZodNumber;
|
|
101
|
+
end: z.ZodNumber;
|
|
102
|
+
}, z.core.$strip>;
|
|
103
|
+
file: z.ZodNumber;
|
|
104
|
+
}, z.core.$strip>;
|
|
105
|
+
}, z.core.$strip>>;
|
|
106
|
+
}, z.core.$strip>;
|
|
107
|
+
acir_locations: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
108
|
+
brillig_locations: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
109
|
+
}, z.core.$strip>;
|
|
110
|
+
files: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
111
|
+
source: z.ZodString;
|
|
112
|
+
path: z.ZodString;
|
|
113
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
114
|
+
start: z.ZodNumber;
|
|
115
|
+
name: z.ZodString;
|
|
116
|
+
}, z.core.$strip>>;
|
|
117
|
+
}, z.core.$strip>>;
|
|
118
|
+
}, z.core.$strip>>;
|
|
119
|
+
}, z.core.$strip>>>;
|
|
120
|
+
nonDispatchPublicFunctions: z.ZodArray<z.ZodObject<{
|
|
121
|
+
name: z.ZodString;
|
|
122
|
+
functionType: z.ZodEnum<typeof import("@aztec/stdlib/abi").FunctionType>;
|
|
123
|
+
isOnlySelf: z.ZodBoolean;
|
|
124
|
+
isStatic: z.ZodBoolean;
|
|
125
|
+
isInitializer: z.ZodBoolean;
|
|
126
|
+
parameters: z.ZodArray<z.ZodObject<{
|
|
127
|
+
name: z.ZodString;
|
|
128
|
+
type: z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>;
|
|
129
|
+
visibility: z.ZodEnum<{
|
|
130
|
+
databus: "databus";
|
|
131
|
+
private: "private";
|
|
132
|
+
public: "public";
|
|
133
|
+
}>;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
returnTypes: z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>;
|
|
136
|
+
errorTypes: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
137
|
+
error_kind: z.ZodLiteral<"string">;
|
|
138
|
+
string: z.ZodString;
|
|
139
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
140
|
+
error_kind: z.ZodLiteral<"fmtstring">;
|
|
141
|
+
length: z.ZodNumber;
|
|
142
|
+
item_types: z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>;
|
|
143
|
+
}, z.core.$strip>, z.ZodIntersection<z.ZodObject<{
|
|
144
|
+
error_kind: z.ZodLiteral<"custom">;
|
|
145
|
+
}, z.core.$strip>, z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>]>>>;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
outputs: z.ZodObject<{
|
|
148
|
+
structs: z.ZodPipe<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>>, z.ZodTransform<Record<string, import("@aztec/stdlib/abi").AbiType[]>, Record<string, import("@aztec/stdlib/abi").AbiType[]>>>;
|
|
149
|
+
globals: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiValue, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiValue, unknown>>>>;
|
|
150
|
+
}, z.core.$strip>;
|
|
151
|
+
storageLayout: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
152
|
+
slot: z.ZodType<Fr, string, z.core.$ZodTypeInternals<Fr, string>>;
|
|
153
|
+
}, z.core.$strip>>;
|
|
154
|
+
fileMap: z.ZodRecord<z.ZodCoercedNumber<unknown>, z.ZodObject<{
|
|
155
|
+
source: z.ZodString;
|
|
156
|
+
path: z.ZodString;
|
|
157
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
158
|
+
start: z.ZodNumber;
|
|
159
|
+
name: z.ZodString;
|
|
160
|
+
}, z.core.$strip>>;
|
|
161
|
+
}, z.core.$strip>>;
|
|
162
|
+
}, z.core.$strip>, z.ZodIntersection<z.ZodObject<{
|
|
163
|
+
version: z.ZodLiteral<2>;
|
|
164
|
+
salt: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
165
|
+
deployer: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
166
|
+
currentContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
167
|
+
originalContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
168
|
+
initializationHash: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
169
|
+
immutablesHash: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
170
|
+
publicKeys: z.ZodPipe<z.ZodObject<{
|
|
171
|
+
npkMHash: z.ZodType<Fr, string, z.core.$ZodTypeInternals<Fr, string>>;
|
|
172
|
+
ivpkM: z.ZodType<import("@aztec/foundation/schemas").Point, string, z.core.$ZodTypeInternals<import("@aztec/foundation/schemas").Point, string>>;
|
|
173
|
+
ovpkMHash: z.ZodType<Fr, string, z.core.$ZodTypeInternals<Fr, string>>;
|
|
174
|
+
tpkMHash: z.ZodType<Fr, string, z.core.$ZodTypeInternals<Fr, string>>;
|
|
175
|
+
mspkMHash: z.ZodType<Fr, string, z.core.$ZodTypeInternals<Fr, string>>;
|
|
176
|
+
fbpkMHash: z.ZodType<Fr, string, z.core.$ZodTypeInternals<Fr, string>>;
|
|
177
|
+
}, z.core.$strip>, z.ZodTransform<import("@aztec/stdlib/keys").PublicKeys, {
|
|
178
|
+
npkMHash: Fr;
|
|
179
|
+
ivpkM: import("@aztec/foundation/schemas").Point;
|
|
180
|
+
ovpkMHash: Fr;
|
|
181
|
+
tpkMHash: Fr;
|
|
182
|
+
mspkMHash: Fr;
|
|
183
|
+
fbpkMHash: Fr;
|
|
184
|
+
}>>;
|
|
185
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
186
|
+
address: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
187
|
+
}, z.core.$strip>>]>>;
|
|
188
|
+
export declare const ForeignCallResultSchema: z.ZodObject<{
|
|
189
|
+
values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
190
|
+
}, z.core.$strip>;
|
|
191
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RpbmcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9lbmNvZGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFFaEUsT0FBTyxFQUFFLEtBQUssZ0JBQWdCLEVBQTBCLE1BQU0sbUJBQW1CLENBQUM7QUFDbEYsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQzNELE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNoRCxPQUFPLEVBQUUsS0FBSywyQkFBMkIsRUFBcUMsTUFBTSx3QkFBd0IsQ0FBQztBQUU3RyxPQUFPLEVBQUUsQ0FBQyxFQUFFLE1BQU0sS0FBSyxDQUFDO0FBRXhCLE1BQU0sTUFBTSxpQkFBaUIsR0FBRyxNQUFNLENBQUM7QUFFdkMsTUFBTSxNQUFNLGdCQUFnQixHQUFHLE1BQU0sRUFBRSxDQUFDO0FBRXhDLE1BQU0sTUFBTSxlQUFlLEdBQUcsQ0FBQyxpQkFBaUIsR0FBRyxnQkFBZ0IsR0FBRyxnQkFBZ0IsR0FBRywyQkFBMkIsQ0FBQyxFQUFFLENBQUM7QUFFeEgsTUFBTSxNQUFNLGlCQUFpQixHQUFHO0lBQzlCLE1BQU0sRUFBRSxDQUFDLGlCQUFpQ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,EAAE,qBAE/C;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,gBAAgB,CAEhE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,gBAAgB,EAC7B,MAAM,EAAE,MAAM,GACb,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAYvC;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,gBAAgB,EAAE,EAC/B,MAAM,EAAE,MAAM,EACd,iBAAiB,EAAE,MAAM,GACxB,CAAC,gBAAgB,EAAE,iBAAiB,CAAC,CAsBvC;AAED,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,EAAE;;EAEhF;AAED,eAAO,MAAM,uBAAuB,aAAa,CAAC;AAElD,eAAO,MAAM,sBAAsB,yBAAsB,CAAC;AAE1D,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;iBAElC,CAAC"}
|
|
@@ -2,6 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import { hexToBuffer } from '@aztec/foundation/string';
|
|
3
3
|
import { ContractArtifactSchema } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
5
6
|
import { ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
export function fromSingle(obj) {
|
|
@@ -10,6 +11,9 @@ export function fromSingle(obj) {
|
|
|
10
11
|
export function addressFromSingle(obj) {
|
|
11
12
|
return new AztecAddress(fromSingle(obj));
|
|
12
13
|
}
|
|
14
|
+
export function blockHashFromSingle(obj) {
|
|
15
|
+
return new BlockHash(fromSingle(obj));
|
|
16
|
+
}
|
|
13
17
|
export function fromArray(obj) {
|
|
14
18
|
return obj.map((str)=>Fr.fromBuffer(hexToBuffer(str)));
|
|
15
19
|
}
|
|
@@ -102,8 +106,9 @@ export function bufferToU8Array(buffer) {
|
|
|
102
106
|
}
|
|
103
107
|
const flattenedStorage = bVecStorage.flat();
|
|
104
108
|
const numFieldsToPad = maxLen * nestedArrayLength - flattenedStorage.length;
|
|
105
|
-
|
|
106
|
-
//
|
|
109
|
+
// Pad with hex-encoded zeros so the result is uniformly `ForeignCallSingle` (string); raw Fr
|
|
110
|
+
// instances would JSON-serialize as `{ asBigInt: "0" }` and nargo would reject the response.
|
|
111
|
+
const flattenedStorageWithPadding = flattenedStorage.concat(toArray(Array(numFieldsToPad).fill(new Fr(0))));
|
|
107
112
|
const len = toSingle(new Fr(bVecStorage.length));
|
|
108
113
|
return [
|
|
109
114
|
flattenedStorageWithPadding,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare class ExpectedFailureError extends Error {
|
|
2
2
|
constructor(message: string);
|
|
3
3
|
}
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhwZWN0ZWRfZmFpbHVyZV9lcnJvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWxzL2V4cGVjdGVkX2ZhaWx1cmVfZXJyb3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEscUJBQWEsb0JBQXFCLFNBQVEsS0FBSztJQUM3QyxZQUFZLE9BQU8sRUFBRSxNQUFNLEVBRTFCO0NBQ0YifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"expected_failure_error.d.ts","sourceRoot":"","sources":["../../src/utils/expected_failure_error.ts"],"names":[],"mappings":"AAAA,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAO,EAAE,MAAM,EAE1B;CACF"}
|
|
@@ -7,4 +7,4 @@ export declare class TXEAccountStore {
|
|
|
7
7
|
getAccount(key: AztecAddress): Promise<CompleteAddress>;
|
|
8
8
|
setAccount(key: AztecAddress, value: CompleteAddress): Promise<void>;
|
|
9
9
|
}
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX2FjY291bnRfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy90eGVfYWNjb3VudF9zdG9yZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBaUIsTUFBTSxpQkFBaUIsQ0FBQztBQUN4RSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFekQscUJBQWEsZUFBZTs7SUFHMUIsWUFBWSxLQUFLLEVBQUUsaUJBQWlCLEVBRW5DO0lBRUssVUFBVSxDQUFDLEdBQUcsRUFBRSxZQUFZLDRCQU1qQztJQUVLLFVBQVUsQ0FBQyxHQUFHLEVBQUUsWUFBWSxFQUFFLEtBQUssRUFBRSxlQUFlLGlCQUV6RDtDQUNGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"txe_account_store.d.ts","sourceRoot":"","sources":["../../src/utils/txe_account_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,qBAAa,eAAe;;IAG1B,YAAY,KAAK,EAAE,iBAAiB,EAEnC;IAEK,UAAU,CAAC,GAAG,EAAE,YAAY,4BAMjC;IAEK,UAAU,CAAC,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,iBAEzD;CACF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
|
+
import type { ContractStore } from '@aztec/pxe/server';
|
|
4
|
+
import { type ContractArtifact, FunctionSelector } from '@aztec/stdlib/abi';
|
|
5
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
|
+
import type { ContractClassPublic, ContractDataSource, ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
7
|
+
export declare class TXEPublicContractDataSource implements ContractDataSource {
|
|
8
|
+
private blockNumber;
|
|
9
|
+
private contractStore;
|
|
10
|
+
constructor(blockNumber: BlockNumber, contractStore: ContractStore);
|
|
11
|
+
getBlockNumber(): Promise<BlockNumber>;
|
|
12
|
+
getContractClass(id: Fr): Promise<ContractClassPublic | undefined>;
|
|
13
|
+
getBytecodeCommitment(id: Fr): Promise<Fr | undefined>;
|
|
14
|
+
getContract(address: AztecAddress): Promise<ContractInstanceWithAddress | undefined>;
|
|
15
|
+
getContractClassIds(): Promise<Fr[]>;
|
|
16
|
+
getContractArtifact(address: AztecAddress): Promise<ContractArtifact | undefined>;
|
|
17
|
+
getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
18
|
+
registerContractFunctionSignatures(_signatures: []): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS5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PLENBQUMsMkJBQTJCLEdBQUcsU0FBUyxDQUFDLENBR3pGO0lBRUQsbUJBQW1CLElBQUksT0FBTyxDQUFDLEVBQUUsRUFBRSxDQUFDLENBRW5DO0lBRUssbUJBQW1CLENBQUMsT0FBTyxFQUFFLFlBQVksR0FBRyxPQUFPLENBQUMsZ0JBQWdCLEdBQUcsU0FBUyxDQUFDLENBR3RGO0lBRUssb0JBQW9CLENBQUMsT0FBTyxFQUFFLFlBQVksRUFBRSxRQUFRLEVBQUUsZ0JBQWdCLEdBQUcsT0FBTyxDQUFDLE1BQU0sR0FBRyxTQUFTLENBQUMsQ0FFekc7SUFFRCxrQ0FBa0MsQ0FBQyxXQUFXLEVBQUUsRUFBRSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFakU7Q0FDRiJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"txe_public_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/utils/txe_public_contract_data_source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAEnH,qBAAa,2BAA4B,YAAW,kBAAkB;IAElE,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,aAAa;IAFvB,YACU,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAClC;IAEJ,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAErC;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAYvE;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAG3D;IAEK,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAGzF;IAED,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAEnC;IAEK,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAGtF;IAEK,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEzG;IAED,kCAAkC,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACF"}
|
|
@@ -18,9 +18,7 @@ export class TXEPublicContractDataSource {
|
|
|
18
18
|
artifactHash: contractClass.artifactHash,
|
|
19
19
|
packedBytecode: contractClass.packedBytecode,
|
|
20
20
|
privateFunctionsRoot: contractClass.privateFunctionsRoot,
|
|
21
|
-
version: contractClass.version
|
|
22
|
-
privateFunctions: [],
|
|
23
|
-
utilityFunctions: []
|
|
21
|
+
version: contractClass.version
|
|
24
22
|
};
|
|
25
23
|
}
|
|
26
24
|
async getBytecodeCommitment(id) {
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { createRequire as __txeCreateRequire } from 'node:module';
|
|
2
|
+
const require = __txeCreateRequire(import.meta.url);
|
|
3
|
+
import{TXEDispatcher,activeSessionCount,createLogger}from"./chunk-PPJTNNUG.js";import{__name}from"./chunk-BJVAAXNA.js";import{BackendType,Barretenberg,BarretenbergSync}from"@aztec/bb.js";import{parentPort,workerData}from"node:worker_threads";Barretenberg.initSingleton({backend:BackendType.Wasm,skipSrsInit:!0,threads:1});BarretenbergSync.initSingleton({backend:BackendType.Wasm});if(!parentPort)throw new Error("worker.ts must be loaded as a worker_thread");var port=parentPort,logger=createLogger("txe:worker"),dispatcherOpts={contractStoreSourceDir:workerData.contractStoreSourceDir,schnorrClassId:workerData.schnorrClassId},dispatcher=new TXEDispatcher(logger,dispatcherOpts);function serializeError(err){return err instanceof Error?{message:err.message,name:err.name,stack:err.stack}:{message:String(err)}}__name(serializeError,"serializeError");process.env.TXE_WORKER_MEMSTAT==="1"&&setInterval(()=>{let m=process.memoryUsage();port.postMessage({type:"memstat",sessions:activeSessionCount(),rss:m.rss,heapTotal:m.heapTotal,heapUsed:m.heapUsed,external:m.external,arrayBuffers:m.arrayBuffers})},2e3).unref();port.on("message",msg=>{switch(msg.type){case"foreign-call":(async()=>{try{let value=await dispatcher.resolve_foreign_call(msg.callData);port.postMessage({type:"result",requestId:msg.requestId,ok:!0,value})}catch(err){port.postMessage({type:"result",requestId:msg.requestId,ok:!1,error:serializeError(err)})}})();return;case"dispose-session":dispatcher.disposeSession(msg.sessionId).catch(err=>logger.warn("disposeSession failed",err));return}});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/worker.ts"],
|
|
4
|
+
"sourcesContent": ["import { BackendType, Barretenberg, BarretenbergSync } from '@aztec/bb.js';\nimport { type Logger, createLogger } from '@aztec/foundation/log';\n\nimport { parentPort, workerData } from 'node:worker_threads';\n\n// Importing `./index.js` registers the msgpackr Fr extension transitively (via\n// ./msgpackr_fr_extension.js); this must happen before any `sendMessage` call.\nimport { TXEDispatcher, type TXEDispatcherOptions, type TXEForeignCallInput, activeSessionCount } from './index.js';\n\n// Seed both bb.js singletons with the WASM backend before any crypto call. `initSingleton`\n// binds the singleton to whichever backend the first call requests, so this pre-empts the\n// implicit `Barretenberg.initSingleton()` inside `poseidon2Hash` from `@aztec/foundation/crypto`.\n// TXE only needs hashing (no proving, no verification), so WASM is sufficient and\n// `skipSrsInit: true` skips the CRS load. `threads: 1` keeps the WASM backend on a single\n// thread \u2014 additional threads would each spawn a nested worker_thread, multiplying memory cost\n// per pool worker.\nvoid Barretenberg.initSingleton({ backend: BackendType.Wasm, skipSrsInit: true, threads: 1 });\nvoid BarretenbergSync.initSingleton({ backend: BackendType.Wasm });\n\nif (!parentPort) {\n throw new Error('worker.ts must be loaded as a worker_thread');\n}\n\nconst port = parentPort;\nconst logger: Logger = createLogger('txe:worker');\n\n// The pool builds a template LMDB containing the protocol contracts + the SchnorrAccount\n// artifact on the main thread and passes its data dir via `workerData`. The dispatcher clones\n// that LMDB into a per-worker store on first use, so this worker gets a writable copy already\n// populated.\nconst dispatcherOpts: TXEDispatcherOptions = {\n contractStoreSourceDir: workerData.contractStoreSourceDir,\n schnorrClassId: workerData.schnorrClassId,\n};\nconst dispatcher = new TXEDispatcher(logger, dispatcherOpts);\n\ninterface ForeignCallRequest {\n type: 'foreign-call';\n requestId: number;\n callData: TXEForeignCallInput;\n}\n\ninterface DisposeSessionMessage {\n type: 'dispose-session';\n sessionId: number;\n}\n\ntype IncomingMessage = ForeignCallRequest | DisposeSessionMessage;\n\ninterface SerializedError {\n message: string;\n name?: string;\n stack?: string;\n}\n\nfunction serializeError(err: unknown): SerializedError {\n if (err instanceof Error) {\n return { message: err.message, name: err.name, stack: err.stack };\n }\n return { message: String(err) };\n}\n\n// Periodic memstat for diagnostic builds \u2014 set TXE_WORKER_MEMSTAT=1 to enable. Posts JS-heap\n// breakdown + active-session count back to the dispatcher so we can attribute RSS growth\n// between V8 heap (would show in heapUsed) and native (LMDB / world-state / WASM).\nif (process.env.TXE_WORKER_MEMSTAT === '1') {\n setInterval(() => {\n const m = process.memoryUsage();\n port.postMessage({\n type: 'memstat',\n sessions: activeSessionCount(),\n rss: m.rss,\n heapTotal: m.heapTotal,\n heapUsed: m.heapUsed,\n external: m.external,\n arrayBuffers: m.arrayBuffers,\n });\n }, 2000).unref();\n}\n\nport.on('message', (msg: IncomingMessage) => {\n switch (msg.type) {\n case 'foreign-call':\n void (async () => {\n try {\n const value = await dispatcher.resolve_foreign_call(msg.callData);\n port.postMessage({ type: 'result', requestId: msg.requestId, ok: true, value });\n } catch (err) {\n port.postMessage({ type: 'result', requestId: msg.requestId, ok: false, error: serializeError(err) });\n }\n })();\n return;\n case 'dispose-session':\n // Fire-and-forget; the main thread does not wait for confirmation.\n void dispatcher.disposeSession(msg.sessionId).catch(err => logger.warn(`disposeSession failed`, err));\n return;\n }\n});\n"],
|
|
5
|
+
"mappings": ";;uHAAA,OAAS,YAAa,aAAc,qBAAwB,eAG5D,OAAS,WAAY,eAAkB,sBAalC,aAAa,cAAc,CAAE,QAAS,YAAY,KAAM,YAAa,GAAM,QAAS,CAAE,CAAC,EACvF,iBAAiB,cAAc,CAAE,QAAS,YAAY,IAAK,CAAC,EAEjE,GAAI,CAAC,WACH,MAAM,IAAI,MAAM,6CAA6C,EAG/D,IAAM,KAAO,WACP,OAAiB,aAAa,YAAY,EAM1C,eAAuC,CAC3C,uBAAwB,WAAW,uBACnC,eAAgB,WAAW,cAC7B,EACM,WAAa,IAAI,cAAc,OAAQ,cAAc,EAqB3D,SAAS,eAAe,IAA+B,CACrD,OAAI,eAAe,MACV,CAAE,QAAS,IAAI,QAAS,KAAM,IAAI,KAAM,MAAO,IAAI,KAAM,EAE3D,CAAE,QAAS,OAAO,GAAG,CAAE,CAChC,CALS,wCAUL,QAAQ,IAAI,qBAAuB,KACrC,YAAY,IAAM,CAChB,IAAM,EAAI,QAAQ,YAAY,EAC9B,KAAK,YAAY,CACf,KAAM,UACN,SAAU,mBAAmB,EAC7B,IAAK,EAAE,IACP,UAAW,EAAE,UACb,SAAU,EAAE,SACZ,SAAU,EAAE,SACZ,aAAc,EAAE,YAClB,CAAC,CACH,EAAG,GAAI,EAAE,MAAM,EAGjB,KAAK,GAAG,UAAY,KAAyB,CAC3C,OAAQ,IAAI,KAAM,CAChB,IAAK,gBACG,SAAY,CAChB,GAAI,CACF,IAAM,MAAQ,MAAM,WAAW,qBAAqB,IAAI,QAAQ,EAChE,KAAK,YAAY,CAAE,KAAM,SAAU,UAAW,IAAI,UAAW,GAAI,GAAM,KAAM,CAAC,CAChF,OAAS,IAAK,CACZ,KAAK,YAAY,CAAE,KAAM,SAAU,UAAW,IAAI,UAAW,GAAI,GAAO,MAAO,eAAe,GAAG,CAAE,CAAC,CACtG,CACF,GAAG,EACH,OACF,IAAK,kBAEE,WAAW,eAAe,IAAI,SAAS,EAAE,MAAM,KAAO,OAAO,KAAK,wBAAyB,GAAG,CAAC,EACpG,MACJ,CACF,CAAC",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/dest/worker.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":""}
|
package/dest/worker.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { BackendType, Barretenberg, BarretenbergSync } from '@aztec/bb.js';
|
|
2
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
3
|
+
import { parentPort, workerData } from 'node:worker_threads';
|
|
4
|
+
// Importing `./index.js` registers the msgpackr Fr extension transitively (via
|
|
5
|
+
// ./msgpackr_fr_extension.js); this must happen before any `sendMessage` call.
|
|
6
|
+
import { TXEDispatcher, activeSessionCount } from './index.js';
|
|
7
|
+
// Seed both bb.js singletons with the WASM backend before any crypto call. `initSingleton`
|
|
8
|
+
// binds the singleton to whichever backend the first call requests, so this pre-empts the
|
|
9
|
+
// implicit `Barretenberg.initSingleton()` inside `poseidon2Hash` from `@aztec/foundation/crypto`.
|
|
10
|
+
// TXE only needs hashing (no proving, no verification), so WASM is sufficient and
|
|
11
|
+
// `skipSrsInit: true` skips the CRS load. `threads: 1` keeps the WASM backend on a single
|
|
12
|
+
// thread — additional threads would each spawn a nested worker_thread, multiplying memory cost
|
|
13
|
+
// per pool worker.
|
|
14
|
+
void Barretenberg.initSingleton({
|
|
15
|
+
backend: BackendType.Wasm,
|
|
16
|
+
skipSrsInit: true,
|
|
17
|
+
threads: 1
|
|
18
|
+
});
|
|
19
|
+
void BarretenbergSync.initSingleton({
|
|
20
|
+
backend: BackendType.Wasm
|
|
21
|
+
});
|
|
22
|
+
if (!parentPort) {
|
|
23
|
+
throw new Error('worker.ts must be loaded as a worker_thread');
|
|
24
|
+
}
|
|
25
|
+
const port = parentPort;
|
|
26
|
+
const logger = createLogger('txe:worker');
|
|
27
|
+
// The pool builds a template LMDB containing the protocol contracts + the SchnorrAccount
|
|
28
|
+
// artifact on the main thread and passes its data dir via `workerData`. The dispatcher clones
|
|
29
|
+
// that LMDB into a per-worker store on first use, so this worker gets a writable copy already
|
|
30
|
+
// populated.
|
|
31
|
+
const dispatcherOpts = {
|
|
32
|
+
contractStoreSourceDir: workerData.contractStoreSourceDir,
|
|
33
|
+
schnorrClassId: workerData.schnorrClassId
|
|
34
|
+
};
|
|
35
|
+
const dispatcher = new TXEDispatcher(logger, dispatcherOpts);
|
|
36
|
+
function serializeError(err) {
|
|
37
|
+
if (err instanceof Error) {
|
|
38
|
+
return {
|
|
39
|
+
message: err.message,
|
|
40
|
+
name: err.name,
|
|
41
|
+
stack: err.stack
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
message: String(err)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
// Periodic memstat for diagnostic builds — set TXE_WORKER_MEMSTAT=1 to enable. Posts JS-heap
|
|
49
|
+
// breakdown + active-session count back to the dispatcher so we can attribute RSS growth
|
|
50
|
+
// between V8 heap (would show in heapUsed) and native (LMDB / world-state / WASM).
|
|
51
|
+
if (process.env.TXE_WORKER_MEMSTAT === '1') {
|
|
52
|
+
setInterval(()=>{
|
|
53
|
+
const m = process.memoryUsage();
|
|
54
|
+
port.postMessage({
|
|
55
|
+
type: 'memstat',
|
|
56
|
+
sessions: activeSessionCount(),
|
|
57
|
+
rss: m.rss,
|
|
58
|
+
heapTotal: m.heapTotal,
|
|
59
|
+
heapUsed: m.heapUsed,
|
|
60
|
+
external: m.external,
|
|
61
|
+
arrayBuffers: m.arrayBuffers
|
|
62
|
+
});
|
|
63
|
+
}, 2000).unref();
|
|
64
|
+
}
|
|
65
|
+
port.on('message', (msg)=>{
|
|
66
|
+
switch(msg.type){
|
|
67
|
+
case 'foreign-call':
|
|
68
|
+
void (async ()=>{
|
|
69
|
+
try {
|
|
70
|
+
const value = await dispatcher.resolve_foreign_call(msg.callData);
|
|
71
|
+
port.postMessage({
|
|
72
|
+
type: 'result',
|
|
73
|
+
requestId: msg.requestId,
|
|
74
|
+
ok: true,
|
|
75
|
+
value
|
|
76
|
+
});
|
|
77
|
+
} catch (err) {
|
|
78
|
+
port.postMessage({
|
|
79
|
+
type: 'result',
|
|
80
|
+
requestId: msg.requestId,
|
|
81
|
+
ok: false,
|
|
82
|
+
error: serializeError(err)
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
})();
|
|
86
|
+
return;
|
|
87
|
+
case 'dispose-session':
|
|
88
|
+
// Fire-and-forget; the main thread does not wait for confirmation.
|
|
89
|
+
void dispatcher.disposeSession(msg.sessionId).catch((err)=>logger.warn(`disposeSession failed`, err));
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/txe",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.8655d4a",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"exports":
|
|
5
|
+
"exports": {
|
|
6
|
+
"./server": {
|
|
7
|
+
"types": "./dest/rpc_server.d.ts",
|
|
8
|
+
"import": "./dest/server.bundle.js"
|
|
9
|
+
}
|
|
10
|
+
},
|
|
6
11
|
"bin": "./dest/bin/index.js",
|
|
7
12
|
"typedocOptions": {
|
|
8
13
|
"entryPoints": [
|
|
@@ -12,15 +17,17 @@
|
|
|
12
17
|
"tsconfig": "./tsconfig.json"
|
|
13
18
|
},
|
|
14
19
|
"scripts": {
|
|
15
|
-
"build": "yarn clean && ../scripts/tsc.sh",
|
|
20
|
+
"build": "yarn clean && ../scripts/tsc.sh && node ./esbuild.config.mjs",
|
|
16
21
|
"build:dev": "../scripts/tsc.sh --watch",
|
|
17
22
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
18
23
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
|
|
19
24
|
"dev": "LOG_LEVEL=\"debug; trace: simulator:state_manager; info: json-rpc:proxy\" node ./dest/bin/index.js",
|
|
20
|
-
"start": "node --no-warnings ./dest/bin/index.js"
|
|
25
|
+
"start": "node --no-warnings ./dest/bin/index.js",
|
|
26
|
+
"check_txe_oracle_version": "node ./dest/bin/check_txe_oracle_version.js"
|
|
21
27
|
},
|
|
22
28
|
"inherits": [
|
|
23
|
-
"../package.common.json"
|
|
29
|
+
"../package.common.json",
|
|
30
|
+
"./package.local.json"
|
|
24
31
|
],
|
|
25
32
|
"jest": {
|
|
26
33
|
"moduleNameMapper": {
|
|
@@ -61,38 +68,47 @@
|
|
|
61
68
|
]
|
|
62
69
|
},
|
|
63
70
|
"dependencies": {
|
|
64
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
65
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
66
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
67
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
68
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
69
|
-
"@aztec/
|
|
70
|
-
"@aztec/
|
|
71
|
-
"@aztec/
|
|
72
|
-
"@aztec/
|
|
73
|
-
"@aztec/
|
|
74
|
-
"@aztec/
|
|
75
|
-
"@aztec/
|
|
76
|
-
"@aztec/
|
|
77
|
-
"@aztec/
|
|
78
|
-
"
|
|
71
|
+
"@aztec/accounts": "0.0.1-commit.8655d4a",
|
|
72
|
+
"@aztec/archiver": "0.0.1-commit.8655d4a",
|
|
73
|
+
"@aztec/aztec-node": "0.0.1-commit.8655d4a",
|
|
74
|
+
"@aztec/aztec.js": "0.0.1-commit.8655d4a",
|
|
75
|
+
"@aztec/bb-prover": "0.0.1-commit.8655d4a",
|
|
76
|
+
"@aztec/bb.js": "0.0.1-commit.8655d4a",
|
|
77
|
+
"@aztec/constants": "0.0.1-commit.8655d4a",
|
|
78
|
+
"@aztec/foundation": "0.0.1-commit.8655d4a",
|
|
79
|
+
"@aztec/key-store": "0.0.1-commit.8655d4a",
|
|
80
|
+
"@aztec/kv-store": "0.0.1-commit.8655d4a",
|
|
81
|
+
"@aztec/protocol-contracts": "0.0.1-commit.8655d4a",
|
|
82
|
+
"@aztec/pxe": "0.0.1-commit.8655d4a",
|
|
83
|
+
"@aztec/simulator": "0.0.1-commit.8655d4a",
|
|
84
|
+
"@aztec/standard-contracts": "0.0.1-commit.8655d4a",
|
|
85
|
+
"@aztec/stdlib": "0.0.1-commit.8655d4a",
|
|
86
|
+
"@aztec/world-state": "0.0.1-commit.8655d4a",
|
|
87
|
+
"msgpackr": "^1.11.2",
|
|
88
|
+
"zod": "^4"
|
|
79
89
|
},
|
|
80
90
|
"devDependencies": {
|
|
81
91
|
"@jest/globals": "^30.0.0",
|
|
82
92
|
"@types/jest": "^30.0.0",
|
|
83
93
|
"@types/node": "^22.15.17",
|
|
84
94
|
"@typescript/native-preview": "7.0.0-dev.20260113.1",
|
|
95
|
+
"esbuild": "^0.27.0",
|
|
85
96
|
"jest": "^30.0.0",
|
|
86
97
|
"jest-mock-extended": "^4.0.0",
|
|
87
98
|
"ts-node": "^10.9.1",
|
|
88
99
|
"typescript": "^5.3.3"
|
|
89
100
|
},
|
|
90
101
|
"files": [
|
|
102
|
+
"dest/bin/index.js",
|
|
103
|
+
"dest/worker.bundle.js",
|
|
104
|
+
"dest/server.bundle.js",
|
|
105
|
+
"dest/chunk-*.js",
|
|
106
|
+
"dest/*-*.js",
|
|
107
|
+
"dest/rpc_server.d.ts",
|
|
91
108
|
"dest",
|
|
92
109
|
"src",
|
|
93
110
|
"!*.test.*"
|
|
94
111
|
],
|
|
95
|
-
"types": "./dest/index.d.ts",
|
|
96
112
|
"engines": {
|
|
97
113
|
"node": ">=20.10"
|
|
98
114
|
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { keccak256String } from '@aztec/foundation/crypto/keccak';
|
|
2
|
+
import { getOracleInterfaceSignature } from '@aztec/pxe/bin';
|
|
3
|
+
|
|
4
|
+
import { dirname, join } from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
|
|
7
|
+
import { TXE_ORACLE_INTERFACE_HASH } from '../txe_oracle_version.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Verifies that the TXE oracle interfaces match the expected interface hash.
|
|
11
|
+
*
|
|
12
|
+
* The TXE oracle interfaces need to be versioned to ensure compatibility between Aztec.nr tests and TXE. This function
|
|
13
|
+
* computes a hash of the TXE oracle interfaces and compares it against a known hash. If they don't match, it means an
|
|
14
|
+
* interface has changed and the TXE oracle version needs to be bumped:
|
|
15
|
+
* - If the change is backward-breaking (e.g. removing/renaming an oracle), bump TXE_ORACLE_VERSION_MAJOR.
|
|
16
|
+
* - If the change is an oracle addition (non-breaking), bump TXE_ORACLE_VERSION_MINOR.
|
|
17
|
+
*/
|
|
18
|
+
function assertTxeOracleInterfaceMatches(): void {
|
|
19
|
+
const currentDir = dirname(fileURLToPath(import.meta.url));
|
|
20
|
+
const packageRoot = dirname(dirname(currentDir));
|
|
21
|
+
const interfacesSourcePath = join(packageRoot, 'src/oracle/interfaces.ts');
|
|
22
|
+
|
|
23
|
+
const targets = ['IAvmExecutionOracle', 'ITxeExecutionOracle'];
|
|
24
|
+
// Not an oracle foreign call handler (see TODO(F-335) in interfaces.ts).
|
|
25
|
+
const excludedMembers = ['syncContractNonOracleMethod'];
|
|
26
|
+
|
|
27
|
+
const txeOracleInterfaceSignature = getOracleInterfaceSignature(interfacesSourcePath, targets, excludedMembers);
|
|
28
|
+
|
|
29
|
+
const txeOracleInterfaceHash = keccak256String(txeOracleInterfaceSignature);
|
|
30
|
+
if (txeOracleInterfaceHash !== TXE_ORACLE_INTERFACE_HASH) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`The TXE oracle interface has changed. Update TXE_ORACLE_INTERFACE_HASH to ${txeOracleInterfaceHash} in txe/src/txe_oracle_version.ts and bump the TXE oracle version (TXE_ORACLE_VERSION_MAJOR for breaking changes, TXE_ORACLE_VERSION_MINOR for oracle additions).`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
assertTxeOracleInterfaceMatches();
|
package/src/bin/index.ts
CHANGED
|
@@ -2,7 +2,16 @@
|
|
|
2
2
|
import { createLogger } from '@aztec/aztec.js/log';
|
|
3
3
|
import { startHttpRpcServer } from '@aztec/foundation/json-rpc/server';
|
|
4
4
|
|
|
5
|
-
import { createTXERpcServer } from '../
|
|
5
|
+
import { createTXERpcServer } from '../rpc_server.js';
|
|
6
|
+
|
|
7
|
+
// Cap the native world-state thread pool before any import touches @aztec/world-state.
|
|
8
|
+
// `MAX_WORLD_STATE_THREADS` reads HARDWARE_CONCURRENCY at module load and defaults to 16; the
|
|
9
|
+
// pool's worker threads inherit `process.env`, so setting the cap here covers every worker.
|
|
10
|
+
//
|
|
11
|
+
// CAVEAT: HARDWARE_CONCURRENCY is process-global — bb prove/verify, the LMDB reader pool, and
|
|
12
|
+
// the world-state native thread pool all read it. Safe at 2 today because TXE never proves or
|
|
13
|
+
// verifies and only performs light tree updates; raise it if that ever changes.
|
|
14
|
+
process.env.HARDWARE_CONCURRENCY ??= '2';
|
|
6
15
|
|
|
7
16
|
/**
|
|
8
17
|
* Create and start a new TXE HTTP Server
|
|
@@ -23,7 +32,7 @@ async function main() {
|
|
|
23
32
|
const logger = createLogger('txe:rpc');
|
|
24
33
|
logger.info(`Setting up TXE...`);
|
|
25
34
|
|
|
26
|
-
const txeServer = createTXERpcServer(logger);
|
|
35
|
+
const txeServer = await createTXERpcServer(logger);
|
|
27
36
|
const { port } = await startHttpRpcServer(txeServer, {
|
|
28
37
|
host: '127.0.0.1',
|
|
29
38
|
port: TXE_PORT,
|
package/src/constants.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
import { PRIVATE_LOG_CIPHERTEXT_LEN } from '@aztec/constants';
|
|
1
2
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
3
|
|
|
3
4
|
export const DEFAULT_ADDRESS = AztecAddress.fromNumber(42);
|
|
5
|
+
|
|
6
|
+
// Arbitrarily set at 64 because we need a bound. Nothing inherent about it.
|
|
7
|
+
export const MAX_OFFCHAIN_EFFECTS_PER_TXE_QUERY = 64;
|
|
8
|
+
// Must match MAX_OFFCHAIN_EFFECT_LEN in noir-projects/aztec-nr/aztec/src/test/helpers/txe_oracles.nr.
|
|
9
|
+
export const MAX_OFFCHAIN_EFFECT_LEN = 2 + PRIVATE_LOG_CIPHERTEXT_LEN;
|