@aztec/pxe 0.0.1-commit.b1c78909e → 0.0.1-commit.b2a5d0dd1
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 +6 -2
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +19 -1
- package/dest/config/index.d.ts +1 -1
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +7 -14
- 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 +35 -10
- 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 +3 -4
- 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 +3 -6
- 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 +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +3 -4
- 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 +3 -6
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +32 -19
- 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 +50 -18
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +186 -39
- package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +12 -23
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +30 -28
- 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 +26 -5
- 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 +10 -7
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +58 -35
- 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/private_event_store/stored_private_event.js +1 -1
- 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 +22 -2
- package/src/config/index.ts +2 -8
- package/src/contract_function_simulator/contract_function_simulator.ts +49 -14
- 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 +1 -4
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +1 -1
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +1 -4
- package/src/contract_function_simulator/oracle/interfaces.ts +51 -17
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +104 -0
- package/src/contract_function_simulator/oracle/oracle.ts +258 -34
- package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +40 -34
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +423 -114
- 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 +30 -5
- 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 +113 -42
- 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/private_event_store/stored_private_event.ts +1 -1
- 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/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
|
}
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfZXhlY3V0aW9uX3Byb3Zlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3ByaXZhdGVfa2VybmVsL3ByaXZhdGVfa2VybmVsX2V4ZWN1dGlvbl9wcm92ZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFlLEtBQUssY0FBYyxFQUFnQixNQUFNLHVCQUF1QixDQUFDO0FBTXZGLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDM0UsT0FBTyxFQVFMLEtBQUssaUNBQWlDLEVBS3RDLEtBQUssb0NBQW9DLEVBRTFDLE1BQU0sc0JBQXNCLENBQUM7QUFFOUIsT0FBTyxFQUVMLEtBQUssc0JBQXNCLEVBQzNCLFNBQVMsRUFHVixNQUFNLGtCQUFrQixDQUFDO0FBSzFCLE9BQU8sS0FBSyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFTdEUsTUFBTSxXQUFXLGtDQUFrQztJQUNqRCxRQUFRLEVBQUUsT0FBTy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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
|
}
|
|
63
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
63
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfb3JhY2xlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJpdmF0ZV9rZXJuZWwvcHJpdmF0ZV9rZXJuZWxfb3JhY2xlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxxQkFBcUIsRUFBMkIsY0FBYyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDeEgsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLE1BQU0sZ0NBQWdDLENBQUM7QUFDekQsT0FBTyxLQUFLLEVBQUUsY0FBYyxFQUFFLEtBQUssRUFBRSxNQUFNLG1DQUFtQyxDQUFDO0FBQy9FLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBQzVELE9BQU8sS0FBSyxFQUFFLFFBQVEsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBR2pELE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDMUQsT0FBTyxLQUFLLEVBQUUsWU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Ac,CAAC,CAEzE;IAED,2EAA2E;IACpE,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAElH;IAED;;;OAGG;IACU,sBAAsB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAgC/F;CACF"}
|
|
@@ -12,12 +12,12 @@ import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
|
12
12
|
contractStore;
|
|
13
13
|
keyStore;
|
|
14
14
|
node;
|
|
15
|
-
|
|
16
|
-
constructor(contractStore, 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 = {
|
|
@@ -83,6 +84,8 @@ export declare class PXE {
|
|
|
83
84
|
private addressStore;
|
|
84
85
|
private privateEventStore;
|
|
85
86
|
private contractSyncService;
|
|
87
|
+
private messageContextService;
|
|
88
|
+
private l2TipsStore;
|
|
86
89
|
private simulator;
|
|
87
90
|
private proverEnabled;
|
|
88
91
|
private proofCreator;
|
|
@@ -223,7 +226,7 @@ export declare class PXE {
|
|
|
223
226
|
*
|
|
224
227
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
225
228
|
*/
|
|
226
|
-
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
229
|
+
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, skipKernels, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
227
230
|
/**
|
|
228
231
|
* Executes a contract utility function.
|
|
229
232
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
@@ -248,4 +251,4 @@ export declare class PXE {
|
|
|
248
251
|
*/
|
|
249
252
|
stop(): Promise<void>;
|
|
250
253
|
}
|
|
251
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
254
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlLmQudHMiLCJ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BAAkB,CAAC,CAoJ7B;IAED;;;OAGG;IACI,cAAc,CACnB,IAAI,EAAE,YAAY,EAClB,EAAE,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,CAIjC;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';
|
|
@@ -49,6 +50,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
49
50
|
addressStore;
|
|
50
51
|
privateEventStore;
|
|
51
52
|
contractSyncService;
|
|
53
|
+
messageContextService;
|
|
54
|
+
l2TipsStore;
|
|
52
55
|
simulator;
|
|
53
56
|
proverEnabled;
|
|
54
57
|
proofCreator;
|
|
@@ -57,7 +60,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
57
60
|
jobQueue;
|
|
58
61
|
jobCoordinator;
|
|
59
62
|
debug;
|
|
60
|
-
constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
|
|
63
|
+
constructor(node, db, blockStateSynchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, l2TipsStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debug){
|
|
61
64
|
this.node = node;
|
|
62
65
|
this.db = db;
|
|
63
66
|
this.blockStateSynchronizer = blockStateSynchronizer;
|
|
@@ -72,6 +75,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
72
75
|
this.addressStore = addressStore;
|
|
73
76
|
this.privateEventStore = privateEventStore;
|
|
74
77
|
this.contractSyncService = contractSyncService;
|
|
78
|
+
this.messageContextService = messageContextService;
|
|
79
|
+
this.l2TipsStore = l2TipsStore;
|
|
75
80
|
this.simulator = simulator;
|
|
76
81
|
this.proverEnabled = proverEnabled;
|
|
77
82
|
this.proofCreator = proofCreator;
|
|
@@ -105,6 +110,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
105
110
|
const keyStore = new KeyStore(store);
|
|
106
111
|
const tipsStore = new L2TipsKVStore(store, 'pxe');
|
|
107
112
|
const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
|
|
113
|
+
const messageContextService = new MessageContextService(node);
|
|
108
114
|
const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, contractSyncService, config, bindings);
|
|
109
115
|
const jobCoordinator = new JobCoordinator(store, bindings);
|
|
110
116
|
jobCoordinator.registerStores([
|
|
@@ -117,7 +123,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
117
123
|
]);
|
|
118
124
|
const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
|
|
119
125
|
const jobQueue = new SerialQueue();
|
|
120
|
-
const pxe = new PXE(node, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
|
|
126
|
+
const pxe = new PXE(node, store, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, messageContextService, tipsStore, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
|
|
121
127
|
debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#executeUtility.bind(pxe));
|
|
122
128
|
pxe.jobQueue.start();
|
|
123
129
|
await pxe.#registerProtocolContracts();
|
|
@@ -133,13 +139,15 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
133
139
|
keyStore: this.keyStore,
|
|
134
140
|
addressStore: this.addressStore,
|
|
135
141
|
aztecNode: BenchmarkedNodeFactory.create(this.node),
|
|
142
|
+
l2TipsStore: this.l2TipsStore,
|
|
136
143
|
senderTaggingStore: this.senderTaggingStore,
|
|
137
144
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
138
145
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
139
146
|
capsuleStore: this.capsuleStore,
|
|
140
147
|
privateEventStore: this.privateEventStore,
|
|
141
148
|
simulator: this.simulator,
|
|
142
|
-
contractSyncService: this.contractSyncService
|
|
149
|
+
contractSyncService: this.contractSyncService,
|
|
150
|
+
messageContextService: this.messageContextService
|
|
143
151
|
});
|
|
144
152
|
}
|
|
145
153
|
#contextualizeError(err, ...context) {
|
|
@@ -192,10 +200,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
192
200
|
}
|
|
193
201
|
// Executes the entrypoint private function, as well as all nested private
|
|
194
202
|
// functions that might arise.
|
|
195
|
-
async #executePrivate(contractFunctionSimulator, txRequest, scopes, jobId) {
|
|
203
|
+
async #executePrivate(contractFunctionSimulator, txRequest, anchorBlockHeader, scopes, jobId) {
|
|
196
204
|
const { origin: contractAddress, functionSelector } = txRequest;
|
|
197
205
|
try {
|
|
198
|
-
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
199
206
|
await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
|
|
200
207
|
const result = await contractFunctionSimulator.run(txRequest, {
|
|
201
208
|
contractAddress,
|
|
@@ -225,7 +232,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
225
232
|
*/ async #executeUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
|
|
226
233
|
try {
|
|
227
234
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
228
|
-
|
|
235
|
+
const { result, offchainEffects } = await contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
|
|
236
|
+
return {
|
|
237
|
+
result,
|
|
238
|
+
offchainEffects
|
|
239
|
+
};
|
|
229
240
|
} catch (err) {
|
|
230
241
|
if (err instanceof SimulationError) {
|
|
231
242
|
await enrichSimulationError(err, this.contractStore, this.log);
|
|
@@ -268,10 +279,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
268
279
|
* @param privateExecutionResult - The result of the private execution
|
|
269
280
|
* @param config - The configuration for the kernel execution prover.
|
|
270
281
|
* @returns An object that contains the output of the kernel execution, including the ChonkProof if proving is enabled.
|
|
271
|
-
*/ async #prove(txExecutionRequest, proofCreator, privateExecutionResult, config) {
|
|
272
|
-
const
|
|
273
|
-
const anchorBlockHash = await anchorBlockHeader.hash();
|
|
274
|
-
const kernelOracle = new PrivateKernelOracle(this.contractStore, this.keyStore, this.node, anchorBlockHash);
|
|
282
|
+
*/ async #prove(txExecutionRequest, proofCreator, privateExecutionResult, anchorBlockHeader, config) {
|
|
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
|
}
|
|
@@ -467,10 +484,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
467
484
|
try {
|
|
468
485
|
const syncTimer = new Timer();
|
|
469
486
|
await this.blockStateSynchronizer.sync();
|
|
487
|
+
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
470
488
|
const syncTime = syncTimer.ms();
|
|
471
489
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
472
|
-
privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
473
|
-
const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
490
|
+
privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, anchorBlockHeader, scopes, jobId);
|
|
491
|
+
const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, anchorBlockHeader, {
|
|
474
492
|
simulate: false,
|
|
475
493
|
skipFeeEnforcement: false,
|
|
476
494
|
profileMode: 'none'
|
|
@@ -500,16 +518,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
500
518
|
// transaction before this one is included in a block from this PXE, and that transaction contains a log with
|
|
501
519
|
// a tag derived from the same secret, we would reuse the tag and the transactions would be linked. Hence
|
|
502
520
|
// storing the tags here prevents linkage of txs sent from the same PXE.
|
|
503
|
-
const
|
|
504
|
-
if (
|
|
521
|
+
const taggingIndexRangesUsedInTheTx = privateExecutionResult.entrypoint.taggingIndexRanges;
|
|
522
|
+
if (taggingIndexRangesUsedInTheTx.length > 0) {
|
|
505
523
|
// TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
|
|
506
524
|
const txHash = (await txProvingResult.toTx()).txHash;
|
|
507
|
-
await this.senderTaggingStore.storePendingIndexes(
|
|
508
|
-
this.log.debug(`Stored used
|
|
509
|
-
|
|
525
|
+
await this.senderTaggingStore.storePendingIndexes(taggingIndexRangesUsedInTheTx, txHash, jobId);
|
|
526
|
+
this.log.debug(`Stored used tagging index ranges as sender for the tx`, {
|
|
527
|
+
taggingIndexRangesUsedInTheTx
|
|
510
528
|
});
|
|
511
529
|
} else {
|
|
512
|
-
this.log.debug(`No
|
|
530
|
+
this.log.debug(`No tagging index ranges used in the tx`);
|
|
513
531
|
}
|
|
514
532
|
return txProvingResult;
|
|
515
533
|
} catch (err) {
|
|
@@ -538,10 +556,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
538
556
|
this.log.info(`Profiling transaction execution request to ${txRequest.functionSelector} at ${txRequest.origin}`, txInfo);
|
|
539
557
|
const syncTimer = new Timer();
|
|
540
558
|
await this.blockStateSynchronizer.sync();
|
|
559
|
+
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
541
560
|
const syncTime = syncTimer.ms();
|
|
542
561
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
543
|
-
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
544
|
-
const { executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
562
|
+
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, anchorBlockHeader, scopes, jobId);
|
|
563
|
+
const { executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, anchorBlockHeader, {
|
|
545
564
|
simulate: skipProofGeneration,
|
|
546
565
|
skipFeeEnforcement: false,
|
|
547
566
|
profileMode
|
|
@@ -591,7 +610,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
591
610
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
592
611
|
*
|
|
593
612
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
594
|
-
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes }) {
|
|
613
|
+
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, skipKernels = true, overrides, scopes }) {
|
|
595
614
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
596
615
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
597
616
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
@@ -609,27 +628,28 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
609
628
|
this.log.info(`Simulating transaction execution request to ${txRequest.functionSelector} at ${txRequest.origin}`, txInfo);
|
|
610
629
|
const syncTimer = new Timer();
|
|
611
630
|
await this.blockStateSynchronizer.sync();
|
|
631
|
+
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
612
632
|
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
633
|
const overriddenContracts = overrides?.contracts ? new Set(Object.keys(overrides.contracts)) : undefined;
|
|
618
634
|
const hasOverriddenContracts = overriddenContracts !== undefined && overriddenContracts.size > 0;
|
|
619
|
-
|
|
620
|
-
|
|
635
|
+
if (hasOverriddenContracts && !skipKernels) {
|
|
636
|
+
throw new Error('Simulating with overridden contracts is not compatible with kernel execution. Please set skipKernels to true when simulating with overridden contracts.');
|
|
637
|
+
}
|
|
638
|
+
const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
|
|
621
639
|
if (hasOverriddenContracts) {
|
|
622
|
-
|
|
640
|
+
// Overridden contracts don't have a sync function, so calling sync on them would fail.
|
|
641
|
+
// We exclude them so the sync service skips them entirely.
|
|
642
|
+
this.contractSyncService.setExcludedFromSync(jobId, overriddenContracts);
|
|
623
643
|
}
|
|
624
644
|
// Execution of private functions only; no proving, and no kernel logic.
|
|
625
|
-
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
645
|
+
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, anchorBlockHeader, scopes, jobId);
|
|
626
646
|
let publicInputs;
|
|
627
647
|
let executionSteps = [];
|
|
628
648
|
if (skipKernels) {
|
|
629
649
|
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel), this.node));
|
|
630
650
|
} else {
|
|
631
651
|
// Kernel logic, plus proving of all private functions and kernels.
|
|
632
|
-
({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
652
|
+
({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, anchorBlockHeader, {
|
|
633
653
|
simulate: true,
|
|
634
654
|
skipFeeEnforcement,
|
|
635
655
|
profileMode: 'none'
|
|
@@ -690,7 +710,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
690
710
|
nodeRPCCalls: simulatorStats.nodeRPCCalls
|
|
691
711
|
});
|
|
692
712
|
} catch (err) {
|
|
693
|
-
throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes
|
|
713
|
+
throw this.#contextualizeError(err, inspect(txRequest), `simulatePublic=${simulatePublic}`, `skipTxValidation=${skipTxValidation}`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
|
|
694
714
|
}
|
|
695
715
|
});
|
|
696
716
|
}
|
|
@@ -698,7 +718,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
698
718
|
* Executes a contract utility function.
|
|
699
719
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
700
720
|
*/ executeUtility(call, { authwits, scopes } = {
|
|
701
|
-
scopes:
|
|
721
|
+
scopes: []
|
|
702
722
|
}) {
|
|
703
723
|
// We disable concurrent executions since those might execute oracles which read and write to the PXE stores (e.g.
|
|
704
724
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
@@ -713,7 +733,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
713
733
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
714
734
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
715
735
|
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);
|
|
736
|
+
const { result: executionResult, offchainEffects } = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
|
|
717
737
|
const functionTime = functionTimer.ms();
|
|
718
738
|
const totalTime = totalTimer.ms();
|
|
719
739
|
const perFunction = [
|
|
@@ -731,6 +751,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
731
751
|
const simulationStats = contractFunctionSimulator.getStats();
|
|
732
752
|
return {
|
|
733
753
|
result: executionResult,
|
|
754
|
+
offchainEffects,
|
|
755
|
+
anchorBlockTimestamp: anchorBlockHeader.globalVariables.timestamp,
|
|
734
756
|
stats: {
|
|
735
757
|
timings,
|
|
736
758
|
nodeRPCCalls: simulationStats.nodeRPCCalls
|
|
@@ -739,7 +761,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
739
761
|
} catch (err) {
|
|
740
762
|
const { to, name, args } = call;
|
|
741
763
|
const stringifiedArgs = args.map((arg)=>arg.toString()).join(', ');
|
|
742
|
-
throw this.#contextualizeError(err, `executeUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes
|
|
764
|
+
throw this.#contextualizeError(err, `executeUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
|
|
743
765
|
}
|
|
744
766
|
});
|
|
745
767
|
}
|
|
@@ -773,6 +795,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
773
795
|
* Stops the PXE's job queue and closes the backing store.
|
|
774
796
|
*/ async stop() {
|
|
775
797
|
await this.jobQueue.end();
|
|
798
|
+
await this.blockStateSynchronizer.stop();
|
|
776
799
|
await this.db.close();
|
|
777
800
|
}
|
|
778
801
|
}
|
|
@@ -17,7 +17,7 @@ export class AnchorBlockStore {
|
|
|
17
17
|
await this.#synchronizedHeader.set(header.toBuffer());
|
|
18
18
|
}
|
|
19
19
|
async getBlockHeader() {
|
|
20
|
-
const headerBuffer = await this.#synchronizedHeader.getAsync();
|
|
20
|
+
const headerBuffer = await this.#store.transactionAsync(()=>this.#synchronizedHeader.getAsync());
|
|
21
21
|
if (!headerBuffer) {
|
|
22
22
|
throw new Error(`Trying to get block header with a not-yet-synchronized PXE - this should never happen`);
|
|
23
23
|
}
|