@aztec/pxe 0.0.1-commit.343b43af6 → 0.0.1-commit.35158ae7e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +9 -3
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +25 -3
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +5 -5
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +17 -9
- package/dest/contract_function_simulator/index.d.ts +2 -1
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.js +57 -0
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +4 -2
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +42 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +4 -2
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +36 -5
- package/dest/contract_function_simulator/oracle/private_execution.js +4 -2
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +4 -15
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +4 -17
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +24 -8
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +94 -17
- package/dest/contract_sync/contract_sync_service.d.ts +5 -3
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
- package/dest/contract_sync/contract_sync_service.js +47 -30
- package/dest/messages/message_context_service.d.ts +17 -0
- package/dest/messages/message_context_service.d.ts.map +1 -0
- package/dest/messages/message_context_service.js +36 -0
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +2 -2
- package/dest/pxe.d.ts +6 -3
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +33 -19
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +26 -25
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +141 -115
- package/dest/tagging/index.d.ts +2 -2
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +10 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +4 -3
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +20 -10
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +2 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +24 -11
- package/package.json +16 -16
- package/src/contract_function_simulator/contract_function_simulator.ts +36 -4
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +16 -11
- package/src/contract_function_simulator/index.ts +1 -0
- package/src/contract_function_simulator/noir-structs/message_tx_context.ts +55 -0
- package/src/contract_function_simulator/oracle/interfaces.ts +7 -1
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +135 -0
- package/src/contract_function_simulator/oracle/oracle.ts +43 -5
- package/src/contract_function_simulator/oracle/private_execution.ts +3 -3
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +5 -21
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +147 -23
- package/src/contract_sync/contract_sync_service.ts +67 -38
- package/src/messages/message_context_service.ts +45 -0
- package/src/oracle_version.ts +2 -2
- package/src/pxe.ts +51 -18
- package/src/storage/metadata.ts +1 -1
- package/src/storage/tagging_store/sender_tagging_store.ts +182 -135
- package/src/tagging/index.ts +1 -1
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +19 -1
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +26 -11
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +19 -9
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Aes128 } from '@aztec/foundation/crypto/aes128';
|
|
2
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { LogLevels, createLogger } from '@aztec/foundation/log';
|
|
4
|
+
import { isProtocolContract } from '@aztec/protocol-contracts';
|
|
4
5
|
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
5
6
|
import { computeAddressSecret } from '@aztec/stdlib/keys';
|
|
6
7
|
import { deriveEcdhSharedSecret } from '@aztec/stdlib/logs';
|
|
@@ -14,6 +15,7 @@ import { ORACLE_VERSION } from '../../oracle_version.js';
|
|
|
14
15
|
import { EventValidationRequest } from '../noir-structs/event_validation_request.js';
|
|
15
16
|
import { LogRetrievalRequest } from '../noir-structs/log_retrieval_request.js';
|
|
16
17
|
import { LogRetrievalResponse } from '../noir-structs/log_retrieval_response.js';
|
|
18
|
+
import { MessageTxContext } from '../noir-structs/message_tx_context.js';
|
|
17
19
|
import { NoteValidationRequest } from '../noir-structs/note_validation_request.js';
|
|
18
20
|
import { UtilityContext } from '../noir-structs/utility_context.js';
|
|
19
21
|
import { pickNotes } from '../pick_notes.js';
|
|
@@ -24,6 +26,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
24
26
|
isMisc = true;
|
|
25
27
|
isUtility = true;
|
|
26
28
|
contractLogger;
|
|
29
|
+
offchainEffects = [];
|
|
27
30
|
contractAddress;
|
|
28
31
|
authWitnesses;
|
|
29
32
|
capsules;
|
|
@@ -37,6 +40,8 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
37
40
|
senderAddressBookStore;
|
|
38
41
|
capsuleStore;
|
|
39
42
|
privateEventStore;
|
|
43
|
+
messageContextService;
|
|
44
|
+
contractSyncService;
|
|
40
45
|
jobId;
|
|
41
46
|
logger;
|
|
42
47
|
scopes;
|
|
@@ -54,11 +59,25 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
54
59
|
this.senderAddressBookStore = args.senderAddressBookStore;
|
|
55
60
|
this.capsuleStore = args.capsuleStore;
|
|
56
61
|
this.privateEventStore = args.privateEventStore;
|
|
62
|
+
this.messageContextService = args.messageContextService;
|
|
63
|
+
this.contractSyncService = args.contractSyncService;
|
|
57
64
|
this.jobId = args.jobId;
|
|
58
65
|
this.logger = args.log ?? createLogger('simulator:client_view_context');
|
|
59
66
|
this.scopes = args.scopes;
|
|
60
67
|
}
|
|
61
68
|
assertCompatibleOracleVersion(version) {
|
|
69
|
+
// TODO(F-416): Remove this hack on v5 when protocol contracts are redeployed.
|
|
70
|
+
// Protocol contracts/canonical contracts shipped with committed bytecode that cannot be changed. Assert they use
|
|
71
|
+
// the expected pinned version or the current one. We want to allow for both the pinned and the current versions
|
|
72
|
+
// because we want this code to work with both the pinned and unpinned version since some branches do not have the
|
|
73
|
+
// pinned contracts (like e.g. next)
|
|
74
|
+
const LEGACY_ORACLE_VERSION = 12;
|
|
75
|
+
if (isProtocolContract(this.contractAddress)) {
|
|
76
|
+
if (version !== LEGACY_ORACLE_VERSION && version !== ORACLE_VERSION) {
|
|
77
|
+
throw new Error(`Expected legacy oracle version ${LEGACY_ORACLE_VERSION} or current oracle version ${ORACLE_VERSION} for alpha payload contract at ${this.contractAddress}, got ${version}.`);
|
|
78
|
+
}
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
62
81
|
if (version !== ORACLE_VERSION) {
|
|
63
82
|
throw new Error(`Incompatible oracle version. Expected version ${ORACLE_VERSION}, got ${version}.`);
|
|
64
83
|
}
|
|
@@ -92,12 +111,12 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
92
111
|
}
|
|
93
112
|
/**
|
|
94
113
|
* Fetches the index and sibling path of a leaf at a given block from the note hash tree.
|
|
95
|
-
* @param
|
|
96
|
-
* witness.
|
|
114
|
+
* @param blockHash - The hash of a block that contains the note hash tree root in which to find the
|
|
115
|
+
* membership witness.
|
|
97
116
|
* @param noteHash - The note hash to find in the note hash tree.
|
|
98
117
|
* @returns The membership witness containing the leaf index and sibling path
|
|
99
|
-
*/ getNoteHashMembershipWitness(
|
|
100
|
-
return this.aztecNode.getNoteHashMembershipWitness(
|
|
118
|
+
*/ getNoteHashMembershipWitness(blockHash, noteHash) {
|
|
119
|
+
return this.#queryWithBlockHashNotAfterAnchor(blockHash, ()=>this.aztecNode.getNoteHashMembershipWitness(blockHash, noteHash));
|
|
101
120
|
}
|
|
102
121
|
/**
|
|
103
122
|
* Fetches the index and sibling path of a block hash in the archive tree.
|
|
@@ -105,12 +124,15 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
105
124
|
* Block hashes are the leaves of the archive tree. Each time a new block is added to the chain,
|
|
106
125
|
* its block hash is appended as a new leaf to the archive tree.
|
|
107
126
|
*
|
|
108
|
-
* @param
|
|
127
|
+
* @param referenceBlockHash - The hash of a block that contains the archive tree root in which to find the membership
|
|
109
128
|
* witness.
|
|
110
129
|
* @param blockHash - The block hash to find in the archive tree.
|
|
111
130
|
* @returns The membership witness containing the leaf index and sibling path
|
|
112
|
-
*/ getBlockHashMembershipWitness(
|
|
113
|
-
|
|
131
|
+
*/ getBlockHashMembershipWitness(referenceBlockHash, blockHash) {
|
|
132
|
+
// Note that we validate that the reference block hash is at or before the anchor block - we don't test the block
|
|
133
|
+
// hash at all. If the block hash did not exist by the reference block hash, then the node will not return the
|
|
134
|
+
// membership witness as there is none.
|
|
135
|
+
return this.#queryWithBlockHashNotAfterAnchor(referenceBlockHash, ()=>this.aztecNode.getBlockHashMembershipWitness(referenceBlockHash, blockHash));
|
|
114
136
|
}
|
|
115
137
|
/**
|
|
116
138
|
* Returns a nullifier membership witness for a given nullifier at a given block.
|
|
@@ -118,7 +140,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
118
140
|
* @param nullifier - Nullifier we try to find witness for.
|
|
119
141
|
* @returns The nullifier membership witness (if found).
|
|
120
142
|
*/ getNullifierMembershipWitness(blockHash, nullifier) {
|
|
121
|
-
return this.aztecNode.getNullifierMembershipWitness(blockHash, nullifier);
|
|
143
|
+
return this.#queryWithBlockHashNotAfterAnchor(blockHash, ()=>this.aztecNode.getNullifierMembershipWitness(blockHash, nullifier));
|
|
122
144
|
}
|
|
123
145
|
/**
|
|
124
146
|
* Returns a low nullifier membership witness for a given nullifier at a given block.
|
|
@@ -129,7 +151,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
129
151
|
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
130
152
|
* we are trying to prove non-inclusion for.
|
|
131
153
|
*/ getLowNullifierMembershipWitness(blockHash, nullifier) {
|
|
132
|
-
return this.aztecNode.getLowNullifierMembershipWitness(blockHash, nullifier);
|
|
154
|
+
return this.#queryWithBlockHashNotAfterAnchor(blockHash, ()=>this.aztecNode.getLowNullifierMembershipWitness(blockHash, nullifier));
|
|
133
155
|
}
|
|
134
156
|
/**
|
|
135
157
|
* Returns a public data tree witness for a given leaf slot at a given block.
|
|
@@ -137,7 +159,7 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
137
159
|
* @param leafSlot - The slot of the public data tree to get the witness for.
|
|
138
160
|
* @returns - The witness
|
|
139
161
|
*/ getPublicDataWitness(blockHash, leafSlot) {
|
|
140
|
-
return this.aztecNode.getPublicDataWitness(blockHash, leafSlot);
|
|
162
|
+
return this.#queryWithBlockHashNotAfterAnchor(blockHash, ()=>this.aztecNode.getPublicDataWitness(blockHash, leafSlot));
|
|
141
163
|
}
|
|
142
164
|
/**
|
|
143
165
|
* Fetches a block header of a given block.
|
|
@@ -253,14 +275,14 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
253
275
|
return leafIndex?.data !== undefined;
|
|
254
276
|
}
|
|
255
277
|
/**
|
|
256
|
-
*
|
|
278
|
+
* Returns the membership witness of an un-nullified L1 to L2 message.
|
|
257
279
|
* @param contractAddress - Address of a contract by which the message was emitted.
|
|
258
280
|
* @param messageHash - Hash of the message.
|
|
259
281
|
* @param secret - Secret used to compute a nullifier.
|
|
260
282
|
* @dev Contract address and secret are only used to compute the nullifier to get non-nullified messages
|
|
261
283
|
* @returns The l1 to l2 membership witness (index of message in the tree and sibling path).
|
|
262
284
|
*/ async getL1ToL2MembershipWitness(contractAddress, messageHash, secret) {
|
|
263
|
-
const [messageIndex, siblingPath] = await getNonNullifiedL1ToL2MessageWitness(this.aztecNode, contractAddress, messageHash, secret);
|
|
285
|
+
const [messageIndex, siblingPath] = await getNonNullifiedL1ToL2MessageWitness(this.aztecNode, contractAddress, messageHash, secret, await this.anchorBlockHeader.hash());
|
|
264
286
|
return new MessageLoadOracleInputs(messageIndex, siblingPath);
|
|
265
287
|
}
|
|
266
288
|
/**
|
|
@@ -269,11 +291,13 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
269
291
|
* @param contractAddress - The address to read storage from.
|
|
270
292
|
* @param startStorageSlot - The starting storage slot.
|
|
271
293
|
* @param numberOfElements - Number of elements to read from the starting storage slot.
|
|
272
|
-
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
294
|
+
*/ storageRead(blockHash, contractAddress, startStorageSlot, numberOfElements) {
|
|
295
|
+
return this.#queryWithBlockHashNotAfterAnchor(blockHash, async ()=>{
|
|
296
|
+
const slots = Array(numberOfElements).fill(0).map((_, i)=>new Fr(startStorageSlot.value + BigInt(i)));
|
|
297
|
+
const values = await Promise.all(slots.map((storageSlot)=>this.aztecNode.getPublicStorageAt(blockHash, contractAddress, storageSlot)));
|
|
298
|
+
this.logger.debug(`Oracle storage read: slots=[${slots.map((slot)=>slot.toString()).join(', ')}] address=${contractAddress.toString()} values=[${values.join(', ')}]`);
|
|
299
|
+
return values;
|
|
300
|
+
});
|
|
277
301
|
}
|
|
278
302
|
/**
|
|
279
303
|
* Returns a per-contract logger whose output is prefixed with `contract_log::<name>(<addrAbbrev>)`.
|
|
@@ -343,6 +367,25 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
343
367
|
// The responses are stored as Option<LogRetrievalResponse> in a second CapsuleArray.
|
|
344
368
|
await this.capsuleStore.setCapsuleArray(contractAddress, logRetrievalResponsesArrayBaseSlot, maybeLogRetrievalResponses.map(LogRetrievalResponse.toSerializedOption), this.jobId);
|
|
345
369
|
}
|
|
370
|
+
async utilityResolveMessageContexts(contractAddress, messageContextRequestsArrayBaseSlot, messageContextResponsesArrayBaseSlot) {
|
|
371
|
+
try {
|
|
372
|
+
if (!this.contractAddress.equals(contractAddress)) {
|
|
373
|
+
throw new Error(`Got a message context request from ${contractAddress}, expected ${this.contractAddress}`);
|
|
374
|
+
}
|
|
375
|
+
const requestCapsules = await this.capsuleStore.readCapsuleArray(contractAddress, messageContextRequestsArrayBaseSlot, this.jobId);
|
|
376
|
+
const txHashes = requestCapsules.map((fields, i)=>{
|
|
377
|
+
if (fields.length !== 1) {
|
|
378
|
+
throw new Error(`Malformed message context request at index ${i}: expected 1 field (tx hash), got ${fields.length}`);
|
|
379
|
+
}
|
|
380
|
+
return fields[0];
|
|
381
|
+
});
|
|
382
|
+
const maybeMessageContexts = await this.messageContextService.resolveMessageContexts(txHashes, this.anchorBlockHeader.getBlockNumber());
|
|
383
|
+
// Leave response in response capsule array.
|
|
384
|
+
await this.capsuleStore.setCapsuleArray(contractAddress, messageContextResponsesArrayBaseSlot, maybeMessageContexts.map(MessageTxContext.toSerializedOption), this.jobId);
|
|
385
|
+
} finally{
|
|
386
|
+
await this.capsuleStore.setCapsuleArray(contractAddress, messageContextRequestsArrayBaseSlot, [], this.jobId);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
346
389
|
storeCapsule(contractAddress, slot, capsule) {
|
|
347
390
|
if (!contractAddress.equals(this.contractAddress)) {
|
|
348
391
|
// TODO(#10727): instead of this check that this.contractAddress is allowed to access the external DB
|
|
@@ -374,6 +417,15 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
374
417
|
}
|
|
375
418
|
return this.capsuleStore.copyCapsule(this.contractAddress, srcSlot, dstSlot, numEntries, this.jobId);
|
|
376
419
|
}
|
|
420
|
+
/**
|
|
421
|
+
* Clears cached sync state for a contract for a set of scopes, forcing re-sync on the next query so that newly
|
|
422
|
+
* stored notes or events are discovered.
|
|
423
|
+
*/ invalidateContractSyncCache(contractAddress, scopes) {
|
|
424
|
+
if (!contractAddress.equals(this.contractAddress)) {
|
|
425
|
+
throw new Error(`Contract ${this.contractAddress} cannot invalidate sync cache of ${contractAddress}`);
|
|
426
|
+
}
|
|
427
|
+
this.contractSyncService.invalidateContractForScopes(contractAddress, scopes);
|
|
428
|
+
}
|
|
377
429
|
// TODO(#11849): consider replacing this oracle with a pure Noir implementation of aes decryption.
|
|
378
430
|
aes128Decrypt(ciphertext, iv, symKey) {
|
|
379
431
|
const aes128 = new Aes128();
|
|
@@ -391,4 +443,29 @@ import { MessageLoadOracleInputs } from './message_load_oracle_inputs.js';
|
|
|
391
443
|
const addressSecret = await computeAddressSecret(await recipientCompleteAddress.getPreaddress(), ivskM);
|
|
392
444
|
return deriveEcdhSharedSecret(addressSecret, ephPk);
|
|
393
445
|
}
|
|
446
|
+
emitOffchainEffect(data) {
|
|
447
|
+
this.offchainEffects.push({
|
|
448
|
+
data,
|
|
449
|
+
contractAddress: this.contractAddress
|
|
450
|
+
});
|
|
451
|
+
return Promise.resolve();
|
|
452
|
+
}
|
|
453
|
+
/** Returns offchain effects collected during execution. */ getOffchainEffects() {
|
|
454
|
+
return this.offchainEffects;
|
|
455
|
+
}
|
|
456
|
+
/** Runs a query concurrently with a validation that the block hash is not ahead of the anchor block. */ async #queryWithBlockHashNotAfterAnchor(blockHash, query) {
|
|
457
|
+
const [response] = await Promise.all([
|
|
458
|
+
query(),
|
|
459
|
+
(async ()=>{
|
|
460
|
+
const header = await this.aztecNode.getBlockHeader(blockHash);
|
|
461
|
+
if (!header) {
|
|
462
|
+
throw new Error(`Could not find block header for block hash ${blockHash}`);
|
|
463
|
+
}
|
|
464
|
+
if (header.getBlockNumber() > this.anchorBlockHeader.getBlockNumber()) {
|
|
465
|
+
throw new Error(`Made a node query with a reference block hash ${blockHash} with block number ${header.getBlockNumber()}, which is ahead of the anchor block number ${this.anchorBlockHeader.getBlockNumber()} (from anchor block hash ${await this.anchorBlockHeader.hash()}).`);
|
|
466
|
+
}
|
|
467
|
+
})()
|
|
468
|
+
]);
|
|
469
|
+
return response;
|
|
470
|
+
}
|
|
394
471
|
}
|
|
@@ -21,10 +21,10 @@ export declare class ContractSyncService implements StagedStore {
|
|
|
21
21
|
private log;
|
|
22
22
|
readonly storeName = "contract_sync";
|
|
23
23
|
private syncedContracts;
|
|
24
|
-
private
|
|
24
|
+
private excludedFromSync;
|
|
25
25
|
constructor(aztecNode: AztecNode, contractStore: ContractStore, noteStore: NoteStore, log: Logger);
|
|
26
26
|
/** Sets contracts that should be skipped during sync for a specific job. */
|
|
27
|
-
|
|
27
|
+
setExcludedFromSync(jobId: string, addresses: Set<string>): void;
|
|
28
28
|
/**
|
|
29
29
|
* Ensures a contract's private state is synchronized and that the PXE holds the current class artifact.
|
|
30
30
|
* Uses a cache to avoid redundant sync operations - the cache is wiped when the anchor block changes.
|
|
@@ -35,9 +35,11 @@ export declare class ContractSyncService implements StagedStore {
|
|
|
35
35
|
* @param scopes - Access scopes to pass through to the utility executor (affects whose account's private state is discovered).
|
|
36
36
|
*/
|
|
37
37
|
ensureContractSynced(contractAddress: AztecAddress, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (call: FunctionCall, scopes: AccessScopes) => Promise<any>, anchorBlockHeader: BlockHeader, jobId: string, scopes: AccessScopes): Promise<void>;
|
|
38
|
+
/** Clears sync cache entries for the given scopes of a contract. Also clears the ALL_SCOPES entry. */
|
|
39
|
+
invalidateContractForScopes(contractAddress: AztecAddress, scopes: AztecAddress[]): void;
|
|
38
40
|
/** Clears sync cache. Called by BlockSynchronizer when anchor block changes. */
|
|
39
41
|
wipe(): void;
|
|
40
42
|
commit(jobId: string): Promise<void>;
|
|
41
43
|
discardStaged(jobId: string): Promise<void>;
|
|
42
44
|
}
|
|
43
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udHJhY3Rfc3luY19zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29udHJhY3Rfc3luYy9jb250cmFjdF9zeW5jX3NlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsTUFBTSxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDeEUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFL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RSxZQUFZLEVBQUUsTUFBTSxFQUFFLFlBQVksS0FBSyxPQUFPLENBQUMsR0FBRyxDQUFDLEVBQzNFLGlCQUFpQixFQUFFLFdBQVcsRUFDOUIsS0FBSyxFQUFFLE1BQU0sRUFDYixNQUFNLEVBQUUsWUFBWSxHQUNuQixPQUFPLENBQUMsSUFBSSxDQUFDLENBaUJmO0lBRUQsc0dBQXNHO0lBQ3RHLDJCQUEyQixDQUFDLGVBQWUsRUFBRSxZQUFZLEVBQUUsTUFBTSxFQUFFLFlBQVksRUFBRSxHQUFHLElBQUksQ0FNdkY7SUE0QkQsZ0ZBQWdGO0lBQ2hGLElBQUksSUFBSSxJQUFJLENBR1g7SUFFRCxNQUFNLENBQUMsS0FBSyxFQUFFLE1BQU0sR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLENBSW5DO0lBRUQsYUFBYSxDQUFDLEtBQUssRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQU0xQztDQTJDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract_sync_service.d.ts","sourceRoot":"","sources":["../../src/contract_sync/contract_sync_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AACjF,OAAO,KAAK,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AG,EAAE,MAAM,EACjB;IAEJ,4EAA4E;IAC5E,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,IAAI,CAE/D;IAED;;;;;;;;OAQG;IACG,oBAAoB,CACxB,eAAe,EAAE,YAAY,EAC7B,yBAAyB,EAAE,gBAAgB,GAAG,IAAI,EAClD,eAAe,EAAE,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,CAAC,EAC3E,iBAAiB,EAAE,WAAW,EAC9B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,IAAI,CAAC,CAiBf;IAED,sGAAsG;IACtG,2BAA2B,CAAC,eAAe,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,IAAI,CAMvF;IA4BD,gFAAgF;IAChF,IAAI,IAAI,IAAI,CAGX;IAED,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAInC;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM1C;CA2CF"}
|
|
@@ -11,11 +11,11 @@ import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
|
11
11
|
log;
|
|
12
12
|
storeName;
|
|
13
13
|
// Tracks contracts synced since last wipe. The cache is keyed per individual scope address
|
|
14
|
-
// (`contractAddress:scopeAddress`), or `contractAddress:*` for
|
|
14
|
+
// (`contractAddress:scopeAddress`), or `contractAddress:*` for all scopes (all accounts).
|
|
15
15
|
// The value is a promise that resolves when the contract is synced.
|
|
16
16
|
syncedContracts;
|
|
17
|
-
// Per-job
|
|
18
|
-
|
|
17
|
+
// Per-job excluded contract addresses - these contracts should not be synced.
|
|
18
|
+
excludedFromSync;
|
|
19
19
|
constructor(aztecNode, contractStore, noteStore, log){
|
|
20
20
|
this.aztecNode = aztecNode;
|
|
21
21
|
this.contractStore = contractStore;
|
|
@@ -23,10 +23,10 @@ import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
|
23
23
|
this.log = log;
|
|
24
24
|
this.storeName = 'contract_sync';
|
|
25
25
|
this.syncedContracts = new Map();
|
|
26
|
-
this.
|
|
26
|
+
this.excludedFromSync = new Map();
|
|
27
27
|
}
|
|
28
|
-
/** Sets contracts that should be skipped during sync for a specific job. */
|
|
29
|
-
this.
|
|
28
|
+
/** Sets contracts that should be skipped during sync for a specific job. */ setExcludedFromSync(jobId, addresses) {
|
|
29
|
+
this.excludedFromSync.set(jobId, addresses);
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
32
|
* Ensures a contract's private state is synchronized and that the PXE holds the current class artifact.
|
|
@@ -37,32 +37,20 @@ import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
|
37
37
|
* @param utilityExecutor - Executor function for running the sync_state utility function.
|
|
38
38
|
* @param scopes - Access scopes to pass through to the utility executor (affects whose account's private state is discovered).
|
|
39
39
|
*/ async ensureContractSynced(contractAddress, functionToInvokeAfterSync, utilityExecutor, anchorBlockHeader, jobId, scopes) {
|
|
40
|
-
|
|
41
|
-
const overrides = this.overriddenContracts.get(jobId);
|
|
42
|
-
if (overrides?.has(contractAddress.toString())) {
|
|
40
|
+
if (this.#shouldSkipSync(jobId, contractAddress)) {
|
|
43
41
|
return;
|
|
44
42
|
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
this.#startSyncIfNeeded(contractAddress, scopes, (scopesToSync)=>this.#syncContract(contractAddress, functionToInvokeAfterSync, utilityExecutor, anchorBlockHeader, jobId, scopesToSync));
|
|
44
|
+
await this.#awaitSync(contractAddress, scopes);
|
|
45
|
+
}
|
|
46
|
+
/** Clears sync cache entries for the given scopes of a contract. Also clears the ALL_SCOPES entry. */ invalidateContractForScopes(contractAddress, scopes) {
|
|
47
|
+
if (scopes.length === 0) {
|
|
49
48
|
return;
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if (unsyncedScopesKeys.length > 0) {
|
|
54
|
-
// Start sync and store the promise for all unsynced scopes
|
|
55
|
-
const promise = this.#doSync(contractAddress, functionToInvokeAfterSync, utilityExecutor, anchorBlockHeader, jobId, unsyncedScopes).catch((err)=>{
|
|
56
|
-
// There was an error syncing the contract, so we remove it from the cache so that it can be retried.
|
|
57
|
-
unsyncedScopesKeys.forEach((key)=>this.syncedContracts.delete(key));
|
|
58
|
-
throw err;
|
|
59
|
-
});
|
|
60
|
-
unsyncedScopesKeys.forEach((key)=>this.syncedContracts.set(key, promise));
|
|
61
|
-
}
|
|
62
|
-
const promises = toKeys(contractAddress, scopes).map((key)=>this.syncedContracts.get(key));
|
|
63
|
-
await Promise.all(promises);
|
|
50
|
+
scopes.forEach((scope)=>this.syncedContracts.delete(toKey(contractAddress, scope)));
|
|
51
|
+
this.syncedContracts.delete(toKey(contractAddress, 'ALL_SCOPES'));
|
|
64
52
|
}
|
|
65
|
-
async #
|
|
53
|
+
async #syncContract(contractAddress, functionToInvokeAfterSync, utilityExecutor, anchorBlockHeader, jobId, scopes) {
|
|
66
54
|
this.log.debug(`Syncing contract ${contractAddress}`);
|
|
67
55
|
await Promise.all([
|
|
68
56
|
syncState(contractAddress, this.contractStore, functionToInvokeAfterSync, utilityExecutor, this.noteStore, this.aztecNode, anchorBlockHeader, jobId, scopes),
|
|
@@ -75,17 +63,46 @@ import { syncState, verifyCurrentClassId } from './helpers.js';
|
|
|
75
63
|
this.syncedContracts.clear();
|
|
76
64
|
}
|
|
77
65
|
commit(jobId) {
|
|
78
|
-
// Clear
|
|
79
|
-
this.
|
|
66
|
+
// Clear excluded contracts for this job
|
|
67
|
+
this.excludedFromSync.delete(jobId);
|
|
80
68
|
return Promise.resolve();
|
|
81
69
|
}
|
|
82
70
|
discardStaged(jobId) {
|
|
83
71
|
// We clear the synced contracts cache here because, when the job is discarded, any associated database writes from
|
|
84
72
|
// the sync are also undone.
|
|
85
73
|
this.syncedContracts.clear();
|
|
86
|
-
this.
|
|
74
|
+
this.excludedFromSync.delete(jobId);
|
|
87
75
|
return Promise.resolve();
|
|
88
76
|
}
|
|
77
|
+
/** Returns true if sync should be skipped for this contract */ #shouldSkipSync(jobId, contractAddress) {
|
|
78
|
+
return !!this.excludedFromSync.get(jobId)?.has(contractAddress.toString());
|
|
79
|
+
}
|
|
80
|
+
/** If there are unsynced scopes, starts sync and stores the promise in cache with error cleanup. */ #startSyncIfNeeded(contractAddress, scopes, syncFn) {
|
|
81
|
+
const scopesToSync = this.#getScopesToSync(contractAddress, scopes);
|
|
82
|
+
const keys = toKeys(contractAddress, scopesToSync);
|
|
83
|
+
if (keys.length === 0) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const promise = syncFn(scopesToSync).catch((err)=>{
|
|
87
|
+
keys.forEach((key)=>this.syncedContracts.delete(key));
|
|
88
|
+
throw err;
|
|
89
|
+
});
|
|
90
|
+
keys.forEach((key)=>this.syncedContracts.set(key, promise));
|
|
91
|
+
}
|
|
92
|
+
/** Filters out scopes that are already cached, returning only those that still need syncing. */ #getScopesToSync(contractAddress, scopes) {
|
|
93
|
+
if (this.syncedContracts.has(toKey(contractAddress, 'ALL_SCOPES'))) {
|
|
94
|
+
// If we are already syncing all scopes, then return an empty list
|
|
95
|
+
return [];
|
|
96
|
+
}
|
|
97
|
+
if (scopes === 'ALL_SCOPES') {
|
|
98
|
+
return 'ALL_SCOPES';
|
|
99
|
+
}
|
|
100
|
+
return scopes.filter((scope)=>!this.syncedContracts.has(toKey(contractAddress, scope)));
|
|
101
|
+
}
|
|
102
|
+
/** Collects all relevant scope promises (including in-flight ones from concurrent calls) and awaits them. */ async #awaitSync(contractAddress, scopes) {
|
|
103
|
+
const promises = toKeys(contractAddress, scopes).map((key)=>this.syncedContracts.get(key)).filter((p)=>p !== undefined);
|
|
104
|
+
await Promise.all(promises);
|
|
105
|
+
}
|
|
89
106
|
}
|
|
90
107
|
function toKeys(contract, scopes) {
|
|
91
108
|
return scopes === 'ALL_SCOPES' ? [
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
3
|
+
import { MessageTxContext } from '../contract_function_simulator/noir-structs/message_tx_context.js';
|
|
4
|
+
/** Resolves transaction hashes into the context needed to process messages. */
|
|
5
|
+
export declare class MessageContextService {
|
|
6
|
+
private readonly aztecNode;
|
|
7
|
+
constructor(aztecNode: AztecNode);
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a list of tx hashes into their message contexts.
|
|
10
|
+
*
|
|
11
|
+
* For each tx hash, looks up the corresponding tx effect and extracts the note hashes and first nullifier needed to
|
|
12
|
+
* process messages that originated from that transaction. Returns `null` for tx hashes that are zero, not yet
|
|
13
|
+
* available, or in blocks beyond the anchor block.
|
|
14
|
+
*/
|
|
15
|
+
resolveMessageContexts(txHashes: Fr[], anchorBlockNumber: number): Promise<(MessageTxContext | null)[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZV9jb250ZXh0X3NlcnZpY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9tZXNzYWdlcy9tZXNzYWdlX2NvbnRleHRfc2VydmljZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDcEQsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFHakUsT0FBTyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUVBQW1FLENBQUM7QUFFckcsK0VBQStFO0FBQy9FLHFCQUFhLHFCQUFxQjtJQUNwQixPQUFPLENBQUMsUUFBUSxDQUFDLFNBQVM7SUFBdEMsWUFBNkIsU0FBUyxFQUFFLFNBQVMsRUFBSTtJQUVyRDs7Ozs7O09BTUc7SUFDSCxzQkFBc0IsQ0FBQyxRQUFRLEVBQUUsRUFBRSxFQUFFLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxDQUFDLGdCQUFnQixHQUFHLElBQUksQ0FBQyxFQUFFLENBQUMsQ0EwQnRHO0NBQ0YifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message_context_service.d.ts","sourceRoot":"","sources":["../../src/messages/message_context_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mEAAmE,CAAC;AAErG,+EAA+E;AAC/E,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAtC,YAA6B,SAAS,EAAE,SAAS,EAAI;IAErD;;;;;;OAMG;IACH,sBAAsB,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,gBAAgB,GAAG,IAAI,CAAC,EAAE,CAAC,CA0BtG;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
2
|
+
import { MessageTxContext } from '../contract_function_simulator/noir-structs/message_tx_context.js';
|
|
3
|
+
/** Resolves transaction hashes into the context needed to process messages. */ export class MessageContextService {
|
|
4
|
+
aztecNode;
|
|
5
|
+
constructor(aztecNode){
|
|
6
|
+
this.aztecNode = aztecNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a list of tx hashes into their message contexts.
|
|
10
|
+
*
|
|
11
|
+
* For each tx hash, looks up the corresponding tx effect and extracts the note hashes and first nullifier needed to
|
|
12
|
+
* process messages that originated from that transaction. Returns `null` for tx hashes that are zero, not yet
|
|
13
|
+
* available, or in blocks beyond the anchor block.
|
|
14
|
+
*/ resolveMessageContexts(txHashes, anchorBlockNumber) {
|
|
15
|
+
// TODO: optimize, we might be hitting the node to get the same txHash repeatedly
|
|
16
|
+
return Promise.all(txHashes.map(async (txHashField)=>{
|
|
17
|
+
// A zero tx hash indicates a tx-less offchain message (e.g. one not tied to any onchain transaction).
|
|
18
|
+
// These messages don't have a transaction context to resolve, so we return null.
|
|
19
|
+
if (txHashField.isZero()) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const txHash = TxHash.fromField(txHashField);
|
|
23
|
+
const txEffect = await this.aztecNode.getTxEffect(txHash);
|
|
24
|
+
if (!txEffect || txEffect.l2BlockNumber > anchorBlockNumber) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
// Every tx has at least one nullifier (the first nullifier derived from the tx hash). Hitting this condition
|
|
28
|
+
// would mean a buggy node, but since we need to access data.nullifiers[0], the defensive check does no harm.
|
|
29
|
+
const data = txEffect.data;
|
|
30
|
+
if (data.nullifiers.length === 0) {
|
|
31
|
+
throw new Error(`Tx effect for ${txHash} has no nullifiers`);
|
|
32
|
+
}
|
|
33
|
+
return new MessageTxContext(data.txHash, data.noteHashes, data.nullifiers[0]);
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
}
|
package/dest/oracle_version.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export declare const ORACLE_VERSION =
|
|
2
|
-
export declare const ORACLE_INTERFACE_HASH = "
|
|
1
|
+
export declare const ORACLE_VERSION = 18;
|
|
2
|
+
export declare const ORACLE_INTERFACE_HASH = "57e5b07c6d55fb167ef90f8d0f410f9bdb5b154a31159c624a061be40b02a2c2";
|
|
3
3
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxlQUFPLE1BQU0sY0FBYyxLQUFLLENBQUM7QUFLakMsZUFBTyxNQUFNLHFCQUFxQixxRUFBcUUsQ0FBQyJ9
|
package/dest/oracle_version.js
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
///
|
|
5
5
|
/// @dev Whenever a contract function or Noir test is run, the `aztec_utl_assertCompatibleOracleVersion` oracle is called
|
|
6
6
|
/// and if the oracle version is incompatible an error is thrown.
|
|
7
|
-
export const ORACLE_VERSION =
|
|
7
|
+
export const ORACLE_VERSION = 18;
|
|
8
8
|
/// This hash is computed as by hashing the Oracle interface and it is used to detect when the Oracle interface changes,
|
|
9
9
|
/// which in turn implies that you need to update the ORACLE_VERSION constant in this file and in
|
|
10
10
|
/// `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
|
|
11
|
-
export const ORACLE_INTERFACE_HASH = '
|
|
11
|
+
export const ORACLE_INTERFACE_HASH = '57e5b07c6d55fb167ef90f8d0f410f9bdb5b154a31159c624a061be40b02a2c2';
|
package/dest/pxe.d.ts
CHANGED
|
@@ -34,7 +34,9 @@ export type SimulateTxOpts = {
|
|
|
34
34
|
skipTxValidation?: boolean;
|
|
35
35
|
/** If false, fees are enforced. */
|
|
36
36
|
skipFeeEnforcement?: boolean;
|
|
37
|
-
/**
|
|
37
|
+
/** If true, kernel logic is emulated in TS for simulation */
|
|
38
|
+
skipKernels?: boolean;
|
|
39
|
+
/** State overrides for the simulation, such as contract instances and artifacts. Requires skipKernels: true */
|
|
38
40
|
overrides?: SimulationOverrides;
|
|
39
41
|
/** Addresses whose private state and keys are accessible during private execution */
|
|
40
42
|
scopes: AccessScopes;
|
|
@@ -83,6 +85,7 @@ export declare class PXE {
|
|
|
83
85
|
private addressStore;
|
|
84
86
|
private privateEventStore;
|
|
85
87
|
private contractSyncService;
|
|
88
|
+
private messageContextService;
|
|
86
89
|
private simulator;
|
|
87
90
|
private proverEnabled;
|
|
88
91
|
private proofCreator;
|
|
@@ -223,7 +226,7 @@ export declare class PXE {
|
|
|
223
226
|
*
|
|
224
227
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
225
228
|
*/
|
|
226
|
-
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
229
|
+
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, skipKernels, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
227
230
|
/**
|
|
228
231
|
* Executes a contract utility function.
|
|
229
232
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
@@ -248,4 +251,4 @@ export declare class PXE {
|
|
|
248
251
|
*/
|
|
249
252
|
stop(): Promise<void>;
|
|
250
253
|
}
|
|
251
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
254
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvcHhlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFakUsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBcUMsTUFBTSx1QkFBdUIsQ0FBQztBQUl2RixPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRXpELE9BQU8sRUFBRSxLQUFLLHlCQUF5QixFQUF5QixNQUFNLDJCQUEyQixDQUFDO0FBQ2xHLE9BQU8sS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