@aztec/txe 0.0.1-commit.2448fdb → 0.0.1-commit.2606882
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/ContractClassRegistry-PII7Q556.js +3 -0
- package/dest/ContractClassRegistry-PII7Q556.js.map +7 -0
- package/dest/ContractInstanceRegistry-3MHLGFNZ.js +3 -0
- package/dest/ContractInstanceRegistry-3MHLGFNZ.js.map +7 -0
- package/dest/FeeJuice-TQV5AQK7.js +3 -0
- package/dest/FeeJuice-TQV5AQK7.js.map +7 -0
- package/dest/MultiCallEntrypoint-SBJUIJY7.js +3 -0
- package/dest/MultiCallEntrypoint-SBJUIJY7.js.map +7 -0
- package/dest/SchnorrAccount-MQXPIZ44.js +3 -0
- package/dest/SchnorrAccount-MQXPIZ44.js.map +7 -0
- package/dest/bin/check_txe_oracle_version.d.ts +2 -0
- package/dest/bin/check_txe_oracle_version.d.ts.map +1 -0
- package/dest/bin/check_txe_oracle_version.js +61 -0
- package/dest/bin/index.js +3 -30
- package/dest/bin/index.js.map +7 -0
- package/dest/bin/oracle_test_server.d.ts +3 -0
- package/dest/bin/oracle_test_server.d.ts.map +1 -0
- package/dest/bin/oracle_test_server.js +41 -0
- package/dest/chunk-3VX4QA7B.js +265 -0
- package/dest/chunk-3VX4QA7B.js.map +7 -0
- package/dest/chunk-BJVAAXNA.js +3 -0
- package/dest/chunk-BJVAAXNA.js.map +7 -0
- package/dest/chunk-FU3LBVE4.js +304 -0
- package/dest/chunk-FU3LBVE4.js.map +7 -0
- package/dest/constants.d.ts +5 -1
- package/dest/constants.d.ts.map +1 -1
- package/dest/constants.js +8 -0
- package/dest/dispatcher_pool.d.ts +67 -0
- package/dest/dispatcher_pool.d.ts.map +1 -0
- package/dest/dispatcher_pool.js +284 -0
- package/dest/index.d.ts +185 -7
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +70 -190
- package/dest/metafile.json +38352 -0
- package/dest/msgpackr_fr_extension.d.ts +2 -0
- package/dest/msgpackr_fr_extension.d.ts.map +1 -0
- package/dest/msgpackr_fr_extension.js +21 -0
- package/dest/oracle/interfaces.d.ts +33 -8
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/test-resolver/fixtures.d.ts +43 -0
- package/dest/oracle/test-resolver/fixtures.d.ts.map +1 -0
- package/dest/oracle/test-resolver/fixtures.js +39 -0
- package/dest/oracle/test-resolver/index.d.ts +9 -0
- package/dest/oracle/test-resolver/index.d.ts.map +1 -0
- package/dest/oracle/test-resolver/index.js +33 -0
- package/dest/oracle/test-resolver/resolver.d.ts +34 -0
- package/dest/oracle/test-resolver/resolver.d.ts.map +1 -0
- package/dest/oracle/test-resolver/resolver.js +114 -0
- package/dest/oracle/txe_oracle_public_context.d.ts +26 -2
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +43 -1
- package/dest/oracle/txe_oracle_registry.d.ts +147 -0
- package/dest/oracle/txe_oracle_registry.d.ts.map +1 -0
- package/dest/oracle/txe_oracle_registry.js +562 -0
- package/dest/oracle/txe_oracle_top_level_context.d.ts +27 -13
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +129 -52
- package/dest/oracle/txe_oracle_version.d.ts +17 -0
- package/dest/oracle/txe_oracle_version.d.ts.map +1 -0
- package/dest/oracle/txe_oracle_version.js +14 -0
- package/dest/oracle/txe_private_execution_oracle.d.ts +17 -0
- package/dest/oracle/txe_private_execution_oracle.d.ts.map +1 -0
- package/dest/oracle/txe_private_execution_oracle.js +15 -0
- package/dest/rpc_server.d.ts +14 -0
- package/dest/rpc_server.d.ts.map +1 -0
- package/dest/rpc_server.js +78 -0
- package/dest/rpc_translator.d.ts +96 -266
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +699 -731
- package/dest/server.bundle.js +3 -0
- package/dest/server.bundle.js.map +7 -0
- package/dest/state_machine/archiver.d.ts +4 -3
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +26 -15
- package/dest/state_machine/dummy_p2p_client.d.ts +13 -7
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +16 -4
- package/dest/state_machine/global_variable_builder.d.ts +9 -4
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/global_variable_builder.js +9 -3
- package/dest/state_machine/index.d.ts +4 -2
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +17 -3
- package/dest/state_machine/mock_epoch_cache.d.ts +16 -3
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +29 -2
- package/dest/state_machine/synchronizer.js +1 -1
- package/dest/txe_session.d.ts +75 -14
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +164 -38
- package/dest/utils/encoding.d.ts +191 -0
- package/dest/utils/encoding.d.ts.map +1 -0
- package/dest/{util → utils}/encoding.js +7 -2
- package/dest/{util → utils}/expected_failure_error.d.ts +1 -1
- package/dest/utils/expected_failure_error.d.ts.map +1 -0
- package/dest/{util → utils}/txe_account_store.d.ts +1 -1
- package/dest/utils/txe_account_store.d.ts.map +1 -0
- package/dest/utils/txe_artifact_resolver.d.ts +37 -0
- package/dest/utils/txe_artifact_resolver.d.ts.map +1 -0
- package/dest/utils/txe_artifact_resolver.js +161 -0
- package/dest/utils/txe_public_contract_data_source.d.ts +20 -0
- package/dest/utils/txe_public_contract_data_source.d.ts.map +1 -0
- package/dest/{util → utils}/txe_public_contract_data_source.js +1 -3
- package/dest/worker.bundle.js +3 -0
- package/dest/worker.bundle.js.map +7 -0
- package/dest/worker.d.ts +2 -0
- package/dest/worker.d.ts.map +1 -0
- package/dest/worker.js +92 -0
- package/package.json +38 -21
- package/src/bin/check_txe_oracle_version.ts +70 -0
- package/src/bin/index.ts +11 -2
- package/src/bin/oracle_test_server.ts +51 -0
- package/src/constants.ts +10 -0
- package/src/dispatcher_pool.ts +316 -0
- package/src/index.ts +97 -227
- package/src/msgpackr_fr_extension.ts +23 -0
- package/src/oracle/interfaces.ts +29 -7
- package/src/oracle/test-resolver/fixtures.ts +84 -0
- package/src/oracle/test-resolver/index.ts +45 -0
- package/src/oracle/test-resolver/resolver.ts +165 -0
- package/src/oracle/txe_oracle_public_context.ts +60 -0
- package/src/oracle/txe_oracle_registry.ts +401 -0
- package/src/oracle/txe_oracle_top_level_context.ts +157 -62
- package/src/oracle/txe_oracle_version.ts +17 -0
- package/src/oracle/txe_private_execution_oracle.ts +30 -0
- package/src/rpc_server.ts +87 -0
- package/src/rpc_translator.ts +774 -1043
- package/src/state_machine/archiver.ts +38 -16
- package/src/state_machine/dummy_p2p_client.ts +31 -11
- package/src/state_machine/global_variable_builder.ts +18 -3
- package/src/state_machine/index.ts +20 -5
- package/src/state_machine/mock_epoch_cache.ts +38 -3
- package/src/state_machine/synchronizer.ts +1 -1
- package/src/txe_session.ts +269 -39
- package/src/{util → utils}/encoding.ts +8 -2
- package/src/utils/txe_artifact_resolver.ts +217 -0
- package/src/{util → utils}/txe_public_contract_data_source.ts +0 -2
- package/src/worker.ts +98 -0
- package/dest/util/encoding.d.ts +0 -719
- package/dest/util/encoding.d.ts.map +0 -1
- package/dest/util/expected_failure_error.d.ts.map +0 -1
- package/dest/util/txe_account_store.d.ts.map +0 -1
- package/dest/util/txe_public_contract_data_source.d.ts +0 -20
- package/dest/util/txe_public_contract_data_source.d.ts.map +0 -1
- /package/dest/{util → utils}/expected_failure_error.js +0 -0
- /package/dest/{util → utils}/txe_account_store.js +0 -0
- /package/src/{util → utils}/expected_failure_error.ts +0 -0
- /package/src/{util → utils}/txe_account_store.ts +0 -0
package/dest/txe_session.d.ts
CHANGED
|
@@ -2,15 +2,18 @@ import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { type Logger } from '@aztec/foundation/log';
|
|
4
4
|
import { KeyStore } from '@aztec/key-store';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
6
|
+
import { AddressStore, CapsuleStore, ContractStore, JobCoordinator, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
7
|
+
import { type IMiscOracle, type IPrivateExecutionOracle, type IUtilityExecutionOracle, Option } from '@aztec/pxe/simulator';
|
|
7
8
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
9
|
+
import type { GasSettings } from '@aztec/stdlib/gas';
|
|
8
10
|
import { PrivateContextInputs } from '@aztec/stdlib/kernel';
|
|
9
11
|
import type { IAvmExecutionOracle, ITxeExecutionOracle } from './oracle/interfaces.js';
|
|
10
12
|
import { RPCTranslator } from './rpc_translator.js';
|
|
11
13
|
import { TXEStateMachine } from './state_machine/index.js';
|
|
12
|
-
import type { ForeignCallArgs, ForeignCallResult } from './
|
|
13
|
-
import { TXEAccountStore } from './
|
|
14
|
+
import type { ForeignCallArgs, ForeignCallResult } from './utils/encoding.js';
|
|
15
|
+
import { TXEAccountStore } from './utils/txe_account_store.js';
|
|
16
|
+
import type { TXEArtifactResolver } from './utils/txe_artifact_resolver.js';
|
|
14
17
|
type MethodNames<T> = {
|
|
15
18
|
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
|
|
16
19
|
}[keyof T];
|
|
@@ -20,12 +23,44 @@ type MethodNames<T> = {
|
|
|
20
23
|
*/
|
|
21
24
|
export type TXEOracleFunctionName = Exclude<MethodNames<RPCTranslator>, 'constructor' | 'handlerAsMisc' | 'handlerAsUtility' | 'handlerAsPrivate' | 'handlerAsAvm' | 'handlerAsTxe'>;
|
|
22
25
|
export interface TXESessionStateHandler {
|
|
26
|
+
/** Records the TXE oracle version reported by the Noir test code for diagnostics. */
|
|
27
|
+
setTxeOracleVersion(major: number, minor: number): void;
|
|
23
28
|
enterTopLevelState(): Promise<void>;
|
|
24
|
-
enterPublicState(contractAddress
|
|
25
|
-
enterPrivateState(contractAddress
|
|
26
|
-
enterUtilityState(contractAddress
|
|
29
|
+
enterPublicState(contractAddress: Option<AztecAddress>): Promise<void>;
|
|
30
|
+
enterPrivateState(contractAddress: Option<AztecAddress>, anchorBlockNumber: Option<BlockNumber>, gasSettings: GasSettings): Promise<PrivateContextInputs>;
|
|
31
|
+
enterUtilityState(contractAddress: Option<AztecAddress>): Promise<void>;
|
|
27
32
|
cycleJob(): Promise<string>;
|
|
28
33
|
getCurrentJob(): string;
|
|
34
|
+
/**
|
|
35
|
+
* Runs an executor-style top-level call (private/public call, utility execution) with last-call tracking.
|
|
36
|
+
*/
|
|
37
|
+
withTopLevelCallTracking<T>(work: () => Promise<{
|
|
38
|
+
result: T;
|
|
39
|
+
txHash?: Fr;
|
|
40
|
+
}>): Promise<T>;
|
|
41
|
+
/**
|
|
42
|
+
* Captures a raw offchain effect payload for consumption from test environment. Called by the `emit_offchain_effect`
|
|
43
|
+
* oracle handler whenever a contract function emits an offchain message, at any call depth.
|
|
44
|
+
*/
|
|
45
|
+
recordOffchainEffect(data: Fr[]): void;
|
|
46
|
+
/**
|
|
47
|
+
* Returns the raw offchain effect payloads emitted by the last top-level call. Each payload follows the protocol
|
|
48
|
+
* convention documented on `OFFCHAIN_MESSAGE_IDENTIFIER`, i.e. `[identifier, recipient, ...ciphertext]`. Decoding into
|
|
49
|
+
* `OffchainMessage` structs happens on the Noir side of the test helper. Marks the buffer as queried so the
|
|
50
|
+
* unqueried-messages warning doesn't fire on the next reset.
|
|
51
|
+
*/
|
|
52
|
+
getLastCallOffchainEffects(): {
|
|
53
|
+
effects: Fr[][];
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Returns the context of the last top-level call: its tx hash (`Fr.ZERO` if the call was tx-less) and the anchor
|
|
57
|
+
* block timestamp captured at the start of the call. Does *not* mark the buffer as queried — context reads are
|
|
58
|
+
* metadata, not effect consumption.
|
|
59
|
+
*/
|
|
60
|
+
getLastCallContext(): {
|
|
61
|
+
txHash: Fr;
|
|
62
|
+
anchorBlockTimestamp: bigint;
|
|
63
|
+
};
|
|
29
64
|
}
|
|
30
65
|
/**
|
|
31
66
|
* A `TXESession` corresponds to a Noir `#[test]` function, and handles all of its oracle calls, stores test-specific
|
|
@@ -33,6 +68,7 @@ export interface TXESessionStateHandler {
|
|
|
33
68
|
*/
|
|
34
69
|
export declare class TXESession implements TXESessionStateHandler {
|
|
35
70
|
private logger;
|
|
71
|
+
private sessionStore;
|
|
36
72
|
private stateMachine;
|
|
37
73
|
private oracleHandler;
|
|
38
74
|
private contractStore;
|
|
@@ -50,11 +86,21 @@ export declare class TXESession implements TXESessionStateHandler {
|
|
|
50
86
|
private chainId;
|
|
51
87
|
private version;
|
|
52
88
|
private nextBlockTimestamp;
|
|
53
|
-
private
|
|
89
|
+
private readonly artifactResolver;
|
|
90
|
+
private readonly rootPath;
|
|
91
|
+
private readonly packageName;
|
|
54
92
|
private state;
|
|
55
93
|
private authwits;
|
|
56
|
-
|
|
57
|
-
|
|
94
|
+
private lastCallInfo;
|
|
95
|
+
private txeOracleVersion;
|
|
96
|
+
private disposed;
|
|
97
|
+
constructor(logger: Logger, sessionStore: AztecAsyncKVStore, stateMachine: TXEStateMachine, oracleHandler: IMiscOracle | IUtilityExecutionOracle | IPrivateExecutionOracle | IAvmExecutionOracle | ITxeExecutionOracle, contractStore: ContractStore, noteStore: NoteStore, keyStore: KeyStore, addressStore: AddressStore, accountStore: TXEAccountStore, senderTaggingStore: SenderTaggingStore, recipientTaggingStore: RecipientTaggingStore, senderAddressBookStore: SenderAddressBookStore, capsuleStore: CapsuleStore, privateEventStore: PrivateEventStore, jobCoordinator: JobCoordinator, currentJobId: string, chainId: Fr, version: Fr, nextBlockTimestamp: bigint, artifactResolver: TXEArtifactResolver, rootPath: string, packageName: string);
|
|
98
|
+
/**
|
|
99
|
+
* Closes the per-session `txe-session` LMDB and the `NativeWorldStateService` .
|
|
100
|
+
* Called via IPC when the dispatcher detects the end of a test. Idempotent.
|
|
101
|
+
*/
|
|
102
|
+
dispose(): Promise<void>;
|
|
103
|
+
static init(contractStore: ContractStore, artifactResolver: TXEArtifactResolver, rootPath: string, packageName: string): Promise<TXESession>;
|
|
58
104
|
/**
|
|
59
105
|
* Processes an oracle function invoked by the Noir test associated to this session.
|
|
60
106
|
* @param functionName The name of the oracle.
|
|
@@ -65,10 +111,25 @@ export declare class TXESession implements TXESessionStateHandler {
|
|
|
65
111
|
getCurrentJob(): string;
|
|
66
112
|
/** Commits the current job and begins a new one. Returns the new job ID. */
|
|
67
113
|
cycleJob(): Promise<string>;
|
|
114
|
+
private resetLastCall;
|
|
115
|
+
recordOffchainEffect(data: Fr[]): void;
|
|
116
|
+
private setLastCallContext;
|
|
117
|
+
withTopLevelCallTracking<T>(work: () => Promise<{
|
|
118
|
+
result: T;
|
|
119
|
+
txHash?: Fr;
|
|
120
|
+
}>): Promise<T>;
|
|
121
|
+
getLastCallOffchainEffects(): {
|
|
122
|
+
effects: Fr[][];
|
|
123
|
+
};
|
|
124
|
+
getLastCallContext(): {
|
|
125
|
+
txHash: Fr;
|
|
126
|
+
anchorBlockTimestamp: bigint;
|
|
127
|
+
};
|
|
128
|
+
setTxeOracleVersion(major: number, minor: number): void;
|
|
68
129
|
enterTopLevelState(): Promise<void>;
|
|
69
|
-
enterPrivateState(
|
|
70
|
-
enterPublicState(
|
|
71
|
-
enterUtilityState(
|
|
130
|
+
enterPrivateState(contractAddressOpt: Option<AztecAddress>, anchorBlockNumberOpt: Option<BlockNumber>, gasSettings: GasSettings): Promise<PrivateContextInputs>;
|
|
131
|
+
enterPublicState(contractAddressOpt: Option<AztecAddress>): Promise<void>;
|
|
132
|
+
enterUtilityState(contractAddressOpt: Option<AztecAddress>): Promise<void>;
|
|
72
133
|
private exitTopLevelState;
|
|
73
134
|
private exitPrivateState;
|
|
74
135
|
private exitPublicState;
|
|
@@ -76,4 +137,4 @@ export declare class TXESession implements TXESessionStateHandler {
|
|
|
76
137
|
private utilityExecutorForContractSync;
|
|
77
138
|
}
|
|
78
139
|
export {};
|
|
79
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
140
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3Nlc3Npb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy90eGVfc2Vzc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sRUFBRSxLQUFLLE1BQU0sRUFBZ0IsTUFBTSx1QkFBdUIsQ0FBQztBQUNsRSxPQUFPLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDNUMsT0FBTyxLQUFLLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUV6RCxPQUFPLEVBQ0wsWUFBWSxFQUdaLFlBQVksRUFDWixhQUFhLEVBQ2IsY0FBYyxFQUVkLFNBQVMsRUFDVCxpQkFBaUIsRUFDakIscUJBQXFCLEVBQ3JCLHNCQUFzQixFQUN0QixrQkFBa0IsRUFDbkIsTUFBTSxtQkFBbUIsQ0FBQztBQUMzQixPQUFPLEVBSUwsS0FBSyxXQUFXLEVBQ2hCLEtBQUssdUJBQXVCLEVBQzVCLEtBQUssdUJBQXVCLEVBQzVCLE1BQU0sRUFHUCxNQUFNLHNCQUFzQixDQUFDO0FBWTlCLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUMzRCxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxtQkF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FpQjtZQWlCWCxnQkFBZ0I7WUE2QmhCLGVBQWU7SUFTN0IsT0FBTyxDQUFDLGtCQUFrQjtJQU0xQixPQUFPLENBQUMsOEJBQThCO0NBa0R2QyJ9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"txe_session.d.ts","sourceRoot":"","sources":["../src/txe_session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"txe_session.d.ts","sourceRoot":"","sources":["../src/txe_session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EACL,YAAY,EAGZ,YAAY,EACZ,aAAa,EACb,cAAc,EAEd,SAAS,EACT,iBAAiB,EACjB,qBAAqB,EACrB,sBAAsB,EACtB,kBAAkB,EACnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAIL,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,MAAM,EAGP,MAAM,sBAAsB,CAAC;AAY9B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAO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B,CAAC,IAAI,EAAE,EAAE,EAAE,GAAG,IAAI,CAErC;IAED,OAAO,CAAC,kBAAkB;IAKpB,wBAAwB,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;QAAE,MAAM,EAAE,CAAC,CAAC;QAAC,MAAM,CAAC,EAAE,EAAE,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAS7F;IAED,0BAA0B,IAAI;QAAE,OAAO,EAAE,EAAE,EAAE,EAAE,CAAA;KAAE,CAYhD;IAED,kBAAkB,IAAI;QAAE,MAAM,EAAE,EAAE,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAA;KAAE,CAGjE;IAED,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAatD;IAEK,kBAAkB,kBAgDvB;IAEK,iBAAiB,CACrB,kBAAkB,EAAE,MAAM,CAAC,YAAY,CAAC,EACxC,oBAAoB,EAAE,MAAM,CAAC,WAAW,CAAC,EACzC,WAAW,EAAE,WAAW,GACvB,OAAO,CAAC,oBAAoB,CAAC,CAwE/B;IAEK,gBAAgB,CAAC,kBAAkB,EAAE,MAAM,CAAC,YAAY,CAAC,iBA4B9D;IAEK,iBAAiB,CAAC,kBAAkB,EAAE,MAAM,CAAC,YAAY,CAAC,iBA+C/D;IAED,OAAO,CAAC,iBAAiB;YAiBX,gBAAgB;YA6BhB,eAAe;IAS7B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,8BAA8B;CAkDvC"}
|
package/dest/txe_session.js
CHANGED
|
@@ -2,31 +2,42 @@ import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { KeyStore } from '@aztec/key-store';
|
|
5
|
-
import {
|
|
6
|
-
import { AddressStore, AnchorBlockStore, CapsuleService, CapsuleStore,
|
|
7
|
-
import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache, Oracle,
|
|
5
|
+
import { openEphemeralStore } from '@aztec/kv-store/lmdb-v2';
|
|
6
|
+
import { AddressStore, AnchorBlockStore, CapsuleService, CapsuleStore, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
7
|
+
import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache, Oracle, UtilityExecutionOracle } from '@aztec/pxe/simulator';
|
|
8
8
|
import { ExecutionError, WASMSimulator, createSimulationError, extractCallStack, resolveAssertionMessageFromError, toACVMWitness } from '@aztec/simulator/client';
|
|
9
|
+
import { STANDARD_AUTH_REGISTRY_ADDRESS } from '@aztec/standard-contracts/auth-registry/constants';
|
|
9
10
|
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
10
11
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
11
|
-
import { GasSettings } from '@aztec/stdlib/gas';
|
|
12
12
|
import { computeProtocolNullifier } from '@aztec/stdlib/hash';
|
|
13
13
|
import { makeGlobalVariables } from '@aztec/stdlib/testing';
|
|
14
|
-
import { CallContext, TxContext } from '@aztec/stdlib/tx';
|
|
14
|
+
import { CallContext, OFFCHAIN_MESSAGE_IDENTIFIER, TxContext } from '@aztec/stdlib/tx';
|
|
15
15
|
import { z } from 'zod';
|
|
16
|
-
import { DEFAULT_ADDRESS } from './constants.js';
|
|
16
|
+
import { DEFAULT_ADDRESS, MAX_OFFCHAIN_EFFECTS_PER_TXE_QUERY, MAX_OFFCHAIN_EFFECT_LEN } from './constants.js';
|
|
17
17
|
import { TXEOraclePublicContext } from './oracle/txe_oracle_public_context.js';
|
|
18
18
|
import { TXEOracleTopLevelContext } from './oracle/txe_oracle_top_level_context.js';
|
|
19
|
+
import { TXE_ORACLE_VERSION_MAJOR, TXE_ORACLE_VERSION_MINOR } from './oracle/txe_oracle_version.js';
|
|
20
|
+
import { TXEPrivateExecutionOracle } from './oracle/txe_private_execution_oracle.js';
|
|
19
21
|
import { RPCTranslator } from './rpc_translator.js';
|
|
20
22
|
import { TXEArchiver } from './state_machine/archiver.js';
|
|
21
23
|
import { TXEStateMachine } from './state_machine/index.js';
|
|
22
|
-
import { TXEAccountStore } from './util/txe_account_store.js';
|
|
23
24
|
import { getSingleTxBlockRequestHash, insertTxEffectIntoWorldTrees, makeTXEBlock } from './utils/block_creation.js';
|
|
24
25
|
import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
26
|
+
import { TXEAccountStore } from './utils/txe_account_store.js';
|
|
27
|
+
function emptyLastCallState() {
|
|
28
|
+
return {
|
|
29
|
+
offchainEffects: [],
|
|
30
|
+
queried: false,
|
|
31
|
+
txHash: Fr.ZERO,
|
|
32
|
+
anchorBlockTimestamp: 0n
|
|
33
|
+
};
|
|
34
|
+
}
|
|
25
35
|
/**
|
|
26
36
|
* A `TXESession` corresponds to a Noir `#[test]` function, and handles all of its oracle calls, stores test-specific
|
|
27
37
|
* state, etc., independent of all other tests running in parallel.
|
|
28
38
|
*/ export class TXESession {
|
|
29
39
|
logger;
|
|
40
|
+
sessionStore;
|
|
30
41
|
stateMachine;
|
|
31
42
|
oracleHandler;
|
|
32
43
|
contractStore;
|
|
@@ -44,11 +55,17 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
44
55
|
chainId;
|
|
45
56
|
version;
|
|
46
57
|
nextBlockTimestamp;
|
|
47
|
-
|
|
58
|
+
artifactResolver;
|
|
59
|
+
rootPath;
|
|
60
|
+
packageName;
|
|
48
61
|
state;
|
|
49
62
|
authwits;
|
|
50
|
-
|
|
63
|
+
lastCallInfo;
|
|
64
|
+
txeOracleVersion;
|
|
65
|
+
disposed;
|
|
66
|
+
constructor(logger, sessionStore, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, currentJobId, chainId, version, nextBlockTimestamp, artifactResolver, rootPath, packageName){
|
|
51
67
|
this.logger = logger;
|
|
68
|
+
this.sessionStore = sessionStore;
|
|
52
69
|
this.stateMachine = stateMachine;
|
|
53
70
|
this.oracleHandler = oracleHandler;
|
|
54
71
|
this.contractStore = contractStore;
|
|
@@ -66,14 +83,41 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
66
83
|
this.chainId = chainId;
|
|
67
84
|
this.version = version;
|
|
68
85
|
this.nextBlockTimestamp = nextBlockTimestamp;
|
|
69
|
-
this.
|
|
86
|
+
this.artifactResolver = artifactResolver;
|
|
87
|
+
this.rootPath = rootPath;
|
|
88
|
+
this.packageName = packageName;
|
|
70
89
|
this.state = {
|
|
71
90
|
name: 'TOP_LEVEL'
|
|
72
91
|
};
|
|
73
92
|
this.authwits = new Map();
|
|
93
|
+
this.lastCallInfo = emptyLastCallState();
|
|
94
|
+
this.disposed = false;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Closes the per-session `txe-session` LMDB and the `NativeWorldStateService` .
|
|
98
|
+
* Called via IPC when the dispatcher detects the end of a test. Idempotent.
|
|
99
|
+
*/ async dispose() {
|
|
100
|
+
if (this.disposed) {
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
this.disposed = true;
|
|
104
|
+
try {
|
|
105
|
+
await this.stateMachine.synchronizer.nativeWorldStateService.close();
|
|
106
|
+
} catch (err) {
|
|
107
|
+
this.logger.warn(`Error closing native world state during session dispose`, err);
|
|
108
|
+
}
|
|
109
|
+
try {
|
|
110
|
+
await this.sessionStore.close();
|
|
111
|
+
} catch (err) {
|
|
112
|
+
this.logger.warn(`Error closing session LMDB during dispose`, err);
|
|
113
|
+
}
|
|
74
114
|
}
|
|
75
|
-
static async init(contractStore) {
|
|
76
|
-
|
|
115
|
+
static async init(contractStore, artifactResolver, rootPath, packageName) {
|
|
116
|
+
// Size LMDB's reader slots to the libuv pool (capped to 2 in bin/index.ts via
|
|
117
|
+
// HARDWARE_CONCURRENCY): each native LMDB read needs a libuv worker thread to run, so any
|
|
118
|
+
// slot beyond the pool size would sit idle while still consuming a semaphore + reader-table
|
|
119
|
+
// entry per session.
|
|
120
|
+
const store = await openEphemeralStore('txe-session', undefined, 2);
|
|
77
121
|
const addressStore = new AddressStore(store);
|
|
78
122
|
const privateEventStore = new PrivateEventStore(store);
|
|
79
123
|
const noteStore = new NoteStore(store);
|
|
@@ -83,7 +127,6 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
83
127
|
const capsuleStore = new CapsuleStore(store);
|
|
84
128
|
const keyStore = new KeyStore(store);
|
|
85
129
|
const accountStore = new TXEAccountStore(store);
|
|
86
|
-
// Create job coordinator and register staged stores
|
|
87
130
|
const jobCoordinator = new JobCoordinator(store);
|
|
88
131
|
jobCoordinator.registerStores([
|
|
89
132
|
capsuleStore,
|
|
@@ -100,10 +143,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
100
143
|
const chainId = new Fr(await stateMachine.node.getChainId());
|
|
101
144
|
const initialJobId = jobCoordinator.beginJob();
|
|
102
145
|
const logger = createLogger('txe:session');
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
146
|
+
const topLevelOracleHandler = new TXEOracleTopLevelContext(stateMachine, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, nextBlockTimestamp, version, chainId, new Map(), artifactResolver, rootPath, packageName);
|
|
147
|
+
await topLevelOracleHandler.mineDeploymentNullifiers([
|
|
148
|
+
STANDARD_AUTH_REGISTRY_ADDRESS
|
|
149
|
+
]);
|
|
150
|
+
return new TXESession(logger, store, stateMachine, topLevelOracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, initialJobId, version, chainId, nextBlockTimestamp, artifactResolver, rootPath, packageName);
|
|
107
151
|
}
|
|
108
152
|
/**
|
|
109
153
|
* Processes an oracle function invoked by the Noir test associated to this session.
|
|
@@ -118,7 +162,15 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
118
162
|
return translator[validatedFunctionName](...inputs);
|
|
119
163
|
} catch (error) {
|
|
120
164
|
if (error instanceof z.ZodError) {
|
|
121
|
-
|
|
165
|
+
let versionHint;
|
|
166
|
+
if (!this.txeOracleVersion) {
|
|
167
|
+
versionHint = ' The test appears to use an older version of Aztec.nr that does not' + ' support test environment oracle versioning. Update Aztec.nr to a compatible version.' + ' See https://docs.aztec.network/errors/12';
|
|
168
|
+
} else if (this.txeOracleVersion.minor > TXE_ORACLE_VERSION_MINOR) {
|
|
169
|
+
versionHint = ` The test uses Aztec.nr test oracle version` + ` ${this.txeOracleVersion.major}.${this.txeOracleVersion.minor}, but this test environment` + ` only supports up to ${TXE_ORACLE_VERSION_MAJOR}.${TXE_ORACLE_VERSION_MINOR}.` + ` Upgrade the Aztec CLI to a compatible version.` + ` See https://docs.aztec.network/errors/12`;
|
|
170
|
+
} else {
|
|
171
|
+
versionHint = ` The test's oracle version (${this.txeOracleVersion.major}.${this.txeOracleVersion.minor})` + ` is compatible with this test environment` + ` (${TXE_ORACLE_VERSION_MAJOR}.${TXE_ORACLE_VERSION_MINOR}), so this oracle should be` + ` available. This is an unexpected error, please report it.` + ` See https://docs.aztec.network/errors/13`;
|
|
172
|
+
}
|
|
173
|
+
throw new Error(`Unknown oracle '${functionName}'.${versionHint}`);
|
|
122
174
|
} else if (error instanceof Error) {
|
|
123
175
|
throw new Error(`Execution error while processing function ${functionName} in state ${this.state.name}: ${error.message}`);
|
|
124
176
|
} else {
|
|
@@ -134,6 +186,60 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
134
186
|
this.currentJobId = this.jobCoordinator.beginJob();
|
|
135
187
|
return this.currentJobId;
|
|
136
188
|
}
|
|
189
|
+
resetLastCall() {
|
|
190
|
+
const notQueriedMessageCount = this.lastCallInfo.queried ? 0 : this.lastCallInfo.offchainEffects.filter((payload)=>payload[0]?.equals(OFFCHAIN_MESSAGE_IDENTIFIER)).length;
|
|
191
|
+
if (notQueriedMessageCount > 0) {
|
|
192
|
+
this.logger.warn(`Dropping ${notQueriedMessageCount} unqueried offchain message(s) from the previous top-level call. ` + `To deliver them, call \`env.offchain_messages()\` and forward the result to the recipient contract's ` + `\`offchain_receive\` utility before issuing another top-level call. To intentionally discard, assign ` + `to \`let _ = env.offchain_messages()\` to silence this warning.`);
|
|
193
|
+
}
|
|
194
|
+
this.lastCallInfo = emptyLastCallState();
|
|
195
|
+
}
|
|
196
|
+
recordOffchainEffect(data) {
|
|
197
|
+
this.lastCallInfo.offchainEffects.push(data);
|
|
198
|
+
}
|
|
199
|
+
setLastCallContext(txHash, anchorBlockTimestamp) {
|
|
200
|
+
this.lastCallInfo.txHash = txHash;
|
|
201
|
+
this.lastCallInfo.anchorBlockTimestamp = anchorBlockTimestamp;
|
|
202
|
+
}
|
|
203
|
+
async withTopLevelCallTracking(work) {
|
|
204
|
+
this.resetLastCall();
|
|
205
|
+
// Capture the anchor *before* `work` runs: private/public executor calls mine a new block as a
|
|
206
|
+
// side effect, and that block's timestamp should not be attributed to this call's anchor.
|
|
207
|
+
const anchorBlockTimestamp = (await this.stateMachine.node.getBlockData('latest')).header.globalVariables.timestamp;
|
|
208
|
+
const { result, txHash } = await work();
|
|
209
|
+
this.setLastCallContext(txHash ?? Fr.ZERO, anchorBlockTimestamp);
|
|
210
|
+
return result;
|
|
211
|
+
}
|
|
212
|
+
getLastCallOffchainEffects() {
|
|
213
|
+
this.lastCallInfo.queried = true;
|
|
214
|
+
const effects = this.lastCallInfo.offchainEffects;
|
|
215
|
+
if (effects.length > MAX_OFFCHAIN_EFFECTS_PER_TXE_QUERY) {
|
|
216
|
+
throw new Error(`${effects.length} offchain effects exceed max ${MAX_OFFCHAIN_EFFECTS_PER_TXE_QUERY}`);
|
|
217
|
+
}
|
|
218
|
+
if (effects.some((e)=>e.length > MAX_OFFCHAIN_EFFECT_LEN)) {
|
|
219
|
+
throw new Error(`Some offchain effect has length larger than max ${MAX_OFFCHAIN_EFFECT_LEN}`);
|
|
220
|
+
}
|
|
221
|
+
return {
|
|
222
|
+
effects
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
getLastCallContext() {
|
|
226
|
+
const { txHash, anchorBlockTimestamp } = this.lastCallInfo;
|
|
227
|
+
return {
|
|
228
|
+
txHash,
|
|
229
|
+
anchorBlockTimestamp
|
|
230
|
+
};
|
|
231
|
+
}
|
|
232
|
+
setTxeOracleVersion(major, minor) {
|
|
233
|
+
if (major !== TXE_ORACLE_VERSION_MAJOR) {
|
|
234
|
+
const hint = major > TXE_ORACLE_VERSION_MAJOR ? 'The test was compiled with a newer version of Aztec.nr than your test environment supports. Upgrade your test environment to a compatible version.' : 'The test was compiled with an older version of Aztec.nr than your test environment supports. Recompile the test with a compatible version of Aztec.nr.';
|
|
235
|
+
throw new Error(`Incompatible test environment version: ${hint} See https://docs.aztec.network/errors/12 (expected test oracle major version ${TXE_ORACLE_VERSION_MAJOR}, got ${major})`);
|
|
236
|
+
}
|
|
237
|
+
this.txeOracleVersion = {
|
|
238
|
+
major,
|
|
239
|
+
minor
|
|
240
|
+
};
|
|
241
|
+
this.logger.debug(`Test compiled with test oracle version ${major}.${minor}`);
|
|
242
|
+
}
|
|
137
243
|
async enterTopLevelState() {
|
|
138
244
|
switch(this.state.name){
|
|
139
245
|
case 'PRIVATE':
|
|
@@ -162,20 +268,23 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
162
268
|
}
|
|
163
269
|
// Commit all staged stores from the job that was just completed, then begin a new job
|
|
164
270
|
await this.cycleJob();
|
|
165
|
-
this.oracleHandler = new TXEOracleTopLevelContext(this.stateMachine, this.contractStore, this.noteStore, this.keyStore, this.addressStore, this.accountStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.nextBlockTimestamp, this.version, this.chainId, this.authwits, this.
|
|
271
|
+
this.oracleHandler = new TXEOracleTopLevelContext(this.stateMachine, this.contractStore, this.noteStore, this.keyStore, this.addressStore, this.accountStore, this.senderTaggingStore, this.recipientTaggingStore, this.senderAddressBookStore, this.capsuleStore, this.privateEventStore, this.nextBlockTimestamp, this.version, this.chainId, this.authwits, this.artifactResolver, this.rootPath, this.packageName);
|
|
166
272
|
this.state = {
|
|
167
273
|
name: 'TOP_LEVEL'
|
|
168
274
|
};
|
|
169
275
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
170
276
|
}
|
|
171
|
-
async enterPrivateState(
|
|
277
|
+
async enterPrivateState(contractAddressOpt, anchorBlockNumberOpt, gasSettings) {
|
|
278
|
+
const contractAddress = contractAddressOpt?.value ?? DEFAULT_ADDRESS;
|
|
279
|
+
const anchorBlockNumber = anchorBlockNumberOpt?.value;
|
|
172
280
|
this.exitTopLevelState();
|
|
281
|
+
this.resetLastCall();
|
|
173
282
|
// Private execution has two associated block numbers: the anchor block (i.e. the historical block that is used to
|
|
174
283
|
// build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
|
|
175
284
|
// a single transaction with the effects of what was done in the test.
|
|
176
|
-
const anchorBlock = await this.stateMachine.node.
|
|
285
|
+
const anchorBlock = await this.stateMachine.node.getBlock(anchorBlockNumber ?? 'latest').then((b)=>b?.header);
|
|
177
286
|
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
178
|
-
const latestBlock = await this.stateMachine.node.
|
|
287
|
+
const latestBlock = await this.stateMachine.node.getBlock('latest').then((b)=>b?.header);
|
|
179
288
|
const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
|
|
180
289
|
blockNumber: BlockNumber(latestBlock.globalVariables.blockNumber + 1),
|
|
181
290
|
timestamp: this.nextBlockTimestamp,
|
|
@@ -187,9 +296,9 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
187
296
|
const noteCache = new ExecutionNoteCache(protocolNullifier);
|
|
188
297
|
const taggingIndexCache = new ExecutionTaggingIndexCache();
|
|
189
298
|
const utilityExecutor = this.utilityExecutorForContractSync(anchorBlock);
|
|
190
|
-
this.oracleHandler = new
|
|
299
|
+
this.oracleHandler = new TXEPrivateExecutionOracle({
|
|
191
300
|
argsHash: Fr.ZERO,
|
|
192
|
-
txContext: new TxContext(this.chainId, this.version,
|
|
301
|
+
txContext: new TxContext(this.chainId, this.version, gasSettings),
|
|
193
302
|
callContext: new CallContext(AztecAddress.ZERO, contractAddress, FunctionSelector.empty(), false),
|
|
194
303
|
anchorBlockHeader: anchorBlock,
|
|
195
304
|
utilityExecutor,
|
|
@@ -209,10 +318,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
209
318
|
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
210
319
|
privateEventStore: this.privateEventStore,
|
|
211
320
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
212
|
-
l2TipsStore: this.stateMachine.
|
|
321
|
+
l2TipsStore: this.stateMachine.l2TipsProvider,
|
|
213
322
|
jobId: this.currentJobId,
|
|
214
323
|
scopes: await this.keyStore.getAccounts(),
|
|
215
|
-
messageContextService: this.stateMachine.messageContextService
|
|
324
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
325
|
+
simulator: new WASMSimulator()
|
|
216
326
|
});
|
|
217
327
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
218
328
|
// data) in order to refer to it later, mimicking the way this object is used by the ContractFunctionSimulator. The
|
|
@@ -226,27 +336,36 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
226
336
|
taggingIndexCache
|
|
227
337
|
};
|
|
228
338
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
339
|
+
// Record the *resolved* anchor's timestamp — if the caller pinned the anchor to a past block
|
|
340
|
+
// via `anchorBlockNumber`, "latest" would be the wrong anchor for offchain-message semantics.
|
|
341
|
+
this.setLastCallContext(Fr.ZERO, anchorBlock.globalVariables.timestamp);
|
|
229
342
|
return this.oracleHandler.getPrivateContextInputs();
|
|
230
343
|
}
|
|
231
|
-
async enterPublicState(
|
|
344
|
+
async enterPublicState(contractAddressOpt) {
|
|
345
|
+
const contractAddress = contractAddressOpt?.value ?? DEFAULT_ADDRESS;
|
|
232
346
|
this.exitTopLevelState();
|
|
347
|
+
this.resetLastCall();
|
|
233
348
|
// The PublicContext will create a block with a single transaction in it, containing the effects of what was done in
|
|
234
349
|
// the test. The block therefore gets the *next* block number and timestamp.
|
|
235
|
-
const
|
|
350
|
+
const latestHeader = (await this.stateMachine.node.getBlockData('latest')).header;
|
|
236
351
|
const globalVariables = makeGlobalVariables(undefined, {
|
|
237
|
-
blockNumber: BlockNumber(
|
|
352
|
+
blockNumber: BlockNumber(latestHeader.globalVariables.blockNumber + 1),
|
|
238
353
|
timestamp: this.nextBlockTimestamp,
|
|
239
354
|
version: this.version,
|
|
240
355
|
chainId: this.chainId
|
|
241
356
|
});
|
|
242
|
-
this.oracleHandler = new TXEOraclePublicContext(contractAddress
|
|
357
|
+
this.oracleHandler = new TXEOraclePublicContext(contractAddress, await this.stateMachine.synchronizer.nativeWorldStateService.fork(), getSingleTxBlockRequestHash(globalVariables.blockNumber), globalVariables, this.contractStore);
|
|
243
358
|
this.state = {
|
|
244
359
|
name: 'PUBLIC'
|
|
245
360
|
};
|
|
246
361
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
362
|
+
// Public state is anchored at the latest block.
|
|
363
|
+
this.setLastCallContext(Fr.ZERO, latestHeader.globalVariables.timestamp);
|
|
247
364
|
}
|
|
248
|
-
async enterUtilityState(
|
|
365
|
+
async enterUtilityState(contractAddressOpt) {
|
|
366
|
+
const contractAddress = contractAddressOpt?.value ?? DEFAULT_ADDRESS;
|
|
249
367
|
this.exitTopLevelState();
|
|
368
|
+
this.resetLastCall();
|
|
250
369
|
const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
251
370
|
// There is no automatic message discovery and contract-driven syncing process in inlined private or utility
|
|
252
371
|
// contexts, which means that known nullifiers are also not searched for, since it is during the tagging sync that
|
|
@@ -269,15 +388,19 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
269
388
|
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
270
389
|
privateEventStore: this.privateEventStore,
|
|
271
390
|
messageContextService: this.stateMachine.messageContextService,
|
|
272
|
-
contractSyncService: this.contractSyncService,
|
|
273
|
-
l2TipsStore: this.stateMachine.
|
|
391
|
+
contractSyncService: this.stateMachine.contractSyncService,
|
|
392
|
+
l2TipsStore: this.stateMachine.l2TipsProvider,
|
|
274
393
|
jobId: this.currentJobId,
|
|
275
|
-
scopes: await this.keyStore.getAccounts()
|
|
394
|
+
scopes: await this.keyStore.getAccounts(),
|
|
395
|
+
simulator: new WASMSimulator(),
|
|
396
|
+
utilityExecutor: this.utilityExecutorForContractSync(anchorBlockHeader)
|
|
276
397
|
});
|
|
277
398
|
this.state = {
|
|
278
399
|
name: 'UTILITY'
|
|
279
400
|
};
|
|
280
401
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
402
|
+
// Utility state anchors at whatever the anchor block store is pointing to (tracked as latest).
|
|
403
|
+
this.setLastCallContext(Fr.ZERO, anchorBlockHeader.globalVariables.timestamp);
|
|
281
404
|
}
|
|
282
405
|
exitTopLevelState() {
|
|
283
406
|
if (this.state.name != 'TOP_LEVEL') {
|
|
@@ -336,6 +459,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
336
459
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
337
460
|
}
|
|
338
461
|
try {
|
|
462
|
+
const simulator = new WASMSimulator();
|
|
339
463
|
const oracle = new UtilityExecutionOracle({
|
|
340
464
|
contractAddress: call.to,
|
|
341
465
|
authWitnesses: [],
|
|
@@ -351,12 +475,14 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
351
475
|
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
352
476
|
privateEventStore: this.privateEventStore,
|
|
353
477
|
messageContextService: this.stateMachine.messageContextService,
|
|
354
|
-
contractSyncService: this.contractSyncService,
|
|
355
|
-
l2TipsStore: this.stateMachine.
|
|
478
|
+
contractSyncService: this.stateMachine.contractSyncService,
|
|
479
|
+
l2TipsStore: this.stateMachine.l2TipsProvider,
|
|
356
480
|
jobId: this.currentJobId,
|
|
357
|
-
scopes
|
|
481
|
+
scopes,
|
|
482
|
+
simulator,
|
|
483
|
+
utilityExecutor: this.utilityExecutorForContractSync(anchorBlock)
|
|
358
484
|
});
|
|
359
|
-
await
|
|
485
|
+
await simulator.executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact, new Oracle(oracle).toACIRCallback()).catch((err)=>{
|
|
360
486
|
err.message = resolveAssertionMessageFromError(err, entryPointArtifact);
|
|
361
487
|
throw new ExecutionError(err.message, {
|
|
362
488
|
contractAddress: call.to,
|