@aztec/pxe 0.0.1-commit.c80b6263 → 0.0.1-commit.cd76b27
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/access_scopes.d.ts +9 -0
- package/dest/access_scopes.d.ts.map +1 -0
- package/dest/access_scopes.js +6 -0
- package/dest/block_synchronizer/block_synchronizer.d.ts +4 -2
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +7 -1
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +54 -30
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +172 -68
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +9 -9
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +5 -5
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +32 -20
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +36 -36
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +74 -21
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +48 -24
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +85 -61
- package/dest/contract_sync/contract_sync_service.d.ts +43 -0
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -0
- package/dest/contract_sync/contract_sync_service.js +97 -0
- package/dest/contract_sync/helpers.d.ts +29 -0
- package/dest/contract_sync/helpers.d.ts.map +1 -0
- package/dest/contract_sync/{index.js → helpers.js} +13 -12
- package/dest/debug/pxe_debug_utils.d.ts +14 -10
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +16 -15
- package/dest/entrypoints/client/bundle/index.d.ts +3 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +2 -0
- 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 +11 -2
- package/dest/entrypoints/client/lazy/index.d.ts +3 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +2 -0
- 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 +11 -2
- package/dest/entrypoints/server/index.d.ts +4 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +3 -1
- package/dest/entrypoints/server/utils.js +9 -1
- package/dest/events/event_service.d.ts +4 -5
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +5 -6
- package/dest/logs/log_service.d.ts +6 -5
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +14 -24
- package/dest/notes/note_service.d.ts +7 -7
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +9 -9
- package/dest/notes_filter.d.ts +25 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +2 -2
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
- package/dest/private_kernel/hints/index.d.ts +1 -1
- package/dest/private_kernel/hints/index.js +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +4 -4
- package/dest/private_kernel/private_kernel_execution_prover.js +6 -6
- package/dest/pxe.d.ts +69 -23
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +78 -50
- package/dest/storage/address_store/address_store.d.ts +1 -1
- package/dest/storage/address_store/address_store.d.ts.map +1 -1
- package/dest/storage/address_store/address_store.js +12 -11
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
- package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
- package/dest/storage/capsule_store/capsule_store.js +6 -8
- package/dest/storage/contract_store/contract_store.d.ts +1 -1
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +27 -18
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +13 -3
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +147 -107
- package/dest/storage/private_event_store/private_event_store.d.ts +1 -1
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
- package/dest/storage/private_event_store/private_event_store.js +84 -61
- package/dest/storage/private_event_store/stored_private_event.js +1 -1
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +1 -1
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/recipient_tagging_store.js +31 -19
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +183 -113
- package/dest/tagging/get_all_logs_by_tags.d.ts +1 -1
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
- package/dest/tagging/get_all_logs_by_tags.js +17 -3
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +4 -4
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
- package/package.json +25 -16
- package/src/access_scopes.ts +9 -0
- package/src/block_synchronizer/block_synchronizer.ts +6 -0
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +321 -125
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
- package/src/contract_function_simulator/oracle/interfaces.ts +10 -10
- package/src/contract_function_simulator/oracle/oracle.ts +35 -18
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +97 -101
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +129 -63
- package/src/contract_sync/contract_sync_service.ts +152 -0
- package/src/contract_sync/{index.ts → helpers.ts} +21 -21
- package/src/debug/pxe_debug_utils.ts +48 -18
- package/src/entrypoints/client/bundle/index.ts +2 -0
- package/src/entrypoints/client/bundle/utils.ts +12 -2
- package/src/entrypoints/client/lazy/index.ts +2 -0
- package/src/entrypoints/client/lazy/utils.ts +12 -2
- package/src/entrypoints/server/index.ts +3 -1
- package/src/entrypoints/server/utils.ts +7 -7
- package/src/events/event_service.ts +4 -6
- package/src/logs/log_service.ts +14 -29
- package/src/notes/note_service.ts +9 -10
- package/src/notes_filter.ts +26 -0
- package/src/oracle_version.ts +2 -2
- package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
- package/src/private_kernel/hints/index.ts +1 -1
- package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +7 -7
- package/src/private_kernel/private_kernel_execution_prover.ts +6 -6
- package/src/pxe.ts +161 -98
- package/src/storage/address_store/address_store.ts +15 -15
- package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
- package/src/storage/capsule_store/capsule_store.ts +8 -8
- package/src/storage/contract_store/contract_store.ts +26 -15
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +169 -132
- package/src/storage/private_event_store/private_event_store.ts +102 -81
- package/src/storage/private_event_store/stored_private_event.ts +1 -1
- package/src/storage/tagging_store/recipient_tagging_store.ts +31 -21
- package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
- package/src/storage/tagging_store/sender_tagging_store.ts +210 -126
- package/src/tagging/get_all_logs_by_tags.ts +28 -4
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +4 -4
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
- package/dest/contract_sync/index.d.ts +0 -23
- package/dest/contract_sync/index.d.ts.map +0 -1
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { toArray } from '@aztec/foundation/iterable';
|
|
2
1
|
import type { AztecAsyncKVStore, AztecAsyncMap } from '@aztec/kv-store';
|
|
3
2
|
import type { DirectionalAppTaggingSecret, PreTag } from '@aztec/stdlib/logs';
|
|
4
3
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
@@ -70,31 +69,23 @@ export class SenderTaggingStore implements StagedStore {
|
|
|
70
69
|
}
|
|
71
70
|
|
|
72
71
|
async #readPendingIndexes(jobId: string, secret: string): Promise<{ index: number; txHash: string }[]> {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return
|
|
72
|
+
// Always issue DB read to keep IndexedDB transaction alive (they auto-commit when a new micro-task starts and there
|
|
73
|
+
// are no pending read requests). The staged value still takes precedence if it exists.
|
|
74
|
+
const dbValue = await this.#pendingIndexes.getAsync(secret);
|
|
75
|
+
const staged = this.#getPendingIndexesForJob(jobId).get(secret);
|
|
76
|
+
return staged !== undefined ? staged : (dbValue ?? []);
|
|
78
77
|
}
|
|
79
78
|
|
|
80
79
|
#writePendingIndexes(jobId: string, secret: string, pendingIndexes: { index: number; txHash: string }[]) {
|
|
81
80
|
this.#getPendingIndexesForJob(jobId).set(secret, pendingIndexes);
|
|
82
81
|
}
|
|
83
82
|
|
|
84
|
-
/**
|
|
85
|
-
* Returns a job view of all the secrets that have a corresponding list of pending indexes either in persistent
|
|
86
|
-
* storage or the current job.
|
|
87
|
-
*/
|
|
88
|
-
async #readSecretsWithPendingIndexes(jobId: string): Promise<string[]> {
|
|
89
|
-
const storedSecrets = new Set(await toArray(this.#pendingIndexes.keysAsync()));
|
|
90
|
-
const stagedSecrets = this.#getPendingIndexesForJob(jobId).keys();
|
|
91
|
-
return [...storedSecrets.union(new Set(stagedSecrets))];
|
|
92
|
-
}
|
|
93
|
-
|
|
94
83
|
async #readLastFinalizedIndex(jobId: string, secret: string): Promise<number | undefined> {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
);
|
|
84
|
+
// Always issue DB read to keep IndexedDB transaction alive (they auto-commit when a new micro-task starts and there
|
|
85
|
+
// are no pending read requests). The staged value still takes precedence if it exists.
|
|
86
|
+
const dbValue = await this.#lastFinalizedIndexes.getAsync(secret);
|
|
87
|
+
const staged = this.#getLastFinalizedIndexesForJob(jobId).get(secret);
|
|
88
|
+
return staged ?? dbValue;
|
|
98
89
|
}
|
|
99
90
|
|
|
100
91
|
#writeLastFinalizedIndex(jobId: string, secret: string, lastFinalizedIndex: number) {
|
|
@@ -156,55 +147,80 @@ export class SenderTaggingStore implements StagedStore {
|
|
|
156
147
|
* This is enforced because this should never happen if the syncing is done correctly as we look for logs from higher
|
|
157
148
|
* indexes than finalized ones.
|
|
158
149
|
*/
|
|
159
|
-
|
|
150
|
+
storePendingIndexes(preTags: PreTag[], txHash: TxHash, jobId: string): Promise<void> {
|
|
151
|
+
if (preTags.length === 0) {
|
|
152
|
+
return Promise.resolve();
|
|
153
|
+
}
|
|
154
|
+
|
|
160
155
|
// The secrets in pre-tags should be unique because we always store just the highest index per given secret-txHash
|
|
161
156
|
// pair. Below we check that this is the case.
|
|
162
157
|
const secretsSet = new Set(preTags.map(preTag => preTag.secret.toString()));
|
|
163
158
|
if (secretsSet.size !== preTags.length) {
|
|
164
|
-
|
|
159
|
+
return Promise.reject(new Error(`Duplicate secrets found when storing pending indexes`));
|
|
165
160
|
}
|
|
166
161
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
const
|
|
162
|
+
const txHashStr = txHash.toString();
|
|
163
|
+
|
|
164
|
+
return this.#store.transactionAsync(async () => {
|
|
165
|
+
// Prefetch all data, start reads during iteration to keep IndexedDB transaction alive
|
|
166
|
+
const preTagReadPromises = preTags.map(({ secret, index }) => {
|
|
167
|
+
const secretStr = secret.toString();
|
|
168
|
+
return {
|
|
169
|
+
secret,
|
|
170
|
+
secretStr,
|
|
171
|
+
index,
|
|
172
|
+
pending: this.#readPendingIndexes(jobId, secretStr),
|
|
173
|
+
finalized: this.#readLastFinalizedIndex(jobId, secretStr),
|
|
174
|
+
};
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
// Await all reads together
|
|
178
|
+
const preTagData = await Promise.all(
|
|
179
|
+
preTagReadPromises.map(async item => ({
|
|
180
|
+
...item,
|
|
181
|
+
pendingData: await item.pending,
|
|
182
|
+
finalizedIndex: await item.finalized,
|
|
183
|
+
})),
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
// Process in memory and validate
|
|
187
|
+
for (const { secretStr, index, pendingData, finalizedIndex } of preTagData) {
|
|
188
|
+
// First we check that for any secret the highest used index in tx is not further than window length from
|
|
189
|
+
// the highest finalized index.
|
|
190
|
+
if (index > (finalizedIndex ?? 0) + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN) {
|
|
191
|
+
throw new Error(
|
|
192
|
+
`Highest used index ${index} is further than window length from the highest finalized index ${finalizedIndex ?? 0}.
|
|
193
|
+
Tagging window length ${UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN} is configured too low. Contact the Aztec team
|
|
194
|
+
to increase it!`,
|
|
195
|
+
);
|
|
196
|
+
}
|
|
193
197
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
if (existingForSecretAndTx.index !== index) {
|
|
198
|
+
// Throw if the new pending index is lower than or equal to the last finalized index
|
|
199
|
+
if (finalizedIndex !== undefined && index <= finalizedIndex) {
|
|
197
200
|
throw new Error(
|
|
198
|
-
`Cannot store index ${index} for secret ${secretStr}
|
|
199
|
-
`
|
|
201
|
+
`Cannot store pending index ${index} for secret ${secretStr}: ` +
|
|
202
|
+
`it is lower than or equal to the last finalized index ${finalizedIndex}`,
|
|
200
203
|
);
|
|
201
204
|
}
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
205
|
+
|
|
206
|
+
// Check if this secret + txHash combination already exists
|
|
207
|
+
const existingForSecretAndTx = pendingData.find(entry => entry.txHash === txHashStr);
|
|
208
|
+
|
|
209
|
+
if (existingForSecretAndTx) {
|
|
210
|
+
// If it exists with a different index, throw an error
|
|
211
|
+
if (existingForSecretAndTx.index !== index) {
|
|
212
|
+
throw new Error(
|
|
213
|
+
`Cannot store index ${index} for secret ${secretStr} and txHash ${txHashStr}: ` +
|
|
214
|
+
`a different index ${existingForSecretAndTx.index} already exists for this secret-txHash pair`,
|
|
215
|
+
);
|
|
216
|
+
}
|
|
217
|
+
// If it exists with the same index, ignore the update (no-op)
|
|
218
|
+
} else {
|
|
219
|
+
// If it doesn't exist, add it
|
|
220
|
+
this.#writePendingIndexes(jobId, secretStr, [...pendingData, { index, txHash: txHashStr }]);
|
|
221
|
+
}
|
|
206
222
|
}
|
|
207
|
-
}
|
|
223
|
+
});
|
|
208
224
|
}
|
|
209
225
|
|
|
210
226
|
/**
|
|
@@ -216,17 +232,19 @@ export class SenderTaggingStore implements StagedStore {
|
|
|
216
232
|
* @returns An array of unique transaction hashes for pending transactions that contain indexes in the range
|
|
217
233
|
* [startIndex, endIndex). Returns an empty array if no pending indexes exist in the range.
|
|
218
234
|
*/
|
|
219
|
-
|
|
235
|
+
getTxHashesOfPendingIndexes(
|
|
220
236
|
secret: DirectionalAppTaggingSecret,
|
|
221
237
|
startIndex: number,
|
|
222
238
|
endIndex: number,
|
|
223
239
|
jobId: string,
|
|
224
240
|
): Promise<TxHash[]> {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
241
|
+
return this.#store.transactionAsync(async () => {
|
|
242
|
+
const existing = await this.#readPendingIndexes(jobId, secret.toString());
|
|
243
|
+
const txHashes = existing
|
|
244
|
+
.filter(entry => entry.index >= startIndex && entry.index < endIndex)
|
|
245
|
+
.map(entry => entry.txHash);
|
|
246
|
+
return Array.from(new Set(txHashes)).map(TxHash.fromString);
|
|
247
|
+
});
|
|
230
248
|
}
|
|
231
249
|
|
|
232
250
|
/**
|
|
@@ -235,7 +253,7 @@ export class SenderTaggingStore implements StagedStore {
|
|
|
235
253
|
* @returns The last (highest) finalized index for the given secret.
|
|
236
254
|
*/
|
|
237
255
|
getLastFinalizedIndex(secret: DirectionalAppTaggingSecret, jobId: string): Promise<number | undefined> {
|
|
238
|
-
return this.#readLastFinalizedIndex(jobId, secret.toString());
|
|
256
|
+
return this.#store.transactionAsync(() => this.#readLastFinalizedIndex(jobId, secret.toString()));
|
|
239
257
|
}
|
|
240
258
|
|
|
241
259
|
/**
|
|
@@ -244,102 +262,168 @@ export class SenderTaggingStore implements StagedStore {
|
|
|
244
262
|
* @param secret - The directional app tagging secret to query the last used index for.
|
|
245
263
|
* @returns The last used index.
|
|
246
264
|
*/
|
|
247
|
-
|
|
265
|
+
getLastUsedIndex(secret: DirectionalAppTaggingSecret, jobId: string): Promise<number | undefined> {
|
|
248
266
|
const secretStr = secret.toString();
|
|
249
|
-
const pendingTxScopedIndexes = await this.#readPendingIndexes(jobId, secretStr);
|
|
250
|
-
const pendingIndexes = pendingTxScopedIndexes.map(entry => entry.index);
|
|
251
267
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
268
|
+
return this.#store.transactionAsync(async () => {
|
|
269
|
+
const pendingPromise = this.#readPendingIndexes(jobId, secretStr);
|
|
270
|
+
const finalizedPromise = this.#readLastFinalizedIndex(jobId, secretStr);
|
|
271
|
+
|
|
272
|
+
const [pendingTxScopedIndexes, lastFinalized] = await Promise.all([pendingPromise, finalizedPromise]);
|
|
273
|
+
const pendingIndexes = pendingTxScopedIndexes.map(entry => entry.index);
|
|
274
|
+
|
|
275
|
+
if (pendingTxScopedIndexes.length === 0) {
|
|
276
|
+
return lastFinalized;
|
|
277
|
+
}
|
|
255
278
|
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
279
|
+
// As the last used index we return the highest one from the pending indexes. Note that this value will be always
|
|
280
|
+
// higher than the last finalized index because we prune lower pending indexes when a tx is finalized.
|
|
281
|
+
return Math.max(...pendingIndexes);
|
|
282
|
+
});
|
|
259
283
|
}
|
|
260
284
|
|
|
261
285
|
/**
|
|
262
286
|
* Drops all pending indexes corresponding to the given transaction hashes.
|
|
263
287
|
*/
|
|
264
|
-
|
|
288
|
+
dropPendingIndexes(txHashes: TxHash[], jobId: string): Promise<void> {
|
|
265
289
|
if (txHashes.length === 0) {
|
|
266
|
-
return;
|
|
290
|
+
return Promise.resolve();
|
|
267
291
|
}
|
|
268
292
|
|
|
269
293
|
const txHashStrings = new Set<string>(txHashes.map(txHash => txHash.toString()));
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
294
|
+
|
|
295
|
+
return this.#store.transactionAsync(async () => {
|
|
296
|
+
// Prefetch all data, start reads during iteration to keep IndexedDB transaction alive
|
|
297
|
+
const secretReadPromises: Map<string, Promise<{ index: number; txHash: string }[]>> = new Map();
|
|
298
|
+
|
|
299
|
+
for await (const secret of this.#pendingIndexes.keysAsync()) {
|
|
300
|
+
secretReadPromises.set(secret, this.#readPendingIndexes(jobId, secret));
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Add staged-only secrets (sync, no DB)
|
|
304
|
+
for (const secret of this.#getPendingIndexesForJob(jobId).keys()) {
|
|
305
|
+
if (!secretReadPromises.has(secret)) {
|
|
306
|
+
secretReadPromises.set(secret, Promise.resolve(this.#getPendingIndexesForJob(jobId).get(secret) ?? []));
|
|
281
307
|
}
|
|
282
|
-
// else: No items were filtered out (txHashes not found for this secret) --> no-op
|
|
283
308
|
}
|
|
284
|
-
|
|
309
|
+
|
|
310
|
+
// Await all reads together
|
|
311
|
+
const secrets = [...secretReadPromises.keys()];
|
|
312
|
+
const pendingDataResults = await Promise.all(secretReadPromises.values());
|
|
313
|
+
|
|
314
|
+
// Process in memory
|
|
315
|
+
for (let i = 0; i < secrets.length; i++) {
|
|
316
|
+
const secret = secrets[i];
|
|
317
|
+
const pendingData = pendingDataResults[i];
|
|
318
|
+
|
|
319
|
+
if (pendingData && pendingData.length > 0) {
|
|
320
|
+
const filtered = pendingData.filter(item => !txHashStrings.has(item.txHash));
|
|
321
|
+
if (filtered.length === 0) {
|
|
322
|
+
this.#writePendingIndexes(jobId, secret, []);
|
|
323
|
+
} else if (filtered.length !== pendingData.length) {
|
|
324
|
+
// Some items were filtered out, so update the pending data
|
|
325
|
+
this.#writePendingIndexes(jobId, secret, filtered);
|
|
326
|
+
}
|
|
327
|
+
// else: No items were filtered out (txHashes not found for this secret) --> no-op
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
});
|
|
285
331
|
}
|
|
286
332
|
|
|
287
333
|
/**
|
|
288
334
|
* Updates pending indexes corresponding to the given transaction hashes to be finalized and prunes any lower pending
|
|
289
335
|
* indexes.
|
|
290
336
|
*/
|
|
291
|
-
|
|
337
|
+
finalizePendingIndexes(txHashes: TxHash[], jobId: string): Promise<void> {
|
|
292
338
|
if (txHashes.length === 0) {
|
|
293
|
-
return;
|
|
339
|
+
return Promise.resolve();
|
|
294
340
|
}
|
|
295
341
|
|
|
296
|
-
|
|
297
|
-
const txHashStr = txHash.toString();
|
|
342
|
+
const txHashStrings = new Set(txHashes.map(tx => tx.toString()));
|
|
298
343
|
|
|
299
|
-
|
|
344
|
+
return this.#store.transactionAsync(async () => {
|
|
345
|
+
// Prefetch all data, start reads during iteration to keep IndexedDB transaction alive
|
|
346
|
+
const secretDataPromises: Map<
|
|
347
|
+
string,
|
|
348
|
+
{ pending: Promise<{ index: number; txHash: string }[]>; finalized: Promise<number | undefined> }
|
|
349
|
+
> = new Map();
|
|
300
350
|
|
|
301
|
-
for (const secret of
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
351
|
+
for await (const secret of this.#pendingIndexes.keysAsync()) {
|
|
352
|
+
secretDataPromises.set(secret, {
|
|
353
|
+
pending: this.#readPendingIndexes(jobId, secret),
|
|
354
|
+
finalized: this.#readLastFinalizedIndex(jobId, secret),
|
|
355
|
+
});
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
// Add staged-only secrets (sync, no DB)
|
|
359
|
+
for (const secret of this.#getPendingIndexesForJob(jobId).keys()) {
|
|
360
|
+
if (!secretDataPromises.has(secret)) {
|
|
361
|
+
secretDataPromises.set(secret, {
|
|
362
|
+
pending: Promise.resolve(this.#getPendingIndexesForJob(jobId).get(secret) ?? []),
|
|
363
|
+
finalized: Promise.resolve(this.#getLastFinalizedIndexesForJob(jobId).get(secret)),
|
|
364
|
+
});
|
|
305
365
|
}
|
|
366
|
+
}
|
|
306
367
|
|
|
307
|
-
|
|
308
|
-
|
|
368
|
+
// Await all reads together
|
|
369
|
+
const secrets = [...secretDataPromises.keys()];
|
|
370
|
+
const dataResults = await Promise.all(
|
|
371
|
+
secrets.map(async secret => ({
|
|
372
|
+
secret,
|
|
373
|
+
pendingData: await secretDataPromises.get(secret)!.pending,
|
|
374
|
+
lastFinalized: await secretDataPromises.get(secret)!.finalized,
|
|
375
|
+
})),
|
|
376
|
+
);
|
|
377
|
+
|
|
378
|
+
// Process all txHashes for each secret in memory
|
|
379
|
+
for (const { secret, pendingData, lastFinalized } of dataResults) {
|
|
380
|
+
if (!pendingData || pendingData.length === 0) {
|
|
309
381
|
continue;
|
|
310
382
|
}
|
|
311
383
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
384
|
+
let currentPending = pendingData;
|
|
385
|
+
let currentFinalized = lastFinalized;
|
|
386
|
+
|
|
387
|
+
// Process all txHashes for this secret
|
|
388
|
+
for (const txHashStr of txHashStrings) {
|
|
389
|
+
const matchingIndexes = currentPending.filter(item => item.txHash === txHashStr).map(item => item.index);
|
|
390
|
+
if (matchingIndexes.length === 0) {
|
|
391
|
+
continue;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
if (matchingIndexes.length > 1) {
|
|
395
|
+
// We should always just store the highest pending index for a given tx hash and secret because the lower
|
|
396
|
+
// values are irrelevant.
|
|
397
|
+
throw new Error(`Multiple pending indexes found for tx hash ${txHashStr} and secret ${secret}`);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
const newFinalized = matchingIndexes[0];
|
|
401
|
+
|
|
402
|
+
if (newFinalized < (currentFinalized ?? 0)) {
|
|
403
|
+
// This should never happen because when last finalized index was finalized we should have pruned the lower
|
|
404
|
+
// pending indexes.
|
|
405
|
+
throw new Error(
|
|
406
|
+
`New finalized index ${newFinalized} is smaller than the current last finalized index ${currentFinalized}`,
|
|
407
|
+
);
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
currentFinalized = newFinalized;
|
|
411
|
+
|
|
412
|
+
// When we add pending indexes, we ensure they are higher than the last finalized index. However, because we
|
|
413
|
+
// cannot control the order in which transactions are finalized, there may be pending indexes that are now
|
|
414
|
+
// obsolete because they are lower than the most recently finalized index. For this reason, we prune these
|
|
415
|
+
// outdated pending indexes.
|
|
416
|
+
currentPending = currentPending.filter(item => item.index > currentFinalized!);
|
|
316
417
|
}
|
|
317
418
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
if (newFinalized < (lastFinalized ?? 0)) {
|
|
322
|
-
// This should never happen because when last finalized index was finalized we should have pruned the lower
|
|
323
|
-
// pending indexes.
|
|
324
|
-
throw new Error(
|
|
325
|
-
`New finalized index ${newFinalized} is smaller than the current last finalized index ${lastFinalized}`,
|
|
326
|
-
);
|
|
419
|
+
// Write final state if changed
|
|
420
|
+
if (currentFinalized !== lastFinalized) {
|
|
421
|
+
this.#writeLastFinalizedIndex(jobId, secret, currentFinalized!);
|
|
327
422
|
}
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
lastFinalized = newFinalized;
|
|
331
|
-
|
|
332
|
-
// When we add pending indexes, we ensure they are higher than the last finalized index. However, because we
|
|
333
|
-
// cannot control the order in which transactions are finalized, there may be pending indexes that are now
|
|
334
|
-
// obsolete because they are lower than the most recently finalized index. For this reason, we prune these
|
|
335
|
-
// outdated pending indexes.
|
|
336
|
-
const remainingItemsOfHigherIndex = pendingData.filter(item => item.index > (lastFinalized ?? 0));
|
|
337
|
-
if (remainingItemsOfHigherIndex.length === 0) {
|
|
338
|
-
this.#writePendingIndexes(jobId, secret, []);
|
|
339
|
-
} else {
|
|
340
|
-
this.#writePendingIndexes(jobId, secret, remainingItemsOfHigherIndex);
|
|
423
|
+
if (currentPending !== pendingData) {
|
|
424
|
+
this.#writePendingIndexes(jobId, secret, currentPending);
|
|
341
425
|
}
|
|
342
426
|
}
|
|
343
|
-
}
|
|
427
|
+
});
|
|
344
428
|
}
|
|
345
429
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
2
|
import type { BlockHash } from '@aztec/stdlib/block';
|
|
3
|
-
import { MAX_LOGS_PER_TAG } from '@aztec/stdlib/interfaces/api-limit';
|
|
3
|
+
import { MAX_LOGS_PER_TAG, MAX_RPC_LEN } from '@aztec/stdlib/interfaces/api-limit';
|
|
4
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import type { SiloedTag, Tag, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
6
6
|
|
|
@@ -31,6 +31,26 @@ async function getAllPages<T>(numTags: number, fetchPage: (page: number) => Prom
|
|
|
31
31
|
return allResultsPerTag;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
/**
|
|
35
|
+
* Splits tags into chunks of MAX_RPC_LEN, fetches logs for each chunk using getAllPages, then stitches the results
|
|
36
|
+
* back into a single array preserving the original tag order.
|
|
37
|
+
*/
|
|
38
|
+
async function getAllPagesInBatches<Tag, T>(
|
|
39
|
+
tags: Tag[],
|
|
40
|
+
fetchAllPagesForBatch: (batch: Tag[]) => Promise<T[][]>,
|
|
41
|
+
): Promise<T[][]> {
|
|
42
|
+
if (tags.length <= MAX_RPC_LEN) {
|
|
43
|
+
return fetchAllPagesForBatch(tags);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const batches: Tag[][] = [];
|
|
47
|
+
for (let i = 0; i < tags.length; i += MAX_RPC_LEN) {
|
|
48
|
+
batches.push(tags.slice(i, i + MAX_RPC_LEN));
|
|
49
|
+
}
|
|
50
|
+
const batchResults = await Promise.all(batches.map(fetchAllPagesForBatch));
|
|
51
|
+
return batchResults.flat();
|
|
52
|
+
}
|
|
53
|
+
|
|
34
54
|
/**
|
|
35
55
|
* Fetches all private logs for the given tags, automatically paginating through all pages.
|
|
36
56
|
* @param aztecNode - The Aztec node to query.
|
|
@@ -44,7 +64,9 @@ export function getAllPrivateLogsByTags(
|
|
|
44
64
|
tags: SiloedTag[],
|
|
45
65
|
anchorBlockHash: BlockHash,
|
|
46
66
|
): Promise<TxScopedL2Log[][]> {
|
|
47
|
-
return
|
|
67
|
+
return getAllPagesInBatches(tags, batch =>
|
|
68
|
+
getAllPages(batch.length, page => aztecNode.getPrivateLogsByTags(batch, page, anchorBlockHash)),
|
|
69
|
+
);
|
|
48
70
|
}
|
|
49
71
|
|
|
50
72
|
/**
|
|
@@ -62,7 +84,9 @@ export function getAllPublicLogsByTagsFromContract(
|
|
|
62
84
|
tags: Tag[],
|
|
63
85
|
anchorBlockHash: BlockHash,
|
|
64
86
|
): Promise<TxScopedL2Log[][]> {
|
|
65
|
-
return
|
|
66
|
-
|
|
87
|
+
return getAllPagesInBatches(tags, batch =>
|
|
88
|
+
getAllPages(batch.length, page =>
|
|
89
|
+
aztecNode.getPublicLogsByTagsFromContract(contractAddress, batch, page, anchorBlockHash),
|
|
90
|
+
),
|
|
67
91
|
);
|
|
68
92
|
}
|
|
@@ -30,7 +30,7 @@ export async function loadPrivateLogsForSenderRecipientPair(
|
|
|
30
30
|
// (highestAgedIndex, highestFinalizedIndex + WINDOW_LEN]
|
|
31
31
|
//
|
|
32
32
|
// highestAgedIndex is the highest index that was used in a tx that is included in a block at least
|
|
33
|
-
// `
|
|
33
|
+
// `MAX_TX_LIFETIME` seconds ago.
|
|
34
34
|
// highestFinalizedIndex is the highest index that was used in a tx that is included in a finalized block.
|
|
35
35
|
//
|
|
36
36
|
// "(" denotes an open end of the range - the index is not included in the range.
|
|
@@ -42,19 +42,19 @@ export async function loadPrivateLogsForSenderRecipientPair(
|
|
|
42
42
|
// ever appear.
|
|
43
43
|
//
|
|
44
44
|
// This relies on the "maximum inclusion timestamp" rule enforced by the kernel and rollup circuits:
|
|
45
|
-
// - a transaction's maximum inclusion timestamp is at most `
|
|
45
|
+
// - a transaction's maximum inclusion timestamp is at most `MAX_TX_LIFETIME` seconds after
|
|
46
46
|
// the timestamp of its anchor block; and
|
|
47
47
|
// - a rollup only includes transactions whose inclusion timestamp is >= the L2 block's timestamp.
|
|
48
48
|
//
|
|
49
49
|
// Suppose some device used index `I` in a transaction anchored to block `B_N` at time `N`, and that block is now at
|
|
50
|
-
// least `
|
|
50
|
+
// least `MAX_TX_LIFETIME` seconds in the past. Then there is no possibility of any *other* device
|
|
51
51
|
// trying to use an index <= `I` while anchoring to a *newer* block than `B_N` because if we were anchoring to
|
|
52
52
|
// a newer block than `B_N` then we would already have seen the log with index `I` and hence the device would have
|
|
53
53
|
// chosen a larger index.
|
|
54
54
|
// If that *other* device would anchor to a block older than `B_N` then that tx could never be included in a block
|
|
55
55
|
// because it would already have been expired.
|
|
56
56
|
//
|
|
57
|
-
// Therefore, once we see that index `I` has been used in a block that is at least `
|
|
57
|
+
// Therefore, once we see that index `I` has been used in a block that is at least `MAX_TX_LIFETIME`
|
|
58
58
|
// seconds old, we can safely stop syncing logs for all indexes <= `I` and set highestAgedIndex = `I`.
|
|
59
59
|
//
|
|
60
60
|
// ## Explanation of the upper bound `highestFinalizedIndex + WINDOW_LEN`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { MAX_TX_LIFETIME } from '@aztec/constants';
|
|
2
2
|
import type { TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -16,7 +16,7 @@ export function findHighestIndexes(
|
|
|
16
16
|
const ageInSeconds = currentTimestamp - log.blockTimestamp;
|
|
17
17
|
|
|
18
18
|
if (
|
|
19
|
-
ageInSeconds >= BigInt(
|
|
19
|
+
ageInSeconds >= BigInt(MAX_TX_LIFETIME) &&
|
|
20
20
|
(highestAgedIndex === undefined || taggingIndex > highestAgedIndex)
|
|
21
21
|
) {
|
|
22
22
|
highestAgedIndex = taggingIndex;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import type { FunctionCall, FunctionSelector } from '@aztec/stdlib/abi';
|
|
2
|
-
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
-
import type { ContractInstance } from '@aztec/stdlib/contract';
|
|
4
|
-
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
|
-
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
6
|
-
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
7
|
-
/**
|
|
8
|
-
* Read the current class id of a contract from the execution data provider or AztecNode. If not found, class id
|
|
9
|
-
* from the instance is used.
|
|
10
|
-
* @param contractAddress - The address of the contract to read the class id for.
|
|
11
|
-
* @param instance - The instance of the contract.
|
|
12
|
-
* @param aztecNode - The Aztec node to query for storage.
|
|
13
|
-
* @param header - The header of the block at which to load the DelayedPublicMutable storing the class id.
|
|
14
|
-
* @returns The current class id.
|
|
15
|
-
*/
|
|
16
|
-
export declare function readCurrentClassId(contractAddress: AztecAddress, instance: ContractInstance, aztecNode: AztecNode, header: BlockHeader): Promise<import("@aztec/foundation/schemas").Fr>;
|
|
17
|
-
export declare function syncState(contractAddress: AztecAddress, contractStore: ContractStore, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (privateSyncCall: FunctionCall) => Promise<any>): Promise<any>;
|
|
18
|
-
/**
|
|
19
|
-
* Ensures the contract's private state is synchronized and that the PXE holds the current class artifact for
|
|
20
|
-
* the contract.
|
|
21
|
-
*/
|
|
22
|
-
export declare function ensureContractSynced(contractAddress: AztecAddress, functionToInvokeAfterSync: FunctionSelector | null, utilityExecutor: (call: FunctionCall) => Promise<any>, aztecNode: AztecNode, contractStore: ContractStore, header: BlockHeader): Promise<void>;
|
|
23
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb250cmFjdF9zeW5jL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ3hFLE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFL0QsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFcEQsT0FBTyxLQUFLLEVBQUUsYUFBYSxFQUFFLE1BQU0sNkNBQTZDLENBQUM7QUFFakY7Ozs7Ozs7O0dBUUc7QUFDSCx3QkFBc0Isa0JBQWtCLENBQ3RDLGVBQWUsRUFBRSxZQUFZLEVBQzdCLFFBQVEsRUFBRSxnQkFBZ0IsRUFDMUIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsTUFBTSxFQUFFLFdBQVcsbURBYXBCO0FBRUQsd0JBQXNCLFNBQVMsQ0FDN0IsZUFBZSxFQUFFLFlBQVksRUFDN0IsYUFBYSxFQUFFLGFBQWEsRUFDNUIseUJBQXlCLEVBQUUsZ0JBQWdCLEdBQUcsSUFBSSxFQUNsRCxlQUFlLEVBQUUsQ0FBQyxlQUFlLEVBQUUsWUFBWSxLQUFLLE9BQU8sQ0FBQyxHQUFHLENBQUMsZ0JBYWpFO0FBMEJEOzs7R0FHRztBQUNILHdCQUFzQixvQkFBb0IsQ0FDeEMsZUFBZSxFQUFFLFlBQVksRUFDN0IseUJBQXlCLEVBQUUsZ0JBQWdCLEdBQUcsSUFBSSxFQUNsRCxlQUFlLEVBQUUsQ0FBQyxJQUFJLEVBQUUsWUFBWSxLQUFLLE9BQU8sQ0FBQyxHQUFHLENBQUMsRUFDckQsU0FBUyxFQUFFLFNBQVMsRUFDcEIsYUFBYSxFQUFFLGFBQWEsRUFDNUIsTUFBTSxFQUFFLFdBQVcsR0FDbEIsT0FBTyxDQUFDLElBQUksQ0FBQyxDQUtmIn0=
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/contract_sync/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6CAA6C,CAAC;AAEjF;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,WAAW,mDAapB;AAED,wBAAsB,SAAS,CAC7B,eAAe,EAAE,YAAY,EAC7B,aAAa,EAAE,aAAa,EAC5B,yBAAyB,EAAE,gBAAgB,GAAG,IAAI,EAClD,eAAe,EAAE,CAAC,eAAe,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,CAAC,gBAajE;AA0BD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,eAAe,EAAE,YAAY,EAC7B,yBAAyB,EAAE,gBAAgB,GAAG,IAAI,EAClD,eAAe,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,CAAC,GAAG,CAAC,EACrD,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { PrivateKernelCircuitPublicInputs } from '@aztec/stdlib/kernel';
|
|
2
|
-
import type { UInt64 } from '@aztec/stdlib/types';
|
|
3
|
-
export declare function computeTxIncludeByTimestamp(previousKernel: PrivateKernelCircuitPublicInputs, maxDuration?: number): UInt64;
|
|
4
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tcHV0ZV90eF9pbmNsdWRlX2J5X3RpbWVzdGFtcC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL2hpbnRzL2NvbXB1dGVfdHhfaW5jbHVkZV9ieV90aW1lc3RhbXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQ0EsT0FBTyxLQUFLLEVBQUUsZ0NBQWdDLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUM3RSxPQUFPLEtBQUssRUFBRSxNQUFNLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQXFCbEQsd0JBQWdCLDJCQUEyQixDQUN6QyxjQUFjLEVBQUUsZ0NBQWdDLEVBQ2hELFdBQVcsU0FBb0MsR0FDOUMsTUFBTSxDQStCUiJ9
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"compute_tx_include_by_timestamp.d.ts","sourceRoot":"","sources":["../../../src/private_kernel/hints/compute_tx_include_by_timestamp.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAqBlD,wBAAgB,2BAA2B,CACzC,cAAc,EAAE,gCAAgC,EAChD,WAAW,SAAoC,GAC9C,MAAM,CA+BR"}
|