@aztec/pxe 0.0.1-commit.64b6bbb → 0.0.1-commit.69c59a8b3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/bin/check_oracle_version.js +4 -4
- package/dest/block_synchronizer/block_synchronizer.d.ts +1 -1
- package/dest/block_synchronizer/block_synchronizer.d.ts.map +1 -1
- package/dest/block_synchronizer/block_synchronizer.js +6 -0
- package/dest/config/index.d.ts +2 -2
- package/dest/config/index.d.ts.map +1 -1
- package/dest/config/index.js +8 -15
- package/dest/config/package_info.js +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.d.ts +17 -7
- package/dest/contract_function_simulator/contract_function_simulator.d.ts.map +1 -1
- package/dest/contract_function_simulator/contract_function_simulator.js +145 -48
- 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 +7 -7
- package/dest/contract_function_simulator/execution_tagging_index_cache.d.ts.map +1 -1
- package/dest/contract_function_simulator/execution_tagging_index_cache.js +19 -11
- package/dest/contract_function_simulator/index.d.ts +2 -1
- package/dest/contract_function_simulator/index.d.ts.map +1 -1
- package/dest/contract_function_simulator/index.js +1 -0
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts +4 -6
- package/dest/contract_function_simulator/noir-structs/event_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/event_validation_request.js +8 -10
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.d.ts +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_request.js +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts +2 -2
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/log_retrieval_response.js +2 -4
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts +4 -7
- package/dest/contract_function_simulator/noir-structs/note_validation_request.d.ts.map +1 -1
- package/dest/contract_function_simulator/noir-structs/note_validation_request.js +6 -11
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +61 -45
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts +9 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.d.ts.map +1 -0
- package/dest/contract_function_simulator/oracle/legacy_oracle_mappings.js +47 -0
- package/dest/contract_function_simulator/oracle/oracle.d.ts +75 -44
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +281 -96
- package/dest/contract_function_simulator/oracle/private_execution.js +5 -3
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts +23 -48
- package/dest/contract_function_simulator/oracle/private_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/private_execution_oracle.js +51 -73
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +92 -56
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.js +275 -106
- 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 +14 -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 +27 -0
- package/dest/contract_logging.d.ts.map +1 -0
- package/dest/contract_logging.js +38 -0
- package/dest/contract_sync/contract_sync_service.d.ts +7 -4
- package/dest/contract_sync/contract_sync_service.d.ts.map +1 -1
- package/dest/contract_sync/contract_sync_service.js +69 -35
- package/dest/contract_sync/helpers.d.ts +2 -2
- package/dest/contract_sync/helpers.d.ts.map +1 -1
- package/dest/contract_sync/helpers.js +9 -4
- package/dest/debug/pxe_debug_utils.d.ts +4 -3
- package/dest/debug/pxe_debug_utils.d.ts.map +1 -1
- package/dest/debug/pxe_debug_utils.js +4 -4
- package/dest/entrypoints/client/bundle/index.d.ts +3 -1
- package/dest/entrypoints/client/bundle/index.d.ts.map +1 -1
- package/dest/entrypoints/client/bundle/index.js +2 -0
- 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 +3 -1
- package/dest/entrypoints/client/lazy/index.d.ts.map +1 -1
- package/dest/entrypoints/client/lazy/index.js +2 -0
- 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 +3 -2
- package/dest/entrypoints/server/index.d.ts.map +1 -1
- package/dest/entrypoints/server/index.js +2 -1
- 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 -7
- package/dest/logs/log_service.d.ts.map +1 -1
- package/dest/logs/log_service.js +33 -48
- 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 -4
- package/dest/notes/note_service.d.ts.map +1 -1
- package/dest/notes/note_service.js +17 -7
- package/dest/notes_filter.d.ts +24 -0
- package/dest/notes_filter.d.ts.map +1 -0
- package/dest/notes_filter.js +4 -0
- 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/hints/compute_tx_expiration_timestamp.d.ts +4 -0
- package/dest/private_kernel/hints/compute_tx_expiration_timestamp.d.ts.map +1 -0
- package/dest/private_kernel/hints/{compute_tx_include_by_timestamp.js → compute_tx_expiration_timestamp.js} +12 -12
- package/dest/private_kernel/hints/index.d.ts +1 -1
- package/dest/private_kernel/hints/index.js +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts +4 -3
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.d.ts.map +1 -1
- package/dest/private_kernel/hints/private_kernel_reset_private_inputs_builder.js +129 -68
- package/dest/private_kernel/hints/test_utils.d.ts +122 -0
- package/dest/private_kernel/hints/test_utils.d.ts.map +1 -0
- package/dest/private_kernel/hints/test_utils.js +203 -0
- 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 +18 -13
- package/dest/private_kernel/private_kernel_oracle.d.ts +6 -2
- package/dest/private_kernel/private_kernel_oracle.d.ts.map +1 -1
- package/dest/private_kernel/private_kernel_oracle.js +7 -3
- package/dest/pxe.d.ts +23 -15
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +87 -54
- 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 +42 -15
- package/dest/storage/contract_store/contract_store.d.ts.map +1 -1
- package/dest/storage/contract_store/contract_store.js +143 -65
- package/dest/storage/metadata.d.ts +1 -1
- package/dest/storage/metadata.js +1 -1
- package/dest/storage/note_store/note_store.d.ts +3 -3
- package/dest/storage/note_store/note_store.d.ts.map +1 -1
- package/dest/storage/note_store/note_store.js +3 -4
- package/dest/storage/private_event_store/stored_private_event.js +1 -1
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts +6 -6
- package/dest/storage/tagging_store/recipient_tagging_store.d.ts.map +1 -1
- package/dest/storage/tagging_store/sender_tagging_store.d.ts +29 -28
- 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/get_all_logs_by_tags.d.ts +1 -1
- package/dest/tagging/get_all_logs_by_tags.d.ts.map +1 -1
- package/dest/tagging/get_all_logs_by_tags.js +17 -3
- package/dest/tagging/index.d.ts +3 -3
- package/dest/tagging/index.d.ts.map +1 -1
- package/dest/tagging/index.js +1 -1
- package/dest/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.d.ts +4 -5
- 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 +7 -21
- package/dest/tagging/recipient_sync/utils/find_highest_indexes.js +2 -2
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts +6 -7
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.d.ts.map +1 -1
- package/dest/tagging/recipient_sync/utils/load_logs_for_range.js +12 -11
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts +4 -8
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.d.ts.map +1 -1
- package/dest/tagging/sender_sync/sync_sender_tagging_indexes.js +13 -7
- 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 +5 -7
- 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 +36 -24
- package/package.json +16 -16
- package/src/bin/check_oracle_version.ts +4 -4
- package/src/block_synchronizer/block_synchronizer.ts +6 -0
- package/src/config/index.ts +3 -9
- package/src/config/package_info.ts +1 -1
- package/src/contract_function_simulator/contract_function_simulator.ts +261 -67
- package/src/contract_function_simulator/ephemeral_array_service.ts +110 -0
- package/src/contract_function_simulator/execution_tagging_index_cache.ts +19 -14
- package/src/contract_function_simulator/index.ts +1 -0
- package/src/contract_function_simulator/noir-structs/event_validation_request.ts +9 -9
- package/src/contract_function_simulator/noir-structs/log_retrieval_request.ts +1 -1
- package/src/contract_function_simulator/noir-structs/log_retrieval_response.ts +2 -5
- package/src/contract_function_simulator/noir-structs/note_validation_request.ts +4 -10
- package/src/contract_function_simulator/oracle/interfaces.ts +82 -54
- package/src/contract_function_simulator/oracle/legacy_oracle_mappings.ts +104 -0
- package/src/contract_function_simulator/oracle/oracle.ts +363 -139
- package/src/contract_function_simulator/oracle/private_execution.ts +4 -4
- package/src/contract_function_simulator/oracle/private_execution_oracle.ts +58 -91
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +455 -143
- package/src/contract_function_simulator/pick_notes.ts +14 -3
- package/src/contract_function_simulator/proxied_contract_data_source.ts +8 -1
- package/src/contract_logging.ts +52 -0
- package/src/contract_sync/contract_sync_service.ts +102 -55
- package/src/contract_sync/helpers.ts +8 -3
- package/src/debug/pxe_debug_utils.ts +10 -8
- package/src/entrypoints/client/bundle/index.ts +2 -0
- package/src/entrypoints/client/bundle/utils.ts +2 -3
- package/src/entrypoints/client/lazy/index.ts +2 -0
- package/src/entrypoints/client/lazy/utils.ts +2 -3
- package/src/entrypoints/pxe_creation_options.ts +7 -0
- package/src/entrypoints/server/index.ts +2 -1
- 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 +63 -91
- package/src/messages/message_context_service.ts +44 -0
- package/src/notes/note_service.ts +19 -8
- package/src/notes_filter.ts +24 -0
- package/src/oracle_version.ts +20 -10
- package/src/private_kernel/hints/{compute_tx_include_by_timestamp.ts → compute_tx_expiration_timestamp.ts} +13 -13
- package/src/private_kernel/hints/index.ts +1 -1
- package/src/private_kernel/hints/private_kernel_reset_private_inputs_builder.ts +164 -117
- package/src/private_kernel/hints/test_utils.ts +325 -0
- package/src/private_kernel/private_kernel_execution_prover.ts +18 -16
- package/src/private_kernel/private_kernel_oracle.ts +7 -7
- package/src/pxe.ts +129 -72
- 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 +177 -76
- package/src/storage/metadata.ts +1 -1
- package/src/storage/note_store/note_store.ts +5 -5
- package/src/storage/private_event_store/stored_private_event.ts +1 -1
- package/src/storage/tagging_store/recipient_tagging_store.ts +9 -5
- package/src/storage/tagging_store/sender_tagging_store.ts +185 -138
- package/src/tagging/get_all_logs_by_tags.ts +28 -4
- package/src/tagging/index.ts +2 -2
- package/src/tagging/recipient_sync/load_private_logs_for_sender_recipient_pair.ts +9 -24
- package/src/tagging/recipient_sync/utils/find_highest_indexes.ts +2 -2
- package/src/tagging/recipient_sync/utils/load_logs_for_range.ts +10 -15
- package/src/tagging/sender_sync/sync_sender_tagging_indexes.ts +23 -10
- 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 +27 -26
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts +0 -4
- package/dest/private_kernel/hints/compute_tx_include_by_timestamp.d.ts.map +0 -1
package/dest/pxe.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
|
9
9
|
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
|
-
import { BlockHeader, type InTx, SimulationOverrides, TxExecutionRequest, TxProfileResult, TxProvingResult, TxSimulationResult,
|
|
12
|
+
import { BlockHeader, type InTx, SimulationOverrides, TxExecutionRequest, TxProfileResult, TxProvingResult, TxSimulationResult, UtilityExecutionResult } from '@aztec/stdlib/tx';
|
|
13
13
|
import type { PXEConfig } from './config/index.js';
|
|
14
14
|
import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
15
15
|
export type PackedPrivateEvent = InTx & {
|
|
@@ -22,6 +22,8 @@ export type ProfileTxOpts = {
|
|
|
22
22
|
profileMode: 'full' | 'execution-steps' | 'gates';
|
|
23
23
|
/** If true, proof generation is skipped during profiling. Defaults to true. */
|
|
24
24
|
skipProofGeneration?: boolean;
|
|
25
|
+
/** Addresses whose private state and keys are accessible during private execution. */
|
|
26
|
+
scopes: AztecAddress[];
|
|
25
27
|
};
|
|
26
28
|
/** Options for PXE.simulateTx. */
|
|
27
29
|
export type SimulateTxOpts = {
|
|
@@ -31,17 +33,19 @@ export type SimulateTxOpts = {
|
|
|
31
33
|
skipTxValidation?: boolean;
|
|
32
34
|
/** If false, fees are enforced. */
|
|
33
35
|
skipFeeEnforcement?: boolean;
|
|
34
|
-
/**
|
|
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 */
|
|
35
39
|
overrides?: SimulationOverrides;
|
|
36
|
-
/**
|
|
37
|
-
scopes
|
|
40
|
+
/** Addresses whose private state and keys are accessible during private execution */
|
|
41
|
+
scopes: AztecAddress[];
|
|
38
42
|
};
|
|
39
|
-
/** Options for PXE.
|
|
40
|
-
export type
|
|
43
|
+
/** Options for PXE.executeUtility. */
|
|
44
|
+
export type ExecuteUtilityOpts = {
|
|
41
45
|
/** The authentication witnesses required for the function call. */
|
|
42
46
|
authwits?: AuthWitness[];
|
|
43
|
-
/** The accounts whose notes we can access in this call
|
|
44
|
-
scopes
|
|
47
|
+
/** The accounts whose notes we can access in this call */
|
|
48
|
+
scopes: AztecAddress[];
|
|
45
49
|
};
|
|
46
50
|
/** Args for PXE.create. */
|
|
47
51
|
export type PXECreateArgs = {
|
|
@@ -67,6 +71,7 @@ export type PXECreateArgs = {
|
|
|
67
71
|
export declare class PXE {
|
|
68
72
|
#private;
|
|
69
73
|
private node;
|
|
74
|
+
private db;
|
|
70
75
|
private blockStateSynchronizer;
|
|
71
76
|
private keyStore;
|
|
72
77
|
private contractStore;
|
|
@@ -79,6 +84,8 @@ export declare class PXE {
|
|
|
79
84
|
private addressStore;
|
|
80
85
|
private privateEventStore;
|
|
81
86
|
private contractSyncService;
|
|
87
|
+
private messageContextService;
|
|
88
|
+
private l2TipsStore;
|
|
82
89
|
private simulator;
|
|
83
90
|
private proverEnabled;
|
|
84
91
|
private proofCreator;
|
|
@@ -188,18 +195,19 @@ export declare class PXE {
|
|
|
188
195
|
* (where validators prove the public portion).
|
|
189
196
|
*
|
|
190
197
|
* @param txRequest - An authenticated tx request ready for proving
|
|
198
|
+
* @param scopes - Addresses whose private state and keys are accessible during private execution.
|
|
191
199
|
* @returns A result containing the proof and public inputs of the tail circuit.
|
|
192
200
|
* @throws If contract code not found, or public simulation reverts.
|
|
193
201
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
194
202
|
*/
|
|
195
|
-
proveTx(txRequest: TxExecutionRequest): Promise<TxProvingResult>;
|
|
203
|
+
proveTx(txRequest: TxExecutionRequest, scopes: AztecAddress[]): Promise<TxProvingResult>;
|
|
196
204
|
/**
|
|
197
205
|
* Profiles a transaction, reporting gate counts (unless disabled) and returns an execution trace.
|
|
198
206
|
* @param txRequest - An authenticated tx request ready for simulation.
|
|
199
207
|
* @returns A trace of the program execution with gate counts.
|
|
200
208
|
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
201
209
|
*/
|
|
202
|
-
profileTx(txRequest: TxExecutionRequest, { profileMode, skipProofGeneration }: ProfileTxOpts): Promise<TxProfileResult>;
|
|
210
|
+
profileTx(txRequest: TxExecutionRequest, { profileMode, skipProofGeneration, scopes }: ProfileTxOpts): Promise<TxProfileResult>;
|
|
203
211
|
/**
|
|
204
212
|
* Simulates a transaction based on the provided preauthenticated execution request.
|
|
205
213
|
* This will run a local simulation of private execution (and optionally of public as well), run the
|
|
@@ -218,12 +226,12 @@ export declare class PXE {
|
|
|
218
226
|
*
|
|
219
227
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
220
228
|
*/
|
|
221
|
-
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
229
|
+
simulateTx(txRequest: TxExecutionRequest, { simulatePublic, skipTxValidation, skipFeeEnforcement, skipKernels, overrides, scopes }: SimulateTxOpts): Promise<TxSimulationResult>;
|
|
222
230
|
/**
|
|
223
|
-
*
|
|
231
|
+
* Executes a contract utility function.
|
|
224
232
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
225
233
|
*/
|
|
226
|
-
|
|
234
|
+
executeUtility(call: FunctionCall, { authwits, scopes }?: ExecuteUtilityOpts): Promise<UtilityExecutionResult>;
|
|
227
235
|
/**
|
|
228
236
|
* Returns the private events given search parameters.
|
|
229
237
|
* @param eventSelector - Event selector to search for.
|
|
@@ -239,8 +247,8 @@ export declare class PXE {
|
|
|
239
247
|
*/
|
|
240
248
|
getPrivateEvents(eventSelector: EventSelector, filter: PrivateEventFilter): Promise<PackedPrivateEvent[]>;
|
|
241
249
|
/**
|
|
242
|
-
* Stops the PXE's job queue.
|
|
250
|
+
* Stops the PXE's job queue and closes the backing store.
|
|
243
251
|
*/
|
|
244
252
|
stop(): Promise<void>;
|
|
245
253
|
}
|
|
246
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
254
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvcHhlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFakUsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBcUMsTUFBTSx1QkFBdUIsQ0FBQztBQUl2RixPQUFPLEtBQUssRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGlCQUFpQixDQUFDO0FBRXpELE9BQU8sRUFBRSxLQUFLLHlCQUF5QixFQUF5QixNQUFNLDJCQUEyQixDQUFDO0FBQ2xHLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDaEUsT0FBTyxFQUNMLEtBQUssZ0JBQWdCLEVBQ3JCLGFBQWEsRUFDYixZQUFZLEVBR2IsTUFBTSxtQkFBbUIsQ0FBQztBQUMzQixPQUFPLEtBQUssRUFBRSxXQ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BQyxJQUFJLENBQUMsQ0FHakM7Q0FDRiJ9
|
package/dest/pxe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../src/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAqC,MAAM,uBAAuB,CAAC;AAIvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,KAAK,yBAAyB,EAAyB,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,KAAK,gBAAgB,EACrB,aAAa,EACb,YAAY,EAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../src/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAqC,MAAM,uBAAuB,CAAC;AAIvF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,KAAK,yBAAyB,EAAyB,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,KAAK,gBAAgB,EACrB,aAAa,EACb,YAAY,EAGb,MAAM,mBAAmB,CAAC;AAC3B,OAAO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ED;;;OAGG;IACI,YAAY,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAE7C;IAED;;;;;;;;;OASG;IACI,OAAO,CAAC,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,eAAe,CAAC,CAuE9F;IAED;;;;;OAKG;IACI,SAAS,CACd,SAAS,EAAE,kBAAkB,EAC7B,EAAE,WAAW,EAAE,mBAA0B,EAAE,MAAM,EAAE,EAAE,aAAa,GACjE,OAAO,CAAC,eAAe,CAAC,CAkE1B;IAED;;;;;;;;;;;;;;;;;OAiBG;IACI,UAAU,CACf,SAAS,EAAE,kBAAkB,EAC7B,EACE,cAAc,EACd,gBAAwB,EACxB,kBAA0B,EAC1B,WAAkB,EAClB,SAAS,EACT,MAAM,EACP,EAAE,cAAc,GAChB,OAAO,CAAC,kBAAkB,CAAC,CAuI7B;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,CAGjC;CACF"}
|
package/dest/pxe.js
CHANGED
|
@@ -13,12 +13,14 @@ import { BlockSynchronizer } from './block_synchronizer/index.js';
|
|
|
13
13
|
import { BenchmarkedNodeFactory } from './contract_function_simulator/benchmarked_node.js';
|
|
14
14
|
import { ContractFunctionSimulator, generateSimulatedProvingResult } from './contract_function_simulator/contract_function_simulator.js';
|
|
15
15
|
import { ProxiedContractStoreFactory } from './contract_function_simulator/proxied_contract_data_source.js';
|
|
16
|
+
import { displayDebugLogs } from './contract_logging.js';
|
|
16
17
|
import { ContractSyncService } from './contract_sync/contract_sync_service.js';
|
|
17
18
|
import { readCurrentClassId } from './contract_sync/helpers.js';
|
|
18
19
|
import { PXEDebugUtils } from './debug/pxe_debug_utils.js';
|
|
19
20
|
import { enrichPublicSimulationError, enrichSimulationError } from './error_enriching.js';
|
|
20
21
|
import { PrivateEventFilterValidator } from './events/private_event_filter_validator.js';
|
|
21
22
|
import { JobCoordinator } from './job_coordinator/job_coordinator.js';
|
|
23
|
+
import { MessageContextService } from './messages/message_context_service.js';
|
|
22
24
|
import { PrivateKernelExecutionProver } from './private_kernel/private_kernel_execution_prover.js';
|
|
23
25
|
import { PrivateKernelOracle } from './private_kernel/private_kernel_oracle.js';
|
|
24
26
|
import { AddressStore } from './storage/address_store/address_store.js';
|
|
@@ -35,6 +37,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
35
37
|
* manage private state of users.
|
|
36
38
|
*/ export class PXE {
|
|
37
39
|
node;
|
|
40
|
+
db;
|
|
38
41
|
blockStateSynchronizer;
|
|
39
42
|
keyStore;
|
|
40
43
|
contractStore;
|
|
@@ -47,6 +50,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
47
50
|
addressStore;
|
|
48
51
|
privateEventStore;
|
|
49
52
|
contractSyncService;
|
|
53
|
+
messageContextService;
|
|
54
|
+
l2TipsStore;
|
|
50
55
|
simulator;
|
|
51
56
|
proverEnabled;
|
|
52
57
|
proofCreator;
|
|
@@ -55,8 +60,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
55
60
|
jobQueue;
|
|
56
61
|
jobCoordinator;
|
|
57
62
|
debug;
|
|
58
|
-
constructor(node, 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){
|
|
59
64
|
this.node = node;
|
|
65
|
+
this.db = db;
|
|
60
66
|
this.blockStateSynchronizer = blockStateSynchronizer;
|
|
61
67
|
this.keyStore = keyStore;
|
|
62
68
|
this.contractStore = contractStore;
|
|
@@ -69,6 +75,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
69
75
|
this.addressStore = addressStore;
|
|
70
76
|
this.privateEventStore = privateEventStore;
|
|
71
77
|
this.contractSyncService = contractSyncService;
|
|
78
|
+
this.messageContextService = messageContextService;
|
|
79
|
+
this.l2TipsStore = l2TipsStore;
|
|
72
80
|
this.simulator = simulator;
|
|
73
81
|
this.proverEnabled = proverEnabled;
|
|
74
82
|
this.proofCreator = proofCreator;
|
|
@@ -88,7 +96,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
88
96
|
// Extract bindings from the logger, or use empty bindings if a string suffix is provided.
|
|
89
97
|
const bindings = loggerOrSuffix && typeof loggerOrSuffix !== 'string' ? loggerOrSuffix.getBindings() : undefined;
|
|
90
98
|
const log = !loggerOrSuffix || typeof loggerOrSuffix === 'string' ? createLogger(loggerOrSuffix ? `pxe:service:${loggerOrSuffix}` : `pxe:service`) : loggerOrSuffix;
|
|
91
|
-
const
|
|
99
|
+
const info = await node.getNodeInfo();
|
|
100
|
+
const proverEnabled = config.proverEnabled !== undefined ? config.proverEnabled : info.realProofs;
|
|
92
101
|
const addressStore = new AddressStore(store);
|
|
93
102
|
const privateEventStore = new PrivateEventStore(store);
|
|
94
103
|
const contractStore = new ContractStore(store);
|
|
@@ -101,6 +110,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
101
110
|
const keyStore = new KeyStore(store);
|
|
102
111
|
const tipsStore = new L2TipsKVStore(store, 'pxe');
|
|
103
112
|
const contractSyncService = new ContractSyncService(node, contractStore, noteStore, createLogger('pxe:contract_sync', bindings));
|
|
113
|
+
const messageContextService = new MessageContextService(node);
|
|
104
114
|
const synchronizer = new BlockSynchronizer(node, store, anchorBlockStore, noteStore, privateEventStore, tipsStore, contractSyncService, config, bindings);
|
|
105
115
|
const jobCoordinator = new JobCoordinator(store, bindings);
|
|
106
116
|
jobCoordinator.registerStores([
|
|
@@ -113,11 +123,10 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
113
123
|
]);
|
|
114
124
|
const debugUtils = new PXEDebugUtils(contractSyncService, noteStore, synchronizer, anchorBlockStore);
|
|
115
125
|
const jobQueue = new SerialQueue();
|
|
116
|
-
const pxe = new PXE(node, synchronizer, keyStore, contractStore, noteStore, capsuleStore, anchorBlockStore, senderTaggingStore, senderAddressBookStore, recipientTaggingStore, addressStore, privateEventStore, contractSyncService, simulator, proverEnabled, proofCreator, protocolContractsProvider, log, jobQueue, jobCoordinator, debugUtils);
|
|
117
|
-
debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#
|
|
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);
|
|
127
|
+
debugUtils.setPXEHelpers(pxe.#putInJobQueue.bind(pxe), pxe.#getSimulatorForTx.bind(pxe), pxe.#executeUtility.bind(pxe));
|
|
118
128
|
pxe.jobQueue.start();
|
|
119
129
|
await pxe.#registerProtocolContracts();
|
|
120
|
-
const info = await node.getNodeInfo();
|
|
121
130
|
log.info(`Started PXE connected to chain ${info.l1ChainId} version ${info.rollupVersion}`);
|
|
122
131
|
return pxe;
|
|
123
132
|
}
|
|
@@ -130,13 +139,15 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
130
139
|
keyStore: this.keyStore,
|
|
131
140
|
addressStore: this.addressStore,
|
|
132
141
|
aztecNode: BenchmarkedNodeFactory.create(this.node),
|
|
142
|
+
l2TipsStore: this.l2TipsStore,
|
|
133
143
|
senderTaggingStore: this.senderTaggingStore,
|
|
134
144
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
135
145
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
136
146
|
capsuleStore: this.capsuleStore,
|
|
137
147
|
privateEventStore: this.privateEventStore,
|
|
138
148
|
simulator: this.simulator,
|
|
139
|
-
contractSyncService: this.contractSyncService
|
|
149
|
+
contractSyncService: this.contractSyncService,
|
|
150
|
+
messageContextService: this.messageContextService
|
|
140
151
|
});
|
|
141
152
|
}
|
|
142
153
|
#contextualizeError(err, ...context) {
|
|
@@ -180,8 +191,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
180
191
|
async #registerProtocolContracts() {
|
|
181
192
|
const registered = {};
|
|
182
193
|
for (const name of protocolContractNames){
|
|
183
|
-
const { address,
|
|
184
|
-
await this.contractStore.addContractArtifact(
|
|
194
|
+
const { address, instance, artifact } = await this.protocolContractsProvider.getProtocolContractArtifact(name);
|
|
195
|
+
await this.contractStore.addContractArtifact(artifact);
|
|
185
196
|
await this.contractStore.addContractInstance(instance);
|
|
186
197
|
registered[name] = address.toString();
|
|
187
198
|
}
|
|
@@ -193,7 +204,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
193
204
|
const { origin: contractAddress, functionSelector } = txRequest;
|
|
194
205
|
try {
|
|
195
206
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
196
|
-
await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall)=>this.#
|
|
207
|
+
await this.contractSyncService.ensureContractSynced(contractAddress, functionSelector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
|
|
197
208
|
const result = await contractFunctionSimulator.run(txRequest, {
|
|
198
209
|
contractAddress,
|
|
199
210
|
selector: functionSelector,
|
|
@@ -211,18 +222,22 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
211
222
|
}
|
|
212
223
|
}
|
|
213
224
|
/**
|
|
214
|
-
*
|
|
225
|
+
* Execute a utility function call on the given contract.
|
|
215
226
|
* @param contractFunctionSimulator - The simulator to use for the function call.
|
|
216
227
|
* @param call - The function call to execute.
|
|
217
228
|
* @param authWitnesses - Authentication witnesses required for the function call.
|
|
218
229
|
* @param scopes - Optional array of account addresses whose notes can be accessed in this call. Defaults to all
|
|
219
230
|
* accounts if not specified.
|
|
220
231
|
* @param jobId - The job ID for staged writes.
|
|
221
|
-
* @returns The
|
|
222
|
-
*/ async #
|
|
232
|
+
* @returns The execution result containing the outputs of the utility function.
|
|
233
|
+
*/ async #executeUtility(contractFunctionSimulator, call, authWitnesses, scopes, jobId) {
|
|
223
234
|
try {
|
|
224
235
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
225
|
-
|
|
236
|
+
const { result, offchainEffects } = await contractFunctionSimulator.runUtility(call, authWitnesses ?? [], anchorBlockHeader, scopes, jobId);
|
|
237
|
+
return {
|
|
238
|
+
result,
|
|
239
|
+
offchainEffects
|
|
240
|
+
};
|
|
226
241
|
} catch (err) {
|
|
227
242
|
if (err instanceof SimulationError) {
|
|
228
243
|
await enrichSimulationError(err, this.contractStore, this.log);
|
|
@@ -278,7 +293,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
278
293
|
* Returns the block header up to which the PXE has synced.
|
|
279
294
|
* @returns The synced block header
|
|
280
295
|
*/ getSyncedBlockHeader() {
|
|
281
|
-
return this
|
|
296
|
+
return this.#putInJobQueue(()=>{
|
|
297
|
+
return this.anchorBlockStore.getBlockHeader();
|
|
298
|
+
});
|
|
282
299
|
}
|
|
283
300
|
/**
|
|
284
301
|
* Returns the contract instance for a given address, if it's registered in the PXE.
|
|
@@ -326,6 +343,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
326
343
|
* @returns The address of the sender.
|
|
327
344
|
* TODO: It's strange that we return the address here and I (benesjan) think we should drop the return value.
|
|
328
345
|
*/ async registerSender(sender) {
|
|
346
|
+
if (!await sender.isValid()) {
|
|
347
|
+
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.`);
|
|
348
|
+
}
|
|
329
349
|
const accounts = await this.keyStore.getAccounts();
|
|
330
350
|
if (accounts.includes(sender)) {
|
|
331
351
|
this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
|
|
@@ -334,6 +354,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
334
354
|
const wasAdded = await this.senderAddressBookStore.addSender(sender);
|
|
335
355
|
if (wasAdded) {
|
|
336
356
|
this.log.info(`Added sender:\n ${sender.toString()}`);
|
|
357
|
+
// Wipe the entire sync cache: the new sender's tagged logs could contain notes/events for any contract, so
|
|
358
|
+
// all contracts must re-sync to discover them.
|
|
359
|
+
this.contractSyncService.wipe();
|
|
337
360
|
} else {
|
|
338
361
|
this.log.info(`Sender:\n "${sender.toString()}"\n already registered.`);
|
|
339
362
|
}
|
|
@@ -371,8 +394,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
371
394
|
*
|
|
372
395
|
* @param artifact - The build artifact for the contract class.
|
|
373
396
|
*/ async registerContractClass(artifact) {
|
|
374
|
-
const
|
|
375
|
-
await this.contractStore.addContractArtifact(contractClassId, artifact);
|
|
397
|
+
const contractClassId = await this.contractStore.addContractArtifact(artifact);
|
|
376
398
|
this.log.info(`Added contract class ${artifact.name} with id ${contractClassId}`);
|
|
377
399
|
}
|
|
378
400
|
/**
|
|
@@ -388,15 +410,14 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
388
410
|
if (artifact) {
|
|
389
411
|
// If the user provides an artifact, validate it against the expected class id and register it
|
|
390
412
|
const contractClass = await getContractClassFromArtifact(artifact);
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
throw new Error(`Artifact does not match expected class id (computed ${contractClassId} but instance refers to ${instance.currentContractClassId})`);
|
|
413
|
+
if (!contractClass.id.equals(instance.currentContractClassId)) {
|
|
414
|
+
throw new Error(`Artifact does not match expected class id (computed ${contractClass.id} but instance refers to ${instance.currentContractClassId})`);
|
|
394
415
|
}
|
|
395
416
|
const computedAddress = await computeContractAddressFromInstance(instance);
|
|
396
417
|
if (!computedAddress.equals(instance.address)) {
|
|
397
418
|
throw new Error('Added a contract in which the address does not match the contract instance.');
|
|
398
419
|
}
|
|
399
|
-
await this.contractStore.addContractArtifact(
|
|
420
|
+
await this.contractStore.addContractArtifact(artifact, contractClass);
|
|
400
421
|
const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
|
|
401
422
|
await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
|
|
402
423
|
} else {
|
|
@@ -432,11 +453,13 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
432
453
|
if (!contractClass.id.equals(currentClassId)) {
|
|
433
454
|
throw new Error('Could not update contract to a class different from the current one.');
|
|
434
455
|
}
|
|
435
|
-
await this.contractStore.addContractArtifact(contractClass.id, artifact);
|
|
436
456
|
const publicFunctionSignatures = artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
|
|
437
457
|
await this.node.registerContractFunctionSignatures(publicFunctionSignatures);
|
|
438
458
|
currentInstance.currentContractClassId = contractClass.id;
|
|
439
|
-
await
|
|
459
|
+
await Promise.all([
|
|
460
|
+
this.contractStore.addContractArtifact(artifact, contractClass),
|
|
461
|
+
this.contractStore.addContractInstance(currentInstance)
|
|
462
|
+
]);
|
|
440
463
|
this.log.info(`Updated contract ${artifact.name} at ${contractAddress.toString()} to class ${contractClass.id}`);
|
|
441
464
|
});
|
|
442
465
|
}
|
|
@@ -451,10 +474,11 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
451
474
|
* (where validators prove the public portion).
|
|
452
475
|
*
|
|
453
476
|
* @param txRequest - An authenticated tx request ready for proving
|
|
477
|
+
* @param scopes - Addresses whose private state and keys are accessible during private execution.
|
|
454
478
|
* @returns A result containing the proof and public inputs of the tail circuit.
|
|
455
479
|
* @throws If contract code not found, or public simulation reverts.
|
|
456
480
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
457
|
-
*/ proveTx(txRequest) {
|
|
481
|
+
*/ proveTx(txRequest, scopes) {
|
|
458
482
|
let privateExecutionResult;
|
|
459
483
|
// We disable proving concurrently mostly out of caution, since it accesses some of our stores. Proving is so
|
|
460
484
|
// computationally demanding that it'd be rare for someone to try to do it concurrently regardless.
|
|
@@ -465,7 +489,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
465
489
|
await this.blockStateSynchronizer.sync();
|
|
466
490
|
const syncTime = syncTimer.ms();
|
|
467
491
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
468
|
-
privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest,
|
|
492
|
+
privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
469
493
|
const { publicInputs, chonkProof, executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
470
494
|
simulate: false,
|
|
471
495
|
skipFeeEnforcement: false,
|
|
@@ -496,16 +520,16 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
496
520
|
// transaction before this one is included in a block from this PXE, and that transaction contains a log with
|
|
497
521
|
// a tag derived from the same secret, we would reuse the tag and the transactions would be linked. Hence
|
|
498
522
|
// storing the tags here prevents linkage of txs sent from the same PXE.
|
|
499
|
-
const
|
|
500
|
-
if (
|
|
523
|
+
const taggingIndexRangesUsedInTheTx = privateExecutionResult.entrypoint.taggingIndexRanges;
|
|
524
|
+
if (taggingIndexRangesUsedInTheTx.length > 0) {
|
|
501
525
|
// TODO(benesjan): The following is an expensive operation. Figure out a way to avoid it.
|
|
502
526
|
const txHash = (await txProvingResult.toTx()).txHash;
|
|
503
|
-
await this.senderTaggingStore.storePendingIndexes(
|
|
504
|
-
this.log.debug(`Stored used
|
|
505
|
-
|
|
527
|
+
await this.senderTaggingStore.storePendingIndexes(taggingIndexRangesUsedInTheTx, txHash, jobId);
|
|
528
|
+
this.log.debug(`Stored used tagging index ranges as sender for the tx`, {
|
|
529
|
+
taggingIndexRangesUsedInTheTx
|
|
506
530
|
});
|
|
507
531
|
} else {
|
|
508
|
-
this.log.debug(`No
|
|
532
|
+
this.log.debug(`No tagging index ranges used in the tx`);
|
|
509
533
|
}
|
|
510
534
|
return txProvingResult;
|
|
511
535
|
} catch (err) {
|
|
@@ -518,7 +542,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
518
542
|
* @param txRequest - An authenticated tx request ready for simulation.
|
|
519
543
|
* @returns A trace of the program execution with gate counts.
|
|
520
544
|
* @throws If the code for the functions executed in this transaction have not been made available via `addContracts`.
|
|
521
|
-
*/ profileTx(txRequest, { profileMode, skipProofGeneration = true }) {
|
|
545
|
+
*/ profileTx(txRequest, { profileMode, skipProofGeneration = true, scopes }) {
|
|
522
546
|
// We disable concurrent profiles for consistency with simulateTx.
|
|
523
547
|
return this.#putInJobQueue(async (jobId)=>{
|
|
524
548
|
const totalTimer = new Timer();
|
|
@@ -536,7 +560,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
536
560
|
await this.blockStateSynchronizer.sync();
|
|
537
561
|
const syncTime = syncTimer.ms();
|
|
538
562
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
539
|
-
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest,
|
|
563
|
+
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
540
564
|
const { executionSteps, timings: { proving } = {} } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
541
565
|
simulate: skipProofGeneration,
|
|
542
566
|
skipFeeEnforcement: false,
|
|
@@ -587,7 +611,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
587
611
|
* Also throws if simulatePublic is true and public simulation reverts.
|
|
588
612
|
*
|
|
589
613
|
* TODO(#7456) Prevent msgSender being defined here for the first call
|
|
590
|
-
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, overrides, scopes }) {
|
|
614
|
+
*/ simulateTx(txRequest, { simulatePublic, skipTxValidation = false, skipFeeEnforcement = false, skipKernels = true, overrides, scopes }) {
|
|
591
615
|
// We disable concurrent simulations since those might execute oracles which read and write to the PXE stores (e.g.
|
|
592
616
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
593
617
|
// delete the same read value, or reading values that another simulation is currently modifying).
|
|
@@ -606,23 +630,23 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
606
630
|
const syncTimer = new Timer();
|
|
607
631
|
await this.blockStateSynchronizer.sync();
|
|
608
632
|
const syncTime = syncTimer.ms();
|
|
609
|
-
const contractFunctionSimulator = this.#getSimulatorForTx(overrides);
|
|
610
|
-
// Temporary: in case there are overrides, we have to skip the kernels or validations
|
|
611
|
-
// will fail. Consider handing control to the user/wallet on whether they want to run them
|
|
612
|
-
// or not.
|
|
613
633
|
const overriddenContracts = overrides?.contracts ? new Set(Object.keys(overrides.contracts)) : undefined;
|
|
614
634
|
const hasOverriddenContracts = overriddenContracts !== undefined && overriddenContracts.size > 0;
|
|
615
|
-
|
|
616
|
-
|
|
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);
|
|
617
639
|
if (hasOverriddenContracts) {
|
|
618
|
-
|
|
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);
|
|
619
643
|
}
|
|
620
644
|
// Execution of private functions only; no proving, and no kernel logic.
|
|
621
645
|
const privateExecutionResult = await this.#executePrivate(contractFunctionSimulator, txRequest, scopes, jobId);
|
|
622
646
|
let publicInputs;
|
|
623
647
|
let executionSteps = [];
|
|
624
648
|
if (skipKernels) {
|
|
625
|
-
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel)));
|
|
649
|
+
({ publicInputs, executionSteps } = await generateSimulatedProvingResult(privateExecutionResult, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel), this.node));
|
|
626
650
|
} else {
|
|
627
651
|
// Kernel logic, plus proving of all private functions and kernels.
|
|
628
652
|
({ publicInputs, executionSteps } = await this.#prove(txRequest, this.proofCreator, privateExecutionResult, {
|
|
@@ -639,6 +663,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
639
663
|
const publicSimulationTimer = new Timer();
|
|
640
664
|
publicOutput = await this.#simulatePublicCalls(simulatedTx, skipFeeEnforcement);
|
|
641
665
|
publicSimulationTime = publicSimulationTimer.ms();
|
|
666
|
+
if (publicOutput?.debugLogs?.length) {
|
|
667
|
+
await displayDebugLogs(publicOutput.debugLogs, (addr)=>this.contractStore.getDebugContractName(addr));
|
|
668
|
+
}
|
|
642
669
|
}
|
|
643
670
|
let validationTime;
|
|
644
671
|
if (!skipTxValidation) {
|
|
@@ -649,7 +676,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
649
676
|
});
|
|
650
677
|
validationTime = validationTimer.ms();
|
|
651
678
|
if (validationResult.result === 'invalid') {
|
|
652
|
-
|
|
679
|
+
const reason = validationResult.reason.length > 0 ? ` Reason: ${validationResult.reason.join(', ')}` : '';
|
|
680
|
+
throw new Error(`The simulated transaction is unable to be added to state and is invalid.${reason}`);
|
|
653
681
|
}
|
|
654
682
|
}
|
|
655
683
|
const txHash = simulatedTx.getTxHash();
|
|
@@ -682,17 +710,19 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
682
710
|
nodeRPCCalls: simulatorStats.nodeRPCCalls
|
|
683
711
|
});
|
|
684
712
|
} catch (err) {
|
|
685
|
-
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(', ')}`);
|
|
686
714
|
}
|
|
687
715
|
});
|
|
688
716
|
}
|
|
689
717
|
/**
|
|
690
|
-
*
|
|
718
|
+
* Executes a contract utility function.
|
|
691
719
|
* @param call - The function call containing the function details, arguments, and target contract address.
|
|
692
|
-
*/
|
|
693
|
-
|
|
720
|
+
*/ executeUtility(call, { authwits, scopes } = {
|
|
721
|
+
scopes: []
|
|
722
|
+
}) {
|
|
723
|
+
// We disable concurrent executions since those might execute oracles which read and write to the PXE stores (e.g.
|
|
694
724
|
// to the capsules), and we need to prevent concurrent runs from interfering with one another (e.g. attempting to
|
|
695
|
-
// delete the same read value, or reading values that another
|
|
725
|
+
// delete the same read value, or reading values that another execution is currently modifying).
|
|
696
726
|
return this.#putInJobQueue(async (jobId)=>{
|
|
697
727
|
try {
|
|
698
728
|
const totalTimer = new Timer();
|
|
@@ -702,8 +732,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
702
732
|
const functionTimer = new Timer();
|
|
703
733
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
704
734
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
705
|
-
await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall)=>this.#
|
|
706
|
-
const executionResult = await this.#
|
|
735
|
+
await this.contractSyncService.ensureContractSynced(call.to, call.selector, (privateSyncCall, execScopes)=>this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, scopes);
|
|
736
|
+
const { result: executionResult, offchainEffects } = await this.#executeUtility(contractFunctionSimulator, call, authwits ?? [], scopes, jobId);
|
|
707
737
|
const functionTime = functionTimer.ms();
|
|
708
738
|
const totalTime = totalTimer.ms();
|
|
709
739
|
const perFunction = [
|
|
@@ -721,6 +751,8 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
721
751
|
const simulationStats = contractFunctionSimulator.getStats();
|
|
722
752
|
return {
|
|
723
753
|
result: executionResult,
|
|
754
|
+
offchainEffects,
|
|
755
|
+
anchorBlockTimestamp: anchorBlockHeader.globalVariables.timestamp,
|
|
724
756
|
stats: {
|
|
725
757
|
timings,
|
|
726
758
|
nodeRPCCalls: simulationStats.nodeRPCCalls
|
|
@@ -729,7 +761,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
729
761
|
} catch (err) {
|
|
730
762
|
const { to, name, args } = call;
|
|
731
763
|
const stringifiedArgs = args.map((arg)=>arg.toString()).join(', ');
|
|
732
|
-
throw this.#contextualizeError(err, `
|
|
764
|
+
throw this.#contextualizeError(err, `executeUtility ${to}:${name}(${stringifiedArgs})`, `scopes=${scopes.map((s)=>s.toString()).join(', ')}`);
|
|
733
765
|
}
|
|
734
766
|
});
|
|
735
767
|
}
|
|
@@ -752,7 +784,7 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
752
784
|
const anchorBlockHeader = await this.anchorBlockStore.getBlockHeader();
|
|
753
785
|
anchorBlockNumber = anchorBlockHeader.getBlockNumber();
|
|
754
786
|
const contractFunctionSimulator = this.#getSimulatorForTx();
|
|
755
|
-
await this.contractSyncService.ensureContractSynced(filter.contractAddress, null, async (privateSyncCall)=>await this.#
|
|
787
|
+
await this.contractSyncService.ensureContractSynced(filter.contractAddress, null, async (privateSyncCall, execScopes)=>await this.#executeUtility(contractFunctionSimulator, privateSyncCall, [], execScopes, jobId), anchorBlockHeader, jobId, filter.scopes);
|
|
756
788
|
});
|
|
757
789
|
// anchorBlockNumber is set during the job and fixed to whatever it is after a block sync
|
|
758
790
|
const sanitizedFilter = new PrivateEventFilterValidator(anchorBlockNumber).validate(filter);
|
|
@@ -760,8 +792,9 @@ import { SenderTaggingStore } from './storage/tagging_store/sender_tagging_store
|
|
|
760
792
|
return this.privateEventStore.getPrivateEvents(eventSelector, sanitizedFilter);
|
|
761
793
|
}
|
|
762
794
|
/**
|
|
763
|
-
* Stops the PXE's job queue.
|
|
764
|
-
*/ stop() {
|
|
765
|
-
|
|
795
|
+
* Stops the PXE's job queue and closes the backing store.
|
|
796
|
+
*/ async stop() {
|
|
797
|
+
await this.jobQueue.end();
|
|
798
|
+
await this.db.close();
|
|
766
799
|
}
|
|
767
800
|
}
|
|
@@ -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
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { Fr } from '@aztec/foundation/curves/bn254';
|
|
2
|
+
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
3
|
+
import type { Capsule } from '@aztec/stdlib/tx';
|
|
4
|
+
import type { CapsuleStore } from './capsule_store.js';
|
|
5
|
+
/**
|
|
6
|
+
* Wraps a CapsuleStore with scope-based access control. Each operation asserts that the requested scope is in the
|
|
7
|
+
* allowed scopes list before delegating to the underlying store.
|
|
8
|
+
*/
|
|
9
|
+
export declare class CapsuleService {
|
|
10
|
+
private readonly capsuleStore;
|
|
11
|
+
private readonly allowedScopes;
|
|
12
|
+
constructor(capsuleStore: CapsuleStore, allowedScopes: AztecAddress[]);
|
|
13
|
+
setCapsule(contractAddress: AztecAddress, slot: Fr, capsule: Fr[], jobId: string, scope: AztecAddress): void;
|
|
14
|
+
getCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string, scope: AztecAddress, transientCapsules?: Capsule[]): Promise<Fr[] | null>;
|
|
15
|
+
deleteCapsule(contractAddress: AztecAddress, slot: Fr, jobId: string, scope: AztecAddress): void;
|
|
16
|
+
copyCapsule(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number, jobId: string, scope: AztecAddress): Promise<void>;
|
|
17
|
+
appendToCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string, scope: AztecAddress): Promise<void>;
|
|
18
|
+
readCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, jobId: string, scope: AztecAddress): Promise<Fr[][]>;
|
|
19
|
+
setCapsuleArray(contractAddress: AztecAddress, baseSlot: Fr, content: Fr[][], jobId: string, scope: AztecAddress): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2Fwc3VsZV9zZXJ2aWNlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc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