@aztec/pxe 0.0.1-commit.8f9871590 → 0.0.1-commit.9117c5f5a

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.
Files changed (96) hide show
  1. package/dest/config/package_info.js +1 -1
  2. package/dest/contract_function_simulator/contract_function_simulator.d.ts +1 -1
  3. package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
  4. package/dest/contract_function_simulator/contract_function_simulator.js +8 -8
  5. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +5 -5
  6. package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
  7. package/dest/contract_function_simulator/execution_tagging_index_cache.js +3 -3
  8. package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
  9. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -2
  10. package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
  11. package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
  12. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +1 -1
  13. package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
  14. package/dest/contract_function_simulator/oracle/private_execution_oracle.js +10 -18
  15. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +1 -1
  16. package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
  17. package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +4 -7
  18. package/dest/contract_logging.d.ts +22 -0
  19. package/dest/contract_logging.d.ts.map +1 -0
  20. package/dest/contract_logging.js +23 -0
  21. package/dest/debug/pxe_debug_utils.d.ts +2 -2
  22. package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
  23. package/dest/debug/pxe_debug_utils.js +4 -4
  24. package/dest/entrypoints/client/bundle/index.d.ts +2 -1
  25. package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
  26. package/dest/entrypoints/client/bundle/index.js +1 -0
  27. package/dest/entrypoints/client/lazy/index.d.ts +2 -1
  28. package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
  29. package/dest/entrypoints/client/lazy/index.js +1 -0
  30. package/dest/logs/log_service.d.ts +1 -1
  31. package/dest/logs/log_service.d.ts.map +1 -1
  32. package/dest/logs/log_service.js +4 -4
  33. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
  34. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
  35. package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +129 -68
  36. package/dest/private_kernel/hints/test_utils.d.ts +122 -0
  37. package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
  38. package/dest/private_kernel/hints/test_utils.js +203 -0
  39. package/dest/private_kernel/private_kernel_execution_prover.d.ts +1 -1
  40. package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
  41. package/dest/private_kernel/private_kernel_execution_prover.js +13 -5
  42. package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
  43. package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
  44. package/dest/private_kernel/private_kernel_oracle.js +7 -3
  45. package/dest/pxe.d.ts +8 -7
  46. package/dest/pxe.d.ts.map +1 -1
  47. package/dest/pxe.js +37 -29
  48. package/dest/storage/contract_store/contract_store.d.ts +42 -15
  49. package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
  50. package/dest/storage/contract_store/contract_store.js +140 -64
  51. package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
  52. package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
  53. package/dest/storage/tagging_store/sender_tagging_store.d.ts +5 -5
  54. package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
  55. package/dest/storage/tagging_store/sender_tagging_store.js +4 -4
  56. package/dest/tagging/index.d.ts +2 -2
  57. package/dest/tagging/index.d.ts.map +1 -1
  58. package/dest/tagging/index.js +1 -1
  59. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -5
  60. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
  61. package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +3 -3
  62. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +6 -7
  63. package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
  64. package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
  65. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -8
  66. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
  67. package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +3 -6
  68. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +4 -7
  69. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
  70. package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +14 -15
  71. package/package.json +16 -16
  72. package/src/config/package_info.ts +1 -1
  73. package/src/contract_function_simulator/contract_function_simulator.ts +15 -17
  74. package/src/contract_function_simulator/execution_tagging_index_cache.ts +5 -5
  75. package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
  76. package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
  77. package/src/contract_function_simulator/oracle/private_execution_oracle.ts +14 -20
  78. package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +8 -7
  79. package/src/contract_logging.ts +39 -0
  80. package/src/debug/pxe_debug_utils.ts +4 -4
  81. package/src/entrypoints/client/bundle/index.ts +1 -0
  82. package/src/entrypoints/client/lazy/index.ts +1 -0
  83. package/src/logs/log_service.ts +10 -5
  84. package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +164 -117
  85. package/src/private_kernel/hints/test_utils.ts +325 -0
  86. package/src/private_kernel/private_kernel_execution_prover.ts +13 -6
  87. package/src/private_kernel/private_kernel_oracle.ts +7 -7
  88. package/src/pxe.ts +41 -34
  89. package/src/storage/contract_store/contract_store.ts +170 -71
  90. package/src/storage/tagging_store/recipient_tagging_store.ts +9 -5
  91. package/src/storage/tagging_store/sender_tagging_store.ts +8 -8
  92. package/src/tagging/index.ts +1 -1
  93. package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +3 -6
  94. package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +10 -15
  95. package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +4 -9
  96. package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +11 -20
@@ -1,8 +1,53 @@
1
+ import { Fr } from '@aztec/foundation/curves/bn254';
1
2
  import { toArray } from '@aztec/foundation/iterable';
3
+ import { BufferReader, numToUInt8, serializeToBuffer } from '@aztec/foundation/serialize';
2
4
  import { FunctionCall, FunctionSelector, FunctionType, contractArtifactFromBuffer, contractArtifactToBuffer, encodeArguments, getFunctionDebugMetadata } from '@aztec/stdlib/abi';
