@aztec/pxe 0.0.1-commit.c7c42ec → 0.0.1-commit.d1f2d6c
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 +10 -4
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +66 -18
- package/dest/config/index.d.ts +3 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +17 -0
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/benchmarked_node.d.ts +9 -0
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +1 -0
- package/dest/contract_function_simulator/benchmarked_node.js +77 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +8 -9
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +33 -19
- package/dest/contract_function_simulator/execution_note_cache.d.ts +18 -9
- package/dest/contract_function_simulator/execution_note_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_note_cache.js +45 -28
- package/dest/contract_function_simulator/index.d.ts +2 -2
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +3 -2
- 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 -2
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts +4 -10
- package/dest/contract_function_simulator/noir-structs/utility_context.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/utility_context.js +7 -18
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +14 -10
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts +3 -1
- package/dest/contract_function_simulator/oracle/message_load_oracle_inputs.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts +6 -6
- package/dest/contract_function_simulator/oracle/note_packing_utils.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/note_packing_utils.js +8 -8
- package/dest/contract_function_simulator/oracle/oracle.d.ts +9 -7
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +41 -30
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +8 -13
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +21 -11
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +16 -18
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +25 -38
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +26 -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 +71 -71
- package/dest/debug/pxe_debug_utils.d.ts +1 -1
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +2 -1
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +10 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +10 -1
- package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +2 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -0
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +11 -7
- package/dest/events/event_service.d.ts +4 -3
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +17 -19
- package/dest/events/private_event_filter_validator.d.ts +5 -5
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/events/private_event_filter_validator.js +5 -6
- package/dest/job_coordinator/job_coordinator.d.ts +74 -0
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -0
- package/dest/job_coordinator/job_coordinator.js +93 -0
- package/dest/logs/log_service.d.ts +3 -2
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +22 -13
- package/dest/notes/note_service.d.ts +5 -4
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +31 -34
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +4 -3
- package/dest/private_kernel/hints/index.d.ts +2 -2
- package/dest/private_kernel/hints/index.d.ts.map +1 -1
- package/dest/private_kernel/hints/index.js +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +28 -0
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -0
- package/dest/private_kernel/hints/{build_private_kernel_reset_private_inputs.js → private_kernel_reset_private_inputs_builder.js} +13 -7
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +4 -5
- package/dest/private_kernel/private_kernel_oracle.d.ts +24 -28
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +90 -2
- package/dest/pxe.d.ts +8 -36
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +71 -90
- package/dest/storage/capsule_store/capsule_store.d.ts +24 -9
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_store.js +132 -23
- package/dest/storage/contract_store/contract_store.d.ts +2 -1
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +12 -0
- package/dest/storage/note_store/note_store.d.ts +45 -56
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +244 -263
- package/dest/storage/note_store/stored_note.d.ts +16 -0
- package/dest/storage/note_store/stored_note.d.ts.map +1 -0
- package/dest/storage/note_store/stored_note.js +43 -0
- package/dest/storage/private_event_store/private_event_store.d.ts +47 -7
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
- package/dest/storage/private_event_store/private_event_store.js +203 -68
- package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
- package/dest/storage/private_event_store/stored_private_event.js +56 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +15 -8
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/recipient_tagging_store.js +69 -12
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +19 -9
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +110 -28
- package/dest/tagging/constants.d.ts +2 -0
- package/dest/tagging/constants.d.ts.map +1 -0
- package/dest/tagging/constants.js +10 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +46 -0
- package/dest/tagging/index.d.ts +3 -2
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +2 -10
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -2
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +8 -8
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -2
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +5 -2
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +3 -2
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +8 -8
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +5 -8
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +5 -2
- 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 +10 -5
- package/package.json +18 -18
- package/src/block_synchronizer/block_synchronizer.ts +77 -20
- package/src/config/index.ts +14 -0
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/benchmarked_node.ts +103 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +39 -21
- package/src/contract_function_simulator/execution_note_cache.ts +44 -25
- package/src/contract_function_simulator/index.ts +1 -1
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +4 -0
- package/src/contract_function_simulator/noir-structs/utility_context.ts +6 -25
- package/src/contract_function_simulator/oracle/interfaces.ts +19 -9
- package/src/contract_function_simulator/oracle/note_packing_utils.ts +10 -10
- package/src/contract_function_simulator/oracle/oracle.ts +54 -39
- package/src/contract_function_simulator/oracle/private_execution.ts +30 -20
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +44 -42
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +89 -75
- package/src/debug/pxe_debug_utils.ts +2 -1
- package/src/entrypoints/client/bundle/utils.ts +7 -1
- package/src/entrypoints/client/lazy/utils.ts +7 -2
- package/src/entrypoints/pxe_creation_options.ts +2 -1
- package/src/entrypoints/server/index.ts +1 -0
- package/src/entrypoints/server/utils.ts +11 -15
- package/src/events/event_service.ts +17 -21
- package/src/events/private_event_filter_validator.ts +3 -5
- package/src/job_coordinator/job_coordinator.ts +149 -0
- package/src/logs/log_service.ts +28 -9
- package/src/notes/note_service.ts +38 -40
- package/src/oracle_version.ts +4 -3
- package/src/private_kernel/hints/index.ts +1 -1
- package/src/private_kernel/hints/{build_private_kernel_reset_private_inputs.ts → private_kernel_reset_private_inputs_builder.ts} +33 -22
- package/src/private_kernel/private_kernel_execution_prover.ts +3 -5
- package/src/private_kernel/private_kernel_oracle.ts +116 -36
- package/src/pxe.ts +125 -119
- package/src/storage/capsule_store/capsule_store.ts +159 -23
- package/src/storage/contract_store/contract_store.ts +20 -0
- package/src/storage/note_store/note_store.ts +286 -317
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/private_event_store/private_event_store.ts +277 -76
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +89 -13
- package/src/storage/tagging_store/sender_tagging_store.ts +129 -28
- package/src/tagging/constants.ts +10 -0
- package/src/tagging/get_all_logs_by_tags.ts +68 -0
- package/src/tagging/index.ts +2 -11
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +21 -7
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +7 -1
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +10 -7
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +5 -13
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +16 -4
- package/dest/contract_function_simulator/proxied_node.d.ts +0 -9
- package/dest/contract_function_simulator/proxied_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/proxied_node.js +0 -27
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts +0 -28
- package/dest/private_kernel/hints/build_private_kernel_reset_private_inputs.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +0 -46
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +0 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +0 -86
- package/dest/public_storage/public_storage_service.d.ts +0 -24
- package/dest/public_storage/public_storage_service.d.ts.map +0 -1
- package/dest/public_storage/public_storage_service.js +0 -26
- package/dest/tree_membership/tree_membership_service.d.ts +0 -52
- package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
- package/dest/tree_membership/tree_membership_service.js +0 -84
- package/src/contract_function_simulator/proxied_node.ts +0 -33
- package/src/private_kernel/private_kernel_oracle_impl.ts +0 -133
- package/src/public_storage/public_storage_service.ts +0 -33
- package/src/tree_membership/tree_membership_service.ts +0 -112
package/dest/pxe.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
1
|
import { createLogger } from '@aztec/foundation/log';
|
|
3
2
|
import { SerialQueue } from '@aztec/foundation/queue';
|
|
4
3
|
import { Timer } from '@aztec/foundation/timer';
|
|
@@ -6,20 +5,22 @@ import { KeyStore } from '@aztec/key-store';
|
|
|
6
5
|
import { L2TipsKVStore } from '@aztec/kv-store/stores';
|
|
7
6
|
import { protocolContractNames } from '@aztec/protocol-contracts';
|
|
8
7
|
import { FunctionType, decodeFunctionSignature } from '@aztec/stdlib/abi';
|
|
8
|
+
import { L2BlockHash } from '@aztec/stdlib/block';
|
|
9
9
|
import { computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
10
10
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
11
|
-
import { computeProtocolNullifier, siloNullifier } from '@aztec/stdlib/hash';
|
|
12
11
|
import { PrivateSimulationResult, TxProfileResult, TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
|
|
13
12
|
import { inspect } from 'util';
|
|
14
13
|
import { BlockSynchronizer } from './block_synchronizer/index.js';
|
|
14
|
+
import { BenchmarkedNodeFactory } from './contract_function_simulator/benchmarked_node.js';
|
|
15
15
|
import { ContractFunctionSimulator, generateSimulatedProvingResult } from './contract_function_simulator/contract_function_simulator.js';
|
|
16
|
-
import { readCurrentClassId } from './contract_function_simulator/oracle/private_execution.js';
|
|
16
|
+
import { ensureContractSynced, readCurrentClassId } from './contract_function_simulator/oracle/private_execution.js';
|
|
17
17
|
import { ProxiedContractStoreFactory } from './contract_function_simulator/proxied_contract_data_source.js';
|
|
18
18
|
import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
19
19
|
import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
|
|
20
20
|
import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
|
|
21
|
+
import { JobCoordinator } from './job_coordinator/job_coordinator.js';
|
|
21
22
|
import { PrivateKernelExecutionProver } from './private_kernel/private_kernel_execution_prover.js';
|
|
22
|
-
import {
|
|
23
|
+
import { PrivateKernelOracle } from './private_kernel/private_kernel_oracle.js';
|
|
23
24
|
import { AddressStore } from './storage/address_store/address_store.js';
|
|
24
25
|
import { AnchorBlockStore } from './storage/anchor_block_store/anchor_block_store.js';
|
|
25
26
|
import { CapsuleStore } from './storage/capsule_store/capsule_store.js';
|
|
@@ -51,8 +52,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
51
52
|
protocolContractsProvider;
|
|
52
53
|
log;
|
|
53
54
|
jobQueue;
|
|
55
|
+
jobCoordinator;
|
|
54
56
|
debug;
|
|
55
|
-
constructor(node, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, debug){
|
|
57
|
+
constructor(node, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
|
|
56
58
|
this.node = node;
|
|
57
59
|
this.blockStateSynchronizer = blockStateSynchronizer;
|
|
58
60
|
this.keyStore = keyStore;
|
|
@@ -71,6 +73,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
71
73
|
this.protocolContractsProvider = protocolContractsProvider;
|
|
72
74
|
this.log = log;
|
|
73
75
|
this.jobQueue = jobQueue;
|
|
76
|
+
this.jobCoordinator = jobCoordinator;
|
|
74
77
|
this.debug = debug;
|
|
75
78
|
}
|
|
76
79
|
/**
|
|
@@ -85,7 +88,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
85
88
|
const addressStore = new AddressStore(store);
|
|
86
89
|
const privateEventStore = new PrivateEventStore(store);
|
|
87
90
|
const contractStore = new ContractStore(store);
|
|
88
|
-
const noteStore =
|
|
91
|
+
const noteStore = new NoteStore(store);
|
|
89
92
|
const anchorBlockStore = new AnchorBlockStore(store);
|
|
90
93
|
const senderTaggingStore = new SenderTaggingStore(store);
|
|
91
94
|
const senderAddressBookStore = new SenderAddressBookStore(store);
|
|
@@ -93,10 +96,18 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
93
96
|
const capsuleStore = new CapsuleStore(store);
|
|
94
97
|
const keyStore = new KeyStore(store);
|
|
95
98
|
const tipsStore = new L2TipsKVStore(store, 'pxe');
|
|
96
|
-
const synchronizer = new BlockSynchronizer(node, anchorBlockStore, noteStore, tipsStore, config, loggerOrSuffix);
|
|
99
|
+
const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, config, loggerOrSuffix);
|
|
100
|
+
const jobCoordinator = new JobCoordinator(store);
|
|
101
|
+
jobCoordinator.registerStores([
|
|
102
|
+
capsuleStore,
|
|
103
|
+
senderTaggingStore,
|
|
104
|
+
recipientTaggingStore,
|
|
105
|
+
privateEventStore,
|
|
106
|
+
noteStore
|
|
107
|
+
]);
|
|
97
108
|
const debugUtils = new PXEDebugUtils(contractStore, noteStore);
|
|
98
109
|
const jobQueue = new SerialQueue();
|
|
99
|
-
const pxe = new PXE(node, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, debugUtils);
|
|
110
|
+
const pxe = new PXE(node, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
|
|
100
111
|
debugUtils.setPXE(pxe);
|
|
101
112
|
pxe.jobQueue.start();
|
|
102
113
|
await pxe.#registerProtocolContracts();
|
|
@@ -107,7 +118,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
107
118
|
// Internal methods
|
|
108
119
|
#getSimulatorForTx(overrides) {
|
|
109
120
|
const proxyContractStore = ProxiedContractStoreFactory.create(this.contractStore, overrides?.contracts);
|
|
110
|
-
return new ContractFunctionSimulator(proxyContractStore, this.noteStore, this.keyStore, this.addressStore, this.node, this.anchorBlockStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.simulator);
|
|
121
|
+
return new ContractFunctionSimulator(proxyContractStore, this.noteStore, this.keyStore, this.addressStore, BenchmarkedNodeFactory.create(this.node), this.anchorBlockStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.simulator);
|
|
111
122
|
}
|
|
112
123
|
#contextualizeError(err, ...context) {
|
|
113
124
|
let contextStr = '';
|
|
@@ -132,7 +143,20 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
132
143
|
if (this.jobQueue.length() != 0) {
|
|
133
144
|
this.log.warn(`PXE is already processing ${this.jobQueue.length()} jobs, concurrent execution is not supported. Will run once those are complete.`);
|
|
134
145
|
}
|
|
135
|
-
return this.jobQueue.put(
|
|
146
|
+
return this.jobQueue.put(async ()=>{
|
|
147
|
+
const jobId = this.jobCoordinator.beginJob();
|
|
148
|
+
this.log.verbose(`Beginning job ${jobId}`);
|
|
149
|
+
try {
|
|
150
|
+
const result = await fn(jobId);
|
|
151
|
+
this.log.verbose(`Committing job ${jobId}`);
|
|
152
|
+
await this.jobCoordinator.commitJob(jobId);
|
|
153
|
+
return result;
|
|
154
|
+
} catch (err) {
|
|
155
|
+
this.log.verbose(`Aborting job ${jobId}`);
|
|
156
|
+
await this.jobCoordinator.abortJob(jobId);
|
|
157
|
+
throw err;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
136
160
|
}
|
|
137
161
|
async #registerProtocolContracts() {
|
|
138
162
|
const registered = {};
|
|
@@ -144,25 +168,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
144
168
|
}
|
|
145
169
|
this.log.verbose(`Registered protocol contracts in pxe`, registered);
|
|
146
170
|
}
|
|
147
|
-
async #isContractClassPubliclyRegistered(id) {
|
|
148
|
-
return !!await this.node.getContractClass(id);
|
|
149
|
-
}
|
|
150
|
-
async #isContractPublished(address) {
|
|
151
|
-
return !!await this.node.getContract(address);
|
|
152
|
-
}
|
|
153
|
-
async #isContractInitialized(address) {
|
|
154
|
-
const initNullifier = await siloNullifier(address, address.toField());
|
|
155
|
-
return !!await this.node.getNullifierMembershipWitness('latest', initNullifier);
|
|
156
|
-
}
|
|
157
171
|
// Executes the entrypoint private function, as well as all nested private
|
|
158
172
|
// functions that might arise.
|
|
159
|
-
async #executePrivate(contractFunctionSimulator, txRequest, scopes) {
|
|
173
|
+
async #executePrivate(contractFunctionSimulator, txRequest, scopes, jobId) {
|
|
160
174
|
const { origin: contractAddress, functionSelector } = txRequest;
|
|
161
175
|
try {
|
|
162
176
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
177
|
+
await ensureContractSynced(contractAddress, functionSelector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, anchorBlockHeader);
|
|
163
178
|
const result = await contractFunctionSimulator.run(txRequest, contractAddress, functionSelector, undefined, anchorBlockHeader, // The sender for tags is set by contracts, typically by an account
|
|
164
179
|
// contract entrypoint
|
|
165
|
-
undefined, scopes);
|
|
180
|
+
undefined, scopes, jobId);
|
|
166
181
|
this.log.debug(`Private simulation completed for ${contractAddress.toString()}:${functionSelector}`);
|
|
167
182
|
return result;
|
|
168
183
|
} catch (err) {
|
|
@@ -179,11 +194,12 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
179
194
|
* @param authWitnesses - Authentication witnesses required for the function call.
|
|
180
195
|
* @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
|
|
181
196
|
* accounts if not specified.
|
|
197
|
+
* @param jobId - The job ID for staged writes.
|
|
182
198
|
* @returns The simulation result containing the outputs of the utility function.
|
|
183
|
-
*/ async #simulateUtility(contractFunctionSimulator, call, authWitnesses, scopes) {
|
|
199
|
+
*/ async #simulateUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
|
|
184
200
|
try {
|
|
185
201
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
186
|
-
return contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes);
|
|
202
|
+
return contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
|
|
187
203
|
} catch (err) {
|
|
188
204
|
if (err instanceof SimulationError) {
|
|
189
205
|
await enrichSimulationError(err, this.contractStore, this.log);
|
|
@@ -227,8 +243,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
227
243
|
* @param config - The configuration for the kernel execution prover.
|
|
228
244
|
* @returns An object that contains the output of the kernel execution, including the ChonkProof if proving is enabled.
|
|
229
245
|
*/ async #prove(txExecutionRequest, proofCreator, privateExecutionResult, config) {
|
|
230
|
-
const
|
|
231
|
-
const
|
|
246
|
+
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
247
|
+
const anchorBlockHash = L2BlockHash.fromField(await anchorBlockHeader.hash());
|
|
248
|
+
const kernelOracle = new PrivateKernelOracle(this.contractStore, this.keyStore, this.node, anchorBlockHash);
|
|
232
249
|
const kernelTraceProver = new PrivateKernelExecutionProver(kernelOracle, proofCreator, !this.proverEnabled);
|
|
233
250
|
this.log.debug(`Executing kernel trace prover (${JSON.stringify(config)})...`);
|
|
234
251
|
return await kernelTraceProver.proveWithKernels(txExecutionRequest.toTxRequest(), privateExecutionResult, config);
|
|
@@ -238,51 +255,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
238
255
|
return this.contractStore.getContractInstance(address);
|
|
239
256
|
}
|
|
240
257
|
/**
|
|
241
|
-
* Returns the contract
|
|
242
|
-
*
|
|
243
|
-
* @
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
* @returns - It returns the contract class metadata, with the artifact field being optional, and will only be returned if true is passed in
|
|
247
|
-
* for `includeArtifact`
|
|
248
|
-
* TODO(@spalladino): The PXE actually holds artifacts and not classes, what should we return? Also,
|
|
249
|
-
* should the pxe query the node for contract public info, and merge it with its own definitions?
|
|
250
|
-
* TODO(@spalladino): This method is strictly needed to decide whether to publicly register a class or not
|
|
251
|
-
* during a public deployment. We probably want a nicer and more general API for this, but it'll have to
|
|
252
|
-
* do for the time being.
|
|
253
|
-
*/ async getContractClassMetadata(id, includeArtifact = false) {
|
|
254
|
-
const artifact = await this.contractStore.getContractArtifact(id);
|
|
255
|
-
if (!artifact) {
|
|
256
|
-
this.log.warn(`No artifact found for contract class ${id.toString()} when looking for its metadata`);
|
|
257
|
-
}
|
|
258
|
-
return {
|
|
259
|
-
contractClass: artifact && await getContractClassFromArtifact(artifact),
|
|
260
|
-
isContractClassPubliclyRegistered: await this.#isContractClassPubliclyRegistered(id),
|
|
261
|
-
artifact: includeArtifact ? artifact : undefined
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Returns the contract metadata given an address.
|
|
266
|
-
* The metadata consists of its contract instance, which includes the contract class identifier,
|
|
267
|
-
* initialization hash, deployment salt, and public keys hash; whether the contract instance has been initialized;
|
|
268
|
-
* and whether the contract instance with the given address has been publicly deployed.
|
|
269
|
-
* @remark - it queries the node to check whether the contract instance has been initialized / publicly deployed through a node.
|
|
270
|
-
* This query is not dependent on the PXE.
|
|
271
|
-
* @param address - The address that the contract instance resides at.
|
|
272
|
-
* @returns - It returns the contract metadata
|
|
273
|
-
* TODO(@spalladino): Should we return the public keys in plain as well here?
|
|
274
|
-
*/ async getContractMetadata(address) {
|
|
275
|
-
let instance;
|
|
276
|
-
try {
|
|
277
|
-
instance = await this.contractStore.getContractInstance(address);
|
|
278
|
-
} catch {
|
|
279
|
-
this.log.warn(`No instance found for contract ${address.toString()} when looking for its metadata`);
|
|
280
|
-
}
|
|
281
|
-
return {
|
|
282
|
-
contractInstance: instance,
|
|
283
|
-
isContractInitialized: await this.#isContractInitialized(address),
|
|
284
|
-
isContractPublished: await this.#isContractPublished(address)
|
|
285
|
-
};
|
|
258
|
+
* Returns the contract artifact for a given contract class id, if it's registered in the PXE.
|
|
259
|
+
* @param id - Identifier of the contract class.
|
|
260
|
+
* @returns The contract artifact if found, undefined otherwise.
|
|
261
|
+
*/ async getContractArtifact(id) {
|
|
262
|
+
return await this.contractStore.getContractArtifact(id);
|
|
286
263
|
}
|
|
287
264
|
/**
|
|
288
265
|
* Registers a user account in PXE given its master encryption private key.
|
|
@@ -304,7 +281,6 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
304
281
|
this.log.debug(`Registered account\n ${accountCompleteAddress.toReadableString()}`);
|
|
305
282
|
}
|
|
306
283
|
await this.addressStore.addCompleteAddress(accountCompleteAddress);
|
|
307
|
-
await this.noteStore.addScope(accountCompleteAddress.address);
|
|
308
284
|
return accountCompleteAddress;
|
|
309
285
|
}
|
|
310
286
|
/**
|
|
@@ -419,7 +395,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
419
395
|
const contractClass = await getContractClassFromArtifact(artifact);
|
|
420
396
|
await this.blockStateSynchronizer.sync();
|
|
421
397
|
const header = await this.anchorBlockStore.getBlockHeader();
|
|
422
|
-
const currentClassId = await readCurrentClassId(contractAddress, currentInstance, this.node, header
|
|
398
|
+
const currentClassId = await readCurrentClassId(contractAddress, currentInstance, this.node, header);
|
|
423
399
|
if (!contractClass.id.equals(currentClassId)) {
|
|
424
400
|
throw new Error('Could not update contract to a class different from the current one.');
|
|
425
401
|
}
|
|
@@ -449,14 +425,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
449
425
|
let privateExecutionResult;
|
|
450
426
|
// We disable proving concurrently mostly out of caution, since it accesses some of our stores. Proving is so
|
|
451
427
|
// computationally demanding that it'd be rare for someone to try to do it concurrently regardless.
|
|
452
|
-
return this.#putInJobQueue(async ()=>{
|
|
428
|
+
return this.#putInJobQueue(async (jobId)=>{
|
|
453
429
|
const totalTimer = new Timer();
|
|
454
430
|
try {
|
|
455
431
|
const syncTimer = new Timer();
|
|
456
432
|
await this.blockStateSynchronizer.sync();
|
|
457
433
|
const syncTime = syncTimer.ms();
|
|
458
434
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
459
|
-
privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest);
|
|
435
|
+
privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
|
|
460
436
|
const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
461
437
|
simulate: false,
|
|
462
438
|
skipFeeEnforcement: false,
|
|
@@ -491,7 +467,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
491
467
|
if (preTagsUsedInTheTx.length > 0) {
|
|
492
468
|
// TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
|
|
493
469
|
const txHash = (await txProvingResult.toTx()).txHash;
|
|
494
|
-
await this.senderTaggingStore.storePendingIndexes(preTagsUsedInTheTx, txHash);
|
|
470
|
+
await this.senderTaggingStore.storePendingIndexes(preTagsUsedInTheTx, txHash, jobId);
|
|
495
471
|
this.log.debug(`Stored used pre-tags as sender for the tx`, {
|
|
496
472
|
preTagsUsedInTheTx
|
|
497
473
|
});
|
|
@@ -514,7 +490,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
514
490
|
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
515
491
|
*/ profileTx(txRequest, profileMode, skipProofGeneration = true) {
|
|
516
492
|
// We disable concurrent profiles for consistency with simulateTx.
|
|
517
|
-
return this.#putInJobQueue(async ()=>{
|
|
493
|
+
return this.#putInJobQueue(async (jobId)=>{
|
|
518
494
|
const totalTimer = new Timer();
|
|
519
495
|
try {
|
|
520
496
|
const txInfo = {
|
|
@@ -530,7 +506,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
530
506
|
await this.blockStateSynchronizer.sync();
|
|
531
507
|
const syncTime = syncTimer.ms();
|
|
532
508
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
533
|
-
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest);
|
|
509
|
+
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, undefined, jobId);
|
|
534
510
|
const { executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
535
511
|
simulate: skipProofGeneration,
|
|
536
512
|
skipFeeEnforcement: false,
|
|
@@ -590,7 +566,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
590
566
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
591
567
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
592
568
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
593
|
-
return this.#putInJobQueue(async ()=>{
|
|
569
|
+
return this.#putInJobQueue(async (jobId)=>{
|
|
594
570
|
try {
|
|
595
571
|
const totalTimer = new Timer();
|
|
596
572
|
const txInfo = {
|
|
@@ -611,14 +587,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
611
587
|
// or not.
|
|
612
588
|
const skipKernels = overrides?.contracts !== undefined && Object.keys(overrides.contracts ?? {}).length > 0;
|
|
613
589
|
// Execution of private functions only; no proving, and no kernel logic.
|
|
614
|
-
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes);
|
|
590
|
+
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
615
591
|
let publicInputs;
|
|
616
592
|
let executionSteps = [];
|
|
617
593
|
if (skipKernels) {
|
|
618
|
-
|
|
619
|
-
// can either be the first nullifier in the tx or the protocol nullifier if there are none.
|
|
620
|
-
const nonceGenerator = privateExecutionResult.firstNullifier.equals(Fr.ZERO) ? await computeProtocolNullifier(await txRequest.toTxRequest().hash()) : privateExecutionResult.firstNullifier;
|
|
621
|
-
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, nonceGenerator, this.contractStore));
|
|
594
|
+
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, this.contractStore));
|
|
622
595
|
} else {
|
|
623
596
|
// Kernel logic, plus proving of all private functions and kernels.
|
|
624
597
|
({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
@@ -694,7 +667,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
694
667
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
695
668
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
696
669
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
697
|
-
return this.#putInJobQueue(async ()=>{
|
|
670
|
+
return this.#putInJobQueue(async (jobId)=>{
|
|
698
671
|
try {
|
|
699
672
|
const totalTimer = new Timer();
|
|
700
673
|
const syncTimer = new Timer();
|
|
@@ -702,7 +675,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
702
675
|
const syncTime = syncTimer.ms();
|
|
703
676
|
const functionTimer = new Timer();
|
|
704
677
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
705
|
-
const
|
|
678
|
+
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
679
|
+
await ensureContractSynced(call.to, call.selector, (privateSyncCall)=>this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, anchorBlockHeader);
|
|
680
|
+
const executionResult = await this.#simulateUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
|
|
706
681
|
const functionTime = functionTimer.ms();
|
|
707
682
|
const totalTime = totalTimer.ms();
|
|
708
683
|
const perFunction = [
|
|
@@ -745,10 +720,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
745
720
|
* Defaults to the latest known block to PXE + 1.
|
|
746
721
|
* @returns - The packed events with block and tx metadata.
|
|
747
722
|
*/ async getPrivateEvents(eventSelector, filter) {
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
723
|
+
let anchorBlockNumber;
|
|
724
|
+
await this.#putInJobQueue(async (jobId)=>{
|
|
725
|
+
await this.blockStateSynchronizer.sync();
|
|
726
|
+
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
727
|
+
anchorBlockNumber = anchorBlockHeader.getBlockNumber();
|
|
728
|
+
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
729
|
+
await ensureContractSynced(filter.contractAddress, null, async (privateSyncCall)=>await this.#simulateUtility(contractFunctionSimulator, privateSyncCall, [], undefined, jobId), this.node, this.contractStore, anchorBlockHeader);
|
|
730
|
+
});
|
|
731
|
+
// anchorBlockNumber is set during the job and fixed to whatever it is after a block sync
|
|
732
|
+
const sanitizedFilter = new PrivateEventFilterValidator(anchorBlockNumber).validate(filter);
|
|
752
733
|
this.log.debug(`Getting private events for ${sanitizedFilter.contractAddress.toString()} from ${sanitizedFilter.fromBlock} to ${sanitizedFilter.toBlock}`);
|
|
753
734
|
return this.privateEventStore.getPrivateEvents(eventSelector, sanitizedFilter);
|
|
754
735
|
}
|
|
@@ -2,34 +2,49 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import { type Logger } from '@aztec/foundation/log';
|
|
3
3
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
4
4
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
|
|
5
|
+
import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
|
|
6
|
+
export declare class CapsuleStore implements StagedStore {
|
|
6
7
|
#private;
|
|
8
|
+
readonly storeName = "capsule";
|
|
7
9
|
logger: Logger;
|
|
8
10
|
constructor(store: AztecAsyncKVStore);
|
|
11
|
+
/**
|
|
12
|
+
* Commits staged data to main storage.
|
|
13
|
+
* Called by JobCoordinator when a job completes successfully.
|
|
14
|
+
* Note: JobCoordinator wraps all commits in a single transaction, so we don't
|
|
15
|
+
* need our own transactionAsync here (and using one would deadlock on IndexedDB).
|
|
16
|
+
* @param jobId - The jobId identifying which staged data to commit
|
|
17
|
+
*/
|
|
18
|
+
commit(jobId: string): Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Discards staged data without committing.
|
|
21
|
+
*/
|
|
22
|
+
discardStaged(jobId: string): Promise<void>;
|
|
9
23
|
/**
|
|
10
24
|
* Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `loadCapsule`.
|
|
11
25
|
* * If data was already stored at this slot, it is overwritten.
|
|
12
26
|
* @param contractAddress - The contract address to scope the data under.
|
|
13
27
|
* @param slot - The slot in the database in which to store the value. Slots need not be contiguous.
|
|
14
28
|
* @param capsule - An array of field elements representing the capsule.
|
|
29
|
+
* @param jobId - The context in which this store will be visible until PXE decides to persist it to underlying KV store
|
|
15
30
|
* @remarks A capsule is a "blob" of data that is passed to the contract through an oracle. It works similarly
|
|
16
31
|
* to public contract storage in that it's indexed by the contract address and storage slot but instead of the global
|
|
17
32
|
* network state it's backed by local PXE db.
|
|
18
33
|
*/
|
|
19
|
-
storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[]):
|
|
34
|
+
storeCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[], jobId: string): void;
|
|
20
35
|
/**
|
|
21
36
|
* Returns data previously stored via `storeCapsule` in the per-contract non-volatile database.
|
|
22
37
|
* @param contractAddress - The contract address under which the data is scoped.
|
|
23
38
|
* @param slot - The slot in the database to read.
|
|
24
39
|
* @returns The stored data or `null` if no data is stored under the slot.
|
|
25
40
|
*/
|
|
26
|
-
loadCapsule(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
|
|
41
|
+
loadCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string): Promise<Fr[] | null>;
|
|
27
42
|
/**
|
|
28
43
|
* Deletes data in the per-contract non-volatile database. Does nothing if no data was present.
|
|
29
44
|
* @param contractAddress - The contract address under which the data is scoped.
|
|
30
45
|
* @param slot - The slot in the database to delete.
|
|
31
46
|
*/
|
|
32
|
-
deleteCapsule(contractAddress: AztecAddress, slot: Fr):
|
|
47
|
+
deleteCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string): void;
|
|
33
48
|
/**
|
|
34
49
|
* Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data
|
|
35
50
|
* structures by avoiding repeated calls to `loadCapsule` and `storeCapsule`.
|
|
@@ -41,7 +56,7 @@ export declare class CapsuleStore {
|
|
|
41
56
|
* @param dstSlot - The first slot to copy to.
|
|
42
57
|
* @param numEntries - The number of entries to copy.
|
|
43
58
|
*/
|
|
44
|
-
copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
|
|
59
|
+
copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number, jobId: string): Promise<void>;
|
|
45
60
|
/**
|
|
46
61
|
* Appends multiple capsules to a capsule array stored at the base slot.
|
|
47
62
|
* The array length is stored at the base slot, and elements are stored in consecutive slots after it.
|
|
@@ -50,8 +65,8 @@ export declare class CapsuleStore {
|
|
|
50
65
|
* @param baseSlot - The slot where the array length is stored
|
|
51
66
|
* @param content - Array of capsule data to append
|
|
52
67
|
*/
|
|
53
|
-
appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][]): Promise<void>;
|
|
54
|
-
readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr): Promise<Fr[][]>;
|
|
55
|
-
setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][]): Promise<void>;
|
|
68
|
+
appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string): Promise<void>;
|
|
69
|
+
readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, jobId: string): Promise<Fr[][]>;
|
|
70
|
+
setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string): Promise<void>;
|
|
56
71
|
}
|
|
57
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
72
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3VsZV9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvY2Fwc3VsZV9zdG9yZS9jYXBzdWxlX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQU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