@aztec/pxe 0.0.1-commit.d431d1c → 0.0.1-commit.e3c1de76
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 +1 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts +7 -5
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +56 -16
- package/dest/config/index.d.ts +3 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +17 -0
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +2 -4
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +8 -13
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +13 -10
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +5 -3
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +27 -17
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +2 -22
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +0 -37
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +10 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +19 -8
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +21 -15
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +39 -43
- package/dest/contract_sync/index.d.ts +23 -0
- package/dest/contract_sync/index.d.ts.map +1 -0
- package/dest/contract_sync/index.js +54 -0
- package/dest/debug/pxe_debug_utils.d.ts +16 -6
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +20 -10
- 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 +12 -6
- package/dest/entrypoints/client/lazy/utils.d.ts +2 -2
- package/dest/entrypoints/client/lazy/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/utils.js +13 -7
- package/dest/entrypoints/pxe_creation_options.d.ts +3 -2
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/server/index.d.ts +2 -1
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -0
- package/dest/entrypoints/server/utils.d.ts +1 -1
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +19 -8
- package/dest/events/event_service.d.ts +5 -6
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +6 -7
- package/dest/job_coordinator/job_coordinator.d.ts +3 -2
- package/dest/job_coordinator/job_coordinator.d.ts.map +1 -1
- package/dest/job_coordinator/job_coordinator.js +3 -2
- package/dest/logs/log_service.d.ts +5 -4
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +18 -15
- package/dest/notes/note_service.d.ts +6 -6
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +14 -14
- package/dest/oracle_version.d.ts +3 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +4 -3
- package/dest/private_kernel/private_kernel_execution_prover.d.ts +3 -2
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +2 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts +3 -3
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/pxe.d.ts +1 -1
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +19 -15
- package/dest/storage/address_store/address_store.d.ts +1 -1
- package/dest/storage/address_store/address_store.d.ts.map +1 -1
- package/dest/storage/address_store/address_store.js +12 -11
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts +9 -1
- package/dest/storage/anchor_block_store/anchor_block_store.d.ts.map +1 -1
- package/dest/storage/anchor_block_store/anchor_block_store.js +8 -1
- package/dest/storage/capsule_store/capsule_store.js +6 -8
- package/dest/storage/contract_store/contract_store.d.ts +1 -2
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +22 -25
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +48 -50
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +276 -252
- package/dest/storage/note_store/stored_note.d.ts +16 -0
- package/dest/storage/note_store/stored_note.d.ts.map +1 -0
- package/dest/storage/note_store/stored_note.js +43 -0
- package/dest/storage/private_event_store/private_event_store.d.ts +17 -4
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
- package/dest/storage/private_event_store/private_event_store.js +198 -147
- package/dest/storage/private_event_store/stored_private_event.d.ts +23 -0
- package/dest/storage/private_event_store/stored_private_event.d.ts.map +1 -0
- package/dest/storage/private_event_store/stored_private_event.js +56 -0
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +1 -1
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/recipient_tagging_store.js +31 -19
- package/dest/storage/tagging_store/sender_address_book_store.d.ts +1 -1
- package/dest/storage/tagging_store/sender_address_book_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_address_book_store.js +20 -14
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +183 -113
- package/dest/tagging/get_all_logs_by_tags.d.ts +24 -0
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -0
- package/dest/tagging/get_all_logs_by_tags.js +46 -0
- package/dest/tagging/index.d.ts +2 -1
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +3 -2
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +2 -2
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +3 -2
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +5 -2
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +3 -2
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +2 -2
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.js +5 -8
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +3 -2
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.js +7 -4
- package/package.json +16 -16
- package/src/bin/check_oracle_version.ts +1 -0
- package/src/block_synchronizer/block_synchronizer.ts +70 -33
- package/src/config/index.ts +14 -0
- package/src/contract_function_simulator/contract_function_simulator.ts +7 -15
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -1
- package/src/contract_function_simulator/oracle/interfaces.ts +18 -9
- package/src/contract_function_simulator/oracle/oracle.ts +34 -21
- package/src/contract_function_simulator/oracle/private_execution.ts +1 -60
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +32 -10
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +59 -51
- package/src/contract_sync/index.ts +98 -0
- package/src/debug/pxe_debug_utils.ts +26 -11
- package/src/entrypoints/client/bundle/utils.ts +7 -14
- package/src/entrypoints/client/lazy/utils.ts +8 -14
- package/src/entrypoints/pxe_creation_options.ts +2 -1
- package/src/entrypoints/server/index.ts +1 -0
- package/src/entrypoints/server/utils.ts +15 -19
- package/src/events/event_service.ts +5 -7
- package/src/job_coordinator/job_coordinator.ts +4 -3
- package/src/logs/log_service.ts +29 -13
- package/src/notes/note_service.ts +21 -20
- package/src/oracle_version.ts +4 -3
- package/src/private_kernel/private_kernel_execution_prover.ts +6 -3
- package/src/private_kernel/private_kernel_oracle.ts +2 -2
- package/src/pxe.ts +48 -17
- package/src/storage/address_store/address_store.ts +15 -15
- package/src/storage/anchor_block_store/anchor_block_store.ts +8 -0
- package/src/storage/capsule_store/capsule_store.ts +8 -8
- package/src/storage/contract_store/contract_store.ts +22 -31
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +314 -318
- package/src/storage/note_store/stored_note.ts +48 -0
- package/src/storage/private_event_store/private_event_store.ts +250 -190
- package/src/storage/private_event_store/stored_private_event.ts +73 -0
- package/src/storage/tagging_store/recipient_tagging_store.ts +31 -21
- package/src/storage/tagging_store/sender_address_book_store.ts +20 -14
- package/src/storage/tagging_store/sender_tagging_store.ts +210 -126
- package/src/tagging/get_all_logs_by_tags.ts +68 -0
- package/src/tagging/index.ts +1 -0
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +11 -1
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +7 -1
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +3 -1
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +5 -17
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +12 -3
- package/dest/tree_membership/tree_membership_service.d.ts +0 -50
- package/dest/tree_membership/tree_membership_service.d.ts.map +0 -1
- package/dest/tree_membership/tree_membership_service.js +0 -75
- package/src/tree_membership/tree_membership_service.ts +0 -97
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qCAAqC,EAAE,MAAM,iEAAiE,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tagging/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,qCAAqC,EAAE,MAAM,iEAAiE,CAAC;AACxH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8CAA8C,CAAC;AACxF,OAAO,EAAE,sCAAsC,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,uBAAuB,EAAE,kCAAkC,EAAE,MAAM,2BAA2B,CAAC;AAGxG,OAAO,EAAE,2BAA2B,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACjF,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dest/tagging/index.js
CHANGED
|
@@ -10,5 +10,6 @@
|
|
|
10
10
|
*/ export { loadPrivateLogsForSenderRecipientPair } from './recipient_sync/load_private_logs_for_sender_recipient_pair.js';
|
|
11
11
|
export { syncSenderTaggingIndexes } from './sender_sync/sync_sender_tagging_indexes.js';
|
|
12
12
|
export { UNFINALIZED_TAGGING_INDEXES_WINDOW_LEN } from './constants.js';
|
|
13
|
+
export { getAllPrivateLogsByTags, getAllPublicLogsByTagsFromContract } from './get_all_logs_by_tags.js';
|
|
13
14
|
// Re-export tagging-related types from stdlib
|
|
14
15
|
export { DirectionalAppTaggingSecret, Tag, SiloedTag } from '@aztec/stdlib/logs';
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import type { BlockHash } from '@aztec/stdlib/block';
|
|
3
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
4
5
|
import type { DirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
5
6
|
import type { RecipientTaggingStore } from '../../storage/tagging_store/recipient_tagging_store.js';
|
|
@@ -10,5 +11,5 @@ import type { RecipientTaggingStore } from '../../storage/tagging_store/recipien
|
|
|
10
11
|
* @dev This function can be safely executed "in parallel" for other sender-recipient pairs because the data in
|
|
11
12
|
* in the tagging data provider is indexed by the secret and hence completely disjoint.
|
|
12
13
|
*/
|
|
13
|
-
export declare function loadPrivateLogsForSenderRecipientPair(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockNumber: BlockNumber, jobId: string): Promise<TxScopedL2Log[]>;
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
14
|
+
export declare function loadPrivateLogsForSenderRecipientPair(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: RecipientTaggingStore, anchorBlockNumber: BlockNumber, anchorBlockHash: BlockHash, jobId: string): Promise<TxScopedL2Log[]>;
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvbG9hZF9wcml2YXRlX2xvZ3NfZm9yX3NlbmRlcl9yZWNpcGllbnRfcGFpci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBRSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUVyRixPQUFPLEtBQUssRUFBRSxxQkFBcUIsRUFBRSxNQUFNLHdEQUF3RCxDQUFDO0FBS3BHOzs7Ozs7R0FNRztBQUNILHdCQUFzQixxQ0FBcUMsQ0FDekQsTUFBTSxFQUFFLDJCQUEyQixFQUNuQyxHQUFHLEVBQUUsWUFBWSxFQUNqQixTQUFTLEVBQUUsU0FBUyxFQUNwQixZQUFZLEVBQUUscUJBQXFCLEVBQ25DLGlCQUFpQixFQUFFLFdBQVcsRUFDOUIsZUFBZSxFQUFFLFNBQVMsRUFDMUIsS0FBSyxFQUFFLE1BQU0sR0FDWixPQUFPLENBQUMsYUFBYSxFQUFFLENBQUMsQ0FvSDFCIn0=
|
|
@@ -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;AAErF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,EAC9B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,EAAE,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,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAErF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wDAAwD,CAAC;AAKpG;;;;;;GAMG;AACH,wBAAsB,qCAAqC,CACzD,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,qBAAqB,EACnC,iBAAiB,EAAE,WAAW,EAC9B,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,aAAa,EAAE,CAAC,CAoH1B"}
|
|
@@ -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, taggingStore, anchorBlockNumber, jobId) {
|
|
10
|
+
*/ export async function loadPrivateLogsForSenderRecipientPair(secret, app, aztecNode, taggingStore, anchorBlockNumber, anchorBlockHash, jobId) {
|
|
11
11
|
// # Explanation of how the algorithm works
|
|
12
12
|
// When we perform the sync we will look at logs that correspond to the tagging index range
|
|
13
13
|
// (highestAgedIndex, highestFinalizedIndex + WINDOW_LEN]
|
|
@@ -72,7 +72,7 @@ import { loadLogsForRange } from './utils/load_logs_for_range.js';
|
|
|
72
72
|
const logs = [];
|
|
73
73
|
while(true){
|
|
74
74
|
// Get private logs with their block timestamps and corresponding tagging indexes
|
|
75
|
-
const privateLogsWithIndexes = await loadLogsForRange(secret, app, aztecNode, start, end, anchorBlockNumber);
|
|
75
|
+
const privateLogsWithIndexes = await loadLogsForRange(secret, app, aztecNode, start, end, anchorBlockNumber, anchorBlockHash);
|
|
76
76
|
if (privateLogsWithIndexes.length === 0) {
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import type { BlockHash } from '@aztec/stdlib/block';
|
|
3
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
4
5
|
import type { DirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/logs';
|
|
5
6
|
/**
|
|
@@ -7,8 +8,8 @@ import type { DirectionalAppTaggingSecret, TxScopedL2Log } from '@aztec/stdlib/l
|
|
|
7
8
|
* `secret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and `end` is
|
|
8
9
|
* exclusive.
|
|
9
10
|
*/
|
|
10
|
-
export declare function loadLogsForRange(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, start: number, end: number, anchorBlockNumber: BlockNumber): Promise<Array<{
|
|
11
|
+
export declare function loadLogsForRange(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, start: number, end: number, anchorBlockNumber: BlockNumber, anchorBlockHash: BlockHash): Promise<Array<{
|
|
11
12
|
log: TxScopedL2Log;
|
|
12
13
|
taggingIndex: number;
|
|
13
14
|
}>>;
|
|
14
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9sb2dzX2Zvcl9yYW5nZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvcmVjaXBpZW50X3N5bmMvdXRpbHMvbG9hZF9sb2dzX2Zvcl9yYW5nZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNuRSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBVSxhQUFhLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUs3Rjs7OztHQUlHO0FBQ0gsd0JBQXNCLGdCQUFnQixDQUNwQyxNQUFNLEVBQUUsMkJBQTJCLEVBQ25DLEdBQUcsRUFBRSxZQUFZLEVBQ2pCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLEtBQUssRUFBRSxNQUFNLEVBQ2IsR0FBRyxFQUFFLE1BQU0sRUFDWCxpQkFBaUIsRUFBRSxXQUFXLEVBQzlCLGVBQWUsRUFBRSxTQUFTLEdBQ3pCLE9BQU8sQ0FBQyxLQUFLLENBQUM7SUFBRSxHQUFHLEVBQUUsYUFBYSxDQUFDO0lBQUMsWUFBWSxFQUFFLE1BQU0sQ0FBQTtDQUFFLENBQUMsQ0FBQyxDQTBCOUQifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load_logs_for_range.d.ts","sourceRoot":"","sources":["../../../../src/tagging/recipient_sync/utils/load_logs_for_range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"load_logs_for_range.d.ts","sourceRoot":"","sources":["../../../../src/tagging/recipient_sync/utils/load_logs_for_range.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,2BAA2B,EAAU,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAK7F;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,2BAA2B,EACnC,GAAG,EAAE,YAAY,EACjB,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,MAAM,EACb,GAAG,EAAE,MAAM,EACX,iBAAiB,EAAE,WAAW,EAC9B,eAAe,EAAE,SAAS,GACzB,OAAO,CAAC,KAAK,CAAC;IAAE,GAAG,EAAE,aAAa,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CA0B9D"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { SiloedTag, Tag } from '@aztec/stdlib/logs';
|
|
2
|
+
import { getAllPrivateLogsByTags } from '../../get_all_logs_by_tags.js';
|
|
2
3
|
/**
|
|
3
4
|
* Gets private logs with their corresponding block timestamps and tagging indexes for the given index range, `app` and
|
|
4
5
|
* `secret`. At most load logs from blocks up to and including `anchorBlockNumber`. `start` is inclusive and `end` is
|
|
5
6
|
* exclusive.
|
|
6
|
-
*/ export async function loadLogsForRange(secret, app, aztecNode, start, end, anchorBlockNumber) {
|
|
7
|
+
*/ export async function loadLogsForRange(secret, app, aztecNode, start, end, anchorBlockNumber, anchorBlockHash) {
|
|
7
8
|
// Derive tags for the window
|
|
8
9
|
const preTags = Array(end - start).fill(0).map((_, i)=>({
|
|
9
10
|
secret,
|
|
10
11
|
index: start + i
|
|
11
12
|
}));
|
|
12
13
|
const siloedTags = await Promise.all(preTags.map((preTag)=>Tag.compute(preTag))).then((tags)=>Promise.all(tags.map((tag)=>SiloedTag.compute(tag, app))));
|
|
13
|
-
|
|
14
|
+
// We use the utility function below to retrieve all logs for the tags across all pages, so we don't need to handle
|
|
15
|
+
// pagination here.
|
|
16
|
+
const logs = await getAllPrivateLogsByTags(aztecNode, siloedTags, anchorBlockHash);
|
|
14
17
|
// Pair logs with their corresponding tagging indexes
|
|
15
18
|
const logsWithIndexes = [];
|
|
16
19
|
for(let i = 0; i < logs.length; i++){
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
|
+
import type { BlockHash } from '@aztec/stdlib/block';
|
|
2
3
|
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
3
4
|
import type { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
|
|
4
5
|
import type { SenderTaggingStore } from '../../storage/tagging_store/sender_tagging_store.js';
|
|
@@ -16,5 +17,5 @@ import type { SenderTaggingStore } from '../../storage/tagging_store/sender_tagg
|
|
|
16
17
|
* @dev This function looks for new indexes, adds them to pending, then it checks status of each pending index and
|
|
17
18
|
* updates its status accordingly.
|
|
18
19
|
*/
|
|
19
|
-
export declare function syncSenderTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: SenderTaggingStore, jobId: string): Promise<void>;
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
export declare function syncSenderTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, aztecNode: AztecNode, taggingStore: SenderTaggingStore, anchorBlockHash: BlockHash, jobId: string): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY19zZW5kZXJfdGFnZ2luZ19pbmRleGVzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdGFnZ2luZy9zZW5kZXJfc3luYy9zeW5jX3NlbmRlcl90YWdnaW5nX2luZGV4ZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDckQsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDakUsT0FBTyxLQUFLLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUV0RSxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBSzlGOzs7Ozs7Ozs7Ozs7O0dBYUc7QUFDSCx3QkFBc0Isd0JBQXdCLENBQzVDLE1BQU0sRUFBRSwyQkFBMkIsRUFDbkMsR0FBRyxFQUFFLFlBQVksRUFDakIsU0FBUyxFQUFFLFNBQVMsRUFDcEIsWUFBWSxFQUFFLGtCQUFrQixFQUNoQyxlQUFlLEVBQUUsU0FBUyxFQUMxQixLQUFLLEVBQUUsTUFBTSxHQUNaLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FtRWYifQ==
|
|
@@ -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,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,EAChC,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAmEf"}
|
|
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,qBAAqB,CAAC;AACrD,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,EAChC,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAmEf"}
|
|
@@ -14,7 +14,7 @@ import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_taggin
|
|
|
14
14
|
* is simply the highest pending index plus one (or finalized if pending is undefined).
|
|
15
15
|
* @dev This function looks for new indexes, adds them to pending, then it checks status of each pending index and
|
|
16
16
|
* updates its status accordingly.
|
|
17
|
-
*/ export async function syncSenderTaggingIndexes(secret, app, aztecNode, taggingStore, jobId) {
|
|
17
|
+
*/ export async function syncSenderTaggingIndexes(secret, app, aztecNode, taggingStore, anchorBlockHash, jobId) {
|
|
18
18
|
// # Explanation of how syncing works
|
|
19
19
|
//
|
|
20
20
|
// When choosing an index, we select: highest pending index + 1 (or highest finalized index + 1 if no pending).
|
|
@@ -40,7 +40,7 @@ import { loadAndStoreNewTaggingIndexes } from './utils/load_and_store_new_taggin
|
|
|
40
40
|
while(true){
|
|
41
41
|
// Load and store indexes for the current window. These indexes may already exist in the database if txs using
|
|
42
42
|
// them were previously sent from this PXE. Any duplicates are handled by the tagging data provider.
|
|
43
|
-
await loadAndStoreNewTaggingIndexes(secret, app, start, end, aztecNode, taggingStore, jobId);
|
|
43
|
+
await loadAndStoreNewTaggingIndexes(secret, app, start, end, aztecNode, taggingStore, anchorBlockHash, jobId);
|
|
44
44
|
// Retrieve all indexes within the current window from storage and update their status accordingly.
|
|
45
45
|
const pendingTxHashes = await taggingStore.getTxHashesOfPendingIndexes(secret, start, end, jobId);
|
|
46
46
|
if (pendingTxHashes.length === 0) {
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0X3N0YXR1c19jaGFuZ2Vfb2ZfcGVuZGluZy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvc2VuZGVyX3N5bmMvdXRpbHMvZ2V0X3N0YXR1c19jaGFuZ2Vfb2ZfcGVuZGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEVBQUUsTUFBTSxFQUFZLE1BQU0sa0JBQWtCLENBQUM7QUFFcEQ7OztHQUdHO0FBQ0gsd0JBQXNCLHdCQUF3QixDQUM1QyxPQUFPLEVBQUUsTUFBTSxFQUFFLEVBQ2pCLFNBQVMsRUFBRSxTQUFTLEdBQ25CLE9BQU8sQ0FBQztJQUFFLGtCQUFrQixFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQUMsY0FBYyxFQUFFLE1BQU0sRUFBRSxDQUFBO0NBQUUsQ0FBQyxDQXlCckUifQ==
|
|
@@ -1 +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,
|
|
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,CAyBrE"}
|
|
@@ -3,26 +3,23 @@ import { TxStatus } from '@aztec/stdlib/tx';
|
|
|
3
3
|
* Based on receipts obtained from `aztecNode` returns which pending transactions changed their status to finalized or
|
|
4
4
|
* dropped.
|
|
5
5
|
*/ export async function getStatusChangeOfPending(pending, aztecNode) {
|
|
6
|
-
// Get receipts for all pending tx hashes
|
|
7
|
-
const
|
|
8
|
-
Promise.all(pending.map((pendingTxHash)=>aztecNode.getTxReceipt(pendingTxHash))),
|
|
9
|
-
aztecNode.getL2Tips()
|
|
10
|
-
]);
|
|
6
|
+
// Get receipts for all pending tx hashes.
|
|
7
|
+
const receipts = await Promise.all(pending.map((pendingTxHash)=>aztecNode.getTxReceipt(pendingTxHash)));
|
|
11
8
|
const txHashesToFinalize = [];
|
|
12
9
|
const txHashesToDrop = [];
|
|
13
10
|
for(let i = 0; i < receipts.length; i++){
|
|
14
11
|
const receipt = receipts[i];
|
|
15
12
|
const txHash = pending[i];
|
|
16
|
-
if (receipt.status === TxStatus.
|
|
13
|
+
if (receipt.status === TxStatus.FINALIZED && receipt.hasExecutionSucceeded()) {
|
|
17
14
|
// Tx has been included in a block and the corresponding block is finalized --> we mark the indexes as
|
|
18
15
|
// finalized.
|
|
19
16
|
txHashesToFinalize.push(txHash);
|
|
20
|
-
} else if (receipt.
|
|
17
|
+
} else if (receipt.isDropped() || receipt.hasExecutionReverted()) {
|
|
21
18
|
// Tx was dropped or reverted --> we drop the corresponding pending indexes.
|
|
22
19
|
// TODO(#17615): Don't drop pending indexes corresponding to non-revertible phases.
|
|
23
20
|
txHashesToDrop.push(txHash);
|
|
24
21
|
} else {
|
|
25
|
-
// Tx is still pending or
|
|
22
|
+
// Tx is still pending, not yet finalized, or was mined successfully but not yet finalized --> we don't do anything.
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
25
|
return {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
2
|
+
import type { BlockHash } from '@aztec/stdlib/block';
|
|
2
3
|
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
3
4
|
import type { DirectionalAppTaggingSecret } from '@aztec/stdlib/logs';
|
|
4
5
|
import type { SenderTaggingStore } from '../../../storage/tagging_store/sender_tagging_store.js';
|
|
@@ -16,5 +17,5 @@ import type { SenderTaggingStore } from '../../../storage/tagging_store/sender_t
|
|
|
16
17
|
* @param jobId - Job identifier, used to keep writes in-memory until they can be persisted in a data integrity
|
|
17
18
|
* preserving way.
|
|
18
19
|
*/
|
|
19
|
-
export declare function loadAndStoreNewTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, start: number, end: number, aztecNode: AztecNode, taggingStore: SenderTaggingStore, jobId: string): Promise<void>;
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
export declare function loadAndStoreNewTaggingIndexes(secret: DirectionalAppTaggingSecret, app: AztecAddress, start: number, end: number, aztecNode: AztecNode, taggingStore: SenderTaggingStore, anchorBlockHash: BlockHash, jobId: string): Promise<void>;
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9hZF9hbmRfc3RvcmVfbmV3X3RhZ2dpbmdfaW5kZXhlcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL3RhZ2dpbmcvc2VuZGVyX3N5bmMvdXRpbHMvbG9hZF9hbmRfc3RvcmVfbmV3X3RhZ2dpbmdfaW5kZXhlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUNyRCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUNqRSxPQUFPLEtBQUssRUFBRSwyQkFBMkIsRUFBVSxNQUFNLG9CQUFvQixDQUFDO0FBSTlFLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0RBQXdELENBQUM7QUFHakc7Ozs7Ozs7Ozs7Ozs7R0FhRztBQUNILHdCQUFzQiw2QkFBNkIsQ0FDakQsTUFBTSxFQUFFLDJCQUEyQixFQUNuQyxHQUFHLEVBQUUsWUFBWSxFQUNqQixLQUFLLEVBQUUsTUFBTSxFQUNiLEdBQUcsRUFBRSxNQUFNLEVBQ1gsU0FBUyxFQUFFLFNBQVMsRUFDcEIsWUFBWSxFQUFFLGtCQUFrQixFQUNoQyxlQUFlLEVBQUUsU0FBUyxFQUMxQixLQUFLLEVBQUUsTUFBTSxpQkFrQmQifQ==
|
|
@@ -1 +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;
|
|
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,qBAAqB,CAAC;AACrD,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;AAGjG;;;;;;;;;;;;;GAaG;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,EAChC,eAAe,EAAE,SAAS,EAC1B,KAAK,EAAE,MAAM,iBAkBd"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { SiloedTag, Tag } from '@aztec/stdlib/logs';
|
|
2
2
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
3
|
+
import { getAllPrivateLogsByTags } from '../../get_all_logs_by_tags.js';
|
|
3
4
|
/**
|
|
4
5
|
* Loads tagging indexes from the Aztec node and stores them in the tagging data provider.
|
|
5
6
|
* @remarks This function is one of two places by which a pending index can get to the tagging data provider. The other
|
|
@@ -13,14 +14,14 @@ import { TxHash } from '@aztec/stdlib/tx';
|
|
|
13
14
|
* @param taggingStore - The data provider to store pending indexes.
|
|
14
15
|
* @param jobId - Job identifier, used to keep writes in-memory until they can be persisted in a data integrity
|
|
15
16
|
* preserving way.
|
|
16
|
-
*/ export async function loadAndStoreNewTaggingIndexes(secret, app, start, end, aztecNode, taggingStore, jobId) {
|
|
17
|
+
*/ export async function loadAndStoreNewTaggingIndexes(secret, app, start, end, aztecNode, taggingStore, anchorBlockHash, jobId) {
|
|
17
18
|
// We compute the tags for the current window of indexes
|
|
18
19
|
const preTagsForWindow = Array(end - start).fill(0).map((_, i)=>({
|
|
19
20
|
secret,
|
|
20
21
|
index: start + i
|
|
21
22
|
}));
|
|
22
23
|
const siloedTagsForWindow = await Promise.all(preTagsForWindow.map(async (preTag)=>SiloedTag.compute(await Tag.compute(preTag), app)));
|
|
23
|
-
const txsForTags = await getTxsContainingTags(siloedTagsForWindow, aztecNode);
|
|
24
|
+
const txsForTags = await getTxsContainingTags(siloedTagsForWindow, aztecNode, anchorBlockHash);
|
|
24
25
|
const highestIndexMap = getTxHighestIndexMap(txsForTags, preTagsForWindow);
|
|
25
26
|
// Now we iterate over the map, reconstruct the preTags and tx hash and store them in the db.
|
|
26
27
|
for (const [txHashStr, highestIndex] of highestIndexMap.entries()){
|
|
@@ -35,8 +36,10 @@ import { TxHash } from '@aztec/stdlib/tx';
|
|
|
35
36
|
}
|
|
36
37
|
// Returns txs that used the given tags. A tag might have been used in multiple txs and for this reason we return
|
|
37
38
|
// an array for each tag.
|
|
38
|
-
async function getTxsContainingTags(tags, aztecNode) {
|
|
39
|
-
|
|
39
|
+
async function getTxsContainingTags(tags, aztecNode, anchorBlockHash) {
|
|
40
|
+
// We use the utility function below to retrieve all logs for the tags across all pages, so we don't need to handle
|
|
41
|
+
// pagination here.
|
|
42
|
+
const allLogs = await getAllPrivateLogsByTags(aztecNode, tags, anchorBlockHash);
|
|
40
43
|
return allLogs.map((logs)=>logs.map((log)=>log.txHash));
|
|
41
44
|
}
|
|
42
45
|
// Returns a map of txHash to the highest index for that txHash.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.e3c1de76",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/entrypoints/server/index.js",
|
|
@@ -61,19 +61,19 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
65
|
-
"@aztec/bb.js": "0.0.1-commit.
|
|
66
|
-
"@aztec/builder": "0.0.1-commit.
|
|
67
|
-
"@aztec/constants": "0.0.1-commit.
|
|
68
|
-
"@aztec/ethereum": "0.0.1-commit.
|
|
69
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
70
|
-
"@aztec/key-store": "0.0.1-commit.
|
|
71
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
72
|
-
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.
|
|
73
|
-
"@aztec/noir-types": "0.0.1-commit.
|
|
74
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
75
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
76
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
64
|
+
"@aztec/bb-prover": "0.0.1-commit.e3c1de76",
|
|
65
|
+
"@aztec/bb.js": "0.0.1-commit.e3c1de76",
|
|
66
|
+
"@aztec/builder": "0.0.1-commit.e3c1de76",
|
|
67
|
+
"@aztec/constants": "0.0.1-commit.e3c1de76",
|
|
68
|
+
"@aztec/ethereum": "0.0.1-commit.e3c1de76",
|
|
69
|
+
"@aztec/foundation": "0.0.1-commit.e3c1de76",
|
|
70
|
+
"@aztec/key-store": "0.0.1-commit.e3c1de76",
|
|
71
|
+
"@aztec/kv-store": "0.0.1-commit.e3c1de76",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "0.0.1-commit.e3c1de76",
|
|
73
|
+
"@aztec/noir-types": "0.0.1-commit.e3c1de76",
|
|
74
|
+
"@aztec/protocol-contracts": "0.0.1-commit.e3c1de76",
|
|
75
|
+
"@aztec/simulator": "0.0.1-commit.e3c1de76",
|
|
76
|
+
"@aztec/stdlib": "0.0.1-commit.e3c1de76",
|
|
77
77
|
"koa": "^2.16.1",
|
|
78
78
|
"koa-router": "^13.1.1",
|
|
79
79
|
"lodash.omit": "^4.5.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@aztec/merkle-tree": "0.0.1-commit.
|
|
86
|
-
"@aztec/noir-test-contracts.js": "0.0.1-commit.
|
|
85
|
+
"@aztec/merkle-tree": "0.0.1-commit.e3c1de76",
|
|
86
|
+
"@aztec/noir-test-contracts.js": "0.0.1-commit.e3c1de76",
|
|
87
87
|
"@jest/globals": "^30.0.0",
|
|
88
88
|
"@types/jest": "^30.0.0",
|
|
89
89
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
-
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
|
+
import { type Logger, type LoggerBindings, createLogger } from '@aztec/foundation/log';
|
|
3
3
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
4
4
|
import type { L2TipsKVStore } from '@aztec/kv-store/stores';
|
|
5
|
-
import {
|
|
6
|
-
L2BlockHash,
|
|
7
|
-
L2BlockStream,
|
|
8
|
-
type L2BlockStreamEvent,
|
|
9
|
-
type L2BlockStreamEventHandler,
|
|
10
|
-
} from '@aztec/stdlib/block';
|
|
5
|
+
import { BlockHash, L2BlockStream, type L2BlockStreamEvent, type L2BlockStreamEventHandler } from '@aztec/stdlib/block';
|
|
11
6
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
7
|
+
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
12
8
|
|
|
13
|
-
import type {
|
|
9
|
+
import type { BlockSynchronizerConfig } from '../config/index.js';
|
|
14
10
|
import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
|
|
15
11
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
16
12
|
import type { PrivateEventStore } from '../storage/private_event_store/private_event_store.js';
|
|
@@ -32,23 +28,26 @@ export class BlockSynchronizer implements L2BlockStreamEventHandler {
|
|
|
32
28
|
private noteStore: NoteStore,
|
|
33
29
|
private privateEventStore: PrivateEventStore,
|
|
34
30
|
private l2TipsStore: L2TipsKVStore,
|
|
35
|
-
config: Partial<
|
|
36
|
-
|
|
31
|
+
private config: Partial<BlockSynchronizerConfig> = {},
|
|
32
|
+
bindings?: LoggerBindings,
|
|
37
33
|
) {
|
|
38
|
-
this.log =
|
|
39
|
-
!loggerOrSuffix || typeof loggerOrSuffix === 'string'
|
|
40
|
-
? createLogger(loggerOrSuffix ? `pxe:block_synchronizer:${loggerOrSuffix}` : `pxe:block_synchronizer`)
|
|
41
|
-
: loggerOrSuffix;
|
|
34
|
+
this.log = createLogger('pxe:block_synchronizer', bindings);
|
|
42
35
|
this.blockStream = this.createBlockStream(config);
|
|
43
36
|
}
|
|
44
37
|
|
|
45
|
-
protected createBlockStream(config: Partial<
|
|
46
|
-
return new L2BlockStream(
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
protected createBlockStream(config: Partial<BlockSynchronizerConfig>): L2BlockStream {
|
|
39
|
+
return new L2BlockStream(
|
|
40
|
+
this.node,
|
|
41
|
+
this.l2TipsStore,
|
|
42
|
+
this,
|
|
43
|
+
createLogger('pxe:block_stream', this.log.getBindings()),
|
|
44
|
+
{
|
|
45
|
+
batchSize: config.l2BlockBatchSize,
|
|
46
|
+
// Skipping finalized blocks makes us sync much faster - we only need to download blocks other than the latest one
|
|
47
|
+
// in order to detect reorgs, and there can be no reorgs on finalized block, making this safe.
|
|
48
|
+
skipFinalized: true,
|
|
49
|
+
},
|
|
50
|
+
);
|
|
52
51
|
}
|
|
53
52
|
|
|
54
53
|
/** Handle events emitted by the block stream. */
|
|
@@ -57,23 +56,55 @@ export class BlockSynchronizer implements L2BlockStreamEventHandler {
|
|
|
57
56
|
|
|
58
57
|
switch (event.type) {
|
|
59
58
|
case 'blocks-added': {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
if (this.config.syncChainTip === undefined || this.config.syncChainTip === 'proposed') {
|
|
60
|
+
const lastBlock = event.blocks.at(-1)!;
|
|
61
|
+
await this.updateAnchorBlockHeader(lastBlock.header);
|
|
62
|
+
}
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
65
|
+
case 'chain-checkpointed': {
|
|
66
|
+
if (this.config.syncChainTip === 'checkpointed') {
|
|
67
|
+
// Get the last block header from the checkpoint
|
|
68
|
+
const lastBlock = event.checkpoint.checkpoint.blocks.at(-1)!;
|
|
69
|
+
await this.updateAnchorBlockHeader(lastBlock.header);
|
|
70
|
+
}
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
case 'chain-proven': {
|
|
74
|
+
if (this.config.syncChainTip === 'proven') {
|
|
75
|
+
const blockHeader = await this.node.getBlockHeader(BlockNumber(event.block.number));
|
|
76
|
+
if (blockHeader) {
|
|
77
|
+
await this.updateAnchorBlockHeader(blockHeader);
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case 'chain-finalized': {
|
|
83
|
+
if (this.config.syncChainTip === 'finalized') {
|
|
84
|
+
const blockHeader = await this.node.getBlockHeader(BlockNumber(event.block.number));
|
|
85
|
+
if (blockHeader) {
|
|
86
|
+
await this.updateAnchorBlockHeader(blockHeader);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
67
89
|
break;
|
|
68
90
|
}
|
|
69
91
|
case 'chain-pruned': {
|
|
92
|
+
const currentAnchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
93
|
+
const currentAnchorBlockNumber = currentAnchorBlockHeader.getBlockNumber();
|
|
94
|
+
if (currentAnchorBlockNumber <= event.block.number) {
|
|
95
|
+
this.log.verbose(
|
|
96
|
+
`Ignoring prune event to block ${event.block.number} greater than current anchor block ${currentAnchorBlockNumber}`,
|
|
97
|
+
{ pruneEvent: event, currentAnchorBlockHeader: currentAnchorBlockHeader.toInspect() },
|
|
98
|
+
);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
|
|
70
102
|
this.log.warn(`Pruning data after block ${event.block.number} due to reorg`);
|
|
71
103
|
|
|
72
|
-
const oldAnchorBlockNumber = (await this.anchorBlockStore.getBlockHeader()).getBlockNumber();
|
|
73
104
|
// Note that the following is not necessarily the anchor block that will be used in the transaction - if
|
|
74
105
|
// the chain has already moved past the reorg, we'll also see blocks-added events that will push the anchor
|
|
75
106
|
// forward.
|
|
76
|
-
const newAnchorBlockHeader = await this.node.getBlockHeader(
|
|
107
|
+
const newAnchorBlockHeader = await this.node.getBlockHeader(BlockHash.fromString(event.block.hash));
|
|
77
108
|
|
|
78
109
|
if (!newAnchorBlockHeader) {
|
|
79
110
|
throw new Error(
|
|
@@ -83,15 +114,21 @@ export class BlockSynchronizer implements L2BlockStreamEventHandler {
|
|
|
83
114
|
|
|
84
115
|
// Operations are wrapped in a single transaction to ensure atomicity.
|
|
85
116
|
await this.store.transactionAsync(async () => {
|
|
86
|
-
await this.noteStore.rollback(event.block.number,
|
|
87
|
-
await this.privateEventStore.rollback(event.block.number,
|
|
88
|
-
await this.
|
|
117
|
+
await this.noteStore.rollback(event.block.number, currentAnchorBlockNumber);
|
|
118
|
+
await this.privateEventStore.rollback(event.block.number, currentAnchorBlockNumber);
|
|
119
|
+
await this.updateAnchorBlockHeader(newAnchorBlockHeader);
|
|
89
120
|
});
|
|
90
121
|
break;
|
|
91
122
|
}
|
|
92
123
|
}
|
|
93
124
|
}
|
|
94
125
|
|
|
126
|
+
/** Updates the anchor block header to the target block */
|
|
127
|
+
private async updateAnchorBlockHeader(blockHeader: BlockHeader) {
|
|
128
|
+
this.log.verbose(`Updated pxe last block to ${blockHeader.getBlockNumber()}`, blockHeader.toInspect());
|
|
129
|
+
await this.anchorBlockStore.setHeader(blockHeader);
|
|
130
|
+
}
|
|
131
|
+
|
|
95
132
|
/**
|
|
96
133
|
* Syncs PXE and the node by downloading the metadata of the latest blocks, allowing simulations to use
|
|
97
134
|
* recent data (e.g. notes), and handling any reorgs that might have occurred.
|
package/src/config/index.ts
CHANGED
|
@@ -24,6 +24,8 @@ export interface KernelProverConfig {
|
|
|
24
24
|
export interface BlockSynchronizerConfig {
|
|
25
25
|
/** Maximum amount of blocks to pull from the stream in one request when synchronizing */
|
|
26
26
|
l2BlockBatchSize: number;
|
|
27
|
+
/** Which chain tip to sync to (proposed, checkpointed, proven, finalized) */
|
|
28
|
+
syncChainTip?: 'proposed' | 'checkpointed' | 'proven' | 'finalized';
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
export type PXEConfig = KernelProverConfig & DataStoreConfig & ChainConfig & BlockSynchronizerConfig;
|
|
@@ -53,6 +55,18 @@ export const pxeConfigMappings: ConfigMappingsType<PXEConfig> = {
|
|
|
53
55
|
description: 'Enable real proofs',
|
|
54
56
|
...booleanConfigHelper(true),
|
|
55
57
|
},
|
|
58
|
+
syncChainTip: {
|
|
59
|
+
env: 'PXE_SYNC_CHAIN_TIP',
|
|
60
|
+
description: 'Which chain tip to sync to (proposed, checkpointed, proven, finalized)',
|
|
61
|
+
defaultValue: 'proposed',
|
|
62
|
+
parseEnv: (val: string) => {
|
|
63
|
+
const allowedValues = ['proposed', 'checkpointed', 'proven', 'finalized'];
|
|
64
|
+
if (allowedValues.includes(val)) {
|
|
65
|
+
return val;
|
|
66
|
+
}
|
|
67
|
+
throw new Error(`Invalid value for PXE_SYNC_CHAIN_TIP: ${val}. Allowed values are: ${allowedValues.join(', ')}`);
|
|
68
|
+
},
|
|
69
|
+
},
|
|
56
70
|
};
|
|
57
71
|
|
|
58
72
|
/**
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
FIXED_AVM_STARTUP_L2_GAS,
|
|
8
8
|
FIXED_DA_GAS,
|
|
9
9
|
FIXED_L2_GAS,
|
|
10
|
+
GeneratorIndex,
|
|
10
11
|
L2_GAS_PER_CONTRACT_CLASS_LOG,
|
|
11
12
|
L2_GAS_PER_PRIVATE_LOG,
|
|
12
13
|
MAX_CONTRACT_CLASS_LOGS_PER_TX,
|
|
@@ -17,7 +18,7 @@ import {
|
|
|
17
18
|
MAX_PRIVATE_LOGS_PER_TX,
|
|
18
19
|
} from '@aztec/constants';
|
|
19
20
|
import { arrayNonEmptyLength, padArrayEnd } from '@aztec/foundation/collection';
|
|
20
|
-
import {
|
|
21
|
+
import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto/poseidon';
|
|
21
22
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
22
23
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
23
24
|
import { Timer } from '@aztec/foundation/timer';
|
|
@@ -72,7 +73,6 @@ import {
|
|
|
72
73
|
} from '@aztec/stdlib/tx';
|
|
73
74
|
|
|
74
75
|
import type { AddressStore } from '../storage/address_store/address_store.js';
|
|
75
|
-
import type { AnchorBlockStore } from '../storage/anchor_block_store/anchor_block_store.js';
|
|
76
76
|
import type { CapsuleStore } from '../storage/capsule_store/capsule_store.js';
|
|
77
77
|
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
78
78
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
@@ -85,7 +85,7 @@ import { ExecutionNoteCache } from './execution_note_cache.js';
|
|
|
85
85
|
import { ExecutionTaggingIndexCache } from './execution_tagging_index_cache.js';
|
|
86
86
|
import { HashedValuesCache } from './hashed_values_cache.js';
|
|
87
87
|
import { Oracle } from './oracle/oracle.js';
|
|
88
|
-
import { executePrivateFunction
|
|
88
|
+
import { executePrivateFunction } from './oracle/private_execution.js';
|
|
89
89
|
import { PrivateExecutionOracle } from './oracle/private_execution_oracle.js';
|
|
90
90
|
import { UtilityExecutionOracle } from './oracle/utility_execution_oracle.js';
|
|
91
91
|
|
|
@@ -101,7 +101,6 @@ export class ContractFunctionSimulator {
|
|
|
101
101
|
private keyStore: KeyStore,
|
|
102
102
|
private addressStore: AddressStore,
|
|
103
103
|
private aztecNode: AztecNode,
|
|
104
|
-
private anchorBlockStore: AnchorBlockStore,
|
|
105
104
|
private senderTaggingStore: SenderTaggingStore,
|
|
106
105
|
private recipientTaggingStore: RecipientTaggingStore,
|
|
107
106
|
private senderAddressBookStore: SenderAddressBookStore,
|
|
@@ -138,12 +137,6 @@ export class ContractFunctionSimulator {
|
|
|
138
137
|
): Promise<PrivateExecutionResult> {
|
|
139
138
|
const simulatorSetupTimer = new Timer();
|
|
140
139
|
|
|
141
|
-
await this.contractStore.syncPrivateState(contractAddress, selector, privateSyncCall =>
|
|
142
|
-
this.runUtility(privateSyncCall, [], anchorBlockHeader, scopes, jobId),
|
|
143
|
-
);
|
|
144
|
-
|
|
145
|
-
await verifyCurrentClassId(contractAddress, this.aztecNode, this.contractStore, anchorBlockHeader);
|
|
146
|
-
|
|
147
140
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(contractAddress, selector);
|
|
148
141
|
|
|
149
142
|
if (entryPointArtifact.functionType !== FunctionType.PRIVATE) {
|
|
@@ -188,7 +181,6 @@ export class ContractFunctionSimulator {
|
|
|
188
181
|
this.keyStore,
|
|
189
182
|
this.addressStore,
|
|
190
183
|
this.aztecNode,
|
|
191
|
-
this.anchorBlockStore,
|
|
192
184
|
this.senderTaggingStore,
|
|
193
185
|
this.recipientTaggingStore,
|
|
194
186
|
this.senderAddressBookStore,
|
|
@@ -268,8 +260,6 @@ export class ContractFunctionSimulator {
|
|
|
268
260
|
scopes: AztecAddress[] | undefined,
|
|
269
261
|
jobId: string,
|
|
270
262
|
): Promise<Fr[]> {
|
|
271
|
-
await verifyCurrentClassId(call.to, this.aztecNode, this.contractStore, anchorBlockHeader);
|
|
272
|
-
|
|
273
263
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
274
264
|
|
|
275
265
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
@@ -286,7 +276,6 @@ export class ContractFunctionSimulator {
|
|
|
286
276
|
this.keyStore,
|
|
287
277
|
this.addressStore,
|
|
288
278
|
this.aztecNode,
|
|
289
|
-
this.anchorBlockStore,
|
|
290
279
|
this.recipientTaggingStore,
|
|
291
280
|
this.senderAddressBookStore,
|
|
292
281
|
this.capsuleStore,
|
|
@@ -409,7 +398,10 @@ export async function generateSimulatedProvingResult(
|
|
|
409
398
|
|
|
410
399
|
const privateLogsFromExecution = await Promise.all(
|
|
411
400
|
execution.publicInputs.privateLogs.getActiveItems().map(async metadata => {
|
|
412
|
-
metadata.log.fields[0] = await
|
|
401
|
+
metadata.log.fields[0] = await poseidon2HashWithSeparator(
|
|
402
|
+
[contractAddress, metadata.log.fields[0]],
|
|
403
|
+
GeneratorIndex.PRIVATE_LOG_FIRST_FIELD,
|
|
404
|
+
);
|
|
413
405
|
return new OrderedSideEffect(metadata.log, metadata.counter);
|
|
414
406
|
}),
|
|
415
407
|
);
|
|
@@ -8,7 +8,7 @@ import { TxHash } from '@aztec/stdlib/tx';
|
|
|
8
8
|
const MAX_EVENT_SERIALIZED_LEN = 12;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
|
-
* Intermediate struct used to perform batch event validation by PXE. The `
|
|
11
|
+
* Intermediate struct used to perform batch event validation by PXE. The `utilityValidateAndStoreEnqueuedNotesAndEvents` oracle
|
|
12
12
|
* expects for values of this type to be stored in a `CapsuleArray`.
|
|
13
13
|
*/
|
|
14
14
|
export class EventValidationRequest {
|
|
@@ -7,7 +7,7 @@ import { TxHash } from '@aztec/stdlib/tx';
|
|
|
7
7
|
export const MAX_NOTE_PACKED_LEN = 10;
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Intermediate struct used to perform batch note validation by PXE. The `
|
|
10
|
+
* Intermediate struct used to perform batch note validation by PXE. The `utilityValidateAndStoreEnqueuedNotesAndEvents` oracle
|
|
11
11
|
* expects for values of this type to be stored in a `CapsuleArray`.
|
|
12
12
|
*/
|
|
13
13
|
export class NoteValidationRequest {
|