3
5
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
4
6
  import { SerializableContractInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
5
7
  import { PrivateFunctionsTree } from './private_functions_tree.js';
8
+ const VERSION = 1;
9
+ /**
10
+ * All contract class data except the large packedBytecode.
11
+ * The expensive data from the ContractClass is precomputed and stored in this format to avoid redundant hashing.
12
+ * Since we have to store the artifacts anyway, the final ContractClass is reconstructed by combining this data
13
+ * with the packedBytecode obtained from the former. That way we can have quick class lookups without wasted storage.
14
+ */ export class SerializableContractClassData {
15
+ version = VERSION;
16
+ id;
17
+ artifactHash;
18
+ privateFunctionsRoot;
19
+ publicBytecodeCommitment;
20
+ privateFunctions;
21
+ constructor(data){
22
+ this.id = data.id;
23
+ this.artifactHash = data.artifactHash;
24
+ this.privateFunctionsRoot = data.privateFunctionsRoot;
25
+ this.publicBytecodeCommitment = data.publicBytecodeCommitment;
26
+ this.privateFunctions = data.privateFunctions;
27
+ }
28
+ toBuffer() {
29
+ return serializeToBuffer(numToUInt8(this.version), this.id, this.artifactHash, this.privateFunctionsRoot, this.publicBytecodeCommitment, this.privateFunctions.length, ...this.privateFunctions.map((fn)=>serializeToBuffer(fn.selector, fn.vkHash)));
30
+ }
31
+ static fromBuffer(bufferOrReader) {
32
+ const reader = BufferReader.asReader(bufferOrReader);
33
+ const version = reader.readUInt8();
34
+ if (version !== VERSION) {
35
+ throw new Error(`Unexpected contract class data version ${version}`);
36
+ }
37
+ return new SerializableContractClassData({
38
+ id: reader.readObject(Fr),
39
+ artifactHash: reader.readObject(Fr),
40
+ privateFunctionsRoot: reader.readObject(Fr),
41
+ publicBytecodeCommitment: reader.readObject(Fr),
42
+ privateFunctions: reader.readVector({
43
+ fromBuffer: (r)=>({
44
+ selector: r.readObject(FunctionSelector),
45
+ vkHash: r.readObject(Fr)
46
+ })
47
+ })
48
+ });
49
+ }
50
+ }
6
51
  /**
7
52
  * ContractStore serves as a data manager and retriever for Aztec.nr contracts.
8
53
  * It provides methods to obtain contract addresses, function ABI, bytecode, and membership witnesses
@@ -12,24 +57,46 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
12
57
  */ export class ContractStore {
13
58
  /** Map from contract class id to private function tree. */ // TODO: Update it to be LRU cache so that it doesn't keep all the data all the time.
14
59
  #privateFunctionTrees = new Map();
15
- /** Map from contract address to contract class id */ #contractClassIdMap = new Map();
60
+ /**
61
+ * In-memory cache of deserialized ContractArtifact objects, keyed by class id string.
62
+ * Avoids repeated LMDB reads + JSON.parse + Zod validation on every oracle call.
63
+ * Artifacts are large but immutable after registration — safe to cache for the lifetime of the store.
64
+ */ // TODO: Update it to be LRU cache so that it doesn't keep all the data all the time.
65
+ #contractArtifactCache = new Map();
66
+ /** Map from contract address to contract class id (avoids KV round-trip on hot path). */ #contractClassIdMap = new Map();
16
67
  #store;
17
68
  #contractArtifacts;
69
+ #contractClassData;
18
70
  #contractInstances;
19
71
  constructor(store){
20
72
  this.#store = store;
21
73
  this.#contractArtifacts = store.openMap('contract_artifacts');
74
+ this.#contractClassData = store.openMap('contract_classes');
22
75
  this.#contractInstances = store.openMap('contracts_instances');
23
76
  }
24
77
  // Setters
25
- async addContractArtifact(id, contract) {
26
- // Validation outside transactionAsync - these are not DB operations
78
+ /**
79
+ * Registers a new contract artifact and its corresponding class data.
80
+ * IMPORTANT: This method does not verify that the provided artifact matches the class data or that the class id matches the artifact.
81
+ * It is the caller's responsibility to ensure the consistency and correctness of the provided data.
82
+ * This is done to avoid redundant, expensive contract class computations
83
+ */ async addContractArtifact(contract, contractClassWithIdAndPreimage) {
84
+ const contractClass = contractClassWithIdAndPreimage ?? await getContractClassFromArtifact(contract);
85
+ const key = contractClass.id.toString();
86
+ if (this.#contractArtifactCache.has(key)) {
87
+ return contractClass.id;
88
+ }
27
89
  const privateFunctions = contract.functions.filter((functionArtifact)=>functionArtifact.functionType === FunctionType.PRIVATE);
28
- const privateSelectors = await Promise.all(privateFunctions.map(async (privateFunctionArtifact)=>(await FunctionSelector.fromNameAndParameters(privateFunctionArtifact.name, privateFunctionArtifact.parameters)).toString()));
90
+ const privateSelectors = await Promise.all(privateFunctions.map(async (fn)=>(await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters)).toString()));
29
91
  if (privateSelectors.length !== new Set(privateSelectors).size) {
30
92
  throw new Error('Repeated function selectors of private functions');
31
93
  }
32
- await this.#store.transactionAsync(()=>this.#contractArtifacts.set(id.toString(), contractArtifactToBuffer(contract)));
94
+ this.#contractArtifactCache.set(key, contract);
95
+ await this.#store.transactionAsync(async ()=>{
96
+ await this.#contractArtifacts.set(key, contractArtifactToBuffer(contract));
97
+ await this.#contractClassData.set(key, new SerializableContractClassData(contractClass).toBuffer());
98
+ });
99
+ return contractClass.id;
33
100
  }
