@aztec/pxe 0.0.1-commit.f146247c → 0.0.1-commit.f224bb98b
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/access_scopes.d.ts +9 -0
- package/dest/access_scopes.d.ts.map +1 -0
- package/dest/access_scopes.js +6 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts +4 -2
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +7 -1
- package/dest/config/index.d.ts +2 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +54 -28
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +177 -71
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +5 -5
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +3 -3
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +2 -3
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +5 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -3
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +3 -5
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +48 -45
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +43 -44
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +148 -98
- package/dest/contract_function_simulator/oracle/private_execution.js +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +55 -68
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +99 -73
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +66 -44
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +101 -83
- package/dest/contract_logging.d.ts +22 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +23 -0
- package/dest/contract_sync/contract_sync_service.d.ts +43 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +97 -0
- package/dest/contract_sync/helpers.d.ts +29 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/{index.js → helpers.js} +13 -12
- package/dest/debug/pxe_debug_utils.d.ts +14 -10
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +16 -15
- package/dest/entrypoints/client/bundle/index.d.ts +4 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +3 -0
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +9 -1
- package/dest/entrypoints/client/lazy/index.d.ts +4 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +3 -0
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +9 -1
- package/dest/entrypoints/server/index.d.ts +4 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +3 -1
- package/dest/entrypoints/server/utils.js +9 -1
- package/dest/logs/log_service.d.ts +3 -2
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +11 -18
- package/dest/notes/note_service.d.ts +4 -3
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +3 -2
- package/dest/notes_filter.d.ts +25 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +3 -3
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
- package/dest/private_kernel/hints/index.d.ts +1 -1
- package/dest/private_kernel/hints/index.js +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +129 -68
- package/dest/private_kernel/hints/test_utils.d.ts +122 -0
- package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
- package/dest/private_kernel/hints/test_utils.js +203 -0
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +19 -11
- package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +7 -3
- package/dest/pxe.d.ts +71 -24
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +100 -64
- package/dest/storage/contract_store/contract_store.d.ts +42 -15
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +145 -69
- package/dest/storage/note_store/note_store.d.ts +3 -3
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +6 -4
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +5 -5
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +4 -4
- package/dest/tagging/get_all_logs_by_tags.d.ts +1 -1
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
- package/dest/tagging/get_all_logs_by_tags.js +17 -3
- package/dest/tagging/index.d.ts +2 -2
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -5
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +7 -7
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +6 -7
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -8
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +3 -6
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +4 -7
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +14 -15
- package/package.json +25 -16
- package/src/access_scopes.ts +9 -0
- package/src/block_synchronizer/block_synchronizer.ts +6 -0
- package/src/config/index.ts +1 -1
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +326 -131
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +5 -5
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +8 -5
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -4
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +3 -6
- package/src/contract_function_simulator/oracle/interfaces.ts +48 -54
- package/src/contract_function_simulator/oracle/oracle.ts +146 -139
- package/src/contract_function_simulator/oracle/private_execution.ts +1 -1
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +126 -164
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +149 -91
- package/src/contract_logging.ts +39 -0
- package/src/contract_sync/contract_sync_service.ts +152 -0
- package/src/contract_sync/{index.ts → helpers.ts} +21 -21
- package/src/debug/pxe_debug_utils.ts +48 -18
- package/src/entrypoints/client/bundle/index.ts +3 -0
- package/src/entrypoints/client/bundle/utils.ts +9 -1
- package/src/entrypoints/client/lazy/index.ts +3 -0
- package/src/entrypoints/client/lazy/utils.ts +9 -1
- package/src/entrypoints/server/index.ts +3 -1
- package/src/entrypoints/server/utils.ts +7 -7
- package/src/logs/log_service.ts +18 -25
- package/src/notes/note_service.ts +4 -3
- package/src/notes_filter.ts +26 -0
- package/src/oracle_version.ts +3 -3
- package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
- package/src/private_kernel/hints/index.ts +1 -1
- package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +164 -117
- package/src/private_kernel/hints/test_utils.ts +325 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +19 -12
- package/src/private_kernel/private_kernel_oracle.ts +7 -7
- package/src/pxe.ts +184 -113
- package/src/storage/contract_store/contract_store.ts +174 -75
- package/src/storage/note_store/note_store.ts +12 -5
- package/src/storage/tagging_store/recipient_tagging_store.ts +9 -5
- package/src/storage/tagging_store/sender_tagging_store.ts +8 -8
- package/src/tagging/get_all_logs_by_tags.ts +28 -4
- package/src/tagging/index.ts +1 -1
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +7 -10
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +10 -15
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +4 -9
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +11 -20
- package/dest/contract_sync/index.d.ts +0 -23
- package/dest/contract_sync/index.d.ts.map +0 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
|
@@ -69,12 +69,12 @@ export class Oracle {
|
|
|
69
69
|
name => !excludedProps.includes(name as (typeof excludedProps)[number]),
|
|
70
70
|
);
|
|
71
71
|
|
|
72
|
-
// Validate oracle names - these must be prefixed with either "
|
|
72
|
+
// Validate oracle names - these must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate their scope
|
|
73
73
|
// and must correspond to a function on the Oracle class.
|
|
74
74
|
oracleNames.forEach(name => {
|
|
75
|
-
if (!name.startsWith('
|
|
75
|
+
if (!name.startsWith('aztec_prv_') && !name.startsWith('aztec_utl_')) {
|
|
76
76
|
throw new Error(
|
|
77
|
-
`Oracle function "${name}" must be prefixed with either "
|
|
77
|
+
`Oracle function "${name}" must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate its scope`,
|
|
78
78
|
);
|
|
79
79
|
}
|
|
80
80
|
|
|
@@ -92,41 +92,46 @@ export class Oracle {
|
|
|
92
92
|
}, {} as ACIRCallback);
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
// eslint-disable-next-line camelcase
|
|
96
|
+
aztec_utl_assertCompatibleOracleVersion([version]: ACVMField[]) {
|
|
97
|
+
this.handlerAsMisc().assertCompatibleOracleVersion(Fr.fromString(version).toNumber());
|
|
97
98
|
return Promise.resolve([]);
|
|
98
99
|
}
|
|
99
100
|
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
// eslint-disable-next-line camelcase
|
|
102
|
+
aztec_utl_getRandomField(): Promise<ACVMField[]> {
|
|
103
|
+
const val = this.handlerAsMisc().getRandomField();
|
|
102
104
|
return Promise.resolve([toACVMField(val)]);
|
|
103
105
|
}
|
|
104
106
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
+
// eslint-disable-next-line camelcase
|
|
108
|
+
aztec_prv_storeInExecutionCache(values: ACVMField[], [hash]: ACVMField[]): Promise<ACVMField[]> {
|
|
109
|
+
this.handlerAsPrivate().storeInExecutionCache(values.map(Fr.fromString), Fr.fromString(hash));
|
|
107
110
|
return Promise.resolve([]);
|
|
108
111
|
}
|
|
109
112
|
|
|
110
|
-
|
|
111
|
-
|
|
113
|
+
// eslint-disable-next-line camelcase
|
|
114
|
+
async aztec_prv_loadFromExecutionCache([returnsHash]: ACVMField[]): Promise<ACVMField[][]> {
|
|
115
|
+
const values = await this.handlerAsPrivate().loadFromExecutionCache(Fr.fromString(returnsHash));
|
|
112
116
|
return [values.map(toACVMField)];
|
|
113
117
|
}
|
|
114
118
|
|
|
115
|
-
|
|
116
|
-
|
|
119
|
+
// eslint-disable-next-line camelcase
|
|
120
|
+
aztec_utl_getUtilityContext(): Promise<(ACVMField | ACVMField[])[]> {
|
|
121
|
+
const context = this.handlerAsUtility().getUtilityContext();
|
|
117
122
|
return Promise.resolve(context.toNoirRepresentation());
|
|
118
123
|
}
|
|
119
124
|
|
|
120
|
-
|
|
121
|
-
|
|
125
|
+
// eslint-disable-next-line camelcase
|
|
126
|
+
async aztec_utl_getKeyValidationRequest([pkMHash]: ACVMField[]): Promise<ACVMField[]> {
|
|
127
|
+
const keyValidationRequest = await this.handlerAsUtility().getKeyValidationRequest(Fr.fromString(pkMHash));
|
|
122
128
|
|
|
123
129
|
return keyValidationRequest.toFields().map(toACVMField);
|
|
124
130
|
}
|
|
125
131
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
);
|
|
132
|
+
// eslint-disable-next-line camelcase
|
|
133
|
+
async aztec_utl_getContractInstance([address]: ACVMField[]): Promise<ACVMField[]> {
|
|
134
|
+
const instance = await this.handlerAsUtility().getContractInstance(AztecAddress.fromField(Fr.fromString(address)));
|
|
130
135
|
|
|
131
136
|
return [
|
|
132
137
|
instance.salt,
|
|
@@ -137,17 +142,15 @@ export class Oracle {
|
|
|
137
142
|
].map(toACVMField);
|
|
138
143
|
}
|
|
139
144
|
|
|
140
|
-
|
|
145
|
+
// eslint-disable-next-line camelcase
|
|
146
|
+
async aztec_utl_getNoteHashMembershipWitness(
|
|
141
147
|
[anchorBlockHash]: ACVMField[],
|
|
142
148
|
[noteHash]: ACVMField[],
|
|
143
149
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
144
150
|
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
145
151
|
const parsedNoteHash = Fr.fromString(noteHash);
|
|
146
152
|
|
|
147
|
-
const witness = await this.handlerAsUtility().
|
|
148
|
-
parsedAnchorBlockHash,
|
|
149
|
-
parsedNoteHash,
|
|
150
|
-
);
|
|
153
|
+
const witness = await this.handlerAsUtility().getNoteHashMembershipWitness(parsedAnchorBlockHash, parsedNoteHash);
|
|
151
154
|
if (!witness) {
|
|
152
155
|
throw new Error(
|
|
153
156
|
`Note hash ${noteHash} not found in the note hash tree at anchor block hash ${parsedAnchorBlockHash.toString()}.`,
|
|
@@ -156,17 +159,15 @@ export class Oracle {
|
|
|
156
159
|
return witness.toNoirRepresentation();
|
|
157
160
|
}
|
|
158
161
|
|
|
159
|
-
|
|
162
|
+
// eslint-disable-next-line camelcase
|
|
163
|
+
async aztec_utl_getBlockHashMembershipWitness(
|
|
160
164
|
[anchorBlockHash]: ACVMField[],
|
|
161
165
|
[blockHash]: ACVMField[],
|
|
162
166
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
163
167
|
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
164
168
|
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
165
169
|
|
|
166
|
-
const witness = await this.handlerAsUtility().
|
|
167
|
-
parsedAnchorBlockHash,
|
|
168
|
-
parsedBlockHash,
|
|
169
|
-
);
|
|
170
|
+
const witness = await this.handlerAsUtility().getBlockHashMembershipWitness(parsedAnchorBlockHash, parsedBlockHash);
|
|
170
171
|
if (!witness) {
|
|
171
172
|
throw new Error(
|
|
172
173
|
`Block hash ${parsedBlockHash.toString()} not found in the archive tree at anchor block ${parsedAnchorBlockHash.toString()}.`,
|
|
@@ -175,17 +176,15 @@ export class Oracle {
|
|
|
175
176
|
return witness.toNoirRepresentation();
|
|
176
177
|
}
|
|
177
178
|
|
|
178
|
-
|
|
179
|
+
// eslint-disable-next-line camelcase
|
|
180
|
+
async aztec_utl_getNullifierMembershipWitness(
|
|
179
181
|
[blockHash]: ACVMField[],
|
|
180
182
|
[nullifier]: ACVMField[], // nullifier, we try to find the witness for (to prove inclusion)
|
|
181
183
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
182
184
|
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
183
185
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
184
186
|
|
|
185
|
-
const witness = await this.handlerAsUtility().
|
|
186
|
-
parsedBlockHash,
|
|
187
|
-
parsedNullifier,
|
|
188
|
-
);
|
|
187
|
+
const witness = await this.handlerAsUtility().getNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
189
188
|
if (!witness) {
|
|
190
189
|
throw new Error(
|
|
191
190
|
`Nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
|
|
@@ -194,17 +193,15 @@ export class Oracle {
|
|
|
194
193
|
return witness.toNoirRepresentation();
|
|
195
194
|
}
|
|
196
195
|
|
|
197
|
-
|
|
196
|
+
// eslint-disable-next-line camelcase
|
|
197
|
+
async aztec_utl_getLowNullifierMembershipWitness(
|
|
198
198
|
[blockHash]: ACVMField[],
|
|
199
199
|
[nullifier]: ACVMField[], // nullifier, we try to find the low nullifier witness for (to prove non-inclusion)
|
|
200
200
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
201
201
|
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
202
202
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
203
203
|
|
|
204
|
-
const witness = await this.handlerAsUtility().
|
|
205
|
-
parsedBlockHash,
|
|
206
|
-
parsedNullifier,
|
|
207
|
-
);
|
|
204
|
+
const witness = await this.handlerAsUtility().getLowNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
208
205
|
if (!witness) {
|
|
209
206
|
throw new Error(
|
|
210
207
|
`Low nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`,
|
|
@@ -213,14 +210,15 @@ export class Oracle {
|
|
|
213
210
|
return witness.toNoirRepresentation();
|
|
214
211
|
}
|
|
215
212
|
|
|
216
|
-
|
|
213
|
+
// eslint-disable-next-line camelcase
|
|
214
|
+
async aztec_utl_getPublicDataWitness(
|
|
217
215
|
[blockHash]: ACVMField[],
|
|
218
216
|
[leafSlot]: ACVMField[],
|
|
219
217
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
220
218
|
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
221
219
|
const parsedLeafSlot = Fr.fromString(leafSlot);
|
|
222
220
|
|
|
223
|
-
const witness = await this.handlerAsUtility().
|
|
221
|
+
const witness = await this.handlerAsUtility().getPublicDataWitness(parsedBlockHash, parsedLeafSlot);
|
|
224
222
|
if (!witness) {
|
|
225
223
|
throw new Error(
|
|
226
224
|
`Public data witness not found for slot ${parsedLeafSlot} at block hash ${parsedBlockHash.toString()}.`,
|
|
@@ -229,34 +227,45 @@ export class Oracle {
|
|
|
229
227
|
return witness.toNoirRepresentation();
|
|
230
228
|
}
|
|
231
229
|
|
|
232
|
-
|
|
230
|
+
// eslint-disable-next-line camelcase
|
|
231
|
+
async aztec_utl_getBlockHeader([blockNumber]: ACVMField[]): Promise<ACVMField[]> {
|
|
233
232
|
const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
|
|
234
233
|
|
|
235
|
-
const header = await this.handlerAsUtility().
|
|
234
|
+
const header = await this.handlerAsUtility().getBlockHeader(BlockNumber(parsedBlockNumber));
|
|
236
235
|
if (!header) {
|
|
237
236
|
throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
|
|
238
237
|
}
|
|
239
238
|
return header.toFields().map(toACVMField);
|
|
240
239
|
}
|
|
241
240
|
|
|
242
|
-
|
|
241
|
+
// eslint-disable-next-line camelcase
|
|
242
|
+
async aztec_utl_getAuthWitness([messageHash]: ACVMField[]): Promise<ACVMField[][]> {
|
|
243
243
|
const messageHashField = Fr.fromString(messageHash);
|
|
244
|
-
const witness = await this.handlerAsUtility().
|
|
244
|
+
const witness = await this.handlerAsUtility().getAuthWitness(messageHashField);
|
|
245
245
|
if (!witness) {
|
|
246
246
|
throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
|
|
247
247
|
}
|
|
248
248
|
return [witness.map(toACVMField)];
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
|
|
251
|
+
// eslint-disable-next-line camelcase
|
|
252
|
+
async aztec_utl_tryGetPublicKeysAndPartialAddress([address]: ACVMField[]): Promise<(ACVMField | ACVMField[])[]> {
|
|
252
253
|
const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
|
|
253
|
-
const
|
|
254
|
-
await this.handlerAsUtility().utilityGetPublicKeysAndPartialAddress(parsedAddress);
|
|
254
|
+
const result = await this.handlerAsUtility().tryGetPublicKeysAndPartialAddress(parsedAddress);
|
|
255
255
|
|
|
256
|
-
return
|
|
256
|
+
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
257
|
+
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
258
|
+
if (result === undefined) {
|
|
259
|
+
// No data was found so we set `some` to 0 and pad `value` with zeros get the correct return size.
|
|
260
|
+
return [toACVMField(0), Array(13).fill(toACVMField(0))];
|
|
261
|
+
} else {
|
|
262
|
+
// Data was found so we set `some` to 1 and return it along with `value`.
|
|
263
|
+
return [toACVMField(1), [...result.publicKeys.toFields(), result.partialAddress].map(toACVMField)];
|
|
264
|
+
}
|
|
257
265
|
}
|
|
258
266
|
|
|
259
|
-
|
|
267
|
+
// eslint-disable-next-line camelcase
|
|
268
|
+
async aztec_utl_getNotes(
|
|
260
269
|
[ownerSome]: ACVMField[],
|
|
261
270
|
[ownerValue]: ACVMField[],
|
|
262
271
|
[storageSlot]: ACVMField[],
|
|
@@ -278,7 +287,7 @@ export class Oracle {
|
|
|
278
287
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
279
288
|
// Parse Option<AztecAddress>: ownerSome is 0 for None, 1 for Some
|
|
280
289
|
const owner = Fr.fromString(ownerSome).toNumber() === 1 ? AztecAddress.fromString(ownerValue) : undefined;
|
|
281
|
-
const noteDatas = await this.handlerAsUtility().
|
|
290
|
+
const noteDatas = await this.handlerAsUtility().getNotes(
|
|
282
291
|
owner,
|
|
283
292
|
Fr.fromString(storageSlot),
|
|
284
293
|
+numSelects,
|
|
@@ -317,7 +326,8 @@ export class Oracle {
|
|
|
317
326
|
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedHintedNoteLength);
|
|
318
327
|
}
|
|
319
328
|
|
|
320
|
-
|
|
329
|
+
// eslint-disable-next-line camelcase
|
|
330
|
+
aztec_prv_notifyCreatedNote(
|
|
321
331
|
[owner]: ACVMField[],
|
|
322
332
|
[storageSlot]: ACVMField[],
|
|
323
333
|
[randomness]: ACVMField[],
|
|
@@ -326,7 +336,7 @@ export class Oracle {
|
|
|
326
336
|
[noteHash]: ACVMField[],
|
|
327
337
|
[counter]: ACVMField[],
|
|
328
338
|
): Promise<ACVMField[]> {
|
|
329
|
-
this.handlerAsPrivate().
|
|
339
|
+
this.handlerAsPrivate().notifyCreatedNote(
|
|
330
340
|
AztecAddress.fromString(owner),
|
|
331
341
|
Fr.fromString(storageSlot),
|
|
332
342
|
Fr.fromString(randomness),
|
|
@@ -338,43 +348,47 @@ export class Oracle {
|
|
|
338
348
|
return Promise.resolve([]);
|
|
339
349
|
}
|
|
340
350
|
|
|
341
|
-
|
|
351
|
+
// eslint-disable-next-line camelcase
|
|
352
|
+
async aztec_prv_notifyNullifiedNote(
|
|
342
353
|
[innerNullifier]: ACVMField[],
|
|
343
354
|
[noteHash]: ACVMField[],
|
|
344
355
|
[counter]: ACVMField[],
|
|
345
356
|
): Promise<ACVMField[]> {
|
|
346
|
-
await this.handlerAsPrivate().
|
|
347
|
-
Fr.fromString(innerNullifier),
|
|
348
|
-
Fr.fromString(noteHash),
|
|
349
|
-
+counter,
|
|
350
|
-
);
|
|
357
|
+
await this.handlerAsPrivate().notifyNullifiedNote(Fr.fromString(innerNullifier), Fr.fromString(noteHash), +counter);
|
|
351
358
|
return [];
|
|
352
359
|
}
|
|
353
360
|
|
|
354
|
-
|
|
355
|
-
|
|
361
|
+
// eslint-disable-next-line camelcase
|
|
362
|
+
async aztec_prv_notifyCreatedNullifier([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
|
|
363
|
+
await this.handlerAsPrivate().notifyCreatedNullifier(Fr.fromString(innerNullifier));
|
|
356
364
|
return [];
|
|
357
365
|
}
|
|
358
366
|
|
|
359
|
-
|
|
360
|
-
|
|
367
|
+
// eslint-disable-next-line camelcase
|
|
368
|
+
async aztec_prv_isNullifierPending(
|
|
369
|
+
[innerNullifier]: ACVMField[],
|
|
370
|
+
[contractAddress]: ACVMField[],
|
|
371
|
+
): Promise<ACVMField[]> {
|
|
372
|
+
const isPending = await this.handlerAsPrivate().isNullifierPending(
|
|
361
373
|
Fr.fromString(innerNullifier),
|
|
362
374
|
AztecAddress.fromString(contractAddress),
|
|
363
375
|
);
|
|
364
376
|
return [toACVMField(isPending)];
|
|
365
377
|
}
|
|
366
378
|
|
|
367
|
-
|
|
368
|
-
|
|
379
|
+
// eslint-disable-next-line camelcase
|
|
380
|
+
async aztec_utl_checkNullifierExists([innerNullifier]: ACVMField[]): Promise<ACVMField[]> {
|
|
381
|
+
const exists = await this.handlerAsUtility().checkNullifierExists(Fr.fromString(innerNullifier));
|
|
369
382
|
return [toACVMField(exists)];
|
|
370
383
|
}
|
|
371
384
|
|
|
372
|
-
|
|
385
|
+
// eslint-disable-next-line camelcase
|
|
386
|
+
async aztec_utl_getL1ToL2MembershipWitness(
|
|
373
387
|
[contractAddress]: ACVMField[],
|
|
374
388
|
[messageHash]: ACVMField[],
|
|
375
389
|
[secret]: ACVMField[],
|
|
376
390
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
377
|
-
const message = await this.handlerAsUtility().
|
|
391
|
+
const message = await this.handlerAsUtility().getL1ToL2MembershipWitness(
|
|
378
392
|
AztecAddress.fromString(contractAddress),
|
|
379
393
|
Fr.fromString(messageHash),
|
|
380
394
|
Fr.fromString(secret),
|
|
@@ -382,13 +396,14 @@ export class Oracle {
|
|
|
382
396
|
return message.toNoirRepresentation();
|
|
383
397
|
}
|
|
384
398
|
|
|
385
|
-
|
|
399
|
+
// eslint-disable-next-line camelcase
|
|
400
|
+
async aztec_utl_storageRead(
|
|
386
401
|
[blockHash]: ACVMField[],
|
|
387
402
|
[contractAddress]: ACVMField[],
|
|
388
403
|
[startStorageSlot]: ACVMField[],
|
|
389
404
|
[numberOfElements]: ACVMField[],
|
|
390
405
|
): Promise<ACVMField[][]> {
|
|
391
|
-
const values = await this.handlerAsUtility().
|
|
406
|
+
const values = await this.handlerAsUtility().storageRead(
|
|
392
407
|
BlockHash.fromString(blockHash),
|
|
393
408
|
new AztecAddress(Fr.fromString(contractAddress)),
|
|
394
409
|
Fr.fromString(startStorageSlot),
|
|
@@ -397,7 +412,8 @@ export class Oracle {
|
|
|
397
412
|
return [values.map(toACVMField)];
|
|
398
413
|
}
|
|
399
414
|
|
|
400
|
-
|
|
415
|
+
// eslint-disable-next-line camelcase
|
|
416
|
+
aztec_prv_notifyCreatedContractClassLog(
|
|
401
417
|
[contractAddress]: ACVMField[],
|
|
402
418
|
message: ACVMField[],
|
|
403
419
|
[length]: ACVMField[],
|
|
@@ -406,11 +422,12 @@ export class Oracle {
|
|
|
406
422
|
const logFields = new ContractClassLogFields(message.map(Fr.fromString));
|
|
407
423
|
const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
|
|
408
424
|
|
|
409
|
-
this.handlerAsPrivate().
|
|
425
|
+
this.handlerAsPrivate().notifyCreatedContractClassLog(log, +counter);
|
|
410
426
|
return Promise.resolve([]);
|
|
411
427
|
}
|
|
412
428
|
|
|
413
|
-
|
|
429
|
+
// eslint-disable-next-line camelcase
|
|
430
|
+
async aztec_utl_log(
|
|
414
431
|
level: ACVMField[],
|
|
415
432
|
message: ACVMField[],
|
|
416
433
|
_ignoredFieldsSize: ACVMField[],
|
|
@@ -419,20 +436,21 @@ export class Oracle {
|
|
|
419
436
|
const levelFr = Fr.fromString(level[0]);
|
|
420
437
|
const messageStr = message.map(acvmField => String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
|
|
421
438
|
const fieldsFr = fields.map(Fr.fromString);
|
|
422
|
-
this.handlerAsMisc().
|
|
423
|
-
return
|
|
439
|
+
await this.handlerAsMisc().log(levelFr.toNumber(), messageStr, fieldsFr);
|
|
440
|
+
return [];
|
|
424
441
|
}
|
|
425
442
|
|
|
426
443
|
// This function's name is directly hardcoded in `circuit_recorder.ts`. Don't forget to update it there if you
|
|
427
444
|
// change the name here.
|
|
428
|
-
|
|
445
|
+
// eslint-disable-next-line camelcase
|
|
446
|
+
async aztec_prv_callPrivateFunction(
|
|
429
447
|
[contractAddress]: ACVMField[],
|
|
430
448
|
[functionSelector]: ACVMField[],
|
|
431
449
|
[argsHash]: ACVMField[],
|
|
432
450
|
[sideEffectCounter]: ACVMField[],
|
|
433
451
|
[isStaticCall]: ACVMField[],
|
|
434
452
|
): Promise<ACVMField[][]> {
|
|
435
|
-
const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().
|
|
453
|
+
const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().callPrivateFunction(
|
|
436
454
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
437
455
|
FunctionSelector.fromField(Fr.fromString(functionSelector)),
|
|
438
456
|
Fr.fromString(argsHash),
|
|
@@ -442,85 +460,65 @@ export class Oracle {
|
|
|
442
460
|
return [[endSideEffectCounter, returnsHash].map(toACVMField)];
|
|
443
461
|
}
|
|
444
462
|
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
[sideEffectCounter]: ACVMField[],
|
|
449
|
-
[isStaticCall]: ACVMField[],
|
|
450
|
-
): Promise<ACVMField[]> {
|
|
451
|
-
await this.handlerAsPrivate().privateNotifyEnqueuedPublicFunctionCall(
|
|
452
|
-
AztecAddress.fromString(contractAddress),
|
|
453
|
-
Fr.fromString(calldataHash),
|
|
454
|
-
Fr.fromString(sideEffectCounter).toNumber(),
|
|
455
|
-
Fr.fromString(isStaticCall).toBool(),
|
|
456
|
-
);
|
|
463
|
+
// eslint-disable-next-line camelcase
|
|
464
|
+
async aztec_prv_validatePublicCalldata([calldataHash]: ACVMField[]): Promise<ACVMField[]> {
|
|
465
|
+
await this.handlerAsPrivate().validatePublicCalldata(Fr.fromString(calldataHash));
|
|
457
466
|
return [];
|
|
458
467
|
}
|
|
459
468
|
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
[sideEffectCounter]: ACVMField[],
|
|
464
|
-
[isStaticCall]: ACVMField[],
|
|
465
|
-
): Promise<ACVMField[]> {
|
|
466
|
-
await this.handlerAsPrivate().privateNotifySetPublicTeardownFunctionCall(
|
|
467
|
-
AztecAddress.fromString(contractAddress),
|
|
468
|
-
Fr.fromString(calldataHash),
|
|
469
|
-
Fr.fromString(sideEffectCounter).toNumber(),
|
|
470
|
-
Fr.fromString(isStaticCall).toBool(),
|
|
471
|
-
);
|
|
472
|
-
return [];
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
async privateNotifySetMinRevertibleSideEffectCounter([minRevertibleSideEffectCounter]: ACVMField[]): Promise<
|
|
476
|
-
ACVMField[]
|
|
477
|
-
> {
|
|
478
|
-
await this.handlerAsPrivate().privateNotifySetMinRevertibleSideEffectCounter(
|
|
479
|
-
Fr.fromString(minRevertibleSideEffectCounter).toNumber(),
|
|
480
|
-
);
|
|
469
|
+
// eslint-disable-next-line camelcase
|
|
470
|
+
async aztec_prv_notifyRevertiblePhaseStart([minRevertibleSideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
|
|
471
|
+
await this.handlerAsPrivate().notifyRevertiblePhaseStart(Fr.fromString(minRevertibleSideEffectCounter).toNumber());
|
|
481
472
|
return Promise.resolve([]);
|
|
482
473
|
}
|
|
483
474
|
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
);
|
|
475
|
+
// eslint-disable-next-line camelcase
|
|
476
|
+
async aztec_prv_inRevertiblePhase([sideEffectCounter]: ACVMField[]): Promise<ACVMField[]> {
|
|
477
|
+
const isRevertible = await this.handlerAsPrivate().inRevertiblePhase(Fr.fromString(sideEffectCounter).toNumber());
|
|
488
478
|
return Promise.resolve([toACVMField(isRevertible)]);
|
|
489
479
|
}
|
|
490
480
|
|
|
491
|
-
|
|
492
|
-
|
|
481
|
+
// eslint-disable-next-line camelcase
|
|
482
|
+
async aztec_prv_getNextAppTagAsSender([sender]: ACVMField[], [recipient]: ACVMField[]): Promise<ACVMField[]> {
|
|
483
|
+
const tag = await this.handlerAsPrivate().getNextAppTagAsSender(
|
|
493
484
|
AztecAddress.fromString(sender),
|
|
494
485
|
AztecAddress.fromString(recipient),
|
|
495
486
|
);
|
|
496
487
|
return [toACVMField(tag.value)];
|
|
497
488
|
}
|
|
498
489
|
|
|
499
|
-
|
|
500
|
-
|
|
490
|
+
// eslint-disable-next-line camelcase
|
|
491
|
+
async aztec_utl_fetchTaggedLogs([pendingTaggedLogArrayBaseSlot]: ACVMField[]): Promise<ACVMField[]> {
|
|
492
|
+
await this.handlerAsUtility().fetchTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot));
|
|
501
493
|
return [];
|
|
502
494
|
}
|
|
503
495
|
|
|
504
|
-
|
|
496
|
+
// eslint-disable-next-line camelcase
|
|
497
|
+
async aztec_utl_validateAndStoreEnqueuedNotesAndEvents(
|
|
505
498
|
[contractAddress]: ACVMField[],
|
|
506
499
|
[noteValidationRequestsArrayBaseSlot]: ACVMField[],
|
|
507
500
|
[eventValidationRequestsArrayBaseSlot]: ACVMField[],
|
|
501
|
+
[maxNotePackedLen]: ACVMField[],
|
|
502
|
+
[maxEventSerializedLen]: ACVMField[],
|
|
508
503
|
): Promise<ACVMField[]> {
|
|
509
|
-
await this.handlerAsUtility().
|
|
504
|
+
await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(
|
|
510
505
|
AztecAddress.fromString(contractAddress),
|
|
511
506
|
Fr.fromString(noteValidationRequestsArrayBaseSlot),
|
|
512
507
|
Fr.fromString(eventValidationRequestsArrayBaseSlot),
|
|
508
|
+
Fr.fromString(maxNotePackedLen).toNumber(),
|
|
509
|
+
Fr.fromString(maxEventSerializedLen).toNumber(),
|
|
513
510
|
);
|
|
514
511
|
|
|
515
512
|
return [];
|
|
516
513
|
}
|
|
517
514
|
|
|
518
|
-
|
|
515
|
+
// eslint-disable-next-line camelcase
|
|
516
|
+
async aztec_utl_bulkRetrieveLogs(
|
|
519
517
|
[contractAddress]: ACVMField[],
|
|
520
518
|
[logRetrievalRequestsArrayBaseSlot]: ACVMField[],
|
|
521
519
|
[logRetrievalResponsesArrayBaseSlot]: ACVMField[],
|
|
522
520
|
): Promise<ACVMField[]> {
|
|
523
|
-
await this.handlerAsUtility().
|
|
521
|
+
await this.handlerAsUtility().bulkRetrieveLogs(
|
|
524
522
|
AztecAddress.fromString(contractAddress),
|
|
525
523
|
Fr.fromString(logRetrievalRequestsArrayBaseSlot),
|
|
526
524
|
Fr.fromString(logRetrievalResponsesArrayBaseSlot),
|
|
@@ -528,12 +526,13 @@ export class Oracle {
|
|
|
528
526
|
return [];
|
|
529
527
|
}
|
|
530
528
|
|
|
531
|
-
|
|
529
|
+
// eslint-disable-next-line camelcase
|
|
530
|
+
async aztec_utl_storeCapsule(
|
|
532
531
|
[contractAddress]: ACVMField[],
|
|
533
532
|
[slot]: ACVMField[],
|
|
534
533
|
capsule: ACVMField[],
|
|
535
534
|
): Promise<ACVMField[]> {
|
|
536
|
-
await this.handlerAsUtility().
|
|
535
|
+
await this.handlerAsUtility().storeCapsule(
|
|
537
536
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
538
537
|
Fr.fromString(slot),
|
|
539
538
|
capsule.map(Fr.fromString),
|
|
@@ -541,12 +540,13 @@ export class Oracle {
|
|
|
541
540
|
return [];
|
|
542
541
|
}
|
|
543
542
|
|
|
544
|
-
|
|
543
|
+
// eslint-disable-next-line camelcase
|
|
544
|
+
async aztec_utl_loadCapsule(
|
|
545
545
|
[contractAddress]: ACVMField[],
|
|
546
546
|
[slot]: ACVMField[],
|
|
547
547
|
[tSize]: ACVMField[],
|
|
548
548
|
): Promise<(ACVMField | ACVMField[])[]> {
|
|
549
|
-
const values = await this.handlerAsUtility().
|
|
549
|
+
const values = await this.handlerAsUtility().loadCapsule(
|
|
550
550
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
551
551
|
Fr.fromString(slot),
|
|
552
552
|
);
|
|
@@ -562,21 +562,23 @@ export class Oracle {
|
|
|
562
562
|
}
|
|
563
563
|
}
|
|
564
564
|
|
|
565
|
-
|
|
566
|
-
|
|
565
|
+
// eslint-disable-next-line camelcase
|
|
566
|
+
async aztec_utl_deleteCapsule([contractAddress]: ACVMField[], [slot]: ACVMField[]): Promise<ACVMField[]> {
|
|
567
|
+
await this.handlerAsUtility().deleteCapsule(
|
|
567
568
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
568
569
|
Fr.fromString(slot),
|
|
569
570
|
);
|
|
570
571
|
return [];
|
|
571
572
|
}
|
|
572
573
|
|
|
573
|
-
|
|
574
|
+
// eslint-disable-next-line camelcase
|
|
575
|
+
async aztec_utl_copyCapsule(
|
|
574
576
|
[contractAddress]: ACVMField[],
|
|
575
577
|
[srcSlot]: ACVMField[],
|
|
576
578
|
[dstSlot]: ACVMField[],
|
|
577
579
|
[numEntries]: ACVMField[],
|
|
578
580
|
): Promise<ACVMField[]> {
|
|
579
|
-
await this.handlerAsUtility().
|
|
581
|
+
await this.handlerAsUtility().copyCapsule(
|
|
580
582
|
AztecAddress.fromField(Fr.fromString(contractAddress)),
|
|
581
583
|
Fr.fromString(srcSlot),
|
|
582
584
|
Fr.fromString(dstSlot),
|
|
@@ -585,7 +587,8 @@ export class Oracle {
|
|
|
585
587
|
return [];
|
|
586
588
|
}
|
|
587
589
|
|
|
588
|
-
|
|
590
|
+
// eslint-disable-next-line camelcase
|
|
591
|
+
async aztec_utl_aes128Decrypt(
|
|
589
592
|
ciphertextBVecStorage: ACVMField[],
|
|
590
593
|
[ciphertextLength]: ACVMField[],
|
|
591
594
|
iv: ACVMField[],
|
|
@@ -595,36 +598,40 @@ export class Oracle {
|
|
|
595
598
|
const ivBuffer = fromUintArray(iv, 8);
|
|
596
599
|
const symKeyBuffer = fromUintArray(symKey, 8);
|
|
597
600
|
|
|
598
|
-
const plaintext = await this.handlerAsUtility().
|
|
601
|
+
const plaintext = await this.handlerAsUtility().aes128Decrypt(ciphertext, ivBuffer, symKeyBuffer);
|
|
599
602
|
return bufferToBoundedVec(plaintext, ciphertextBVecStorage.length);
|
|
600
603
|
}
|
|
601
604
|
|
|
602
|
-
|
|
605
|
+
// eslint-disable-next-line camelcase
|
|
606
|
+
async aztec_utl_getSharedSecret(
|
|
603
607
|
[address]: ACVMField[],
|
|
604
608
|
[ephPKField0]: ACVMField[],
|
|
605
609
|
[ephPKField1]: ACVMField[],
|
|
606
610
|
[ephPKField2]: ACVMField[],
|
|
607
611
|
): Promise<ACVMField[]> {
|
|
608
|
-
const secret = await this.handlerAsUtility().
|
|
612
|
+
const secret = await this.handlerAsUtility().getSharedSecret(
|
|
609
613
|
AztecAddress.fromField(Fr.fromString(address)),
|
|
610
614
|
Point.fromFields([ephPKField0, ephPKField1, ephPKField2].map(Fr.fromString)),
|
|
611
615
|
);
|
|
612
616
|
return secret.toFields().map(toACVMField);
|
|
613
617
|
}
|
|
614
618
|
|
|
615
|
-
|
|
616
|
-
|
|
619
|
+
// eslint-disable-next-line camelcase
|
|
620
|
+
async aztec_utl_emitOffchainEffect(data: ACVMField[]) {
|
|
621
|
+
await this.handlerAsPrivate().emitOffchainEffect(data.map(Fr.fromString));
|
|
617
622
|
return [];
|
|
618
623
|
}
|
|
619
624
|
|
|
620
|
-
|
|
621
|
-
|
|
625
|
+
// eslint-disable-next-line camelcase
|
|
626
|
+
async aztec_prv_getSenderForTags(): Promise<ACVMField[]> {
|
|
627
|
+
const sender = await this.handlerAsPrivate().getSenderForTags();
|
|
622
628
|
// Return [1, address] for Some(address), [0, 0] for None
|
|
623
629
|
return sender ? [toACVMField(1n), toACVMField(sender)] : [toACVMField(0n), toACVMField(0n)];
|
|
624
630
|
}
|
|
625
631
|
|
|
626
|
-
|
|
627
|
-
|
|
632
|
+
// eslint-disable-next-line camelcase
|
|
633
|
+
async aztec_prv_setSenderForTags([senderForTags]: ACVMField[]): Promise<ACVMField[]> {
|
|
634
|
+
await this.handlerAsPrivate().setSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
|
|
628
635
|
return [];
|
|
629
636
|
}
|
|
630
637
|
}
|
|
@@ -76,7 +76,7 @@ export async function executePrivateFunction(
|
|
|
76
76
|
|
|
77
77
|
const contractClassLogs = privateExecutionOracle.getContractClassLogs();
|
|
78
78
|
|
|
79
|
-
const rawReturnValues = await privateExecutionOracle.
|
|
79
|
+
const rawReturnValues = await privateExecutionOracle.loadFromExecutionCache(publicInputs.returnsHash);
|
|
80
80
|
|
|
81
81
|
const newNotes = privateExecutionOracle.getNewNotes();
|
|
82
82
|
const noteHashNullifierCounterMap = privateExecutionOracle.getNoteHashNullifierCounterMap();
|