@aztec/pxe 0.0.1-commit.e6bd8901 → 0.0.1-commit.ee80a48
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 +3 -3
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +5 -5
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +2 -4
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +7 -9
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +8 -8
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +3 -3
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +15 -15
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +2 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +6 -8
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +20 -16
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +23 -27
- package/dest/contract_sync/index.d.ts +4 -3
- package/dest/contract_sync/index.d.ts.map +1 -1
- package/dest/contract_sync/index.js +12 -7
- package/dest/debug/pxe_debug_utils.d.ts +16 -6
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +17 -8
- 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 +12 -6
- 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 +13 -7
- 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 +19 -8
- package/dest/events/event_service.d.ts +4 -5
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +5 -6
- 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 +6 -5
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +10 -16
- package/dest/notes/note_service.d.ts +4 -5
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +6 -8
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +2 -2
- 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 +2 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts +3 -3
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/pxe.d.ts +1 -1
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +12 -11
- 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 +1 -1
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +22 -13
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +11 -1
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +143 -105
- package/dest/storage/private_event_store/private_event_store.d.ts +1 -1
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
- package/dest/storage/private_event_store/private_event_store.js +84 -61
- package/dest/storage/private_event_store/stored_private_event.d.ts +4 -4
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -1
- package/dest/storage/private_event_store/stored_private_event.js +2 -2
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +1 -1
- 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 +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +183 -113
- package/dest/tagging/get_all_logs_by_tags.d.ts +4 -4
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
- 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/utils/load_logs_for_range.d.ts +3 -3
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +3 -3
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +3 -3
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
- package/package.json +16 -16
- package/src/block_synchronizer/block_synchronizer.ts +17 -19
- package/src/contract_function_simulator/contract_function_simulator.ts +6 -6
- package/src/contract_function_simulator/oracle/interfaces.ts +10 -10
- package/src/contract_function_simulator/oracle/oracle.ts +27 -17
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +4 -8
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +32 -35
- package/src/contract_sync/index.ts +24 -5
- package/src/debug/pxe_debug_utils.ts +23 -9
- package/src/entrypoints/client/bundle/utils.ts +7 -14
- package/src/entrypoints/client/lazy/utils.ts +8 -14
- package/src/entrypoints/pxe_creation_options.ts +2 -1
- package/src/entrypoints/server/utils.ts +15 -19
- package/src/events/event_service.ts +4 -6
- package/src/job_coordinator/job_coordinator.ts +4 -3
- package/src/logs/log_service.ts +14 -15
- package/src/notes/note_service.ts +5 -8
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/private_kernel_execution_prover.ts +6 -3
- package/src/private_kernel/private_kernel_oracle.ts +2 -2
- package/src/pxe.ts +22 -9
- 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 +22 -11
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +159 -129
- package/src/storage/private_event_store/private_event_store.ts +102 -81
- package/src/storage/private_event_store/stored_private_event.ts +3 -3
- package/src/storage/tagging_store/recipient_tagging_store.ts +31 -21
- package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
- package/src/storage/tagging_store/sender_tagging_store.ts +210 -126
- package/src/tagging/get_all_logs_by_tags.ts +3 -3
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +2 -2
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +2 -2
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +2 -2
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +3 -3
|
@@ -4,7 +4,6 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
4
4
|
import { Timer } from '@aztec/foundation/timer';
|
|
5
5
|
import { toACVMWitness } from '@aztec/simulator/client';
|
|
6
6
|
import { FunctionSelector, countArgumentsSize } from '@aztec/stdlib/abi';
|
|
7
|
-
import { L2BlockHash } from '@aztec/stdlib/block';
|
|
8
7
|
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
9
8
|
import { PrivateContextInputs } from '@aztec/stdlib/kernel';
|
|
10
9
|
import { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
|
|
@@ -46,8 +45,8 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
46
45
|
contractClassLogs;
|
|
47
46
|
offchainEffects;
|
|
48
47
|
nestedExecutionResults;
|
|
49
|
-
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,
|
|
50
|
-
super(callContext.contractAddress, authWitnesses, capsules, anchorBlockHeader, contractStore, noteStore, keyStore, addressStore, aztecNode,
|
|
48
|
+
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, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobId, totalPublicCalldataCount = 0, sideEffectCounter = 0, log = createLogger('simulator:client_execution_context'), scopes, senderForTags, simulator){
|
|
49
|
+
super(callContext.contractAddress, authWitnesses, capsules, anchorBlockHeader, contractStore, noteStore, keyStore, addressStore, aztecNode, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobId, 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.noteHashNullifierCounterMap = new Map(), this.contractClassLogs = [], this.offchainEffects = [], this.nestedExecutionResults = [];
|
|
51
50
|
}
|
|
52
51
|
getPrivateContextInputs() {
|
|
53
52
|
return new PrivateContextInputs(this.callContext, this.anchorBlockHeader, this.txContext, this.sideEffectCounter);
|
|
@@ -157,8 +156,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
157
156
|
// This is a tagging secret we've not yet used in this tx, so first sync our store to make sure its indices
|
|
158
157
|
// are up to date. We do this here because this store is not synced as part of the global sync because
|
|
159
158
|
// that'd be wasteful as most tagging secrets are not used in each tx.
|
|
160
|
-
|
|
161
|
-
await syncSenderTaggingIndexes(secret, this.contractAddress, this.aztecNode, this.senderTaggingStore, anchorBlockHash, this.jobId);
|
|
159
|
+
await syncSenderTaggingIndexes(secret, this.contractAddress, this.aztecNode, this.senderTaggingStore, await this.anchorBlockHeader.hash(), this.jobId);
|
|
162
160
|
const lastUsedIndex = await this.senderTaggingStore.getLastUsedIndex(secret, this.jobId);
|
|
163
161
|
// If lastUsedIndex is undefined, we've never used this secret, so start from 0
|
|
164
162
|
// Otherwise, the next index to use is one past the last used index
|
|
@@ -217,7 +215,7 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
217
215
|
// Nullified pending notes are already removed from the list.
|
|
218
216
|
const pendingNotes = this.noteCache.getNotes(this.callContext.contractAddress, owner, storageSlot);
|
|
219
217
|
const pendingNullifiers = this.noteCache.getNullifiers(this.callContext.contractAddress);
|
|
220
|
-
const noteService = new NoteService(this.noteStore, this.aztecNode, this.
|
|
218
|
+
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockHeader, this.jobId);
|
|
221
219
|
const dbNotes = await noteService.getNotes(this.callContext.contractAddress, owner, storageSlot, status, this.scopes);
|
|
222
220
|
const dbNotesFiltered = dbNotes.filter((n)=>!pendingNullifiers.has(n.siloedNullifier.value));
|
|
223
221
|
const notes = pickNotes([
|
|
@@ -350,11 +348,11 @@ import { UtilityExecutionOracle } from './utility_execution_oracle.js';
|
|
|
350
348
|
const simulatorSetupTimer = new Timer();
|
|
351
349
|
this.log.debug(`Calling private function ${targetContractAddress}:${functionSelector} from ${this.callContext.contractAddress}`);
|
|
352
350
|
isStaticCall = isStaticCall || this.callContext.isStaticCall;
|
|
353
|
-
await ensureContractSynced(targetContractAddress, functionSelector, this.utilityExecutor, this.aztecNode, this.contractStore, this.anchorBlockHeader);
|
|
351
|
+
await ensureContractSynced(targetContractAddress, functionSelector, this.utilityExecutor, this.aztecNode, this.contractStore, this.noteStore, this.anchorBlockHeader, this.jobId);
|
|
354
352
|
const targetArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(targetContractAddress, functionSelector);
|
|
355
353
|
const derivedTxContext = this.txContext.clone();
|
|
356
354
|
const derivedCallContext = await this.deriveCallContext(targetContractAddress, targetArtifact, isStaticCall);
|
|
357
|
-
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.
|
|
355
|
+
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.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.jobId, this.totalPublicCalldataCount, sideEffectCounter, this.log, this.scopes, this.senderForTags, this.simulator);
|
|
358
356
|
const setupTime = simulatorSetupTimer.ms();
|
|
359
357
|
const childExecutionResult = await executePrivateFunction(this.simulator, privateExecutionOracle, targetArtifact, targetContractAddress, functionSelector);
|
|
360
358
|
if (isStaticCall) {
|
|
@@ -6,7 +6,7 @@ import type { MembershipWitness } from '@aztec/foundation/trees';
|
|
|
6
6
|
import type { KeyStore } from '@aztec/key-store';
|
|
7
7
|
import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
8
8
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
9
|
-
import {
|
|
9
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
10
10
|
import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
|
|
11
11
|
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
12
12
|
import type { KeyValidationRequest } from '@aztec/stdlib/kernel';
|
|
@@ -14,7 +14,6 @@ import type { NoteStatus } from '@aztec/stdlib/note';
|
|
|
14
14
|
import { type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
|
|
15
15
|
import type { BlockHeader, Capsule } from '@aztec/stdlib/tx';
|
|
16
16
|
import type { AddressStore } from '../../storage/address_store/address_store.js';
|
|
17
|
-
import type { AnchorBlockStore } from '../../storage/anchor_block_store/anchor_block_store.js';
|
|
18
17
|
import type { CapsuleStore } from '../../storage/capsule_store/capsule_store.js';
|
|
19
18
|
import type { ContractStore } from '../../storage/contract_store/contract_store.js';
|
|
20
19
|
import type { NoteStore } from '../../storage/note_store/note_store.js';
|
|
@@ -38,7 +37,6 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
38
37
|
protected readonly keyStore: KeyStore;
|
|
39
38
|
protected readonly addressStore: AddressStore;
|
|
40
39
|
protected readonly aztecNode: AztecNode;
|
|
41
|
-
protected readonly anchorBlockStore: AnchorBlockStore;
|
|
42
40
|
protected readonly recipientTaggingStore: RecipientTaggingStore;
|
|
43
41
|
protected readonly senderAddressBookStore: SenderAddressBookStore;
|
|
44
42
|
protected readonly capsuleStore: CapsuleStore;
|
|
@@ -51,7 +49,7 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
51
49
|
private aztecNrDebugLog;
|
|
52
50
|
constructor(contractAddress: AztecAddress,
|
|
53
51
|
/** List of transient auth witnesses to be used during this simulation */
|
|
54
|
-
authWitnesses: AuthWitness[], capsules: Capsule[], anchorBlockHeader: BlockHeader, contractStore: ContractStore, noteStore: NoteStore, keyStore: KeyStore, addressStore: AddressStore, aztecNode: AztecNode,
|
|
52
|
+
authWitnesses: AuthWitness[], capsules: Capsule[], anchorBlockHeader: BlockHeader, contractStore: ContractStore, noteStore: NoteStore, keyStore: KeyStore, addressStore: AddressStore, aztecNode: AztecNode, recipientTaggingStore: RecipientTaggingStore, senderAddressBookStore: SenderAddressBookStore, capsuleStore: CapsuleStore, privateEventStore: PrivateEventStore, jobId: string, log?: import("@aztec/foundation/log").Logger, scopes?: AztecAddress[] | undefined);
|
|
55
53
|
utilityAssertCompatibleOracleVersion(version: number): void;
|
|
56
54
|
utilityGetRandomField(): Fr;
|
|
57
55
|
utilityGetUtilityContext(): UtilityContext;
|
|
@@ -64,25 +62,31 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
64
62
|
utilityGetKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest>;
|
|
65
63
|
/**
|
|
66
64
|
* Fetches the index and sibling path of a leaf at a given block from the note hash tree.
|
|
67
|
-
* @param
|
|
68
|
-
*
|
|
65
|
+
* @param anchorBlockHash - The hash of a block that contains the note hash tree root in which to find the membership
|
|
66
|
+
* witness.
|
|
67
|
+
* @param noteHash - The note hash to find in the note hash tree.
|
|
69
68
|
* @returns The membership witness containing the leaf index and sibling path
|
|
70
69
|
*/
|
|
71
|
-
utilityGetNoteHashMembershipWitness(
|
|
70
|
+
utilityGetNoteHashMembershipWitness(anchorBlockHash: BlockHash, noteHash: Fr): Promise<MembershipWitness<typeof NOTE_HASH_TREE_HEIGHT> | undefined>;
|
|
72
71
|
/**
|
|
73
|
-
* Fetches the index and sibling path of a
|
|
74
|
-
*
|
|
75
|
-
*
|
|
72
|
+
* Fetches the index and sibling path of a block hash in the archive tree.
|
|
73
|
+
*
|
|
74
|
+
* Block hashes are the leaves of the archive tree. Each time a new block is added to the chain,
|
|
75
|
+
* its block hash is appended as a new leaf to the archive tree.
|
|
76
|
+
*
|
|
77
|
+
* @param anchorBlockHash - The hash of a block that contains the archive tree root in which to find the membership
|
|
78
|
+
* witness.
|
|
79
|
+
* @param blockHash - The block hash to find in the archive tree.
|
|
76
80
|
* @returns The membership witness containing the leaf index and sibling path
|
|
77
81
|
*/
|
|
78
|
-
|
|
82
|
+
utilityGetBlockHashMembershipWitness(anchorBlockHash: BlockHash, blockHash: BlockHash): Promise<MembershipWitness<typeof ARCHIVE_HEIGHT> | undefined>;
|
|
79
83
|
/**
|
|
80
84
|
* Returns a nullifier membership witness for a given nullifier at a given block.
|
|
81
85
|
* @param blockHash - The block hash at which to get the index.
|
|
82
86
|
* @param nullifier - Nullifier we try to find witness for.
|
|
83
87
|
* @returns The nullifier membership witness (if found).
|
|
84
88
|
*/
|
|
85
|
-
utilityGetNullifierMembershipWitness(blockHash:
|
|
89
|
+
utilityGetNullifierMembershipWitness(blockHash: BlockHash, nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
|
|
86
90
|
/**
|
|
87
91
|
* Returns a low nullifier membership witness for a given nullifier at a given block.
|
|
88
92
|
* @param blockHash - The block hash at which to get the index.
|
|
@@ -92,14 +96,14 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
92
96
|
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
93
97
|
* we are trying to prove non-inclusion for.
|
|
94
98
|
*/
|
|
95
|
-
utilityGetLowNullifierMembershipWitness(blockHash:
|
|
99
|
+
utilityGetLowNullifierMembershipWitness(blockHash: BlockHash, nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
|
|
96
100
|
/**
|
|
97
101
|
* Returns a public data tree witness for a given leaf slot at a given block.
|
|
98
102
|
* @param blockHash - The block hash at which to get the index.
|
|
99
103
|
* @param leafSlot - The slot of the public data tree to get the witness for.
|
|
100
104
|
* @returns - The witness
|
|
101
105
|
*/
|
|
102
|
-
utilityGetPublicDataWitness(blockHash:
|
|
106
|
+
utilityGetPublicDataWitness(blockHash: BlockHash, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
|
|
103
107
|
/**
|
|
104
108
|
* Fetches a block header of a given block.
|
|
105
109
|
* @param blockNumber - The number of a block of which to get the block header.
|
|
@@ -173,7 +177,7 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
173
177
|
* @param startStorageSlot - The starting storage slot.
|
|
174
178
|
* @param numberOfElements - Number of elements to read from the starting storage slot.
|
|
175
179
|
*/
|
|
176
|
-
utilityStorageRead(blockHash:
|
|
180
|
+
utilityStorageRead(blockHash: BlockHash, contractAddress: AztecAddress, startStorageSlot: Fr, numberOfElements: number): Promise<Fr[]>;
|
|
177
181
|
utilityDebugLog(level: number, message: string, fields: Fr[]): void;
|
|
178
182
|
utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
|
|
179
183
|
/**
|
|
@@ -202,4 +206,4 @@ export declare class UtilityExecutionOracle implements IMiscOracle, IUtilityExec
|
|
|
202
206
|
utilityGetSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
|
|
203
207
|
protected getSharedSecret(address: AztecAddress, ephPk: Point): Promise<Point>;
|
|
204
208
|
}
|
|
205
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
209
|
+
//# sourceMapp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JQUVEOzs7OztPQUtHO0lBQ0ksc0JBQXNCLENBQUMsT0FBTyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FFakY7SUFFRCxVQUFnQixlQUFlLENBQUMsT0FBTyxFQUFFLFlBQVksRUFBRSxLQUFLLEVBQUUsS0FBSyxHQUFHLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FRbkY7Q0FDRiJ9
|
|
@@ -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,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,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,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,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,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,cAAc,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,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AAK,EAAE,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,CAQnF;CACF"}
|
|
@@ -29,7 +29,6 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
29
29
|
keyStore;
|
|
30
30
|
addressStore;
|
|
31
31
|
aztecNode;
|
|
32
|
-
anchorBlockStore;
|
|
33
32
|
recipientTaggingStore;
|
|
34
33
|
senderAddressBookStore;
|
|
35
34
|
capsuleStore;
|
|
@@ -40,7 +39,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
40
39
|
isMisc;
|
|
41
40
|
isUtility;
|
|
42
41
|
aztecNrDebugLog;
|
|
43
|
-
constructor(contractAddress, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, anchorBlockHeader, contractStore, noteStore, keyStore, addressStore, aztecNode,
|
|
42
|
+
constructor(contractAddress, /** List of transient auth witnesses to be used during this simulation */ authWitnesses, capsules, anchorBlockHeader, contractStore, noteStore, keyStore, addressStore, aztecNode, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobId, log = createLogger('simulator:client_view_context'), scopes){
|
|
44
43
|
this.contractAddress = contractAddress;
|
|
45
44
|
this.authWitnesses = authWitnesses;
|
|
46
45
|
this.capsules = capsules;
|
|
@@ -50,7 +49,6 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
50
49
|
this.keyStore = keyStore;
|
|
51
50
|
this.addressStore = addressStore;
|
|
52
51
|
this.aztecNode = aztecNode;
|
|
53
|
-
this.anchorBlockStore = anchorBlockStore;
|
|
54
52
|
this.recipientTaggingStore = recipientTaggingStore;
|
|
55
53
|
this.senderAddressBookStore = senderAddressBookStore;
|
|
56
54
|
this.capsuleStore = capsuleStore;
|
|
@@ -83,19 +81,25 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
83
81
|
}
|
|
84
82
|
/**
|
|
85
83
|
* Fetches the index and sibling path of a leaf at a given block from the note hash tree.
|
|
86
|
-
* @param
|
|
87
|
-
*
|
|
84
|
+
* @param anchorBlockHash - The hash of a block that contains the note hash tree root in which to find the membership
|
|
85
|
+
* witness.
|
|
86
|
+
* @param noteHash - The note hash to find in the note hash tree.
|
|
88
87
|
* @returns The membership witness containing the leaf index and sibling path
|
|
89
|
-
*/ utilityGetNoteHashMembershipWitness(
|
|
90
|
-
return this.aztecNode.getNoteHashMembershipWitness(
|
|
88
|
+
*/ utilityGetNoteHashMembershipWitness(anchorBlockHash, noteHash) {
|
|
89
|
+
return this.aztecNode.getNoteHashMembershipWitness(anchorBlockHash, noteHash);
|
|
91
90
|
}
|
|
92
91
|
/**
|
|
93
|
-
* Fetches the index and sibling path of a
|
|
94
|
-
*
|
|
95
|
-
*
|
|
92
|
+
* Fetches the index and sibling path of a block hash in the archive tree.
|
|
93
|
+
*
|
|
94
|
+
* Block hashes are the leaves of the archive tree. Each time a new block is added to the chain,
|
|
95
|
+
* its block hash is appended as a new leaf to the archive tree.
|
|
96
|
+
*
|
|
97
|
+
* @param anchorBlockHash - The hash of a block that contains the archive tree root in which to find the membership
|
|
98
|
+
* witness.
|
|
99
|
+
* @param blockHash - The block hash to find in the archive tree.
|
|
96
100
|
* @returns The membership witness containing the leaf index and sibling path
|
|
97
|
-
*/
|
|
98
|
-
return this.aztecNode.
|
|
101
|
+
*/ utilityGetBlockHashMembershipWitness(anchorBlockHash, blockHash) {
|
|
102
|
+
return this.aztecNode.getBlockHashMembershipWitness(anchorBlockHash, blockHash);
|
|
99
103
|
}
|
|
100
104
|
/**
|
|
101
105
|
* Returns a nullifier membership witness for a given nullifier at a given block.
|
|
@@ -129,7 +133,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
129
133
|
* @param blockNumber - The number of a block of which to get the block header.
|
|
130
134
|
* @returns Block extracted from a block with block number `blockNumber`.
|
|
131
135
|
*/ async utilityGetBlockHeader(blockNumber) {
|
|
132
|
-
const anchorBlockNumber =
|
|
136
|
+
const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
|
|
133
137
|
if (blockNumber > anchorBlockNumber) {
|
|
134
138
|
throw new Error(`Block number ${blockNumber} is higher than current block ${anchorBlockNumber}`);
|
|
135
139
|
}
|
|
@@ -196,7 +200,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
196
200
|
* @param status - The status of notes to fetch.
|
|
197
201
|
* @returns Array of note data.
|
|
198
202
|
*/ async utilityGetNotes(owner, storageSlot, numSelects, selectByIndexes, selectByOffsets, selectByLengths, selectValues, selectComparators, sortByIndexes, sortByOffsets, sortByLengths, sortOrder, limit, offset, status) {
|
|
199
|
-
const noteService = new NoteService(this.noteStore, this.aztecNode, this.
|
|
203
|
+
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockHeader, this.jobId);
|
|
200
204
|
const dbNotes = await noteService.getNotes(this.contractAddress, owner, storageSlot, status, this.scopes);
|
|
201
205
|
return pickNotes(dbNotes, {
|
|
202
206
|
selects: selectByIndexes.slice(0, numSelects).map((index, i)=>({
|
|
@@ -262,16 +266,8 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
262
266
|
this.aztecNrDebugLog[levelName](`${applyStringFormatting(message, fields)}`);
|
|
263
267
|
}
|
|
264
268
|
async utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot) {
|
|
265
|
-
const logService = new LogService(this.aztecNode, this.
|
|
266
|
-
|
|
267
|
-
// It is acceptable to run the following operations in parallel for several reasons:
|
|
268
|
-
// 1. syncTaggedLogs does not write to the note store — it only stores the pending tagged logs in a capsule array,
|
|
269
|
-
// which is then processed in Noir after this handler returns.
|
|
270
|
-
// 2. Even if syncTaggedLogs did write to the note store, it would not cause inconsistent state.
|
|
271
|
-
await Promise.all([
|
|
272
|
-
logService.syncTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes),
|
|
273
|
-
noteService.syncNoteNullifiers(this.contractAddress)
|
|
274
|
-
]);
|
|
269
|
+
const logService = new LogService(this.aztecNode, this.anchorBlockHeader, this.keyStore, this.capsuleStore, this.recipientTaggingStore, this.senderAddressBookStore, this.addressStore, this.jobId, this.log.getBindings());
|
|
270
|
+
await logService.fetchTaggedLogs(this.contractAddress, pendingTaggedLogArrayBaseSlot, this.scopes);
|
|
275
271
|
}
|
|
276
272
|
/**
|
|
277
273
|
* Validates all note and event validation requests enqueued via `enqueue_note_for_validation` and
|
|
@@ -291,9 +287,9 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
291
287
|
// faster as we don't need to wait for the network round-trip.
|
|
292
288
|
const noteValidationRequests = (await this.capsuleStore.readCapsuleArray(contractAddress, noteValidationRequestsArrayBaseSlot, this.jobId)).map(NoteValidationRequest.fromFields);
|
|
293
289
|
const eventValidationRequests = (await this.capsuleStore.readCapsuleArray(contractAddress, eventValidationRequestsArrayBaseSlot, this.jobId)).map(EventValidationRequest.fromFields);
|
|
294
|
-
const noteService = new NoteService(this.noteStore, this.aztecNode, this.
|
|
290
|
+
const noteService = new NoteService(this.noteStore, this.aztecNode, this.anchorBlockHeader, this.jobId);
|
|
295
291
|
const noteStorePromises = noteValidationRequests.map((request)=>noteService.validateAndStoreNote(request.contractAddress, request.owner, request.storageSlot, request.randomness, request.noteNonce, request.content, request.noteHash, request.nullifier, request.txHash, request.recipient));
|
|
296
|
-
const eventService = new EventService(this.
|
|
292
|
+
const eventService = new EventService(this.anchorBlockHeader, this.aztecNode, this.privateEventStore, this.jobId);
|
|
297
293
|
const eventStorePromises = eventValidationRequests.map((request)=>eventService.validateAndStoreEvent(request.contractAddress, request.eventTypeId, request.randomness, request.serializedEvent, request.eventCommitment, request.txHash, request.recipient));
|
|
298
294
|
await Promise.all([
|
|
299
295
|
...noteStorePromises,
|
|
@@ -311,7 +307,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
311
307
|
// We read all log retrieval requests and process them all concurrently. This makes the process much faster as we
|
|
312
308
|
// don't need to wait for the network round-trip.
|
|
313
309
|
const logRetrievalRequests = (await this.capsuleStore.readCapsuleArray(contractAddress, logRetrievalRequestsArrayBaseSlot, this.jobId)).map(LogRetrievalRequest.fromFields);
|
|
314
|
-
const logService = new LogService(this.aztecNode, this.
|
|
310
|
+
const logService = new LogService(this.aztecNode, this.anchorBlockHeader, this.keyStore, this.capsuleStore, this.recipientTaggingStore, this.senderAddressBookStore, this.addressStore, this.jobId, this.log.getBindings());
|
|
315
311
|
const maybeLogRetrievalResponses = await logService.bulkRetrieveLogs(logRetrievalRequests);
|
|
316
312
|
// Requests are cleared once we're done.
|
|
317
313
|
await this.capsuleStore.setCapsuleArray(contractAddress, logRetrievalRequestsArrayBaseSlot, [], this.jobId);
|
|
@@ -4,6 +4,7 @@ import type { ContractInstance } from '@aztec/stdlib/contract';
|
|
|
4
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
6
6
|
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
7
|
+
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
7
8
|
/**
|
|
8
9
|
* Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
|
|
9
10
|
* from the instance is used.
|
|
@@ -14,10 +15,10 @@ import type { ContractStore } from '../storage/contract_store/contract_store.js'
|
|
|
14
15
|
* @returns The current class id.
|
|
15
16
|
*/
|
|
16
17
|
export declare function readCurrentClassId(contractAddress: AztecAddress, instance: ContractInstance, aztecNode: AztecNode, header: BlockHeader): Promise<import("@aztec/foundation/schemas").Fr>;
|
|
17
|
-
export declare function syncState(contractAddress: AztecAddress, contractStore: ContractStore, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (privateSyncCall: FunctionCall) => Promise<any
|
|
18
|
+
export declare function syncState(contractAddress: AztecAddress, contractStore: ContractStore, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (privateSyncCall: FunctionCall) => Promise<any>, noteStore: NoteStore, aztecNode: AztecNode, header: BlockHeader, jobId: string): Promise<void>;
|
|
18
19
|
/**
|
|
19
20
|
* Ensures the contract's private state is synchronized and that the PXE holds the current class artifact for
|
|
20
21
|
* the contract.
|
|
21
22
|
*/
|
|
22
|
-
export declare function ensureContractSynced(contractAddress: AztecAddress, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (call: FunctionCall) => Promise<any>, aztecNode: AztecNode, contractStore: ContractStore, header: BlockHeader): Promise<void>;
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
23
|
+
export declare function ensureContractSynced(contractAddress: AztecAddress, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (call: FunctionCall) => Promise<any>, aztecNode: AztecNode, contractStore: ContractStore, noteStore: NoteStore, header: BlockHeader, jobId: string): Promise<void>;
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250cmFjdF9zeW5jL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ3hFLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFL0QsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFHcEQsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sNkNBQTZDLENBQUM7QUFDakYsT0FBTyxLQUFLLEVBQUU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EACpB,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ProtocolContractAddress, isProtocolContract } from '@aztec/protocol-contracts';
|
|
2
|
-
import { L2BlockHash } from '@aztec/stdlib/block';
|
|
3
2
|
import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '@aztec/stdlib/delayed-public-mutable';
|
|
3
|
+
import { NoteService } from '../notes/note_service.js';
|
|
4
4
|
/**
|
|
5
5
|
* Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
|
|
6
6
|
* from the instance is used.
|
|
@@ -10,8 +10,7 @@ import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '
|
|
|
10
10
|
* @param header - The header of the block at which to load the DelayedPublicMutable storing the class id.
|
|
11
11
|
* @returns The current class id.
|
|
12
12
|
*/ export async function readCurrentClassId(contractAddress, instance, aztecNode, header) {
|
|
13
|
-
const
|
|
14
|
-
const blockHash = L2BlockHash.fromField(blockHashFr);
|
|
13
|
+
const blockHash = await header.hash();
|
|
15
14
|
const timestamp = header.globalVariables.timestamp;
|
|
16
15
|
const { delayedPublicMutableSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
|
|
17
16
|
const delayedPublicMutableValues = await DelayedPublicMutableValues.readFromTree(delayedPublicMutableSlot, (slot)=>aztecNode.getPublicStorageAt(blockHash, ProtocolContractAddress.ContractInstanceRegistry, slot));
|
|
@@ -21,14 +20,20 @@ import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '
|
|
|
21
20
|
}
|
|
22
21
|
return currentClassId;
|
|
23
22
|
}
|
|
24
|
-
export async function syncState(contractAddress, contractStore, functionToInvokeAfterSync, utilityExecutor) {
|
|
23
|
+
export async function syncState(contractAddress, contractStore, functionToInvokeAfterSync, utilityExecutor, noteStore, aztecNode, header, jobId) {
|
|
25
24
|
// Protocol contracts don't have private state to sync
|
|
26
25
|
if (!isProtocolContract(contractAddress)) {
|
|
27
26
|
const syncStateFunctionCall = await contractStore.getFunctionCall('sync_state', [], contractAddress);
|
|
28
27
|
if (functionToInvokeAfterSync && functionToInvokeAfterSync.equals(syncStateFunctionCall.selector)) {
|
|
29
28
|
throw new Error('Forbidden `sync_state` invocation. `sync_state` can only be invoked by PXE, manual execution can lead to inconsistencies.');
|
|
30
29
|
}
|
|
31
|
-
|
|
30
|
+
const noteService = new NoteService(noteStore, aztecNode, header, jobId);
|
|
31
|
+
// Both sync_state and syncNoteNullifiers interact with the note store, but running them in parallel is safe
|
|
32
|
+
// because note store is designed to handle concurrent operations.
|
|
33
|
+
await Promise.all([
|
|
34
|
+
utilityExecutor(syncStateFunctionCall),
|
|
35
|
+
noteService.syncNoteNullifiers(contractAddress)
|
|
36
|
+
]);
|
|
32
37
|
}
|
|
33
38
|
}
|
|
34
39
|
/**
|
|
@@ -48,9 +53,9 @@ export async function syncState(contractAddress, contractStore, functionToInvoke
|
|
|
48
53
|
/**
|
|
49
54
|
* Ensures the contract's private state is synchronized and that the PXE holds the current class artifact for
|
|
50
55
|
* the contract.
|
|
51
|
-
*/ export async function ensureContractSynced(contractAddress, functionToInvokeAfterSync, utilityExecutor, aztecNode, contractStore, header) {
|
|
56
|
+
*/ export async function ensureContractSynced(contractAddress, functionToInvokeAfterSync, utilityExecutor, aztecNode, contractStore, noteStore, header, jobId) {
|
|
52
57
|
await Promise.all([
|
|
53
|
-
syncState(contractAddress, contractStore, functionToInvokeAfterSync, utilityExecutor),
|
|
58
|
+
syncState(contractAddress, contractStore, functionToInvokeAfterSync, utilityExecutor, noteStore, aztecNode, header, jobId),
|
|
54
59
|
verifyCurrentClassId(contractAddress, aztecNode, contractStore, header)
|
|
55
60
|
]);
|
|
56
61
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { NoteDao, NotesFilter } from '@aztec/stdlib/note';
|
|
2
|
+
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
3
|
+
import type { BlockSynchronizer } from '../block_synchronizer/block_synchronizer.js';
|
|
2
4
|
import type { PXE } from '../pxe.js';
|
|
3
5
|
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
6
|
+
import type { AnchorBlockStore } from '../storage/index.js';
|
|
4
7
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
5
8
|
/**
|
|
6
9
|
* Methods provided by this class might help debugging but must not be used in production.
|
|
@@ -10,11 +13,11 @@ export declare class PXEDebugUtils {
|
|
|
10
13
|
#private;
|
|
11
14
|
private contractStore;
|
|
12
15
|
private noteStore;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
setPXE(pxe: PXE): void;
|
|
16
|
+
private blockStateSynchronizer;
|
|
17
|
+
private anchorBlockStore;
|
|
18
|
+
constructor(contractStore: ContractStore, noteStore: NoteStore, blockStateSynchronizer: BlockSynchronizer, anchorBlockStore: AnchorBlockStore);
|
|
19
|
+
/** Not injected through constructor since they're are co-dependant */
|
|
20
|
+
setPXE(pxe: PXE, putJobInQueue: <T>(job: (jobId: string) => Promise<T>) => Promise<T>): void;
|
|
18
21
|
/**
|
|
19
22
|
* A debugging utility to get notes based on the provided filter.
|
|
20
23
|
*
|
|
@@ -27,5 +30,12 @@ export declare class PXEDebugUtils {
|
|
|
27
30
|
* @returns The requested notes.
|
|
28
31
|
*/
|
|
29
32
|
getNotes(filter: NotesFilter): Promise<NoteDao[]>;
|
|
33
|
+
/** Returns the block header up to which the PXE has synced. */
|
|
34
|
+
getSyncedBlockHeader(): Promise<BlockHeader>;
|
|
35
|
+
/**
|
|
36
|
+
* Triggers a sync of the PXE with the node.
|
|
37
|
+
* Blocks until the sync is complete.
|
|
38
|
+
*/
|
|
39
|
+
sync(): Promise<void>;
|
|
30
40
|
}
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
41
|
+
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sQ0FBQyxFQUFFLEdBQUcsRUFBRSxDQUFDLEtBQUssRUFBRSxNQUFNLEtBQUssT0FBTyxDQUFDLENBQUMsQ0FBQyxLQUFLLE9BQU8sQ0FBQyxDQUFDLENBQUMsUUFHM0Y7SUFFRDs7Ozs7Ozs7OztPQVVHO0lBQ1UsUUFBUSxDQUFDLE1BQU0sRUFBRSxXQUFXLEdBQUcsT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBTTdEO0lBRUQsK0RBQStEO0lBQ3hELG9CQUFvQixJQUFJLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FFbEQ7SUFFRDs7O09BR0c7SUFDSSxJQUFJLElBQUksT0FBTyxDQUFDLElBQUksQ0FBQyxDQUUzQjtDQUNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_debug_utils.d.ts","sourceRoot":"","sources":["../../src/debug/pxe_debug_utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"pxe_debug_utils.d.ts","sourceRoot":"","sources":["../../src/debug/pxe_debug_utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AACrF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAErE;;;GAGG;AACH,qBAAa,aAAa;;IAKtB,OAAO,CAAC,aAAa;IACrB,OAAO,CAAC,SAAS;IACjB,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,gBAAgB;IAJ1B,YACU,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,SAAS,EACpB,sBAAsB,EAAE,iBAAiB,EACzC,gBAAgB,EAAE,gBAAgB,EACxC;IAEJ,sEAAsE;IAC/D,MAAM,CAAC,GAAG,EAAE,GAAG,EAAE,aAAa,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,CAAC,CAAC,QAG3F;IAED;;;;;;;;;;OAUG;IACU,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAM7D;IAED,+DAA+D;IACxD,oBAAoB,IAAI,OAAO,CAAC,WAAW,CAAC,CAElD;IAED;;;OAGG;IACI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;CACF"}
|
|
@@ -5,16 +5,19 @@ import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
|
5
5
|
*/ export class PXEDebugUtils {
|
|
6
6
|
contractStore;
|
|
7
7
|
noteStore;
|
|
8
|
+
blockStateSynchronizer;
|
|
9
|
+
anchorBlockStore;
|
|
8
10
|
#pxe;
|
|
9
|
-
|
|
11
|
+
#putJobInQueue;
|
|
12
|
+
constructor(contractStore, noteStore, blockStateSynchronizer, anchorBlockStore){
|
|
10
13
|
this.contractStore = contractStore;
|
|
11
14
|
this.noteStore = noteStore;
|
|
12
|
-
this
|
|
15
|
+
this.blockStateSynchronizer = blockStateSynchronizer;
|
|
16
|
+
this.anchorBlockStore = anchorBlockStore;
|
|
13
17
|
}
|
|
14
|
-
/**
|
|
15
|
-
* Not injected through constructor since they're are co-dependant.
|
|
16
|
-
*/ setPXE(pxe) {
|
|
18
|
+
/** Not injected through constructor since they're are co-dependant */ setPXE(pxe, putJobInQueue) {
|
|
17
19
|
this.#pxe = pxe;
|
|
20
|
+
this.#putJobInQueue = putJobInQueue;
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* A debugging utility to get notes based on the provided filter.
|
|
@@ -27,12 +30,18 @@ import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
|
27
30
|
* @param filter - The filter to apply to the notes.
|
|
28
31
|
* @returns The requested notes.
|
|
29
32
|
*/ async getNotes(filter) {
|
|
30
|
-
if (!this.#pxe) {
|
|
31
|
-
throw new Error('Cannot getNotes because no PXE is set');
|
|
32
|
-
}
|
|
33
33
|
// We need to manually trigger private state sync to have a guarantee that all the notes are available.
|
|
34
34
|
const call = await this.contractStore.getFunctionCall('sync_state', [], filter.contractAddress);
|
|
35
35
|
await this.#pxe.simulateUtility(call);
|
|
36
36
|
return this.noteStore.getNotes(filter, randomBytes(8).toString('hex'));
|
|
37
37
|
}
|
|
38
|
+
/** Returns the block header up to which the PXE has synced. */ getSyncedBlockHeader() {
|
|
39
|
+
return this.anchorBlockStore.getBlockHeader();
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Triggers a sync of the PXE with the node.
|
|
43
|
+
* Blocks until the sync is complete.
|
|
44
|
+
*/ sync() {
|
|
45
|
+
return this.#putJobInQueue(()=>this.blockStateSynchronizer.sync());
|
|
46
|
+
}
|
|
38
47
|
}
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvYnVuZGxlL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU1BLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBRWpFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzFELE9BQU8sRUFBRSxHQUFHLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUV0QyxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLCtCQUErQixDQUFDO0FBRXhFOzs7Ozs7Ozs7R0FTRztBQUNILHdCQUFzQixTQUFTLENBQzdCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLE1BQU0sRUFBRSxTQUFTLEVBQ2pCLE9BQU8sR0FBRSxrQkFBb0MsZ0JBOEI5QyJ9
|
|
@@ -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":"AAMA,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;AAEtC,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,gBA8B9C"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { BBPrivateKernelProver } from '@aztec/bb-prover/client';
|
|
2
2
|
import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
|
|
3
|
-
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
4
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
4
|
import { createStore } from '@aztec/kv-store/indexeddb';
|
|
6
5
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
7
6
|
import { WASMSimulator } from '@aztec/simulator/client';
|
|
8
7
|
import { PXE } from '../../../pxe.js';
|
|
8
|
+
import { PXE_DATA_SCHEMA_VERSION } from '../../../storage/metadata.js';
|
|
9
9
|
/**
|
|
10
10
|
* Create and start an PXE instance with the given AztecNode.
|
|
11
11
|
* If no keyStore or database is provided, it will use KeyStore and MemoryDB as default values.
|
|
@@ -18,17 +18,21 @@ import { PXE } from '../../../pxe.js';
|
|
|
18
18
|
*/ export async function createPXE(aztecNode, config, options = {
|
|
19
19
|
loggers: {}
|
|
20
20
|
}) {
|
|
21
|
-
const
|
|
21
|
+
const actor = options.loggerActorLabel;
|
|
22
22
|
const loggers = options.loggers ?? {};
|
|
23
23
|
const l1Contracts = await aztecNode.getL1ContractAddresses();
|
|
24
24
|
const configWithContracts = {
|
|
25
25
|
...config,
|
|
26
26
|
l1Contracts
|
|
27
27
|
};
|
|
28
|
-
const storeLogger = loggers.store
|
|
29
|
-
|
|
28
|
+
const storeLogger = loggers.store ?? createLogger('pxe:data:idb', {
|
|
29
|
+
actor
|
|
30
|
+
});
|
|
31
|
+
const store = options.store ?? await createStore('pxe_data', configWithContracts, PXE_DATA_SCHEMA_VERSION, storeLogger);
|
|
30
32
|
const simulator = options.simulator ?? new WASMSimulator();
|
|
31
|
-
const proverLogger = loggers.prover
|
|
33
|
+
const proverLogger = loggers.prover ?? createLogger('pxe:bb:wasm:bundle', {
|
|
34
|
+
actor
|
|
35
|
+
});
|
|
32
36
|
let prover;
|
|
33
37
|
if (options.proverOrOptions instanceof BBPrivateKernelProver) {
|
|
34
38
|
prover = options.proverOrOptions;
|
|
@@ -39,7 +43,9 @@ import { PXE } from '../../../pxe.js';
|
|
|
39
43
|
});
|
|
40
44
|
}
|
|
41
45
|
const protocolContractsProvider = new BundledProtocolContractsProvider();
|
|
42
|
-
const pxeLogger = loggers.pxe
|
|
46
|
+
const pxeLogger = loggers.pxe ?? createLogger('pxe:service', {
|
|
47
|
+
actor
|
|
48
|
+
});
|
|
43
49
|
const pxe = await PXE.create(aztecNode, store, prover, simulator, protocolContractsProvider, config, pxeLogger);
|
|
44
50
|
return pxe;
|
|
45
51
|
}
|