34
101
  async addContractInstance(contract) {
35
102
  this.#contractClassIdMap.set(contract.address.toString(), contract.currentContractClassId);
@@ -37,25 +104,17 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
37
104
  }
38
105
  // Private getters
39
106
  async #getContractClassId(contractAddress) {
40
- if (!this.#contractClassIdMap.has(contractAddress.toString())) {
107
+ const key = contractAddress.toString();
108
+ if (!this.#contractClassIdMap.has(key)) {
41
109
  const instance = await this.getContractInstance(contractAddress);
42
110
  if (!instance) {
43
111
  return;
44
112
  }
45
- this.#contractClassIdMap.set(contractAddress.toString(), instance.currentContractClassId);
113
+ this.#contractClassIdMap.set(key, instance.currentContractClassId);
46
114
  }
47
- return this.#contractClassIdMap.get(contractAddress.toString());
115
+ return this.#contractClassIdMap.get(key);
48
116
  }
49
- /**
50
- * Retrieve or create a ContractTree instance based on the provided class id.
51
- * If an existing tree with the same class id is found in the cache, it will be returned.
52
- * Otherwise, a new ContractTree instance will be created using the contract data from the database
53
- * and added to the cache before returning.
54
- *
55
- * @param classId - The class id of the contract for which the ContractTree is required.
56
- * @returns A ContractTree instance associated with the specified contract address.
57
- * @throws An Error if the contract is not found in the ContractDatabase.
58
- */ async #getPrivateFunctionTreeForClassId(classId) {
117
+ async #getPrivateFunctionTreeForClassId(classId) {
59
118
  if (!this.#privateFunctionTrees.has(classId.toString())) {
60
119
  const artifact = await this.getContractArtifact(classId);
61
120
  if (!artifact) {
@@ -66,9 +125,9 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
66
125
  }
67
126
  return this.#privateFunctionTrees.get(classId.toString());
68
127
  }
69
- async #getContractArtifactByAddress(contractAddress) {
70
- const contractClassId = await this.#getContractClassId(contractAddress);
71
- return contractClassId && this.getContractArtifact(contractClassId);
128
+ async #getArtifactByAddress(contractAddress) {
129
+ const classId = await this.#getContractClassId(contractAddress);
130
+ return classId && this.getContractArtifact(classId);
72
131
  }
73
132
  // Public getters
74
133
  getContractsAddresses() {
@@ -77,22 +136,43 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
77
136
  return keys.map(AztecAddress.fromString);
78
137
  });
79
138
  }
80
- /** Returns a contract instance for a given address. Throws if not found. */ getContractInstance(contractAddress) {
139
+ /** Returns a contract instance for a given address. */ getContractInstance(contractAddress) {
81
140
  return this.#store.transactionAsync(async ()=>{
82
141
  const contract = await this.#contractInstances.getAsync(contractAddress.toString());
83
142
  return contract && SerializableContractInstance.fromBuffer(contract).withAddress(contractAddress);
84
143
  });
85
144
  }
86
- getContractArtifact(contractClassId) {
87
- return this.#store.transactionAsync(async ()=>{
88
- const contract = await this.#contractArtifacts.getAsync(contractClassId.toString());
89
- // TODO(@spalladino): AztecAsyncMap lies and returns Uint8Arrays instead of Buffers, hence the extra Buffer.from.
90
- return contract && contractArtifactFromBuffer(Buffer.from(contract));
145
+ /** Returns the raw contract artifact for a given class id. */ async getContractArtifact(contractClassId) {
146
+ const key = contractClassId.toString();
147
+ const cached = this.#contractArtifactCache.get(key);
148
+ if (cached) {
149
+ return cached;
150
+ }
151
+ const artifact = await this.#store.transactionAsync(async ()=>{
152
+ const buf = await this.#contractArtifacts.getAsync(key);
153
+ return buf && contractArtifactFromBuffer(buf);
91
154
  });
155
+ if (artifact) {
156
+ this.#contractArtifactCache.set(key, artifact);
157
+ }
158
+ return artifact;
92
159
  }
