@aztec/pxe 3.0.0-nightly.20251222 → 3.0.0-nightly.20251224
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/contract_function_simulator/contract_function_simulator.d.ts +31 -6
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +35 -11
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +4 -3
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +7 -6
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +2 -3
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +6 -8
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution.js +10 -9
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +14 -5
- 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 -14
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +44 -6
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +135 -30
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +2 -2
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +18 -0
- package/dest/debug/pxe_debug_utils.d.ts +3 -2
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.d.ts +1 -2
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +0 -1
- package/dest/entrypoints/client/lazy/index.d.ts +1 -2
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +0 -1
- package/dest/entrypoints/server/index.d.ts +2 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -1
- package/dest/events/event_service.d.ts +15 -0
- package/dest/events/event_service.d.ts.map +1 -0
- package/dest/events/event_service.js +47 -0
- package/dest/events/private_event_filter_validator.d.ts +3 -2
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/logs/log_service.d.ts +43 -0
- package/dest/logs/log_service.d.ts.map +1 -0
- package/dest/logs/log_service.js +239 -0
- package/dest/notes/index.d.ts +2 -0
- package/dest/notes/index.d.ts.map +1 -0
- package/dest/notes/index.js +1 -0
- package/dest/notes/note_service.d.ts +48 -0
- package/dest/notes/note_service.d.ts.map +1 -0
- package/dest/notes/note_service.js +152 -0
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +2 -2
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/public_storage/public_storage_service.d.ts +24 -0
- package/dest/public_storage/public_storage_service.d.ts.map +1 -0
- package/dest/public_storage/public_storage_service.js +26 -0
- package/dest/pxe.d.ts +1 -1
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +3 -5
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts +33 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.d.ts.map +1 -1
- package/dest/storage/capsule_data_provider/capsule_data_provider.js +32 -4
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts +2 -1
- package/dest/storage/contract_data_provider/contract_data_provider.d.ts.map +1 -1
- package/dest/storage/contract_data_provider/contract_data_provider.js +11 -0
- package/dest/storage/tagging_data_provider/sender_tagging_data_provider.js +3 -3
- package/dest/tagging/index.d.ts +2 -4
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +1 -3
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +14 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +99 -0
- package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts +21 -0
- package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/new_recipient_tagging_data_provider.js +42 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts +12 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +20 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +14 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -0
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +29 -0
- package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts +2 -2
- package/dest/tagging/sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sync/sync_sender_tagging_indexes.js +3 -3
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts +1 -1
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sync/utils/load_and_store_new_tagging_indexes.js +3 -5
- package/dest/tree_membership/tree_membership_service.d.ts +52 -0
- package/dest/tree_membership/tree_membership_service.d.ts.map +1 -0
- package/dest/tree_membership/tree_membership_service.js +84 -0
- package/package.json +16 -16
- package/src/contract_function_simulator/contract_function_simulator.ts +59 -10
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +5 -4
- package/src/contract_function_simulator/oracle/interfaces.ts +1 -2
- package/src/contract_function_simulator/oracle/private_execution.ts +13 -10
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +81 -21
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +199 -38
- package/src/contract_function_simulator/proxied_contract_data_source.ts +18 -1
- package/src/debug/pxe_debug_utils.ts +2 -1
- package/src/entrypoints/client/bundle/index.ts +0 -1
- package/src/entrypoints/client/lazy/index.ts +0 -1
- package/src/entrypoints/server/index.ts +1 -1
- package/src/events/event_service.ts +77 -0
- package/src/events/private_event_filter_validator.ts +2 -1
- package/src/logs/log_service.ts +364 -0
- package/src/notes/index.ts +1 -0
- package/src/notes/note_service.ts +200 -0
- package/src/private_kernel/private_kernel_oracle_impl.ts +1 -1
- package/src/public_storage/public_storage_service.ts +33 -0
- package/src/pxe.ts +13 -11
- package/src/storage/capsule_data_provider/capsule_data_provider.ts +32 -0
- package/src/storage/contract_data_provider/contract_data_provider.ts +15 -0
- package/src/storage/tagging_data_provider/sender_tagging_data_provider.ts +3 -3
- package/src/tagging/index.ts +1 -3
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +129 -0
- package/src/tagging/recipient_sync/new_recipient_tagging_data_provider.ts +53 -0
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +34 -0
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +43 -0
- package/src/tagging/sync/sync_sender_tagging_indexes.ts +3 -3
- package/src/tagging/sync/utils/load_and_store_new_tagging_indexes.ts +3 -5
- package/src/tree_membership/tree_membership_service.ts +112 -0
- package/dest/contract_function_simulator/execution_data_provider.d.ts +0 -248
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +0 -1
- package/dest/contract_function_simulator/execution_data_provider.js +0 -14
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +0 -113
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +0 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +0 -648
- package/dest/tagging/siloed_tag.d.ts +0 -14
- package/dest/tagging/siloed_tag.d.ts.map +0 -1
- package/dest/tagging/siloed_tag.js +0 -20
- package/dest/tagging/tag.d.ts +0 -12
- package/dest/tagging/tag.d.ts.map +0 -1
- package/dest/tagging/tag.js +0 -17
- package/src/contract_function_simulator/execution_data_provider.ts +0 -322
- package/src/contract_function_simulator/pxe_oracle_interface.ts +0 -967
- package/src/tagging/siloed_tag.ts +0 -22
- package/src/tagging/tag.ts +0 -16
|
@@ -47,6 +47,24 @@ import { FunctionSelector } from '@aztec/stdlib/abi';
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
+
case 'getFunctionArtifactWithDebugMetadata':
|
|
51
|
+
{
|
|
52
|
+
return async (contractAddress, selector)=>{
|
|
53
|
+
if (overrides[contractAddress.toString()]) {
|
|
54
|
+
const { artifact } = overrides[contractAddress.toString()];
|
|
55
|
+
const functions = artifact.functions;
|
|
56
|
+
for(let i = 0; i < functions.length; i++){
|
|
57
|
+
const fn = functions[i];
|
|
58
|
+
const fnSelector = await FunctionSelector.fromNameAndParameters(fn.name, fn.parameters);
|
|
59
|
+
if (fnSelector.equals(selector)) {
|
|
60
|
+
return fn;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
} else {
|
|
64
|
+
return target.getFunctionArtifactWithDebugMetadata(contractAddress, selector);
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
50
68
|
default:
|
|
51
69
|
{
|
|
52
70
|
const value = Reflect.get(target, prop);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NoteDao, NotesFilter } from '@aztec/stdlib/note';
|
|
2
2
|
import type { PXE } from '../pxe.js';
|
|
3
|
-
import type { ContractDataProvider
|
|
3
|
+
import type { ContractDataProvider } from '../storage/contract_data_provider/contract_data_provider.js';
|
|
4
|
+
import type { NoteDataProvider } from '../storage/note_data_provider/note_data_provider.js';
|
|
4
5
|
/**
|
|
5
6
|
* Methods provided by this class might help debugging but must not be used in production.
|
|
6
7
|
* No backwards compatibility or API stability should be expected. Use at your own risk.
|
|
@@ -27,4 +28,4 @@ export declare class PXEDebugUtils {
|
|
|
27
28
|
*/
|
|
28
29
|
getNotes(filter: NotesFilter): Promise<NoteDao[]>;
|
|
29
30
|
}
|
|
30
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
31
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlX2RlYnVnX3V0aWxzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZGVidWcvcHhlX2RlYnVnX3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQztBQUUvRCxPQUFPLEtBQUssRUFBRSxHQUFHLEVBQUUsTUFBTSxXQUFXLENBQUM7QUFDckMsT0FBTyxLQUFLLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSw2REFBNkQsQ0FBQztBQUN4RyxPQUFPLEtBQUssRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHFEQUFxRCxDQUFDO0FBRTVGOzs7R0FHRztBQUNILHFCQUFhLGFBQWE7O0lBSXRCLE9BQU8sQ0FBQyxvQkFBb0I7SUFDNUIsT0FBTyxDQUFDLGdCQUFnQjtJQUYxQixZQUNVLG9CQUFvQixFQUFFLG9CQUFvQixFQUMxQyxnQkFBZ0IsRUFBRSxnQkFBZ0IsRUFDeEM7SUFFSjs7T0FFRztJQUNJLE1BQU0sQ0FBQyxHQUFHLEVBQUUsR0FBRyxRQUVyQjtJQUVEOzs7Ozs7Ozs7O09BVUc7SUFDVSxRQUFRLENBQUMsTUFBTSxFQUFFLFdBQVcsR0FBRyxPQUFPLENBQUMsT0FBTyxFQUFFLENBQUMsQ0FVN0Q7Q0FDRiJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_debug_utils.d.ts","sourceRoot":"","sources":["../../src/debug/pxe_debug_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"pxe_debug_utils.d.ts","sourceRoot":"","sources":["../../src/debug/pxe_debug_utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACrC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6DAA6D,CAAC;AACxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAE5F;;;GAGG;AACH,qBAAa,aAAa;;IAItB,OAAO,CAAC,oBAAoB;IAC5B,OAAO,CAAC,gBAAgB;IAF1B,YACU,oBAAoB,EAAE,oBAAoB,EAC1C,gBAAgB,EAAE,gBAAgB,EACxC;IAEJ;;OAEG;IACI,MAAM,CAAC,GAAG,EAAE,GAAG,QAErB;IAED;;;;;;;;;;OAUG;IACU,QAAQ,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAU7D;CACF"}
|
|
@@ -3,6 +3,5 @@ export * from '../../../config/index.js';
|
|
|
3
3
|
export * from '../../../error_enriching.js';
|
|
4
4
|
export * from '../../../storage/index.js';
|
|
5
5
|
export * from './utils.js';
|
|
6
|
-
export { PXEOracleInterface } from '../../../contract_function_simulator/pxe_oracle_interface.js';
|
|
7
6
|
export type { PXECreationOptions } from '../../pxe_creation_options.js';
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvYnVuZGxlL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsY0FBYywwQkFBMEIsQ0FBQztBQUN6QyxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsMkJBQTJCLENBQUM7QUFDMUMsY0FBYyxZQUFZLENBQUM7QUFDM0IsWUFBWSxFQUFFLGtCQUFrQixFQUFFLE1BQU0sK0JBQStCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/bundle/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/bundle/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC;AAC3B,YAAY,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -3,6 +3,5 @@ export * from '../../../config/index.js';
|
|
|
3
3
|
export * from '../../../storage/index.js';
|
|
4
4
|
export * from '../../../error_enriching.js';
|
|
5
5
|
export * from './utils.js';
|
|
6
|
-
export { PXEOracleInterface } from '../../../contract_function_simulator/pxe_oracle_interface.js';
|
|
7
6
|
export { type PXECreationOptions } from '../../pxe_creation_options.js';
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9jbGllbnQvbGF6eS9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLGlCQUFpQixDQUFDO0FBQ2hDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYywyQkFBMkIsQ0FBQztBQUMxQyxjQUFjLDZCQUE2QixDQUFDO0FBQzVDLGNBQWMsWUFBWSxDQUFDO0FBQzNCLE9BQU8sRUFBRSxLQUFLLGtCQUFrQixFQUFFLE1BQU0sK0JBQStCLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entrypoints/client/lazy/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,+BAA+B,CAAC"}
|
|
@@ -3,7 +3,7 @@ export * from '../../config/index.js';
|
|
|
3
3
|
export * from '../../error_enriching.js';
|
|
4
4
|
export * from '../../storage/index.js';
|
|
5
5
|
export * from './utils.js';
|
|
6
|
-
export {
|
|
6
|
+
export { NoteService } from '../../notes/note_service.js';
|
|
7
7
|
export { ORACLE_VERSION } from '../../oracle_version.js';
|
|
8
8
|
export { type PXECreationOptions } from '../pxe_creation_options.js';
|
|
9
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9zZXJ2ZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxjQUFjLENBQUM7QUFDN0IsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMsd0JBQXdCLENBQUM7QUFDdkMsY0FBYyxZQUFZLENBQUM7QUFDM0IsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQzFELE9BQU8sRUFBRSxjQUFjLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUN6RCxPQUFPLEVBQUUsS0FBSyxrQkFBa0IsRUFBRSxNQUFNLDRCQUE0QixDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -3,5 +3,5 @@ export * from '../../config/index.js';
|
|
|
3
3
|
export * from '../../error_enriching.js';
|
|
4
4
|
export * from '../../storage/index.js';
|
|
5
5
|
export * from './utils.js';
|
|
6
|
-
export {
|
|
6
|
+
export { NoteService } from '../../notes/note_service.js';
|
|
7
7
|
export { ORACLE_VERSION } from '../../oracle_version.js';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { EventSelector } from '@aztec/stdlib/abi';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
5
|
+
import type { TxHash } from '@aztec/stdlib/tx';
|
|
6
|
+
import { AnchorBlockDataProvider } from '../storage/anchor_block_data_provider/anchor_block_data_provider.js';
|
|
7
|
+
import { PrivateEventDataProvider } from '../storage/private_event_data_provider/private_event_data_provider.js';
|
|
8
|
+
export declare class EventService {
|
|
9
|
+
private readonly anchorBlockDataProvider;
|
|
10
|
+
private readonly aztecNode;
|
|
11
|
+
private readonly privateEventDataProvider;
|
|
12
|
+
constructor(anchorBlockDataProvider: AnchorBlockDataProvider, aztecNode: AztecNode, privateEventDataProvider: PrivateEventDataProvider);
|
|
13
|
+
deliverEvent(contractAddress: AztecAddress, selector: EventSelector, content: Fr[], eventCommitment: Fr, txHash: TxHash, scope: AztecAddress): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRfc2VydmljZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2V2ZW50cy9ldmVudF9zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQU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,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,qEAAqE,CAAC;AAC9G,OAAO,EAAE,wBAAwB,EAAE,MAAM,uEAAuE,CAAC;AAEjH,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,uBAAuB;IACxC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IAH3C,YACmB,uBAAuB,EAAE,uBAAuB,EAChD,SAAS,EAAE,SAAS,EACpB,wBAAwB,EAAE,wBAAwB,EACjE;IAES,YAAY,CACvB,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,aAAa,EACvB,OAAO,EAAE,EAAE,EAAE,EACb,eAAe,EAAE,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAkDf;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
2
|
+
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
3
|
+
export class EventService {
|
|
4
|
+
anchorBlockDataProvider;
|
|
5
|
+
aztecNode;
|
|
6
|
+
privateEventDataProvider;
|
|
7
|
+
constructor(anchorBlockDataProvider, aztecNode, privateEventDataProvider){
|
|
8
|
+
this.anchorBlockDataProvider = anchorBlockDataProvider;
|
|
9
|
+
this.aztecNode = aztecNode;
|
|
10
|
+
this.privateEventDataProvider = privateEventDataProvider;
|
|
11
|
+
}
|
|
12
|
+
async deliverEvent(contractAddress, selector, content, eventCommitment, txHash, scope) {
|
|
13
|
+
// While using 'latest' block number would be fine for private events since they cannot be accessed from Aztec.nr
|
|
14
|
+
// (and thus we're less concerned about being ahead of the synced block), we use the synced block number to
|
|
15
|
+
// maintain consistent behavior in the PXE. Additionally, events should never be ahead of the synced block here
|
|
16
|
+
// since `fetchTaggedLogs` only processes logs up to the synced block.
|
|
17
|
+
const [syncedBlockHeader, siloedEventCommitment, txEffect] = await Promise.all([
|
|
18
|
+
this.anchorBlockDataProvider.getBlockHeader(),
|
|
19
|
+
siloNullifier(contractAddress, eventCommitment),
|
|
20
|
+
this.aztecNode.getTxEffect(txHash)
|
|
21
|
+
]);
|
|
22
|
+
const syncedBlockNumber = syncedBlockHeader.getBlockNumber();
|
|
23
|
+
if (!txEffect) {
|
|
24
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash}`);
|
|
25
|
+
}
|
|
26
|
+
if (txEffect.l2BlockNumber > syncedBlockNumber) {
|
|
27
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash} as of block number ${syncedBlockNumber}`);
|
|
28
|
+
}
|
|
29
|
+
const eventInTx = txEffect.data.nullifiers.some((n)=>n.equals(siloedEventCommitment));
|
|
30
|
+
if (!eventInTx) {
|
|
31
|
+
throw new Error(`Event commitment ${eventCommitment} (siloed as ${siloedEventCommitment}) is not present in tx ${txHash}`);
|
|
32
|
+
}
|
|
33
|
+
const [nullifierIndex] = await this.aztecNode.findLeavesIndexes(syncedBlockNumber, MerkleTreeId.NULLIFIER_TREE, [
|
|
34
|
+
siloedEventCommitment
|
|
35
|
+
]);
|
|
36
|
+
if (nullifierIndex === undefined) {
|
|
37
|
+
throw new Error(`Event commitment ${eventCommitment} (siloed as ${siloedEventCommitment}) is not present on the nullifier tree at block ${syncedBlockNumber} (from tx ${txHash})`);
|
|
38
|
+
}
|
|
39
|
+
return this.privateEventDataProvider.storePrivateEventLog(selector, content, Number(nullifierIndex.data), {
|
|
40
|
+
contractAddress,
|
|
41
|
+
scope,
|
|
42
|
+
txHash,
|
|
43
|
+
l2BlockNumber: nullifierIndex.l2BlockNumber,
|
|
44
|
+
l2BlockHash: nullifierIndex.l2BlockHash
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { PrivateEventFilter } from '@aztec/aztec.js/wallet';
|
|
2
|
-
import
|
|
2
|
+
import { AnchorBlockDataProvider } from '../storage/anchor_block_data_provider/anchor_block_data_provider.js';
|
|
3
|
+
import type { PrivateEventDataProviderFilter } from '../storage/private_event_data_provider/private_event_data_provider.js';
|
|
3
4
|
export declare class PrivateEventFilterValidator {
|
|
4
5
|
private anchorBlockDataProvider;
|
|
5
6
|
constructor(anchorBlockDataProvider: AnchorBlockDataProvider);
|
|
6
7
|
validate(filter: PrivateEventFilter): Promise<PrivateEventDataProviderFilter>;
|
|
7
8
|
}
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9ldmVudF9maWx0ZXJfdmFsaWRhdG9yLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZXZlbnRzL3ByaXZhdGVfZXZlbnRfZmlsdGVyX3ZhbGlkYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBSWpFLE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxNQUFNLHFFQUFxRSxDQUFDO0FBQzlHLE9BQU8sS0FBSyxFQUFFLDhCQUE4QixFQUFFLE1BQU0sdUVBQXVFLENBQUM7QUFFNUgscUJBQWEsMkJBQTJCO0lBQzFCLE9BQU8sQ0FBQyx1QkFBdUI7SUFBM0MsWUFBb0IsdUJBQXVCLEVBQUUsdUJBQXVCLEVBQUk7SUFFbEUsUUFBUSxDQUFDLE1BQU0sRUFBRSxrQkFBa0IsR0FBRyxPQUFPLENBQUMsOEJBQThCLENBQUMsQ0FvQ2xGO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_event_filter_validator.d.ts","sourceRoot":"","sources":["../../src/events/private_event_filter_validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAIjE,OAAO,
|
|
1
|
+
{"version":3,"file":"private_event_filter_validator.d.ts","sourceRoot":"","sources":["../../src/events/private_event_filter_validator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAIjE,OAAO,EAAE,uBAAuB,EAAE,MAAM,qEAAqE,CAAC;AAC9G,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,uEAAuE,CAAC;AAE5H,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,uBAAuB;IAA3C,YAAoB,uBAAuB,EAAE,uBAAuB,EAAI;IAElE,QAAQ,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,8BAA8B,CAAC,CAoClF;CACF"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { KeyStore } from '@aztec/key-store';
|
|
3
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
5
|
+
import { DirectionalAppTaggingSecret, PrivateLogWithTxData, PublicLogWithTxData, SiloedTag, Tag } from '@aztec/stdlib/logs';
|
|
6
|
+
import type { LogRetrievalRequest } from '../contract_function_simulator/noir-structs/log_retrieval_request.js';
|
|
7
|
+
import { LogRetrievalResponse } from '../contract_function_simulator/noir-structs/log_retrieval_response.js';
|
|
8
|
+
import { AddressDataProvider } from '../storage/address_data_provider/address_data_provider.js';
|
|
9
|
+
import { AnchorBlockDataProvider } from '../storage/anchor_block_data_provider/anchor_block_data_provider.js';
|
|
10
|
+
import { CapsuleDataProvider } from '../storage/capsule_data_provider/capsule_data_provider.js';
|
|
11
|
+
import { RecipientTaggingDataProvider } from '../storage/tagging_data_provider/recipient_tagging_data_provider.js';
|
|
12
|
+
export declare class LogService {
|
|
13
|
+
#private;
|
|
14
|
+
private readonly aztecNode;
|
|
15
|
+
private readonly anchorBlockDataProvider;
|
|
16
|
+
private readonly keyStore;
|
|
17
|
+
private readonly capsuleDataProvider;
|
|
18
|
+
private readonly recipientTaggingDataProvider;
|
|
19
|
+
private readonly addressDataProvider;
|
|
20
|
+
constructor(aztecNode: AztecNode, anchorBlockDataProvider: AnchorBlockDataProvider, keyStore: KeyStore, capsuleDataProvider: CapsuleDataProvider, recipientTaggingDataProvider: RecipientTaggingDataProvider, addressDataProvider: AddressDataProvider);
|
|
21
|
+
bulkRetrieveLogs(logRetrievalRequests: LogRetrievalRequest[]): Promise<(LogRetrievalResponse | null)[]>;
|
|
22
|
+
getPublicLogByTag(tag: Tag, contractAddress: AztecAddress): Promise<PublicLogWithTxData | null>;
|
|
23
|
+
getPrivateLogByTag(siloedTag: SiloedTag): Promise<PrivateLogWithTxData | null>;
|
|
24
|
+
syncTaggedLogs(contractAddress: AztecAddress, pendingTaggedLogArrayBaseSlot: Fr, scopes?: AztecAddress[]): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Returns the last used tagging indexes along with the directional app tagging secrets for a given recipient and all
|
|
27
|
+
* the senders in the address book.
|
|
28
|
+
* This method should be exposed as an oracle call to allow aztec.nr to perform the orchestration
|
|
29
|
+
* of the syncTaggedLogs and processTaggedLogs methods. However, it is not possible to do so at the moment,
|
|
30
|
+
* so we're keeping it private for now.
|
|
31
|
+
* @param contractAddress - The contract address to silo the secret for
|
|
32
|
+
* @param recipient - The address receiving the notes
|
|
33
|
+
* @returns A list of directional app tagging secrets along with the last used tagging indexes. If the corresponding
|
|
34
|
+
* secret was never used, the index is undefined.
|
|
35
|
+
* TODO(#17775): The naming here is broken as the function name does not reflect the return type. Make sure this gets
|
|
36
|
+
* fixed when implementing the linked issue.
|
|
37
|
+
*/
|
|
38
|
+
protected getLastUsedTaggingIndexesForSenders(contractAddress: AztecAddress, recipient: AztecAddress): Promise<{
|
|
39
|
+
secret: DirectionalAppTaggingSecret;
|
|
40
|
+
index: number | undefined;
|
|
41
|
+
}[]>;
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nX3NlcnZpY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dzL2xvZ19zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3pELE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ2pELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBRWhFLE9BQU8sS0FBSyxFQUFFLFNBQVMsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ2pFLE9BQU8sRUFDTCwyQkFBMkIsRUFFM0Isb0JBQW9CLEVBQ3BCLG1CQUFtQixFQUNuQixTQUFTLEVBQ1QsR0FBRyxFQUVKLE1BQU0sb0JBQW9CLENBQUM7QUFFNUIsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxzRUFBc0UsQ0FBQztBQUNoSCxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSx1RUFBdUUsQ0FBQztBQUM3RyxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSwyREFBMkQsQ0FBQztBQUNoRyxPQUFPLEVBQUUsdUJBQXVCLEVBQUUsTUFBTSxxRUFBcUUsQ0FBQztBQUM5RyxPQUFPLEVBQU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C,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,4BAA4B;IAC7C,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IANtC,YACmB,SAAS,EAAE,SAAS,EACpB,uBAAuB,EAAE,uBAAuB,EAChD,QAAQ,EAAE,QAAQ,EAClB,mBAAmB,EAAE,mBAAmB,EACxC,4BAA4B,EAAE,4BAA4B,EAC1D,mBAAmB,EAAE,mBAAmB,EACvD;IAES,gBAAgB,CAAC,oBAAoB,EAAE,mBAAmB,EAAE,GAAG,OAAO,CAAC,CAAC,oBAAoB,GAAG,IAAI,CAAC,EAAE,CAAC,CAkCnH;IAGY,iBAAiB,CAAC,GAAG,EAAE,GAAG,EAAE,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CA6B3G;IAGY,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,oBAAoB,GAAG,IAAI,CAAC,CA6B1F;IAKY,cAAc,CACzB,eAAe,EAAE,YAAY,EAC7B,6BAA6B,EAAE,EAAE,EACjC,MAAM,CAAC,EAAE,YAAY,EAAE,iBAoIxB;IAED;;;;;;;;;;;;OAYG;IACH,UAAgB,mCAAmC,CACjD,eAAe,EAAE,YAAY,EAC7B,SAAS,EAAE,YAAY,GACtB,OAAO,CAAC;QAAE,MAAM,EAAE,2BAA2B,CAAC;QAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,EAAE,CAAC,CA8B/E;CA2CF"}
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { DirectionalAppTaggingSecret, PendingTaggedLog, PrivateLogWithTxData, PublicLogWithTxData, SiloedTag, Tag } from '@aztec/stdlib/logs';
|
|
2
|
+
import { LogRetrievalResponse } from '../contract_function_simulator/noir-structs/log_retrieval_response.js';
|
|
3
|
+
import { WINDOW_HALF_SIZE } from '../tagging/constants.js';
|
|
4
|
+
import { getInitialIndexesMap, getPreTagsForTheWindow } from '../tagging/utils.js';
|
|
5
|
+
export class LogService {
|
|
6
|
+
aztecNode;
|
|
7
|
+
anchorBlockDataProvider;
|
|
8
|
+
keyStore;
|
|
9
|
+
capsuleDataProvider;
|
|
10
|
+
recipientTaggingDataProvider;
|
|
11
|
+
addressDataProvider;
|
|
12
|
+
constructor(aztecNode, anchorBlockDataProvider, keyStore, capsuleDataProvider, recipientTaggingDataProvider, addressDataProvider){
|
|
13
|
+
this.aztecNode = aztecNode;
|
|
14
|
+
this.anchorBlockDataProvider = anchorBlockDataProvider;
|
|
15
|
+
this.keyStore = keyStore;
|
|
16
|
+
this.capsuleDataProvider = capsuleDataProvider;
|
|
17
|
+
this.recipientTaggingDataProvider = recipientTaggingDataProvider;
|
|
18
|
+
this.addressDataProvider = addressDataProvider;
|
|
19
|
+
}
|
|
20
|
+
async bulkRetrieveLogs(logRetrievalRequests) {
|
|
21
|
+
return await Promise.all(logRetrievalRequests.map(async (request)=>{
|
|
22
|
+
// TODO(F-231): remove these internal functions and have node endpoints that do this instead
|
|
23
|
+
const [publicLog, privateLog] = await Promise.all([
|
|
24
|
+
this.getPublicLogByTag(request.tag, request.contractAddress),
|
|
25
|
+
this.getPrivateLogByTag(await SiloedTag.compute(request.tag, request.contractAddress))
|
|
26
|
+
]);
|
|
27
|
+
if (publicLog !== null) {
|
|
28
|
+
if (privateLog !== null) {
|
|
29
|
+
throw new Error(`Found both a public and private log when searching for tag ${request.tag} from contract ${request.contractAddress}`);
|
|
30
|
+
}
|
|
31
|
+
return new LogRetrievalResponse(publicLog.logPayload, publicLog.txHash, publicLog.uniqueNoteHashesInTx, publicLog.firstNullifierInTx);
|
|
32
|
+
} else if (privateLog !== null) {
|
|
33
|
+
return new LogRetrievalResponse(privateLog.logPayload, privateLog.txHash, privateLog.uniqueNoteHashesInTx, privateLog.firstNullifierInTx);
|
|
34
|
+
} else {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
// TODO(F-231): delete this function and implement this behavior in the node instead
|
|
40
|
+
async getPublicLogByTag(tag, contractAddress) {
|
|
41
|
+
const logs = await this.aztecNode.getPublicLogsByTagsFromContract(contractAddress, [
|
|
42
|
+
tag
|
|
43
|
+
]);
|
|
44
|
+
const logsForTag = logs[0];
|
|
45
|
+
if (logsForTag.length == 0) {
|
|
46
|
+
return null;
|
|
47
|
+
} else if (logsForTag.length > 1) {
|
|
48
|
+
// TODO(#11627): handle this case
|
|
49
|
+
throw new Error(`Got ${logsForTag.length} logs for tag ${tag} and contract ${contractAddress.toString()}. getPublicLogByTag currently only supports a single log per tag`);
|
|
50
|
+
}
|
|
51
|
+
const scopedLog = logsForTag[0];
|
|
52
|
+
// getLogsByTag doesn't have all of the information that we need (notably note hashes and the first nullifier), so
|
|
53
|
+
// we need to make a second call to the node for `getTxEffect`.
|
|
54
|
+
// TODO(#9789): bundle this information in the `getLogsByTag` call.
|
|
55
|
+
const txEffect = await this.aztecNode.getTxEffect(scopedLog.txHash);
|
|
56
|
+
if (txEffect == undefined) {
|
|
57
|
+
throw new Error(`Unexpected: failed to retrieve tx effects for tx ${scopedLog.txHash} which is known to exist`);
|
|
58
|
+
}
|
|
59
|
+
return new PublicLogWithTxData(scopedLog.log.getEmittedFieldsWithoutTag(), scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
|
|
60
|
+
}
|
|
61
|
+
// TODO(F-231): delete this function and implement this behavior in the node instead
|
|
62
|
+
async getPrivateLogByTag(siloedTag) {
|
|
63
|
+
const logs = await this.aztecNode.getPrivateLogsByTags([
|
|
64
|
+
siloedTag
|
|
65
|
+
]);
|
|
66
|
+
const logsForTag = logs[0];
|
|
67
|
+
if (logsForTag.length == 0) {
|
|
68
|
+
return null;
|
|
69
|
+
} else if (logsForTag.length > 1) {
|
|
70
|
+
// TODO(#11627): handle this case
|
|
71
|
+
throw new Error(`Got ${logsForTag.length} logs for tag ${siloedTag}. getPrivateLogByTag currently only supports a single log per tag`);
|
|
72
|
+
}
|
|
73
|
+
const scopedLog = logsForTag[0];
|
|
74
|
+
// getLogsByTag doesn't have all of the information that we need (notably note hashes and the first nullifier), so
|
|
75
|
+
// we need to make a second call to the node for `getTxEffect`.
|
|
76
|
+
// TODO(#9789): bundle this information in the `getLogsByTag` call.
|
|
77
|
+
const txEffect = await this.aztecNode.getTxEffect(scopedLog.txHash);
|
|
78
|
+
if (txEffect == undefined) {
|
|
79
|
+
throw new Error(`Unexpected: failed to retrieve tx effects for tx ${scopedLog.txHash} which is known to exist`);
|
|
80
|
+
}
|
|
81
|
+
return new PrivateLogWithTxData(scopedLog.log.getEmittedFieldsWithoutTag(), scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0]);
|
|
82
|
+
}
|
|
83
|
+
// TODO(#17775): Replace this implementation of this function with one implementing an approach similar
|
|
84
|
+
// to syncSenderTaggingIndexes. Not done yet due to re-prioritization to devex and this doesn't directly affect
|
|
85
|
+
// devex.
|
|
86
|
+
async syncTaggedLogs(contractAddress, pendingTaggedLogArrayBaseSlot, scopes) {
|
|
87
|
+
const maxBlockNumber = (await this.anchorBlockDataProvider.getBlockHeader()).getBlockNumber();
|
|
88
|
+
// Ideally this algorithm would be implemented in noir, exposing its building blocks as oracles.
|
|
89
|
+
// However it is impossible at the moment due to the language not supporting nested slices.
|
|
90
|
+
// This nesting is necessary because for a given set of tags we don't
|
|
91
|
+
// know how many logs we will get back. Furthermore, these logs are of undetermined
|
|
92
|
+
// length, since we don't really know the note they correspond to until we decrypt them.
|
|
93
|
+
const recipients = scopes ? scopes : await this.keyStore.getAccounts();
|
|
94
|
+
for (const recipient of recipients){
|
|
95
|
+
// Get all the secrets for the recipient and sender pairs (#9365)
|
|
96
|
+
const indexedSecrets = await this.getLastUsedTaggingIndexesForSenders(contractAddress, recipient);
|
|
97
|
+
// We fetch logs for a window of indexes in a range:
|
|
98
|
+
// <latest_log_index - WINDOW_HALF_SIZE, latest_log_index + WINDOW_HALF_SIZE>.
|
|
99
|
+
//
|
|
100
|
+
// We use this window approach because it could happen that a sender might have messed up and inadvertently
|
|
101
|
+
// incremented their index without us getting any logs (for example, in case of a revert). If we stopped looking
|
|
102
|
+
// for logs the first time we don't receive any logs for a tag, we might never receive anything from that sender again.
|
|
103
|
+
// Also there's a possibility that we have advanced our index, but the sender has reused it, so we might have missed
|
|
104
|
+
// some logs. For these reasons, we have to look both back and ahead of the stored index.
|
|
105
|
+
let secretsAndWindows = indexedSecrets.map((indexedSecret)=>{
|
|
106
|
+
if (indexedSecret.index === undefined) {
|
|
107
|
+
return {
|
|
108
|
+
secret: indexedSecret.secret,
|
|
109
|
+
leftMostIndex: 0,
|
|
110
|
+
rightMostIndex: WINDOW_HALF_SIZE
|
|
111
|
+
};
|
|
112
|
+
} else {
|
|
113
|
+
return {
|
|
114
|
+
secret: indexedSecret.secret,
|
|
115
|
+
leftMostIndex: Math.max(0, indexedSecret.index - WINDOW_HALF_SIZE),
|
|
116
|
+
rightMostIndex: indexedSecret.index + WINDOW_HALF_SIZE
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
// As we iterate we store the largest index we have seen for a given secret to later on store it in the db.
|
|
121
|
+
const newLargestIndexMapToStore = {};
|
|
122
|
+
// The initial/unmodified indexes of the secrets stored in a key-value map where key is the directional app
|
|
123
|
+
// tagging secret.
|
|
124
|
+
const initialIndexesMap = getInitialIndexesMap(indexedSecrets);
|
|
125
|
+
while(secretsAndWindows.length > 0){
|
|
126
|
+
const preTagsForTheWholeWindow = getPreTagsForTheWindow(secretsAndWindows);
|
|
127
|
+
const tagsForTheWholeWindow = await Promise.all(preTagsForTheWholeWindow.map(async (preTag)=>{
|
|
128
|
+
return SiloedTag.compute(await Tag.compute(preTag), contractAddress);
|
|
129
|
+
}));
|
|
130
|
+
// We store the new largest indexes we find in the iteration in the following map to later on construct
|
|
131
|
+
// a new set of secrets and windows to fetch logs for.
|
|
132
|
+
const newLargestIndexMapForIteration = {};
|
|
133
|
+
// Fetch the private logs for the tags and iterate over them
|
|
134
|
+
const logsByTags = await this.aztecNode.getPrivateLogsByTags(tagsForTheWholeWindow);
|
|
135
|
+
for(let logIndex = 0; logIndex < logsByTags.length; logIndex++){
|
|
136
|
+
const logsByTag = logsByTags[logIndex];
|
|
137
|
+
if (logsByTag.length > 0) {
|
|
138
|
+
// We filter out the logs that are newer than the anchor block number of the tx currently being constructed
|
|
139
|
+
const filteredLogsByBlockNumber = logsByTag.filter((l)=>l.blockNumber <= maxBlockNumber);
|
|
140
|
+
// We store the logs in capsules (to later be obtained in Noir)
|
|
141
|
+
await this.#storePendingTaggedLogs(contractAddress, pendingTaggedLogArrayBaseSlot, recipient, filteredLogsByBlockNumber);
|
|
142
|
+
// We retrieve the pre-tag corresponding to the log as I need that to evaluate whether
|
|
143
|
+
// a new largest index have been found.
|
|
144
|
+
const preTagCorrespondingToLog = preTagsForTheWholeWindow[logIndex];
|
|
145
|
+
const initialIndex = initialIndexesMap[preTagCorrespondingToLog.secret.toString()];
|
|
146
|
+
if (preTagCorrespondingToLog.index >= initialIndex && (newLargestIndexMapForIteration[preTagCorrespondingToLog.secret.toString()] === undefined || preTagCorrespondingToLog.index >= newLargestIndexMapForIteration[preTagCorrespondingToLog.secret.toString()])) {
|
|
147
|
+
// We have found a new largest index so we store it for later processing (storing it in the db + fetching
|
|
148
|
+
// the difference of the window sets of current and the next iteration)
|
|
149
|
+
newLargestIndexMapForIteration[preTagCorrespondingToLog.secret.toString()] = preTagCorrespondingToLog.index + 1;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
// Now based on the new largest indexes we found, we will construct a new secrets and windows set to fetch logs
|
|
154
|
+
// for. Note that it's very unlikely that a new log from the current window would appear between the iterations
|
|
155
|
+
// so we fetch the logs only for the difference of the window sets.
|
|
156
|
+
const newSecretsAndWindows = [];
|
|
157
|
+
for (const [directionalAppTaggingSecret, newIndex] of Object.entries(newLargestIndexMapForIteration)){
|
|
158
|
+
const maybeIndexedSecret = indexedSecrets.find((indexedSecret)=>indexedSecret.secret.toString() === directionalAppTaggingSecret);
|
|
159
|
+
if (maybeIndexedSecret) {
|
|
160
|
+
newSecretsAndWindows.push({
|
|
161
|
+
secret: maybeIndexedSecret.secret,
|
|
162
|
+
// We set the left most index to the new index to avoid fetching the same logs again
|
|
163
|
+
leftMostIndex: newIndex,
|
|
164
|
+
rightMostIndex: newIndex + WINDOW_HALF_SIZE
|
|
165
|
+
});
|
|
166
|
+
// We store the new largest index in the map to later store it in the db.
|
|
167
|
+
newLargestIndexMapToStore[directionalAppTaggingSecret] = newIndex;
|
|
168
|
+
} else {
|
|
169
|
+
throw new Error(`Secret not found for directionalAppTaggingSecret ${directionalAppTaggingSecret}. This is a bug as it should never happen!`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
// Now we set the new secrets and windows and proceed to the next iteration.
|
|
173
|
+
secretsAndWindows = newSecretsAndWindows;
|
|
174
|
+
}
|
|
175
|
+
// At this point we have processed all the logs for the recipient so we store the last used indexes in the db.
|
|
176
|
+
// newLargestIndexMapToStore contains "next" indexes to look for (one past the last found), so subtract 1 to get
|
|
177
|
+
// last used.
|
|
178
|
+
await this.recipientTaggingDataProvider.setLastUsedIndexes(Object.entries(newLargestIndexMapToStore).map(([directionalAppTaggingSecret, index])=>({
|
|
179
|
+
secret: DirectionalAppTaggingSecret.fromString(directionalAppTaggingSecret),
|
|
180
|
+
index: index - 1
|
|
181
|
+
})));
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Returns the last used tagging indexes along with the directional app tagging secrets for a given recipient and all
|
|
186
|
+
* the senders in the address book.
|
|
187
|
+
* This method should be exposed as an oracle call to allow aztec.nr to perform the orchestration
|
|
188
|
+
* of the syncTaggedLogs and processTaggedLogs methods. However, it is not possible to do so at the moment,
|
|
189
|
+
* so we're keeping it private for now.
|
|
190
|
+
* @param contractAddress - The contract address to silo the secret for
|
|
191
|
+
* @param recipient - The address receiving the notes
|
|
192
|
+
* @returns A list of directional app tagging secrets along with the last used tagging indexes. If the corresponding
|
|
193
|
+
* secret was never used, the index is undefined.
|
|
194
|
+
* TODO(#17775): The naming here is broken as the function name does not reflect the return type. Make sure this gets
|
|
195
|
+
* fixed when implementing the linked issue.
|
|
196
|
+
*/ async getLastUsedTaggingIndexesForSenders(contractAddress, recipient) {
|
|
197
|
+
const recipientCompleteAddress = await this.#getCompleteAddress(recipient);
|
|
198
|
+
const recipientIvsk = await this.keyStore.getMasterIncomingViewingSecretKey(recipient);
|
|
199
|
+
// We implicitly add all PXE accounts as senders, this helps us decrypt tags on notes that we send to ourselves
|
|
200
|
+
// (recipient = us, sender = us)
|
|
201
|
+
const senders = [
|
|
202
|
+
...await this.recipientTaggingDataProvider.getSenderAddresses(),
|
|
203
|
+
...await this.keyStore.getAccounts()
|
|
204
|
+
].filter((address, index, self)=>index === self.findIndex((otherAddress)=>otherAddress.equals(address)));
|
|
205
|
+
const secrets = await Promise.all(senders.map((contact)=>{
|
|
206
|
+
return DirectionalAppTaggingSecret.compute(recipientCompleteAddress, recipientIvsk, contact, contractAddress, recipient);
|
|
207
|
+
}));
|
|
208
|
+
const indexes = await this.recipientTaggingDataProvider.getLastUsedIndexes(secrets);
|
|
209
|
+
if (indexes.length !== secrets.length) {
|
|
210
|
+
throw new Error('Indexes and directional app tagging secrets have different lengths');
|
|
211
|
+
}
|
|
212
|
+
return secrets.map((secret, i)=>({
|
|
213
|
+
secret,
|
|
214
|
+
index: indexes[i]
|
|
215
|
+
}));
|
|
216
|
+
}
|
|
217
|
+
async #storePendingTaggedLogs(contractAddress, capsuleArrayBaseSlot, recipient, privateLogs) {
|
|
218
|
+
// Build all pending tagged logs upfront with their tx effects
|
|
219
|
+
const pendingTaggedLogs = await Promise.all(privateLogs.map(async (scopedLog)=>{
|
|
220
|
+
// TODO(#9789): get these effects along with the log
|
|
221
|
+
const txEffect = await this.aztecNode.getTxEffect(scopedLog.txHash);
|
|
222
|
+
if (!txEffect) {
|
|
223
|
+
throw new Error(`Could not find tx effect for tx hash ${scopedLog.txHash}`);
|
|
224
|
+
}
|
|
225
|
+
const pendingTaggedLog = new PendingTaggedLog(scopedLog.log.fields, scopedLog.txHash, txEffect.data.noteHashes, txEffect.data.nullifiers[0], recipient);
|
|
226
|
+
return pendingTaggedLog.toFields();
|
|
227
|
+
}));
|
|
228
|
+
// TODO: This looks like it could belong more at the oracle interface level
|
|
229
|
+
return this.capsuleDataProvider.appendToCapsuleArray(contractAddress, capsuleArrayBaseSlot, pendingTaggedLogs);
|
|
230
|
+
}
|
|
231
|
+
async #getCompleteAddress(account) {
|
|
232
|
+
const completeAddress = await this.addressDataProvider.getCompleteAddress(account);
|
|
233
|
+
if (!completeAddress) {
|
|
234
|
+
throw new Error(`No public key registered for address ${account}.
|
|
235
|
+
Register it by calling pxe.addAccount(...).\nSee docs for context: https://docs.aztec.network/developers/resources/debugging/aztecnr-errors#simulation-error-no-public-key-registered-for-address-0x0-register-it-by-calling-pxeregisterrecipient-or-pxeregisteraccount`);
|
|
236
|
+
}
|
|
237
|
+
return completeAddress;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { NoteService } from './note_service.js';
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9ub3Rlcy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sbUJBQW1CLENBQUMifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/notes/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NoteService } from './note_service.js';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import { type AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
4
|
+
import { Note, NoteStatus } from '@aztec/stdlib/note';
|
|
5
|
+
import type { TxHash } from '@aztec/stdlib/tx';
|
|
6
|
+
import type { AnchorBlockDataProvider } from '../storage/anchor_block_data_provider/anchor_block_data_provider.js';
|
|
7
|
+
import type { NoteDataProvider } from '../storage/note_data_provider/note_data_provider.js';
|
|
8
|
+
export declare class NoteService {
|
|
9
|
+
private readonly noteDataProvider;
|
|
10
|
+
private readonly aztecNode;
|
|
11
|
+
private readonly anchorBlockDataProvider;
|
|
12
|
+
constructor(noteDataProvider: NoteDataProvider, aztecNode: AztecNode, anchorBlockDataProvider: AnchorBlockDataProvider);
|
|
13
|
+
/**
|
|
14
|
+
* Retrieves a set of notes stored in the database for a given contract address and storage slot.
|
|
15
|
+
* The query result is paginated using 'limit' and 'offset' values.
|
|
16
|
+
* Returns an object containing an array of note data.
|
|
17
|
+
*
|
|
18
|
+
* @param owner - The owner of the notes. If undefined, returns notes for all known owners.
|
|
19
|
+
* @param status - The status of notes to fetch.
|
|
20
|
+
* @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
21
|
+
*/
|
|
22
|
+
getNotes(contractAddress: AztecAddress, owner: AztecAddress | undefined, storageSlot: Fr, status: NoteStatus, scopes?: AztecAddress[]): Promise<{
|
|
23
|
+
contractAddress: AztecAddress;
|
|
24
|
+
owner: AztecAddress;
|
|
25
|
+
storageSlot: Fr;
|
|
26
|
+
randomness: Fr;
|
|
27
|
+
noteNonce: Fr;
|
|
28
|
+
note: Note;
|
|
29
|
+
noteHash: Fr;
|
|
30
|
+
siloedNullifier: Fr;
|
|
31
|
+
index: bigint;
|
|
32
|
+
}[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Looks for nullifiers of active contract notes and marks them as nullified if a nullifier is found.
|
|
35
|
+
*
|
|
36
|
+
* Fetches notes from the NoteDataProvider and checks which nullifiers are present in the
|
|
37
|
+
* onchain nullifier Merkle tree - up to the latest locally synced block. We use the
|
|
38
|
+
* locally synced block instead of querying the chain's 'latest' block to ensure correctness:
|
|
39
|
+
* notes are only marked nullified once their corresponding nullifier has been included in a
|
|
40
|
+
* block up to which the PXE has synced.
|
|
41
|
+
* This allows recent nullifications to be processed even if the node is not an archive node.
|
|
42
|
+
*
|
|
43
|
+
* @param contractAddress - The contract whose notes should be checked and nullified.
|
|
44
|
+
*/
|
|
45
|
+
syncNoteNullifiers(contractAddress: AztecAddress): Promise<void>;
|
|
46
|
+
deliverNote(contractAddress: AztecAddress, owner: AztecAddress, storageSlot: Fr, randomness: Fr, noteNonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: TxHash, recipient: AztecAddress): Promise<void>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbm90ZXMvbm90ZV9zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUdoRSxPQUFPLEVBQUUsS0FBSyxTQUFTLEVBQWUsTUFBTSxpQ0FBaUMsQ0FBQztBQUM5RSxPQUFPLEVBQUUsSUFBSSxFQUFXLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRS9ELE9BQU8sS0FBSyxFQUFF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