@aztec/pxe 0.0.1-commit.3100065 → 0.0.1-commit.330febf
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/bin/check_oracle_version.js +5 -46
- package/dest/bin/index.d.ts +2 -2
- package/dest/bin/index.d.ts.map +1 -1
- package/dest/bin/index.js +1 -1
- package/dest/bin/oracle_version_helpers.d.ts +8 -39
- package/dest/bin/oracle_version_helpers.d.ts.map +1 -1
- package/dest/bin/oracle_version_helpers.js +10 -239
- package/dest/block_synchronizer/block_synchronizer.d.ts +3 -5
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +5 -18
- package/dest/config/package_info.js +1 -1
- package/dest/contract/contract_class_service.d.ts +1 -8
- package/dest/contract/contract_class_service.d.ts.map +1 -1
- package/dest/contract/contract_class_service.js +8 -40
- package/dest/contract/helpers.d.ts +1 -1
- package/dest/contract/helpers.d.ts.map +1 -1
- package/dest/contract/helpers.js +3 -3
- package/dest/contract/skip_sync_contracts.d.ts +11 -0
- package/dest/contract/skip_sync_contracts.d.ts.map +1 -0
- package/dest/contract/skip_sync_contracts.js +18 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +1 -8
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +5 -20
- package/dest/contract_function_simulator/index.d.ts +3 -3
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -2
- package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts +7 -9
- package/dest/contract_function_simulator/noir-structs/resolved_tx.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/resolved_tx.js +3 -44
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts +5 -4
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/tx_effect_data.js +2 -2
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts +4 -3
- package/dest/contract_function_simulator/oracle/oracle_registry.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_registry.js +15 -6
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts +87 -35
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle_type_mappings.js +297 -287
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +11 -8
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +15 -4
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +168 -53
- package/dest/entrypoints/client/bundle/index.d.ts +2 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +1 -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 +10 -4
- package/dest/entrypoints/client/lazy/index.d.ts +2 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +1 -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 +10 -4
- package/dest/entrypoints/client/store.d.ts +14 -0
- package/dest/entrypoints/client/store.d.ts.map +1 -0
- package/dest/entrypoints/client/store.js +42 -0
- 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/store.d.ts +18 -0
- package/dest/entrypoints/server/store.d.ts.map +1 -0
- package/dest/entrypoints/server/store.js +28 -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 +8 -2
- package/dest/events/event_service.d.ts +13 -6
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +13 -13
- package/dest/logs/log_service.d.ts +15 -6
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +25 -32
- package/dest/messages/tx_resolver_service.d.ts +18 -7
- package/dest/messages/tx_resolver_service.d.ts.map +1 -1
- package/dest/messages/tx_resolver_service.js +13 -7
- package/dest/node/benchmarked_node.d.ts +20 -0
- package/dest/node/benchmarked_node.d.ts.map +1 -0
- package/dest/node/benchmarked_node.js +94 -0
- package/dest/node/caching_aztec_node.d.ts +24 -0
- package/dest/node/caching_aztec_node.d.ts.map +1 -0
- package/dest/node/caching_aztec_node.js +267 -0
- package/dest/notes/note_service.d.ts +13 -7
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +10 -10
- package/dest/oracle_version.d.ts +2 -2
- package/dest/oracle_version.js +5 -5
- package/dest/private_kernel/batch_planner.d.ts +1 -1
- package/dest/private_kernel/batch_planner.d.ts.map +1 -1
- package/dest/private_kernel/batch_planner.js +1 -1
- 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 +45 -5
- package/dest/pxe.d.ts +1 -1
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +39 -19
- 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 +2 -2
- package/dest/storage/fact_store/fact_store.d.ts +1 -1
- package/dest/storage/fact_store/fact_store.js +1 -1
- package/dest/storage/fact_store/index.d.ts +2 -2
- package/dest/storage/fact_store/index.d.ts.map +1 -1
- package/dest/storage/fact_store/index.js +1 -1
- package/dest/storage/fact_store/origin_state.d.ts +4 -2
- package/dest/storage/fact_store/origin_state.d.ts.map +1 -1
- package/dest/storage/fact_store/origin_state.js +8 -1
- package/dest/storage/store_identity.d.ts +35 -0
- package/dest/storage/store_identity.d.ts.map +1 -0
- package/dest/storage/store_identity.js +44 -0
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +41 -10
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +81 -29
- package/dest/tagging/constants.d.ts +10 -1
- package/dest/tagging/constants.d.ts.map +1 -1
- package/dest/tagging/constants.js +19 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts +29 -8
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
- package/dest/tagging/get_all_logs_by_tags.js +29 -10
- package/dest/tagging/index.d.ts +3 -3
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +2 -2
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts +10 -5
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/sync_tagged_private_logs.js +69 -38
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +6 -3
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +23 -38
- package/dest/tagging/sender_sync/utils/classify_pending_txs.d.ts +22 -0
- package/dest/tagging/sender_sync/utils/classify_pending_txs.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/classify_pending_txs.js +61 -0
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +15 -5
- 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 +36 -35
- package/dest/tagging/sender_sync/utils/resolve_pending_txs.d.ts +29 -0
- package/dest/tagging/sender_sync/utils/resolve_pending_txs.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/resolve_pending_txs.js +41 -0
- package/dest/tagging/sender_sync/utils/test_utils.d.ts +16 -0
- package/dest/tagging/sender_sync/utils/test_utils.d.ts.map +1 -0
- package/dest/tagging/sender_sync/utils/test_utils.js +24 -0
- package/dest/tagging/testing/tag_query_test_utils.d.ts +6 -0
- package/dest/tagging/testing/tag_query_test_utils.d.ts.map +1 -0
- package/dest/tagging/testing/tag_query_test_utils.js +10 -0
- package/package.json +17 -17
- package/src/bin/check_oracle_version.ts +5 -56
- package/src/bin/index.ts +1 -5
- package/src/bin/oracle_version_helpers.ts +11 -292
- package/src/block_synchronizer/block_synchronizer.ts +6 -23
- package/src/config/package_info.ts +1 -1
- package/src/contract/contract_class_service.ts +8 -46
- package/src/contract/helpers.ts +3 -3
- package/src/contract/skip_sync_contracts.ts +23 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +5 -20
- package/src/contract_function_simulator/index.ts +23 -3
- package/src/contract_function_simulator/noir-structs/resolved_tx.ts +11 -45
- package/src/contract_function_simulator/noir-structs/tx_effect_data.ts +4 -3
- package/src/contract_function_simulator/oracle/oracle_registry.ts +12 -8
- package/src/contract_function_simulator/oracle/oracle_type_mappings.ts +301 -198
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +19 -9
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +184 -56
- package/src/entrypoints/client/bundle/index.ts +1 -0
- package/src/entrypoints/client/bundle/utils.ts +15 -3
- package/src/entrypoints/client/lazy/index.ts +1 -0
- package/src/entrypoints/client/lazy/utils.ts +15 -3
- package/src/entrypoints/client/store.ts +54 -0
- package/src/entrypoints/server/index.ts +1 -0
- package/src/entrypoints/server/store.ts +47 -0
- package/src/entrypoints/server/utils.ts +21 -7
- package/src/events/event_service.ts +24 -14
- package/src/logs/log_service.ts +41 -39
- package/src/messages/tx_resolver_service.ts +26 -15
- package/src/node/benchmarked_node.ts +140 -0
- package/src/node/caching_aztec_node.ts +406 -0
- package/src/notes/note_service.ts +20 -14
- package/src/oracle_version.ts +5 -5
- package/src/private_kernel/batch_planner.ts +0 -1
- package/src/private_kernel/private_kernel_execution_prover.ts +90 -4
- package/src/pxe.ts +40 -21
- package/src/storage/contract_store/contract_store.ts +2 -1
- package/src/storage/fact_store/fact_store.ts +1 -1
- package/src/storage/fact_store/index.ts +1 -0
- package/src/storage/fact_store/origin_state.ts +10 -1
- package/src/storage/store_identity.ts +72 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +113 -41
- package/src/tagging/constants.ts +22 -0
- package/src/tagging/get_all_logs_by_tags.ts +47 -11
- package/src/tagging/index.ts +7 -2
- package/src/tagging/recipient_sync/sync_tagged_private_logs.ts +116 -62
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +27 -57
- package/src/tagging/sender_sync/utils/classify_pending_txs.ts +91 -0
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +46 -40
- package/src/tagging/sender_sync/utils/resolve_pending_txs.ts +64 -0
- package/src/tagging/sender_sync/utils/test_utils.ts +46 -0
- package/src/tagging/testing/tag_query_test_utils.ts +11 -0
- package/dest/contract_function_simulator/aztec_node_read_cache.d.ts +0 -39
- package/dest/contract_function_simulator/aztec_node_read_cache.d.ts.map +0 -1
- package/dest/contract_function_simulator/aztec_node_read_cache.js +0 -60
- package/dest/contract_function_simulator/benchmarked_node.d.ts +0 -9
- package/dest/contract_function_simulator/benchmarked_node.d.ts.map +0 -1
- package/dest/contract_function_simulator/benchmarked_node.js +0 -77
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +0 -17
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +0 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +0 -60
- package/src/contract_function_simulator/aztec_node_read_cache.ts +0 -89
- package/src/contract_function_simulator/benchmarked_node.ts +0 -103
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +0 -66
|
@@ -1,8 +1,29 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
import type { BlockHash } from '@aztec/stdlib/block';
|
|
4
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
5
5
|
import { type LogResult, type SiloedTag, type Tag } from '@aztec/stdlib/logs';
|
|
6
|
+
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
7
|
+
/**
|
|
8
|
+
* The block a tag query is anchored to.
|
|
9
|
+
*
|
|
10
|
+
* Both fields come from one header (see {@link logQueryAnchorOf}), which is what keeps the bound and the reorg check
|
|
11
|
+
* talking about the same block.
|
|
12
|
+
*/
|
|
13
|
+
export type LogQueryAnchor = {
|
|
14
|
+
/**
|
|
15
|
+
* Hash of the anchor block, naming the chain the query must be answered on: the node throws if that block is gone,
|
|
16
|
+
* which is how a reorg surfaces.
|
|
17
|
+
*/
|
|
18
|
+
hash: BlockHash;
|
|
19
|
+
/** Height of the anchor block, bounding the query to blocks at or below it. */
|
|
20
|
+
number: BlockNumber;
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* The {@link LogQueryAnchor} naming `anchorBlockHeader`: its hash and its height. Callers build it once and reuse
|
|
24
|
+
* it across every query anchored to that block, so the header is hashed only once.
|
|
25
|
+
*/
|
|
26
|
+
export declare function logQueryAnchorOf(anchorBlockHeader: BlockHeader): Promise<LogQueryAnchor>;
|
|
6
27
|
/** Optional block-range, effects opt-in, and pagination cap shared by both wrappers. */
|
|
7
28
|
export type GetAllLogsByTagsOptions = {
|
|
8
29
|
/** Lower block bound, inclusive. */
|
|
@@ -27,22 +48,22 @@ export type GetAllLogsByTagsOptions = {
|
|
|
27
48
|
*
|
|
28
49
|
* @param aztecNode - The Aztec node to query.
|
|
29
50
|
* @param tags - The siloed tags to search for.
|
|
30
|
-
* @param
|
|
31
|
-
* because of reorgs).
|
|
51
|
+
* @param anchor - Block the query is anchored to: results stop there, and the call throws if that block is not found
|
|
52
|
+
* (typically because of reorgs).
|
|
32
53
|
* @param options - Optional `fromBlock`/`toBlock` range and `includeEffects` opt-in.
|
|
33
54
|
* @returns An array of log arrays, one per tag, containing all logs across all pages.
|
|
34
55
|
*/
|
|
35
|
-
export declare function getAllPrivateLogsByTags<Opts extends GetAllLogsByTagsOptions = GetAllLogsByTagsOptions>(aztecNode: AztecNode, tags: SiloedTag[],
|
|
56
|
+
export declare function getAllPrivateLogsByTags<Opts extends GetAllLogsByTagsOptions = GetAllLogsByTagsOptions>(aztecNode: AztecNode, tags: SiloedTag[], anchor: LogQueryAnchor, options?: Opts): Promise<LogResult<Opts>[][]>;
|
|
36
57
|
/**
|
|
37
58
|
* Fetches all public logs for the given tags from a contract, automatically paginating per-tag via `afterLog` cursors.
|
|
38
59
|
*
|
|
39
60
|
* @param aztecNode - The Aztec node to query.
|
|
40
61
|
* @param contractAddress - The contract address to search logs for.
|
|
41
62
|
* @param tags - The tags to search for.
|
|
42
|
-
* @param
|
|
43
|
-
* because of reorgs).
|
|
63
|
+
* @param anchor - Block the query is anchored to: results stop there, and the call throws if that block is not found
|
|
64
|
+
* (typically because of reorgs).
|
|
44
65
|
* @param options - Optional `fromBlock`/`toBlock` range and `includeEffects` opt-in.
|
|
45
66
|
* @returns An array of log arrays, one per tag, containing all logs across all pages.
|
|
46
67
|
*/
|
|
47
|
-
export declare function getAllPublicLogsByTagsFromContract<Opts extends GetAllLogsByTagsOptions = GetAllLogsByTagsOptions>(aztecNode: AztecNode, contractAddress: AztecAddress, tags: Tag[],
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
68
|
+
export declare function getAllPublicLogsByTagsFromContract<Opts extends GetAllLogsByTagsOptions = GetAllLogsByTagsOptions>(aztecNode: AztecNode, contractAddress: AztecAddress, tags: Tag[], anchor: LogQueryAnchor, options?: Opts): Promise<LogResult<Opts>[][]>;
|
|
69
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X2FsbF9sb2dzX2J5X3RhZ3MuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2dldF9hbGxfbG9nc19ieV90YWdzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUM5RCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUVyRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEVBRUwsS0FBSyxTQUFTLEVBQ2QsS0FBSyxTQUFTLEVBQ2QsS0FBSyxHQUFHLEVBR1QsTUFBTSxvQkFBb0IsQ0FBQztBQUM1QixPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUVwRDs7Ozs7R0FLRztBQUNILE1BQU0sTUFBTSxjQUFjLEdBQUc7SUFDM0I7OztPQUdHO0lBQ0gsSUFBSSxFQUFFLFNBQVMsQ0FBQztJQUNoQiwrRUFBK0U7SUFDL0UsTUFBTSxFQUFFLFdBQVcsQ0FBQztDQUNyQixDQUFDO0FBRUY7OztHQUdHO0FBQ0gsd0JBQXNCLGdCQUFnQixDQUFDLGlCQUFpQixFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMsY0FBYyxDQUFDLENBRTlGO0FBRUQsd0ZBQXdGO0FBQ3hGLE1BQU0sTUFBTSx1QkFBdUIsR0FBRztJQUNwQyxvQ0FBb0M7SUFDcEMsU0FBUyxDQUFDLEVBQUUsV0FBVyxDQUFDO0lBQ3hCLG9DQUFvQztJQUNwQyxPQUFPLENBQUMsRUFBRSxXQUFXLENBQUM7SUFDdEI7Ozs7T0FJRztJQUNILGNBQWMsQ0FBQyxFQUFFLE9BQU8sQ0FBQztJQUN6Qjs7OztPQUlHO0lBQ0gsV0FBVyxDQUFDLEVBQUUsTUFBTSxDQUFDO0NBQ3RCLENBQUM7QUEwQkY7Ozs7Ozs7OztHQVNHO0FBQ0gsd0JBQWdCLHVCQUF1QixDQUFDLElBQUksU0FBUyx1QkFBdUIsR0FBRyx1QkFBdUIsRUFDcEcsU0FBUyxFQUFFLFNBQVMsRUFDcEIsSUFBSSxFQUFFLFNBQVMsRUFBRSxFQUNqQixNQUFNLEVBQUUsY0FBYyxFQUN0QixPQUFPLEdBQUUsSUFBaUIsR0FDekIsT0FBTyxDQUFDLFNBQVMsQ0FBQyxJQUFJLENBQUMsRUFBRSxFQUFFLENBQUMsQ0FhOUI7QUFFRDs7Ozs7Ozs7OztHQVVHO0FBQ0gsd0JBQWdCLGtDQUFrQyxDQUFDLElBQUksU0FBUyx1QkFBdUIsR0FBRyx1QkFBdUIsRUFDL0csU0FBUyxFQUFFLFNBQVMsRUFDcEIsZUFBZSxFQUFFLFlBQVksRUFDN0IsSUFBSSxFQUFFLEdBQUcsRUFBRSxFQUNYLE1BQU0sRUFBRSxjQUFjLEVBQ3RCLE9BQU8sR0FBRSxJQUFpQixHQUN6QixPQUFPLENBQUMsU0FBUyxDQUFDLElBQUksQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQWM5QiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get_all_logs_by_tags.d.ts","sourceRoot":"","sources":["../../src/tagging/get_all_logs_by_tags.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"get_all_logs_by_tags.d.ts","sourceRoot":"","sources":["../../src/tagging/get_all_logs_by_tags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAErD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,GAAG,EAGT,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B;;;OAGG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,+EAA+E;IAC/E,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,gBAAgB,CAAC,iBAAiB,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC,CAE9F;AAED,wFAAwF;AACxF,MAAM,MAAM,uBAAuB,GAAG;IACpC,oCAAoC;IACpC,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,oCAAoC;IACpC,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;;OAIG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AA0BF;;;;;;;;;GASG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,SAAS,uBAAuB,GAAG,uBAAuB,EACpG,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,SAAS,EAAE,EACjB,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,IAAiB,GACzB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAa9B;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,kCAAkC,CAAC,IAAI,SAAS,uBAAuB,GAAG,uBAAuB,EAC/G,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,YAAY,EAC7B,IAAI,EAAE,GAAG,EAAE,EACX,MAAM,EAAE,cAAc,EACtB,OAAO,GAAE,IAAiB,GACzB,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAc9B"}
|
|
@@ -1,5 +1,15 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { MAX_RPC_LEN } from '@aztec/stdlib/interfaces/api-limit';
|
|
2
3
|
import { queryAllPrivateLogsByTags, queryAllPublicLogsByTags } from '@aztec/stdlib/logs';
|
|
4
|
+
/**
|
|
5
|
+
* The {@link LogQueryAnchor} naming `anchorBlockHeader`: its hash and its height. Callers build it once and reuse
|
|
6
|
+
* it across every query anchored to that block, so the header is hashed only once.
|
|
7
|
+
*/ export async function logQueryAnchorOf(anchorBlockHeader) {
|
|
8
|
+
return {
|
|
9
|
+
hash: await anchorBlockHeader.hash(),
|
|
10
|
+
number: anchorBlockHeader.getBlockNumber()
|
|
11
|
+
};
|
|
12
|
+
}
|
|
3
13
|
/**
|
|
4
14
|
* Splits tags into chunks of MAX_RPC_LEN, paginates each chunk via the stdlib per-tag cursor helper,
|
|
5
15
|
* then stitches the results back into a single array preserving the original tag order.
|
|
@@ -22,16 +32,16 @@ import { queryAllPrivateLogsByTags, queryAllPublicLogsByTags } from '@aztec/stdl
|
|
|
22
32
|
*
|
|
23
33
|
* @param aztecNode - The Aztec node to query.
|
|
24
34
|
* @param tags - The siloed tags to search for.
|
|
25
|
-
* @param
|
|
26
|
-
* because of reorgs).
|
|
35
|
+
* @param anchor - Block the query is anchored to: results stop there, and the call throws if that block is not found
|
|
36
|
+
* (typically because of reorgs).
|
|
27
37
|
* @param options - Optional `fromBlock`/`toBlock` range and `includeEffects` opt-in.
|
|
28
38
|
* @returns An array of log arrays, one per tag, containing all logs across all pages.
|
|
29
|
-
*/ export function getAllPrivateLogsByTags(aztecNode, tags,
|
|
39
|
+
*/ export function getAllPrivateLogsByTags(aztecNode, tags, anchor, options = {}) {
|
|
30
40
|
return getAllPagesInBatches(tags, (batch)=>queryAllPrivateLogsByTags(aztecNode, {
|
|
31
41
|
tags: batch,
|
|
32
|
-
referenceBlock:
|
|
42
|
+
referenceBlock: anchor.hash,
|
|
33
43
|
fromBlock: options.fromBlock,
|
|
34
|
-
toBlock: options.toBlock,
|
|
44
|
+
toBlock: exclusiveUpperBound(anchor, options.toBlock),
|
|
35
45
|
includeEffects: options.includeEffects ?? false,
|
|
36
46
|
limitPerTag: options.limitPerTag
|
|
37
47
|
}));
|
|
@@ -42,18 +52,27 @@ import { queryAllPrivateLogsByTags, queryAllPublicLogsByTags } from '@aztec/stdl
|
|
|
42
52
|
* @param aztecNode - The Aztec node to query.
|
|
43
53
|
* @param contractAddress - The contract address to search logs for.
|
|
44
54
|
* @param tags - The tags to search for.
|
|
45
|
-
* @param
|
|
46
|
-
* because of reorgs).
|
|
55
|
+
* @param anchor - Block the query is anchored to: results stop there, and the call throws if that block is not found
|
|
56
|
+
* (typically because of reorgs).
|
|
47
57
|
* @param options - Optional `fromBlock`/`toBlock` range and `includeEffects` opt-in.
|
|
48
58
|
* @returns An array of log arrays, one per tag, containing all logs across all pages.
|
|
49
|
-
*/ export function getAllPublicLogsByTagsFromContract(aztecNode, contractAddress, tags,
|
|
59
|
+
*/ export function getAllPublicLogsByTagsFromContract(aztecNode, contractAddress, tags, anchor, options = {}) {
|
|
50
60
|
return getAllPagesInBatches(tags, (batch)=>queryAllPublicLogsByTags(aztecNode, {
|
|
51
61
|
contractAddress,
|
|
52
62
|
tags: batch,
|
|
53
|
-
referenceBlock:
|
|
63
|
+
referenceBlock: anchor.hash,
|
|
54
64
|
fromBlock: options.fromBlock,
|
|
55
|
-
toBlock: options.toBlock,
|
|
65
|
+
toBlock: exclusiveUpperBound(anchor, options.toBlock),
|
|
56
66
|
includeEffects: options.includeEffects ?? false,
|
|
57
67
|
limitPerTag: options.limitPerTag
|
|
58
68
|
}));
|
|
59
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Exclusive upper block bound for a query anchored at `anchor`: one past the anchor block, or the caller's own
|
|
72
|
+
* `toBlock` when that is tighter.
|
|
73
|
+
*
|
|
74
|
+
* The bound is spelled out in the request rather than left implicit in `referenceBlock`, so the request itself
|
|
75
|
+
* names a fixed block range that no later block can widen.
|
|
76
|
+
*/ function exclusiveUpperBound(anchor, toBlock) {
|
|
77
|
+
return BlockNumber(Math.min(toBlock ?? Infinity, anchor.number + 1));
|
|
78
|
+
}
|
package/dest/tagging/index.d.ts
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
export { syncTaggedPrivateLogs } from './recipient_sync/sync_tagged_private_logs.js';
|
|
12
12
|
export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
|
|
13
13
|
export { persistSenderTaggingIndexRangesForTx } from './persist_sender_tagging_index_ranges.js';
|
|
14
|
-
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
|
|
15
|
-
export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
|
|
14
|
+
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN, INITIAL_CONSTRAINED_PROBE_LEN } from './constants.js';
|
|
15
|
+
export { type LogQueryAnchor, getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract, logQueryAnchorOf, } from './get_all_logs_by_tags.js';
|
|
16
16
|
export { AppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
|
|
17
17
|
export { type PreTag, type TaggingIndexRange } from '@aztec/stdlib/logs';
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7R0FTRztBQUVILE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBQ3JGLE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBQ3hGLE9BQU8sRUFBRSxvQ0FBb0MsRUFBRSxNQUFNLDBDQUEwQyxDQUFDO0FBQ2hHLE9BQU8sRUFBRSxzQ0FBc0MsRUFBRSw2QkFBNkIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3ZHLE9BQU8sRUFDTCxLQUFLLGNBQWMsRUFDbkIsdUJBQXVCLEVBQ3ZCLGtDQUFrQyxFQUNsQyxnQkFBZ0IsR0FDakIsTUFBTSwyQkFBMkIsQ0FBQztBQUduQyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsR0FBRyxFQUFFLFNBQVMsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQ3RFLE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBRSxLQUFLLGlCQUFpQixFQUFFLE1BQU0sb0JBQW9CLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,oCAAoC,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,sCAAsC,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qBAAqB,EAAE,MAAM,8CAA8C,CAAC;AACrF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,oCAAoC,EAAE,MAAM,0CAA0C,CAAC;AAChG,OAAO,EAAE,sCAAsC,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAC;AACvG,OAAO,EACL,KAAK,cAAc,EACnB,uBAAuB,EACvB,kCAAkC,EAClC,gBAAgB,GACjB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dest/tagging/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
*/ export { syncTaggedPrivateLogs } from './recipient_sync/sync_tagged_private_logs.js';
|
|
11
11
|
export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
|
|
12
12
|
export { persistSenderTaggingIndexRangesForTx } from './persist_sender_tagging_index_ranges.js';
|
|
13
|
-
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
|
|
14
|
-
export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
|
|
13
|
+
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN, INITIAL_CONSTRAINED_PROBE_LEN } from './constants.js';
|
|
14
|
+
export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract, logQueryAnchorOf } from './get_all_logs_by_tags.js';
|
|
15
15
|
// Re-export tagging-related types from stdlib
|
|
16
16
|
export { AppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
3
3
|
import type { AppTaggingSecret, LogResult } from '@aztec/stdlib/logs';
|
|
4
4
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
@@ -54,9 +54,14 @@ import type { RecipientTaggingStore } from '../../storage/tagging_store/recipien
|
|
|
54
54
|
* - The lower bound is `highestFinalizedIndex + 1`. The `highestAgedIndex` mechanism is unnecessary because
|
|
55
55
|
* the nullifier chain prevents out-of-order index usage: no device can fill in a lower index after a higher
|
|
56
56
|
* one is already on-chain.
|
|
57
|
-
* -
|
|
58
|
-
*
|
|
59
|
-
*
|
|
57
|
+
* - Because the sequence is gapless, the scan stops at the first missing index: that gap proves the sequence has
|
|
58
|
+
* ended and no further logs exist. We exploit this with a doubling first-miss probe (see
|
|
59
|
+
* `INITIAL_CONSTRAINED_PROBE_LEN` in ../constants.ts), so a
|
|
60
|
+
* steady-state sync with no new logs costs two tags instead of the whole window. The probe length is in-memory
|
|
61
|
+
* state scoped to one sync call, so every sync restarts at the initial probe.
|
|
62
|
+
* - The upper bound is the same as unconstrained: `highestFinalizedIndex + WINDOW_LEN`. Advancing the probe is
|
|
63
|
+
* decoupled from persisting the finalized index, so unfinalized logs at the top of the run are still fetched
|
|
64
|
+
* while only the finalized prefix is persisted.
|
|
60
65
|
*
|
|
61
66
|
* # Batching across secrets
|
|
62
67
|
*
|
|
@@ -66,4 +71,4 @@ import type { RecipientTaggingStore } from '../../storage/tagging_store/recipien
|
|
|
66
71
|
* advanced are kept for the next iteration.
|
|
67
72
|
*/
|
|
68
73
|
export declare function syncTaggedPrivateLogs(secrets: AppTaggingSecret[], aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockHeader: BlockHeader, finalizedBlockNumber: BlockNumber, jobId: string): Promise<LogResult[]>;
|
|
69
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
74
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY190YWdnZWRfcHJpdmF0ZV9sb2dzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGFnZ2luZy9yZWNpcGllbnRfc3luYy9zeW5jX3RhZ2dlZF9wcml2YXRlX2xvZ3MudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFbkUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFFdEUsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFcEQsT0FBTyxLQUFLLEVBQUUscUJBQXFCLEVBQUUsTUFBTSx3REFBd0QsQ0FBQztBQVNwRzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0dBa0VHO0FBQ0gsd0JBQXNCLHFCQUFxQixDQUN6QyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsRUFDM0IsU0FBUyxFQUFFLFNBQVMsRUFDcEIsWUFBWSxFQUFFLHFCQUFxQixFQUNuQyxpQkFBaUIsRUFBRSxXQUFXLEVBQzlCLG9CQUFvQixFQUFFLFdBQVcsRUFDakMsS0FBSyxFQUFFLE1BQU0sR0FDWixPQUFPLENBQUMsU0FBUyxFQUFFLENBQUMsQ0FvRHRCIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync_tagged_private_logs.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/sync_tagged_private_logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"sync_tagged_private_logs.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/sync_tagged_private_logs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AASpG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,gBAAgB,EAAE,EAC3B,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,EAC9B,oBAAoB,EAAE,WAAW,EACjC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,SAAS,EAAE,CAAC,CAoDtB"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
1
|
import { isDefined } from '@aztec/foundation/types';
|
|
3
2
|
import { AppTaggingSecretKind, SiloedTag } from '@aztec/stdlib/logs';
|
|
4
|
-
import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../constants.js';
|
|
5
|
-
import { getAllPrivateLogsByTags } from '../get_all_logs_by_tags.js';
|
|
3
|
+
import { INITIAL_CONSTRAINED_PROBE_LEN, UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN, unfinalizedTaggingIndexesWindowEnd } from '../constants.js';
|
|
4
|
+
import { getAllPrivateLogsByTags, logQueryAnchorOf } from '../get_all_logs_by_tags.js';
|
|
6
5
|
import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
7
6
|
/**
|
|
8
7
|
* Fetches and syncs tagged private logs for multiple sender-recipient pairs, batching tag queries across all secrets
|
|
@@ -55,9 +54,14 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
55
54
|
* - The lower bound is `highestFinalizedIndex + 1`. The `highestAgedIndex` mechanism is unnecessary because
|
|
56
55
|
* the nullifier chain prevents out-of-order index usage: no device can fill in a lower index after a higher
|
|
57
56
|
* one is already on-chain.
|
|
58
|
-
* -
|
|
59
|
-
*
|
|
60
|
-
*
|
|
57
|
+
* - Because the sequence is gapless, the scan stops at the first missing index: that gap proves the sequence has
|
|
58
|
+
* ended and no further logs exist. We exploit this with a doubling first-miss probe (see
|
|
59
|
+
* `INITIAL_CONSTRAINED_PROBE_LEN` in ../constants.ts), so a
|
|
60
|
+
* steady-state sync with no new logs costs two tags instead of the whole window. The probe length is in-memory
|
|
61
|
+
* state scoped to one sync call, so every sync restarts at the initial probe.
|
|
62
|
+
* - The upper bound is the same as unconstrained: `highestFinalizedIndex + WINDOW_LEN`. Advancing the probe is
|
|
63
|
+
* decoupled from persisting the finalized index, so unfinalized logs at the top of the run are still fetched
|
|
64
|
+
* while only the finalized prefix is persisted.
|
|
61
65
|
*
|
|
62
66
|
* # Batching across secrets
|
|
63
67
|
*
|
|
@@ -69,15 +73,14 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
69
73
|
if (secrets.length === 0) {
|
|
70
74
|
return [];
|
|
71
75
|
}
|
|
72
|
-
const
|
|
73
|
-
const anchorBlockHash = await anchorBlockHeader.hash();
|
|
76
|
+
const anchor = await logQueryAnchorOf(anchorBlockHeader);
|
|
74
77
|
const currentTimestamp = anchorBlockHeader.globalVariables.timestamp;
|
|
75
78
|
// Read stored indexes from the db and compute the initial [start, end) range for each secret
|
|
76
79
|
let pending = await getIndexRangesForSecrets(secrets, taggingStore, jobId);
|
|
77
80
|
const allLogs = [];
|
|
78
81
|
while(pending.length > 0){
|
|
79
82
|
// Compute tags for all pending secrets and fetch logs in batched RPC calls
|
|
80
|
-
const logsPerSecret = await fetchLogsForSecrets(pending, aztecNode,
|
|
83
|
+
const logsPerSecret = await fetchLogsForSecrets(pending, aztecNode, anchor);
|
|
81
84
|
const nextRound = await Promise.all(pending.map(async (pendingSecret, i)=>{
|
|
82
85
|
const logsFoundWithSecret = logsPerSecret[i];
|
|
83
86
|
if (logsFoundWithSecret.length === 0) {
|
|
@@ -87,8 +90,7 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
87
90
|
allLogs.push(...logsFoundWithSecret.map(({ log })=>log));
|
|
88
91
|
// Persist new indexes. If the finalized index moved forward, the window advances
|
|
89
92
|
// and we need another round for this secret.
|
|
90
|
-
|
|
91
|
-
return await processForKind(pendingSecret, logsFoundWithSecret, taggingStore, currentTimestamp, finalizedBlockNumber, jobId);
|
|
93
|
+
return pendingSecret.kind === AppTaggingSecretKind.CONSTRAINED ? await processConstrainedResults(pendingSecret, logsFoundWithSecret, taggingStore, currentTimestamp, finalizedBlockNumber, jobId) : await processUnconstrainedResults(pendingSecret, logsFoundWithSecret, taggingStore, currentTimestamp, finalizedBlockNumber, jobId);
|
|
92
94
|
}));
|
|
93
95
|
pending = nextRound.filter(isDefined);
|
|
94
96
|
}
|
|
@@ -97,20 +99,36 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
97
99
|
/** Reads stored indexes for each secret and computes the initial index range to query. */ function getIndexRangesForSecrets(secrets, taggingStore, jobId) {
|
|
98
100
|
return Promise.all(secrets.map(async (secret)=>{
|
|
99
101
|
const currentHighestFinalizedIndex = await taggingStore.getHighestFinalizedIndex(secret, jobId);
|
|
100
|
-
const
|
|
101
|
-
|
|
102
|
-
|
|
102
|
+
const boundEnd = unfinalizedTaggingIndexesWindowEnd(currentHighestFinalizedIndex);
|
|
103
|
+
if (secret.kind === AppTaggingSecretKind.CONSTRAINED) {
|
|
104
|
+
// Constrained streams are gapless and resume at the finalized index, so probe a small initial window and stop
|
|
105
|
+
// at the first missing tag instead of always fetching the full window. The probe grows each round up to the
|
|
106
|
+
// window cap.
|
|
107
|
+
const start = currentHighestFinalizedIndex === undefined ? 0 : currentHighestFinalizedIndex + 1;
|
|
108
|
+
return {
|
|
109
|
+
kind: AppTaggingSecretKind.CONSTRAINED,
|
|
110
|
+
secret,
|
|
111
|
+
start,
|
|
112
|
+
end: Math.min(boundEnd, start + INITIAL_CONSTRAINED_PROBE_LEN),
|
|
113
|
+
boundEnd,
|
|
114
|
+
probeLen: INITIAL_CONSTRAINED_PROBE_LEN
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
// Unconstrained secrets can have gaps, so they scan the whole window starting past the highest aged index.
|
|
118
|
+
const highestAgedIndex = await taggingStore.getHighestAgedIndex(secret, jobId);
|
|
119
|
+
const start = highestAgedIndex === undefined ? 0 : highestAgedIndex + 1;
|
|
103
120
|
return {
|
|
121
|
+
kind: AppTaggingSecretKind.UNCONSTRAINED,
|
|
104
122
|
secret,
|
|
105
123
|
start,
|
|
106
|
-
end
|
|
124
|
+
end: boundEnd
|
|
107
125
|
};
|
|
108
126
|
}));
|
|
109
127
|
}
|
|
110
128
|
/**
|
|
111
129
|
* Computes siloed tags for all pending secrets' index ranges, fetches logs in one batched RPC call,
|
|
112
130
|
* and returns the results grouped back per secret.
|
|
113
|
-
*/ async function fetchLogsForSecrets(pending, aztecNode,
|
|
131
|
+
*/ async function fetchLogsForSecrets(pending, aztecNode, anchor) {
|
|
114
132
|
// Determine the index range for each secret
|
|
115
133
|
const indexesPerSecret = pending.map(({ start, end })=>Array.from({
|
|
116
134
|
length: end - start
|
|
@@ -121,13 +139,11 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
121
139
|
index
|
|
122
140
|
})))));
|
|
123
141
|
const allTags = tagsPerSecret.flat();
|
|
124
|
-
// getAllPrivateLogsByTags handles MAX_RPC_LEN chunking internally
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
includeEffects: true,
|
|
130
|
-
toBlock: BlockNumber(anchorBlockNumber + 1)
|
|
142
|
+
// getAllPrivateLogsByTags handles MAX_RPC_LEN chunking internally, and bounds the query at the anchor block so
|
|
143
|
+
// logs from later blocks are never returned. Recipient sync builds `PendingTaggedLog` from each log's note hashes
|
|
144
|
+
// and first nullifier, so we opt into effects.
|
|
145
|
+
const allResults = await getAllPrivateLogsByTags(aztecNode, allTags, anchor, {
|
|
146
|
+
includeEffects: true
|
|
131
147
|
});
|
|
132
148
|
// Split flat results back per secret using the known lengths
|
|
133
149
|
const logsPerSecret = [];
|
|
@@ -148,30 +164,43 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
148
164
|
return logsPerSecret;
|
|
149
165
|
}
|
|
150
166
|
/**
|
|
151
|
-
* Processes fetched logs for a constrained secret
|
|
152
|
-
*
|
|
167
|
+
* Processes fetched logs for a constrained secret: persists the finalized index and advances the probe. See the
|
|
168
|
+
* "# Constrained secrets" section above for why the scan stops at the first missing index. Only `highestFinalizedIndex`
|
|
153
169
|
* is tracked (no aged index).
|
|
154
170
|
*/ async function processConstrainedResults(pending, logsWithIndexes, taggingStore, currentTimestamp, finalizedBlockNumber, jobId) {
|
|
155
|
-
// Find where the contiguous run of indexes ends
|
|
156
|
-
// first gap, so all logs in the batch are within this prefix.
|
|
171
|
+
// Find where the contiguous run of indexes ends; all logs in the batch fall within this prefix.
|
|
157
172
|
const indexesWithLogs = new Set(logsWithIndexes.map((l)=>l.taggingIndex));
|
|
158
173
|
let firstMissingIndex = pending.start;
|
|
159
174
|
while(firstMissingIndex < pending.end && indexesWithLogs.has(firstMissingIndex)){
|
|
160
175
|
firstMissingIndex++;
|
|
161
176
|
}
|
|
162
|
-
//
|
|
163
|
-
// transaction, guaranteeing the log cannot disappear once included, so we persist the
|
|
164
|
-
//
|
|
177
|
+
// Persist the highest finalized index found. The nullifier for a constrained-delivery log is emitted in the same
|
|
178
|
+
// transaction, guaranteeing the log cannot disappear once included, so we persist even when a gap stops the scan.
|
|
179
|
+
// This lets the next sync round skip already-finalized indexes.
|
|
165
180
|
const { highestFinalizedIndex } = findHighestIndexes(logsWithIndexes, currentTimestamp, finalizedBlockNumber);
|
|
166
181
|
if (highestFinalizedIndex !== undefined) {
|
|
167
182
|
await taggingStore.updateHighestFinalizedIndex(pending.secret, highestFinalizedIndex, jobId);
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
183
|
+
}
|
|
184
|
+
// Advancing the probe is decoupled from persisting the finalized index: keep scanning as long as the probe was
|
|
185
|
+
// entirely hits (no gap) and there is room before the protocol bound, even if none of those hits is finalized yet.
|
|
186
|
+
// Gating this on finalization would drop logs in unfinalized blocks, which sit at the top of the contiguous run.
|
|
187
|
+
// The bound re-anchors to any finalized index found this round.
|
|
188
|
+
const probeFullyConsumed = firstMissingIndex >= pending.end;
|
|
189
|
+
const boundEnd = highestFinalizedIndex !== undefined ? Math.max(pending.boundEnd, unfinalizedTaggingIndexesWindowEnd(highestFinalizedIndex)) : pending.boundEnd;
|
|
190
|
+
// Double the probe each round, capped at the window (see INITIAL_CONSTRAINED_PROBE_LEN in ../constants.ts).
|
|
191
|
+
// The queried range is already bounded by boundEnd (a probe can never reach
|
|
192
|
+
// more than WINDOW_LEN past the finalized frontier); this cap just keeps the stored length from growing unbounded
|
|
193
|
+
// once the probe saturates the window.
|
|
194
|
+
const nextProbeLen = Math.min(pending.probeLen * 2, UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN);
|
|
195
|
+
if (probeFullyConsumed && pending.end < boundEnd) {
|
|
196
|
+
return {
|
|
197
|
+
kind: AppTaggingSecretKind.CONSTRAINED,
|
|
198
|
+
secret: pending.secret,
|
|
199
|
+
start: pending.end,
|
|
200
|
+
end: Math.min(boundEnd, pending.end + nextProbeLen),
|
|
201
|
+
boundEnd,
|
|
202
|
+
probeLen: nextProbeLen
|
|
203
|
+
};
|
|
175
204
|
}
|
|
176
205
|
return undefined;
|
|
177
206
|
}
|
|
@@ -195,9 +224,11 @@ import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
|
195
224
|
await taggingStore.updateHighestFinalizedIndex(pending.secret, highestFinalizedIndex, jobId);
|
|
196
225
|
// For the next iteration we want to look only at indexes for which we have not yet fetched logs while
|
|
197
226
|
// ensuring that we do not look further than WINDOW_LEN ahead of the highest finalized index.
|
|
227
|
+
const end = unfinalizedTaggingIndexesWindowEnd(highestFinalizedIndex);
|
|
198
228
|
return {
|
|
229
|
+
kind: AppTaggingSecretKind.UNCONSTRAINED,
|
|
199
230
|
secret: pending.secret,
|
|
200
231
|
start: pending.end,
|
|
201
|
-
end
|
|
232
|
+
end
|
|
202
233
|
};
|
|
203
234
|
}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
3
3
|
import type { AppTaggingSecret } from '@aztec/stdlib/logs';
|
|
4
4
|
import type { SenderTaggingStore } from '../../storage/tagging_store/sender_tagging_store.js';
|
|
5
|
+
import type { LogQueryAnchor } from '../get_all_logs_by_tags.js';
|
|
5
6
|
/**
|
|
6
7
|
* Syncs tagging indexes. This function needs to be called whenever a private log is being sent.
|
|
7
8
|
*
|
|
8
9
|
* @param secret - The sender-side tagging `AppTaggingSecret`.
|
|
10
|
+
* @param finalizedBlockNumber - The locally-synced finalized tip, used to tell whether the block a discovered log
|
|
11
|
+
* sits in is finalized.
|
|
9
12
|
* @remarks When syncing the indexes as sender we don't care about the log contents - we only care about the highest
|
|
10
13
|
* pending and highest finalized indexes as that guides the next index choice when sending a log. The next index choice
|
|
11
14
|
* is simply the highest pending index plus one (or finalized if pending is undefined).
|
|
12
15
|
* @dev This function looks for new indexes, adds them to pending, then it checks status of each pending index and
|
|
13
16
|
* updates its status accordingly.
|
|
14
17
|
*/
|
|
15
|
-
export declare function syncSenderTaggingIndexes(secret: AppTaggingSecret, aztecNode: AztecNode, taggingStore: SenderTaggingStore,
|
|
16
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
18
|
+
export declare function syncSenderTaggingIndexes(secret: AppTaggingSecret, aztecNode: AztecNode, taggingStore: SenderTaggingStore, finalizedBlockNumber: BlockNumber, anchor: LogQueryAnchor, jobId: string): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY19zZW5kZXJfdGFnZ2luZ19pbmRleGVzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGFnZ2luZy9zZW5kZXJfc3luYy9zeW5jX3NlbmRlcl90YWdnaW5nX2luZGV4ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDbkUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUUzRCxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBRTlGLE9BQU8sS0FBSyxFQUFFLGNBQWMsRUFBRSxNQUFNLDRCQUE0QixDQUFDO0FBSWpFOzs7Ozs7Ozs7OztHQVdHO0FBQ0gsd0JBQXNCLHdCQUF3QixDQUM1QyxNQUFNLEVBQUUsZ0JBQWdCLEVBQ3hCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLFlBQVksRUFBRSxrQkFBa0IsRUFDaEMsb0JBQW9CLEVBQUUsV0FBVyxFQUNqQyxNQUFNLEVBQUUsY0FBYyxFQUN0QixLQUFLLEVBQUUsTUFBTSxHQUNaLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0EwRWYifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync_sender_tagging_indexes.d.ts","sourceRoot":"","sources":["../../../src/tagging/sender_sync/sync_sender_tagging_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sync_sender_tagging_indexes.d.ts","sourceRoot":"","sources":["../../../src/tagging/sender_sync/sync_sender_tagging_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AAE9F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAIjE;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,kBAAkB,EAChC,oBAAoB,EAAE,WAAW,EACjC,MAAM,EAAE,cAAc,EACtB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CA0Ef"}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EMPTY_STATUS_CHANGE, getStatusChangeOfPending, mergeStatusChanges } from './utils/get_status_change_of_pending.js';
|
|
1
|
+
import { unfinalizedTaggingIndexesWindowEnd } from '../constants.js';
|
|
3
2
|
import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_tagging_indexes.js';
|
|
3
|
+
import { resolvePendingTxs } from './utils/resolve_pending_txs.js';
|
|
4
4
|
/**
|
|
5
5
|
* Syncs tagging indexes. This function needs to be called whenever a private log is being sent.
|
|
6
6
|
*
|
|
7
7
|
* @param secret - The sender-side tagging `AppTaggingSecret`.
|
|
8
|
+
* @param finalizedBlockNumber - The locally-synced finalized tip, used to tell whether the block a discovered log
|
|
9
|
+
* sits in is finalized.
|
|
8
10
|
* @remarks When syncing the indexes as sender we don't care about the log contents - we only care about the highest
|
|
9
11
|
* pending and highest finalized indexes as that guides the next index choice when sending a log. The next index choice
|
|
10
12
|
* is simply the highest pending index plus one (or finalized if pending is undefined).
|
|
11
13
|
* @dev This function looks for new indexes, adds them to pending, then it checks status of each pending index and
|
|
12
14
|
* updates its status accordingly.
|
|
13
|
-
*/ export async function syncSenderTaggingIndexes(secret, aztecNode, taggingStore,
|
|
15
|
+
*/ export async function syncSenderTaggingIndexes(secret, aztecNode, taggingStore, finalizedBlockNumber, anchor, jobId) {
|
|
14
16
|
// # Explanation of how syncing works
|
|
15
17
|
//
|
|
16
18
|
// When choosing an index, we select: highest pending index + 1 (or highest finalized index + 1 if no pending).
|
|
@@ -26,46 +28,30 @@ import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_taggin
|
|
|
26
28
|
// than WINDOW_LEN from the highest finalized index.
|
|
27
29
|
//
|
|
28
30
|
// # Note on performance
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
+
// A window advance usually takes a single logs query: the finalization status of most txs the logs surface is
|
|
32
|
+
// derived from the log block numbers and the locally-synced finalized tip, without a per-tx node call. See
|
|
33
|
+
// `resolvePendingTxs` for the txs that the logs cannot settle and what they cost.
|
|
31
34
|
const finalizedIndex = await taggingStore.getLastFinalizedIndex(secret, jobId);
|
|
32
35
|
let start = finalizedIndex === undefined ? 0 : finalizedIndex + 1;
|
|
33
|
-
|
|
36
|
+
// The loop only extends the window when the finalized index moves,
|
|
37
|
+
// so this first window must cover the entire permitted range on its own.
|
|
38
|
+
let end = unfinalizedTaggingIndexesWindowEnd(finalizedIndex);
|
|
34
39
|
let previousFinalizedIndex = finalizedIndex;
|
|
35
40
|
let newFinalizedIndex = undefined;
|
|
36
41
|
while(true){
|
|
37
|
-
|
|
38
|
-
//
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
const [, statusOfKnown] = await Promise.all([
|
|
42
|
-
loadAndStoreNewTaggingIndexes(secret, start, end, aztecNode, taggingStore, anchorBlockHash, jobId),
|
|
43
|
-
knownPendingTxHashes.length > 0 ? getStatusChangeOfPending(knownPendingTxHashes, aztecNode) : Promise.resolve(EMPTY_STATUS_CHANGE)
|
|
44
|
-
]);
|
|
45
|
-
// Re-read pending tx hashes after the logs query writes any newly-discovered ones to the store.
|
|
46
|
-
const allPendingTxHashes = await taggingStore.getTxHashesOfPendingIndexes(secret, start, end, jobId);
|
|
47
|
-
if (allPendingTxHashes.length === 0) {
|
|
42
|
+
const txsInLogs = await loadAndStoreNewTaggingIndexes(secret, start, end, aztecNode, taggingStore, anchor, jobId);
|
|
43
|
+
// Pending txs for this window: prior syncs, txs this PXE itself sent, and what the logs just stored.
|
|
44
|
+
const pendingTxs = await taggingStore.getPendingTxs(secret, start, end, jobId);
|
|
45
|
+
if (pendingTxs.length === 0) {
|
|
48
46
|
break;
|
|
49
47
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
//
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
await taggingStore.dropPendingIndexes(txHashesToDrop, jobId);
|
|
58
|
-
await taggingStore.finalizePendingIndexes(txHashesToFinalize, jobId);
|
|
59
|
-
if (txHashesWithExecutionReverted.length > 0) {
|
|
60
|
-
const receipts = await Promise.all(txHashesWithExecutionReverted.map((txHash)=>aztecNode.getTxReceipt(txHash, {
|
|
61
|
-
includeTxEffect: true
|
|
62
|
-
})));
|
|
63
|
-
for (const receipt of receipts){
|
|
64
|
-
if (!receipt.isMined() || !receipt.txEffect) {
|
|
65
|
-
throw new Error('TxEffect not found for execution-reverted tx. This is either a bug or a reorg has occurred.');
|
|
66
|
-
}
|
|
67
|
-
await taggingStore.finalizePendingIndexesOfAPartiallyRevertedTx(receipt.txEffect, jobId);
|
|
68
|
-
}
|
|
48
|
+
const { txHashesFinalizedFromLogs, txHashesFinalizedFromReceipts, txHashesDropped, receiptsWithExecutionReverted } = await resolvePendingTxs(pendingTxs, txsInLogs, finalizedBlockNumber, aztecNode);
|
|
49
|
+
await taggingStore.dropPendingIndexes(txHashesDropped, jobId);
|
|
50
|
+
// The logs are queried per secret, so they only evidence this one's indexes. A receipt covers the whole tx.
|
|
51
|
+
await taggingStore.finalizePendingIndexesOfSecret(secret, txHashesFinalizedFromLogs, jobId);
|
|
52
|
+
await taggingStore.finalizePendingIndexes(txHashesFinalizedFromReceipts, jobId);
|
|
53
|
+
for (const receipt of receiptsWithExecutionReverted){
|
|
54
|
+
await taggingStore.finalizePendingIndexesOfAPartiallyRevertedTx(receipt.txEffect, jobId);
|
|
69
55
|
}
|
|
70
56
|
// We check if the finalized index has been updated.
|
|
71
57
|
newFinalizedIndex = await taggingStore.getLastFinalizedIndex(secret, jobId);
|
|
@@ -81,8 +67,7 @@ import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_taggin
|
|
|
81
67
|
// Previous window: [11, 12, 13, 14, 15, 16, 17, 18, 19, 20]
|
|
82
68
|
// New window: [21, 22, 23]
|
|
83
69
|
const previousEnd = end;
|
|
84
|
-
|
|
85
|
-
end = newFinalizedIndex + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN + 1;
|
|
70
|
+
end = unfinalizedTaggingIndexesWindowEnd(newFinalizedIndex);
|
|
86
71
|
start = previousEnd;
|
|
87
72
|
previousFinalizedIndex = newFinalizedIndex;
|
|
88
73
|
} else {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
3
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
4
|
+
import type { PendingTx } from '../../../storage/tagging_store/sender_tagging_store.js';
|
|
5
|
+
import type { TxInLogs } from './load_and_store_new_tagging_indexes.js';
|
|
6
|
+
/** A sync window's pending txs, grouped by what the window's logs evidence about each of them. */
|
|
7
|
+
export type LogClassification = {
|
|
8
|
+
txHashesFinalized: TxHash[];
|
|
9
|
+
txHashesWithExecutionReverted: TxHash[];
|
|
10
|
+
txHashesAbsent: TxHash[];
|
|
11
|
+
};
|
|
12
|
+
/** Groups a window's pending txs by what its logs say about them. */
|
|
13
|
+
export declare function classifyPendingTxsFromLogs(pendingTxs: PendingTx[], txsInLogs: Map<string, TxInLogs>, finalizedBlockNumber: BlockNumber): LogClassification;
|
|
14
|
+
/** A batch of pending txs grouped by what their receipts report about them. */
|
|
15
|
+
export type ReceiptClassification = {
|
|
16
|
+
txHashesFinalized: TxHash[];
|
|
17
|
+
txHashesDropped: TxHash[];
|
|
18
|
+
txHashesWithExecutionReverted: TxHash[];
|
|
19
|
+
};
|
|
20
|
+
/** Groups pending txs by what their receipts say, for the txs the logs could not resolve. */
|
|
21
|
+
export declare function classifyPendingTxsFromReceipts(pending: TxHash[], aztecNode: AztecNode): Promise<ReceiptClassification>;
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xhc3NpZnlfcGVuZGluZ190eHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy90YWdnaW5nL3NlbmRlcl9zeW5jL3V0aWxzL2NsYXNzaWZ5X3BlbmRpbmdfdHhzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sRUFBRSxNQUFNLEVBQVksTUFBTSxrQkFBa0IsQ0FBQztBQUVwRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSx3REFBd0QsQ0FBQztBQUN4RixPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSx5Q0FBeUMsQ0FBQztBQUV4RSxrR0FBa0c7QUFDbEcsTUFBTSxNQUFNLGlCQUFpQixHQUFHO0lBQzlCLGlCQUFpQixFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQzVCLDZCQUE2QixFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQ3hDLGNBQWMsRUFBRSxNQUFNLEVBQUUsQ0FBQztDQUMxQixDQUFDO0FBRUYscUVBQXFFO0FBQ3JFLHdCQUFnQiwwQkFBMEIsQ0FDeEMsVUFBVSxFQUFFLFNBQVMsRUFBRSxFQUN2QixTQUFTLEVBQUUsR0FBRyxDQUFDLE1BQU0sRUFBRSxRQUFRLENBQUMsRUFDaEMsb0JBQW9CLEVBQUUsV0FBVyxHQUNoQyxpQkFBaUIsQ0FzQm5CO0FBRUQsK0VBQStFO0FBQy9FLE1BQU0sTUFBTSxxQkFBcUIsR0FBRztJQUNsQyxpQkFBaUIsRUFBRSxNQUFNLEVBQUUsQ0FBQztJQUM1QixlQUFlLEVBQUUsTUFBTSxFQUFFLENBQUM7SUFDMUIsNkJBQTZCLEVBQUUsTUFBTSxFQUFFLENBQUM7Q0FDekMsQ0FBQztBQUVGLDZGQUE2RjtBQUM3Rix3QkFBc0IsOEJBQThCLENBQ2xELE9BQU8sRUFBRSxNQUFNLEVBQUUsRUFDakIsU0FBUyxFQUFFLFNBQVMsR0FDbkIsT0FBTyxDQUFDLHFCQUFxQixDQUFDLENBb0NoQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classify_pending_txs.d.ts","sourceRoot":"","sources":["../../../../src/tagging/sender_sync/utils/classify_pending_txs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAY,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wDAAwD,CAAC;AACxF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,yCAAyC,CAAC;AAExE,kGAAkG;AAClG,MAAM,MAAM,iBAAiB,GAAG;IAC9B,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,6BAA6B,EAAE,MAAM,EAAE,CAAC;IACxC,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B,CAAC;AAEF,qEAAqE;AACrE,wBAAgB,0BAA0B,CACxC,UAAU,EAAE,SAAS,EAAE,EACvB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EAChC,oBAAoB,EAAE,WAAW,GAChC,iBAAiB,CAsBnB;AAED,+EAA+E;AAC/E,MAAM,MAAM,qBAAqB,GAAG;IAClC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,6BAA6B,EAAE,MAAM,EAAE,CAAC;CACzC,CAAC;AAEF,6FAA6F;AAC7F,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAoChC"}
|