@aztec/pxe 3.0.0-nightly.20260105 → 3.0.0-nightly.20260106
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/block_synchronizer/block_synchronizer.d.ts +6 -6
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +11 -11
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +22 -22
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +31 -28
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +4 -4
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +3 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +17 -13
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +13 -11
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +19 -19
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +44 -44
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +5 -5
- package/dest/debug/pxe_debug_utils.d.ts +6 -6
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +7 -7
- 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 +10 -1
- 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 +10 -1
- 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/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +11 -7
- package/dest/error_enriching.d.ts +4 -4
- package/dest/error_enriching.d.ts.map +1 -1
- package/dest/error_enriching.js +6 -6
- package/dest/events/event_service.d.ts +6 -6
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +7 -7
- package/dest/events/private_event_filter_validator.d.ts +6 -6
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/events/private_event_filter_validator.js +4 -4
- package/dest/logs/log_service.d.ts +12 -12
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +17 -17
- package/dest/notes/note_service.d.ts +7 -7
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +14 -14
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +4 -4
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +7 -7
- package/dest/public_storage/public_storage_service.d.ts +4 -4
- package/dest/public_storage/public_storage_service.d.ts.map +1 -1
- package/dest/public_storage/public_storage_service.js +4 -4
- package/dest/pxe.d.ts +10 -10
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +81 -78
- package/dest/storage/address_store/address_store.d.ts +11 -0
- package/dest/storage/address_store/address_store.d.ts.map +1 -0
- package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -1
- package/dest/storage/address_store/index.d.ts +2 -0
- package/dest/storage/address_store/index.d.ts.map +1 -0
- package/dest/storage/address_store/index.js +1 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/{anchor_block_data_provider/anchor_block_data_provider.js → anchor_block_store/anchor_block_store.js} +1 -1
- package/dest/storage/anchor_block_store/index.d.ts +2 -0
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/{capsule_data_provider/capsule_data_provider.d.ts → capsule_store/capsule_store.d.ts} +2 -2
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/{capsule_data_provider/capsule_data_provider.js → capsule_store/capsule_store.js} +1 -1
- package/dest/storage/capsule_store/index.d.ts +2 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +4 -3
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +14 -2
- package/dest/storage/contract_store/index.d.ts +2 -0
- package/dest/storage/contract_store/index.d.ts.map +1 -0
- package/dest/storage/contract_store/index.js +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/index.d.ts +8 -8
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -7
- package/dest/storage/note_store/index.d.ts +3 -0
- package/dest/storage/note_store/index.d.ts.map +1 -0
- package/dest/storage/note_store/index.js +2 -0
- package/dest/storage/{note_data_provider/note_data_provider.d.ts → note_store/note_store.d.ts} +7 -7
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/{note_data_provider/note_data_provider.js → note_store/note_store.js} +6 -6
- package/dest/storage/{private_event_data_provider/private_event_data_provider.d.ts → private_event_store/private_event_store.d.ts} +4 -4
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
- package/dest/storage/{private_event_data_provider/private_event_data_provider.js → private_event_store/private_event_store.js} +2 -2
- package/dest/storage/tagging_store/index.d.ts +4 -0
- package/dest/storage/tagging_store/index.d.ts.map +1 -0
- package/dest/storage/tagging_store/index.js +3 -0
- package/dest/{tagging/recipient_sync/recipient_tagging_data_provider.d.ts → storage/tagging_store/recipient_tagging_store.d.ts} +4 -4
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/{tagging/recipient_sync/recipient_tagging_data_provider.js → storage/tagging_store/recipient_tagging_store.js} +3 -3
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
- package/dest/storage/{tagging_data_provider/sender_address_book.js → tagging_store/sender_address_book_store.js} +1 -1
- package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.d.ts → tagging_store/sender_tagging_store.d.ts} +3 -3
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.js → tagging_store/sender_tagging_store.js} +3 -3
- package/dest/tagging/index.d.ts +14 -1
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +22 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -3
- 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 +6 -6
- package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.d.ts +3 -4
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.js +8 -17
- package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.d.ts +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.d.ts +4 -4
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.js +3 -3
- package/dest/tree_membership/tree_membership_service.d.ts +4 -4
- package/dest/tree_membership/tree_membership_service.d.ts.map +1 -1
- package/dest/tree_membership/tree_membership_service.js +5 -5
- package/package.json +16 -16
- package/src/block_synchronizer/block_synchronizer.ts +10 -10
- package/src/contract_function_simulator/contract_function_simulator.ts +49 -48
- package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +48 -47
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +51 -51
- package/src/contract_function_simulator/proxied_contract_data_source.ts +7 -7
- package/src/debug/pxe_debug_utils.ts +6 -6
- package/src/entrypoints/client/bundle/utils.ts +7 -1
- package/src/entrypoints/client/lazy/utils.ts +7 -2
- package/src/entrypoints/pxe_creation_options.ts +2 -1
- package/src/entrypoints/server/utils.ts +11 -15
- package/src/error_enriching.ts +7 -15
- package/src/events/event_service.ts +6 -6
- package/src/events/private_event_filter_validator.ts +5 -5
- package/src/logs/log_service.ts +16 -16
- package/src/notes/note_service.ts +13 -13
- package/src/private_kernel/private_kernel_oracle_impl.ts +6 -6
- package/src/public_storage/public_storage_service.ts +3 -3
- package/src/pxe.ts +100 -101
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -1
- package/src/storage/address_store/index.ts +1 -0
- package/src/storage/{anchor_block_data_provider/anchor_block_data_provider.ts → anchor_block_store/anchor_block_store.ts} +1 -1
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/{capsule_data_provider/capsule_data_provider.ts → capsule_store/capsule_store.ts} +1 -1
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +22 -2
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/index.ts +7 -7
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +7 -7
- package/src/storage/{private_event_data_provider/private_event_data_provider.ts → private_event_store/private_event_store.ts} +4 -4
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/{tagging/recipient_sync/recipient_tagging_data_provider.ts → storage/tagging_store/recipient_tagging_store.ts} +3 -3
- package/src/storage/{tagging_data_provider/sender_address_book.ts → tagging_store/sender_address_book_store.ts} +1 -1
- package/src/storage/{tagging_data_provider/sender_tagging_data_provider.ts → tagging_store/sender_tagging_store.ts} +3 -3
- package/src/tagging/index.ts +26 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +7 -7
- package/src/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.ts +9 -19
- package/src/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.ts +4 -4
- package/src/tree_membership/tree_membership_service.ts +4 -4
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts +0 -9
- package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts.map +0 -1
- package/dest/storage/anchor_block_data_provider/index.d.ts +0 -2
- package/dest/storage/anchor_block_data_provider/index.d.ts.map +0 -1
- package/dest/storage/anchor_block_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.d.ts +0 -2
- package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.d.ts +0 -4
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -3
- package/dest/storage/tagging_data_provider/sender_address_book.d.ts +0 -14
- package/dest/storage/tagging_data_provider/sender_address_book.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/sender_tagging_data_provider.d.ts.map +0 -1
- package/dest/tagging/recipient_sync/recipient_tagging_data_provider.d.ts.map +0 -1
- package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts.map +0 -1
- package/dest/tagging/sync/utils/get_status_change_of_pending.d.ts.map +0 -1
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts.map +0 -1
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/anchor_block_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/tagging_data_provider/index.ts +0 -3
- /package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +0 -0
- /package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.js +0 -0
- /package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +0 -0
- /package/src/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.ts +0 -0
|
@@ -11,7 +11,7 @@ import { Tag } from '@aztec/stdlib/logs';
|
|
|
11
11
|
import { Note } from '@aztec/stdlib/note';
|
|
12
12
|
import { CallContext, CountedContractClassLog, NoteAndSlot } from '@aztec/stdlib/tx';
|
|
13
13
|
import { NoteService } from '../../notes/note_service.js';
|
|
14
|
-
import { syncSenderTaggingIndexes } from '../../tagging/
|
|
14
|
+
import { syncSenderTaggingIndexes } from '../../tagging/index.js';
|
|
15
15
|
import { pickNotes } from '../pick_notes.js';
|
|
16
16
|
import { executePrivateFunction, verifyCurrentClassId } from './private_execution.js';
|
|
17
17
|
import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
@@ -22,10 +22,11 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
22
22
|
txContext;
|
|
23
23
|
callContext;
|
|
24
24
|
anchorBlockHeader;
|
|
25
|
+
utilityExecutor;
|
|
25
26
|
executionCache;
|
|
26
27
|
noteCache;
|
|
27
28
|
taggingIndexCache;
|
|
28
|
-
|
|
29
|
+
senderTaggingStore;
|
|
29
30
|
totalPublicCalldataCount;
|
|
30
31
|
sideEffectCounter;
|
|
31
32
|
senderForTags;
|
|
@@ -52,8 +53,8 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
52
53
|
contractClassLogs;
|
|
53
54
|
offchainEffects;
|
|
54
55
|
nestedExecutionResults;
|
|
55
|
-
constructor(argsHash, txContext, callContext, /** Header of a block whose state is used during private execution (not the block the transaction is included in). */ anchorBlockHeader, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, executionCache, noteCache, taggingIndexCache,
|
|
56
|
-
super(callContext.contractAddress, authWitnesses, capsules, anchorBlockHeader,
|
|
56
|
+
constructor(argsHash, txContext, callContext, /** Header of a block whose state is used during private execution (not the block the transaction is included in). */ anchorBlockHeader, /** Needed to trigger contract synchronization before nested calls */ utilityExecutor, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, executionCache, noteCache, taggingIndexCache, contractStore, noteStore, keyStore, addressStore, aztecNode, anchorBlockStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, totalPublicCalldataCount = 0, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes, senderForTags, simulator){
|
|
57
|
+
super(callContext.contractAddress, authWitnesses, capsules, anchorBlockHeader, contractStore, noteStore, keyStore, addressStore, aztecNode, anchorBlockStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, log, scopes), this.argsHash = argsHash, this.txContext = txContext, this.callContext = callContext, this.anchorBlockHeader = anchorBlockHeader, this.utilityExecutor = utilityExecutor, this.executionCache = executionCache, this.noteCache = noteCache, this.taggingIndexCache = taggingIndexCache, this.senderTaggingStore = senderTaggingStore, this.totalPublicCalldataCount = totalPublicCalldataCount, this.sideEffectCounter = sideEffectCounter, this.senderForTags = senderForTags, this.simulator = simulator, this.isPrivate = true, this.newNotes = [], this.noteHashLeafIndexMap = new Map(), this.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.offchainEffects = [], this.nestedExecutionResults = [];
|
|
57
58
|
}
|
|
58
59
|
getPrivateContextInputs() {
|
|
59
60
|
return new PrivateContextInputs(this.callContext, this.anchorBlockHeader, this.txContext, this.sideEffectCounter);
|
|
@@ -169,8 +170,8 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
169
170
|
// This is a tagging secret we've not yet used in this tx, so first sync our store to make sure its indices
|
|
170
171
|
// are up to date. We do this here because this store is not synced as part of the global sync because
|
|
171
172
|
// that'd be wasteful as most tagging secrets are not used in each tx.
|
|
172
|
-
await syncSenderTaggingIndexes(secret, this.contractAddress, this.aztecNode, this.
|
|
173
|
-
const lastUsedIndex = await this.
|
|
173
|
+
await syncSenderTaggingIndexes(secret, this.contractAddress, this.aztecNode, this.senderTaggingStore);
|
|
174
|
+
const lastUsedIndex = await this.senderTaggingStore.getLastUsedIndex(secret);
|
|
174
175
|
// If lastUsedIndex is undefined, we've never used this secret, so start from 0
|
|
175
176
|
// Otherwise, the next index to use is one past the last used index
|
|
176
177
|
return lastUsedIndex === undefined ? 0 : lastUsedIndex + 1;
|
|
@@ -228,7 +229,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
228
229
|
// Nullified pending notes are already removed from the list.
|
|
229
230
|
const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, owner, storageSlot);
|
|
230
231
|
const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
|
|
231
|
-
const noteService = new NoteService(this.
|
|
232
|
+
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockStore);
|
|
232
233
|
const dbNotes = await noteService.getNotes(this.callContext.contractAddress, owner, storageSlot, status, this.scopes);
|
|
233
234
|
const dbNotesFiltered = dbNotes.filter((n)=>!pendingNullifiers.has(n.siloedNullifier.value));
|
|
234
235
|
const notes = pickNotes([
|
|
@@ -362,11 +363,12 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
362
363
|
const simulatorSetupTimer = new Timer();
|
|
363
364
|
this.log.debug(`Calling private function ${targetContractAddress}:${functionSelector} from ${this.callContext.contractAddress}`);
|
|
364
365
|
isStaticCall = isStaticCall || this.callContext.isStaticCall;
|
|
365
|
-
await verifyCurrentClassId(targetContractAddress, this.aztecNode, this.
|
|
366
|
-
|
|
366
|
+
await verifyCurrentClassId(targetContractAddress, this.aztecNode, this.contractStore, this.anchorBlockHeader);
|
|
367
|
+
await this.contractStore.syncPrivateState(targetContractAddress, functionSelector, this.utilityExecutor);
|
|
368
|
+
const targetArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(targetContractAddress, functionSelector);
|
|
367
369
|
const derivedTxContext = this.txContext.clone();
|
|
368
370
|
const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
|
|
369
|
-
const privateExecutionOracle = new PrivateExecutionOracle(argsHash, derivedTxContext, derivedCallContext, this.anchorBlockHeader, this.authWitnesses, this.capsules, this.executionCache, this.noteCache, this.taggingIndexCache, this.
|
|
371
|
+
const privateExecutionOracle = new PrivateExecutionOracle(argsHash, derivedTxContext, derivedCallContext, this.anchorBlockHeader, this.utilityExecutor, this.authWitnesses, this.capsules, this.executionCache, this.noteCache, this.taggingIndexCache, this.contractStore, this.noteStore, this.keyStore, this.addressStore, this.aztecNode, this.anchorBlockStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.totalPublicCalldataCount, sideEffectCounter, this.log, this.scopes, this.senderForTags, this.simulator);
|
|
370
372
|
const setupTime = simulatorSetupTimer.ms();
|
|
371
373
|
const childExecutionResult = await executePrivateFunction(this.simulator, privateExecutionOracle, targetArtifact, targetContractAddress, functionSelector);
|
|
372
374
|
if (isStaticCall) {
|
|
@@ -429,7 +431,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
429
431
|
return new CallContext(this.contractAddress, targetContractAddress, await FunctionSelector.fromNameAndParameters(targetArtifact.name, targetArtifact.parameters), isStaticCall);
|
|
430
432
|
}
|
|
431
433
|
getDebugFunctionName() {
|
|
432
|
-
return this.
|
|
434
|
+
return this.contractStore.getDebugFunctionName(this.contractAddress, this.callContext.functionSelector);
|
|
433
435
|
}
|
|
434
436
|
utilityEmitOffchainEffect(data) {
|
|
435
437
|
this.offchainEffects.push({
|
|
@@ -10,14 +10,14 @@ import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
|
|
|
10
10
|
import type { NoteStatus } from '@aztec/stdlib/note';
|
|
11
11
|
import { MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
|
|
12
12
|
import type { BlockHeader, Capsule } from '@aztec/stdlib/tx';
|
|
13
|
-
import type {
|
|
14
|
-
import type {
|
|
15
|
-
import type {
|
|
16
|
-
import type {
|
|
17
|
-
import type {
|
|
18
|
-
import type {
|
|
19
|
-
import type {
|
|
20
|
-
import type {
|
|
13
|
+
import type { AddressStore } from '../../storage/address_store/address_store.js';
|
|
14
|
+
import type { AnchorBlockStore } from '../../storage/anchor_block_store/anchor_block_store.js';
|
|
15
|
+
import type { CapsuleStore } from '../../storage/capsule_store/capsule_store.js';
|
|
16
|
+
import type { ContractStore } from '../../storage/contract_store/contract_store.js';
|
|
17
|
+
import type { NoteStore } from '../../storage/note_store/note_store.js';
|
|
18
|
+
import type { PrivateEventStore } from '../../storage/private_event_store/private_event_store.js';
|
|
19
|
+
import type { RecipientTaggingStore } from '../../storage/tagging_store/recipient_tagging_store.js';
|
|
20
|
+
import type { SenderAddressBookStore } from '../../storage/tagging_store/sender_address_book_store.js';
|
|
21
21
|
import { UtilityContext } from '../noir-structs/utility_context.js';
|
|
22
22
|
import type { IMiscOracle, IUtilityExecutionOracle, NoteData } from './interfaces.js';
|
|
23
23
|
import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
@@ -30,16 +30,16 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
30
30
|
protected readonly authWitnesses: AuthWitness[];
|
|
31
31
|
protected readonly capsules: Capsule[];
|
|
32
32
|
protected readonly anchorBlockHeader: BlockHeader;
|
|
33
|
-
protected readonly
|
|
34
|
-
protected readonly
|
|
33
|
+
protected readonly contractStore: ContractStore;
|
|
34
|
+
protected readonly noteStore: NoteStore;
|
|
35
35
|
protected readonly keyStore: KeyStore;
|
|
36
|
-
protected readonly
|
|
36
|
+
protected readonly addressStore: AddressStore;
|
|
37
37
|
protected readonly aztecNode: AztecNode;
|
|
38
|
-
protected readonly
|
|
39
|
-
protected readonly
|
|
40
|
-
protected readonly
|
|
41
|
-
protected readonly
|
|
42
|
-
protected readonly
|
|
38
|
+
protected readonly anchorBlockStore: AnchorBlockStore;
|
|
39
|
+
protected readonly recipientTaggingStore: RecipientTaggingStore;
|
|
40
|
+
protected readonly senderAddressBookStore: SenderAddressBookStore;
|
|
41
|
+
protected readonly capsuleStore: CapsuleStore;
|
|
42
|
+
protected readonly privateEventStore: PrivateEventStore;
|
|
43
43
|
protected log: import("@aztec/foundation/log").Logger;
|
|
44
44
|
protected readonly scopes?: AztecAddress[] | undefined;
|
|
45
45
|
isMisc: true;
|
|
@@ -47,7 +47,7 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
47
47
|
private aztecNrDebugLog;
|
|
48
48
|
constructor(contractAddress: AztecAddress,
|
|
49
49
|
/** List of transient auth witnesses to be used during this simulation */
|
|
50
|
-
authWitnesses: AuthWitness[], capsules: Capsule[], anchorBlockHeader: BlockHeader,
|
|
50
|
+
authWitnesses: AuthWitness[], capsules: Capsule[], anchorBlockHeader: BlockHeader, contractStore: ContractStore, noteStore: NoteStore, keyStore: KeyStore, addressStore: AddressStore, aztecNode: AztecNode, anchorBlockStore: AnchorBlockStore, recipientTaggingStore: RecipientTaggingStore, senderAddressBookStore: SenderAddressBookStore, capsuleStore: CapsuleStore, privateEventStore: PrivateEventStore, log?: import("@aztec/foundation/log").Logger, scopes?: AztecAddress[] | undefined);
|
|
51
51
|
utilityAssertCompatibleOracleVersion(version: number): void;
|
|
52
52
|
utilityGetRandomField(): Fr;
|
|
53
53
|
utilityGetUtilityContext(): UtilityContext;
|
|
@@ -148,7 +148,7 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
148
148
|
*/
|
|
149
149
|
utilityCheckNullifierExists(innerNullifier: Fr): Promise<boolean>;
|
|
150
150
|
/**
|
|
151
|
-
* Fetches a message from the
|
|
151
|
+
* Fetches a message from the executionStore, given its key.
|
|
152
152
|
* @param contractAddress - Address of a contract by which the message was emitted.
|
|
153
153
|
* @param messageHash - Hash of the message.
|
|
154
154
|
* @param secret - Secret used to compute a nullifier.
|
|
@@ -192,4 +192,4 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
192
192
|
utilityGetSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
|
|
193
193
|
protected getSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
|
|
194
194
|
}
|
|
195
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
195
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbGl0eV9leGVjdXRpb25fb3JhY2xlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6W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QUFFLE9BQU8sRUFBRSxFQUFFLEVBQUUsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBTWhHO0lBRVksa0JBQWtCLENBQUMsZUFBZSxFQUFFLFlBQVksRUFBRSxJQUFJLEVBQUUsRUFBRSxHQUFHLE9BQU8sQ0FBQyxFQUFFLEVBQUUsR0FBRyxJQUFJLENBQUMsQ0FVN0Y7SUFFTSxvQkFBb0IsQ0FBQyxlQUFlLEVBQUUsWUFBWSxFQUFFLElBQUksRUFBRSxFQUFFLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQU1sRjtJQUVNLGtCQUFrQixDQUN2QixlQUFlLEVBQUUsWUFBWSxFQUM3QixPQUFPLEVBQUUsRUFBRSxFQUNYLE9BQU8sRUFBRSxFQUFFLEVBQ1gsVUFBVSxFQUFFLE1BQU0sR0FDakIsT0FBTyxDQUFDLElBQUksQ0FBQyxDQU1mO0lBR00sb0JBQW9CLENBQUMsVUFBVSxFQUFFLE1BQU0sRUFBRSxFQUFFLEVBQUUsTUFBTSxFQUFFLE1BQU0sRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUczRjtJQUVEOzs7OztPQUtHO0lBQ0ksc0JBQXNCLENBQUMsT0FBTyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FFakY7SUFFRCxVQUFnQixlQUFlLENBQUMsT0FBTyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FRbkY7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utility_execution_oracle.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/utility_execution_oracle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,KAAK,0BAA0B,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACvG,OAAO,KAAK,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAO7D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"utility_execution_oracle.d.ts","sourceRoot":"","sources":["../../../src/contract_function_simulator/oracle/utility_execution_oracle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAE1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,KAAK,EAAE,SAAS,EAAE,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IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMhG;IAEY,kBAAkB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,EAAE,GAAG,IAAI,CAAC,CAU7F;IAEM,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,IAAI,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAMlF;IAEM,kBAAkB,CACvB,eAAe,EAAE,YAAY,EAC7B,OAAO,EAAE,EAAE,EACX,OAAO,EAAE,EAAE,EACX,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAMf;IAGM,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAG3F;IAED;;;;;OAKG;IACI,sBAAsB,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAEjF;IAED,UAAgB,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAQnF;CACF"}
|
|
@@ -24,36 +24,36 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
24
24
|
authWitnesses;
|
|
25
25
|
capsules;
|
|
26
26
|
anchorBlockHeader;
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
contractStore;
|
|
28
|
+
noteStore;
|
|
29
29
|
keyStore;
|
|
30
|
-
|
|
30
|
+
addressStore;
|
|
31
31
|
aztecNode;
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
anchorBlockStore;
|
|
33
|
+
recipientTaggingStore;
|
|
34
|
+
senderAddressBookStore;
|
|
35
|
+
capsuleStore;
|
|
36
|
+
privateEventStore;
|
|
37
37
|
log;
|
|
38
38
|
scopes;
|
|
39
39
|
isMisc;
|
|
40
40
|
isUtility;
|
|
41
41
|
aztecNrDebugLog;
|
|
42
|
-
constructor(contractAddress, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, anchorBlockHeader,
|
|
42
|
+
constructor(contractAddress, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, anchorBlockHeader, contractStore, noteStore, keyStore, addressStore, aztecNode, anchorBlockStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, log = createLogger('simulator:client_view_context'), scopes){
|
|
43
43
|
this.contractAddress = contractAddress;
|
|
44
44
|
this.authWitnesses = authWitnesses;
|
|
45
45
|
this.capsules = capsules;
|
|
46
46
|
this.anchorBlockHeader = anchorBlockHeader;
|
|
47
|
-
this.
|
|
48
|
-
this.
|
|
47
|
+
this.contractStore = contractStore;
|
|
48
|
+
this.noteStore = noteStore;
|
|
49
49
|
this.keyStore = keyStore;
|
|
50
|
-
this.
|
|
50
|
+
this.addressStore = addressStore;
|
|
51
51
|
this.aztecNode = aztecNode;
|
|
52
|
-
this.
|
|
53
|
-
this.
|
|
54
|
-
this.
|
|
55
|
-
this.
|
|
56
|
-
this.
|
|
52
|
+
this.anchorBlockStore = anchorBlockStore;
|
|
53
|
+
this.recipientTaggingStore = recipientTaggingStore;
|
|
54
|
+
this.senderAddressBookStore = senderAddressBookStore;
|
|
55
|
+
this.capsuleStore = capsuleStore;
|
|
56
|
+
this.privateEventStore = privateEventStore;
|
|
57
57
|
this.log = log;
|
|
58
58
|
this.scopes = scopes;
|
|
59
59
|
this.isMisc = true;
|
|
@@ -92,7 +92,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
92
92
|
* @param leafValue - The leaf value
|
|
93
93
|
* @returns The index and sibling path concatenated [index, sibling_path]
|
|
94
94
|
*/ utilityGetMembershipWitness(blockNumber, treeId, leafValue) {
|
|
95
|
-
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.
|
|
95
|
+
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.anchorBlockStore);
|
|
96
96
|
return treeMembershipService.getMembershipWitness(blockNumber, treeId, leafValue);
|
|
97
97
|
}
|
|
98
98
|
/**
|
|
@@ -112,7 +112,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
112
112
|
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
113
113
|
* we are trying to prove non-inclusion for.
|
|
114
114
|
*/ async utilityGetLowNullifierMembershipWitness(blockNumber, nullifier) {
|
|
115
|
-
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.
|
|
115
|
+
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.anchorBlockStore);
|
|
116
116
|
return await treeMembershipService.getLowNullifierMembershipWitness(blockNumber, nullifier);
|
|
117
117
|
}
|
|
118
118
|
/**
|
|
@@ -121,7 +121,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
121
121
|
* @param leafSlot - The slot of the public data tree to get the witness for.
|
|
122
122
|
* @returns - The witness
|
|
123
123
|
*/ async utilityGetPublicDataWitness(blockNumber, leafSlot) {
|
|
124
|
-
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.
|
|
124
|
+
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.anchorBlockStore);
|
|
125
125
|
return await treeMembershipService.getPublicDataWitness(blockNumber, leafSlot);
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
@@ -129,7 +129,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
129
129
|
* @param blockNumber - The number of a block of which to get the block header.
|
|
130
130
|
* @returns Block extracted from a block with block number `blockNumber`.
|
|
131
131
|
*/ async utilityGetBlockHeader(blockNumber) {
|
|
132
|
-
const anchorBlockNumber = (await this.
|
|
132
|
+
const anchorBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
|
|
133
133
|
if (blockNumber > anchorBlockNumber) {
|
|
134
134
|
throw new Error(`Block number ${blockNumber} is higher than current block ${anchorBlockNumber}`);
|
|
135
135
|
}
|
|
@@ -145,7 +145,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
145
145
|
return this.getCompleteAddress(account);
|
|
146
146
|
}
|
|
147
147
|
async getCompleteAddress(account) {
|
|
148
|
-
const completeAddress = await this.
|
|
148
|
+
const completeAddress = await this.addressStore.getCompleteAddress(account);
|
|
149
149
|
if (!completeAddress) {
|
|
150
150
|
throw new Error(`No public key registered for address ${account}.
|
|
151
151
|
Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#simulation-error-no-public-key-registered-for-address-0x0-register-it-by-calling-pxeregisterrecipient-or-pxeregisteraccount`);
|
|
@@ -160,7 +160,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
160
160
|
return this.getContractInstance(address);
|
|
161
161
|
}
|
|
162
162
|
async getContractInstance(address) {
|
|
163
|
-
const instance = await this.
|
|
163
|
+
const instance = await this.contractStore.getContractInstance(address);
|
|
164
164
|
if (!instance) {
|
|
165
165
|
throw new Error(`No contract instance found for address ${address.toString()}`);
|
|
166
166
|
}
|
|
@@ -196,7 +196,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
196
196
|
* @param status - The status of notes to fetch.
|
|
197
197
|
* @returns Array of note data.
|
|
198
198
|
*/ async utilityGetNotes(owner, storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
|
|
199
|
-
const noteService = new NoteService(this.
|
|
199
|
+
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockStore);
|
|
200
200
|
const dbNotes = await noteService.getNotes(this.contractAddress, owner, storageSlot, status, this.scopes);
|
|
201
201
|
return pickNotes(dbNotes, {
|
|
202
202
|
selects: selectByIndexes.slice(0, numSelects).map((index, i)=>({
|
|
@@ -226,19 +226,19 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
226
226
|
* @returns A boolean indicating whether the nullifier exists in the tree or not.
|
|
227
227
|
*/ async utilityCheckNullifierExists(innerNullifier) {
|
|
228
228
|
const nullifier = await siloNullifier(this.contractAddress, innerNullifier);
|
|
229
|
-
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.
|
|
229
|
+
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.anchorBlockStore);
|
|
230
230
|
const index = await treeMembershipService.getNullifierIndex(nullifier);
|
|
231
231
|
return index !== undefined;
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
234
|
-
* Fetches a message from the
|
|
234
|
+
* Fetches a message from the executionStore, given its key.
|
|
235
235
|
* @param contractAddress - Address of a contract by which the message was emitted.
|
|
236
236
|
* @param messageHash - Hash of the message.
|
|
237
237
|
* @param secret - Secret used to compute a nullifier.
|
|
238
238
|
* @dev Contract address and secret are only used to compute the nullifier to get non-nullified messages
|
|
239
239
|
* @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
|
|
240
240
|
*/ async utilityGetL1ToL2MembershipWitness(contractAddress, messageHash, secret) {
|
|
241
|
-
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.
|
|
241
|
+
const treeMembershipService = new TreeMembershipService(this.aztecNode, this.anchorBlockStore);
|
|
242
242
|
const [messageIndex, siblingPath] = await treeMembershipService.getL1ToL2MembershipWitness(contractAddress, messageHash, secret);
|
|
243
243
|
// Assuming messageIndex is what you intended to use for the index in MessageLoadOracleInputs
|
|
244
244
|
return new MessageLoadOracleInputs(messageIndex, siblingPath);
|
|
@@ -251,7 +251,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
251
251
|
* @param numberOfElements - Number of elements to read from the starting storage slot.
|
|
252
252
|
*/ async utilityStorageRead(contractAddress, startStorageSlot, blockNumber, numberOfElements) {
|
|
253
253
|
const values = [];
|
|
254
|
-
const publicStorageService = new PublicStorageService(this.
|
|
254
|
+
const publicStorageService = new PublicStorageService(this.anchorBlockStore, this.aztecNode);
|
|
255
255
|
// TODO: why do we serialize these requests? This should probably a single call
|
|
256
256
|
// Privacy considerations?
|
|
257
257
|
for(let i = 0n; i < numberOfElements; i++){
|
|
@@ -270,9 +270,9 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
270
270
|
this.aztecNrDebugLog[levelName](`${applyStringFormatting(message, fields)}`);
|
|
271
271
|
}
|
|
272
272
|
async utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot) {
|
|
273
|
-
const logService = new LogService(this.aztecNode, this.
|
|
273
|
+
const logService = new LogService(this.aztecNode, this.anchorBlockStore, this.keyStore, this.capsuleStore, this.recipientTaggingStore, this.senderAddressBookStore, this.addressStore);
|
|
274
274
|
await logService.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
|
|
275
|
-
const noteService = new NoteService(this.
|
|
275
|
+
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockStore);
|
|
276
276
|
await noteService.syncNoteNullifiers(this.contractAddress);
|
|
277
277
|
}
|
|
278
278
|
/**
|
|
@@ -291,19 +291,19 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
291
291
|
}
|
|
292
292
|
// We read all note and event validation requests and process them all concurrently. This makes the process much
|
|
293
293
|
// faster as we don't need to wait for the network round-trip.
|
|
294
|
-
const noteValidationRequests = (await this.
|
|
295
|
-
const eventValidationRequests = (await this.
|
|
296
|
-
const noteService = new NoteService(this.
|
|
294
|
+
const noteValidationRequests = (await this.capsuleStore.readCapsuleArray(contractAddress, noteValidationRequestsArrayBaseSlot)).map(NoteValidationRequest.fromFields);
|
|
295
|
+
const eventValidationRequests = (await this.capsuleStore.readCapsuleArray(contractAddress, eventValidationRequestsArrayBaseSlot)).map(EventValidationRequest.fromFields);
|
|
296
|
+
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockStore);
|
|
297
297
|
const noteDeliveries = noteValidationRequests.map((request)=>noteService.deliverNote(request.contractAddress, request.owner, request.storageSlot, request.randomness, request.noteNonce, request.content, request.noteHash, request.nullifier, request.txHash, request.recipient));
|
|
298
|
-
const eventService = new EventService(this.
|
|
298
|
+
const eventService = new EventService(this.anchorBlockStore, this.aztecNode, this.privateEventStore);
|
|
299
299
|
const eventDeliveries = eventValidationRequests.map((request)=>eventService.deliverEvent(request.contractAddress, request.eventTypeId, request.serializedEvent, request.eventCommitment, request.txHash, request.recipient));
|
|
300
300
|
await Promise.all([
|
|
301
301
|
...noteDeliveries,
|
|
302
302
|
...eventDeliveries
|
|
303
303
|
]);
|
|
304
304
|
// Requests are cleared once we're done.
|
|
305
|
-
await this.
|
|
306
|
-
await this.
|
|
305
|
+
await this.capsuleStore.setCapsuleArray(contractAddress, noteValidationRequestsArrayBaseSlot, []);
|
|
306
|
+
await this.capsuleStore.setCapsuleArray(contractAddress, eventValidationRequestsArrayBaseSlot, []);
|
|
307
307
|
}
|
|
308
308
|
async utilityBulkRetrieveLogs(contractAddress, logRetrievalRequestsArrayBaseSlot, logRetrievalResponsesArrayBaseSlot) {
|
|
309
309
|
// TODO(#10727): allow other contracts to process partial notes
|
|
@@ -312,20 +312,20 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
312
312
|
}
|
|
313
313
|
// We read all log retrieval requests and process them all concurrently. This makes the process much faster as we
|
|
314
314
|
// don't need to wait for the network round-trip.
|
|
315
|
-
const logRetrievalRequests = (await this.
|
|
316
|
-
const logService = new LogService(this.aztecNode, this.
|
|
315
|
+
const logRetrievalRequests = (await this.capsuleStore.readCapsuleArray(contractAddress, logRetrievalRequestsArrayBaseSlot)).map(LogRetrievalRequest.fromFields);
|
|
316
|
+
const logService = new LogService(this.aztecNode, this.anchorBlockStore, this.keyStore, this.capsuleStore, this.recipientTaggingStore, this.senderAddressBookStore, this.addressStore);
|
|
317
317
|
const maybeLogRetrievalResponses = await logService.bulkRetrieveLogs(logRetrievalRequests);
|
|
318
318
|
// Requests are cleared once we're done.
|
|
319
|
-
await this.
|
|
319
|
+
await this.capsuleStore.setCapsuleArray(contractAddress, logRetrievalRequestsArrayBaseSlot, []);
|
|
320
320
|
// The responses are stored as Option<LogRetrievalResponse> in a second CapsuleArray.
|
|
321
|
-
await this.
|
|
321
|
+
await this.capsuleStore.setCapsuleArray(contractAddress, logRetrievalResponsesArrayBaseSlot, maybeLogRetrievalResponses.map(LogRetrievalResponse.toSerializedOption));
|
|
322
322
|
}
|
|
323
323
|
utilityStoreCapsule(contractAddress, slot, capsule) {
|
|
324
324
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
325
325
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
326
326
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
327
327
|
}
|
|
328
|
-
return this.
|
|
328
|
+
return this.capsuleStore.storeCapsule(this.contractAddress, slot, capsule);
|
|
329
329
|
}
|
|
330
330
|
async utilityLoadCapsule(contractAddress, slot) {
|
|
331
331
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
@@ -333,21 +333,21 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
333
333
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
334
334
|
}
|
|
335
335
|
return(// TODO(#12425): On the following line, the pertinent capsule gets overshadowed by the transient one. Tackle this.
|
|
336
|
-
this.capsules.find((c)=>c.contractAddress.equals(contractAddress) && c.storageSlot.equals(slot))?.data ?? await this.
|
|
336
|
+
this.capsules.find((c)=>c.contractAddress.equals(contractAddress) && c.storageSlot.equals(slot))?.data ?? await this.capsuleStore.loadCapsule(this.contractAddress, slot));
|
|
337
337
|
}
|
|
338
338
|
utilityDeleteCapsule(contractAddress, slot) {
|
|
339
339
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
340
340
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
341
341
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
342
342
|
}
|
|
343
|
-
return this.
|
|
343
|
+
return this.capsuleStore.deleteCapsule(this.contractAddress, slot);
|
|
344
344
|
}
|
|
345
345
|
utilityCopyCapsule(contractAddress, srcSlot, dstSlot, numEntries) {
|
|
346
346
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
347
347
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
348
348
|
throw new Error(`Contract ${contractAddress} is not allowed to access ${this.contractAddress}'s PXE DB`);
|
|
349
349
|
}
|
|
350
|
-
return this.
|
|
350
|
+
return this.capsuleStore.copyCapsule(this.contractAddress, srcSlot, dstSlot, numEntries);
|
|
351
351
|
}
|
|
352
352
|
// TODO(#11849): consider replacing this oracle with a pure Noir implementation of aes decryption.
|
|
353
353
|
utilityAes128Decrypt(ciphertext, iv, symKey) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ContractOverrides } from '@aztec/stdlib/tx';
|
|
2
|
-
import type {
|
|
3
|
-
export declare class
|
|
4
|
-
static create(
|
|
2
|
+
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
3
|
+
export declare class ProxiedContractStoreFactory {
|
|
4
|
+
static create(contractStore: ContractStore, overrides?: ContractOverrides): ContractStore;
|
|
5
5
|
}
|
|
6
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
6
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJveGllZF9jb250cmFjdF9kYXRhX3NvdXJjZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnRyYWN0X2Z1bmN0aW9uX3NpbXVsYXRvci9wcm94aWVkX2NvbnRyYWN0X2RhdGFfc291cmNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFMUQsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sNkNBQTZDLENBQUM7QUFPakYscUJBQWEsMkJBQTJCO0lBQ3RDLE1BQU0sQ0FBQyxNQUFNLENBQUMsYUFBYSxFQUFFLGFBQWEsRUFBRSxTQUFTLENBQUMsRUFBRSxpQkFBaUIsaUJBcUV4RTtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxied_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/proxied_contract_data_source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"proxied_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/proxied_contract_data_source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAOjF,qBAAa,2BAA2B;IACtC,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,iBAAiB,iBAqExE;CACF"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
2
2
|
/*
|
|
3
|
-
* Proxy generator for a
|
|
3
|
+
* Proxy generator for a ContractStore that allows overriding contract instances and artifacts, so
|
|
4
4
|
* the contract function simulator can execute different bytecode on certain addresses. An example use case
|
|
5
5
|
* would be overriding your own account contract so that valid signatures don't have to be provided while simulating.
|
|
6
|
-
*/ export class
|
|
7
|
-
static create(
|
|
6
|
+
*/ export class ProxiedContractStoreFactory {
|
|
7
|
+
static create(contractStore, overrides) {
|
|
8
8
|
if (!overrides) {
|
|
9
|
-
return
|
|
9
|
+
return contractStore;
|
|
10
10
|
}
|
|
11
|
-
return new Proxy(
|
|
11
|
+
return new Proxy(contractStore, {
|
|
12
12
|
get (target, prop) {
|
|
13
13
|
switch(prop){
|
|
14
14
|
case 'getContractInstance':
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import type { NoteDao, NotesFilter } from '@aztec/stdlib/note';
|
|
2
2
|
import type { PXE } from '../pxe.js';
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
3
|
+
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
4
|
+
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
5
5
|
/**
|
|
6
6
|
* Methods provided by this class might help debugging but must not be used in production.
|
|
7
7
|
* No backwards compatibility or API stability should be expected. Use at your own risk.
|
|
8
8
|
*/
|
|
9
9
|
export declare class PXEDebugUtils {
|
|
10
10
|
#private;
|
|
11
|
-
private
|
|
12
|
-
private
|
|
13
|
-
constructor(
|
|
11
|
+
private contractStore;
|
|
12
|
+
private noteStore;
|
|
13
|
+
constructor(contractStore: ContractStore, noteStore: NoteStore);
|
|
14
14
|
/**
|
|
15
15
|
* Not injected through constructor since they're are co-dependant.
|
|
16
16
|
*/
|
|
@@ -28,4 +28,4 @@ export declare class PXEDebugUtils {
|
|
|
28
28
|
*/
|
|
29
29
|
getNotes(filter: NotesFilter): Promise<NoteDao[]>;
|
|
30
30
|
}
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlX2RlYnVnX3V0aWxzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZGVidWcvcHhlX2RlYnVnX3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUUvRCxPQUFPLEtBQUssRUFBRSxHQUFHLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDckMsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sNkNBQTZDLENBQUM7QUFDakYsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0scUNBQXFDLENBQUM7QUFFckU7OztHQUdHO0FBQ0gscUJBQWEsYUFBYTs7SUFJdEIsT0FBTyxDQUFDLGFBQWE7SUFDckIsT0FBTyxDQUFDLFNBQVM7SUFGbkIsWUFDVSxhQUFhLEVBQUUsYUFBYSxFQUM1QixTQUFTLEVBQUUsU0FBUyxFQUMxQjtJQUVKOztPQUVHO0lBQ0ksTUFBTSxDQUFDLEdBQUcsRUFBRSxHQUFHLFFBRXJCO0lBRUQ7Ozs7Ozs7Ozs7T0FVRztJQUNVLFFBQVEsQ0FBQyxNQUFNLEVBQUUsV0FBVyxHQUFHLE9BQU8sQ0FBQyxPQUFPLEVBQUUsQ0FBQyxDQVU3RDtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_debug_utils.d.ts","sourceRoot":"","sources":["../../src/debug/pxe_debug_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"pxe_debug_utils.d.ts","sourceRoot":"","sources":["../../src/debug/pxe_debug_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAErE;;;GAGG;AACH,qBAAa,aAAa;;IAItB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IAFnB,YACU,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EAC1B;IAEJ;;OAEG;IACI,MAAM,CAAC,GAAG,EAAE,GAAG,QAErB;IAED;;;;;;;;;;OAUG;IACU,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAU7D;CACF"}
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Methods provided by this class might help debugging but must not be used in production.
|
|
3
3
|
* No backwards compatibility or API stability should be expected. Use at your own risk.
|
|
4
4
|
*/ export class PXEDebugUtils {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
contractStore;
|
|
6
|
+
noteStore;
|
|
7
7
|
#pxe;
|
|
8
|
-
constructor(
|
|
9
|
-
this.
|
|
10
|
-
this.
|
|
8
|
+
constructor(contractStore, noteStore){
|
|
9
|
+
this.contractStore = contractStore;
|
|
10
|
+
this.noteStore = noteStore;
|
|
11
11
|
this.#pxe = undefined;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
throw new Error('Cannot getNotes because no PXE is set');
|
|
31
31
|
}
|
|
32
32
|
// We need to manually trigger private state sync to have a guarantee that all the notes are available.
|
|
33
|
-
const call = await this.
|
|
33
|
+
const call = await this.contractStore.getFunctionCall('sync_private_state', [], filter.contractAddress);
|
|
34
34
|
await this.#pxe.simulateUtility(call);
|
|
35
|
-
return this.
|
|
35
|
+
return this.noteStore.getNotes(filter);
|
|
36
36
|
}
|
|
37
37
|
}
|
|
@@ -13,4 +13,4 @@ import type { PXECreationOptions } from '../../pxe_creation_options.js';
|
|
|
13
13
|
* @returns A Promise that resolves to the started PXE instance.
|
|
14
14
|
*/
|
|
15
15
|
export declare function createPXE(aztecNode: AztecNode, config: PXEConfig, options?: PXECreationOptions): Promise<PXE>;
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvYnVuZGxlL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9BLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRWpFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzFELE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUN0QyxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRXhFOzs7Ozs7Ozs7R0FTRztBQUNILHdCQUFzQixTQUFTLENBQzdCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLE1BQU0sRUFBRSxTQUFTLEVBQ2pCLE9BQU8sR0FBRSxrQkFBb0MsZ0JBcUM5QyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/bundle/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/bundle/utils.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAExE;;;;;;;;;GASG;AACH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,SAAS,EACjB,OAAO,GAAE,kBAAoC,gBAqC9C"}
|