@aztec/pxe 0.0.1-commit.ec5f612 → 0.0.1-commit.ec7ac5448
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 +4 -4
- package/dest/block_synchronizer/block_synchronizer.d.ts +1 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +6 -0
- package/dest/config/index.d.ts +2 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +10 -5
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +31 -8
- package/dest/contract_function_simulator/ephemeral_array_service.d.ts +28 -0
- package/dest/contract_function_simulator/ephemeral_array_service.d.ts.map +1 -0
- package/dest/contract_function_simulator/ephemeral_array_service.js +78 -0
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts +5 -5
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +17 -9
- package/dest/contract_function_simulator/index.d.ts +2 -1
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -6
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +8 -10
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +2 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +4 -7
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +6 -11
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +61 -45
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +47 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +75 -44
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +281 -96
- package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +23 -49
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +40 -63
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +89 -56
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +272 -107
- package/dest/contract_function_simulator/pick_notes.d.ts +1 -1
- package/dest/contract_function_simulator/pick_notes.d.ts.map +1 -1
- package/dest/contract_function_simulator/pick_notes.js +9 -2
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.d.ts.map +1 -1
- package/dest/contract_function_simulator/proxied_contract_data_source.js +3 -0
- package/dest/contract_logging.d.ts +9 -4
- package/dest/contract_logging.d.ts.map +1 -1
- package/dest/contract_logging.js +21 -6
- package/dest/contract_sync/contract_sync_service.d.ts +6 -5
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
- package/dest/contract_sync/contract_sync_service.js +44 -37
- package/dest/contract_sync/helpers.d.ts +2 -3
- package/dest/contract_sync/helpers.d.ts.map +1 -1
- package/dest/contract_sync/helpers.js +7 -2
- package/dest/debug/pxe_debug_utils.d.ts +3 -3
- 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/bundle/utils.d.ts +2 -2
- package/dest/entrypoints/client/bundle/utils.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/utils.js +2 -2
- 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/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 +2 -2
- package/dest/entrypoints/pxe_creation_options.d.ts +3 -1
- package/dest/entrypoints/pxe_creation_options.d.ts.map +1 -1
- package/dest/entrypoints/pxe_creation_options.js +3 -1
- package/dest/entrypoints/server/index.d.ts +2 -3
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +1 -2
- package/dest/entrypoints/server/utils.d.ts +2 -2
- package/dest/entrypoints/server/utils.d.ts.map +1 -1
- package/dest/entrypoints/server/utils.js +2 -2
- package/dest/events/event_service.d.ts +3 -2
- package/dest/events/event_service.d.ts.map +1 -1
- package/dest/events/event_service.js +16 -4
- package/dest/logs/log_service.d.ts +5 -8
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +24 -37
- package/dest/messages/message_context_service.d.ts +17 -0
- package/dest/messages/message_context_service.d.ts.map +1 -0
- package/dest/messages/message_context_service.js +36 -0
- package/dest/notes/note_service.d.ts +4 -5
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +14 -5
- package/dest/notes_filter.d.ts +2 -3
- package/dest/notes_filter.d.ts.map +1 -1
- package/dest/oracle_version.d.ts +4 -3
- package/dest/oracle_version.d.ts.map +1 -1
- package/dest/oracle_version.js +20 -10
- package/dest/pxe.d.ts +11 -8
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +45 -26
- package/dest/storage/capsule_store/capsule_service.d.ts +21 -0
- package/dest/storage/capsule_store/capsule_service.d.ts.map +1 -0
- package/dest/storage/capsule_store/capsule_service.js +50 -0
- package/dest/storage/capsule_store/capsule_store.d.ts +9 -9
- package/dest/storage/capsule_store/capsule_store.d.ts.map +1 -1
- package/dest/storage/capsule_store/capsule_store.js +33 -28
- package/dest/storage/capsule_store/index.d.ts +2 -1
- package/dest/storage/capsule_store/index.d.ts.map +1 -1
- package/dest/storage/capsule_store/index.js +1 -0
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +1 -1
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +2 -2
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +26 -25
- package/dest/storage/tagging_store/sender_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.js +141 -115
- package/dest/tagging/index.d.ts +2 -2
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +10 -1
- package/dest/tagging/sender_sync/utils/get_status_change_of_pending.d.ts +4 -3
- 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 +20 -10
- package/dest/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.d.ts +2 -1
- 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 +24 -11
- package/package.json +16 -16
- package/src/bin/check_oracle_version.ts +4 -4
- package/src/block_synchronizer/block_synchronizer.ts +6 -0
- package/src/config/index.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +44 -12
- package/src/contract_function_simulator/ephemeral_array_service.ts +110 -0
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +16 -11
- package/src/contract_function_simulator/index.ts +1 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +9 -9
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -5
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +4 -10
- package/src/contract_function_simulator/oracle/interfaces.ts +82 -54
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +104 -0
- package/src/contract_function_simulator/oracle/oracle.ts +363 -139
- package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +45 -84
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +444 -143
- package/src/contract_function_simulator/pick_notes.ts +9 -2
- package/src/contract_function_simulator/proxied_contract_data_source.ts +8 -1
- package/src/contract_logging.ts +18 -5
- package/src/contract_sync/contract_sync_service.ts +77 -59
- package/src/contract_sync/helpers.ts +4 -4
- package/src/debug/pxe_debug_utils.ts +3 -3
- package/src/entrypoints/client/bundle/index.ts +0 -1
- package/src/entrypoints/client/bundle/utils.ts +2 -3
- package/src/entrypoints/client/lazy/index.ts +0 -1
- package/src/entrypoints/client/lazy/utils.ts +2 -3
- package/src/entrypoints/pxe_creation_options.ts +7 -0
- package/src/entrypoints/server/index.ts +1 -2
- package/src/entrypoints/server/utils.ts +2 -3
- package/src/events/event_service.ts +17 -4
- package/src/logs/log_service.ts +52 -78
- package/src/messages/message_context_service.ts +44 -0
- package/src/notes/note_service.ts +18 -8
- package/src/notes_filter.ts +1 -3
- package/src/oracle_version.ts +20 -10
- package/src/pxe.ts +68 -31
- package/src/storage/capsule_store/capsule_service.ts +90 -0
- package/src/storage/capsule_store/capsule_store.ts +34 -26
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +2 -5
- package/src/storage/tagging_store/sender_tagging_store.ts +182 -135
- package/src/tagging/index.ts +1 -1
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +19 -1
- package/src/tagging/sender_sync/utils/get_status_change_of_pending.ts +26 -11
- package/src/tagging/sender_sync/utils/load_and_store_new_tagging_indexes.ts +19 -9
- package/dest/access_scopes.d.ts +0 -9
- package/dest/access_scopes.d.ts.map +0 -1
- package/dest/access_scopes.js +0 -6
- package/src/access_scopes.ts +0 -9
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from '../../access_scopes.js';
|
|
2
1
|
export * from '../../notes_filter.js';
|
|
3
2
|
export * from '../../pxe.js';
|
|
4
3
|
export * from '../../config/index.js';
|
|
@@ -6,8 +5,8 @@ export * from '../../error_enriching.js';
|
|
|
6
5
|
export * from '../../storage/index.js';
|
|
7
6
|
export * from './utils.js';
|
|
8
7
|
export { NoteService } from '../../notes/note_service.js';
|
|
9
|
-
export {
|
|
8
|
+
export { ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR } from '../../oracle_version.js';
|
|
10
9
|
export { type PXECreationOptions } from '../pxe_creation_options.js';
|
|
11
10
|
export { JobCoordinator } from '../../job_coordinator/job_coordinator.js';
|
|
12
11
|
export { ContractSyncService } from '../../contract_sync/contract_sync_service.js';
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9zZXJ2ZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxjQUFjLGNBQWMsQ0FBQztBQUM3QixjQUFjLHVCQUF1QixDQUFDO0FBQ3RDLGNBQWMsMEJBQTBCLENBQUM7QUFDekMsY0FBYyx3QkFBd0IsQ0FBQztBQUN2QyxjQUFjLFlBQVksQ0FBQztBQUMzQixPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDMUQsT0FBTyxFQUFFLG9CQUFvQixFQUFFLG9CQUFvQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDckYsT0FBTyxFQUFFLEtBQUssa0JBQWtCLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUNyRSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sMENBQTBDLENBQUM7QUFDMUUsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sOENBQThDLENBQUMifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,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,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8CAA8C,CAAC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
export * from '../../access_scopes.js';
|
|
2
1
|
export * from '../../notes_filter.js';
|
|
3
2
|
export * from '../../pxe.js';
|
|
4
3
|
export * from '../../config/index.js';
|
|
@@ -6,6 +5,6 @@ export * from '../../error_enriching.js';
|
|
|
6
5
|
export * from '../../storage/index.js';
|
|
7
6
|
export * from './utils.js';
|
|
8
7
|
export { NoteService } from '../../notes/note_service.js';
|
|
9
|
-
export {
|
|
8
|
+
export { ORACLE_VERSION_MAJOR, ORACLE_VERSION_MINOR } from '../../oracle_version.js';
|
|
10
9
|
export { JobCoordinator } from '../../job_coordinator/job_coordinator.js';
|
|
11
10
|
export { ContractSyncService } from '../../contract_sync/contract_sync_service.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
2
2
|
import type { PXEConfig } from '../../config/index.js';
|
|
3
3
|
import { PXE } from '../../pxe.js';
|
|
4
|
-
import type
|
|
4
|
+
import { type PXECreationOptions } from '../pxe_creation_options.js';
|
|
5
5
|
type PXEConfigWithoutDefaults = Omit<PXEConfig, 'l1Contracts' | 'l1ChainId' | 'l2BlockBatchSize' | 'rollupVersion'>;
|
|
6
6
|
export declare function createPXE(aztecNode: AztecNode, config: PXEConfigWithoutDefaults, options?: PXECreationOptions): Promise<PXE>;
|
|
7
7
|
export {};
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
8
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9lbnRyeXBvaW50cy9zZXJ2ZXIvdXRpbHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTUEsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFFakUsT0FBTyxLQUFLLEVBQUUsU0FBUyxFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDdkQsT0FBTyxFQUFFLEdBQUcsRUFBRSxNQUFNLGNBQWMsQ0FBQztBQUVuQyxPQUFPLEVBQUUsS0FBSyxrQkFBa0IsRUFBeUIsTUFBTSw0QkFBNEIsQ0FBQztBQUU1RixLQUFLLHdCQUF3QixHQUFHLElBQUksQ0FBQyxTQUFTLEVBQUUsYUFBYSxHQUFHLFdBQVcsR0FBRyxrQkFBa0IsR0FBRyxlQUFlLENBQUMsQ0FBQztBQUVwSCx3QkFBc0IsU0FBUyxDQUM3QixTQUFTLEVBQUUsU0FBUyxFQUNwQixNQUFNLEVBQUUsd0JBQXdCLEVBQ2hDLE9BQU8sR0FBRSxrQkFBb0MsZ0JBbUQ5QyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/entrypoints/server/utils.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAEnC,OAAO,EAAE,KAAK,kBAAkB,EAAyB,MAAM,4BAA4B,CAAC;AAE5F,KAAK,wBAAwB,GAAG,IAAI,CAAC,SAAS,EAAE,aAAa,GAAG,WAAW,GAAG,kBAAkB,GAAG,eAAe,CAAC,CAAC;AAEpH,wBAAsB,SAAS,CAC7B,SAAS,EAAE,SAAS,EACpB,MAAM,EAAE,wBAAwB,EAChC,OAAO,GAAE,kBAAoC,gBAmD9C"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BBPrivateKernelProver } from '@aztec/bb-prover/client';
|
|
2
1
|
import { BBBundlePrivateKernelProver } from '@aztec/bb-prover/client/bundle';
|
|
3
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
3
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
@@ -7,6 +6,7 @@ import { MemoryCircuitRecorder, SimulatorRecorderWrapper, WASMSimulator } from '
|
|
|
7
6
|
import { FileCircuitRecorder } from '@aztec/simulator/testing';
|
|
8
7
|
import { PXE } from '../../pxe.js';
|
|
9
8
|
import { PXE_DATA_SCHEMA_VERSION } from '../../storage/index.js';
|
|
9
|
+
import { isPrivateKernelProver } from '../pxe_creation_options.js';
|
|
10
10
|
export async function createPXE(aztecNode, config, options = {
|
|
11
11
|
loggers: {}
|
|
12
12
|
}) {
|
|
@@ -38,7 +38,7 @@ export async function createPXE(aztecNode, config, options = {
|
|
|
38
38
|
actor
|
|
39
39
|
});
|
|
40
40
|
let prover;
|
|
41
|
-
if (options.proverOrOptions
|
|
41
|
+
if (isPrivateKernelProver(options.proverOrOptions)) {
|
|
42
42
|
prover = options.proverOrOptions;
|
|
43
43
|
} else {
|
|
44
44
|
prover = new BBBundlePrivateKernelProver(simulator, {
|
|
@@ -9,7 +9,8 @@ export declare class EventService {
|
|
|
9
9
|
private readonly aztecNode;
|
|
10
10
|
private readonly privateEventStore;
|
|
11
11
|
private readonly jobId;
|
|
12
|
-
|
|
12
|
+
private readonly log;
|
|
13
|
+
constructor(anchorBlockHeader: BlockHeader, aztecNode: AztecNode, privateEventStore: PrivateEventStore, jobId: string, log?: import("@aztec/foundation/log").Logger);
|
|
13
14
|
validateAndStoreEvent(contractAddress: AztecAddress, selector: EventSelector, randomness: Fr, content: Fr[], eventCommitment: Fr, txHash: TxHash, scope: AztecAddress): Promise<void>;
|
|
14
15
|
}
|
|
15
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXZlbnRfc2VydmljZS5kLnRzIiwic291cmNlUm9vdCI6I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xFQUFFLEVBQUUsRUFDbkIsTUFBTSxFQUFFLE1BQU0sRUFDZCxLQUFLLEVBQUUsWUFBWSxHQUNsQixPQUFPLENBQUMsSUFBSSxDQUFDLENBdURmO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"event_service.d.ts","sourceRoot":"","sources":["../../src/events/event_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;
|
|
1
|
+
{"version":3,"file":"event_service.d.ts","sourceRoot":"","sources":["../../src/events/event_service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uDAAuD,CAAC;AAE1F,qBAAa,YAAY;IAErB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG;IALtB,YACmB,iBAAiB,EAAE,WAAW,EAC9B,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,iBAAiB,EACpC,KAAK,EAAE,MAAM,EACb,GAAG,yCAAoC,EACtD;IAES,qBAAqB,CAChC,eAAe,EAAE,YAAY,EAC7B,QAAQ,EAAE,aAAa,EACvB,UAAU,EAAE,EAAE,EACd,OAAO,EAAE,EAAE,EAAE,EACb,eAAe,EAAE,EAAE,EACnB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAuDf;CACF"}
|
|
@@ -1,14 +1,17 @@
|
|
|
1
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
1
2
|
import { siloNullifier } from '@aztec/stdlib/hash';
|
|
2
3
|
export class EventService {
|
|
3
4
|
anchorBlockHeader;
|
|
4
5
|
aztecNode;
|
|
5
6
|
privateEventStore;
|
|
6
7
|
jobId;
|
|
7
|
-
|
|
8
|
+
log;
|
|
9
|
+
constructor(anchorBlockHeader, aztecNode, privateEventStore, jobId, log = createLogger('pxe:event_service')){
|
|
8
10
|
this.anchorBlockHeader = anchorBlockHeader;
|
|
9
11
|
this.aztecNode = aztecNode;
|
|
10
12
|
this.privateEventStore = privateEventStore;
|
|
11
13
|
this.jobId = jobId;
|
|
14
|
+
this.log = log;
|
|
12
15
|
}
|
|
13
16
|
async validateAndStoreEvent(contractAddress, selector, randomness, content, eventCommitment, txHash, scope) {
|
|
14
17
|
// While using 'latest' block number would be fine for private events since they cannot be accessed from Aztec.nr
|
|
@@ -21,15 +24,24 @@ export class EventService {
|
|
|
21
24
|
]);
|
|
22
25
|
const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
|
|
23
26
|
if (!txEffect) {
|
|
24
|
-
|
|
27
|
+
// We error out instead of just logging a warning and skipping the event because this would indicate a bug. This
|
|
28
|
+
// is because the node has already served info about this tx either when obtaining the log (TxScopedL2Log contain
|
|
29
|
+
// tx info) or when getting metadata for the offchain message (before the message got passed to `process_log`).
|
|
30
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash} when processing an event.`);
|
|
25
31
|
}
|
|
26
32
|
if (txEffect.l2BlockNumber > anchorBlockNumber) {
|
|
27
|
-
|
|
33
|
+
// We should never process a message from a tx past the anchor block. If we got here, a preprocessing step made
|
|
34
|
+
// a mistake.
|
|
35
|
+
throw new Error(`Obtained a newer tx effect for ${txHash} for an event validation request than the anchor block ${anchorBlockNumber}. This is a bug as smart contracts should not issue event validation requests for events from blocks newer than the anchor block.`);
|
|
28
36
|
}
|
|
29
37
|
// Find the index of the event commitment in the nullifiers array to determine event ordering within the tx
|
|
30
38
|
const eventIndexInTx = txEffect.data.nullifiers.findIndex((n)=>n.equals(siloedEventCommitment));
|
|
31
39
|
if (eventIndexInTx === -1) {
|
|
32
|
-
|
|
40
|
+
// Unlike in NoteService, this might not be a bug since the commitment hasn't been verified yet in the message
|
|
41
|
+
// processing pipeline. A malformed or malicious message could trigger this condition. Because of this we don't
|
|
42
|
+
// error out and we just show a warning.
|
|
43
|
+
this.log.warn(`Skipping event whose commitment is not present in its tx. siloedEventCommitment=${siloedEventCommitment}, contract=${contractAddress}, selector=${selector}, eventCommitment=${eventCommitment}, txHash=${txHash}`);
|
|
44
|
+
return;
|
|
33
45
|
}
|
|
34
46
|
return this.privateEventStore.storePrivateEventLog(selector, randomness, content, siloedEventCommitment, {
|
|
35
47
|
contractAddress,
|
|
@@ -1,14 +1,12 @@
|
|
|
1
|
-
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
1
|
import { type LoggerBindings } from '@aztec/foundation/log';
|
|
3
2
|
import type { KeyStore } from '@aztec/key-store';
|
|
4
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
4
|
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
5
|
+
import { PendingTaggedLog } from '@aztec/stdlib/logs';
|
|
6
6
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
7
|
-
import type { AccessScopes } from '../access_scopes.js';
|
|
8
7
|
import type { LogRetrievalRequest } from '../contract_function_simulator/noir-structs/log_retrieval_request.js';
|
|
9
8
|
import { LogRetrievalResponse } from '../contract_function_simulator/noir-structs/log_retrieval_response.js';
|
|
10
9
|
import { AddressStore } from '../storage/address_store/address_store.js';
|
|
11
|
-
import { CapsuleStore } from '../storage/capsule_store/capsule_store.js';
|
|
12
10
|
import type { RecipientTaggingStore } from '../storage/tagging_store/recipient_tagging_store.js';
|
|
13
11
|
import type { SenderAddressBookStore } from '../storage/tagging_store/sender_address_book_store.js';
|
|
14
12
|
export declare class LogService {
|
|
@@ -16,14 +14,13 @@ export declare class LogService {
|
|
|
16
14
|
private readonly aztecNode;
|
|
17
15
|
private readonly anchorBlockHeader;
|
|
18
16
|
private readonly keyStore;
|
|
19
|
-
private readonly capsuleStore;
|
|
20
17
|
private readonly recipientTaggingStore;
|
|
21
18
|
private readonly senderAddressBookStore;
|
|
22
19
|
private readonly addressStore;
|
|
23
20
|
private readonly jobId;
|
|
24
21
|
private log;
|
|
25
|
-
constructor(aztecNode: AztecNode, anchorBlockHeader: BlockHeader, keyStore: KeyStore,
|
|
26
|
-
|
|
27
|
-
fetchTaggedLogs(contractAddress: AztecAddress,
|
|
22
|
+
constructor(aztecNode: AztecNode, anchorBlockHeader: BlockHeader, keyStore: KeyStore, recipientTaggingStore: RecipientTaggingStore, senderAddressBookStore: SenderAddressBookStore, addressStore: AddressStore, jobId: string, bindings?: LoggerBindings);
|
|
23
|
+
fetchLogsByTag(contractAddress: AztecAddress, logRetrievalRequests: LogRetrievalRequest[]): Promise<(LogRetrievalResponse | null)[]>;
|
|
24
|
+
fetchTaggedLogs(contractAddress: AztecAddress, recipient: AztecAddress): Promise<PendingTaggedLog[]>;
|
|
28
25
|
}
|
|
29
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
26
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nX3NlcnZpY2UuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dzL2xvZ19zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBZSxLQUFLLGNBQWMsRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUN2RixPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSxrQkFBa0IsQ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IsRUFBRSxxQkFBcUIsRUFDNUMsc0JBQXNCLEVBQUUsc0JBQXNCLEVBQzlDLFlBQVksRUFBRSxZQUFZLEVBQzFCLEtBQUssRUFBRSxNQUFNLEVBQzlCLFFBQVEsQ0FBQyxFQUFFLGNBQWMsRUFHMUI7SUFFWSxjQUFjLENBQ3pCLGVBQWUsRUFBRSxZQUFZLEVBQzdCLG9CQUFvQixFQUFFLG1CQUFtQixFQUFFLEdBQzFDLE9BQU8sQ0FBQyxDQUFDLG9CQUFvQixHQUFHLElBQUksQ0FBQyxFQUFFLENBQUMsQ0F1QjFDO0lBcURZLGVBQWUsQ0FBQyxlQUFlLEVBQUUsWUFBWSxFQUFFLFNBQVMsRUFBRSxZQUFZLEdBQUcsT0FBTyxDQUFDLGdCQUFnQixFQUFFLENBQUMsQ0E4QmhIO0NBMkNGIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log_service.d.ts","sourceRoot":"","sources":["../../src/logs/log_service.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"log_service.d.ts","sourceRoot":"","sources":["../../src/logs/log_service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AACvF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAuC,gBAAgB,EAAkB,MAAM,oBAAoB,CAAC;AAC3G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sEAAsE,CAAC;AAChH,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAC;AAC7G,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qDAAqD,CAAC;AACjG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uDAAuD,CAAC;AAOpG,qBAAa,UAAU;;IAInB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,sBAAsB;IACvC,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IATxB,OAAO,CAAC,GAAG,CAAS;IAEpB,YACmB,SAAS,EAAE,SAAS,EACpB,iBAAiB,EAAE,WAAW,EAC9B,QAAQ,EAAE,QAAQ,EAClB,qBAAqB,EAAE,qBAAqB,EAC5C,sBAAsB,EAAE,sBAAsB,EAC9C,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,EAC9B,QAAQ,CAAC,EAAE,cAAc,EAG1B;IAEY,cAAc,CACzB,eAAe,EAAE,YAAY,EAC7B,oBAAoB,EAAE,mBAAmB,EAAE,GAC1C,OAAO,CAAC,CAAC,oBAAoB,GAAG,IAAI,CAAC,EAAE,CAAC,CAuB1C;IAqDY,eAAe,CAAC,eAAe,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA8BhH;CA2CF"}
|
package/dest/logs/log_service.js
CHANGED
|
@@ -7,31 +7,34 @@ export class LogService {
|
|
|
7
7
|
aztecNode;
|
|
8
8
|
anchorBlockHeader;
|
|
9
9
|
keyStore;
|
|
10
|
-
capsuleStore;
|
|
11
10
|
recipientTaggingStore;
|
|
12
11
|
senderAddressBookStore;
|
|
13
12
|
addressStore;
|
|
14
13
|
jobId;
|
|
15
14
|
log;
|
|
16
|
-
constructor(aztecNode, anchorBlockHeader, keyStore,
|
|
15
|
+
constructor(aztecNode, anchorBlockHeader, keyStore, recipientTaggingStore, senderAddressBookStore, addressStore, jobId, bindings){
|
|
17
16
|
this.aztecNode = aztecNode;
|
|
18
17
|
this.anchorBlockHeader = anchorBlockHeader;
|
|
19
18
|
this.keyStore = keyStore;
|
|
20
|
-
this.capsuleStore = capsuleStore;
|
|
21
19
|
this.recipientTaggingStore = recipientTaggingStore;
|
|
22
20
|
this.senderAddressBookStore = senderAddressBookStore;
|
|
23
21
|
this.addressStore = addressStore;
|
|
24
22
|
this.jobId = jobId;
|
|
25
23
|
this.log = createLogger('pxe:log_service', bindings);
|
|
26
24
|
}
|
|
27
|
-
async
|
|
25
|
+
async fetchLogsByTag(contractAddress, logRetrievalRequests) {
|
|
26
|
+
for (const request of logRetrievalRequests){
|
|
27
|
+
if (!contractAddress.equals(request.contractAddress)) {
|
|
28
|
+
throw new Error(`Got a log retrieval request from ${request.contractAddress}, expected ${contractAddress}`);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
28
31
|
return await Promise.all(logRetrievalRequests.map(async (request)=>{
|
|
29
32
|
const [publicLog, privateLog] = await Promise.all([
|
|
30
33
|
this.#getPublicLogByTag(request.tag, request.contractAddress),
|
|
31
34
|
this.#getPrivateLogByTag(await SiloedTag.computeFromTagAndApp(request.tag, request.contractAddress))
|
|
32
35
|
]);
|
|
33
36
|
if (publicLog !== null && privateLog !== null) {
|
|
34
|
-
|
|
37
|
+
this.log.warn(`Found both a public and private log for tag ${request.tag} from contract ${request.contractAddress}. This may indicate a contract bug. Returning the public log.`);
|
|
35
38
|
}
|
|
36
39
|
return publicLog ?? privateLog;
|
|
37
40
|
}));
|
|
@@ -45,8 +48,7 @@ export class LogService {
|
|
|
45
48
|
if (logsForTag.length === 0) {
|
|
46
49
|
return null;
|
|
47
50
|
} else if (logsForTag.length > 1) {
|
|
48
|
-
|
|
49
|
-
throw new Error(`Got ${logsForTag.length} logs for tag ${tag} and contract ${contractAddress.toString()}. getPublicLogByTag currently only supports a single log per tag`);
|
|
51
|
+
this.log.warn(`Expected at most 1 public log for tag ${tag} and contract ${contractAddress.toString()}, got ${logsForTag.length}. This may indicate a contract bug. Returning the first log.`);
|
|
50
52
|
}
|
|
51
53
|
const scopedLog = logsForTag[0];
|
|
52
54
|
return new LogRetrievalResponse(scopedLog.logData.slice(1), scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier);
|
|
@@ -60,33 +62,21 @@ export class LogService {
|
|
|
60
62
|
if (logsForTag.length === 0) {
|
|
61
63
|
return null;
|
|
62
64
|
} else if (logsForTag.length > 1) {
|
|
63
|
-
|
|
64
|
-
throw new Error(`Got ${logsForTag.length} logs for tag ${siloedTag}. getPrivateLogByTag currently only supports a single log per tag`);
|
|
65
|
+
this.log.warn(`Expected at most 1 private log for tag ${siloedTag}, got ${logsForTag.length}. This may indicate a contract bug. Returning the first log.`);
|
|
65
66
|
}
|
|
66
67
|
const scopedLog = logsForTag[0];
|
|
67
68
|
return new LogRetrievalResponse(scopedLog.logData.slice(1), scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier);
|
|
68
69
|
}
|
|
69
|
-
async fetchTaggedLogs(contractAddress,
|
|
70
|
+
async fetchTaggedLogs(contractAddress, recipient) {
|
|
70
71
|
this.log.verbose(`Fetching tagged logs for ${contractAddress.toString()}`);
|
|
71
72
|
// We only load logs from block up to and including the anchor block number
|
|
72
73
|
const anchorBlockNumber = this.anchorBlockHeader.getBlockNumber();
|
|
73
74
|
const anchorBlockHash = await this.anchorBlockHeader.hash();
|
|
74
|
-
//
|
|
75
|
-
const
|
|
76
|
-
//
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
// Get all secrets for this recipient (one per sender)
|
|
80
|
-
const secrets = await this.#getSecretsForSenders(contractAddress, recipient);
|
|
81
|
-
// Load logs for all sender-recipient pairs in parallel
|
|
82
|
-
const logArrays = await Promise.all(secrets.map((secret)=>loadPrivateLogsForSenderRecipientPair(secret, this.aztecNode, this.recipientTaggingStore, anchorBlockNumber, anchorBlockHash, this.jobId)));
|
|
83
|
-
// Flatten all logs from all secrets
|
|
84
|
-
const allLogs = logArrays.flat();
|
|
85
|
-
// Store the logs for this recipient
|
|
86
|
-
if (allLogs.length > 0) {
|
|
87
|
-
await this.#storePendingTaggedLogs(contractAddress, pendingTaggedLogArrayBaseSlot, recipient, allLogs);
|
|
88
|
-
}
|
|
89
|
-
}));
|
|
75
|
+
// Get all secrets for this recipient (one per sender)
|
|
76
|
+
const secrets = await this.#getSecretsForSenders(contractAddress, recipient);
|
|
77
|
+
// Load logs for all sender-recipient pairs in parallel
|
|
78
|
+
const logArrays = await Promise.all(secrets.map((secret)=>loadPrivateLogsForSenderRecipientPair(secret, this.aztecNode, this.recipientTaggingStore, anchorBlockNumber, anchorBlockHash, this.jobId)));
|
|
79
|
+
return logArrays.flat().map((scopedLog)=>new PendingTaggedLog(scopedLog.logData, scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier));
|
|
90
80
|
}
|
|
91
81
|
async #getSecretsForSenders(contractAddress, recipient) {
|
|
92
82
|
const recipientCompleteAddress = await this.addressStore.getCompleteAddress(recipient);
|
|
@@ -102,17 +92,14 @@ export class LogService {
|
|
|
102
92
|
];
|
|
103
93
|
// We deduplicate the senders by adding them to a set and then converting the set back to an array
|
|
104
94
|
const deduplicatedSenders = Array.from(new Set(allSenders.map((sender)=>sender.toString()))).map((sender)=>AztecAddress.fromString(sender));
|
|
105
|
-
return Promise.all(deduplicatedSenders.map((sender)=>{
|
|
106
|
-
|
|
95
|
+
return Promise.all(deduplicatedSenders.map(async (sender)=>{
|
|
96
|
+
const secret = await ExtendedDirectionalAppTaggingSecret.compute(recipientCompleteAddress, recipientIvsk, sender, contractAddress, recipient);
|
|
97
|
+
if (!secret) {
|
|
98
|
+
// Note that all senders originate from either the SenderAddressBookStore or the KeyStore.
|
|
99
|
+
// TODO(F-512): make sure we actually prevent registering invalid senders.
|
|
100
|
+
throw new Error(`Failed to compute a tagging secret for sender ${sender} - this implies this is an invalid address, which should not happen as they have been previously registered in PXE.`);
|
|
101
|
+
}
|
|
102
|
+
return secret;
|
|
107
103
|
}));
|
|
108
104
|
}
|
|
109
|
-
#storePendingTaggedLogs(contractAddress, capsuleArrayBaseSlot, recipient, privateLogs) {
|
|
110
|
-
// Build all pending tagged logs from the scoped logs
|
|
111
|
-
const pendingTaggedLogs = privateLogs.map((scopedLog)=>{
|
|
112
|
-
const pendingTaggedLog = new PendingTaggedLog(scopedLog.logData, scopedLog.txHash, scopedLog.noteHashes, scopedLog.firstNullifier, recipient);
|
|
113
|
-
return pendingTaggedLog.toFields();
|
|
114
|
-
});
|
|
115
|
-
// TODO: This looks like it could belong more at the oracle interface level
|
|
116
|
-
return this.capsuleStore.appendToCapsuleArray(contractAddress, capsuleArrayBaseSlot, pendingTaggedLogs, this.jobId);
|
|
117
|
-
}
|
|
118
105
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import type { AztecNode } from '@aztec/stdlib/interfaces/server';
|
|
3
|
+
import { MessageContext } from '@aztec/stdlib/logs';
|
|
4
|
+
/** Resolves transaction hashes into the context needed to process messages. */
|
|
5
|
+
export declare class MessageContextService {
|
|
6
|
+
private readonly aztecNode;
|
|
7
|
+
constructor(aztecNode: AztecNode);
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a list of tx hashes into their message contexts.
|
|
10
|
+
*
|
|
11
|
+
* For each tx hash, looks up the corresponding tx effect and extracts the note hashes and first nullifier needed to
|
|
12
|
+
* process messages that originated from that transaction. Returns `null` for tx hashes that are zero, not yet
|
|
13
|
+
* available, or in blocks beyond the anchor block.
|
|
14
|
+
*/
|
|
15
|
+
getMessageContextsByTxHash(txHashes: Fr[], anchorBlockNumber: number): Promise<(MessageContext | null)[]>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZV9jb250ZX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,GAAG,OAAO,CAAC,CAAC,cAAc,GAAG,IAAI,CAAC,EAAE,CAAC,CA0BxG;CACF"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { MessageContext } from '@aztec/stdlib/logs';
|
|
2
|
+
import { TxHash } from '@aztec/stdlib/tx';
|
|
3
|
+
/** Resolves transaction hashes into the context needed to process messages. */ export class MessageContextService {
|
|
4
|
+
aztecNode;
|
|
5
|
+
constructor(aztecNode){
|
|
6
|
+
this.aztecNode = aztecNode;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Resolves a list of tx hashes into their message contexts.
|
|
10
|
+
*
|
|
11
|
+
* For each tx hash, looks up the corresponding tx effect and extracts the note hashes and first nullifier needed to
|
|
12
|
+
* process messages that originated from that transaction. Returns `null` for tx hashes that are zero, not yet
|
|
13
|
+
* available, or in blocks beyond the anchor block.
|
|
14
|
+
*/ getMessageContextsByTxHash(txHashes, anchorBlockNumber) {
|
|
15
|
+
// TODO: optimize, we might be hitting the node to get the same txHash repeatedly
|
|
16
|
+
return Promise.all(txHashes.map(async (txHashField)=>{
|
|
17
|
+
// A zero tx hash indicates a tx-less offchain message (e.g. one not tied to any onchain transaction).
|
|
18
|
+
// These messages don't have a transaction context to resolve, so we return null.
|
|
19
|
+
if (txHashField.isZero()) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const txHash = TxHash.fromField(txHashField);
|
|
23
|
+
const txEffect = await this.aztecNode.getTxEffect(txHash);
|
|
24
|
+
if (!txEffect || txEffect.l2BlockNumber > anchorBlockNumber) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
// Every tx has at least one nullifier (the first nullifier derived from the tx hash). Hitting this condition
|
|
28
|
+
// would mean a buggy node, but since we need to access data.nullifiers[0], the defensive check does no harm.
|
|
29
|
+
const data = txEffect.data;
|
|
30
|
+
if (data.nullifiers.length === 0) {
|
|
31
|
+
throw new Error(`Tx effect for ${txHash} has no nullifiers`);
|
|
32
|
+
}
|
|
33
|
+
return new MessageContext(data.txHash, data.noteHashes, data.nullifiers[0]);
|
|
34
|
+
}));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -3,7 +3,6 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
3
3
|
import { type AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
4
4
|
import { Note, NoteStatus } from '@aztec/stdlib/note';
|
|
5
5
|
import type { BlockHeader, TxHash } from '@aztec/stdlib/tx';
|
|
6
|
-
import type { AccessScopes } from '../access_scopes.js';
|
|
7
6
|
import type { NoteStore } from '../storage/note_store/note_store.js';
|
|
8
7
|
export declare class NoteService {
|
|
9
8
|
private readonly noteStore;
|
|
@@ -20,7 +19,7 @@ export declare class NoteService {
|
|
|
20
19
|
* @param status - The status of notes to fetch.
|
|
21
20
|
* @param scopes - The accounts whose notes we can access in this call. Currently optional and will default to all.
|
|
22
21
|
*/
|
|
23
|
-
getNotes(contractAddress: AztecAddress, owner: AztecAddress | undefined, storageSlot: Fr, status: NoteStatus, scopes:
|
|
22
|
+
getNotes(contractAddress: AztecAddress, owner: AztecAddress | undefined, storageSlot: Fr, status: NoteStatus, scopes: AztecAddress[]): Promise<{
|
|
24
23
|
contractAddress: AztecAddress;
|
|
25
24
|
owner: AztecAddress;
|
|
26
25
|
storageSlot: Fr;
|
|
@@ -43,7 +42,7 @@ export declare class NoteService {
|
|
|
43
42
|
*
|
|
44
43
|
* @param contractAddress - The contract whose notes should be checked and nullified.
|
|
45
44
|
*/
|
|
46
|
-
syncNoteNullifiers(contractAddress: AztecAddress, scopes:
|
|
47
|
-
validateAndStoreNote(contractAddress: AztecAddress, owner: AztecAddress, storageSlot: Fr, randomness: Fr, noteNonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: TxHash,
|
|
45
|
+
syncNoteNullifiers(contractAddress: AztecAddress, scopes: AztecAddress[]): Promise<void>;
|
|
46
|
+
validateAndStoreNote(contractAddress: AztecAddress, owner: AztecAddress, storageSlot: Fr, randomness: Fr, noteNonce: Fr, content: Fr[], noteHash: Fr, nullifier: Fr, txHash: TxHash, scope: AztecAddress): Promise<void>;
|
|
48
47
|
}
|
|
49
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvbm90ZXMvbm90ZV9zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUdoRSxPQUFPLEVBQUUsS0FBSyxTQUFTLEVBQWUsTUFBTSxpQ0FBaUMsQ0FBQztBQUM5RSxPQUFPLEVBQUUsSUFBSSxFQUFXLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRS9ELE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUU1RCxPQUFPLEtBQUssRUFBRSxTQUFTLEVBQUUsTUFBTSxxQ0FBcUMsQ0FBQztBQUVyRSxxQkFBYSxXQUFXO0lBRXBCLE9BQU8sQ0FBQyxRQUFRLENBQUMsU0FBUztJQUMxQixPQUFPLENBQUMsUUFBUSxDQUFDLFNBQVM7SUFDMUIsT0FBTyxDQUFDLFFBQVEsQ0FBQyxpQkFBaUI7SUFDbEMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxLQUFLO0lBSnhCLFlBQ21CLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLGlCQUFpQixFQUFFLFdBQVcsRUFDOUIsS0FBSyxFQUFFLE1BQU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AE,EAAE,EACb,OAAO,EAAE,EAAE,EAAE,EACb,QAAQ,EAAE,EAAE,EACZ,SAAS,EAAE,EAAE,EACb,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,IAAI,CAAC,CAiFf;CACF"}
|
|
@@ -87,7 +87,7 @@ export class NoteService {
|
|
|
87
87
|
}).filter((nullifier)=>nullifier !== undefined);
|
|
88
88
|
await this.noteStore.applyNullifiers(foundNullifiers, this.jobId);
|
|
89
89
|
}
|
|
90
|
-
async validateAndStoreNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash,
|
|
90
|
+
async validateAndStoreNote(contractAddress, owner, storageSlot, randomness, noteNonce, content, noteHash, nullifier, txHash, scope) {
|
|
91
91
|
// We are going to store the new note in the NoteStore, which will let us later return it via `getNotes`.
|
|
92
92
|
// There's two things we need to check before we do this however:
|
|
93
93
|
// - we must make sure the note does actually exist in the note hash tree
|
|
@@ -119,21 +119,30 @@ export class NoteService {
|
|
|
119
119
|
])
|
|
120
120
|
]);
|
|
121
121
|
if (!txEffect) {
|
|
122
|
-
|
|
122
|
+
// We error out instead of just logging a warning and skipping the note because this would indicate a bug. This
|
|
123
|
+
// is because the node has already served info about this tx either when obtaining the log (TxScopedL2Log contain
|
|
124
|
+
// tx info) or when getting metadata for the offchain message (before the message got passed to `process_log`).
|
|
125
|
+
throw new Error(`Could not find tx effect for tx hash ${txHash} when processing a note.`);
|
|
123
126
|
}
|
|
124
127
|
if (txEffect.l2BlockNumber > anchorBlockNumber) {
|
|
125
|
-
|
|
128
|
+
// If the message was delivered onchain, this would indicate a bug: log sync should never load logs from blocks
|
|
129
|
+
// newer than the anchor block. If the note came via an offchain message, it would likely also be a bug, since we
|
|
130
|
+
// sync a new anchor block before calling `process_message`. For this not to be a bug, the message would need to
|
|
131
|
+
// come from a newer block than the anchor served by the node, implying the node isn't properly synced.
|
|
132
|
+
// We therefore error out here rather than assuming the offchain message was constructed by a malicious
|
|
133
|
+
// sender with the intention of bricking recipient's PXE (if we assumed that we would just ignore the message).
|
|
134
|
+
throw new Error(`Obtained a newer tx effect for ${txHash} for a note validation request than the anchor block ${anchorBlockNumber}. This is a bug as we should not ever be processing a note from a newer block than the anchor block.`);
|
|
126
135
|
}
|
|
127
136
|
// Find the index of the note hash in the noteHashes array to determine note ordering within the tx
|
|
128
137
|
const noteIndexInTx = txEffect.data.noteHashes.findIndex((nh)=>nh.equals(uniqueNoteHash));
|
|
129
138
|
if (noteIndexInTx === -1) {
|
|
139
|
+
// Similar to the comment above - we error out as this would indicate a bug in nonce discovery.
|
|
130
140
|
throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present in tx ${txHash}`);
|
|
131
141
|
}
|
|
132
142
|
const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, txEffect.l2BlockNumber, txEffect.l2BlockHash.toString(), txEffect.txIndexInBlock, noteIndexInTx);
|
|
133
|
-
// The note was found by `recipient`, so we use that as the scope when storing the note.
|
|
134
143
|
await this.noteStore.addNotes([
|
|
135
144
|
noteDao
|
|
136
|
-
],
|
|
145
|
+
], scope, this.jobId);
|
|
137
146
|
if (nullifierIndex !== undefined) {
|
|
138
147
|
// We found nullifier index which implies that the note has already been nullified.
|
|
139
148
|
const { data: _, ...blockHashAndNum } = nullifierIndex;
|
package/dest/notes_filter.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
2
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
3
|
import type { NoteStatus } from '@aztec/stdlib/note';
|
|
4
|
-
import type { AccessScopes } from './access_scopes.js';
|
|
5
4
|
/**
|
|
6
5
|
* A filter used to fetch notes.
|
|
7
6
|
* @remarks This filter is applied as an intersection of all its params.
|
|
@@ -20,6 +19,6 @@ export type NotesFilter = {
|
|
|
20
19
|
status?: NoteStatus;
|
|
21
20
|
/** The siloed nullifier for the note. */
|
|
22
21
|
siloedNullifier?: Fr;
|
|
23
|
-
scopes:
|
|
22
|
+
scopes: AztecAddress[];
|
|
24
23
|
};
|
|
25
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZXNfZmlsdGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvbm90ZXNfZmlsdGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3pELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLDZCQUE2QixDQUFDO0FBQ2hFLE9BQU8sS0FBSyxFQUFFLFVBQVUsRUFBRSxNQUFNLG9CQUFvQixDQUFDO0FBRXJEOzs7R0FHRztBQUNILE1BQU0sTUFBTSxXQUFXLEdBQUc7SUFDeEI7OztPQUdHO0lBQ0gsZUFBZSxFQUFFLFlBQVksQ0FBQztJQUM5Qiw2QkFBNkI7SUFDN0IsS0FBSyxDQUFDLEVBQUUsWUFBWSxDQUFDO0lBQ3JCLGlFQUFpRTtJQUNqRSxXQUFXLENBQUMsRUFBRSxFQUFFLENBQUM7SUFDakIsb0RBQW9EO0lBQ3BELE1BQU0sQ0FBQyxFQUFFLFVBQVUsQ0FBQztJQUNwQix5Q0FBeUM7SUFDekMsZUFBZSxDQUFDLEVBQUUsRUFBRSxDQUFDO0lBQ3JCLE1BQU0sRUFBRSxZQUFZLEVBQUUsQ0FBQztDQUN4QixDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"notes_filter.d.ts","sourceRoot":"","sources":["../src/notes_filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD
|
|
1
|
+
{"version":3,"file":"notes_filter.d.ts","sourceRoot":"","sources":["../src/notes_filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB;;;OAGG;IACH,eAAe,EAAE,YAAY,CAAC;IAC9B,6BAA6B;IAC7B,KAAK,CAAC,EAAE,YAAY,CAAC;IACrB,iEAAiE;IACjE,WAAW,CAAC,EAAE,EAAE,CAAC;IACjB,oDAAoD;IACpD,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,yCAAyC;IACzC,eAAe,CAAC,EAAE,EAAE,CAAC;IACrB,MAAM,EAAE,YAAY,EAAE,CAAC;CACxB,CAAC"}
|
package/dest/oracle_version.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
1
|
+
export declare const ORACLE_VERSION_MAJOR = 22;
|
|
2
|
+
export declare const ORACLE_VERSION_MINOR = 1;
|
|
3
|
+
export declare const ORACLE_INTERFACE_HASH = "efafa0db2cc1f94e26d794d0079c8f71115261df0c3d0fa8cb5b64f17a12db92";
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlX3ZlcnNpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9vcmFjbGVfdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFZQSxlQUFPLE1BQU0sb0JBQW9CLEtBQUssQ0FBQztBQUN2QyxlQUFPLE1BQU0sb0JBQW9CLElBQUksQ0FBQztBQVF0QyxlQUFPLE1BQU0scUJBQXFCLHFFQUFxRSxDQUFDIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oracle_version.d.ts","sourceRoot":"","sources":["../src/oracle_version.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"oracle_version.d.ts","sourceRoot":"","sources":["../src/oracle_version.ts"],"names":[],"mappings":"AAYA,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,oBAAoB,IAAI,CAAC;AAQtC,eAAO,MAAM,qBAAqB,qEAAqE,CAAC"}
|
package/dest/oracle_version.js
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
/// The
|
|
2
|
-
///
|
|
3
|
-
///
|
|
1
|
+
/// The oracle version constants are used to check that the oracle interface is in sync between PXE and Aztec.nr.
|
|
2
|
+
/// We version the oracle interface as `major.minor` where:
|
|
3
|
+
/// - `major` = backward-breaking changes (must match exactly between PXE and Aztec.nr)
|
|
4
|
+
/// - `minor` = oracle additions (non-breaking; PXE minor >= contract minor)
|
|
4
5
|
///
|
|
5
|
-
///
|
|
6
|
-
///
|
|
7
|
-
|
|
8
|
-
///
|
|
9
|
-
///
|
|
10
|
-
///
|
|
11
|
-
|
|
6
|
+
/// The Noir counterparts are in `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
|
|
7
|
+
///
|
|
8
|
+
/// @dev Whenever a contract function or Noir test is run, the `aztec_utl_assertCompatibleOracleVersion` oracle is called.
|
|
9
|
+
/// If the major version is incompatible, an error is thrown immediately. The minor version is recorded by the PXE and
|
|
10
|
+
/// used to provide helpful error messages if a contract calls an oracle that doesn't exist. We don't throw immediately
|
|
11
|
+
/// if AZTEC_NR_MINOR > PXE_MINOR because if a contract is updated to use a newer Aztec.nr dependency without actually
|
|
12
|
+
/// using any of the new oracles then there is no reason to throw.
|
|
13
|
+
export const ORACLE_VERSION_MAJOR = 22;
|
|
14
|
+
export const ORACLE_VERSION_MINOR = 1;
|
|
15
|
+
/// This hash is computed from the Oracle interface and is used to detect when that interface changes. When it does,
|
|
16
|
+
/// you need to either:
|
|
17
|
+
/// - increment `ORACLE_VERSION_MAJOR` and reset `ORACLE_VERSION_MINOR` to zero if the change is breaking, or
|
|
18
|
+
/// - increment only `ORACLE_VERSION_MINOR` if the change is additive (a new oracle was added).
|
|
19
|
+
///
|
|
20
|
+
/// These constants must be kept in sync between this file and `noir-projects/aztec-nr/aztec/src/oracle/version.nr`.
|
|
21
|
+
export const ORACLE_INTERFACE_HASH = 'efafa0db2cc1f94e26d794d0079c8f71115261df0c3d0fa8cb5b64f17a12db92';
|