@aztec/pxe 0.0.1-commit.ffe5b04ea → 0.0.1-commit.fff30aa
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 +3 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +10 -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/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +13 -5
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +36 -9
- 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 +33 -21
- 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 +51 -20
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +188 -46
- package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +13 -39
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +27 -49
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +74 -42
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +252 -87
- 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 +20 -3
- 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 +62 -43
- 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/events/private_event_filter_validator.d.ts +3 -2
- package/dest/events/private_event_filter_validator.d.ts.map +1 -1
- package/dest/events/private_event_filter_validator.js +15 -0
- package/dest/logs/log_service.d.ts +7 -8
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +27 -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/private_kernel/private_kernel_execution_prover.d.ts +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_execution_prover.js +4 -7
- package/dest/private_kernel/private_kernel_oracle.d.ts +5 -5
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +12 -15
- package/dest/pxe.d.ts +11 -9
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +48 -29
- package/dest/storage/anchor_block_store/anchor_block_store.js +1 -1
- 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 +36 -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/contract_store/contract_store.d.ts +1 -1
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +4 -2
- 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/private_event_store/private_event_store.d.ts +1 -1
- package/dest/storage/private_event_store/private_event_store.d.ts.map +1 -1
- package/dest/storage/private_event_store/private_event_store.js +3 -0
- 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/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +2 -2
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.js +2 -16
- 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 +12 -0
- package/src/config/index.ts +1 -1
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +50 -13
- 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 +54 -29
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +104 -0
- package/src/contract_function_simulator/oracle/oracle.ts +262 -66
- package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +36 -69
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +427 -116
- package/src/contract_function_simulator/pick_notes.ts +22 -3
- 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 +99 -75
- 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/events/private_event_filter_validator.ts +21 -1
- package/src/logs/log_service.ts +57 -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/private_kernel/private_kernel_execution_prover.ts +4 -9
- package/src/private_kernel/private_kernel_oracle.ts +14 -14
- package/src/pxe.ts +75 -34
- package/src/storage/anchor_block_store/anchor_block_store.ts +1 -1
- package/src/storage/capsule_store/capsule_service.ts +90 -0
- package/src/storage/capsule_store/capsule_store.ts +44 -26
- package/src/storage/capsule_store/index.ts +1 -0
- package/src/storage/contract_store/contract_store.ts +8 -6
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +2 -5
- package/src/storage/private_event_store/private_event_store.ts +4 -0
- package/src/storage/tagging_store/sender_tagging_store.ts +182 -135
- package/src/tagging/index.ts +1 -1
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +5 -15
- 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
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';
|
|
@@ -42,4 +42,4 @@ export declare class PrivateKernelExecutionProver {
|
|
|
42
42
|
private getVkData;
|
|
43
43
|
private createPrivateCallData;
|
|
44
44
|
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CLEVBQzNCLFlBQVksRUFBRSxtQkFBbUIsRUFDakMsVUFBVSxVQUFRLEVBQzFCLFFBQVEsQ0FBQyxFQUFFLGNBQWMsRUFHMUI7SUFFRDs7Ozs7Ozs7OztPQVVHO0lBQ0csZ0JBQWdCLENBQ3BCLFNBQVMsRUFBRSxTQUFTLEVBQ3BCLGVBQWUsRUFBRSxzQkFBc0IsRUFDdkMsRUFBRSxRQUFRLEVBQUUsa0JBQWtCLEVBQUUsV0FBVyxFQUFFLEdBQUUsa0NBSTlDLEdBQ0EsT0FBTyxDQUFDLGlDQUFpQyxDQUFDLG9DQUFvQyxDQUFDLENBQUMsQ0FxUmxGO0lBRUQ7Ozs7O09BS0c7SUFDSCxPQUFPLENBQUMsdUJBQXVCO1lBb0JqQixTQUFTO1lBU1QscUJBQXFCO0NBK0JwQyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAMvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAGV,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"private_kernel_execution_prover.d.ts","sourceRoot":"","sources":["../../src/private_kernel/private_kernel_execution_prover.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,KAAK,cAAc,EAAgB,MAAM,uBAAuB,CAAC;AAMvF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAC3E,OAAO,EAQL,KAAK,iCAAiC,EAKtC,KAAK,oCAAoC,EAE1C,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,sBAAsB,EAC3B,SAAS,EAGV,MAAM,kBAAkB,CAAC;AAK1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAStE,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,OAAO,CAAC;IAClB,kBAAkB,EAAE,OAAO,CAAC;IAC5B,WAAW,EAAE,OAAO,GAAG,iBAAiB,GAAG,MAAM,GAAG,MAAM,CAAC;CAC5D;AAED;;;;;GAKG;AACH,qBAAa,4BAA4B;IAIrC,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,UAAU;IALpB,OAAO,CAAC,GAAG,CAAS;IAEpB,YACU,MAAM,EAAE,mBAAmB,EAC3B,YAAY,EAAE,mBAAmB,EACjC,UAAU,UAAQ,EAC1B,QAAQ,CAAC,EAAE,cAAc,EAG1B;IAED;;;;;;;;;;OAUG;IACG,gBAAgB,CACpB,SAAS,EAAE,SAAS,EACpB,eAAe,EAAE,sBAAsB,EACvC,EAAE,QAAQ,EAAE,kBAAkB,EAAE,WAAW,EAAE,GAAE,kCAI9C,GACA,OAAO,CAAC,iCAAiC,CAAC,oCAAoC,CAAC,CAAC,CAqRlF;IAED;;;;;OAKG;IACH,OAAO,CAAC,uBAAuB;YAoBjB,SAAS;YAST,qBAAqB;CA+BpC"}
|
|
@@ -10,6 +10,7 @@ import { HidingKernelToPublicPrivateInputs, HidingKernelToRollupPrivateInputs, P
|
|
|
10
10
|
import { ChonkProof } from '@aztec/stdlib/proofs';
|
|
11
11
|
import { collectNoteHashNullifierCounterMap, getFinalMinRevertibleSideEffectCounter } from '@aztec/stdlib/tx';
|
|
12
12
|
import { VerificationKeyAsFields, VerificationKeyData, VkData } from '@aztec/stdlib/vks';
|
|
13
|
+
import { computeTxExpirationTimestamp } from './hints/compute_tx_expiration_timestamp.js';
|
|
13
14
|
import { PrivateKernelResetPrivateInputsBuilder } from './hints/private_kernel_reset_private_inputs_builder.js';
|
|
14
15
|
const NULL_SIMULATE_OUTPUT = {
|
|
15
16
|
publicInputs: PrivateKernelCircuitPublicInputs.empty(),
|
|
@@ -169,13 +170,9 @@ const NULL_SIMULATE_OUTPUT = {
|
|
|
169
170
|
this.log.debug(`Calling private kernel tail with hwm ${previousKernelData.publicInputs.minRevertibleSideEffectCounter}`);
|
|
170
171
|
// TODO: Enable padding once we better understand the final amounts to pad to.
|
|
171
172
|
const paddedSideEffectAmounts = PaddedSideEffectAmounts.empty();
|
|
172
|
-
//
|
|
173
|
-
//
|
|
174
|
-
const expirationTimestampUpperBound = previousKernelData.publicInputs
|
|
175
|
-
const anchorBlockTimestamp = previousKernelData.publicInputs.constants.anchorBlockHeader.globalVariables.timestamp;
|
|
176
|
-
if (expirationTimestampUpperBound <= anchorBlockTimestamp) {
|
|
177
|
-
throw new Error(`Include-by timestamp must be greater than the anchor block timestamp. Anchor block timestamp: ${anchorBlockTimestamp}. Include-by timestamp: ${expirationTimestampUpperBound}.`);
|
|
178
|
-
}
|
|
173
|
+
// Round the aggregated expirationTimestamp down to reduce precision and avoid leaking which private
|
|
174
|
+
// functions were called via their exact expiration offsets.
|
|
175
|
+
const expirationTimestampUpperBound = computeTxExpirationTimestamp(previousKernelData.publicInputs);
|
|
179
176
|
const privateInputs = new PrivateKernelTailCircuitPrivateInputs(previousKernelData, paddedSideEffectAmounts, expirationTimestampUpperBound);
|
|
180
177
|
const witgenTimer = new Timer();
|
|
181
178
|
const tailOutput = generateWitnesses ? await this.proofCreator.generateTailOutput(privateInputs) : await this.proofCreator.simulateTail(privateInputs);
|
|
@@ -5,11 +5,11 @@ import { MembershipWitness } from '@aztec/foundation/trees';
|
|
|
5
5
|
import type { KeyStore } from '@aztec/key-store';
|
|
6
6
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
7
7
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import { BlockHash } from '@aztec/stdlib/block';
|
|
9
8
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
10
9
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
11
10
|
import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
12
11
|
import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
|
|
12
|
+
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
13
13
|
import type { VerificationKeyAsFields } from '@aztec/stdlib/vks';
|
|
14
14
|
import type { ContractStore } from '../storage/contract_store/contract_store.js';
|
|
15
15
|
/**
|
|
@@ -19,8 +19,8 @@ export declare class PrivateKernelOracle {
|
|
|
19
19
|
private contractStore;
|
|
20
20
|
private keyStore;
|
|
21
21
|
private node;
|
|
22
|
-
private
|
|
23
|
-
constructor(contractStore: ContractStore, keyStore: KeyStore, node: AztecNode,
|
|
22
|
+
private blockHeader;
|
|
23
|
+
constructor(contractStore: ContractStore, keyStore: KeyStore, node: AztecNode, blockHeader: BlockHeader);
|
|
24
24
|
/** Retrieves the preimage of a contract address from the registered contract instances db. */
|
|
25
25
|
getContractAddressPreimage(address: AztecAddress): Promise<ContractInstanceWithAddress & {
|
|
26
26
|
saltedInitializationHash: Fr;
|
|
@@ -43,7 +43,7 @@ export declare class PrivateKernelOracle {
|
|
|
43
43
|
/** Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree. */
|
|
44
44
|
getNullifierMembershipWitness(nullifier: Fr): Promise<NullifierMembershipWitness | undefined>;
|
|
45
45
|
/** Returns the root of our note hash merkle tree. */
|
|
46
|
-
getNoteHashTreeRoot():
|
|
46
|
+
getNoteHashTreeRoot(): Fr;
|
|
47
47
|
/**
|
|
48
48
|
* Retrieves the sk_m corresponding to the pk_m.
|
|
49
49
|
* @throws If the provided public key is not associated with any of the registered accounts.
|
|
@@ -60,4 +60,4 @@ export declare class PrivateKernelOracle {
|
|
|
60
60
|
*/
|
|
61
61
|
getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
|
|
62
62
|
}
|
|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ractStore, keyStore, node,
|
|
15
|
+
blockHeader;
|
|
16
|
+
constructor(contractStore, keyStore, node, blockHeader){
|
|
17
17
|
this.contractStore = contractStore;
|
|
18
18
|
this.keyStore = keyStore;
|
|
19
19
|
this.node = node;
|
|
20
|
-
this.
|
|
20
|
+
this.blockHeader = blockHeader;
|
|
21
21
|
}
|
|
22
22
|
/** Retrieves the preimage of a contract address from the registered contract instances db. */ async getContractAddressPreimage(address) {
|
|
23
23
|
const instance = await this.contractStore.getContractInstance(address);
|
|
@@ -54,18 +54,14 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
|
54
54
|
const leafIndex = getVKIndex(vk);
|
|
55
55
|
return Promise.resolve(new MembershipWitness(VK_TREE_HEIGHT, BigInt(leafIndex), getVKSiblingPath(leafIndex)));
|
|
56
56
|
}
|
|
57
|
-
/** Returns a membership witness with the sibling path and leaf index in our note hash tree. */ getNoteHashMembershipWitness(noteHash) {
|
|
58
|
-
return this.node.getNoteHashMembershipWitness(this.
|
|
57
|
+
/** Returns a membership witness with the sibling path and leaf index in our note hash tree. */ async getNoteHashMembershipWitness(noteHash) {
|
|
58
|
+
return this.node.getNoteHashMembershipWitness(await this.blockHeader.hash(), noteHash);
|
|
59
59
|
}
|
|
60
|
-
/** Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree. */ getNullifierMembershipWitness(nullifier) {
|
|
61
|
-
return this.node.getNullifierMembershipWitness(this.
|
|
60
|
+
/** Returns a membership witness with the sibling path and leaf index in our nullifier indexed merkle tree. */ async getNullifierMembershipWitness(nullifier) {
|
|
61
|
+
return this.node.getNullifierMembershipWitness(await this.blockHeader.hash(), nullifier);
|
|
62
62
|
}
|
|
63
|
-
/** Returns the root of our note hash merkle tree. */
|
|
64
|
-
|
|
65
|
-
if (!header) {
|
|
66
|
-
throw new Error(`No block header found for block hash ${this.blockHash}`);
|
|
67
|
-
}
|
|
68
|
-
return header.state.partial.noteHashTree.root;
|
|
63
|
+
/** Returns the root of our note hash merkle tree. */ getNoteHashTreeRoot() {
|
|
64
|
+
return this.blockHeader.state.partial.noteHashTree.root;
|
|
69
65
|
}
|
|
70
66
|
/**
|
|
71
67
|
* Retrieves the sk_m corresponding to the pk_m.
|
|
@@ -85,11 +81,12 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
|
85
81
|
*/ async getUpdatedClassIdHints(contractAddress) {
|
|
86
82
|
const { delayedPublicMutableSlot, delayedPublicMutableHashSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
|
|
87
83
|
const hashLeafSlot = await computePublicDataTreeLeafSlot(ProtocolContractAddress.ContractInstanceRegistry, delayedPublicMutableHashSlot);
|
|
88
|
-
const
|
|
84
|
+
const blockHash = await this.blockHeader.hash();
|
|
85
|
+
const updatedClassIdWitness = await this.node.getPublicDataWitness(blockHash, hashLeafSlot);
|
|
89
86
|
if (!updatedClassIdWitness) {
|
|
90
87
|
throw new Error(`No public data tree witness found for ${hashLeafSlot}`);
|
|
91
88
|
}
|
|
92
|
-
const readStorage = (storageSlot)=>this.node.getPublicStorageAt(
|
|
89
|
+
const readStorage = (storageSlot)=>this.node.getPublicStorageAt(blockHash, ProtocolContractAddress.ContractInstanceRegistry, storageSlot);
|
|
93
90
|
const delayedPublicMutableValues = await DelayedPublicMutableValues.readFromTree(delayedPublicMutableSlot, readStorage);
|
|
94
91
|
return new UpdatedClassIdHints(new MembershipWitness(PUBLIC_DATA_TREE_HEIGHT, updatedClassIdWitness.index, updatedClassIdWitness.siblingPath.toTuple()), updatedClassIdWitness.leafPreimage, delayedPublicMutableValues);
|
|
95
92
|
}
|
package/dest/pxe.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
10
10
|
import { CompleteAddress, type ContractInstanceWithAddress, type PartialAddress } from '@aztec/stdlib/contract';
|
|
11
11
|
import type { AztecNode, PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
12
12
|
import { BlockHeader, type InTx, SimulationOverrides, TxExecutionRequest, TxProfileResult, TxProvingResult, TxSimulationResult, UtilityExecutionResult } from '@aztec/stdlib/tx';
|
|
13
|
-
import type { AccessScopes } from './access_scopes.js';
|
|
14
13
|
import type { PXEConfig } from './config/index.js';
|
|
15
14
|
import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
16
15
|
export type PackedPrivateEvent = InTx & {
|
|
@@ -24,7 +23,7 @@ export type ProfileTxOpts = {
|
|
|
24
23
|
/** If true, proof generation is skipped during profiling. Defaults to true. */
|
|
25
24
|
skipProofGeneration?: boolean;
|
|
26
25
|
/** Addresses whose private state and keys are accessible during private execution. */
|
|
27
|
-
scopes:
|
|
26
|
+
scopes: AztecAddress[];
|
|
28
27
|
};
|
|
29
28
|
/** Options for PXE.simulateTx. */
|
|
30
29
|
export type SimulateTxOpts = {
|
|
@@ -34,17 +33,19 @@ export type SimulateTxOpts = {
|
|
|
34
33
|
skipTxValidation?: boolean;
|
|
35
34
|
/** If false, fees are enforced. */
|
|
36
35
|
skipFeeEnforcement?: boolean;
|
|
37
|
-
/**
|
|
36
|
+
/** If true, kernel logic is emulated in TS for simulation */
|
|
37
|
+
skipKernels?: boolean;
|
|
38
|
+
/** State overrides for the simulation, such as contract instances and artifacts. Requires skipKernels: true */
|
|
38
39
|
overrides?: SimulationOverrides;
|
|
39
40
|
/** Addresses whose private state and keys are accessible during private execution */
|
|
40
|
-
scopes:
|
|
41
|
+
scopes: AztecAddress[];
|
|
41
42
|
};
|
|
42
43
|
/** Options for PXE.executeUtility. */
|
|
43
44
|
export type ExecuteUtilityOpts = {
|
|
44
45
|
/** The authentication witnesses required for the function call. */
|
|
45
46
|
authwits?: AuthWitness[];
|
|
46
47
|
/** The accounts whose notes we can access in this call */
|
|
47
|
-
scopes:
|
|
48
|
+
scopes: AztecAddress[];
|
|
48
49
|
};
|
|
49
50
|
/** Args for PXE.create. */
|
|
50
51
|
export type PXECreateArgs = {
|
|
@@ -70,7 +71,6 @@ export type PXECreateArgs = {
|
|
|
70
71
|
export declare class PXE {
|
|
71
72
|
#private;
|
|
72
73
|
private node;
|
|
73
|
-
private db;
|
|
74
74
|
private blockStateSynchronizer;
|
|
75
75
|
private keyStore;
|
|
76
76
|
private contractStore;
|
|
@@ -83,6 +83,8 @@ export declare class PXE {
|
|
|
83
83
|
private addressStore;
|
|
84
84
|
private privateEventStore;
|
|
85
85
|
private contractSyncService;
|
|
86
|
+
private messageContextService;
|
|
87
|
+
private l2TipsStore;
|
|
86
88
|
private simulator;
|
|
87
89
|
private proverEnabled;
|
|
88
90
|
private proofCreator;
|
|
@@ -223,7 +225,7 @@ export declare class PXE {
|
|
|
223
225
|
*
|
|
224
226
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
225
227
|
*/
|
|
226
|
-
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
228
|
+
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, skipKernels, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
227
229
|
/**
|
|
228
230
|
* Executes a contract utility function.
|
|
229
231
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
@@ -244,8 +246,8 @@ export declare class PXE {
|
|
|
244
246
|
*/
|
|
245
247
|
getPrivateEvents(eventSelector: EventSelector, filter: PrivateEventFilter): Promise<PackedPrivateEvent[]>;
|
|
246
248
|
/**
|
|
247
|
-
* Stops the PXE's job queue
|
|
249
|
+
* Stops the PXE's job queue.
|
|
248
250
|
*/
|
|
249
251
|
stop(): Promise<void>;
|
|
250
252
|
}
|
|
251
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
253
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9z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,QAAQ,EAAE,MAAM,EAAE,GAAE,kBAAmC,GACxD,OAAO,CAAC,sBAAsB,CAAC,CA6DjC;IAED;;;;;;;;;;;;OAYG;IACU,gBAAgB,CAC3B,aAAa,EAAE,aAAa,EAC5B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA8B/B;IAED;;OAEG;IACU,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAGjC;CACF"}
|
package/dest/pxe.js
CHANGED
|
@@ -20,6 +20,7 @@ import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
|
20
20
|
import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
|
|
21
21
|
import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
|
|
22
22
|
import { JobCoordinator } from './job_coordinator/job_coordinator.js';
|
|
23
|
+
import { MessageContextService } from './messages/message_context_service.js';
|
|
23
24
|
import { PrivateKernelExecutionProver } from './private_kernel/private_kernel_execution_prover.js';
|
|
24
25
|
import { PrivateKernelOracle } from './private_kernel/private_kernel_oracle.js';
|
|
25
26
|
import { AddressStore } from './storage/address_store/address_store.js';
|
|
@@ -36,7 +37,6 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
36
37
|
* manage private state of users.
|
|
37
38
|
*/ export class PXE {
|
|
38
39
|
node;
|
|
39
|
-
db;
|
|
40
40
|
blockStateSynchronizer;
|
|
41
41
|
keyStore;
|
|
42
42
|
contractStore;
|
|
@@ -49,6 +49,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
49
49
|
addressStore;
|
|
50
50
|
privateEventStore;
|
|
51
51
|
contractSyncService;
|
|
52
|
+
messageContextService;
|
|
53
|
+
l2TipsStore;
|
|
52
54
|
simulator;
|
|
53
55
|
proverEnabled;
|
|
54
56
|
proofCreator;
|
|
@@ -57,9 +59,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
57
59
|
jobQueue;
|
|
58
60
|
jobCoordinator;
|
|
59
61
|
debug;
|
|
60
|
-
constructor(node,
|
|
62
|
+
constructor(node, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, l2TipsStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
|
|
61
63
|
this.node = node;
|
|
62
|
-
this.db = db;
|
|
63
64
|
this.blockStateSynchronizer = blockStateSynchronizer;
|
|
64
65
|
this.keyStore = keyStore;
|
|
65
66
|
this.contractStore = contractStore;
|
|
@@ -72,6 +73,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
72
73
|
this.addressStore = addressStore;
|
|
73
74
|
this.privateEventStore = privateEventStore;
|
|
74
75
|
this.contractSyncService = contractSyncService;
|
|
76
|
+
this.messageContextService = messageContextService;
|
|
77
|
+
this.l2TipsStore = l2TipsStore;
|
|
75
78
|
this.simulator = simulator;
|
|
76
79
|
this.proverEnabled = proverEnabled;
|
|
77
80
|
this.proofCreator = proofCreator;
|
|
@@ -105,6 +108,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
105
108
|
const keyStore = new KeyStore(store);
|
|
106
109
|
const tipsStore = new L2TipsKVStore(store, 'pxe');
|
|
107
110
|
const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
|
|
111
|
+
const messageContextService = new MessageContextService(node);
|
|
108
112
|
const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, contractSyncService, config, bindings);
|
|
109
113
|
const jobCoordinator = new JobCoordinator(store, bindings);
|
|
110
114
|
jobCoordinator.registerStores([
|
|
@@ -117,7 +121,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
117
121
|
]);
|
|
118
122
|
const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
|
|
119
123
|
const jobQueue = new SerialQueue();
|
|
120
|
-
const pxe = new PXE(node,
|
|
124
|
+
const pxe = new PXE(node, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, tipsStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
|
|
121
125
|
debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#executeUtility.bind(pxe));
|
|
122
126
|
pxe.jobQueue.start();
|
|
123
127
|
await pxe.#registerProtocolContracts();
|
|
@@ -133,13 +137,15 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
133
137
|
keyStore: this.keyStore,
|
|
134
138
|
addressStore: this.addressStore,
|
|
135
139
|
aztecNode: BenchmarkedNodeFactory.create(this.node),
|
|
140
|
+
l2TipsStore: this.l2TipsStore,
|
|
136
141
|
senderTaggingStore: this.senderTaggingStore,
|
|
137
142
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
138
143
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
139
144
|
capsuleStore: this.capsuleStore,
|
|
140
145
|
privateEventStore: this.privateEventStore,
|
|
141
146
|
simulator: this.simulator,
|
|
142
|
-
contractSyncService: this.contractSyncService
|
|
147
|
+
contractSyncService: this.contractSyncService,
|
|
148
|
+
messageContextService: this.messageContextService
|
|
143
149
|
});
|
|
144
150
|
}
|
|
145
151
|
#contextualizeError(err, ...context) {
|
|
@@ -225,7 +231,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
225
231
|
*/ async #executeUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
|
|
226
232
|
try {
|
|
227
233
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
228
|
-
|
|
234
|
+
const { result, offchainEffects } = await contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
|
|
235
|
+
return {
|
|
236
|
+
result,
|
|
237
|
+
offchainEffects
|
|
238
|
+
};
|
|
229
239
|
} catch (err) {
|
|
230
240
|
if (err instanceof SimulationError) {
|
|
231
241
|
await enrichSimulationError(err, this.contractStore, this.log);
|
|
@@ -270,8 +280,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
270
280
|
* @returns An object that contains the output of the kernel execution, including the ChonkProof if proving is enabled.
|
|
271
281
|
*/ async #prove(txExecutionRequest, proofCreator, privateExecutionResult, config) {
|
|
272
282
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
273
|
-
const
|
|
274
|
-
const kernelOracle = new PrivateKernelOracle(this.contractStore, this.keyStore, this.node, anchorBlockHash);
|
|
283
|
+
const kernelOracle = new PrivateKernelOracle(this.contractStore, this.keyStore, this.node, anchorBlockHeader);
|
|
275
284
|
const kernelTraceProver = new PrivateKernelExecutionProver(kernelOracle, proofCreator, !this.proverEnabled, this.log.getBindings());
|
|
276
285
|
this.log.debug(`Executing kernel trace prover (${JSON.stringify(config)})...`);
|
|
277
286
|
return await kernelTraceProver.proveWithKernels(txExecutionRequest.toTxRequest(), privateExecutionResult, config);
|
|
@@ -281,7 +290,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
281
290
|
* Returns the block header up to which the PXE has synced.
|
|
282
291
|
* @returns The synced block header
|
|
283
292
|
*/ getSyncedBlockHeader() {
|
|
284
|
-
return this
|
|
293
|
+
return this.#putInJobQueue(()=>{
|
|
294
|
+
return this.anchorBlockStore.getBlockHeader();
|
|
295
|
+
});
|
|
285
296
|
}
|
|
286
297
|
/**
|
|
287
298
|
* Returns the contract instance for a given address, if it's registered in the PXE.
|
|
@@ -329,6 +340,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
329
340
|
* @returns The address of the sender.
|
|
330
341
|
* TODO: It's strange that we return the address here and I (benesjan) think we should drop the return value.
|
|
331
342
|
*/ async registerSender(sender) {
|
|
343
|
+
if (!await sender.isValid()) {
|
|
344
|
+
throw new Error(`Address ${sender} is not valid: it does not correspond to a point on the Grumpkin curve. Cannot register it as a sender.`);
|
|
345
|
+
}
|
|
332
346
|
const accounts = await this.keyStore.getAccounts();
|
|
333
347
|
if (accounts.includes(sender)) {
|
|
334
348
|
this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
|
|
@@ -337,6 +351,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
337
351
|
const wasAdded = await this.senderAddressBookStore.addSender(sender);
|
|
338
352
|
if (wasAdded) {
|
|
339
353
|
this.log.info(`Added sender:\n ${sender.toString()}`);
|
|
354
|
+
// Wipe the entire sync cache: the new sender's tagged logs could contain notes/events for any contract, so
|
|
355
|
+
// all contracts must re-sync to discover them. Queued to avoid wiping while a job is in flight.
|
|
356
|
+
await this.#putInJobQueue(()=>Promise.resolve(this.contractSyncService.wipe()));
|
|
340
357
|
} else {
|
|
341
358
|
this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
|
|
342
359
|
}
|
|
@@ -500,16 +517,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
500
517
|
// transaction before this one is included in a block from this PXE, and that transaction contains a log with
|
|
501
518
|
// a tag derived from the same secret, we would reuse the tag and the transactions would be linked. Hence
|
|
502
519
|
// storing the tags here prevents linkage of txs sent from the same PXE.
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
520
|
+
const taggingIndexRangesUsedInTheTx = privateExecutionResult.entrypoint.taggingIndexRanges;
|
|
521
|
+
if (taggingIndexRangesUsedInTheTx.length > 0) {
|
|
505
522
|
// TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
|
|
506
523
|
const txHash = (await txProvingResult.toTx()).txHash;
|
|
507
|
-
await this.senderTaggingStore.storePendingIndexes(
|
|
508
|
-
this.log.debug(`Stored used
|
|
509
|
-
|
|
524
|
+
await this.senderTaggingStore.storePendingIndexes(taggingIndexRangesUsedInTheTx, txHash, jobId);
|
|
525
|
+
this.log.debug(`Stored used tagging index ranges as sender for the tx`, {
|
|
526
|
+
taggingIndexRangesUsedInTheTx
|
|
510
527
|
});
|
|
511
528
|
} else {
|
|
512
|
-
this.log.debug(`No
|
|
529
|
+
this.log.debug(`No tagging index ranges used in the tx`);
|
|
513
530
|
}
|
|
514
531
|
return txProvingResult;
|
|
515
532
|
} catch (err) {
|
|
@@ -591,7 +608,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
591
608
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
592
609
|
*
|
|
593
610
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
594
|
-
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes }) {
|
|
611
|
+
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, skipKernels = true, overrides, scopes }) {
|
|
595
612
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
596
613
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
597
614
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
@@ -610,16 +627,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
610
627
|
const syncTimer = new Timer();
|
|
611
628
|
await this.blockStateSynchronizer.sync();
|
|
612
629
|
const syncTime = syncTimer.ms();
|
|
613
|
-
const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
|
|
614
|
-
// Temporary: in case there are overrides, we have to skip the kernels or validations
|
|
615
|
-
// will fail. Consider handing control to the user/wallet on whether they want to run them
|
|
616
|
-
// or not.
|
|
617
630
|
const overriddenContracts = overrides?.contracts ? new Set(Object.keys(overrides.contracts)) : undefined;
|
|
618
631
|
const hasOverriddenContracts = overriddenContracts !== undefined && overriddenContracts.size > 0;
|
|
619
|
-
|
|
620
|
-
|
|
632
|
+
if (hasOverriddenContracts && !skipKernels) {
|
|
633
|
+
throw new Error('Simulating with overridden contracts is not compatible with kernel execution. Please set skipKernels to true when simulating with overridden contracts.');
|
|
634
|
+
}
|
|
635
|
+
const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
|
|
621
636
|
if (hasOverriddenContracts) {
|
|
622
|
-
|
|
637
|
+
// Overridden contracts don't have a sync function, so calling sync on them would fail.
|
|
638
|
+
// We exclude them so the sync service skips them entirely.
|
|
639
|
+
this.contractSyncService.setExcludedFromSync(jobId, overriddenContracts);
|
|
623
640
|
}
|
|
624
641
|
// Execution of private functions only; no proving, and no kernel logic.
|
|
625
642
|
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
@@ -690,7 +707,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
690
707
|
nodeRPCCalls: simulatorStats.nodeRPCCalls
|
|
691
708
|
});
|
|
692
709
|
} catch (err) {
|
|
693
|
-
throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes
|
|
710
|
+
throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
|
|
694
711
|
}
|
|
695
712
|
});
|
|
696
713
|
}
|
|
@@ -698,7 +715,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
698
715
|
* Executes a contract utility function.
|
|
699
716
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
700
717
|
*/ executeUtility(call, { authwits, scopes } = {
|
|
701
|
-
scopes:
|
|
718
|
+
scopes: []
|
|
702
719
|
}) {
|
|
703
720
|
// We disable concurrent executions since those might execute oracles which read and write to the PXE stores (e.g.
|
|
704
721
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
@@ -713,7 +730,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
713
730
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
714
731
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
715
732
|
await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
|
|
716
|
-
const executionResult = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
|
|
733
|
+
const { result: executionResult, offchainEffects } = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
|
|
717
734
|
const functionTime = functionTimer.ms();
|
|
718
735
|
const totalTime = totalTimer.ms();
|
|
719
736
|
const perFunction = [
|
|
@@ -731,6 +748,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
731
748
|
const simulationStats = contractFunctionSimulator.getStats();
|
|
732
749
|
return {
|
|
733
750
|
result: executionResult,
|
|
751
|
+
offchainEffects,
|
|
752
|
+
anchorBlockTimestamp: anchorBlockHeader.globalVariables.timestamp,
|
|
734
753
|
stats: {
|
|
735
754
|
timings,
|
|
736
755
|
nodeRPCCalls: simulationStats.nodeRPCCalls
|
|
@@ -739,7 +758,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
739
758
|
} catch (err) {
|
|
740
759
|
const { to, name, args } = call;
|
|
741
760
|
const stringifiedArgs = args.map((arg)=>arg.toString()).join(', ');
|
|
742
|
-
throw this.#contextualizeError(err, `executeUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes
|
|
761
|
+
throw this.#contextualizeError(err, `executeUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
|
|
743
762
|
}
|
|
744
763
|
});
|
|
745
764
|
}
|
|
@@ -770,9 +789,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
770
789
|
return this.privateEventStore.getPrivateEvents(eventSelector, sanitizedFilter);
|
|
771
790
|
}
|
|
772
791
|
/**
|
|
773
|
-
* Stops the PXE's job queue
|
|
792
|
+
* Stops the PXE's job queue.
|
|
774
793
|
*/ async stop() {
|
|
775
794
|
await this.jobQueue.end();
|
|
776
|
-
await this.
|
|
795
|
+
await this.blockStateSynchronizer.stop();
|
|
777
796
|
}
|
|
778
797
|
}
|