@aztec/pxe 3.0.0-nightly.20260105 → 3.0.0-nightly.20260106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/block_synchronizer/block_synchronizer.d.ts +6 -6
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +11 -11
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +22 -22
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +31 -28
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +4 -4
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +3 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +17 -13
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +13 -11
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +19 -19
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +44 -44
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +4 -4
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +5 -5
- package/dest/debug/pxe_debug_utils.d.ts +6 -6
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +7 -7
- package/dest/entrypoints/client/bundle/utils.d.ts +1 -1
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +10 -1
- package/dest/entrypoints/client/lazy/utils.d.ts +1 -1
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +10 -1
- package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +11 -7
- package/dest/error_enriching.d.ts +4 -4
- package/dest/error_enriching.d.ts.map +1 -1
- package/dest/error_enriching.js +6 -6
- package/dest/events/event_service.d.ts +6 -6
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +7 -7
- package/dest/events/private_event_filter_validator.d.ts +6 -6
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/events/private_event_filter_validator.js +4 -4
- package/dest/logs/log_service.d.ts +12 -12
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +17 -17
- 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 +14 -14
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +4 -4
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle_impl.js +7 -7
- package/dest/public_storage/public_storage_service.d.ts +4 -4
- package/dest/public_storage/public_storage_service.d.ts.map +1 -1
- package/dest/public_storage/public_storage_service.js +4 -4
- package/dest/pxe.d.ts +10 -10
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +81 -78
- package/dest/storage/address_store/address_store.d.ts +11 -0
- package/dest/storage/address_store/address_store.d.ts.map +1 -0
- package/dest/storage/{address_data_provider/address_data_provider.js → address_store/address_store.js} +1 -1
- package/dest/storage/address_store/index.d.ts +2 -0
- package/dest/storage/address_store/index.d.ts.map +1 -0
- package/dest/storage/address_store/index.js +1 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -0
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -0
- package/dest/storage/{anchor_block_data_provider/anchor_block_data_provider.js → anchor_block_store/anchor_block_store.js} +1 -1
- package/dest/storage/anchor_block_store/index.d.ts +2 -0
- package/dest/storage/anchor_block_store/index.d.ts.map +1 -0
- package/dest/storage/anchor_block_store/index.js +1 -0
- package/dest/storage/{capsule_data_provider/capsule_data_provider.d.ts → capsule_store/capsule_store.d.ts} +2 -2
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -0
- package/dest/storage/{capsule_data_provider/capsule_data_provider.js → capsule_store/capsule_store.js} +1 -1
- package/dest/storage/capsule_store/index.d.ts +2 -0
- package/dest/storage/capsule_store/index.d.ts.map +1 -0
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.d.ts → contract_store/contract_store.d.ts} +4 -3
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -0
- package/dest/storage/{contract_data_provider/contract_data_provider.js → contract_store/contract_store.js} +14 -2
- package/dest/storage/contract_store/index.d.ts +2 -0
- package/dest/storage/contract_store/index.d.ts.map +1 -0
- package/dest/storage/contract_store/index.js +1 -0
- package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.d.ts +1 -1
- package/dest/storage/contract_store/private_functions_tree.d.ts.map +1 -0
- package/dest/storage/index.d.ts +8 -8
- package/dest/storage/index.d.ts.map +1 -1
- package/dest/storage/index.js +7 -7
- package/dest/storage/note_store/index.d.ts +3 -0
- package/dest/storage/note_store/index.d.ts.map +1 -0
- package/dest/storage/note_store/index.js +2 -0
- package/dest/storage/{note_data_provider/note_data_provider.d.ts → note_store/note_store.d.ts} +7 -7
- package/dest/storage/note_store/note_store.d.ts.map +1 -0
- package/dest/storage/{note_data_provider/note_data_provider.js → note_store/note_store.js} +6 -6
- package/dest/storage/{private_event_data_provider/private_event_data_provider.d.ts → private_event_store/private_event_store.d.ts} +4 -4
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -0
- package/dest/storage/{private_event_data_provider/private_event_data_provider.js → private_event_store/private_event_store.js} +2 -2
- package/dest/storage/tagging_store/index.d.ts +4 -0
- package/dest/storage/tagging_store/index.d.ts.map +1 -0
- package/dest/storage/tagging_store/index.js +3 -0
- package/dest/{tagging/recipient_sync/recipient_tagging_data_provider.d.ts → storage/tagging_store/recipient_tagging_store.d.ts} +4 -4
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -0
- package/dest/{tagging/recipient_sync/recipient_tagging_data_provider.js → storage/tagging_store/recipient_tagging_store.js} +3 -3
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +14 -0
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -0
- package/dest/storage/{tagging_data_provider/sender_address_book.js → tagging_store/sender_address_book_store.js} +1 -1
- package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.d.ts → tagging_store/sender_tagging_store.d.ts} +3 -3
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -0
- package/dest/storage/{tagging_data_provider/sender_tagging_data_provider.js → tagging_store/sender_tagging_store.js} +3 -3
- package/dest/tagging/index.d.ts +14 -1
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +22 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -3
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +6 -6
- package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.d.ts +3 -4
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.js +8 -17
- package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.d.ts +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.d.ts +4 -4
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -0
- package/dest/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.js +3 -3
- package/dest/tree_membership/tree_membership_service.d.ts +4 -4
- package/dest/tree_membership/tree_membership_service.d.ts.map +1 -1
- package/dest/tree_membership/tree_membership_service.js +5 -5
- package/package.json +16 -16
- package/src/block_synchronizer/block_synchronizer.ts +10 -10
- package/src/contract_function_simulator/contract_function_simulator.ts +49 -48
- package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +48 -47
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +51 -51
- package/src/contract_function_simulator/proxied_contract_data_source.ts +7 -7
- package/src/debug/pxe_debug_utils.ts +6 -6
- package/src/entrypoints/client/bundle/utils.ts +7 -1
- package/src/entrypoints/client/lazy/utils.ts +7 -2
- package/src/entrypoints/pxe_creation_options.ts +2 -1
- package/src/entrypoints/server/utils.ts +11 -15
- package/src/error_enriching.ts +7 -15
- package/src/events/event_service.ts +6 -6
- package/src/events/private_event_filter_validator.ts +5 -5
- package/src/logs/log_service.ts +16 -16
- package/src/notes/note_service.ts +13 -13
- package/src/private_kernel/private_kernel_oracle_impl.ts +6 -6
- package/src/public_storage/public_storage_service.ts +3 -3
- package/src/pxe.ts +100 -101
- package/src/storage/{address_data_provider/address_data_provider.ts → address_store/address_store.ts} +1 -1
- package/src/storage/address_store/index.ts +1 -0
- package/src/storage/{anchor_block_data_provider/anchor_block_data_provider.ts → anchor_block_store/anchor_block_store.ts} +1 -1
- package/src/storage/anchor_block_store/index.ts +1 -0
- package/src/storage/{capsule_data_provider/capsule_data_provider.ts → capsule_store/capsule_store.ts} +1 -1
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/{contract_data_provider/contract_data_provider.ts → contract_store/contract_store.ts} +22 -2
- package/src/storage/contract_store/index.ts +1 -0
- package/src/storage/index.ts +7 -7
- package/src/storage/note_store/index.ts +2 -0
- package/src/storage/{note_data_provider/note_data_provider.ts → note_store/note_store.ts} +7 -7
- package/src/storage/{private_event_data_provider/private_event_data_provider.ts → private_event_store/private_event_store.ts} +4 -4
- package/src/storage/tagging_store/index.ts +3 -0
- package/src/{tagging/recipient_sync/recipient_tagging_data_provider.ts → storage/tagging_store/recipient_tagging_store.ts} +3 -3
- package/src/storage/{tagging_data_provider/sender_address_book.ts → tagging_store/sender_address_book_store.ts} +1 -1
- package/src/storage/{tagging_data_provider/sender_tagging_data_provider.ts → tagging_store/sender_tagging_store.ts} +3 -3
- package/src/tagging/index.ts +26 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +7 -7
- package/src/tagging/{sync → sender_sync}/sync_sender_tagging_indexes.ts +9 -19
- package/src/tagging/{sync → sender_sync}/utils/load_and_store_new_tagging_indexes.ts +4 -4
- package/src/tree_membership/tree_membership_service.ts +4 -4
- package/dest/storage/address_data_provider/address_data_provider.d.ts +0 -11
- package/dest/storage/address_data_provider/address_data_provider.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.d.ts +0 -2
- package/dest/storage/address_data_provider/index.d.ts.map +0 -1
- package/dest/storage/address_data_provider/index.js +0 -1
- package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts +0 -9
- package/dest/storage/anchor_block_data_provider/anchor_block_data_provider.d.ts.map +0 -1
- package/dest/storage/anchor_block_data_provider/index.d.ts +0 -2
- package/dest/storage/anchor_block_data_provider/index.d.ts.map +0 -1
- package/dest/storage/anchor_block_data_provider/index.js +0 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.d.ts +0 -2
- package/dest/storage/capsule_data_provider/index.d.ts.map +0 -1
- package/dest/storage/capsule_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.d.ts +0 -2
- package/dest/storage/contract_data_provider/index.d.ts.map +0 -1
- package/dest/storage/contract_data_provider/index.js +0 -1
- package/dest/storage/contract_data_provider/private_functions_tree.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.d.ts +0 -3
- package/dest/storage/note_data_provider/index.d.ts.map +0 -1
- package/dest/storage/note_data_provider/index.js +0 -2
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +0 -1
- package/dest/storage/private_event_data_provider/private_event_data_provider.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.d.ts +0 -4
- package/dest/storage/tagging_data_provider/index.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/index.js +0 -3
- package/dest/storage/tagging_data_provider/sender_address_book.d.ts +0 -14
- package/dest/storage/tagging_data_provider/sender_address_book.d.ts.map +0 -1
- package/dest/storage/tagging_data_provider/sender_tagging_data_provider.d.ts.map +0 -1
- package/dest/tagging/recipient_sync/recipient_tagging_data_provider.d.ts.map +0 -1
- package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts.map +0 -1
- package/dest/tagging/sync/utils/get_status_change_of_pending.d.ts.map +0 -1
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts.map +0 -1
- package/src/storage/address_data_provider/index.ts +0 -1
- package/src/storage/anchor_block_data_provider/index.ts +0 -1
- package/src/storage/capsule_data_provider/index.ts +0 -1
- package/src/storage/contract_data_provider/index.ts +0 -1
- package/src/storage/note_data_provider/index.ts +0 -2
- package/src/storage/tagging_data_provider/index.ts +0 -3
- /package/dest/storage/{contract_data_provider → contract_store}/private_functions_tree.js +0 -0
- /package/dest/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.js +0 -0
- /package/src/storage/{contract_data_provider → contract_store}/private_functions_tree.ts +0 -0
- /package/src/tagging/{sync → sender_sync}/utils/get_status_change_of_pending.ts +0 -0
package/dest/storage/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
1
|
+
export * from './address_store/index.js';
|
|
2
|
+
export * from './capsule_store/index.js';
|
|
3
|
+
export * from './contract_store/index.js';
|
|
4
|
+
export * from './note_store/index.js';
|
|
5
|
+
export * from './anchor_block_store/index.js';
|
|
6
|
+
export * from './tagging_store/index.js';
|
|
7
7
|
export * from './metadata.js';
|
|
8
|
-
export * from './
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
export * from './private_event_store/private_event_store.js';
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdG9yYWdlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLDJCQUEyQixDQUFDO0FBQzFDLGNBQWMsdUJBQXVCLENBQUM7QUFDdEMsY0FBYywrQkFBK0IsQ0FBQztBQUM5QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsZUFBZSxDQUFDO0FBQzlCLGNBQWMsOENBQThDLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/storage/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,eAAe,CAAC;AAC9B,cAAc,8CAA8C,CAAC"}
|
package/dest/storage/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
1
|
+
export * from './address_store/index.js';
|
|
2
|
+
export * from './capsule_store/index.js';
|
|
3
|
+
export * from './contract_store/index.js';
|
|
4
|
+
export * from './note_store/index.js';
|
|
5
|
+
export * from './anchor_block_store/index.js';
|
|
6
|
+
export * from './tagging_store/index.js';
|
|
7
7
|
export * from './metadata.js';
|
|
8
|
-
export * from './
|
|
8
|
+
export * from './private_event_store/private_event_store.js';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { NoteDao } from '@aztec/stdlib/note';
|
|
2
|
+
export { NoteStore } from './note_store.js';
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL25vdGVfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBQzdDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/note_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
package/dest/storage/{note_data_provider/note_data_provider.d.ts → note_store/note_store.d.ts}
RENAMED
|
@@ -5,24 +5,24 @@ import type { DataInBlock } from '@aztec/stdlib/block';
|
|
|
5
5
|
import { type NotesFilter } from '@aztec/stdlib/note';
|
|
6
6
|
import { NoteDao } from '@aztec/stdlib/note';
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* NoteStore manages the storage and retrieval of notes.
|
|
9
9
|
*
|
|
10
10
|
* Notes can be active or nullified. This class processes new notes, nullifications,
|
|
11
11
|
* and performs rollback handling in the case of a reorg.
|
|
12
12
|
**/
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class NoteStore {
|
|
14
14
|
#private;
|
|
15
15
|
private constructor();
|
|
16
16
|
/**
|
|
17
|
-
* Creates and initializes a new
|
|
17
|
+
* Creates and initializes a new NoteStore instance.
|
|
18
18
|
*
|
|
19
|
-
* This factory method creates a
|
|
19
|
+
* This factory method creates a NoteStore and restores any existing
|
|
20
20
|
* scope-specific indexes from the database.
|
|
21
21
|
*
|
|
22
22
|
* @param store - The key-value store to use for persistence
|
|
23
|
-
* @returns Promise resolving to a fully initialized
|
|
23
|
+
* @returns Promise resolving to a fully initialized NoteStore instance
|
|
24
24
|
*/
|
|
25
|
-
static create(store: AztecAsyncKVStore): Promise<
|
|
25
|
+
static create(store: AztecAsyncKVStore): Promise<NoteStore>;
|
|
26
26
|
/**
|
|
27
27
|
* Adds a new scope to the note data provider.
|
|
28
28
|
*
|
|
@@ -81,4 +81,4 @@ export declare class NoteDataProvider {
|
|
|
81
81
|
*/
|
|
82
82
|
applyNullifiers(nullifiers: DataInBlock<Fr>[]): Promise<NoteDao[]>;
|
|
83
83
|
}
|
|
84
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
84
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2Uvbm90ZV9zdG9yZS9ub3RlX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBRXpELE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFxQy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O,CAAC,OAAO,EAAE,CAAC,CA8DjE;CACF"}
|
|
@@ -4,11 +4,11 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
4
4
|
import { NoteStatus } from '@aztec/stdlib/note';
|
|
5
5
|
import { NoteDao } from '@aztec/stdlib/note';
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* NoteStore manages the storage and retrieval of notes.
|
|
8
8
|
*
|
|
9
9
|
* Notes can be active or nullified. This class processes new notes, nullifications,
|
|
10
10
|
* and performs rollback handling in the case of a reorg.
|
|
11
|
-
**/ export class
|
|
11
|
+
**/ export class NoteStore {
|
|
12
12
|
#store;
|
|
13
13
|
#notes;
|
|
14
14
|
#nullifiedNotes;
|
|
@@ -38,15 +38,15 @@ import { NoteDao } from '@aztec/stdlib/note';
|
|
|
38
38
|
this.#notesByStorageSlotAndScope = new Map();
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Creates and initializes a new
|
|
41
|
+
* Creates and initializes a new NoteStore instance.
|
|
42
42
|
*
|
|
43
|
-
* This factory method creates a
|
|
43
|
+
* This factory method creates a NoteStore and restores any existing
|
|
44
44
|
* scope-specific indexes from the database.
|
|
45
45
|
*
|
|
46
46
|
* @param store - The key-value store to use for persistence
|
|
47
|
-
* @returns Promise resolving to a fully initialized
|
|
47
|
+
* @returns Promise resolving to a fully initialized NoteStore instance
|
|
48
48
|
*/ static async create(store) {
|
|
49
|
-
const pxeDB = new
|
|
49
|
+
const pxeDB = new NoteStore(store);
|
|
50
50
|
for await (const scope of pxeDB.#scopes.keysAsync()){
|
|
51
51
|
pxeDB.#notesByContractAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_contract`));
|
|
52
52
|
pxeDB.#notesByStorageSlotAndScope.set(scope, store.openMultiMap(`${scope}:notes_by_storage_slot`));
|
|
@@ -4,7 +4,7 @@ import type { EventSelector } from '@aztec/stdlib/abi';
|
|
|
4
4
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
5
|
import { type InTx, TxHash } from '@aztec/stdlib/tx';
|
|
6
6
|
import type { PackedPrivateEvent } from '../../pxe.js';
|
|
7
|
-
export type
|
|
7
|
+
export type PrivateEventStoreFilter = {
|
|
8
8
|
contractAddress: AztecAddress;
|
|
9
9
|
fromBlock: number;
|
|
10
10
|
toBlock: number;
|
|
@@ -18,7 +18,7 @@ type PrivateEventMetadata = InTx & {
|
|
|
18
18
|
/**
|
|
19
19
|
* Stores decrypted private event logs.
|
|
20
20
|
*/
|
|
21
|
-
export declare class
|
|
21
|
+
export declare class PrivateEventStore {
|
|
22
22
|
#private;
|
|
23
23
|
logger: import("@aztec/foundation/log").Logger;
|
|
24
24
|
constructor(store: AztecAsyncKVStore);
|
|
@@ -45,7 +45,7 @@ export declare class PrivateEventDataProvider {
|
|
|
45
45
|
* @returns - The event log contents, augmented with metadata about
|
|
46
46
|
* the transaction and block it the event was included in .
|
|
47
47
|
*/
|
|
48
|
-
getPrivateEvents(eventSelector: EventSelector, filter:
|
|
48
|
+
getPrivateEvents(eventSelector: EventSelector, filter: PrivateEventStoreFilter): Promise<PackedPrivateEvent[]>;
|
|
49
49
|
}
|
|
50
50
|
export {};
|
|
51
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
51
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9ldmVudF9zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvcHJpdmF0ZV9ldmVudF9zdG9yZS9wcml2YXRlX2V2ZW50X3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUdwRCxPQUFPLEtBQUssRUFBbUIsaUJBQWlCLEVBQWlCLE1BQU0saUJBQWlCLENBQUM7QUFDekYsT0FBTyxLQ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T0FBTyxDQUFDLGtCQUFrQixFQUFFLENBQUMsQ0F3Qy9CO0NBQ0YifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"private_event_store.d.ts","sourceRoot":"","sources":["../../../src/storage/private_event_store/private_event_store.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAGpD,OAAO,KAAK,EAAmB,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACzF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,MAAM,uBAAuB,GAAG;IACpC,eAAe,EAAE,YAAY,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAUF,KAAK,oBAAoB,GAAG,IAAI,GAAG;IACjC,eAAe,EAAE,YAAY,CAAC;IAC9B,KAAK,EAAE,YAAY,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,qBAAa,iBAAiB;;IAS5B,MAAM,yCAAuC;IAE7C,YAAY,KAAK,EAAE,iBAAiB,EAKnC;IAMD;;;;;;;;;;OAUG;IACH,oBAAoB,CAClB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,EAAE,EAAE,EAChB,oBAAoB,EAAE,MAAM,EAC5B,QAAQ,EAAE,oBAAoB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA8Bf;IAED;;;;;;;;;;OAUG;IACU,gBAAgB,CAC3B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAwC/B;CACF"}
|
|
@@ -6,12 +6,12 @@ import { L2BlockHash } from '@aztec/stdlib/block';
|
|
|
6
6
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
7
7
|
/**
|
|
8
8
|
* Stores decrypted private event logs.
|
|
9
|
-
*/ export class
|
|
9
|
+
*/ export class PrivateEventStore {
|
|
10
10
|
#store;
|
|
11
11
|
/** Array storing the actual private event log entries containing the log content and block number */ #eventLogs;
|
|
12
12
|
/** Map from contract_address_scope_eventSelector to array of indices into #eventLogs for efficient lookup */ #eventLogIndex;
|
|
13
13
|
/** Map from eventCommitmentIndex to boolean indicating if log has been seen. */ #seenLogs;
|
|
14
|
-
logger = createLogger('
|
|
14
|
+
logger = createLogger('private_event_store');
|
|
15
15
|
constructor(store){
|
|
16
16
|
this.#store = store;
|
|
17
17
|
this.#eventLogs = this.#store.openArray('private_event_logs');
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { SenderTaggingStore } from './sender_tagging_store.js';
|
|
2
|
+
export { SenderAddressBookStore } from './sender_address_book_store.js';
|
|
3
|
+
export { RecipientTaggingStore } from './recipient_tagging_store.js';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zdG9yYWdlL3RhZ2dpbmdfc3RvcmUvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFDL0QsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDeEUsT0FBTyxFQUFFLHFCQUFxQixFQUFFLE1BQU0sOEJBQThCLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -2,15 +2,15 @@ import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
|
2
2
|
import type { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
|
|
3
3
|
/**
|
|
4
4
|
* Data provider of tagging data used when syncing the logs as a recipient. The sender counterpart of this class
|
|
5
|
-
* is called
|
|
5
|
+
* is called SenderTaggingStore. We have the providers separate for the sender and recipient because
|
|
6
6
|
* the algorithms are completely disjoint and there is not data reuse between the two.
|
|
7
7
|
*
|
|
8
8
|
* @dev Chain reorgs do not need to be handled here because both the finalized and aged indexes refer to finalized
|
|
9
9
|
* blocks, which by definition cannot be affected by reorgs.
|
|
10
10
|
*
|
|
11
|
-
* TODO(benesjan): Relocate to yarn-project/pxe/src/storage/
|
|
11
|
+
* TODO(benesjan): Relocate to yarn-project/pxe/src/storage/tagging_store
|
|
12
12
|
*/
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class RecipientTaggingStore {
|
|
14
14
|
#private;
|
|
15
15
|
constructor(store: AztecAsyncKVStore);
|
|
16
16
|
getHighestAgedIndex(secret: DirectionalAppTaggingSecret): Promise<number | undefined>;
|
|
@@ -18,4 +18,4 @@ export declare class RecipientTaggingDataProvider {
|
|
|
18
18
|
getHighestFinalizedIndex(secret: DirectionalAppTaggingSecret): Promise<number | undefined>;
|
|
19
19
|
updateHighestFinalizedIndex(secret: DirectionalAppTaggingSecret, index: number): Promise<void>;
|
|
20
20
|
}
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjo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AE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE;;;;;;;;;GASG;AACH,qBAAa,qBAAqB;;IAMhC,YAAY,KAAK,EAAE,iBAAiB,EAKnC;IAED,mBAAmB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEpF;IAEK,sBAAsB,CAAC,MAAM,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAO9F;IAED,wBAAwB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEzF;IAEK,2BAA2B,CAAC,MAAM,EAAE,2BAA2B,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAQnG;CACF"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Data provider of tagging data used when syncing the logs as a recipient. The sender counterpart of this class
|
|
3
|
-
* is called
|
|
3
|
+
* is called SenderTaggingStore. We have the providers separate for the sender and recipient because
|
|
4
4
|
* the algorithms are completely disjoint and there is not data reuse between the two.
|
|
5
5
|
*
|
|
6
6
|
* @dev Chain reorgs do not need to be handled here because both the finalized and aged indexes refer to finalized
|
|
7
7
|
* blocks, which by definition cannot be affected by reorgs.
|
|
8
8
|
*
|
|
9
|
-
* TODO(benesjan): Relocate to yarn-project/pxe/src/storage/
|
|
10
|
-
*/ export class
|
|
9
|
+
* TODO(benesjan): Relocate to yarn-project/pxe/src/storage/tagging_store
|
|
10
|
+
*/ export class RecipientTaggingStore {
|
|
11
11
|
#store;
|
|
12
12
|
#highestAgedIndex;
|
|
13
13
|
#highestFinalizedIndex;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
/**
|
|
4
|
+
* Stores sender addresses. During recipient log synchronization, these senders are used, along with a given recipient,
|
|
5
|
+
* to derive directional app tagging secrets that are then used to sync the logs.
|
|
6
|
+
*/
|
|
7
|
+
export declare class SenderAddressBookStore {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(store: AztecAsyncKVStore);
|
|
10
|
+
addSender(address: AztecAddress): Promise<boolean>;
|
|
11
|
+
getSenders(): Promise<AztecAddress[]>;
|
|
12
|
+
removeSender(address: AztecAddress): Promise<boolean>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZGVyX2FkZHJlc3NfYm9va19zdG9yZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3N0b3JhZ2UvdGFnZ2luZ19zdG9yZS9zZW5kZXJfYWRkcmVzc19ib29rX3N0b3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUFpQixNQUFNLGlCQUFpQixDQUFDO0FBQ3hFLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUUzRDs7O0dBR0c7QUFDSCxxQkFBYSxzQkFBc0I7O0lBSWpDLFlBQVksS0FBSyxFQUFFLGlCQUFpQixFQUluQztJQUVLLFNBQVMsQ0FBQyxPQUFPLEVBQUUsWUFBWSxHQUFHLE9BQU8sQ0FBQyxPQUFPLENBQUMsQ0FRdkQ7SUFFSyxVQUFVLElBQUksT0FBTyxDQUFDLFlBQVksRUFBRSxDQUFDLENBRTFDO0lBRUssWUFBWSxDQUFDLE9BQU8sRUFBRSxZQUFZLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQVExRDtDQUNGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender_address_book_store.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/sender_address_book_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;;GAGG;AACH,qBAAa,sBAAsB;;IAIjC,YAAY,KAAK,EAAE,iBAAiB,EAInC;IAEK,SAAS,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAQvD;IAEK,UAAU,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAE1C;IAEK,YAAY,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAQ1D;CACF"}
|
|
@@ -3,7 +3,7 @@ import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
3
3
|
/**
|
|
4
4
|
* Stores sender addresses. During recipient log synchronization, these senders are used, along with a given recipient,
|
|
5
5
|
* to derive directional app tagging secrets that are then used to sync the logs.
|
|
6
|
-
*/ export class
|
|
6
|
+
*/ export class SenderAddressBookStore {
|
|
7
7
|
#store;
|
|
8
8
|
#addressBook;
|
|
9
9
|
constructor(store){
|
|
@@ -3,10 +3,10 @@ import type { DirectionalAppTaggingSecret, PreTag } from '@aztec/stdlib/logs';
|
|
|
3
3
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
4
4
|
/**
|
|
5
5
|
* Data provider of tagging data used when syncing the sender tagging indexes. The recipient counterpart of this class
|
|
6
|
-
* is called
|
|
6
|
+
* is called RecipientTaggingStore. We have the providers separate for the sender and recipient because
|
|
7
7
|
* the algorithms are completely disjoint and there is not data reuse between the two.
|
|
8
8
|
*/
|
|
9
|
-
export declare class
|
|
9
|
+
export declare class SenderTaggingStore {
|
|
10
10
|
#private;
|
|
11
11
|
constructor(store: AztecAsyncKVStore);
|
|
12
12
|
/**
|
|
@@ -64,4 +64,4 @@ export declare class SenderTaggingDataProvider {
|
|
|
64
64
|
*/
|
|
65
65
|
finalizePendingIndexes(txHashes: TxHash[]): Promise<void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FBZ0IsQ0FBQyxNQUFNLEVBQUUsMkJBQTJCLEdBQUcsT0FBTyxDQUFDLE1BQU0sR0FBRyxTQUFTLENBQUMsQ0FZdkY7SUFFRDs7T0FFRztJQUNHLGtCQUFrQixDQUFDLFFBQVEsRUFBRSxNQUFNLEVBQUUsaUJBcUIxQztJQUVEOzs7T0FHRztJQUNHLHNCQUFzQixDQUFDLFFBQVEsRUFBRSxNQUFNLEVBQUUsaUJBcUQ5QztDQUNGIn0=
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sender_tagging_store.d.ts","sourceRoot":"","sources":["../../../src/storage/tagging_store/sender_tagging_store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAI1C;;;;GAIG;AACH,qBAAa,kBAAkB;;IAkB7B,YAAY,KAAK,EAAE,iBAAiB,EAKnC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,mBAAmB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,iBAiD1D;IAED;;;;;;;;OAQG;IACG,2BAA2B,CAC/B,MAAM,EAAE,2BAA2B,EACnC,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB;IAED;;;;OAIG;IACH,qBAAqB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEtF;IAED;;;;;OAKG;IACG,gBAAgB,CAAC,MAAM,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAYvF;IAED;;OAEG;IACG,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,iBAqB1C;IAED;;;OAGG;IACG,sBAAsB,CAAC,QAAQ,EAAE,MAAM,EAAE,iBAqD9C;CACF"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { toArray } from '@aztec/foundation/iterable';
|
|
2
2
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
3
|
-
import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/
|
|
3
|
+
import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../../tagging/index.js';
|
|
4
4
|
/**
|
|
5
5
|
* Data provider of tagging data used when syncing the sender tagging indexes. The recipient counterpart of this class
|
|
6
|
-
* is called
|
|
6
|
+
* is called RecipientTaggingStore. We have the providers separate for the sender and recipient because
|
|
7
7
|
* the algorithms are completely disjoint and there is not data reuse between the two.
|
|
8
|
-
*/ export class
|
|
8
|
+
*/ export class SenderTaggingStore {
|
|
9
9
|
#store;
|
|
10
10
|
// Stores the pending indexes for each directional app tagging secret. Pending here means that the tx that contained
|
|
11
11
|
// the private logs with tags corresponding to these indexes has not been finalized yet.
|
package/dest/tagging/index.d.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This directory contains the sender and recipient synchronization algorithms that use tagging.
|
|
3
|
+
*
|
|
4
|
+
* The objective of the sender sync algorithm is to determine which tags have already been used by a sender, thereby
|
|
5
|
+
* deciding which tag should be used next.
|
|
6
|
+
*
|
|
7
|
+
* The objective of the recipient sync algorithm is to load and process the corresponding logs.
|
|
8
|
+
*
|
|
9
|
+
* @module tagging
|
|
10
|
+
*/
|
|
11
|
+
export { loadPrivateLogsForSenderRecipientPair } from './recipient_sync/load_private_logs_for_sender_recipient_pair.js';
|
|
12
|
+
export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
|
|
13
|
+
export declare const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
|
|
1
14
|
export { DirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
|
|
2
15
|
export { type PreTag } from '@aztec/stdlib/logs';
|
|
3
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy90YWdnaW5nL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7Ozs7R0FTRztBQUVILE9BQU8sRUFBRSxxQ0FBcUMsRUFBRSxNQUFNLGlFQUFpRSxDQUFDO0FBQ3hILE9BQU8sRUFBRSx3QkFBd0IsRUFBRSxNQUFNLDhDQUE4QyxDQUFDO0FBV3hGLGVBQU8sTUFBTSxzQ0FBc0MsS0FBSyxDQUFDO0FBR3pELE9BQU8sRUFBRSwyQkFBMkIsRUFBRSxHQUFHLEVBQUUsU0FBUyxFQUFFLE1BQU0sb0JBQW9CLENBQUM7QUFDakYsT0FBTyxFQUFFLEtBQUssTUFBTSxFQUFFLE1BQU0sb0JBQW9CLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qCAAqC,EAAE,MAAM,iEAAiE,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AAWxF,eAAO,MAAM,sCAAsC,KAAK,CAAC;AAGzD,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dest/tagging/index.js
CHANGED
|
@@ -1 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This directory contains the sender and recipient synchronization algorithms that use tagging.
|
|
3
|
+
*
|
|
4
|
+
* The objective of the sender sync algorithm is to determine which tags have already been used by a sender, thereby
|
|
5
|
+
* deciding which tag should be used next.
|
|
6
|
+
*
|
|
7
|
+
* The objective of the recipient sync algorithm is to load and process the corresponding logs.
|
|
8
|
+
*
|
|
9
|
+
* @module tagging
|
|
10
|
+
*/ export { loadPrivateLogsForSenderRecipientPair } from './recipient_sync/load_private_logs_for_sender_recipient_pair.js';
|
|
11
|
+
export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
|
|
12
|
+
// This window has to be as large as the largest expected number of logs emitted in a tx for a given directional app
|
|
13
|
+
// tagging secret. If we get more tag indexes consumed than this window, an error is thrown in `PXE::proveTx` function.
|
|
14
|
+
// This is set to a larger value than MAX_PRIVATE_LOGS_PER_TX (currently 64) because there could be more than
|
|
15
|
+
// MAX_PRIVATE_LOGS_PER_TX indexes consumed in case the logs are squashed. This happens when the log contains a note
|
|
16
|
+
// and the note is nullified in the same tx.
|
|
17
|
+
//
|
|
18
|
+
// Having a large window significantly slowed down `e2e_l1_with_wall_time` test as there we perform sync for more than
|
|
19
|
+
// 1000 secrets. For this reason we set it to a relatively low value of 20. 20 should be sufficient for all the use
|
|
20
|
+
// cases.
|
|
21
|
+
export const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
|
|
22
|
+
// Re-export tagging-related types from stdlib
|
|
1
23
|
export { DirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
|
|
@@ -2,7 +2,7 @@ import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
import type { DirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
5
|
-
import type {
|
|
5
|
+
import type { RecipientTaggingStore } from '../../storage/tagging_store/recipient_tagging_store.js';
|
|
6
6
|
/**
|
|
7
7
|
* Loads private logs for `app` and sender-recipient pair defined by `secret` and updates the highest aged and
|
|
8
8
|
* finalized indexes in the db. At most load logs from blocks up to and including `anchorBlockNumber`.
|
|
@@ -10,5 +10,5 @@ import type { RecipientTaggingDataProvider } from './recipient_tagging_data_prov
|
|
|
10
10
|
* @dev This function can be safely executed "in parallel" for other sender-recipient pairs because the data in
|
|
11
11
|
* in the tagging data provider is indexed by the secret and hence completely disjoint.
|
|
12
12
|
*/
|
|
13
|
-
export declare function loadPrivateLogsForSenderRecipientPair(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode,
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
13
|
+
export declare function loadPrivateLogsForSenderRecipientPair(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockNumber: BlockNumber): Promise<TxScopedL2Log[]>;
|
|
14
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvbG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBRSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUVyRixPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHdEQUF3RCxDQUFDO0FBS3BHOzs7Ozs7R0FNRztBQUNILHdCQUFzQixxQ0FBcUMsQ0FDekQsTUFBTSxFQUFFLDJCQUEyQixFQUNuQyxHQUFHLEVBQUUsWUFBWSxFQUNqQixTQUFTLEVBQUUsU0FBUyxFQUNwQixZQUFZLEVBQUUscUJBQXFCLEVBQ25DLGlCQUFpQixFQUFFLFdBQVcsR0FDN0IsT0FBTyxDQUFDLGFBQWEsRUFBRSxDQUFDLENBeUcxQiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load_private_logs_for_sender_recipient_pair.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"load_private_logs_for_sender_recipient_pair.d.ts","sourceRoot":"","sources":["../../../src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAErF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,GAC7B,OAAO,CAAC,aAAa,EAAE,CAAC,CAyG1B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../
|
|
1
|
+
import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../index.js';
|
|
2
2
|
import { findHighestIndexes } from './utils/find_highest_indexes.js';
|
|
3
3
|
import { loadLogsForRange } from './utils/load_logs_for_range.js';
|
|
4
4
|
/**
|
|
@@ -7,7 +7,7 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
|
|
|
7
7
|
*
|
|
8
8
|
* @dev This function can be safely executed "in parallel" for other sender-recipient pairs because the data in
|
|
9
9
|
* in the tagging data provider is indexed by the secret and hence completely disjoint.
|
|
10
|
-
*/ export async function loadPrivateLogsForSenderRecipientPair(secret, app, aztecNode,
|
|
10
|
+
*/ export async function loadPrivateLogsForSenderRecipientPair(secret, app, aztecNode, taggingStore, anchorBlockNumber) {
|
|
11
11
|
// # Explanation of how the algorithm works
|
|
12
12
|
// When we perform the sync we will look at logs that correspond to the tagging index range
|
|
13
13
|
// (highestAgedIndex, highestFinalizedIndex + WINDOW_LEN]
|
|
@@ -61,8 +61,8 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
|
|
|
61
61
|
}
|
|
62
62
|
let start, end;
|
|
63
63
|
{
|
|
64
|
-
const currentHighestAgedIndex = await
|
|
65
|
-
const currentHighestFinalizedIndex = await
|
|
64
|
+
const currentHighestAgedIndex = await taggingStore.getHighestAgedIndex(secret);
|
|
65
|
+
const currentHighestFinalizedIndex = await taggingStore.getHighestFinalizedIndex(secret);
|
|
66
66
|
// We don't want to include the highest aged index so we start from `currentHighestAgedIndex + 1` (or 0 if not set)
|
|
67
67
|
start = currentHighestAgedIndex === undefined ? 0 : currentHighestAgedIndex + 1;
|
|
68
68
|
// The highest index a sender can choose is "highest finalized index + window length" but given that
|
|
@@ -80,7 +80,7 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
|
|
|
80
80
|
const { highestAgedIndex, highestFinalizedIndex } = findHighestIndexes(privateLogsWithIndexes, currentTimestamp, finalizedBlockNumber);
|
|
81
81
|
// Store updates in data provider and update local variables
|
|
82
82
|
if (highestAgedIndex !== undefined) {
|
|
83
|
-
await
|
|
83
|
+
await taggingStore.updateHighestAgedIndex(secret, highestAgedIndex);
|
|
84
84
|
}
|
|
85
85
|
if (highestFinalizedIndex === undefined) {
|
|
86
86
|
break;
|
|
@@ -89,7 +89,7 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
|
|
|
89
89
|
// This is just a sanity check as this should never happen.
|
|
90
90
|
throw new Error('Highest aged index lower than highest finalized index invariant violated');
|
|
91
91
|
}
|
|
92
|
-
await
|
|
92
|
+
await taggingStore.updateHighestFinalizedIndex(secret, highestFinalizedIndex);
|
|
93
93
|
// For the next iteration we want to look only at indexes for which we have not attempted to load logs yet while
|
|
94
94
|
// ensuring that we do not look further than WINDOW_LEN ahead of the highest finalized index.
|
|
95
95
|
start = end;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
2
|
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
3
3
|
import type { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
|
|
4
|
-
import type {
|
|
5
|
-
export declare const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
|
|
4
|
+
import type { SenderTaggingStore } from '../../storage/tagging_store/sender_tagging_store.js';
|
|
6
5
|
/**
|
|
7
6
|
* Syncs tagging indexes. This function needs to be called whenever a private log is being sent.
|
|
8
7
|
*
|
|
@@ -17,5 +16,5 @@ export declare const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
|
|
|
17
16
|
* @dev This function looks for new indexes, adds them to pending, then it checks status of each pending index and
|
|
18
17
|
* updates its status accordingly.
|
|
19
18
|
*/
|
|
20
|
-
export declare function syncSenderTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode,
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
export declare function syncSenderTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: SenderTaggingStore): Promise<void>;
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY19zZW5kZXJfdGFnZ2luZ19pbmRleGVzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGFnZ2luZy9zZW5kZXJfc3luYy9zeW5jX3NlbmRlcl90YWdnaW5nX2luZGV4ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUV0RSxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBSzlGOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFDSCx3QkFBc0Isd0JBQXdCLENBQzVDLE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsR0FBRyxFQUFFLFlBQVksRUFDakIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsWUFBWSxFQUFFLGtCQUFrQixHQUMvQixPQUFPLENBQUMsSUFBSSxDQUFDLENBbUVmIn0=
|
|
@@ -0,0 +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,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AAEtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qDAAqD,CAAC;AAK9F;;;;;;;;;;;;;GAaG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,kBAAkB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAmEf"}
|
|
@@ -1,15 +1,6 @@
|
|
|
1
|
+
import { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from '../index.js';
|
|
1
2
|
import { getStatusChangeOfPending } from './utils/get_status_change_of_pending.js';
|
|
2
3
|
import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_tagging_indexes.js';
|
|
3
|
-
// This window has to be as large as the largest expected number of logs emitted in a tx for a given directional app
|
|
4
|
-
// tagging secret. If we get more tag indexes consumed than this window, an error is thrown in `PXE::proveTx` function.
|
|
5
|
-
// This is set to a larger value than MAX_PRIVATE_LOGS_PER_TX (currently 64) because there could be more than
|
|
6
|
-
// MAX_PRIVATE_LOGS_PER_TX indexes consumed in case the logs are squashed. This happens when the log contains a note
|
|
7
|
-
// and the note is nullified in the same tx.
|
|
8
|
-
//
|
|
9
|
-
// Having a large window significantly slowed down `e2e_l1_with_wall_time` test as there we perform sync for more than
|
|
10
|
-
// 1000 secrets. For this reason we set it to a relatively low value of 20. 20 should be sufficient for all the use
|
|
11
|
-
// cases.
|
|
12
|
-
export const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
|
|
13
4
|
/**
|
|
14
5
|
* Syncs tagging indexes. This function needs to be called whenever a private log is being sent.
|
|
15
6
|
*
|
|
@@ -23,7 +14,7 @@ export const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
|
|
|
23
14
|
* is simply the highest pending index plus one (or finalized if pending is undefined).
|
|
24
15
|
* @dev This function looks for new indexes, adds them to pending, then it checks status of each pending index and
|
|
25
16
|
* updates its status accordingly.
|
|
26
|
-
*/ export async function syncSenderTaggingIndexes(secret, app, aztecNode,
|
|
17
|
+
*/ export async function syncSenderTaggingIndexes(secret, app, aztecNode, taggingStore) {
|
|
27
18
|
// # Explanation of how syncing works
|
|
28
19
|
//
|
|
29
20
|
// When choosing an index, we select: highest pending index + 1 (or highest finalized index + 1 if no pending).
|
|
@@ -41,7 +32,7 @@ export const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
|
|
|
41
32
|
// # Note on performance
|
|
42
33
|
// Each window advance requires two queries (logs + tx status). For example, syncing indexes 0–500 with a window of
|
|
43
34
|
// 100 takes at least 10 round trips (5 windows × 2 queries).
|
|
44
|
-
const finalizedIndex = await
|
|
35
|
+
const finalizedIndex = await taggingStore.getLastFinalizedIndex(secret);
|
|
45
36
|
let start = finalizedIndex === undefined ? 0 : finalizedIndex + 1;
|
|
46
37
|
let end = start + UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN;
|
|
47
38
|
let previousFinalizedIndex = finalizedIndex;
|
|
@@ -49,17 +40,17 @@ export const UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN = 20;
|
|
|
49
40
|
while(true){
|
|
50
41
|
// Load and store indexes for the current window. These indexes may already exist in the database if txs using
|
|
51
42
|
// them were previously sent from this PXE. Any duplicates are handled by the tagging data provider.
|
|
52
|
-
await loadAndStoreNewTaggingIndexes(secret, app, start, end, aztecNode,
|
|
43
|
+
await loadAndStoreNewTaggingIndexes(secret, app, start, end, aztecNode, taggingStore);
|
|
53
44
|
// Retrieve all indexes within the current window from storage and update their status accordingly.
|
|
54
|
-
const pendingTxHashes = await
|
|
45
|
+
const pendingTxHashes = await taggingStore.getTxHashesOfPendingIndexes(secret, start, end);
|
|
55
46
|
if (pendingTxHashes.length === 0) {
|
|
56
47
|
break;
|
|
57
48
|
}
|
|
58
49
|
const { txHashesToFinalize, txHashesToDrop } = await getStatusChangeOfPending(pendingTxHashes, aztecNode);
|
|
59
|
-
await
|
|
60
|
-
await
|
|
50
|
+
await taggingStore.dropPendingIndexes(txHashesToDrop);
|
|
51
|
+
await taggingStore.finalizePendingIndexes(txHashesToFinalize);
|
|
61
52
|
// We check if the finalized index has been updated.
|
|
62
|
-
newFinalizedIndex = await
|
|
53
|
+
newFinalizedIndex = await taggingStore.getLastFinalizedIndex(secret);
|
|
63
54
|
if (previousFinalizedIndex !== newFinalizedIndex) {
|
|
64
55
|
// A new finalized index was found, so we'll run the loop again. For example:
|
|
65
56
|
// - Previous finalized index: 10
|
|
@@ -8,4 +8,4 @@ export declare function getStatusChangeOfPending(pending: TxHash[], aztecNode: A
|
|
|
8
8
|
txHashesToFinalize: TxHash[];
|
|
9
9
|
txHashesToDrop: TxHash[];
|
|
10
10
|
}>;
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X3N0YXR1c19jaGFuZ2Vfb2ZfcGVuZGluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvc2VuZGVyX3N5bmMvdXRpbHMvZ2V0X3N0YXR1c19jaGFuZ2Vfb2ZfcGVuZGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEVBQUUsTUFBTSxFQUFZLE1BQU0sa0JBQWtCLENBQUM7QUFFcEQ7OztHQUdHO0FBQ0gsd0JBQXNCLHdCQUF3QixDQUM1QyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQ2pCLFNBQVMsRUFBRSxTQUFTLEdBQ25CLE9BQU8sQ0FBQztJQUFFLGtCQUFrQixFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQUMsY0FBYyxFQUFFLE1BQU0sRUFBRSxDQUFBO0NBQUUsQ0FBQyxDQWlDckUifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get_status_change_of_pending.d.ts","sourceRoot":"","sources":["../../../../src/tagging/sender_sync/utils/get_status_change_of_pending.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAY,MAAM,kBAAkB,CAAC;AAEpD;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EAAE,EACjB,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC;IAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC;IAAC,cAAc,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,CAiCrE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
2
|
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
3
3
|
import type { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
|
|
4
|
-
import type {
|
|
4
|
+
import type { SenderTaggingStore } from '../../../storage/tagging_store/sender_tagging_store.js';
|
|
5
5
|
/**
|
|
6
6
|
* Loads tagging indexes from the Aztec node and stores them in the tagging data provider.
|
|
7
7
|
* @remarks This function is one of two places by which a pending index can get to the tagging data provider. The other
|
|
@@ -12,7 +12,7 @@ import type { SenderTaggingDataProvider } from '../../../storage/tagging_data_pr
|
|
|
12
12
|
* @param start - The starting index (inclusive) of the window to process.
|
|
13
13
|
* @param end - The ending index (exclusive) of the window to process.
|
|
14
14
|
* @param aztecNode - The Aztec node instance to query for logs.
|
|
15
|
-
* @param
|
|
15
|
+
* @param taggingStore - The data provider to store pending indexes.
|
|
16
16
|
*/
|
|
17
|
-
export declare function loadAndStoreNewTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, start: number, end: number, aztecNode: AztecNode,
|
|
18
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
17
|
+
export declare function loadAndStoreNewTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, start: number, end: number, aztecNode: AztecNode, taggingStore: SenderTaggingStore): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9hbmRfc3RvcmVfbmV3X3RhZ2dpbmdfaW5kZXhlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvc2VuZGVyX3N5bmMvdXRpbHMvbG9hZF9hbmRfc3RvcmVfbmV3X3RhZ2dpbmdfaW5kZXhlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBVSxNQUFNLG9CQUFvQixDQUFDO0FBSTlFLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0RBQXdELENBQUM7QUFFakc7Ozs7Ozs7Ozs7O0dBV0c7QUFDSCx3QkFBc0IsNkJBQTZCLENBQ2pELE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsR0FBRyxFQUFFLFlBQVksRUFDakIsS0FBSyxFQUFFLE1BQU0sRUFDYixHQUFHLEVBQUUsTUFBTSxFQUNYLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLFlBQVksRUFBRSxrQkFBa0IsaUJBa0JqQyJ9
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load_and_store_new_tagging_indexes.d.ts","sourceRoot":"","sources":["../../../../src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAU,MAAM,oBAAoB,CAAC;AAI9E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wDAAwD,CAAC;AAEjG;;;;;;;;;;;GAWG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,kBAAkB,iBAkBjC"}
|