@aztec/pxe 0.0.1-commit.f2ce05ee → 0.0.1-commit.f5d02921e
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 +1 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +6 -0
- 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 +60 -30
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +199 -72
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +7 -7
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +19 -11
- package/dest/contract_function_simulator/index.d.ts +2 -1
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +3 -5
- 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 +7 -9
- 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 +3 -6
- 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 +5 -10
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +50 -45
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +38 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +64 -44
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +187 -97
- package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +54 -80
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +98 -85
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +90 -52
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +213 -116
- package/dest/contract_logging.d.ts +27 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +38 -0
- package/dest/contract_sync/contract_sync_service.d.ts +10 -5
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
- package/dest/contract_sync/contract_sync_service.js +72 -30
- package/dest/contract_sync/helpers.d.ts +3 -2
- package/dest/contract_sync/helpers.d.ts.map +1 -1
- package/dest/contract_sync/helpers.js +9 -4
- package/dest/debug/pxe_debug_utils.d.ts +5 -4
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +4 -4
- 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 +3 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +2 -0
- package/dest/entrypoints/server/utils.js +9 -1
- package/dest/events/event_service.d.ts +3 -2
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +16 -4
- package/dest/logs/log_service.d.ts +6 -6
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +31 -40
- package/dest/messages/message_context_service.d.ts +17 -0
- package/dest/messages/message_context_service.d.ts.map +1 -0
- package/dest/messages/message_context_service.js +36 -0
- package/dest/notes/note_service.d.ts +5 -4
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +17 -7
- 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 +63 -24
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +105 -74
- package/dest/storage/capsule_store/capsule_service.d.ts +22 -0
- package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_service.js +50 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +9 -9
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_store.js +33 -28
- package/dest/storage/capsule_store/index.d.ts +2 -1
- package/dest/storage/capsule_store/index.d.ts.map +1 -1
- package/dest/storage/capsule_store/index.js +1 -0
- 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 +140 -64
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- 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 +3 -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 +29 -28
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +141 -115
- 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 +3 -3
- 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 +13 -7
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +4 -3
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +20 -10
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -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 +36 -24
- package/package.json +16 -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 +358 -133
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -14
- package/src/contract_function_simulator/index.ts +1 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +8 -8
- 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 -9
- package/src/contract_function_simulator/oracle/interfaces.ts +63 -54
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +98 -0
- package/src/contract_function_simulator/oracle/oracle.ts +223 -139
- package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +122 -177
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +375 -131
- package/src/contract_logging.ts +52 -0
- package/src/contract_sync/contract_sync_service.ts +108 -45
- package/src/contract_sync/helpers.ts +9 -3
- package/src/debug/pxe_debug_utils.ts +11 -9
- 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 +2 -0
- package/src/entrypoints/server/utils.ts +7 -7
- package/src/events/event_service.ts +17 -4
- package/src/logs/log_service.ts +61 -63
- package/src/messages/message_context_service.ts +44 -0
- package/src/notes/note_service.ts +20 -8
- 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 +190 -117
- package/src/storage/capsule_store/capsule_service.ts +91 -0
- package/src/storage/capsule_store/capsule_store.ts +34 -26
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/contract_store/contract_store.ts +170 -71
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +8 -5
- package/src/storage/tagging_store/recipient_tagging_store.ts +9 -5
- package/src/storage/tagging_store/sender_tagging_store.ts +185 -138
- package/src/tagging/get_all_logs_by_tags.ts +28 -4
- package/src/tagging/index.ts +2 -2
- 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 +23 -10
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +26 -11
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +27 -26
- 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
|
@@ -6,6 +6,7 @@ import { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
|
6
6
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
7
|
import { BlockHash } from '@aztec/stdlib/block';
|
|
8
8
|
import { ContractClassLog, ContractClassLogFields } from '@aztec/stdlib/logs';
|
|
9
|
+
import { buildLegacyOracleCallbacks } from './legacy_oracle_mappings.js';
|
|
9
10
|
import { packAsHintedNote } from './note_packing_utils.js';
|
|
10
11
|
export class UnavailableOracleError extends Error {
|
|
11
12
|
constructor(oracleName){
|
|
@@ -14,6 +15,25 @@ export class UnavailableOracleError extends Error {
|
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
17
|
* A data source that has all the apis required by Aztec.nr.
|
|
18
|
+
*
|
|
19
|
+
* ## Oracle naming conventions
|
|
20
|
+
*
|
|
21
|
+
* We try to keep oracle naming consistent, please see below the conventions we adhere to.
|
|
22
|
+
*
|
|
23
|
+
* Each oracle method name has the form `aztec_{scope}_{verb}{Object}`, where:
|
|
24
|
+
*
|
|
25
|
+
* - **Scope prefix** indicates the execution context required:
|
|
26
|
+
* - `aztec_prv_` — available only during private function execution.
|
|
27
|
+
* - `aztec_utl_` — available during both utility and private execution.
|
|
28
|
+
*
|
|
29
|
+
* - **Verb** signals the operation's semantics (verb-first, then object):
|
|
30
|
+
* - `get` — read / lookup / get data from oracle into contract.
|
|
31
|
+
* - `does`/`is`/`has` — predicate (returns boolean).
|
|
32
|
+
* - `emit`/`notify` — propagate data from contract to oracle.
|
|
33
|
+
* - `set` — contract driven oracle state mutation (capsules, execution cache, tagging, etc).
|
|
34
|
+
* - `call` — trigger nested execution (control flow).
|
|
35
|
+
* - `assert` — validate a condition, throw on failure.
|
|
36
|
+
* - Standalone verbs (`delete`, `copy`, `decrypt`, `log`, etc) are used when no generic verb fits.
|
|
17
37
|
*/ export class Oracle {
|
|
18
38
|
handler;
|
|
19
39
|
constructor(handler){
|
|
@@ -48,11 +68,11 @@ export class UnavailableOracleError extends Error {
|
|
|
48
68
|
];
|
|
49
69
|
// Get all the oracle function names
|
|
50
70
|
const oracleNames = Object.getOwnPropertyNames(Oracle.prototype).filter((name)=>!excludedProps.includes(name));
|
|
51
|
-
// Validate oracle names - these must be prefixed with either "
|
|
71
|
+
// Validate oracle names - these must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate their scope
|
|
52
72
|
// and must correspond to a function on the Oracle class.
|
|
53
73
|
oracleNames.forEach((name)=>{
|
|
54
|
-
if (!name.startsWith('
|
|
55
|
-
throw new Error(`Oracle function "${name}" must be prefixed with either "
|
|
74
|
+
if (!name.startsWith('aztec_prv_') && !name.startsWith('aztec_utl_')) {
|
|
75
|
+
throw new Error(`Oracle function "${name}" must be prefixed with either "aztec_prv_" or "aztec_utl_" to indicate its scope`);
|
|
56
76
|
}
|
|
57
77
|
const method = this[name];
|
|
58
78
|
if (typeof method !== 'function') {
|
|
@@ -60,42 +80,53 @@ export class UnavailableOracleError extends Error {
|
|
|
60
80
|
}
|
|
61
81
|
});
|
|
62
82
|
// Build callback object and return it
|
|
63
|
-
|
|
83
|
+
const callback = oracleNames.reduce((acc, name)=>{
|
|
64
84
|
const method = this[name];
|
|
65
85
|
acc[name] = method.bind(this);
|
|
66
86
|
return acc;
|
|
67
87
|
}, {});
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
88
|
+
return {
|
|
89
|
+
...callback,
|
|
90
|
+
...buildLegacyOracleCallbacks(this)
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// eslint-disable-next-line camelcase
|
|
94
|
+
aztec_utl_assertCompatibleOracleVersion([version]) {
|
|
95
|
+
this.handlerAsMisc().assertCompatibleOracleVersion(Fr.fromString(version).toNumber());
|
|
71
96
|
return Promise.resolve([]);
|
|
72
97
|
}
|
|
73
|
-
|
|
74
|
-
|
|
98
|
+
// eslint-disable-next-line camelcase
|
|
99
|
+
aztec_utl_getRandomField() {
|
|
100
|
+
const val = this.handlerAsMisc().getRandomField();
|
|
75
101
|
return Promise.resolve([
|
|
76
102
|
toACVMField(val)
|
|
77
103
|
]);
|
|
78
104
|
}
|
|
79
|
-
|
|
80
|
-
|
|
105
|
+
// eslint-disable-next-line camelcase
|
|
106
|
+
aztec_prv_setHashPreimage(values, [hash]) {
|
|
107
|
+
this.handlerAsPrivate().setHashPreimage(values.map(Fr.fromString), Fr.fromString(hash));
|
|
81
108
|
return Promise.resolve([]);
|
|
82
109
|
}
|
|
83
|
-
|
|
84
|
-
|
|
110
|
+
// eslint-disable-next-line camelcase
|
|
111
|
+
async aztec_prv_getHashPreimage([returnsHash]) {
|
|
112
|
+
const values = await this.handlerAsPrivate().getHashPreimage(Fr.fromString(returnsHash));
|
|
85
113
|
return [
|
|
86
114
|
values.map(toACVMField)
|
|
87
115
|
];
|
|
88
116
|
}
|
|
89
|
-
|
|
90
|
-
|
|
117
|
+
// eslint-disable-next-line camelcase
|
|
118
|
+
aztec_utl_getUtilityContext() {
|
|
119
|
+
const context = this.handlerAsUtility().getUtilityContext();
|
|
91
120
|
return Promise.resolve(context.toNoirRepresentation());
|
|
92
121
|
}
|
|
93
|
-
|
|
94
|
-
|
|
122
|
+
// eslint-disable-next-line camelcase
|
|
123
|
+
async aztec_utl_getKeyValidationRequest([pkMHash]) {
|
|
124
|
+
const keyValidationRequest = await this.handlerAsUtility().getKeyValidationRequest(Fr.fromString(pkMHash));
|
|
95
125
|
return keyValidationRequest.toFields().map(toACVMField);
|
|
96
126
|
}
|
|
97
|
-
|
|
98
|
-
|
|
127
|
+
// eslint-disable-next-line camelcase
|
|
128
|
+
async aztec_utl_getContractInstance([address]) {
|
|
129
|
+
const instance = await this.handlerAsUtility().getContractInstance(AztecAddress.fromField(Fr.fromString(address)));
|
|
99
130
|
return [
|
|
100
131
|
instance.salt,
|
|
101
132
|
instance.deployer,
|
|
@@ -104,62 +135,69 @@ export class UnavailableOracleError extends Error {
|
|
|
104
135
|
...instance.publicKeys.toFields()
|
|
105
136
|
].map(toACVMField);
|
|
106
137
|
}
|
|
107
|
-
|
|
138
|
+
// eslint-disable-next-line camelcase
|
|
139
|
+
async aztec_utl_getNoteHashMembershipWitness([anchorBlockHash], [noteHash]) {
|
|
108
140
|
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
109
141
|
const parsedNoteHash = Fr.fromString(noteHash);
|
|
110
|
-
const witness = await this.handlerAsUtility().
|
|
142
|
+
const witness = await this.handlerAsUtility().getNoteHashMembershipWitness(parsedAnchorBlockHash, parsedNoteHash);
|
|
111
143
|
if (!witness) {
|
|
112
144
|
throw new Error(`Note hash ${noteHash} not found in the note hash tree at anchor block hash ${parsedAnchorBlockHash.toString()}.`);
|
|
113
145
|
}
|
|
114
146
|
return witness.toNoirRepresentation();
|
|
115
147
|
}
|
|
116
|
-
|
|
148
|
+
// eslint-disable-next-line camelcase
|
|
149
|
+
async aztec_utl_getBlockHashMembershipWitness([anchorBlockHash], [blockHash]) {
|
|
117
150
|
const parsedAnchorBlockHash = BlockHash.fromString(anchorBlockHash);
|
|
118
151
|
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
119
|
-
const witness = await this.handlerAsUtility().
|
|
152
|
+
const witness = await this.handlerAsUtility().getBlockHashMembershipWitness(parsedAnchorBlockHash, parsedBlockHash);
|
|
120
153
|
if (!witness) {
|
|
121
154
|
throw new Error(`Block hash ${parsedBlockHash.toString()} not found in the archive tree at anchor block ${parsedAnchorBlockHash.toString()}.`);
|
|
122
155
|
}
|
|
123
156
|
return witness.toNoirRepresentation();
|
|
124
157
|
}
|
|
125
|
-
|
|
158
|
+
// eslint-disable-next-line camelcase
|
|
159
|
+
async aztec_utl_getNullifierMembershipWitness([blockHash], [nullifier]) {
|
|
126
160
|
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
127
161
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
128
|
-
const witness = await this.handlerAsUtility().
|
|
162
|
+
const witness = await this.handlerAsUtility().getNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
129
163
|
if (!witness) {
|
|
130
164
|
throw new Error(`Nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`);
|
|
131
165
|
}
|
|
132
166
|
return witness.toNoirRepresentation();
|
|
133
167
|
}
|
|
134
|
-
|
|
168
|
+
// eslint-disable-next-line camelcase
|
|
169
|
+
async aztec_utl_getLowNullifierMembershipWitness([blockHash], [nullifier]) {
|
|
135
170
|
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
136
171
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
137
|
-
const witness = await this.handlerAsUtility().
|
|
172
|
+
const witness = await this.handlerAsUtility().getLowNullifierMembershipWitness(parsedBlockHash, parsedNullifier);
|
|
138
173
|
if (!witness) {
|
|
139
174
|
throw new Error(`Low nullifier witness not found for nullifier ${parsedNullifier} at block hash ${parsedBlockHash.toString()}.`);
|
|
140
175
|
}
|
|
141
176
|
return witness.toNoirRepresentation();
|
|
142
177
|
}
|
|
143
|
-
|
|
178
|
+
// eslint-disable-next-line camelcase
|
|
179
|
+
async aztec_utl_getPublicDataWitness([blockHash], [leafSlot]) {
|
|
144
180
|
const parsedBlockHash = BlockHash.fromString(blockHash);
|
|
145
181
|
const parsedLeafSlot = Fr.fromString(leafSlot);
|
|
146
|
-
const witness = await this.handlerAsUtility().
|
|
182
|
+
const witness = await this.handlerAsUtility().getPublicDataWitness(parsedBlockHash, parsedLeafSlot);
|
|
147
183
|
if (!witness) {
|
|
148
184
|
throw new Error(`Public data witness not found for slot ${parsedLeafSlot} at block hash ${parsedBlockHash.toString()}.`);
|
|
149
185
|
}
|
|
150
186
|
return witness.toNoirRepresentation();
|
|
151
187
|
}
|
|
152
|
-
|
|
188
|
+
// eslint-disable-next-line camelcase
|
|
189
|
+
async aztec_utl_getBlockHeader([blockNumber]) {
|
|
153
190
|
const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
|
|
154
|
-
const header = await this.handlerAsUtility().
|
|
191
|
+
const header = await this.handlerAsUtility().getBlockHeader(BlockNumber(parsedBlockNumber));
|
|
155
192
|
if (!header) {
|
|
156
193
|
throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
|
|
157
194
|
}
|
|
158
195
|
return header.toFields().map(toACVMField);
|
|
159
196
|
}
|
|
160
|
-
|
|
197
|
+
// eslint-disable-next-line camelcase
|
|
198
|
+
async aztec_utl_getAuthWitness([messageHash]) {
|
|
161
199
|
const messageHashField = Fr.fromString(messageHash);
|
|
162
|
-
const witness = await this.handlerAsUtility().
|
|
200
|
+
const witness = await this.handlerAsUtility().getAuthWitness(messageHashField);
|
|
163
201
|
if (!witness) {
|
|
164
202
|
throw new Error(`Unknown auth witness for message hash ${messageHashField}`);
|
|
165
203
|
}
|
|
@@ -167,9 +205,10 @@ export class UnavailableOracleError extends Error {
|
|
|
167
205
|
witness.map(toACVMField)
|
|
168
206
|
];
|
|
169
207
|
}
|
|
170
|
-
|
|
208
|
+
// eslint-disable-next-line camelcase
|
|
209
|
+
async aztec_utl_getPublicKeysAndPartialAddress([address]) {
|
|
171
210
|
const parsedAddress = AztecAddress.fromField(Fr.fromString(address));
|
|
172
|
-
const result = await this.handlerAsUtility().
|
|
211
|
+
const result = await this.handlerAsUtility().getPublicKeysAndPartialAddress(parsedAddress);
|
|
173
212
|
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
174
213
|
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
175
214
|
if (result === undefined) {
|
|
@@ -189,10 +228,11 @@ export class UnavailableOracleError extends Error {
|
|
|
189
228
|
];
|
|
190
229
|
}
|
|
191
230
|
}
|
|
192
|
-
|
|
231
|
+
// eslint-disable-next-line camelcase
|
|
232
|
+
async aztec_utl_getNotes([ownerSome], [ownerValue], [storageSlot], [numSelects], selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, [limit], [offset], [status], [maxNotes], [packedHintedNoteLength]) {
|
|
193
233
|
// Parse Option<AztecAddress>: ownerSome is 0 for None, 1 for Some
|
|
194
234
|
const owner = Fr.fromString(ownerSome).toNumber() === 1 ? AztecAddress.fromString(ownerValue) : undefined;
|
|
195
|
-
const noteDatas = await this.handlerAsUtility().
|
|
235
|
+
const noteDatas = await this.handlerAsUtility().getNotes(owner, Fr.fromString(storageSlot), +numSelects, selectByIndexes.map((s)=>+s), selectByOffsets.map((s)=>+s), selectByLengths.map((s)=>+s), selectValues.map(Fr.fromString), selectComparators.map((s)=>+s), sortByIndexes.map((s)=>+s), sortByOffsets.map((s)=>+s), sortByLengths.map((s)=>+s), sortOrder.map((s)=>+s), +limit, +offset, +status);
|
|
196
236
|
const returnDataAsArrayOfPackedHintedNotes = noteDatas.map((noteData)=>packAsHintedNote({
|
|
197
237
|
contractAddress: noteData.contractAddress,
|
|
198
238
|
owner: noteData.owner,
|
|
@@ -207,57 +247,67 @@ export class UnavailableOracleError extends Error {
|
|
|
207
247
|
// At last we convert the array of arrays to a bounded vec of arrays
|
|
208
248
|
return arrayOfArraysToBoundedVecOfArrays(returnDataAsArrayOfACVMFieldArrays, +maxNotes, +packedHintedNoteLength);
|
|
209
249
|
}
|
|
210
|
-
|
|
211
|
-
|
|
250
|
+
// eslint-disable-next-line camelcase
|
|
251
|
+
aztec_prv_notifyCreatedNote([owner], [storageSlot], [randomness], [noteTypeId], note, [noteHash], [counter]) {
|
|
252
|
+
this.handlerAsPrivate().notifyCreatedNote(AztecAddress.fromString(owner), Fr.fromString(storageSlot), Fr.fromString(randomness), NoteSelector.fromField(Fr.fromString(noteTypeId)), note.map(Fr.fromString), Fr.fromString(noteHash), +counter);
|
|
212
253
|
return Promise.resolve([]);
|
|
213
254
|
}
|
|
214
|
-
|
|
215
|
-
|
|
255
|
+
// eslint-disable-next-line camelcase
|
|
256
|
+
async aztec_prv_notifyNullifiedNote([innerNullifier], [noteHash], [counter]) {
|
|
257
|
+
await this.handlerAsPrivate().notifyNullifiedNote(Fr.fromString(innerNullifier), Fr.fromString(noteHash), +counter);
|
|
216
258
|
return [];
|
|
217
259
|
}
|
|
218
|
-
|
|
219
|
-
|
|
260
|
+
// eslint-disable-next-line camelcase
|
|
261
|
+
async aztec_prv_notifyCreatedNullifier([innerNullifier]) {
|
|
262
|
+
await this.handlerAsPrivate().notifyCreatedNullifier(Fr.fromString(innerNullifier));
|
|
220
263
|
return [];
|
|
221
264
|
}
|
|
222
|
-
|
|
223
|
-
|
|
265
|
+
// eslint-disable-next-line camelcase
|
|
266
|
+
async aztec_prv_isNullifierPending([innerNullifier], [contractAddress]) {
|
|
267
|
+
const isPending = await this.handlerAsPrivate().isNullifierPending(Fr.fromString(innerNullifier), AztecAddress.fromString(contractAddress));
|
|
224
268
|
return [
|
|
225
269
|
toACVMField(isPending)
|
|
226
270
|
];
|
|
227
271
|
}
|
|
228
|
-
|
|
229
|
-
|
|
272
|
+
// eslint-disable-next-line camelcase
|
|
273
|
+
async aztec_utl_doesNullifierExist([innerNullifier]) {
|
|
274
|
+
const exists = await this.handlerAsUtility().doesNullifierExist(Fr.fromString(innerNullifier));
|
|
230
275
|
return [
|
|
231
276
|
toACVMField(exists)
|
|
232
277
|
];
|
|
233
278
|
}
|
|
234
|
-
|
|
235
|
-
|
|
279
|
+
// eslint-disable-next-line camelcase
|
|
280
|
+
async aztec_utl_getL1ToL2MembershipWitness([contractAddress], [messageHash], [secret]) {
|
|
281
|
+
const message = await this.handlerAsUtility().getL1ToL2MembershipWitness(AztecAddress.fromString(contractAddress), Fr.fromString(messageHash), Fr.fromString(secret));
|
|
236
282
|
return message.toNoirRepresentation();
|
|
237
283
|
}
|
|
238
|
-
|
|
239
|
-
|
|
284
|
+
// eslint-disable-next-line camelcase
|
|
285
|
+
async aztec_utl_getFromPublicStorage([blockHash], [contractAddress], [startStorageSlot], [numberOfElements]) {
|
|
286
|
+
const values = await this.handlerAsUtility().getFromPublicStorage(BlockHash.fromString(blockHash), new AztecAddress(Fr.fromString(contractAddress)), Fr.fromString(startStorageSlot), +numberOfElements);
|
|
240
287
|
return [
|
|
241
288
|
values.map(toACVMField)
|
|
242
289
|
];
|
|
243
290
|
}
|
|
244
|
-
|
|
291
|
+
// eslint-disable-next-line camelcase
|
|
292
|
+
aztec_prv_notifyCreatedContractClassLog([contractAddress], message, [length], [counter]) {
|
|
245
293
|
const logFields = new ContractClassLogFields(message.map(Fr.fromString));
|
|
246
294
|
const log = new ContractClassLog(new AztecAddress(Fr.fromString(contractAddress)), logFields, +length);
|
|
247
|
-
this.handlerAsPrivate().
|
|
295
|
+
this.handlerAsPrivate().notifyCreatedContractClassLog(log, +counter);
|
|
248
296
|
return Promise.resolve([]);
|
|
249
297
|
}
|
|
250
|
-
|
|
298
|
+
// eslint-disable-next-line camelcase
|
|
299
|
+
async aztec_utl_log(level, message, _ignoredFieldsSize, fields) {
|
|
251
300
|
const levelFr = Fr.fromString(level[0]);
|
|
252
301
|
const messageStr = message.map((acvmField)=>String.fromCharCode(Fr.fromString(acvmField).toNumber())).join('');
|
|
253
302
|
const fieldsFr = fields.map(Fr.fromString);
|
|
254
|
-
await this.handlerAsMisc().
|
|
303
|
+
await this.handlerAsMisc().log(levelFr.toNumber(), messageStr, fieldsFr);
|
|
255
304
|
return [];
|
|
256
305
|
}
|
|
257
306
|
// This function's name is directly hardcoded in `circuit_recorder.ts`. Don't forget to update it there if you
|
|
258
307
|
// change the name here.
|
|
259
|
-
|
|
260
|
-
|
|
308
|
+
// eslint-disable-next-line camelcase
|
|
309
|
+
async aztec_prv_callPrivateFunction([contractAddress], [functionSelector], [argsHash], [sideEffectCounter], [isStaticCall]) {
|
|
310
|
+
const { endSideEffectCounter, returnsHash } = await this.handlerAsPrivate().callPrivateFunction(AztecAddress.fromField(Fr.fromString(contractAddress)), FunctionSelector.fromField(Fr.fromString(functionSelector)), Fr.fromString(argsHash), Fr.fromString(sideEffectCounter).toNumber(), Fr.fromString(isStaticCall).toBool());
|
|
261
311
|
return [
|
|
262
312
|
[
|
|
263
313
|
endSideEffectCounter,
|
|
@@ -265,48 +315,58 @@ export class UnavailableOracleError extends Error {
|
|
|
265
315
|
].map(toACVMField)
|
|
266
316
|
];
|
|
267
317
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
}
|
|
272
|
-
async privateNotifySetPublicTeardownFunctionCall([contractAddress], [calldataHash], [sideEffectCounter], [isStaticCall]) {
|
|
273
|
-
await this.handlerAsPrivate().privateNotifySetPublicTeardownFunctionCall(AztecAddress.fromString(contractAddress), Fr.fromString(calldataHash), Fr.fromString(sideEffectCounter).toNumber(), Fr.fromString(isStaticCall).toBool());
|
|
318
|
+
// eslint-disable-next-line camelcase
|
|
319
|
+
async aztec_prv_assertValidPublicCalldata([calldataHash]) {
|
|
320
|
+
await this.handlerAsPrivate().assertValidPublicCalldata(Fr.fromString(calldataHash));
|
|
274
321
|
return [];
|
|
275
322
|
}
|
|
276
|
-
|
|
277
|
-
|
|
323
|
+
// eslint-disable-next-line camelcase
|
|
324
|
+
async aztec_prv_notifyRevertiblePhaseStart([minRevertibleSideEffectCounter]) {
|
|
325
|
+
await this.handlerAsPrivate().notifyRevertiblePhaseStart(Fr.fromString(minRevertibleSideEffectCounter).toNumber());
|
|
278
326
|
return Promise.resolve([]);
|
|
279
327
|
}
|
|
280
|
-
|
|
281
|
-
|
|
328
|
+
// eslint-disable-next-line camelcase
|
|
329
|
+
async aztec_prv_isExecutionInRevertiblePhase([sideEffectCounter]) {
|
|
330
|
+
const isRevertible = await this.handlerAsPrivate().isExecutionInRevertiblePhase(Fr.fromString(sideEffectCounter).toNumber());
|
|
282
331
|
return Promise.resolve([
|
|
283
332
|
toACVMField(isRevertible)
|
|
284
333
|
]);
|
|
285
334
|
}
|
|
286
|
-
|
|
287
|
-
|
|
335
|
+
// eslint-disable-next-line camelcase
|
|
336
|
+
async aztec_prv_getNextAppTagAsSender([sender], [recipient]) {
|
|
337
|
+
const tag = await this.handlerAsPrivate().getNextAppTagAsSender(AztecAddress.fromString(sender), AztecAddress.fromString(recipient));
|
|
288
338
|
return [
|
|
289
339
|
toACVMField(tag.value)
|
|
290
340
|
];
|
|
291
341
|
}
|
|
292
|
-
|
|
293
|
-
|
|
342
|
+
// eslint-disable-next-line camelcase
|
|
343
|
+
async aztec_utl_getPendingTaggedLogs([pendingTaggedLogArrayBaseSlot], [scope]) {
|
|
344
|
+
await this.handlerAsUtility().getPendingTaggedLogs(Fr.fromString(pendingTaggedLogArrayBaseSlot), AztecAddress.fromString(scope));
|
|
294
345
|
return [];
|
|
295
346
|
}
|
|
296
|
-
|
|
297
|
-
|
|
347
|
+
// eslint-disable-next-line camelcase
|
|
348
|
+
async aztec_utl_validateAndStoreEnqueuedNotesAndEvents([contractAddress], [noteValidationRequestsArrayBaseSlot], [eventValidationRequestsArrayBaseSlot], [maxNotePackedLen], [maxEventSerializedLen], [scope]) {
|
|
349
|
+
await this.handlerAsUtility().validateAndStoreEnqueuedNotesAndEvents(AztecAddress.fromString(contractAddress), Fr.fromString(noteValidationRequestsArrayBaseSlot), Fr.fromString(eventValidationRequestsArrayBaseSlot), Fr.fromString(maxNotePackedLen).toNumber(), Fr.fromString(maxEventSerializedLen).toNumber(), AztecAddress.fromString(scope));
|
|
298
350
|
return [];
|
|
299
351
|
}
|
|
300
|
-
|
|
301
|
-
|
|
352
|
+
// eslint-disable-next-line camelcase
|
|
353
|
+
async aztec_utl_getLogsByTag([contractAddress], [logRetrievalRequestsArrayBaseSlot], [logRetrievalResponsesArrayBaseSlot], [scope]) {
|
|
354
|
+
await this.handlerAsUtility().getLogsByTag(AztecAddress.fromString(contractAddress), Fr.fromString(logRetrievalRequestsArrayBaseSlot), Fr.fromString(logRetrievalResponsesArrayBaseSlot), AztecAddress.fromString(scope));
|
|
302
355
|
return [];
|
|
303
356
|
}
|
|
304
|
-
|
|
305
|
-
|
|
357
|
+
// eslint-disable-next-line camelcase
|
|
358
|
+
async aztec_utl_getMessageContextsByTxHash([contractAddress], [messageContextRequestsArrayBaseSlot], [messageContextResponsesArrayBaseSlot], [scope]) {
|
|
359
|
+
await this.handlerAsUtility().getMessageContextsByTxHash(AztecAddress.fromString(contractAddress), Fr.fromString(messageContextRequestsArrayBaseSlot), Fr.fromString(messageContextResponsesArrayBaseSlot), AztecAddress.fromString(scope));
|
|
306
360
|
return [];
|
|
307
361
|
}
|
|
308
|
-
|
|
309
|
-
|
|
362
|
+
// eslint-disable-next-line camelcase
|
|
363
|
+
aztec_utl_setCapsule([contractAddress], [slot], capsule, [scope]) {
|
|
364
|
+
this.handlerAsUtility().setCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot), capsule.map(Fr.fromString), AztecAddress.fromField(Fr.fromString(scope)));
|
|
365
|
+
return Promise.resolve([]);
|
|
366
|
+
}
|
|
367
|
+
// eslint-disable-next-line camelcase
|
|
368
|
+
async aztec_utl_getCapsule([contractAddress], [slot], [tSize], [scope]) {
|
|
369
|
+
const values = await this.handlerAsUtility().getCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot), AztecAddress.fromField(Fr.fromString(scope)));
|
|
310
370
|
// We are going to return a Noir Option struct to represent the possibility of null values. Options are a struct
|
|
311
371
|
// with two fields: `some` (a boolean) and `value` (a field array in this case).
|
|
312
372
|
if (values === null) {
|
|
@@ -323,35 +383,64 @@ export class UnavailableOracleError extends Error {
|
|
|
323
383
|
];
|
|
324
384
|
}
|
|
325
385
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
386
|
+
// eslint-disable-next-line camelcase
|
|
387
|
+
aztec_utl_deleteCapsule([contractAddress], [slot], [scope]) {
|
|
388
|
+
this.handlerAsUtility().deleteCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(slot), AztecAddress.fromField(Fr.fromString(scope)));
|
|
389
|
+
return Promise.resolve([]);
|
|
329
390
|
}
|
|
330
|
-
|
|
331
|
-
|
|
391
|
+
// eslint-disable-next-line camelcase
|
|
392
|
+
async aztec_utl_copyCapsule([contractAddress], [srcSlot], [dstSlot], [numEntries], [scope]) {
|
|
393
|
+
await this.handlerAsUtility().copyCapsule(AztecAddress.fromField(Fr.fromString(contractAddress)), Fr.fromString(srcSlot), Fr.fromString(dstSlot), Fr.fromString(numEntries).toNumber(), AztecAddress.fromField(Fr.fromString(scope)));
|
|
332
394
|
return [];
|
|
333
395
|
}
|
|
334
|
-
|
|
396
|
+
// eslint-disable-next-line camelcase
|
|
397
|
+
async aztec_utl_decryptAes128(ciphertextBVecStorage, [ciphertextLength], iv, symKey) {
|
|
335
398
|
const ciphertext = fromUintBoundedVec(ciphertextBVecStorage, ciphertextLength, 8);
|
|
336
399
|
const ivBuffer = fromUintArray(iv, 8);
|
|
337
400
|
const symKeyBuffer = fromUintArray(symKey, 8);
|
|
338
|
-
|
|
339
|
-
|
|
401
|
+
// Noir Option<BoundedVec> is encoded as [is_some: Field, storage: Field[], length: Field].
|
|
402
|
+
try {
|
|
403
|
+
const plaintext = await this.handlerAsUtility().decryptAes128(ciphertext, ivBuffer, symKeyBuffer);
|
|
404
|
+
const [storage, length] = bufferToBoundedVec(plaintext, ciphertextBVecStorage.length);
|
|
405
|
+
return [
|
|
406
|
+
toACVMField(1),
|
|
407
|
+
storage,
|
|
408
|
+
length
|
|
409
|
+
];
|
|
410
|
+
} catch {
|
|
411
|
+
const zeroStorage = Array(ciphertextBVecStorage.length).fill(toACVMField(0));
|
|
412
|
+
return [
|
|
413
|
+
toACVMField(0),
|
|
414
|
+
zeroStorage,
|
|
415
|
+
toACVMField(0)
|
|
416
|
+
];
|
|
417
|
+
}
|
|
340
418
|
}
|
|
341
|
-
|
|
342
|
-
|
|
419
|
+
// eslint-disable-next-line camelcase
|
|
420
|
+
async aztec_utl_getSharedSecret([address], [ephPKField0], [ephPKField1], [ephPKField2], [contractAddress]) {
|
|
421
|
+
const secret = await this.handlerAsUtility().getSharedSecret(AztecAddress.fromField(Fr.fromString(address)), Point.fromFields([
|
|
343
422
|
ephPKField0,
|
|
344
423
|
ephPKField1,
|
|
345
424
|
ephPKField2
|
|
346
|
-
].map(Fr.fromString)));
|
|
347
|
-
return
|
|
425
|
+
].map(Fr.fromString)), AztecAddress.fromField(Fr.fromString(contractAddress)));
|
|
426
|
+
return [
|
|
427
|
+
toACVMField(secret)
|
|
428
|
+
];
|
|
429
|
+
}
|
|
430
|
+
// eslint-disable-next-line camelcase
|
|
431
|
+
aztec_utl_setContractSyncCacheInvalid([contractAddress], scopes, [scopeCount]) {
|
|
432
|
+
const scopeAddresses = scopes.slice(0, +scopeCount).map((s)=>AztecAddress.fromField(Fr.fromString(s)));
|
|
433
|
+
this.handlerAsUtility().setContractSyncCacheInvalid(AztecAddress.fromField(Fr.fromString(contractAddress)), scopeAddresses);
|
|
434
|
+
return Promise.resolve([]);
|
|
348
435
|
}
|
|
349
|
-
|
|
350
|
-
|
|
436
|
+
// eslint-disable-next-line camelcase
|
|
437
|
+
async aztec_utl_emitOffchainEffect(data) {
|
|
438
|
+
await this.handlerAsUtility().emitOffchainEffect(data.map(Fr.fromString));
|
|
351
439
|
return [];
|
|
352
440
|
}
|
|
353
|
-
|
|
354
|
-
|
|
441
|
+
// eslint-disable-next-line camelcase
|
|
442
|
+
async aztec_prv_getSenderForTags() {
|
|
443
|
+
const sender = await this.handlerAsPrivate().getSenderForTags();
|
|
355
444
|
// Return [1, address] for Some(address), [0, 0] for None
|
|
356
445
|
return sender ? [
|
|
357
446
|
toACVMField(1n),
|
|
@@ -361,8 +450,9 @@ export class UnavailableOracleError extends Error {
|
|
|
361
450
|
toACVMField(0n)
|
|
362
451
|
];
|
|
363
452
|
}
|
|
364
|
-
|
|
365
|
-
|
|
453
|
+
// eslint-disable-next-line camelcase
|
|
454
|
+
async aztec_prv_setSenderForTags([senderForTags]) {
|
|
455
|
+
await this.handlerAsPrivate().setSenderForTags(AztecAddress.fromField(Fr.fromString(senderForTags)));
|
|
366
456
|
return [];
|
|
367
457
|
}
|
|
368
458
|
}
|
|
@@ -45,11 +45,11 @@ import { Oracle } from './oracle.js';
|
|
|
45
45
|
appCircuitName: functionName
|
|
46
46
|
});
|
|
47
47
|
const contractClassLogs = privateExecutionOracle.getContractClassLogs();
|
|
48
|
-
const rawReturnValues = await privateExecutionOracle.
|
|
48
|
+
const rawReturnValues = await privateExecutionOracle.getHashPreimage(publicInputs.returnsHash);
|
|
49
49
|
const newNotes = privateExecutionOracle.getNewNotes();
|
|
50
50
|
const noteHashNullifierCounterMap = privateExecutionOracle.getNoteHashNullifierCounterMap();
|
|
51
51
|
const offchainEffects = privateExecutionOracle.getOffchainEffects();
|
|
52
|
-
const
|
|
52
|
+
const taggingIndexRanges = privateExecutionOracle.getUsedTaggingIndexRanges();
|
|
53
53
|
const nestedExecutionResults = privateExecutionOracle.getNestedExecutionResults();
|
|
54
54
|
let timerSubtractionList = nestedExecutionResults;
|
|
55
55
|
let witgenTime = duration;
|
|
@@ -59,7 +59,9 @@ import { Oracle } from './oracle.js';
|
|
|
59
59
|
timerSubtractionList = timerSubtractionList.flatMap((nested)=>nested.nestedExecutionResults ?? []);
|
|
60
60
|
}
|
|
61
61
|
log.debug(`Returning from call to ${contractAddress.toString()}:${functionSelector}`);
|
|
62
|
-
return new PrivateCallExecutionResult(artifact.bytecode, Buffer.from(artifact.verificationKey, 'base64'), partialWitness, publicInputs, newNotes, noteHashNullifierCounterMap, rawReturnValues, offchainEffects
|
|
62
|
+
return new PrivateCallExecutionResult(artifact.bytecode, Buffer.from(artifact.verificationKey, 'base64'), partialWitness, publicInputs, newNotes, noteHashNullifierCounterMap, rawReturnValues, offchainEffects.map((e)=>({
|
|
63
|
+
data: e.data
|
|
64
|
+
})), taggingIndexRanges, nestedExecutionResults, contractClassLogs, {
|
|
63
65
|
timings: {
|
|
64
66
|
witgen: witgenTime,
|
|
65
67
|
oracles: acirExecutionResult.oracles
|