@aztec/pxe 0.0.1-commit.db765a8 → 0.0.1-commit.df81a97b5
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/config/index.d.ts +2 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -1
- 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/event_validation_request.d.ts +2 -3
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +5 -4
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -3
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts +16 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.d.ts.map +1 -0
- package/dest/contract_function_simulator/noir-structs/message_tx_context.js +57 -0
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +3 -5
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +14 -9
- 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 +8 -7
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +44 -18
- package/dest/contract_function_simulator/oracle/private_execution.js +4 -2
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +8 -33
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +7 -39
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +27 -7
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +71 -7
- 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/config/index.ts +1 -1
- 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/event_validation_request.ts +8 -5
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -4
- package/src/contract_function_simulator/noir-structs/message_tx_context.ts +55 -0
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +3 -6
- package/src/contract_function_simulator/oracle/interfaces.ts +17 -17
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +135 -0
- package/src/contract_function_simulator/oracle/oracle.ts +53 -43
- package/src/contract_function_simulator/oracle/private_execution.ts +3 -3
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +9 -57
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +105 -9
- 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
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvcHhlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1B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AO,CAAC,eAAe,CAAC,CAuE9F;IAED;;;;;OAKG;IACI,SAAS,CACd,SAAS,EAAE,kBAAkB,EAC7B,EAAE,WAAW,EAAE,mBAA0B,EAAE,MAAM,EAAE,EAAE,aAAa,GACjE,OAAO,CAAC,eAAe,CAAC,CAkE1B;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,UAAU,CACf,SAAS,EAAE,kBAAkB,EAC7B,EACE,cAAc,EACd,gBAAwB,EACxB,kBAA0B,EAC1B,WAAkB,EAClB,SAAS,EACT,MAAM,EACP,EAAE,cAAc,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAuI7B;IAED;;;OAGG;IACI,cAAc,CACnB,IAAI,EAAE,YAAY,EAClB,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAE,kBAA6C,GAClE,OAAO,CAAC,sBAAsB,CAAC,CA6DjC;IAED;;;;;;;;;;;;OAYG;IACU,gBAAgB,CAC3B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA8B/B;IAED;;OAEG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAGjC;CACF"}
|
package/dest/pxe.js
CHANGED
|
@@ -20,6 +20,7 @@ import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
|
20
20
|
import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
|
|
21
21
|
import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
|
|
22
22
|
import { JobCoordinator } from './job_coordinator/job_coordinator.js';
|
|
23
|
+
import { MessageContextService } from './messages/message_context_service.js';
|
|
23
24
|
import { PrivateKernelExecutionProver } from './private_kernel/private_kernel_execution_prover.js';
|
|
24
25
|
import { PrivateKernelOracle } from './private_kernel/private_kernel_oracle.js';
|
|
25
26
|
import { AddressStore } from './storage/address_store/address_store.js';
|
|
@@ -49,6 +50,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
49
50
|
addressStore;
|
|
50
51
|
privateEventStore;
|
|
51
52
|
contractSyncService;
|
|
53
|
+
messageContextService;
|
|
52
54
|
simulator;
|
|
53
55
|
proverEnabled;
|
|
54
56
|
proofCreator;
|
|
@@ -57,7 +59,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
57
59
|
jobQueue;
|
|
58
60
|
jobCoordinator;
|
|
59
61
|
debug;
|
|
60
|
-
constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
|
|
62
|
+
constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
|
|
61
63
|
this.node = node;
|
|
62
64
|
this.db = db;
|
|
63
65
|
this.blockStateSynchronizer = blockStateSynchronizer;
|
|
@@ -72,6 +74,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
72
74
|
this.addressStore = addressStore;
|
|
73
75
|
this.privateEventStore = privateEventStore;
|
|
74
76
|
this.contractSyncService = contractSyncService;
|
|
77
|
+
this.messageContextService = messageContextService;
|
|
75
78
|
this.simulator = simulator;
|
|
76
79
|
this.proverEnabled = proverEnabled;
|
|
77
80
|
this.proofCreator = proofCreator;
|
|
@@ -105,6 +108,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
105
108
|
const keyStore = new KeyStore(store);
|
|
106
109
|
const tipsStore = new L2TipsKVStore(store, 'pxe');
|
|
107
110
|
const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
|
|
111
|
+
const messageContextService = new MessageContextService(node);
|
|
108
112
|
const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, contractSyncService, config, bindings);
|
|
109
113
|
const jobCoordinator = new JobCoordinator(store, bindings);
|
|
110
114
|
jobCoordinator.registerStores([
|
|
@@ -117,7 +121,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
117
121
|
]);
|
|
118
122
|
const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
|
|
119
123
|
const jobQueue = new SerialQueue();
|
|
120
|
-
const pxe = new PXE(node, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
|
|
124
|
+
const pxe = new PXE(node, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
|
|
121
125
|
debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#executeUtility.bind(pxe));
|
|
122
126
|
pxe.jobQueue.start();
|
|
123
127
|
await pxe.#registerProtocolContracts();
|
|
@@ -139,7 +143,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
139
143
|
capsuleStore: this.capsuleStore,
|
|
140
144
|
privateEventStore: this.privateEventStore,
|
|
141
145
|
simulator: this.simulator,
|
|
142
|
-
contractSyncService: this.contractSyncService
|
|
146
|
+
contractSyncService: this.contractSyncService,
|
|
147
|
+
messageContextService: this.messageContextService
|
|
143
148
|
});
|
|
144
149
|
}
|
|
145
150
|
#contextualizeError(err, ...context) {
|
|
@@ -225,7 +230,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
225
230
|
*/ async #executeUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
|
|
226
231
|
try {
|
|
227
232
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
228
|
-
|
|
233
|
+
const { result, offchainEffects } = await contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
|
|
234
|
+
return {
|
|
235
|
+
result,
|
|
236
|
+
offchainEffects
|
|
237
|
+
};
|
|
229
238
|
} catch (err) {
|
|
230
239
|
if (err instanceof SimulationError) {
|
|
231
240
|
await enrichSimulationError(err, this.contractStore, this.log);
|
|
@@ -337,6 +346,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
337
346
|
const wasAdded = await this.senderAddressBookStore.addSender(sender);
|
|
338
347
|
if (wasAdded) {
|
|
339
348
|
this.log.info(`Added sender:\n ${sender.toString()}`);
|
|
349
|
+
// Wipe the entire sync cache: the new sender's tagged logs could contain notes/events for any contract, so
|
|
350
|
+
// all contracts must re-sync to discover them.
|
|
351
|
+
this.contractSyncService.wipe();
|
|
340
352
|
} else {
|
|
341
353
|
this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
|
|
342
354
|
}
|
|
@@ -500,16 +512,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
500
512
|
// transaction before this one is included in a block from this PXE, and that transaction contains a log with
|
|
501
513
|
// a tag derived from the same secret, we would reuse the tag and the transactions would be linked. Hence
|
|
502
514
|
// storing the tags here prevents linkage of txs sent from the same PXE.
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
515
|
+
const taggingIndexRangesUsedInTheTx = privateExecutionResult.entrypoint.taggingIndexRanges;
|
|
516
|
+
if (taggingIndexRangesUsedInTheTx.length > 0) {
|
|
505
517
|
// TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
|
|
506
518
|
const txHash = (await txProvingResult.toTx()).txHash;
|
|
507
|
-
await this.senderTaggingStore.storePendingIndexes(
|
|
508
|
-
this.log.debug(`Stored used
|
|
509
|
-
|
|
519
|
+
await this.senderTaggingStore.storePendingIndexes(taggingIndexRangesUsedInTheTx, txHash, jobId);
|
|
520
|
+
this.log.debug(`Stored used tagging index ranges as sender for the tx`, {
|
|
521
|
+
taggingIndexRangesUsedInTheTx
|
|
510
522
|
});
|
|
511
523
|
} else {
|
|
512
|
-
this.log.debug(`No
|
|
524
|
+
this.log.debug(`No tagging index ranges used in the tx`);
|
|
513
525
|
}
|
|
514
526
|
return txProvingResult;
|
|
515
527
|
} catch (err) {
|
|
@@ -591,7 +603,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
591
603
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
592
604
|
*
|
|
593
605
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
594
|
-
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes }) {
|
|
606
|
+
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, skipKernels = true, overrides, scopes }) {
|
|
595
607
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
596
608
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
597
609
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
@@ -610,16 +622,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
610
622
|
const syncTimer = new Timer();
|
|
611
623
|
await this.blockStateSynchronizer.sync();
|
|
612
624
|
const syncTime = syncTimer.ms();
|
|
613
|
-
const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
|
|
614
|
-
// Temporary: in case there are overrides, we have to skip the kernels or validations
|
|
615
|
-
// will fail. Consider handing control to the user/wallet on whether they want to run them
|
|
616
|
-
// or not.
|
|
617
625
|
const overriddenContracts = overrides?.contracts ? new Set(Object.keys(overrides.contracts)) : undefined;
|
|
618
626
|
const hasOverriddenContracts = overriddenContracts !== undefined && overriddenContracts.size > 0;
|
|
619
|
-
|
|
620
|
-
|
|
627
|
+
if (hasOverriddenContracts && !skipKernels) {
|
|
628
|
+
throw new Error('Simulating with overridden contracts is not compatible with kernel execution. Please set skipKernels to true when simulating with overridden contracts.');
|
|
629
|
+
}
|
|
630
|
+
const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
|
|
621
631
|
if (hasOverriddenContracts) {
|
|
622
|
-
|
|
632
|
+
// Overridden contracts don't have a sync function, so calling sync on them would fail.
|
|
633
|
+
// We exclude them so the sync service skips them entirely.
|
|
634
|
+
this.contractSyncService.setExcludedFromSync(jobId, overriddenContracts);
|
|
623
635
|
}
|
|
624
636
|
// Execution of private functions only; no proving, and no kernel logic.
|
|
625
637
|
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
@@ -713,7 +725,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
713
725
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
714
726
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
715
727
|
await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
|
|
716
|
-
const executionResult = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
|
|
728
|
+
const { result: executionResult, offchainEffects } = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
|
|
717
729
|
const functionTime = functionTimer.ms();
|
|
718
730
|
const totalTime = totalTimer.ms();
|
|
719
731
|
const perFunction = [
|
|
@@ -731,6 +743,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
731
743
|
const simulationStats = contractFunctionSimulator.getStats();
|
|
732
744
|
return {
|
|
733
745
|
result: executionResult,
|
|
746
|
+
offchainEffects,
|
|
747
|
+
anchorBlockTimestamp: anchorBlockHeader.globalVariables.timestamp,
|
|
734
748
|
stats: {
|
|
735
749
|
timings,
|
|
736
750
|
nodeRPCCalls: simulationStats.nodeRPCCalls
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const PXE_DATA_SCHEMA_VERSION =
|
|
1
|
+
export declare const PXE_DATA_SCHEMA_VERSION = 4;
|
|
2
2
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0YWRhdGEuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL21ldGFkYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGVBQU8sTUFBTSx1QkFBdUIsSUFBSSxDQUFDIn0=
|
package/dest/storage/metadata.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const PXE_DATA_SCHEMA_VERSION =
|
|
1
|
+
export const PXE_DATA_SCHEMA_VERSION = 4;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
|
-
import
|
|
3
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
2
|
+
import { ExtendedDirectionalAppTaggingSecret, type TaggingIndexRange } from '@aztec/stdlib/logs';
|
|
3
|
+
import { TxEffect, TxHash } from '@aztec/stdlib/tx';
|
|
4
4
|
import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
|
|
5
5
|
/**
|
|
6
6
|
* Data provider of tagging data used when syncing the sender tagging indexes. The recipient counterpart of this class
|
|
@@ -19,31 +19,23 @@ export declare class SenderTaggingStore implements StagedStore {
|
|
|
19
19
|
commit(jobId: string): Promise<void>;
|
|
20
20
|
discardStaged(jobId: string): Promise<void>;
|
|
21
21
|
/**
|
|
22
|
-
* Stores pending
|
|
23
|
-
* @remarks
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* @param
|
|
27
|
-
* stored in the db.
|
|
28
|
-
* @param txHash - The tx in which the
|
|
22
|
+
* Stores pending index ranges.
|
|
23
|
+
* @remarks If the same (secret, txHash) pair already exists in the db with an equal range, it's a no-op. This is
|
|
24
|
+
* expected to happen because whenever we start sync we start from the last finalized index and we can have pending
|
|
25
|
+
* ranges already stored from previous syncs. If the ranges differ, it throws an error as that indicates a bug.
|
|
26
|
+
* @param ranges - The tagging index ranges containing the directional app tagging secrets and the index ranges that are
|
|
27
|
+
* to be stored in the db.
|
|
28
|
+
* @param txHash - The tx in which the tagging indexes were used in private logs.
|
|
29
29
|
* @param jobId - job context for staged writes to this store. See `JobCoordinator` for more details.
|
|
30
|
-
* @throws If
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @throws If the newly stored pending index is further than window length from the highest finalized index for the
|
|
34
|
-
* same secret. This is enforced in order to give a guarantee to a recipient that he doesn't need to look further than
|
|
35
|
-
* window length ahead of the highest finalized index.
|
|
36
|
-
* @throws If a secret + txHash pair already exists in the db with a different index value. It should never happen
|
|
37
|
-
* that we would attempt to store a different index for a given secret-txHash pair because we always store just the
|
|
38
|
-
* highest index for a given secret-txHash pair. Hence this is a good way to catch bugs.
|
|
39
|
-
* @throws If the newly stored pending index is lower than or equal to the last finalized index for the same secret.
|
|
40
|
-
* This is enforced because this should never happen if the syncing is done correctly as we look for logs from higher
|
|
41
|
-
* indexes than finalized ones.
|
|
30
|
+
* @throws If the highestIndex is further than window length from the highest finalized index for the same secret.
|
|
31
|
+
* @throws If the lowestIndex is lower than or equal to the last finalized index for the same secret.
|
|
32
|
+
* @throws If a different range already exists for the same (secret, txHash) pair.
|
|
42
33
|
*/
|
|
43
|
-
storePendingIndexes(
|
|
34
|
+
storePendingIndexes(ranges: TaggingIndexRange[], txHash: TxHash, jobId: string): Promise<void>;
|
|
44
35
|
/**
|
|
45
|
-
* Returns the transaction hashes of all pending transactions that contain indexes within a specified range
|
|
46
|
-
* for a given directional app tagging secret.
|
|
36
|
+
* Returns the transaction hashes of all pending transactions that contain highest indexes within a specified range
|
|
37
|
+
* for a given directional app tagging secret. We check based on the highest indexes only as that is the relevant
|
|
38
|
+
* information for the caller of this function.
|
|
47
39
|
* @param secret - The directional app tagging secret to query pending indexes for.
|
|
48
40
|
* @param startIndex - The lower bound of the index range (inclusive).
|
|
49
41
|
* @param endIndex - The upper bound of the index range (exclusive).
|
|
@@ -73,5 +65,14 @@ export declare class SenderTaggingStore implements StagedStore {
|
|
|
73
65
|
* indexes.
|
|
74
66
|
*/
|
|
75
67
|
finalizePendingIndexes(txHashes: TxHash[], jobId: string): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* Handles finalization of pending indexes for a transaction whose execution was partially reverted.
|
|
70
|
+
* Recomputes the siloed tags for each pending index of the given tx and checks which ones appear in the
|
|
71
|
+
* TxEffect's private logs (i.e., which ones made it onchain). Those that survived are finalized; those that
|
|
72
|
+
* didn't are dropped.
|
|
73
|
+
* @param txEffect - The tx effect of the partially reverted transaction.
|
|
74
|
+
* @param jobId - job context for staged writes to this store. See `JobCoordinator` for more details.
|
|
75
|
+
*/
|
|
76
|
+
finalizePendingIndexesOfAPartiallyRevertedTx(txEffect: TxEffect, jobId: string): Promise<void>;
|
|
76
77
|
}
|
|
77
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
78
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZGVyX3RhZ2dpbmdfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL3RhZ2dpbmdfc3RvcmUvc2VuZGVyX3RhZ2dpbmdfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENB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U0sR0FBRyxTQUFTLENBQUMsQ0FFN0c7SUFFRDs7Ozs7T0FLRztJQUNILGdCQUFnQixDQUFDLE1BQU0sRUFBRSxtQ0FBbUMsRUFBRSxLQUFLLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxNQUFNLEdBQUcsU0FBUyxDQUFDLENBaUJ4RztJQUVEOztPQUVHO0lBQ0gsa0JBQWtCLENBQUMsUUFBUSxFQUFFLE1BQU0sRUFBRSxFQUFFLEtBQUssRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQTJDbkU7SUE0Q0Q7OztPQUdHO0lBQ0csc0JBQXNCLENBQUMsUUFBUSxFQUFFLE1BQU0sRUFBRSxFQUFFLEtBQUssRUFBRSxNQUFNLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQyxDQXNEN0U7SUFFRDs7Ozs7OztPQU9HO0lBQ0csNENBQTRDLENBQUMsUUFBUSxFQUFFLFFBQVEsRUFBRSxLQUFLLEVBQUUsTUFBTSxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FnRG5HO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sender_tagging_store.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/sender_tagging_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,
|
|
1
|
+
{"version":3,"file":"sender_tagging_store.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/sender_tagging_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,mCAAmC,EAAa,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5G,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,WAAW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