93
- /** Returns a contract class for a given class id. Throws if not found. */ async getContractClass(contractClassId) {
160
+ /** Returns a contract class for a given class id. */ async getContractClassWithPreimage(contractClassId) {
161
+ const key = contractClassId.toString();
162
+ const buf = await this.#contractClassData.getAsync(key);
163
+ if (!buf) {
164
+ return undefined;
165
+ }
166
+ const classData = SerializableContractClassData.fromBuffer(buf);
94
167
  const artifact = await this.getContractArtifact(contractClassId);
95
- return artifact && getContractClassFromArtifact(artifact);
168
+ if (!artifact) {
169
+ return undefined;
170
+ }
171
+ const packedBytecode = artifact.functions.find((f)=>f.name === 'public_dispatch')?.bytecode ?? Buffer.alloc(0);
172
+ return {
173
+ ...classData,
174
+ packedBytecode
175
+ };
96
176
  }
97
177
  async getContract(address) {
98
178
  const instance = await this.getContractInstance(address);
@@ -110,17 +190,18 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
110
190
  }
111
191
  /**
112
192
  * Retrieves the artifact of a specified function within a given contract.
113
- * The function is identified by its selector, which is a unique code generated from the function's signature.
114
- * Throws an error if the contract address or function selector are invalid or not found.
115
193
  *
116
194
  * @param contractAddress - The AztecAddress representing the contract containing the function.
117
195
  * @param selector - The function selector.
118
196
  * @returns The corresponding function's artifact as an object.
119
197
  */ async getFunctionArtifact(contractAddress, selector) {
120
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
121
- const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
122
- return fnArtifact && {
123
- ...fnArtifact,
198
+ const artifact = await this.#getArtifactByAddress(contractAddress);
199
+ if (!artifact) {
200
+ return undefined;
201
+ }
202
+ const fn = await this.#findFunctionArtifactBySelector(artifact, selector);
203
+ return fn && {
204
+ ...fn,
124
205
  contractName: artifact.name
125
206
  };
126
207
  }
@@ -136,40 +217,38 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
136
217
  };
137
218
  }
