@aztec/pxe 0.0.1-commit.3469e52 → 0.0.1-commit.35158ae7e
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/bin/check_oracle_version.js +1 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts +9 -5
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +62 -16
- package/dest/config/index.d.ts +4 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +18 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +61 -31
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +201 -78
- 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 -4
- 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 +6 -5
- 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/message_tx_context.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.js +57 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +3 -5
- 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 +4 -6
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +54 -46
- 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 +42 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +45 -42
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +201 -110
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -22
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +5 -40
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +60 -77
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +110 -86
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +104 -54
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +216 -119
- 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 +45 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +114 -0
- package/dest/contract_sync/helpers.d.ts +29 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/helpers.js +55 -0
- package/dest/debug/pxe_debug_utils.d.ts +24 -10
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +28 -17
- 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 +21 -7
- 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 +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +22 -8
- package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +4 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +3 -0
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +28 -9
- package/dest/events/event_service.d.ts +5 -6
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +6 -7
- package/dest/job_coordinator/job_coordinator.d.ts +3 -2
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
- package/dest/job_coordinator/job_coordinator.js +3 -2
- package/dest/logs/log_service.d.ts +7 -5
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +28 -32
- 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 +9 -8
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +17 -16
- 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 +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +5 -4
- 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 +3 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +21 -13
- package/dest/private_kernel/private_kernel_oracle.d.ts +8 -4
- 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 +74 -24
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +134 -80
- package/dest/storage/address_store/address_store.d.ts +1 -1
- package/dest/storage/address_store/address_store.d.ts.map +1 -1
- package/dest/storage/address_store/address_store.js +12 -11
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
- package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
- package/dest/storage/capsule_store/capsule_store.js +6 -8
- package/dest/storage/contract_store/contract_store.d.ts +42 -16
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +157 -84
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +47 -49
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +278 -252
- package/dest/storage/note_store/stored_note.d.ts +16 -0
- package/dest/storage/note_store/stored_note.d.ts.map +1 -0
- package/dest/storage/note_store/stored_note.js +43 -0
- package/dest/storage/private_event_store/private_event_store.d.ts +17 -4
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
- package/dest/storage/private_event_store/private_event_store.js +198 -147
- package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
- package/dest/storage/private_event_store/stored_private_event.js +56 -0
- 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/recipient_tagging_store.js +31 -19
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
- 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 +233 -137
- package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +60 -0
- package/dest/tagging/index.d.ts +4 -3
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +2 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +5 -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 +7 -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 +16 -12
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +5 -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 +23 -16
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +6 -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 +42 -27
- package/package.json +25 -16
- package/src/access_scopes.ts +9 -0
- package/src/bin/check_oracle_version.ts +1 -0
- package/src/block_synchronizer/block_synchronizer.ts +76 -33
- package/src/config/index.ts +15 -1
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +361 -142
- 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 +9 -6
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -4
- package/src/contract_function_simulator/noir-structs/message_tx_context.ts +55 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +4 -7
- package/src/contract_function_simulator/oracle/interfaces.ts +67 -58
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +135 -0
- package/src/contract_function_simulator/oracle/oracle.ts +217 -149
- package/src/contract_function_simulator/oracle/private_execution.ts +5 -64
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +150 -182
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +330 -134
- package/src/contract_logging.ts +39 -0
- package/src/contract_sync/contract_sync_service.ts +181 -0
- package/src/contract_sync/helpers.ts +98 -0
- package/src/debug/pxe_debug_utils.ts +63 -18
- package/src/entrypoints/client/bundle/index.ts +3 -0
- package/src/entrypoints/client/bundle/utils.ts +16 -15
- package/src/entrypoints/client/lazy/index.ts +3 -0
- package/src/entrypoints/client/lazy/utils.ts +17 -15
- package/src/entrypoints/pxe_creation_options.ts +2 -1
- package/src/entrypoints/server/index.ts +3 -0
- package/src/entrypoints/server/utils.ts +22 -26
- package/src/events/event_service.ts +5 -7
- package/src/job_coordinator/job_coordinator.ts +4 -3
- package/src/logs/log_service.ts +48 -39
- package/src/messages/message_context_service.ts +45 -0
- package/src/notes/note_service.ts +24 -22
- package/src/notes_filter.ts +26 -0
- package/src/oracle_version.ts +5 -4
- 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 +25 -15
- package/src/private_kernel/private_kernel_oracle.ts +9 -9
- package/src/pxe.ts +261 -126
- package/src/storage/address_store/address_store.ts +15 -15
- package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
- package/src/storage/capsule_store/capsule_store.ts +8 -8
- package/src/storage/contract_store/contract_store.ts +186 -96
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +321 -318
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/private_event_store/private_event_store.ts +250 -190
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +38 -24
- package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
- package/src/storage/tagging_store/sender_tagging_store.ts +287 -156
- package/src/tagging/get_all_logs_by_tags.ts +92 -0
- package/src/tagging/index.ts +3 -2
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +17 -10
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +17 -16
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +25 -10
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +29 -26
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +39 -29
- 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
- package/dest/tree_membership/tree_membership_service.d.ts +0 -50
- package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
- package/dest/tree_membership/tree_membership_service.js +0 -75
- package/src/tree_membership/tree_membership_service.ts +0 -97
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ExtendedDirectionalAppTaggingSecret, type TaggingIndexRange } from '@aztec/stdlib/logs';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* A map that stores the tagging index for a given directional app tagging secret.
|
|
4
|
+
* A map that stores the tagging index range for a given extended directional app tagging secret.
|
|
5
5
|
* Note: The directional app tagging secret is unique for a (sender, recipient, contract) tuple while the direction
|
|
6
6
|
* of sender -> recipient matters.
|
|
7
7
|
*/
|
|
8
8
|
export class ExecutionTaggingIndexCache {
|
|
9
|
-
private taggingIndexMap: Map<string, number> = new Map();
|
|
9
|
+
private taggingIndexMap: Map<string, { lowestIndex: number; highestIndex: number }> = new Map();
|
|
10
10
|
|
|
11
|
-
public getLastUsedIndex(secret:
|
|
12
|
-
return this.taggingIndexMap.get(secret.toString());
|
|
11
|
+
public getLastUsedIndex(secret: ExtendedDirectionalAppTaggingSecret): number | undefined {
|
|
12
|
+
return this.taggingIndexMap.get(secret.toString())?.highestIndex;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
public setLastUsedIndex(secret:
|
|
15
|
+
public setLastUsedIndex(secret: ExtendedDirectionalAppTaggingSecret, index: number) {
|
|
16
16
|
const currentValue = this.taggingIndexMap.get(secret.toString());
|
|
17
|
-
if (currentValue !== undefined && currentValue !== index - 1) {
|
|
18
|
-
throw new Error(`Invalid tagging index update. Current value: ${currentValue}, new value: ${index}`);
|
|
17
|
+
if (currentValue !== undefined && currentValue.highestIndex !== index - 1) {
|
|
18
|
+
throw new Error(`Invalid tagging index update. Current value: ${currentValue.highestIndex}, new value: ${index}`);
|
|
19
|
+
}
|
|
20
|
+
if (currentValue !== undefined) {
|
|
21
|
+
currentValue.highestIndex = index;
|
|
22
|
+
} else {
|
|
23
|
+
this.taggingIndexMap.set(secret.toString(), { lowestIndex: index, highestIndex: index });
|
|
19
24
|
}
|
|
20
|
-
this.taggingIndexMap.set(secret.toString(), index);
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
/**
|
|
24
|
-
* Returns the
|
|
28
|
+
* Returns the tagging index ranges that were used in this execution (and that need to be stored in the db).
|
|
25
29
|
*/
|
|
26
|
-
public
|
|
27
|
-
return Array.from(this.taggingIndexMap.entries()).map(([secret,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
public getUsedTaggingIndexRanges(): TaggingIndexRange[] {
|
|
31
|
+
return Array.from(this.taggingIndexMap.entries()).map(([secret, { lowestIndex, highestIndex }]) => ({
|
|
32
|
+
extendedSecret: ExtendedDirectionalAppTaggingSecret.fromString(secret),
|
|
33
|
+
lowestIndex,
|
|
34
|
+
highestIndex,
|
|
30
35
|
}));
|
|
31
36
|
}
|
|
32
37
|
}
|
|
@@ -4,6 +4,7 @@ export { HashedValuesCache } from './hashed_values_cache.js';
|
|
|
4
4
|
export { pickNotes } from './pick_notes.js';
|
|
5
5
|
export type { NoteData, IMiscOracle, IUtilityExecutionOracle, IPrivateExecutionOracle } from './oracle/interfaces.js';
|
|
6
6
|
export { MessageLoadOracleInputs } from './oracle/message_load_oracle_inputs.js';
|
|
7
|
+
export { MessageContextService } from '../messages/message_context_service.js';
|
|
7
8
|
export { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
8
9
|
export { PrivateExecutionOracle } from './oracle/private_execution_oracle.js';
|
|
9
10
|
export { Oracle } from './oracle/oracle.js';
|
|
@@ -4,11 +4,8 @@ import { EventSelector } from '@aztec/stdlib/abi';
|
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
5
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
6
6
|
|
|
7
|
-
// TODO(#14617): should we compute this from constants? This value is aztec-nr specific.
|
|
8
|
-
const MAX_EVENT_SERIALIZED_LEN = 12;
|
|
9
|
-
|
|
10
7
|
/**
|
|
11
|
-
* Intermediate struct used to perform batch event validation by PXE. The `
|
|
8
|
+
* Intermediate struct used to perform batch event validation by PXE. The `utilityValidateAndStoreEnqueuedNotesAndEvents` oracle
|
|
12
9
|
* expects for values of this type to be stored in a `CapsuleArray`.
|
|
13
10
|
*/
|
|
14
11
|
export class EventValidationRequest {
|
|
@@ -22,7 +19,7 @@ export class EventValidationRequest {
|
|
|
22
19
|
public recipient: AztecAddress,
|
|
23
20
|
) {}
|
|
24
21
|
|
|
25
|
-
static fromFields(fields: Fr[]
|
|
22
|
+
static fromFields(fields: Fr[], maxEventSerializedLen: number): EventValidationRequest {
|
|
26
23
|
const reader = FieldReader.asReader(fields);
|
|
27
24
|
|
|
28
25
|
const contractAddress = AztecAddress.fromField(reader.readField());
|
|
@@ -30,7 +27,7 @@ export class EventValidationRequest {
|
|
|
30
27
|
|
|
31
28
|
const randomness = reader.readField();
|
|
32
29
|
|
|
33
|
-
const eventStorage = reader.readFieldArray(
|
|
30
|
+
const eventStorage = reader.readFieldArray(maxEventSerializedLen);
|
|
34
31
|
const eventLen = reader.readField().toNumber();
|
|
35
32
|
const serializedEvent = eventStorage.slice(0, eventLen);
|
|
36
33
|
|
|
@@ -38,6 +35,12 @@ export class EventValidationRequest {
|
|
|
38
35
|
const txHash = TxHash.fromField(reader.readField());
|
|
39
36
|
const recipient = AztecAddress.fromField(reader.readField());
|
|
40
37
|
|
|
38
|
+
if (reader.remainingFields() !== 0) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
`Error converting array of fields to EventValidationRequest: expected ${reader.cursor} fields but received ${fields.length} (maxEventSerializedLen=${maxEventSerializedLen}).`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
41
44
|
return new EventValidationRequest(
|
|
42
45
|
contractAddress,
|
|
43
46
|
eventTypeId,
|
|
@@ -3,10 +3,7 @@ import { range } from '@aztec/foundation/array';
|
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import type { TxHash } from '@aztec/stdlib/tx';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const MAX_PUBLIC_LOG_LEN_FOR_NOTE_COMPLETION = MAX_NOTE_PACKED_LEN;
|
|
9
|
-
const MAX_LOG_CONTENT_LEN = Math.max(MAX_PUBLIC_LOG_LEN_FOR_NOTE_COMPLETION, PRIVATE_LOG_CIPHERTEXT_LEN);
|
|
6
|
+
const MAX_LOG_CONTENT_LEN = PRIVATE_LOG_CIPHERTEXT_LEN;
|
|
10
7
|
|
|
11
8
|
/**
|
|
12
9
|
* Intermediate struct used to perform batch log retrieval by PXE. The `utilityBulkRetrieveLogs` oracle stores values of this
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { MAX_NOTE_HASHES_PER_TX } from '@aztec/constants';
|
|
2
|
+
import { range } from '@aztec/foundation/array';
|
|
3
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
|
+
import type { TxHash } from '@aztec/stdlib/tx';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Intermediate struct used to return resolved message contexts from PXE. The
|
|
8
|
+
* `utilityResolveMessageContexts` oracle stores values of this type in a CapsuleArray.
|
|
9
|
+
*/
|
|
10
|
+
export class MessageTxContext {
|
|
11
|
+
constructor(
|
|
12
|
+
public txHash: TxHash,
|
|
13
|
+
public uniqueNoteHashesInTx: Fr[],
|
|
14
|
+
public firstNullifierInTx: Fr,
|
|
15
|
+
) {}
|
|
16
|
+
|
|
17
|
+
toFields(): Fr[] {
|
|
18
|
+
return [
|
|
19
|
+
this.txHash.hash,
|
|
20
|
+
...serializeBoundedVec(this.uniqueNoteHashesInTx, MAX_NOTE_HASHES_PER_TX),
|
|
21
|
+
this.firstNullifierInTx,
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
static toEmptyFields(): Fr[] {
|
|
26
|
+
const serializationLen =
|
|
27
|
+
1 /* txHash */ + MAX_NOTE_HASHES_PER_TX + 1 /* uniqueNoteHashesInTx BVec */ + 1; /* firstNullifierInTx */
|
|
28
|
+
return range(serializationLen).map(_ => Fr.zero());
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static toSerializedOption(response: MessageTxContext | null): Fr[] {
|
|
32
|
+
if (response) {
|
|
33
|
+
return [new Fr(1), ...response.toFields()];
|
|
34
|
+
} else {
|
|
35
|
+
return [new Fr(0), ...MessageTxContext.toEmptyFields()];
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Helper function to serialize a bounded vector according to Noir's BoundedVec format
|
|
42
|
+
* @param values - The values to serialize
|
|
43
|
+
* @param maxLength - The maximum length of the bounded vector
|
|
44
|
+
* @returns The serialized bounded vector as Fr[]
|
|
45
|
+
*/
|
|
46
|
+
function serializeBoundedVec(values: Fr[], maxLength: number): Fr[] {
|
|
47
|
+
if (values.length > maxLength) {
|
|
48
|
+
throw new Error(`Attempted to serialize ${values} values into a BoundedVec with max length ${maxLength}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const lengthDiff = maxLength - values.length;
|
|
52
|
+
const zeroPaddingArray = Array(lengthDiff).fill(Fr.ZERO);
|
|
53
|
+
const storage = values.concat(zeroPaddingArray);
|
|
54
|
+
return [...storage, new Fr(values.length)];
|
|
55
|
+
}
|
|
@@ -3,11 +3,8 @@ import { FieldReader } from '@aztec/foundation/serialize';
|
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
5
5
|
|
|
6
|
-
// TODO(#14617): should we compute this from constants? This value is aztec-nr specific.
|
|
7
|
-
export const MAX_NOTE_PACKED_LEN = 10;
|
|
8
|
-
|
|
9
6
|
/**
|
|
10
|
-
* Intermediate struct used to perform batch note validation by PXE. The `
|
|
7
|
+
* Intermediate struct used to perform batch note validation by PXE. The `utilityValidateAndStoreEnqueuedNotesAndEvents` oracle
|
|
11
8
|
* expects for values of this type to be stored in a `CapsuleArray`.
|
|
12
9
|
*/
|
|
13
10
|
export class NoteValidationRequest {
|
|
@@ -24,7 +21,7 @@ export class NoteValidationRequest {
|
|
|
24
21
|
public recipient: AztecAddress,
|
|
25
22
|
) {}
|
|
26
23
|
|
|
27
|
-
static fromFields(fields: Fr[]
|
|
24
|
+
static fromFields(fields: Fr[], maxNotePackedLen: number): NoteValidationRequest {
|
|
28
25
|
const reader = FieldReader.asReader(fields);
|
|
29
26
|
|
|
30
27
|
const contractAddress = AztecAddress.fromField(reader.readField());
|
|
@@ -33,7 +30,7 @@ export class NoteValidationRequest {
|
|
|
33
30
|
const randomness = reader.readField();
|
|
34
31
|
const noteNonce = reader.readField();
|
|
35
32
|
|
|
36
|
-
const contentStorage = reader.readFieldArray(
|
|
33
|
+
const contentStorage = reader.readFieldArray(maxNotePackedLen);
|
|
37
34
|
const contentLen = reader.readField().toNumber();
|
|
38
35
|
const content = contentStorage.slice(0, contentLen);
|
|
39
36
|
|
|
@@ -44,7 +41,7 @@ export class NoteValidationRequest {
|
|
|
44
41
|
|
|
45
42
|
if (reader.remainingFields() !== 0) {
|
|
46
43
|
throw new Error(
|
|
47
|
-
`Error converting array of fields to NoteValidationRequest
|
|
44
|
+
`Error converting array of fields to NoteValidationRequest: expected ${reader.cursor} fields but received ${fields.length} (maxNotePackedLen=${maxNotePackedLen}).`,
|
|
48
45
|
);
|
|
49
46
|
}
|
|
50
47
|
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
|
|
1
|
+
import type { ARCHIVE_HEIGHT, L1_TO_L2_MSG_TREE_HEIGHT, NOTE_HASH_TREE_HEIGHT } from '@aztec/constants';
|
|
2
2
|
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { Point } from '@aztec/foundation/curves/grumpkin';
|
|
5
|
+
import { MembershipWitness } from '@aztec/foundation/trees';
|
|
5
6
|
import type { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
6
7
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import {
|
|
8
|
-
import type {
|
|
8
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
9
|
+
import type { ContractInstance, PartialAddress } from '@aztec/stdlib/contract';
|
|
9
10
|
import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
|
|
11
|
+
import type { PublicKeys } from '@aztec/stdlib/keys';
|
|
10
12
|
import type { ContractClassLog, Tag } from '@aztec/stdlib/logs';
|
|
11
13
|
import type { Note, NoteStatus } from '@aztec/stdlib/note';
|
|
12
|
-
import { type
|
|
14
|
+
import { type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
|
|
13
15
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
14
16
|
|
|
15
17
|
import type { UtilityContext } from '../noir-structs/utility_context.js';
|
|
@@ -51,9 +53,9 @@ export interface NoteData {
|
|
|
51
53
|
export interface IMiscOracle {
|
|
52
54
|
isMisc: true;
|
|
53
55
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
56
|
+
getRandomField(): Fr;
|
|
57
|
+
assertCompatibleOracleVersion(version: number): void;
|
|
58
|
+
log(level: number, message: string, fields: Fr[]): Promise<void>;
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
/**
|
|
@@ -63,23 +65,32 @@ export interface IMiscOracle {
|
|
|
63
65
|
export interface IUtilityExecutionOracle {
|
|
64
66
|
isUtility: true;
|
|
65
67
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
getUtilityContext(): UtilityContext;
|
|
69
|
+
getKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest>;
|
|
70
|
+
getContractInstance(address: AztecAddress): Promise<ContractInstance>;
|
|
71
|
+
getNoteHashMembershipWitness(
|
|
72
|
+
anchorBlockHash: BlockHash,
|
|
73
|
+
noteHash: Fr,
|
|
74
|
+
): Promise<MembershipWitness<typeof NOTE_HASH_TREE_HEIGHT> | undefined>;
|
|
75
|
+
getBlockHashMembershipWitness(
|
|
76
|
+
anchorBlockHash: BlockHash,
|
|
77
|
+
blockHash: BlockHash,
|
|
78
|
+
): Promise<MembershipWitness<typeof ARCHIVE_HEIGHT> | undefined>;
|
|
79
|
+
getNullifierMembershipWitness(
|
|
80
|
+
anchorBlockHash: BlockHash,
|
|
72
81
|
nullifier: Fr,
|
|
73
82
|
): Promise<NullifierMembershipWitness | undefined>;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
getPublicDataWitness(anchorBlockHash: BlockHash, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
|
|
84
|
+
getLowNullifierMembershipWitness(
|
|
85
|
+
anchorBlockHash: BlockHash,
|
|
77
86
|
nullifier: Fr,
|
|
78
87
|
): Promise<NullifierMembershipWitness | undefined>;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
88
|
+
getBlockHeader(blockNumber: BlockNumber): Promise<BlockHeader | undefined>;
|
|
89
|
+
tryGetPublicKeysAndPartialAddress(
|
|
90
|
+
account: AztecAddress,
|
|
91
|
+
): Promise<{ publicKeys: PublicKeys; partialAddress: PartialAddress } | undefined>;
|
|
92
|
+
getAuthWitness(messageHash: Fr): Promise<Fr[] | undefined>;
|
|
93
|
+
getNotes(
|
|
83
94
|
owner: AztecAddress | undefined,
|
|
84
95
|
storageSlot: Fr,
|
|
85
96
|
numSelects: number,
|
|
@@ -96,35 +107,44 @@ export interface IUtilityExecutionOracle {
|
|
|
96
107
|
offset: number,
|
|
97
108
|
status: NoteStatus,
|
|
98
109
|
): Promise<NoteData[]>;
|
|
99
|
-
|
|
100
|
-
|
|
110
|
+
checkNullifierExists(innerNullifier: Fr): Promise<boolean>;
|
|
111
|
+
getL1ToL2MembershipWitness(
|
|
101
112
|
contractAddress: AztecAddress,
|
|
102
113
|
messageHash: Fr,
|
|
103
114
|
secret: Fr,
|
|
104
115
|
): Promise<MessageLoadOracleInputs<typeof L1_TO_L2_MSG_TREE_HEIGHT>>;
|
|
105
|
-
|
|
106
|
-
|
|
116
|
+
storageRead(
|
|
117
|
+
anchorBlockHash: BlockHash,
|
|
107
118
|
contractAddress: AztecAddress,
|
|
108
119
|
startStorageSlot: Fr,
|
|
109
120
|
numberOfElements: number,
|
|
110
121
|
): Promise<Fr[]>;
|
|
111
|
-
|
|
112
|
-
|
|
122
|
+
fetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
|
|
123
|
+
validateAndStoreEnqueuedNotesAndEvents(
|
|
113
124
|
contractAddress: AztecAddress,
|
|
114
125
|
noteValidationRequestsArrayBaseSlot: Fr,
|
|
115
126
|
eventValidationRequestsArrayBaseSlot: Fr,
|
|
127
|
+
maxNotePackedLen: number,
|
|
128
|
+
maxEventSerializedLen: number,
|
|
116
129
|
): Promise<void>;
|
|
117
|
-
|
|
130
|
+
bulkRetrieveLogs(
|
|
118
131
|
contractAddress: AztecAddress,
|
|
119
132
|
logRetrievalRequestsArrayBaseSlot: Fr,
|
|
120
133
|
logRetrievalResponsesArrayBaseSlot: Fr,
|
|
121
134
|
): Promise<void>;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
135
|
+
utilityResolveMessageContexts(
|
|
136
|
+
contractAddress: AztecAddress,
|
|
137
|
+
messageContextRequestsArrayBaseSlot: Fr,
|
|
138
|
+
messageContextResponsesArrayBaseSlot: Fr,
|
|
139
|
+
): Promise<void>;
|
|
140
|
+
storeCapsule(contractAddress: AztecAddress, key: Fr, capsule: Fr[]): Promise<void>;
|
|
141
|
+
loadCapsule(contractAddress: AztecAddress, key: Fr): Promise<Fr[] | null>;
|
|
142
|
+
deleteCapsule(contractAddress: AztecAddress, key: Fr): Promise<void>;
|
|
143
|
+
copyCapsule(contractAddress: AztecAddress, srcKey: Fr, dstKey: Fr, numEntries: number): Promise<void>;
|
|
144
|
+
aes128Decrypt(ciphertext: Buffer, iv: Buffer, symKey: Buffer): Promise<Buffer>;
|
|
145
|
+
getSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
|
|
146
|
+
invalidateContractSyncCache(contractAddress: AztecAddress, scopes: AztecAddress[]): void;
|
|
147
|
+
emitOffchainEffect(data: Fr[]): Promise<void>;
|
|
128
148
|
}
|
|
129
149
|
|
|
130
150
|
/**
|
|
@@ -134,9 +154,9 @@ export interface IUtilityExecutionOracle {
|
|
|
134
154
|
export interface IPrivateExecutionOracle {
|
|
135
155
|
isPrivate: true;
|
|
136
156
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
157
|
+
storeInExecutionCache(values: Fr[], hash: Fr): void;
|
|
158
|
+
loadFromExecutionCache(hash: Fr): Promise<Fr[]>;
|
|
159
|
+
notifyCreatedNote(
|
|
140
160
|
owner: AztecAddress,
|
|
141
161
|
storageSlot: Fr,
|
|
142
162
|
randomness: Fr,
|
|
@@ -145,32 +165,21 @@ export interface IPrivateExecutionOracle {
|
|
|
145
165
|
noteHash: Fr,
|
|
146
166
|
counter: number,
|
|
147
167
|
): void;
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
168
|
+
notifyNullifiedNote(innerNullifier: Fr, noteHash: Fr, counter: number): Promise<void>;
|
|
169
|
+
notifyCreatedNullifier(innerNullifier: Fr): Promise<void>;
|
|
170
|
+
isNullifierPending(innerNullifier: Fr, contractAddress: AztecAddress): Promise<boolean>;
|
|
171
|
+
notifyCreatedContractClassLog(log: ContractClassLog, counter: number): void;
|
|
172
|
+
callPrivateFunction(
|
|
152
173
|
targetContractAddress: AztecAddress,
|
|
153
174
|
functionSelector: FunctionSelector,
|
|
154
175
|
argsHash: Fr,
|
|
155
176
|
sideEffectCounter: number,
|
|
156
177
|
isStaticCall: boolean,
|
|
157
178
|
): Promise<{ endSideEffectCounter: Fr; returnsHash: Fr }>;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
): Promise<
|
|
164
|
-
privateNotifySetPublicTeardownFunctionCall(
|
|
165
|
-
targetContractAddress: AztecAddress,
|
|
166
|
-
calldataHash: Fr,
|
|
167
|
-
sideEffectCounter: number,
|
|
168
|
-
isStaticCall: boolean,
|
|
169
|
-
): Promise<void>;
|
|
170
|
-
privateNotifySetMinRevertibleSideEffectCounter(minRevertibleSideEffectCounter: number): Promise<void>;
|
|
171
|
-
privateIsSideEffectCounterRevertible(sideEffectCounter: number): Promise<boolean>;
|
|
172
|
-
privateGetSenderForTags(): Promise<AztecAddress | undefined>;
|
|
173
|
-
privateSetSenderForTags(senderForTags: AztecAddress): Promise<void>;
|
|
174
|
-
privateGetNextAppTagAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<Tag>;
|
|
175
|
-
utilityEmitOffchainEffect(data: Fr[]): Promise<void>;
|
|
179
|
+
validatePublicCalldata(calldataHash: Fr): Promise<void>;
|
|
180
|
+
notifyRevertiblePhaseStart(minRevertibleSideEffectCounter: number): Promise<void>;
|
|
181
|
+
inRevertiblePhase(sideEffectCounter: number): Promise<boolean>;
|
|
182
|
+
getSenderForTags(): Promise<AztecAddress | undefined>;
|
|
183
|
+
setSenderForTags(senderForTags: AztecAddress): Promise<void>;
|
|
184
|
+
getNextAppTagAsSender(sender: AztecAddress, recipient: AztecAddress): Promise<Tag>;
|
|
176
185
|
}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { ACIRCallback, ACVMField } from '@aztec/simulator/client';
|
|
3
|
+
|
|
4
|
+
import type { Oracle } from './oracle.js';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Builds legacy oracle name callbacks for pinned protocol contracts whose artifacts are committed and cannot be
|
|
8
|
+
* changed.
|
|
9
|
+
* TODO(F-416): Remove these aliases on v5 when protocol contracts are redeployed.
|
|
10
|
+
*/
|
|
11
|
+
export function buildLegacyOracleCallbacks(oracle: Oracle): ACIRCallback {
|
|
12
|
+
return {
|
|
13
|
+
// Simple prefix renames (privateXxx/utilityXxx → aztec_prv_/aztec_utl_)
|
|
14
|
+
utilityLog: (
|
|
15
|
+
level: ACVMField[],
|
|
16
|
+
message: ACVMField[],
|
|
17
|
+
_ignoredFieldsSize: ACVMField[],
|
|
18
|
+
fields: ACVMField[],
|
|
19
|
+
): Promise<ACVMField[]> => oracle.aztec_utl_log(level, message, _ignoredFieldsSize, fields),
|
|
20
|
+
utilityAssertCompatibleOracleVersion: (version: ACVMField[]): Promise<ACVMField[]> =>
|
|
21
|
+
oracle.aztec_utl_assertCompatibleOracleVersion(version),
|
|
22
|
+
utilityLoadCapsule: (
|
|
23
|
+
contractAddress: ACVMField[],
|
|
24
|
+
slot: ACVMField[],
|
|
25
|
+
tSize: ACVMField[],
|
|
26
|
+
): Promise<(ACVMField | ACVMField[])[]> => oracle.aztec_utl_loadCapsule(contractAddress, slot, tSize),
|
|
27
|
+
privateStoreInExecutionCache: (values: ACVMField[], hash: ACVMField[]): Promise<ACVMField[]> =>
|
|
28
|
+
oracle.aztec_prv_storeInExecutionCache(values, hash),
|
|
29
|
+
privateLoadFromExecutionCache: (returnsHash: ACVMField[]): Promise<ACVMField[][]> =>
|
|
30
|
+
oracle.aztec_prv_loadFromExecutionCache(returnsHash),
|
|
31
|
+
privateCallPrivateFunction: (
|
|
32
|
+
contractAddress: ACVMField[],
|
|
33
|
+
functionSelector: ACVMField[],
|
|
34
|
+
argsHash: ACVMField[],
|
|
35
|
+
sideEffectCounter: ACVMField[],
|
|
36
|
+
isStaticCall: ACVMField[],
|
|
37
|
+
): Promise<ACVMField[][]> =>
|
|
38
|
+
oracle.aztec_prv_callPrivateFunction(
|
|
39
|
+
contractAddress,
|
|
40
|
+
functionSelector,
|
|
41
|
+
argsHash,
|
|
42
|
+
sideEffectCounter,
|
|
43
|
+
isStaticCall,
|
|
44
|
+
),
|
|
45
|
+
privateIsNullifierPending: (innerNullifier: ACVMField[], contractAddress: ACVMField[]): Promise<ACVMField[]> =>
|
|
46
|
+
oracle.aztec_prv_isNullifierPending(innerNullifier, contractAddress),
|
|
47
|
+
privateNotifyCreatedNullifier: (innerNullifier: ACVMField[]): Promise<ACVMField[]> =>
|
|
48
|
+
oracle.aztec_prv_notifyCreatedNullifier(innerNullifier),
|
|
49
|
+
privateNotifyCreatedContractClassLog: (
|
|
50
|
+
contractAddress: ACVMField[],
|
|
51
|
+
message: ACVMField[],
|
|
52
|
+
length: ACVMField[],
|
|
53
|
+
counter: ACVMField[],
|
|
54
|
+
): Promise<ACVMField[]> =>
|
|
55
|
+
oracle.aztec_prv_notifyCreatedContractClassLog(contractAddress, message, length, counter),
|
|
56
|
+
utilityGetUtilityContext: (): Promise<(ACVMField | ACVMField[])[]> => oracle.aztec_utl_getUtilityContext(),
|
|
57
|
+
utilityStorageRead: (
|
|
58
|
+
blockHash: ACVMField[],
|
|
59
|
+
contractAddress: ACVMField[],
|
|
60
|
+
startStorageSlot: ACVMField[],
|
|
61
|
+
numberOfElements: ACVMField[],
|
|
62
|
+
): Promise<ACVMField[][]> =>
|
|
63
|
+
oracle.aztec_utl_storageRead(blockHash, contractAddress, startStorageSlot, numberOfElements),
|
|
64
|
+
utilityStoreCapsule: (
|
|
65
|
+
contractAddress: ACVMField[],
|
|
66
|
+
slot: ACVMField[],
|
|
67
|
+
capsule: ACVMField[],
|
|
68
|
+
): Promise<ACVMField[]> => oracle.aztec_utl_storeCapsule(contractAddress, slot, capsule),
|
|
69
|
+
utilityCopyCapsule: (
|
|
70
|
+
contractAddress: ACVMField[],
|
|
71
|
+
srcSlot: ACVMField[],
|
|
72
|
+
dstSlot: ACVMField[],
|
|
73
|
+
numEntries: ACVMField[],
|
|
74
|
+
): Promise<ACVMField[]> => oracle.aztec_utl_copyCapsule(contractAddress, srcSlot, dstSlot, numEntries),
|
|
75
|
+
utilityDeleteCapsule: (contractAddress: ACVMField[], slot: ACVMField[]): Promise<ACVMField[]> =>
|
|
76
|
+
oracle.aztec_utl_deleteCapsule(contractAddress, slot),
|
|
77
|
+
utilityGetSharedSecret: (
|
|
78
|
+
address: ACVMField[],
|
|
79
|
+
ephPKField0: ACVMField[],
|
|
80
|
+
ephPKField1: ACVMField[],
|
|
81
|
+
ephPKField2: ACVMField[],
|
|
82
|
+
): Promise<ACVMField[]> => oracle.aztec_utl_getSharedSecret(address, ephPKField0, ephPKField1, ephPKField2),
|
|
83
|
+
utilityFetchTaggedLogs: (pendingTaggedLogArrayBaseSlot: ACVMField[]): Promise<ACVMField[]> =>
|
|
84
|
+
oracle.aztec_utl_fetchTaggedLogs(pendingTaggedLogArrayBaseSlot),
|
|
85
|
+
utilityBulkRetrieveLogs: (
|
|
86
|
+
contractAddress: ACVMField[],
|
|
87
|
+
logRetrievalRequestsArrayBaseSlot: ACVMField[],
|
|
88
|
+
logRetrievalResponsesArrayBaseSlot: ACVMField[],
|
|
89
|
+
): Promise<ACVMField[]> =>
|
|
90
|
+
oracle.aztec_utl_bulkRetrieveLogs(
|
|
91
|
+
contractAddress,
|
|
92
|
+
logRetrievalRequestsArrayBaseSlot,
|
|
93
|
+
logRetrievalResponsesArrayBaseSlot,
|
|
94
|
+
),
|
|
95
|
+
utilityGetL1ToL2MembershipWitness: (
|
|
96
|
+
contractAddress: ACVMField[],
|
|
97
|
+
messageHash: ACVMField[],
|
|
98
|
+
secret: ACVMField[],
|
|
99
|
+
): Promise<(ACVMField | ACVMField[])[]> =>
|
|
100
|
+
oracle.aztec_utl_getL1ToL2MembershipWitness(contractAddress, messageHash, secret),
|
|
101
|
+
utilityEmitOffchainEffect: (data: ACVMField[]): Promise<ACVMField[]> => oracle.aztec_utl_emitOffchainEffect(data),
|
|
102
|
+
// Adapter: old 3-param signature → new 5-param with injected constants.
|
|
103
|
+
// Values derived from: MAX_MESSAGE_CONTENT_LEN(11) - RESERVED_FIELDS (3 for notes, 1 for events).
|
|
104
|
+
utilityValidateAndStoreEnqueuedNotesAndEvents: (
|
|
105
|
+
contractAddress: ACVMField[],
|
|
106
|
+
noteValidationRequestsArrayBaseSlot: ACVMField[],
|
|
107
|
+
eventValidationRequestsArrayBaseSlot: ACVMField[],
|
|
108
|
+
): Promise<ACVMField[]> =>
|
|
109
|
+
oracle.aztec_utl_validateAndStoreEnqueuedNotesAndEvents(
|
|
110
|
+
contractAddress,
|
|
111
|
+
noteValidationRequestsArrayBaseSlot,
|
|
112
|
+
eventValidationRequestsArrayBaseSlot,
|
|
113
|
+
[new Fr(8).toString()],
|
|
114
|
+
[new Fr(10).toString()],
|
|
115
|
+
),
|
|
116
|
+
// Renames (same signature, different oracle name)
|
|
117
|
+
privateNotifySetMinRevertibleSideEffectCounter: (counter: ACVMField[]): Promise<ACVMField[]> =>
|
|
118
|
+
oracle.aztec_prv_notifyRevertiblePhaseStart(counter),
|
|
119
|
+
privateIsSideEffectCounterRevertible: (sideEffectCounter: ACVMField[]): Promise<ACVMField[]> =>
|
|
120
|
+
oracle.aztec_prv_inRevertiblePhase(sideEffectCounter),
|
|
121
|
+
// Signature changes: old 4-param oracles → new 1-param validatePublicCalldata
|
|
122
|
+
privateNotifyEnqueuedPublicFunctionCall: (
|
|
123
|
+
_contractAddress: ACVMField[],
|
|
124
|
+
calldataHash: ACVMField[],
|
|
125
|
+
_sideEffectCounter: ACVMField[],
|
|
126
|
+
_isStaticCall: ACVMField[],
|
|
127
|
+
): Promise<ACVMField[]> => oracle.aztec_prv_validatePublicCalldata(calldataHash),
|
|
128
|
+
privateNotifySetPublicTeardownFunctionCall: (
|
|
129
|
+
_contractAddress: ACVMField[],
|
|
130
|
+
calldataHash: ACVMField[],
|
|
131
|
+
_sideEffectCounter: ACVMField[],
|
|
132
|
+
_isStaticCall: ACVMField[],
|
|
133
|
+
): Promise<ACVMField[]> => oracle.aztec_prv_validatePublicCalldata(calldataHash),
|
|
134
|
+
};
|
|
135
|
+
}
|