@aztec/stdlib 0.82.2-alpha-testnet.4 → 0.82.3
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/avm/avm.d.ts +919 -1252
- package/dest/avm/avm.d.ts.map +1 -1
- package/dest/avm/avm.js +138 -111
- package/dest/avm/avm_proving_request.d.ts +400 -575
- package/dest/avm/avm_proving_request.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts +1 -0
- package/dest/block/l2_block_downloader/l2_block_stream.d.ts.map +1 -1
- package/dest/block/l2_block_downloader/l2_block_stream.js +6 -0
- package/dest/database-version/version_manager.d.ts +4 -2
- package/dest/database-version/version_manager.d.ts.map +1 -1
- package/dest/database-version/version_manager.js +13 -9
- package/dest/epoch-helpers/index.d.ts +2 -0
- package/dest/epoch-helpers/index.d.ts.map +1 -1
- package/dest/epoch-helpers/index.js +3 -0
- package/dest/file-store/factory.d.ts +7 -0
- package/dest/file-store/factory.d.ts.map +1 -0
- package/dest/file-store/factory.js +46 -0
- package/dest/file-store/gcs.d.ts +22 -0
- package/dest/file-store/gcs.d.ts.map +1 -0
- package/dest/file-store/gcs.js +115 -0
- package/dest/file-store/http.d.ts +15 -0
- package/dest/file-store/http.d.ts.map +1 -0
- package/dest/file-store/http.js +53 -0
- package/dest/file-store/index.d.ts +3 -0
- package/dest/file-store/index.d.ts.map +1 -0
- package/dest/file-store/index.js +2 -0
- package/dest/file-store/interface.d.ts +24 -0
- package/dest/file-store/interface.d.ts.map +1 -0
- package/dest/file-store/interface.js +1 -0
- package/dest/file-store/local.d.ts +16 -0
- package/dest/file-store/local.d.ts.map +1 -0
- package/dest/file-store/local.js +40 -0
- package/dest/interfaces/aztec-node-admin.d.ts +9 -1
- package/dest/interfaces/aztec-node-admin.d.ts.map +1 -1
- package/dest/interfaces/aztec-node-admin.js +2 -1
- package/dest/interfaces/aztec-node.d.ts +3 -0
- package/dest/interfaces/aztec-node.d.ts.map +1 -1
- package/dest/interfaces/aztec-node.js +2 -0
- package/dest/interfaces/p2p.d.ts +2 -0
- package/dest/interfaces/p2p.d.ts.map +1 -1
- package/dest/interfaces/p2p.js +2 -1
- package/dest/interfaces/prover-node.d.ts +4 -0
- package/dest/interfaces/prover-node.d.ts.map +1 -1
- package/dest/interfaces/prover-node.js +5 -1
- package/dest/interfaces/proving-job.d.ts +400 -575
- package/dest/interfaces/proving-job.d.ts.map +1 -1
- package/dest/interfaces/service.d.ts +3 -0
- package/dest/interfaces/service.d.ts.map +1 -1
- package/dest/interfaces/service.js +7 -0
- package/dest/interfaces/world_state.d.ts +13 -15
- package/dest/interfaces/world_state.d.ts.map +1 -1
- package/dest/snapshots/download.d.ts +9 -0
- package/dest/snapshots/download.d.ts.map +1 -0
- package/dest/snapshots/download.js +37 -0
- package/dest/snapshots/index.d.ts +4 -0
- package/dest/snapshots/index.d.ts.map +1 -0
- package/dest/snapshots/index.js +3 -0
- package/dest/snapshots/types.d.ts +97 -0
- package/dest/snapshots/types.d.ts.map +1 -0
- package/dest/snapshots/types.js +27 -0
- package/dest/snapshots/upload.d.ts +5 -0
- package/dest/snapshots/upload.d.ts.map +1 -0
- package/dest/snapshots/upload.js +37 -0
- package/dest/tests/factories.d.ts +13 -7
- package/dest/tests/factories.d.ts.map +1 -1
- package/dest/tests/factories.js +37 -25
- package/dest/trees/merkle_tree_id.d.ts +8 -0
- package/dest/trees/merkle_tree_id.d.ts.map +1 -1
- package/dest/trees/merkle_tree_id.js +10 -0
- package/dest/trees/nullifier_leaf.d.ts +11 -2
- package/dest/trees/nullifier_leaf.d.ts.map +1 -1
- package/dest/trees/nullifier_leaf.js +12 -7
- package/dest/trees/nullifier_membership_witness.d.ts +7 -7
- package/dest/trees/public_data_leaf.d.ts +13 -0
- package/dest/trees/public_data_leaf.d.ts.map +1 -1
- package/dest/trees/public_data_leaf.js +6 -0
- package/dest/trees/public_data_witness.d.ts +7 -7
- package/dest/validators/index.d.ts +3 -0
- package/dest/validators/index.d.ts.map +1 -0
- package/dest/validators/index.js +1 -0
- package/dest/validators/schemas.d.ts +342 -0
- package/dest/validators/schemas.d.ts.map +1 -0
- package/dest/validators/schemas.js +40 -0
- package/dest/validators/types.d.ts +39 -0
- package/dest/validators/types.d.ts.map +1 -0
- package/dest/validators/types.js +1 -0
- package/package.json +11 -7
- package/src/avm/avm.ts +131 -106
- package/src/block/l2_block_downloader/l2_block_stream.ts +6 -0
- package/src/database-version/version_manager.ts +12 -8
- package/src/epoch-helpers/index.ts +8 -0
- package/src/file-store/factory.ts +61 -0
- package/src/file-store/gcs.ts +121 -0
- package/src/file-store/http.ts +58 -0
- package/src/file-store/index.ts +2 -0
- package/src/file-store/interface.ts +19 -0
- package/src/file-store/local.ts +46 -0
- package/src/interfaces/aztec-node-admin.ts +11 -1
- package/src/interfaces/aztec-node.ts +7 -0
- package/src/interfaces/p2p.ts +4 -0
- package/src/interfaces/prover-node.ts +10 -0
- package/src/interfaces/service.ts +13 -0
- package/src/interfaces/world_state.ts +17 -15
- package/src/snapshots/download.ts +60 -0
- package/src/snapshots/index.ts +3 -0
- package/src/snapshots/types.ts +58 -0
- package/src/snapshots/upload.ts +53 -0
- package/src/tests/factories.ts +74 -54
- package/src/trees/merkle_tree_id.ts +12 -0
- package/src/trees/nullifier_leaf.ts +9 -5
- package/src/trees/public_data_leaf.ts +9 -0
- package/src/validators/index.ts +3 -0
- package/src/validators/schemas.ts +53 -0
- package/src/validators/types.ts +37 -0
package/dest/avm/avm.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avm.d.ts","sourceRoot":"","sources":["../../src/avm/avm.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"avm.d.ts","sourceRoot":"","sources":["../../src/avm/avm.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAK9C,OAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAYhB;IAEM,wBAAwB,IAAI,MAAM;IAKlC,QAAQ,IAAI,MAAM;IAGzB,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;CAG9B"}
|
package/dest/avm/avm.js
CHANGED
|
@@ -1,33 +1,16 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
1
|
import { jsonParseWithSchema, jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
2
|
import { schemas } from '@aztec/foundation/schemas';
|
|
4
3
|
import { z } from 'zod';
|
|
5
4
|
import { AztecAddress } from '../aztec-address/index.js';
|
|
6
5
|
import { PublicKeys } from '../keys/public_keys.js';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { AppendOnlyTreeSnapshot } from '../trees/append_only_tree_snapshot.js';
|
|
7
|
+
import { NullifierLeaf } from '../trees/nullifier_leaf.js';
|
|
8
|
+
import { PublicDataTreeLeaf } from '../trees/public_data_leaf.js';
|
|
9
9
|
import { AvmCircuitPublicInputs } from './avm_circuit_public_inputs.js';
|
|
10
10
|
import { serializeWithMessagePack } from './message_pack.js';
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
calldata;
|
|
15
|
-
isStaticCall;
|
|
16
|
-
constructor(msgSender, contractAddress, calldata, isStaticCall){
|
|
17
|
-
this.msgSender = msgSender;
|
|
18
|
-
this.contractAddress = contractAddress;
|
|
19
|
-
this.calldata = calldata;
|
|
20
|
-
this.isStaticCall = isStaticCall;
|
|
21
|
-
}
|
|
22
|
-
static get schema() {
|
|
23
|
-
return z.object({
|
|
24
|
-
msgSender: AztecAddress.schema,
|
|
25
|
-
contractAddress: AztecAddress.schema,
|
|
26
|
-
calldata: schemas.Fr.array(),
|
|
27
|
-
isStaticCall: z.boolean()
|
|
28
|
-
}).transform(({ msgSender, contractAddress, calldata, isStaticCall })=>new AvmEnqueuedCallHint(msgSender, contractAddress, calldata, isStaticCall));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
11
|
+
////////////////////////////////////////////////////////////////////////////
|
|
12
|
+
// Hints (contracts)
|
|
13
|
+
////////////////////////////////////////////////////////////////////////////
|
|
31
14
|
export class AvmContractClassHint {
|
|
32
15
|
classId;
|
|
33
16
|
artifactHash;
|
|
@@ -91,90 +74,138 @@ export class AvmContractInstanceHint {
|
|
|
91
74
|
}).transform(({ address, salt, deployer, currentContractClassId, originalContractClassId, initializationHash, publicKeys })=>new AvmContractInstanceHint(address, salt, deployer, currentContractClassId, originalContractClassId, initializationHash, publicKeys));
|
|
92
75
|
}
|
|
93
76
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
77
|
+
////////////////////////////////////////////////////////////////////////////
|
|
78
|
+
// Hints (merkle db)
|
|
79
|
+
////////////////////////////////////////////////////////////////////////////
|
|
80
|
+
// Hint for MerkleTreeDB.getSiblingPath.
|
|
81
|
+
export class AvmGetSiblingPathHint {
|
|
82
|
+
hintKey;
|
|
83
|
+
treeId;
|
|
84
|
+
index;
|
|
85
|
+
path;
|
|
86
|
+
constructor(hintKey, // params
|
|
87
|
+
treeId, index, // return
|
|
88
|
+
path){
|
|
89
|
+
this.hintKey = hintKey;
|
|
90
|
+
this.treeId = treeId;
|
|
91
|
+
this.index = index;
|
|
92
|
+
this.path = path;
|
|
102
93
|
}
|
|
103
94
|
static get schema() {
|
|
104
95
|
return z.object({
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
96
|
+
hintKey: AppendOnlyTreeSnapshot.schema,
|
|
97
|
+
treeId: z.number().int().nonnegative(),
|
|
98
|
+
index: schemas.BigInt,
|
|
99
|
+
path: schemas.Fr.array()
|
|
100
|
+
}).transform(({ hintKey, treeId, index, path })=>new AvmGetSiblingPathHint(hintKey, treeId, index, path));
|
|
109
101
|
}
|
|
110
102
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
103
|
+
// Hint for MerkleTreeDB.getPreviousValueIndex.
|
|
104
|
+
export class AvmGetPreviousValueIndexHint {
|
|
105
|
+
hintKey;
|
|
106
|
+
treeId;
|
|
107
|
+
value;
|
|
108
|
+
index;
|
|
109
|
+
alreadyPresent;
|
|
110
|
+
constructor(hintKey, // params
|
|
111
|
+
treeId, value, // return
|
|
112
|
+
index, alreadyPresent){
|
|
113
|
+
this.hintKey = hintKey;
|
|
114
|
+
this.treeId = treeId;
|
|
115
|
+
this.value = value;
|
|
116
|
+
this.index = index;
|
|
117
|
+
this.alreadyPresent = alreadyPresent;
|
|
117
118
|
}
|
|
118
119
|
static get schema() {
|
|
119
120
|
return z.object({
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
hintKey: AppendOnlyTreeSnapshot.schema,
|
|
122
|
+
treeId: z.number().int().nonnegative(),
|
|
123
|
+
value: schemas.Fr,
|
|
124
|
+
index: schemas.BigInt,
|
|
125
|
+
alreadyPresent: z.boolean()
|
|
126
|
+
}).transform(({ hintKey, treeId, value, index, alreadyPresent })=>new AvmGetPreviousValueIndexHint(hintKey, treeId, value, index, alreadyPresent));
|
|
123
127
|
}
|
|
124
128
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
129
|
+
// Hint for MerkleTreeDB.getLeafPreimage.
|
|
130
|
+
// NOTE: I need this factory because in order to get hold of the schema, I need an actual instance of the class,
|
|
131
|
+
// having the type doesn't suffice since TS does type erasure in the end.
|
|
132
|
+
function AvmGetLeafPreimageHintFactory(klass) {
|
|
133
|
+
return class AvmGetLeafPreimageHint {
|
|
134
|
+
hintKey;
|
|
135
|
+
index;
|
|
136
|
+
leaf;
|
|
137
|
+
nextIndex;
|
|
138
|
+
nextValue;
|
|
139
|
+
constructor(hintKey, // params (tree id will be implicit)
|
|
140
|
+
index, // return
|
|
141
|
+
leaf, nextIndex, nextValue){
|
|
142
|
+
this.hintKey = hintKey;
|
|
143
|
+
this.index = index;
|
|
144
|
+
this.leaf = leaf;
|
|
145
|
+
this.nextIndex = nextIndex;
|
|
146
|
+
this.nextValue = nextValue;
|
|
147
|
+
}
|
|
148
|
+
static get schema() {
|
|
149
|
+
return z.object({
|
|
150
|
+
hintKey: AppendOnlyTreeSnapshot.schema,
|
|
151
|
+
index: schemas.BigInt,
|
|
152
|
+
leaf: klass.schema,
|
|
153
|
+
nextIndex: schemas.BigInt,
|
|
154
|
+
nextValue: schemas.Fr
|
|
155
|
+
}).transform(({ hintKey, index, leaf, nextIndex, nextValue })=>new AvmGetLeafPreimageHint(hintKey, index, leaf, nextIndex, nextValue));
|
|
156
|
+
}
|
|
157
|
+
};
|
|
141
158
|
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
159
|
+
// Note: only supported for PUBLIC_DATA_TREE and NULLIFIER_TREE.
|
|
160
|
+
export class AvmGetLeafPreimageHintPublicDataTree extends AvmGetLeafPreimageHintFactory(PublicDataTreeLeaf) {
|
|
161
|
+
}
|
|
162
|
+
export class AvmGetLeafPreimageHintNullifierTree extends AvmGetLeafPreimageHintFactory(NullifierLeaf) {
|
|
163
|
+
}
|
|
164
|
+
// Hint for MerkleTreeDB.getLeafValue.
|
|
165
|
+
// Note: only supported for NOTE_HASH_TREE and L1_TO_L2_MESSAGE_TREE.
|
|
166
|
+
export class AvmGetLeafValueHint {
|
|
167
|
+
hintKey;
|
|
168
|
+
treeId;
|
|
169
|
+
index;
|
|
170
|
+
value;
|
|
171
|
+
constructor(hintKey, // params
|
|
172
|
+
treeId, index, // return
|
|
173
|
+
value){
|
|
174
|
+
this.hintKey = hintKey;
|
|
175
|
+
this.treeId = treeId;
|
|
176
|
+
this.index = index;
|
|
177
|
+
this.value = value;
|
|
153
178
|
}
|
|
154
179
|
static get schema() {
|
|
155
180
|
return z.object({
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
181
|
+
hintKey: AppendOnlyTreeSnapshot.schema,
|
|
182
|
+
treeId: z.number().int().nonnegative(),
|
|
183
|
+
index: schemas.BigInt,
|
|
184
|
+
value: schemas.Fr
|
|
185
|
+
}).transform(({ hintKey, treeId, index, value })=>new AvmGetLeafValueHint(hintKey, treeId, index, value));
|
|
160
186
|
}
|
|
161
187
|
}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
188
|
+
////////////////////////////////////////////////////////////////////////////
|
|
189
|
+
// Hints (other)
|
|
190
|
+
////////////////////////////////////////////////////////////////////////////
|
|
191
|
+
export class AvmEnqueuedCallHint {
|
|
192
|
+
msgSender;
|
|
193
|
+
contractAddress;
|
|
194
|
+
calldata;
|
|
195
|
+
isStaticCall;
|
|
196
|
+
constructor(msgSender, contractAddress, calldata, isStaticCall){
|
|
197
|
+
this.msgSender = msgSender;
|
|
198
|
+
this.contractAddress = contractAddress;
|
|
199
|
+
this.calldata = calldata;
|
|
200
|
+
this.isStaticCall = isStaticCall;
|
|
171
201
|
}
|
|
172
202
|
static get schema() {
|
|
173
203
|
return z.object({
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
204
|
+
msgSender: AztecAddress.schema,
|
|
205
|
+
contractAddress: AztecAddress.schema,
|
|
206
|
+
calldata: schemas.Fr.array(),
|
|
207
|
+
isStaticCall: z.boolean()
|
|
208
|
+
}).transform(({ msgSender, contractAddress, calldata, isStaticCall })=>new AvmEnqueuedCallHint(msgSender, contractAddress, calldata, isStaticCall));
|
|
178
209
|
}
|
|
179
210
|
}
|
|
180
211
|
export class AvmExecutionHints {
|
|
@@ -182,25 +213,23 @@ export class AvmExecutionHints {
|
|
|
182
213
|
contractInstances;
|
|
183
214
|
contractClasses;
|
|
184
215
|
bytecodeCommitments;
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
216
|
+
getSiblingPathHints;
|
|
217
|
+
getPreviousValueIndexHints;
|
|
218
|
+
getLeafPreimageHintsPublicDataTree;
|
|
219
|
+
getLeafPreimageHintsNullifierTree;
|
|
220
|
+
getLeafValueHints;
|
|
221
|
+
constructor(enqueuedCalls = [], // Contract hints.
|
|
222
|
+
contractInstances = [], contractClasses = [], bytecodeCommitments = [], // Merkle DB hints.
|
|
223
|
+
getSiblingPathHints = [], getPreviousValueIndexHints = [], getLeafPreimageHintsPublicDataTree = [], getLeafPreimageHintsNullifierTree = [], getLeafValueHints = []){
|
|
193
224
|
this.enqueuedCalls = enqueuedCalls;
|
|
194
225
|
this.contractInstances = contractInstances;
|
|
195
226
|
this.contractClasses = contractClasses;
|
|
196
227
|
this.bytecodeCommitments = bytecodeCommitments;
|
|
197
|
-
this.
|
|
198
|
-
this.
|
|
199
|
-
this.
|
|
200
|
-
this.
|
|
201
|
-
this.
|
|
202
|
-
this.noteHashWrites = noteHashWrites;
|
|
203
|
-
this.l1ToL2MessageReads = l1ToL2MessageReads;
|
|
228
|
+
this.getSiblingPathHints = getSiblingPathHints;
|
|
229
|
+
this.getPreviousValueIndexHints = getPreviousValueIndexHints;
|
|
230
|
+
this.getLeafPreimageHintsPublicDataTree = getLeafPreimageHintsPublicDataTree;
|
|
231
|
+
this.getLeafPreimageHintsNullifierTree = getLeafPreimageHintsNullifierTree;
|
|
232
|
+
this.getLeafValueHints = getLeafValueHints;
|
|
204
233
|
}
|
|
205
234
|
static empty() {
|
|
206
235
|
return new AvmExecutionHints();
|
|
@@ -211,14 +240,12 @@ export class AvmExecutionHints {
|
|
|
211
240
|
contractInstances: AvmContractInstanceHint.schema.array(),
|
|
212
241
|
contractClasses: AvmContractClassHint.schema.array(),
|
|
213
242
|
bytecodeCommitments: AvmBytecodeCommitmentHint.schema.array(),
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
l1ToL2MessageReads: AvmAppendTreeHint.schema.array()
|
|
221
|
-
}).transform(({ enqueuedCalls, contractInstances, contractClasses, bytecodeCommitments, publicDataReads, publicDataWrites, nullifierReads, nullifierWrites, noteHashReads, noteHashWrites, l1ToL2MessageReads })=>new AvmExecutionHints(enqueuedCalls, contractInstances, contractClasses, bytecodeCommitments, publicDataReads, publicDataWrites, nullifierReads, nullifierWrites, noteHashReads, noteHashWrites, l1ToL2MessageReads));
|
|
243
|
+
getSiblingPathHints: AvmGetSiblingPathHint.schema.array(),
|
|
244
|
+
getPreviousValueIndexHints: AvmGetPreviousValueIndexHint.schema.array(),
|
|
245
|
+
getLeafPreimageHintsPublicDataTree: AvmGetLeafPreimageHintPublicDataTree.schema.array(),
|
|
246
|
+
getLeafPreimageHintsNullifierTree: AvmGetLeafPreimageHintNullifierTree.schema.array(),
|
|
247
|
+
getLeafValueHints: AvmGetLeafValueHint.schema.array()
|
|
248
|
+
}).transform(({ enqueuedCalls, contractInstances, contractClasses, bytecodeCommitments, getSiblingPathHints, getPreviousValueIndexHints, getLeafPreimageHintsPublicDataTree, getLeafPreimageHintsNullifierTree, getLeafValueHints })=>new AvmExecutionHints(enqueuedCalls, contractInstances, contractClasses, bytecodeCommitments, getSiblingPathHints, getPreviousValueIndexHints, getLeafPreimageHintsPublicDataTree, getLeafPreimageHintsNullifierTree, getLeafValueHints));
|
|
222
249
|
}
|
|
223
250
|
}
|
|
224
251
|
export class AvmCircuitInputs {
|