138
219
  async getPublicFunctionArtifact(contractAddress) {
139
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
140
- const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
141
- return fnArtifact && {
142
- ...fnArtifact,
220
+ const artifact = await this.#getArtifactByAddress(contractAddress);
221
+ const fn = artifact && artifact.functions.find((f)=>f.functionType === FunctionType.PUBLIC);
222
+ return fn && {
223
+ ...fn,
143
224
  contractName: artifact.name
144
225
  };
145
226
  }
146
227
  async getFunctionAbi(contractAddress, selector) {
147
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
228
+ const artifact = await this.#getArtifactByAddress(contractAddress);
148
229
  return artifact && await this.#findFunctionAbiBySelector(artifact, selector);
149
230
  }
150
231
  /**
151
232
  * Retrieves the debug metadata of a specified function within a given contract.
152
- * The function is identified by its selector, which is a unique code generated from the function's signature.
153
- * Returns undefined if the debug metadata for the given function is not found.
154
- * Throws if the contract has not been added to the database.
155
233
  *
156
234
  * @param contractAddress - The AztecAddress representing the contract containing the function.
157
235
  * @param selector - The function selector.
158
- * @returns The corresponding function's artifact as an object.
236
+ * @returns The corresponding function's debug metadata, or undefined.
159
237
  */ async getFunctionDebugMetadata(contractAddress, selector) {
160
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
161
- const fnArtifact = artifact && await this.#findFunctionArtifactBySelector(artifact, selector);
162
- return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
238
+ const artifact = await this.#getArtifactByAddress(contractAddress);
239
+ if (!artifact) {
240
+ return undefined;
241
+ }
242
+ const fn = await this.#findFunctionArtifactBySelector(artifact, selector);
243
+ return fn && getFunctionDebugMetadata(artifact, fn);
163
244
  }
164
245
  async getPublicFunctionDebugMetadata(contractAddress) {
165
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
166
- const fnArtifact = artifact && artifact.functions.find((fn)=>fn.functionType === FunctionType.PUBLIC);
167
- return fnArtifact && getFunctionDebugMetadata(artifact, fnArtifact);
246
+ const artifact = await this.#getArtifactByAddress(contractAddress);
247
+ const fn = artifact && artifact.functions.find((f)=>f.functionType === FunctionType.PUBLIC);
248
+ return fn && getFunctionDebugMetadata(artifact, fn);
168
249
  }
169
250
  /**
170
251
  * Retrieve the function membership witness for the given contract class and function selector.
171
- * The function membership witness represents a proof that the function belongs to the specified contract.
172
- * Throws an error if the contract address or function selector is unknown.
173
252
  *
174
253
  * @param contractClassId - The id of the class.
175
254
  * @param selector - The function selector.
@@ -179,18 +258,16 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
179
258
  return tree?.getFunctionMembershipWitness(selector);
180
259
  }
181
260
  async getDebugContractName(contractAddress) {
182
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
261
+ const artifact = await this.#getArtifactByAddress(contractAddress);
183
262
  return artifact?.name;
184
263
  }
185
264
  async getDebugFunctionName(contractAddress, selector) {
186
- const artifact = await this.#getContractArtifactByAddress(contractAddress);
187
- const fnArtifact = artifact && await this.#findFunctionAbiBySelector(artifact, selector);
188
- return `${artifact?.name ?? contractAddress}:${fnArtifact?.name ?? selector}`;
265
+ const artifact = await this.#getArtifactByAddress(contractAddress);
266
+ const fn = artifact && await this.#findFunctionAbiBySelector(artifact, selector);
267
+ return `${artifact?.name ?? contractAddress}:${fn?.name ?? selector}`;
189
268
  }
190
269
  async #findFunctionArtifactBySelector(artifact, selector) {
191
- const functions = artifact.functions;
192
- for(let i = 0; i < functions.length; i++){
193
- const fn = functions[i];
270
+ for (const fn of artifact.functions){
194
271
  const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
195
272
  if (fnSelector.equals(selector)) {
196
273
  return fn;
@@ -198,12 +275,10 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
198
275
  }
199
276
  }
200
277
  async #findFunctionAbiBySelector(artifact, selector) {
201
- const functions = [
278
+ for (const fn of [
202
279
  ...artifact.functions,
203
280
  ...artifact.nonDispatchPublicFunctions ?? []
204
- ];
205
- for(let i = 0; i < functions.length; i++){
206
- const fn = functions[i];
281
+ ]){
207
282
  const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
208
283
  if (fnSelector.equals(selector)) {
209
284
  return fn;
@@ -219,10 +294,11 @@ import { PrivateFunctionsTree } from './private_functions_tree.js';
219
294
  if (!functionDao) {
220
295
  throw new Error(`Unknown function ${functionName} in contract ${contract.name}.`);
221
296
  }
297
+ const selector = await FunctionSelector.fromNameAndParameters(functionDao.name, functionDao.parameters);
222
298
  return FunctionCall.from({
223
299
  name: functionDao.name,
224
300
  to,
225
- selector: await FunctionSelector.fromNameAndParameters(functionDao.name, functionDao.parameters),
301
+ selector,
226
302
  type: functionDao.functionType,
227
303
  hideMsgSender: false,
228
304
  isStatic: functionDao.isStatic,
@@ -1,5 +1,5 @@
1
1
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
- import type { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
2
+ import type { ExtendedDirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
3
3
  import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
4
4
  /**
5
5
  * Data provider of tagging data used when syncing the logs as a recipient. The sender counterpart of this class
@@ -20,9 +20,9 @@ export declare class RecipientTaggingStore implements StagedStore {
20
20
  */
21
21
  commit(jobId: string): Promise<void>;
22
22
  discardStaged(jobId: string): Promise<void>;
23
- getHighestAgedIndex(secret: DirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
24
- updateHighestAgedIndex(secret: DirectionalAppTaggingSecret, index: number, jobId: string): Promise<void>;
25
- getHighestFinalizedIndex(secret: DirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
26
- updateHighestFinalizedIndex(secret: DirectionalAppTaggingSecret, index: number, jobId: string): Promise<void>;
23
+ getHighestAgedIndex(secret: ExtendedDirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
24
+ updateHighestAgedIndex(secret: ExtendedDirectionalAppTaggingSecret, index: number, jobId: string): Promise<void>;
25
+ getHighestFinalizedIndex(secret: ExtendedDirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
26
+ updateHighestFinalizedIndex(secret: ExtendedDirectionalAppTaggingSecret, index: number, jobId: string): Promise<void>;
27
27
  }
28
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVjaXBpZW50X3RhZ2dpbmdfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL3RhZ2dpbmdfc3RvcmUvcmVjaXBpZW50X3RhZ2dpbmdfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFDeEUsT0FBTyxLQUFLLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUV0RSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSwwQ0FBMEM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FBbUMsRUFDM0MsS0FBSyxFQUFFLE1BQU0sRUFDYixLQUFLLEVBQUUsTUFBTSxHQUNaLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FVZjtDQUNGIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"recipient_tagging_store.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/recipient_tagging_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAE5E;;;;;;;GAOG;AACH,qBAAa,qBAAsB,YAAW,WAAW;;IACvD,SAAS,EAAE,MAAM,CAAuB;IAaxC,YAAY,KAAK,EAAE,iBAAiB,EAQnC;IA4CD;;;;OAIG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBzC;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI1C;IAED,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEnG;IAED,sBAAsB,CAAC,MAAM,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CASvG;IAED,wBAAwB,CAAC,MAAM,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAExG;IAED,2BAA2B,CAAC,MAAM,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAU5G;CACF"}
1
+ {"version":3,"file":"recipient_tagging_store.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/recipient_tagging_store.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,mCAAmC,EAAE,MAAM,oBAAoB,CAAC;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAE5E;;;;;;;GAOG;AACH,qBAAa,qBAAsB,YAAW,WAAW;;IACvD,SAAS,EAAE,MAAM,CAAuB;IAaxC,YAAY,KAAK,EAAE,iBAAiB,EAQnC;IA4CD;;;;OAIG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBzC;IAED,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAI1C;IAED,mBAAmB,CAAC,MAAM,EAAE,mCAAmC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE3G;IAED,sBAAsB,CAAC,MAAM,EAAE,mCAAmC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAS/G;IAED,wBAAwB,CAAC,MAAM,EAAE,mCAAmC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEhH;IAED,2BAA2B,CACzB,MAAM,EAAE,mCAAmC,EAC3C,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAUf;CACF"}
@@ -1,5 +1,5 @@
1
1
  import type { AztecAsyncKVStore } from '@aztec/kv-store';
2
- import type { DirectionalAppTaggingSecret, PreTag } from '@aztec/stdlib/logs';
2
+ import type { ExtendedDirectionalAppTaggingSecret, PreTag } from '@aztec/stdlib/logs';
3
3
  import { TxHash } from '@aztec/stdlib/tx';
4
4
  import type { StagedStore } from '../../job_coordinator/job_coordinator.js';
5
5
  /**
@@ -50,20 +50,20 @@ export declare class SenderTaggingStore implements StagedStore {
50
50
  * @returns An array of unique transaction hashes for pending transactions that contain indexes in the range
51
51
  * [startIndex, endIndex). Returns an empty array if no pending indexes exist in the range.
52
52
  */
53
- getTxHashesOfPendingIndexes(secret: DirectionalAppTaggingSecret, startIndex: number, endIndex: number, jobId: string): Promise<TxHash[]>;
53
+ getTxHashesOfPendingIndexes(secret: ExtendedDirectionalAppTaggingSecret, startIndex: number, endIndex: number, jobId: string): Promise<TxHash[]>;
54
54
  /**
55
55
  * Returns the last (highest) finalized index for a given secret.
56
56
  * @param secret - The secret to get the last finalized index for.
57
57
  * @returns The last (highest) finalized index for the given secret.
58
58
  */
59
- getLastFinalizedIndex(secret: DirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
59
+ getLastFinalizedIndex(secret: ExtendedDirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
60
60
  /**
61
61
  * Returns the last used index for a given directional app tagging secret, considering both finalized and pending
62
62
  * indexes.
63
63
  * @param secret - The directional app tagging secret to query the last used index for.
64
64
  * @returns The last used index.
65
65
  */
66
- getLastUsedIndex(secret: DirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
66
+ getLastUsedIndex(secret: ExtendedDirectionalAppTaggingSecret, jobId: string): Promise<number | undefined>;
67
67
  /**
68
68
  * Drops all pending indexes corresponding to the given transaction hashes.
69
69
  */
@@ -74,4 +74,4 @@ export declare class SenderTaggingStore implements StagedStore {
74
74
  */
75
75
  finalizePendingIndexes(txHashes: TxHash[], jobId: string): Promise<void>;
76
76
  }
77
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZGVyX3RhZ2dpbmdfc3RvcmUuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL3RhZ2dpbmdfc3RvcmUvc2VuZGVyX3RhZ2dpbmd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;IACH,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA0EnF;IAED;;;;;;;;OAQG;IACH,2BAA2B,CACzB,MAAM,EAAE,mCAAmC,EAC3C,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnB;IAED;;;;OAIG;IACH,qBAAqB,CAAC,MAAM,EAAE,mCAAmC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE7G;IAED;;;;;OAKG;IACH,gBAAgB,CAAC,MAAM,EAAE,mCAAmC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkBxG;IAED;;OAEG;IACH,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2CnE;IAED;;;OAGG;IACH,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CA2FvE;CACF"}
@@ -126,17 +126,17 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/constants.
126
126
  }
127
127
  // The secrets in pre-tags should be unique because we always store just the highest index per given secret-txHash
128
128
  // pair. Below we check that this is the case.
129
- const secretsSet = new Set(preTags.map((preTag)=>preTag.secret.toString()));
129
+ const secretsSet = new Set(preTags.map((preTag)=>preTag.extendedSecret.toString()));
130
130
  if (secretsSet.size !== preTags.length) {
131
131
  return Promise.reject(new Error(`Duplicate secrets found when storing pending indexes`));
132
132
  }
133
133
  const txHashStr = txHash.toString();
134
134
  return this.#store.transactionAsync(async ()=>{
135
135
  // Prefetch all data, start reads during iteration to keep IndexedDB transaction alive
136
- const preTagReadPromises = preTags.map(({ secret, index })=>{
137
- const secretStr = secret.toString();
136
+ const preTagReadPromises = preTags.map(({ extendedSecret, index })=>{
137
+ const secretStr = extendedSecret.toString();
138
138
  return {
139
- secret,
139
+ extendedSecret,
140
140
  secretStr,
141
141
  index,
142
142
  pending: this.#readPendingIndexes(jobId, secretStr),
@@ -12,6 +12,6 @@ export { loadPrivateLogsForSenderRecipientPair } from './recipient_sync/load_pri
12
12
  export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
13
13
  export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
14
14
  export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
15
- export { DirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
15
+ export { ExtendedDirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
16
16
  export { type PreTag } from '@aztec/stdlib/logs';
17
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7R0FTRztBQUVILE9BQU8sRUFBRSxxQ0FBcUMsRUFBRSxNQUFNLGlFQUFpRSxDQUFDO0FBQ3hILE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBQ3hGLE9BQU8sRUFBRSxzQ0FBc0MsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3hFLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxrQ0FBa0MsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBR3hHLE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDakYsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUMifQ==
17
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7R0FTRztBQUVILE9BQU8sRUFBRSxxQ0FBcUMsRUFBRSxNQUFNLGlFQUFpRSxDQUFDO0FBQ3hILE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBQ3hGLE9BQU8sRUFBRSxzQ0FBc0MsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3hFLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxrQ0FBa0MsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBR3hHLE9BQU8sRUFBRSxtQ0FBbUMsRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDekYsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qCAAqC,EAAE,MAAM,iEAAiE,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAGxG,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qCAAqC,EAAE,MAAM,iEAAiE,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAGxG,OAAO,EAAE,mCAAmC,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
@@ -12,4 +12,4 @@ export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_inde
12
12
  export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
13
13
  export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
14
14
  // Re-export tagging-related types from stdlib
15
- export { DirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
15
+ export { ExtendedDirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
@@ -1,15 +1,14 @@
1
1
  import type { BlockNumber } from '@aztec/foundation/branded-types';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
2
  import type { BlockHash } from '@aztec/stdlib/block';
4
3
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
5
- import type { DirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
4
+ import type { ExtendedDirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
6
5
  import type { RecipientTaggingStore } from '../../storage/tagging_store/recipient_tagging_store.js';
7
6
  /**
8
- * Loads private logs for `app` and sender-recipient pair defined by `secret` and updates the highest aged and
7
+ * Loads private logs for the app-sender-recipient triplet defined by `secret` and updates the highest aged and
9
8
  * finalized indexes in the db. At most load logs from blocks up to and including `anchorBlockNumber`.
10
9
  *
11
10
  * @dev This function can be safely executed "in parallel" for other sender-recipient pairs because the data in
12
11
  * in the tagging data provider is indexed by the secret and hence completely disjoint.
13
12
  */
14
- export declare function loadPrivateLogsForSenderRecipientPair(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockNumber: BlockNumber, anchorBlockHash: BlockHash, jobId: string): Promise<TxScopedL2Log[]>;
15
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvbG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBRSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUVyRixPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHdEQUF3RCxDQUFDO0FBS3BHOzs7Ozs7R0FNRztBQUNILHdCQUFzQixxQ0FBcUMsQ0FDekQsTUFBTSxFQUFFLDJCQUEyQixFQUNuQyxHQUFHLEVBQUUsWUFBWSxFQUNqQixTQUFTLEVBQUUsU0FBUyxFQUNwQixZQUFZLEVBQUUscUJBQXFCLEVBQ25DLGlCQUFpQixFQUFFLFdBQVcsRUFDOUIsZUFBZSxFQUFFLFNBQVMsRUFDMUIsS0FBSyxFQUFFLE1BQU0sR0FDWixPQUFPLENBQUMsYUFBYSxFQUFFLENBQUMsQ0FvSDFCIn0=
13
+ export declare function loadPrivateLogsForSenderRecipientPair(secret: ExtendedDirectionalAppTaggingSecret, aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockNumber: BlockNumber, anchorBlockHash: BlockHash, jobId: string): Promise<TxScopedL2Log[]>;
14
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvbG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSxtQ0FBbUMsRUFBRSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUU3RixPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHdEQUF3RCxDQUFDO0FBS3BHOzs7Ozs7R0FNRztBQUNILHdCQUFzQixxQ0FBcUMsQ0FDekQsTUFBTSxFQUFFLG1DQUFtQyxFQUMzQyxTQUFTLEVBQUUsU0FBUyxFQUNwQixZQUFZLEVBQUUscUJBQXFCLEVBQ25DLGlCQUFpQixFQUFFLFdBQVcsRUFDOUIsZUFBZSxFQUFFLFNBQVMsRUFDMUIsS0FBSyxFQUFFLE1BQU0sR0FDWixPQUFPLENBQUMsYUFBYSxFQUFFLENBQUMsQ0FtSDFCIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"load_private_logs_for_sender_recipient_pair.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAErF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,EAC9B,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,EAAE,CAAC,CAoH1B"}
1
+ {"version":3,"file":"load_private_logs_for_sender_recipient_pair.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,mCAAmC,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAE7F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,mCAAmC,EAC3C,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,EAC9B,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,EAAE,CAAC,CAmH1B"}
@@ -2,12 +2,12 @@ import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../constants.js';
2
2
  import { findHighestIndexes } from './utils/find_highest_indexes.js';
3
3
  import { loadLogsForRange } from './utils/load_logs_for_range.js';
4
4
  /**
5
- * Loads private logs for `app` and sender-recipient pair defined by `secret` and updates the highest aged and
5
+ * Loads private logs for the app-sender-recipient triplet defined by `secret` and updates the highest aged and
6
6
  * finalized indexes in the db. At most load logs from blocks up to and including `anchorBlockNumber`.
7
7
  *
8
8
  * @dev This function can be safely executed "in parallel" for other sender-recipient pairs because the data in
9
9
  * in the tagging data provider is indexed by the secret and hence completely disjoint.
10
- */ export async function loadPrivateLogsForSenderRecipientPair(secret, app, aztecNode, taggingStore, anchorBlockNumber, anchorBlockHash, jobId) {
10
+ */ export async function loadPrivateLogsForSenderRecipientPair(secret, aztecNode, taggingStore, anchorBlockNumber, anchorBlockHash, jobId) {
11
11
  // # Explanation of how the algorithm works
12
12
  // When we perform the sync we will look at logs that correspond to the tagging index range
13
13
  // (highestAgedIndex, highestFinalizedIndex + WINDOW_LEN]
@@ -72,7 +72,7 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
72
72
  const logs = [];
73
73
  while(true){
74
74
  // Get private logs with their block timestamps and corresponding tagging indexes
75
- const privateLogsWithIndexes = await loadLogsForRange(secret, app, aztecNode, start, end, anchorBlockNumber, anchorBlockHash);
75
+ const privateLogsWithIndexes = await loadLogsForRange(secret, aztecNode, start, end, anchorBlockNumber, anchorBlockHash);
76
76
  if (privateLogsWithIndexes.length === 0) {
77
77
  break;
78
78
  }
@@ -1,15 +1,14 @@
1
1
  import type { BlockNumber } from '@aztec/foundation/branded-types';
2
- import type { AztecAddress } from '@aztec/stdlib/aztec-address';
3
2
  import type { BlockHash } from '@aztec/stdlib/block';
4
3
  import type { AztecNode } from '@aztec/stdlib/interfaces/client';
5
- import type { DirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
4
+ import type { ExtendedDirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
6
5
  /**
7
- * Gets private logs with their corresponding block timestamps and tagging indexes for the given index range, `app` and
8
- * `secret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and `end` is
9
- * exclusive.
6
+ * Gets private logs with their corresponding block timestamps and tagging indexes for the given index range and
7
+ * `extendedSecret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and
8
+ * `end` is exclusive.
10
9
  */
11
- export declare function loadLogsForRange(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, start: number, end: number, anchorBlockNumber: BlockNumber, anchorBlockHash: BlockHash): Promise<Array<{
10
+ export declare function loadLogsForRange(extendedSecret: ExtendedDirectionalAppTaggingSecret, aztecNode: AztecNode, start: number, end: number, anchorBlockNumber: BlockNumber, anchorBlockHash: BlockHash): Promise<Array<{
12
11
  log: TxScopedL2Log;
13
12
  taggingIndex: number;
14
13
  }>>;
15
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9sb2dzX2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AO,KAAK,EAAE,2BAA2B,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK7F;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,iBAAiB,EAAE,WAAW,EAC9B,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,KAAK,CAAC;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CA0B9D"}
1
+ {"version":3,"file":"load_logs_for_range.d.ts","sourceRoot":"","sources":["../../../../src/tagging/recipient_sync/utils/load_logs_for_range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,mCAAmC,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK7F;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,mCAAmC,EACnD,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,iBAAiB,EAAE,WAAW,EAC9B,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,KAAK,CAAC;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAuB9D"}
@@ -1,16 +1,17 @@
1
- import { SiloedTag, Tag } from '@aztec/stdlib/logs';
1
+ import { SiloedTag } from '@aztec/stdlib/logs';
2
2
  import { getAllPrivateLogsByTags } from '../../get_all_logs_by_tags.js';
3
3
  /**
4
- * Gets private logs with their corresponding block timestamps and tagging indexes for the given index range, `app` and
5
- * `secret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and `end` is
6
- * exclusive.
7
- */ export async function loadLogsForRange(secret, app, aztecNode, start, end, anchorBlockNumber, anchorBlockHash) {
8
- // Derive tags for the window
9
- const preTags = Array(end - start).fill(0).map((_, i)=>({
10
- secret,
4
+ * Gets private logs with their corresponding block timestamps and tagging indexes for the given index range and
5
+ * `extendedSecret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and
6
+ * `end` is exclusive.
7
+ */ export async function loadLogsForRange(extendedSecret, aztecNode, start, end, anchorBlockNumber, anchorBlockHash) {
8
+ // Derive siloed tags for the window
9
+ const siloedTags = await Promise.all(Array.from({
10
+ length: end - start
11
+ }, (_, i)=>SiloedTag.compute({
12
+ extendedSecret,
11
13
  index: start + i
12
- }));
13
- const siloedTags = await Promise.all(preTags.map((preTag)=>Tag.compute(preTag))).then((tags)=>Promise.all(tags.map((tag)=>SiloedTag.compute(tag, app))));
14
+ })));
14
15
  // We use the utility function below to retrieve all logs for the tags across all pages, so we don't need to handle
15
16
  // pagination here.
16
17
  const logs = await getAllPrivateLogsByTags(aztecNode, siloedTags, anchorBlockHash);
@@ -18,7 +19,7 @@ import { getAllPrivateLogsByTags } from '../../get_all_logs_by_tags.js';
18
19
  const logsWithIndexes = [];
19
20
  for(let i = 0; i < logs.length; i++){
20
21
  const logsForTag = logs[i];
21
- const taggingIndex = preTags[i].index;
22
+ const taggingIndex = start + i;
22
23
  for (const log of logsForTag){
23
24
  if (log.blockNumber <= anchorBlockNumber) {
24
25
  logsWithIndexes.push({