@aztec/txe 0.0.1-commit.993d240 → 0.0.1-commit.9a89641
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/AuthRegistry-QVGDDH5X.js +3 -0
- package/dest/AuthRegistry-QVGDDH5X.js.map +7 -0
- package/dest/ContractClassRegistry-PVNCKGG7.js +3 -0
- package/dest/ContractClassRegistry-PVNCKGG7.js.map +7 -0
- package/dest/ContractInstanceRegistry-WLOZKTR6.js +3 -0
- package/dest/ContractInstanceRegistry-WLOZKTR6.js.map +7 -0
- package/dest/FeeJuice-MAQJU53K.js +3 -0
- package/dest/FeeJuice-MAQJU53K.js.map +7 -0
- package/dest/HandshakeRegistry-GY5CPEPS.js +3 -0
- package/dest/HandshakeRegistry-GY5CPEPS.js.map +7 -0
- package/dest/MultiCallEntrypoint-QG5H33ZZ.js +3 -0
- package/dest/MultiCallEntrypoint-QG5H33ZZ.js.map +7 -0
- package/dest/SchnorrAccount-ADD65DYA.js +3 -0
- package/dest/SchnorrAccount-ADD65DYA.js.map +7 -0
- package/dest/SchnorrInitializerlessAccount-TWGKRUSY.js +3 -0
- package/dest/SchnorrInitializerlessAccount-TWGKRUSY.js.map +7 -0
- package/dest/bin/check_txe_oracle_version.js +9 -19
- package/dest/bin/index.js +1 -1
- 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-32UHX7YY.js +3 -0
- package/dest/{chunk-DF6RMOC6.js → chunk-RVEPNDEP.js} +2 -2
- package/dest/{chunk-DF6RMOC6.js.map → chunk-RVEPNDEP.js.map} +3 -3
- package/dest/chunk-XWIMXLKD.js +258 -0
- package/dest/chunk-XWIMXLKD.js.map +7 -0
- package/dest/constants.d.ts +3 -1
- package/dest/constants.d.ts.map +1 -1
- package/dest/constants.js +5 -2
- package/dest/dispatcher_pool.d.ts +2 -2
- package/dest/dispatcher_pool.d.ts.map +1 -1
- package/dest/dispatcher_pool.js +5 -3
- package/dest/index.d.ts +6 -143
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +12 -169
- package/dest/metafile.json +10267 -9581
- package/dest/oracle/interfaces.d.ts +38 -11
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/tagging_secret_strategy.d.ts +12 -0
- package/dest/oracle/tagging_secret_strategy.d.ts.map +1 -0
- package/dest/oracle/tagging_secret_strategy.js +12 -0
- package/dest/oracle/test-resolver/default_fixtures.d.ts +16 -0
- package/dest/oracle/test-resolver/default_fixtures.d.ts.map +1 -0
- package/dest/oracle/test-resolver/default_fixtures.js +200 -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 +32 -0
- package/dest/oracle/test-resolver/resolver.d.ts +48 -0
- package/dest/oracle/test-resolver/resolver.d.ts.map +1 -0
- package/dest/oracle/test-resolver/resolver.js +181 -0
- package/dest/oracle/txe_oracle_public_context.d.ts +25 -6
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +34 -1
- package/dest/oracle/txe_oracle_registry.d.ts +172 -0
- package/dest/oracle/txe_oracle_registry.d.ts.map +1 -0
- package/dest/oracle/txe_oracle_registry.js +767 -0
- package/dest/oracle/txe_oracle_top_level_context.d.ts +39 -14
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +489 -289
- package/dest/{txe_oracle_version.d.ts → oracle/txe_oracle_version.d.ts} +5 -5
- package/dest/oracle/txe_oracle_version.d.ts.map +1 -0
- package/dest/{txe_oracle_version.js → oracle/txe_oracle_version.js} +4 -4
- package/dest/rpc_translator.d.ts +116 -284
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +809 -860
- package/dest/server.bundle.js +1 -1
- package/dest/state_machine/archiver.d.ts +3 -2
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +9 -3
- package/dest/state_machine/dummy_p2p_client.d.ts +5 -2
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +9 -0
- package/dest/state_machine/global_variable_builder.d.ts +3 -4
- package/dest/state_machine/global_variable_builder.d.ts.map +1 -1
- package/dest/state_machine/global_variable_builder.js +0 -3
- package/dest/state_machine/index.d.ts +8 -6
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +41 -19
- package/dest/state_machine/mock_epoch_cache.d.ts +2 -3
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +3 -6
- package/dest/state_machine/synchronizer.d.ts +10 -2
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/state_machine/synchronizer.js +18 -5
- package/dest/txe_session.d.ts +43 -28
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +183 -47
- package/dest/utils/block_creation.d.ts +2 -2
- package/dest/utils/block_creation.d.ts.map +1 -1
- package/dest/utils/block_creation.js +2 -2
- package/dest/utils/encoding.d.ts +8 -5
- package/dest/utils/encoding.d.ts.map +1 -1
- package/dest/utils/tx_effect_creation.d.ts +1 -1
- package/dest/utils/tx_effect_creation.d.ts.map +1 -1
- package/dest/utils/tx_effect_creation.js +0 -1
- 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 +1 -1
- package/dest/utils/txe_public_contract_data_source.d.ts.map +1 -1
- package/dest/utils/txe_public_contract_data_source.js +7 -4
- package/dest/worker.bundle.js +1 -1
- package/package.json +18 -17
- package/src/bin/check_txe_oracle_version.ts +11 -17
- package/src/bin/oracle_test_server.ts +51 -0
- package/src/constants.ts +6 -2
- package/src/dispatcher_pool.ts +4 -3
- package/src/index.ts +21 -198
- package/src/oracle/interfaces.ts +35 -9
- package/src/oracle/tagging_secret_strategy.ts +25 -0
- package/src/oracle/test-resolver/default_fixtures.ts +271 -0
- package/src/oracle/test-resolver/index.ts +44 -0
- package/src/oracle/test-resolver/resolver.ts +245 -0
- package/src/oracle/txe_oracle_public_context.ts +36 -4
- package/src/oracle/txe_oracle_registry.ts +556 -0
- package/src/oracle/txe_oracle_top_level_context.ts +249 -66
- package/src/{txe_oracle_version.ts → oracle/txe_oracle_version.ts} +4 -4
- package/src/rpc_translator.ts +850 -1065
- package/src/state_machine/archiver.ts +9 -3
- package/src/state_machine/dummy_p2p_client.ts +13 -0
- package/src/state_machine/global_variable_builder.ts +2 -16
- package/src/state_machine/index.ts +50 -34
- package/src/state_machine/mock_epoch_cache.ts +4 -8
- package/src/state_machine/synchronizer.ts +26 -5
- package/src/txe_session.ts +325 -56
- package/src/utils/block_creation.ts +2 -1
- package/src/utils/tx_effect_creation.ts +0 -2
- package/src/utils/txe_artifact_resolver.ts +217 -0
- package/src/utils/txe_public_contract_data_source.ts +6 -4
- package/dest/ContractClassRegistry-KKNT527R.js +0 -3
- package/dest/ContractClassRegistry-KKNT527R.js.map +0 -7
- package/dest/ContractInstanceRegistry-GSKBNL3Q.js +0 -3
- package/dest/ContractInstanceRegistry-GSKBNL3Q.js.map +0 -7
- package/dest/FeeJuice-GUJ5O6GB.js +0 -3
- package/dest/FeeJuice-GUJ5O6GB.js.map +0 -7
- package/dest/MultiCallEntrypoint-ZQPCKVKL.js +0 -3
- package/dest/MultiCallEntrypoint-ZQPCKVKL.js.map +0 -7
- package/dest/SchnorrAccount-QIXE5DXA.js +0 -3
- package/dest/SchnorrAccount-QIXE5DXA.js.map +0 -7
- package/dest/chunk-BJVAAXNA.js +0 -3
- package/dest/chunk-PPJTNNUG.js +0 -265
- package/dest/chunk-PPJTNNUG.js.map +0 -7
- package/dest/txe_oracle_version.d.ts.map +0 -1
- /package/dest/{chunk-BJVAAXNA.js.map → chunk-32UHX7YY.js.map} +0 -0
package/dest/txe_session.js
CHANGED
|
@@ -3,8 +3,8 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
3
3
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
4
|
import { KeyStore } from '@aztec/key-store';
|
|
5
5
|
import { openEphemeralStore } from '@aztec/kv-store/lmdb-v2';
|
|
6
|
-
import { AddressStore, AnchorBlockStore, CapsuleService, CapsuleStore, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore,
|
|
7
|
-
import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache,
|
|
6
|
+
import { AddressStore, AnchorBlockStore, AnchoredContractData, CapsuleService, CapsuleStore, FactService, FactStore, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderTaggingStore, TaggingSecretSourcesStore, composeHooks } from '@aztec/pxe/server';
|
|
7
|
+
import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache, LEGACY_ORACLE_REGISTRY, TransientArrayService, UtilityExecutionOracle, buildACIRCallback } from '@aztec/pxe/simulator';
|
|
8
8
|
import { ExecutionError, WASMSimulator, createSimulationError, extractCallStack, resolveAssertionMessageFromError, toACVMWitness } from '@aztec/simulator/client';
|
|
9
9
|
import { STANDARD_AUTH_REGISTRY_ADDRESS } from '@aztec/standard-contracts/auth-registry/constants';
|
|
10
10
|
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
@@ -14,13 +14,15 @@ import { makeGlobalVariables } from '@aztec/stdlib/testing';
|
|
|
14
14
|
import { CallContext, OFFCHAIN_MESSAGE_IDENTIFIER, TxContext } from '@aztec/stdlib/tx';
|
|
15
15
|
import { z } from 'zod';
|
|
16
16
|
import { DEFAULT_ADDRESS, MAX_OFFCHAIN_EFFECTS_PER_TXE_QUERY, MAX_OFFCHAIN_EFFECT_LEN } from './constants.js';
|
|
17
|
+
import { makeResolveTaggingSecretStrategyHook } from './oracle/tagging_secret_strategy.js';
|
|
17
18
|
import { TXEOraclePublicContext } from './oracle/txe_oracle_public_context.js';
|
|
18
|
-
import {
|
|
19
|
+
import { callTxeLegacyHandler } from './oracle/txe_oracle_registry.js';
|
|
20
|
+
import { TXEOracleTopLevelContext, authorizeAllUtilityCallsHook } from './oracle/txe_oracle_top_level_context.js';
|
|
21
|
+
import { TXE_ORACLE_VERSION_MAJOR, TXE_ORACLE_VERSION_MINOR } from './oracle/txe_oracle_version.js';
|
|
19
22
|
import { TXEPrivateExecutionOracle } from './oracle/txe_private_execution_oracle.js';
|
|
20
|
-
import { RPCTranslator } from './rpc_translator.js';
|
|
23
|
+
import { RPCTranslator, UnavailableOracleError } from './rpc_translator.js';
|
|
21
24
|
import { TXEArchiver } from './state_machine/archiver.js';
|
|
22
25
|
import { TXEStateMachine } from './state_machine/index.js';
|
|
23
|
-
import { TXE_ORACLE_VERSION_MAJOR, TXE_ORACLE_VERSION_MINOR } from './txe_oracle_version.js';
|
|
24
26
|
import { getSingleTxBlockRequestHash, insertTxEffectIntoWorldTrees, makeTXEBlock } from './utils/block_creation.js';
|
|
25
27
|
import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
26
28
|
import { TXEAccountStore } from './utils/txe_account_store.js';
|
|
@@ -47,20 +49,26 @@ function emptyLastCallState() {
|
|
|
47
49
|
accountStore;
|
|
48
50
|
senderTaggingStore;
|
|
49
51
|
recipientTaggingStore;
|
|
50
|
-
|
|
52
|
+
taggingSecretSourcesStore;
|
|
51
53
|
capsuleStore;
|
|
54
|
+
factStore;
|
|
52
55
|
privateEventStore;
|
|
53
56
|
jobCoordinator;
|
|
54
57
|
currentJobId;
|
|
55
58
|
chainId;
|
|
56
59
|
version;
|
|
57
60
|
nextBlockTimestamp;
|
|
61
|
+
artifactResolver;
|
|
62
|
+
rootPath;
|
|
63
|
+
packageName;
|
|
58
64
|
state;
|
|
59
65
|
authwits;
|
|
66
|
+
taggingSecretStrategies;
|
|
67
|
+
authorizeAllUtilityCallTargets;
|
|
60
68
|
lastCallInfo;
|
|
61
69
|
txeOracleVersion;
|
|
62
70
|
disposed;
|
|
63
|
-
constructor(logger, sessionStore, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore,
|
|
71
|
+
constructor(logger, sessionStore, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, taggingSecretSourcesStore, capsuleStore, factStore, privateEventStore, jobCoordinator, currentJobId, chainId, version, nextBlockTimestamp, artifactResolver, rootPath, packageName){
|
|
64
72
|
this.logger = logger;
|
|
65
73
|
this.sessionStore = sessionStore;
|
|
66
74
|
this.stateMachine = stateMachine;
|
|
@@ -72,29 +80,43 @@ function emptyLastCallState() {
|
|
|
72
80
|
this.accountStore = accountStore;
|
|
73
81
|
this.senderTaggingStore = senderTaggingStore;
|
|
74
82
|
this.recipientTaggingStore = recipientTaggingStore;
|
|
75
|
-
this.
|
|
83
|
+
this.taggingSecretSourcesStore = taggingSecretSourcesStore;
|
|
76
84
|
this.capsuleStore = capsuleStore;
|
|
85
|
+
this.factStore = factStore;
|
|
77
86
|
this.privateEventStore = privateEventStore;
|
|
78
87
|
this.jobCoordinator = jobCoordinator;
|
|
79
88
|
this.currentJobId = currentJobId;
|
|
80
89
|
this.chainId = chainId;
|
|
81
90
|
this.version = version;
|
|
82
91
|
this.nextBlockTimestamp = nextBlockTimestamp;
|
|
92
|
+
this.artifactResolver = artifactResolver;
|
|
93
|
+
this.rootPath = rootPath;
|
|
94
|
+
this.packageName = packageName;
|
|
83
95
|
this.state = {
|
|
84
96
|
name: 'TOP_LEVEL'
|
|
85
97
|
};
|
|
86
98
|
this.authwits = new Map();
|
|
99
|
+
this.taggingSecretStrategies = new Map();
|
|
100
|
+
this.authorizeAllUtilityCallTargets = false;
|
|
87
101
|
this.lastCallInfo = emptyLastCallState();
|
|
88
102
|
this.disposed = false;
|
|
89
103
|
}
|
|
90
104
|
/**
|
|
91
|
-
*
|
|
92
|
-
* Called via IPC when the dispatcher detects the end of a test. Idempotent.
|
|
105
|
+
* Tears down the per-session AVM simulator (process pool + CDB server), the `NativeWorldStateService`,
|
|
106
|
+
* and the `txe-session` LMDB. Called via IPC when the dispatcher detects the end of a test. Idempotent.
|
|
93
107
|
*/ async dispose() {
|
|
94
108
|
if (this.disposed) {
|
|
95
109
|
return;
|
|
96
110
|
}
|
|
97
111
|
this.disposed = true;
|
|
112
|
+
// Dispose the AVM pool before the world state: it kills the bb-avm-sim processes so they release their
|
|
113
|
+
// connection to the WSDB server, letting it shut down cleanly. Skipping this leaks a bb-avm-sim process
|
|
114
|
+
// (and keeps its WSDB alive) per session.
|
|
115
|
+
try {
|
|
116
|
+
await this.stateMachine.synchronizer.closeIpc();
|
|
117
|
+
} catch (err) {
|
|
118
|
+
this.logger.warn(`Error closing AVM simulator during session dispose`, err);
|
|
119
|
+
}
|
|
98
120
|
try {
|
|
99
121
|
await this.stateMachine.synchronizer.nativeWorldStateService.close();
|
|
100
122
|
} catch (err) {
|
|
@@ -106,7 +128,7 @@ function emptyLastCallState() {
|
|
|
106
128
|
this.logger.warn(`Error closing session LMDB during dispose`, err);
|
|
107
129
|
}
|
|
108
130
|
}
|
|
109
|
-
static async init(contractStore) {
|
|
131
|
+
static async init(contractStore, artifactResolver, rootPath, packageName) {
|
|
110
132
|
// Size LMDB's reader slots to the libuv pool (capped to 2 in bin/index.ts via
|
|
111
133
|
// HARDWARE_CONCURRENCY): each native LMDB read needs a libuv worker thread to run, so any
|
|
112
134
|
// slot beyond the pool size would sit idle while still consuming a semaphore + reader-table
|
|
@@ -117,13 +139,15 @@ function emptyLastCallState() {
|
|
|
117
139
|
const noteStore = new NoteStore(store);
|
|
118
140
|
const senderTaggingStore = new SenderTaggingStore(store);
|
|
119
141
|
const recipientTaggingStore = new RecipientTaggingStore(store);
|
|
120
|
-
const
|
|
142
|
+
const taggingSecretSourcesStore = new TaggingSecretSourcesStore(store);
|
|
121
143
|
const capsuleStore = new CapsuleStore(store);
|
|
144
|
+
const factStore = new FactStore(store);
|
|
122
145
|
const keyStore = new KeyStore(store);
|
|
123
146
|
const accountStore = new TXEAccountStore(store);
|
|
124
147
|
const jobCoordinator = new JobCoordinator(store);
|
|
125
148
|
jobCoordinator.registerStores([
|
|
126
149
|
capsuleStore,
|
|
150
|
+
factStore,
|
|
127
151
|
senderTaggingStore,
|
|
128
152
|
recipientTaggingStore,
|
|
129
153
|
privateEventStore,
|
|
@@ -137,11 +161,11 @@ function emptyLastCallState() {
|
|
|
137
161
|
const chainId = new Fr(await stateMachine.node.getChainId());
|
|
138
162
|
const initialJobId = jobCoordinator.beginJob();
|
|
139
163
|
const logger = createLogger('txe:session');
|
|
140
|
-
const topLevelOracleHandler = new TXEOracleTopLevelContext(stateMachine, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore,
|
|
164
|
+
const topLevelOracleHandler = new TXEOracleTopLevelContext(stateMachine, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, taggingSecretSourcesStore, capsuleStore, factStore, privateEventStore, nextBlockTimestamp, version, chainId, new Map(), new Map(), false, artifactResolver, rootPath, packageName);
|
|
141
165
|
await topLevelOracleHandler.mineDeploymentNullifiers([
|
|
142
166
|
STANDARD_AUTH_REGISTRY_ADDRESS
|
|
143
167
|
]);
|
|
144
|
-
return new TXESession(logger, store, stateMachine, topLevelOracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore,
|
|
168
|
+
return new TXESession(logger, store, stateMachine, topLevelOracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, taggingSecretSourcesStore, capsuleStore, factStore, privateEventStore, jobCoordinator, initialJobId, version, chainId, nextBlockTimestamp, artifactResolver, rootPath, packageName);
|
|
145
169
|
}
|
|
146
170
|
/**
|
|
147
171
|
* Processes an oracle function invoked by the Noir test associated to this session.
|
|
@@ -150,6 +174,13 @@ function emptyLastCallState() {
|
|
|
150
174
|
* @returns The oracle return values.
|
|
151
175
|
*/ processFunction(functionName, inputs) {
|
|
152
176
|
try {
|
|
177
|
+
// Oracles retired into the PXE legacy registry have no translator method; dispatch them through the same
|
|
178
|
+
// buildACIRCallback legacy path that contract execution uses, keeping TXE's two oracle paths in sync.
|
|
179
|
+
// Use an own-property check: `in` would match inherited `Object.prototype` keys (e.g. `constructor`), routing
|
|
180
|
+
// them into the legacy path instead of letting them fall through to the unknown-oracle error.
|
|
181
|
+
if (Object.hasOwn(LEGACY_ORACLE_REGISTRY, functionName)) {
|
|
182
|
+
return callTxeLegacyHandler(functionName, inputs, this.oracleHandler);
|
|
183
|
+
}
|
|
153
184
|
const translator = new RPCTranslator(this, this.oracleHandler);
|
|
154
185
|
// We perform a runtime validation to check that the function name corresponds to a real oracle handler.
|
|
155
186
|
const validatedFunctionName = z.string().refine((fn)=>typeof translator[fn] === 'function' && !fn.startsWith('handlerAs') && fn !== 'constructor').parse(functionName);
|
|
@@ -172,9 +203,6 @@ function emptyLastCallState() {
|
|
|
172
203
|
}
|
|
173
204
|
}
|
|
174
205
|
}
|
|
175
|
-
getCurrentJob() {
|
|
176
|
-
return this.currentJobId;
|
|
177
|
-
}
|
|
178
206
|
/** Commits the current job and begins a new one. Returns the new job ID. */ async cycleJob() {
|
|
179
207
|
await this.jobCoordinator.commitJob(this.currentJobId);
|
|
180
208
|
this.currentJobId = this.jobCoordinator.beginJob();
|
|
@@ -223,6 +251,73 @@ function emptyLastCallState() {
|
|
|
223
251
|
anchorBlockTimestamp
|
|
224
252
|
};
|
|
225
253
|
}
|
|
254
|
+
async executePrivateCall(from, targetContractAddress, functionSelector, args, argsHash, isStaticCall, additionalScopes, authorizedUtilityCallTargets, gasSettings) {
|
|
255
|
+
const handler = this.handlerAsTxe();
|
|
256
|
+
return await this.withTopLevelCallTracking(async ()=>{
|
|
257
|
+
const { returnValues, offchainEffects } = await handler.privateCallNewFlow(from?.value, targetContractAddress, functionSelector, args, argsHash, isStaticCall, additionalScopes, this.currentJobId, authorizedUtilityCallTargets, gasSettings);
|
|
258
|
+
// Private execution collects offchain effects inside PXE's PrivateExecutionOracle rather than round-tripping
|
|
259
|
+
// them through `aztec_utl_emitOffchainEffect`, so the session buffer is empty at this point. Drain the effects
|
|
260
|
+
// from the execution tree into the session buffer so the next `env.offchain_messages()` call in the test sees
|
|
261
|
+
// them.
|
|
262
|
+
for (const data of offchainEffects){
|
|
263
|
+
this.recordOffchainEffect(data);
|
|
264
|
+
}
|
|
265
|
+
await this.cycleJob();
|
|
266
|
+
if (isStaticCall) {
|
|
267
|
+
// Static calls revert their checkpoint and mine no block, so there is no tx hash to tag offchain effects
|
|
268
|
+
// with. Querying `getLastTxEffects()` here would return an unrelated predecessor tx.
|
|
269
|
+
return {
|
|
270
|
+
result: returnValues
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
const { txHash } = await handler.getLastTxEffects();
|
|
274
|
+
return {
|
|
275
|
+
result: returnValues,
|
|
276
|
+
txHash: txHash.hash
|
|
277
|
+
};
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
async executeUtilityFunction(from, targetContractAddress, functionSelector, args, authorizedUtilityCallTargets) {
|
|
281
|
+
const handler = this.handlerAsTxe();
|
|
282
|
+
return await this.withTopLevelCallTracking(async ()=>{
|
|
283
|
+
const returnValues = await handler.executeUtilityFunction(from?.value, targetContractAddress, functionSelector, args, this.currentJobId, authorizedUtilityCallTargets);
|
|
284
|
+
await this.cycleJob();
|
|
285
|
+
return {
|
|
286
|
+
result: returnValues
|
|
287
|
+
};
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
async executePublicCall(from, targetContractAddress, calldata, isStaticCall, gasSettings) {
|
|
291
|
+
const handler = this.handlerAsTxe();
|
|
292
|
+
return await this.withTopLevelCallTracking(async ()=>{
|
|
293
|
+
const returnValues = await handler.publicCallNewFlow(from?.value, targetContractAddress, calldata, isStaticCall, gasSettings);
|
|
294
|
+
await this.cycleJob();
|
|
295
|
+
if (isStaticCall) {
|
|
296
|
+
// See the equivalent branch in `executePrivateCall`.
|
|
297
|
+
return {
|
|
298
|
+
result: returnValues
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
const { txHash } = await handler.getLastTxEffects();
|
|
302
|
+
return {
|
|
303
|
+
result: returnValues,
|
|
304
|
+
txHash: txHash.hash
|
|
305
|
+
};
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
async getPrivateEvents(selector, contractAddress, scope) {
|
|
309
|
+
const handler = this.handlerAsTxe();
|
|
310
|
+
await handler.syncContractNonOracleMethod(contractAddress, scope, this.currentJobId);
|
|
311
|
+
// Cycle the job to commit the stores after the contract sync.
|
|
312
|
+
await this.cycleJob();
|
|
313
|
+
return handler.getPrivateEvents(selector, contractAddress, scope);
|
|
314
|
+
}
|
|
315
|
+
handlerAsTxe() {
|
|
316
|
+
if (!('isTxe' in this.oracleHandler)) {
|
|
317
|
+
throw new UnavailableOracleError('Txe');
|
|
318
|
+
}
|
|
319
|
+
return this.oracleHandler;
|
|
320
|
+
}
|
|
226
321
|
setTxeOracleVersion(major, minor) {
|
|
227
322
|
if (major !== TXE_ORACLE_VERSION_MAJOR) {
|
|
228
323
|
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.';
|
|
@@ -262,13 +357,15 @@ function emptyLastCallState() {
|
|
|
262
357
|
}
|
|
263
358
|
// Commit all staged stores from the job that was just completed, then begin a new job
|
|
264
359
|
await this.cycleJob();
|
|
265
|
-
this.oracleHandler = new TXEOracleTopLevelContext(this.stateMachine, this.contractStore, this.noteStore, this.keyStore, this.addressStore, this.accountStore, this.senderTaggingStore, this.recipientTaggingStore, this.
|
|
360
|
+
this.oracleHandler = new TXEOracleTopLevelContext(this.stateMachine, this.contractStore, this.noteStore, this.keyStore, this.addressStore, this.accountStore, this.senderTaggingStore, this.recipientTaggingStore, this.taggingSecretSourcesStore, this.capsuleStore, this.factStore, this.privateEventStore, this.nextBlockTimestamp, this.version, this.chainId, this.authwits, this.taggingSecretStrategies, this.authorizeAllUtilityCallTargets, this.artifactResolver, this.rootPath, this.packageName);
|
|
266
361
|
this.state = {
|
|
267
362
|
name: 'TOP_LEVEL'
|
|
268
363
|
};
|
|
269
364
|
this.logger.debug(`Entered state ${this.state.name}`);
|
|
270
365
|
}
|
|
271
|
-
async enterPrivateState(
|
|
366
|
+
async enterPrivateState(contractAddressOpt, anchorBlockNumberOpt, gasSettings) {
|
|
367
|
+
const contractAddress = contractAddressOpt?.value ?? DEFAULT_ADDRESS;
|
|
368
|
+
const anchorBlockNumber = anchorBlockNumberOpt?.value;
|
|
272
369
|
this.exitTopLevelState();
|
|
273
370
|
this.resetLastCall();
|
|
274
371
|
// Private execution has two associated block numbers: the anchor block (i.e. the historical block that is used to
|
|
@@ -288,9 +385,12 @@ function emptyLastCallState() {
|
|
|
288
385
|
const noteCache = new ExecutionNoteCache(protocolNullifier);
|
|
289
386
|
const taggingIndexCache = new ExecutionTaggingIndexCache();
|
|
290
387
|
const utilityExecutor = this.utilityExecutorForContractSync(anchorBlock);
|
|
388
|
+
const transientArrayService = new TransientArrayService();
|
|
389
|
+
const anchoredContractData = new AnchoredContractData(this.contractStore, this.stateMachine.contractClassService, anchorBlock);
|
|
291
390
|
this.oracleHandler = new TXEPrivateExecutionOracle({
|
|
292
391
|
argsHash: Fr.ZERO,
|
|
293
392
|
txContext: new TxContext(this.chainId, this.version, gasSettings),
|
|
393
|
+
txRequestSalt: Fr.ZERO,
|
|
294
394
|
callContext: new CallContext(AztecAddress.ZERO, contractAddress, FunctionSelector.empty(), false),
|
|
295
395
|
anchorBlockHeader: anchorBlock,
|
|
296
396
|
utilityExecutor,
|
|
@@ -299,22 +399,25 @@ function emptyLastCallState() {
|
|
|
299
399
|
executionCache: new HashedValuesCache(),
|
|
300
400
|
noteCache,
|
|
301
401
|
taggingIndexCache,
|
|
302
|
-
|
|
402
|
+
anchoredContractData,
|
|
303
403
|
noteStore: this.noteStore,
|
|
304
404
|
keyStore: this.keyStore,
|
|
305
405
|
addressStore: this.addressStore,
|
|
306
406
|
aztecNode: this.stateMachine.node,
|
|
307
407
|
senderTaggingStore: this.senderTaggingStore,
|
|
308
408
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
309
|
-
|
|
409
|
+
taggingSecretSourcesStore: this.taggingSecretSourcesStore,
|
|
310
410
|
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
411
|
+
factService: new FactService(this.factStore, await this.keyStore.getAccounts()),
|
|
311
412
|
privateEventStore: this.privateEventStore,
|
|
312
413
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
313
414
|
l2TipsStore: this.stateMachine.l2TipsProvider,
|
|
314
415
|
jobId: this.currentJobId,
|
|
315
416
|
scopes: await this.keyStore.getAccounts(),
|
|
316
|
-
|
|
317
|
-
simulator: new WASMSimulator()
|
|
417
|
+
txResolver: this.stateMachine.txResolver,
|
|
418
|
+
simulator: new WASMSimulator(),
|
|
419
|
+
hooks: this.buildExecutionHooks(),
|
|
420
|
+
transientArrayService
|
|
318
421
|
});
|
|
319
422
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
320
423
|
// data) in order to refer to it later, mimicking the way this object is used by the ContractFunctionSimulator. The
|
|
@@ -333,7 +436,8 @@ function emptyLastCallState() {
|
|
|
333
436
|
this.setLastCallContext(Fr.ZERO, anchorBlock.globalVariables.timestamp);
|
|
334
437
|
return this.oracleHandler.getPrivateContextInputs();
|
|
335
438
|
}
|
|
336
|
-
async enterPublicState(
|
|
439
|
+
async enterPublicState(contractAddressOpt) {
|
|
440
|
+
const contractAddress = contractAddressOpt?.value ?? DEFAULT_ADDRESS;
|
|
337
441
|
this.exitTopLevelState();
|
|
338
442
|
this.resetLastCall();
|
|
339
443
|
// The PublicContext will create a block with a single transaction in it, containing the effects of what was done in
|
|
@@ -345,7 +449,7 @@ function emptyLastCallState() {
|
|
|
345
449
|
version: this.version,
|
|
346
450
|
chainId: this.chainId
|
|
347
451
|
});
|
|
348
|
-
this.oracleHandler = new TXEOraclePublicContext(contractAddress
|
|
452
|
+
this.oracleHandler = new TXEOraclePublicContext(contractAddress, await this.stateMachine.synchronizer.nativeWorldStateService.fork(), getSingleTxBlockRequestHash(globalVariables.blockNumber), globalVariables, this.contractStore);
|
|
349
453
|
this.state = {
|
|
350
454
|
name: 'PUBLIC'
|
|
351
455
|
};
|
|
@@ -353,7 +457,8 @@ function emptyLastCallState() {
|
|
|
353
457
|
// Public state is anchored at the latest block.
|
|
354
458
|
this.setLastCallContext(Fr.ZERO, latestHeader.globalVariables.timestamp);
|
|
355
459
|
}
|
|
356
|
-
async enterUtilityState(
|
|
460
|
+
async enterUtilityState(contractAddressOpt) {
|
|
461
|
+
const contractAddress = contractAddressOpt?.value ?? DEFAULT_ADDRESS;
|
|
357
462
|
this.exitTopLevelState();
|
|
358
463
|
this.resetLastCall();
|
|
359
464
|
const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
@@ -364,26 +469,36 @@ function emptyLastCallState() {
|
|
|
364
469
|
// TODO(#12553): make the synchronizer sync here instead and remove this
|
|
365
470
|
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
366
471
|
this.oracleHandler = new UtilityExecutionOracle({
|
|
367
|
-
|
|
472
|
+
callContext: CallContext.from({
|
|
473
|
+
msgSender: AztecAddress.NULL_MSG_SENDER,
|
|
474
|
+
contractAddress,
|
|
475
|
+
// No specific function is being executed in this inlined utility context, hence the empty selector.
|
|
476
|
+
functionSelector: FunctionSelector.empty(),
|
|
477
|
+
isStaticCall: true
|
|
478
|
+
}),
|
|
368
479
|
authWitnesses: [],
|
|
369
480
|
capsules: [],
|
|
370
481
|
anchorBlockHeader,
|
|
371
|
-
|
|
482
|
+
anchoredContractData: new AnchoredContractData(this.contractStore, this.stateMachine.contractClassService, anchorBlockHeader),
|
|
372
483
|
noteStore: this.noteStore,
|
|
373
484
|
keyStore: this.keyStore,
|
|
374
485
|
addressStore: this.addressStore,
|
|
375
486
|
aztecNode: this.stateMachine.node,
|
|
376
487
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
377
|
-
|
|
488
|
+
taggingSecretSourcesStore: this.taggingSecretSourcesStore,
|
|
378
489
|
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
490
|
+
factService: new FactService(this.factStore, await this.keyStore.getAccounts()),
|
|
379
491
|
privateEventStore: this.privateEventStore,
|
|
380
|
-
|
|
492
|
+
txResolver: this.stateMachine.txResolver,
|
|
381
493
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
382
494
|
l2TipsStore: this.stateMachine.l2TipsProvider,
|
|
383
495
|
jobId: this.currentJobId,
|
|
384
496
|
scopes: await this.keyStore.getAccounts(),
|
|
385
497
|
simulator: new WASMSimulator(),
|
|
386
|
-
utilityExecutor: this.utilityExecutorForContractSync(anchorBlockHeader)
|
|
498
|
+
utilityExecutor: this.utilityExecutorForContractSync(anchorBlockHeader),
|
|
499
|
+
hooks: this.buildExecutionHooks(),
|
|
500
|
+
// Execution-tree root (top-level utility run): own store; nested frames inherit it.
|
|
501
|
+
transientArrayService: new TransientArrayService()
|
|
387
502
|
});
|
|
388
503
|
this.state = {
|
|
389
504
|
name: 'UTILITY'
|
|
@@ -397,15 +512,17 @@ function emptyLastCallState() {
|
|
|
397
512
|
throw new Error(`Expected to be in state 'TOP_LEVEL', but got '${this.state.name}' instead`);
|
|
398
513
|
}
|
|
399
514
|
// Note that while all public and private contexts do is build a single block that we then process when exiting
|
|
400
|
-
//
|
|
401
|
-
//
|
|
402
|
-
//
|
|
403
|
-
//
|
|
404
|
-
//
|
|
405
|
-
//
|
|
406
|
-
// the
|
|
407
|
-
//
|
|
408
|
-
|
|
515
|
+
// them, the top level context does most of its work as it goes: it creates empty blocks (via `advanceBlocksBy`
|
|
516
|
+
// and `deploy`), creates blocks with transactions (via `privateCallNewFlow` and `publicCallNewFlow`), adds
|
|
517
|
+
// accounts to PXE (via `addAccount`), etc. This is a slight inconsistency in the working model of this class, but
|
|
518
|
+
// is not too bad. The `close` call below therefore only hands back the session-scoped values that a test
|
|
519
|
+
// sets directly at the top level, outside any contract execution (e.g. via `advanceTimestampBy`,
|
|
520
|
+
// `addAuthWitness`, `setTaggingSecretStrategies`). The oracle handler is discarded on every state transition,
|
|
521
|
+
// so the session must seed these values into the contexts it creates later.
|
|
522
|
+
// TODO: persisting authwits this way is quite unfortunate: they create a temporary utility context that would
|
|
523
|
+
// otherwise reset them, so we'd not be able to pass more than one per execution. Ideally authwits would be passed
|
|
524
|
+
// alongside a contract call instead of pre-seeded.
|
|
525
|
+
({ nextBlockTimestamp: this.nextBlockTimestamp, authwits: this.authwits, taggingSecretStrategies: this.taggingSecretStrategies, authorizeAllUtilityCallTargets: this.authorizeAllUtilityCallTargets } = this.oracleHandler.close());
|
|
409
526
|
}
|
|
410
527
|
async exitPrivateState() {
|
|
411
528
|
if (this.state.name != 'PRIVATE') {
|
|
@@ -444,35 +561,48 @@ function emptyLastCallState() {
|
|
|
444
561
|
}
|
|
445
562
|
utilityExecutorForContractSync(anchorBlock) {
|
|
446
563
|
return async (call, scopes)=>{
|
|
447
|
-
const
|
|
564
|
+
const anchoredContractData = new AnchoredContractData(this.contractStore, this.stateMachine.contractClassService, anchorBlock);
|
|
565
|
+
const entryPointArtifact = await anchoredContractData.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
566
|
+
if (!entryPointArtifact) {
|
|
567
|
+
throw new Error(`Cannot run function ${call.selector} on ${call.to}: the contract is not registered.`);
|
|
568
|
+
}
|
|
448
569
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
449
570
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
450
571
|
}
|
|
451
572
|
try {
|
|
452
573
|
const simulator = new WASMSimulator();
|
|
453
574
|
const oracle = new UtilityExecutionOracle({
|
|
454
|
-
|
|
575
|
+
callContext: CallContext.from({
|
|
576
|
+
msgSender: AztecAddress.NULL_MSG_SENDER,
|
|
577
|
+
contractAddress: call.to,
|
|
578
|
+
functionSelector: call.selector,
|
|
579
|
+
isStaticCall: true
|
|
580
|
+
}),
|
|
455
581
|
authWitnesses: [],
|
|
456
582
|
capsules: [],
|
|
457
583
|
anchorBlockHeader: anchorBlock,
|
|
458
|
-
|
|
584
|
+
anchoredContractData,
|
|
459
585
|
noteStore: this.noteStore,
|
|
460
586
|
keyStore: this.keyStore,
|
|
461
587
|
addressStore: this.addressStore,
|
|
462
588
|
aztecNode: this.stateMachine.node,
|
|
463
589
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
464
|
-
|
|
590
|
+
taggingSecretSourcesStore: this.taggingSecretSourcesStore,
|
|
465
591
|
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
592
|
+
factService: new FactService(this.factStore, scopes),
|
|
466
593
|
privateEventStore: this.privateEventStore,
|
|
467
|
-
|
|
594
|
+
txResolver: this.stateMachine.txResolver,
|
|
468
595
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
469
596
|
l2TipsStore: this.stateMachine.l2TipsProvider,
|
|
470
597
|
jobId: this.currentJobId,
|
|
471
598
|
scopes,
|
|
472
599
|
simulator,
|
|
473
|
-
utilityExecutor: this.utilityExecutorForContractSync(anchorBlock)
|
|
600
|
+
utilityExecutor: this.utilityExecutorForContractSync(anchorBlock),
|
|
601
|
+
hooks: this.buildExecutionHooks(),
|
|
602
|
+
// Top-level utility entrypoint: gets a fresh store. Nested frames inherit it via UtilityExecutionOracle.
|
|
603
|
+
transientArrayService: new TransientArrayService()
|
|
474
604
|
});
|
|
475
|
-
await simulator.executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact,
|
|
605
|
+
await simulator.executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact, buildACIRCallback(oracle)).catch((err)=>{
|
|
476
606
|
err.message = resolveAssertionMessageFromError(err, entryPointArtifact);
|
|
477
607
|
throw new ExecutionError(err.message, {
|
|
478
608
|
contractAddress: call.to,
|
|
@@ -486,4 +616,10 @@ function emptyLastCallState() {
|
|
|
486
616
|
}
|
|
487
617
|
};
|
|
488
618
|
}
|
|
619
|
+
/** Execution hooks for the oracles this session builds. Every oracle construction site must use this. */ buildExecutionHooks() {
|
|
620
|
+
return composeHooks({
|
|
621
|
+
resolveTaggingSecretStrategy: makeResolveTaggingSecretStrategyHook(this.taggingSecretStrategies),
|
|
622
|
+
authorizeUtilityCall: this.authorizeAllUtilityCallTargets ? authorizeAllUtilityCallsHook : undefined
|
|
623
|
+
});
|
|
624
|
+
}
|
|
489
625
|
}
|
|
@@ -9,7 +9,7 @@ import { BlockHeader, GlobalVariables, TxEffect } from '@aztec/stdlib/tx';
|
|
|
9
9
|
* @returns The transaction request hash.
|
|
10
10
|
*/
|
|
11
11
|
export declare function getSingleTxBlockRequestHash(blockNumber: BlockNumber): Fr;
|
|
12
|
-
export declare function insertTxEffectIntoWorldTrees(txEffect: TxEffect, worldTrees: MerkleTreeWriteOperations): Promise<void>;
|
|
12
|
+
export declare function insertTxEffectIntoWorldTrees(txEffect: TxEffect, worldTrees: MerkleTreeWriteOperations, l1ToL2Messages?: Fr[]): Promise<void>;
|
|
13
13
|
export declare function makeTXEBlockHeader(worldTrees: MerkleTreeWriteOperations, globalVariables: GlobalVariables): Promise<BlockHeader>;
|
|
14
14
|
/**
|
|
15
15
|
* Creates an L2Block with proper archive chaining.
|
|
@@ -25,4 +25,4 @@ export declare function makeTXEBlockHeader(worldTrees: MerkleTreeWriteOperations
|
|
|
25
25
|
* @returns The created L2Block with proper archive chaining
|
|
26
26
|
*/
|
|
27
27
|
export declare function makeTXEBlock(worldTrees: MerkleTreeWriteOperations, globalVariables: GlobalVariables, txEffects: TxEffect[]): Promise<L2Block>;
|
|
28
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfY3JlYXRpb24uZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9ibG9ja19jcmVhdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFNQSxPQUFPLEVBQUUsV0FBVyxFQUEyQyxNQUFNLGlDQUFpQyxDQUFDO0FBRXZHLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxnQ0FBZ0MsQ0FBQztBQUNwRCxPQUFPLEVBQVEsT0FBTyxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDcEQsT0FBTyxFQUF3QyxLQUFLLHlCQUF5QixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDM0csT0FBTyxFQUFFLFdBQVcsRUFBRSxlQUFlLEVBQUUsUUFBUSxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFFMUU7Ozs7R0FJRztBQUNILHdCQUFnQiwyQkFBMkIsQ0FBQyxXQUFXLEVBQUUsV0FBVyxHQUFHLEVBQUUsQ0FFeEU7QUFFRCx3QkFBc0IsNEJBQTRCLENBQ2hELFFBQVEsRUFBRSxRQUFRLEVBQ2xCLFVBQVUsRUFBRSx5QkFBeUIsRUFDckMsY0FBYyxHQUFFLEVBQUUsRUFBTyxHQUN4QixPQUFPLENBQUMsSUFBSSxDQUFDLENBa0JmO0FBRUQsd0JBQXNCLGtCQUFrQixDQUN0QyxVQUFVLEVBQUUseUJBQXlCLEVBQ3JDLGVBQWUsRUFBRSxlQUFlLEdBQy9CLE9BQU8sQ0FBQyxXQUFXLENBQUMsQ0FZdEI7QUFFRDs7Ozs7Ozs7Ozs7O0dBWUc7QUFDSCx3QkFBc0IsWUFBWSxDQUNoQyxVQUFVLEVBQUUseUJBQXlCLEVBQ3JDLGVBQWUsRUFBRSxlQUFlLEVBQ2hDLFNBQVMsRUFBRSxRQUFRLEVBQUUsR0FDcEIsT0FBTyxDQUFDLE9BQU8sQ0FBQyxDQWlCbEIifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block_creation.d.ts","sourceRoot":"","sources":["../../src/utils/block_creation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAA2C,MAAM,iCAAiC,CAAC;AAEvG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAQ,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAwC,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,WAAW,GAAG,EAAE,CAExE;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"block_creation.d.ts","sourceRoot":"","sources":["../../src/utils/block_creation.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,WAAW,EAA2C,MAAM,iCAAiC,CAAC;AAEvG,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,EAAQ,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAwC,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAC;AAC3G,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE1E;;;;GAIG;AACH,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,WAAW,GAAG,EAAE,CAExE;AAED,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,QAAQ,EAClB,UAAU,EAAE,yBAAyB,EACrC,cAAc,GAAE,EAAE,EAAO,GACxB,OAAO,CAAC,IAAI,CAAC,CAkBf;AAED,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,WAAW,CAAC,CAYtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,UAAU,EAAE,yBAAyB,EACrC,eAAe,EAAE,eAAe,EAChC,SAAS,EAAE,QAAQ,EAAE,GACpB,OAAO,CAAC,OAAO,CAAC,CAiBlB"}
|
|
@@ -12,10 +12,10 @@ import { BlockHeader } from '@aztec/stdlib/tx';
|
|
|
12
12
|
*/ export function getSingleTxBlockRequestHash(blockNumber) {
|
|
13
13
|
return new Fr(blockNumber + 9999); // Why does this need to be a high number? Why do small numbered nullifiers already exist?
|
|
14
14
|
}
|
|
15
|
-
export async function insertTxEffectIntoWorldTrees(txEffect, worldTrees) {
|
|
15
|
+
export async function insertTxEffectIntoWorldTrees(txEffect, worldTrees, l1ToL2Messages = []) {
|
|
16
16
|
await worldTrees.appendLeaves(MerkleTreeId.NOTE_HASH_TREE, padArrayEnd(txEffect.noteHashes, Fr.ZERO, MAX_NOTE_HASHES_PER_TX));
|
|
17
17
|
await worldTrees.batchInsert(MerkleTreeId.NULLIFIER_TREE, padArrayEnd(txEffect.nullifiers, Fr.ZERO, MAX_NULLIFIERS_PER_TX).map((nullifier)=>nullifier.toBuffer()), NULLIFIER_SUBTREE_HEIGHT);
|
|
18
|
-
await worldTrees.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padArrayEnd(
|
|
18
|
+
await worldTrees.appendLeaves(MerkleTreeId.L1_TO_L2_MESSAGE_TREE, padArrayEnd(l1ToL2Messages, Fr.ZERO, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP));
|
|
19
19
|
// We do not need to add public data writes because we apply them as we go.
|
|
20
20
|
}
|
|
21
21
|
export async function makeTXEBlockHeader(worldTrees, globalVariables) {
|
package/dest/utils/encoding.d.ts
CHANGED
|
@@ -75,7 +75,8 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<readonly [z.Zo
|
|
|
75
75
|
public: "public";
|
|
76
76
|
}>;
|
|
77
77
|
}, z.core.$strip>>;
|
|
78
|
-
|
|
78
|
+
returnType: z.ZodOptional<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>;
|
|
79
|
+
returnTypes: z.ZodOptional<z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>>;
|
|
79
80
|
errorTypes: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
80
81
|
error_kind: z.ZodLiteral<"string">;
|
|
81
82
|
string: z.ZodString;
|
|
@@ -132,7 +133,8 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<readonly [z.Zo
|
|
|
132
133
|
public: "public";
|
|
133
134
|
}>;
|
|
134
135
|
}, z.core.$strip>>;
|
|
135
|
-
|
|
136
|
+
returnType: z.ZodOptional<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>;
|
|
137
|
+
returnTypes: z.ZodOptional<z.ZodArray<z.ZodType<import("@aztec/stdlib/abi").AbiType, unknown, z.core.$ZodTypeInternals<import("@aztec/stdlib/abi").AbiType, unknown>>>>;
|
|
136
138
|
errorTypes: z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
137
139
|
error_kind: z.ZodLiteral<"string">;
|
|
138
140
|
string: z.ZodString;
|
|
@@ -159,11 +161,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<readonly [z.Zo
|
|
|
159
161
|
name: z.ZodString;
|
|
160
162
|
}, z.core.$strip>>;
|
|
161
163
|
}, z.core.$strip>>;
|
|
162
|
-
}, z.core.$strip>, z.ZodIntersection<z.ZodObject<{
|
|
164
|
+
}, z.core.$strip>, z.ZodIntersection<z.ZodIntersection<z.ZodObject<{
|
|
163
165
|
version: z.ZodLiteral<2>;
|
|
164
166
|
salt: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
165
167
|
deployer: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
166
|
-
currentContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
167
168
|
originalContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
168
169
|
initializationHash: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
169
170
|
immutablesHash: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
@@ -183,9 +184,11 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<readonly [z.Zo
|
|
|
183
184
|
fbpkMHash: Fr;
|
|
184
185
|
}>>;
|
|
185
186
|
}, z.core.$strip>, z.ZodObject<{
|
|
187
|
+
currentContractClassId: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
188
|
+
}, z.core.$strip>>, z.ZodObject<{
|
|
186
189
|
address: import("@aztec/foundation/schemas").ZodFor<AztecAddress>;
|
|
187
190
|
}, z.core.$strip>>]>>;
|
|
188
191
|
export declare const ForeignCallResultSchema: z.ZodObject<{
|
|
189
192
|
values: z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
190
193
|
}, z.core.$strip>;
|
|
191
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
194
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RpbmcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlscy9lbmNvZGluZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdz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;;;qBAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;iBAElC,CAAC"}
|
|
@@ -2,4 +2,4 @@ import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
|
2
2
|
import type { ExecutionNoteCache } from '@aztec/pxe/simulator';
|
|
3
3
|
import { TxEffect } from '@aztec/stdlib/tx';
|
|
4
4
|
export declare function makeTxEffect(noteCache: ExecutionNoteCache, txBlockNumber: BlockNumber): Promise<TxEffect>;
|
|
5
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhfZWZmZWN0X2NyZWF0aW9uLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbHMvdHhfZWZmZWN0X2NyZWF0aW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUU5RCxPQUFPLEtBQUssRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHNCQUFzQixDQUFDO0FBRS9ELE9BQU8sRUFBRSxRQUFRLEVBQVUsTUFBTSxrQkFBa0IsQ0FBQztBQUVwRCx3QkFBc0IsWUFBWSxDQUFDLFNBQVMsRUFBRSxrQkFBa0IsRUFBRSxhQUFhLEVBQUUsV0FBVyxHQUFHLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0FxQi9HIn0=
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tx_effect_creation.d.ts","sourceRoot":"","sources":["../../src/utils/tx_effect_creation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAU,MAAM,kBAAkB,CAAC;AAEpD,wBAAsB,YAAY,CAAC,SAAS,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"tx_effect_creation.d.ts","sourceRoot":"","sources":["../../src/utils/tx_effect_creation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAE9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAU,MAAM,kBAAkB,CAAC;AAEpD,wBAAsB,YAAY,CAAC,SAAS,EAAE,kBAAkB,EAAE,aAAa,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC,CAqB/G"}
|
|
@@ -3,7 +3,6 @@ import { computeNoteHashNonce, computeUniqueNoteHash, siloNoteHash } from '@azte
|
|
|
3
3
|
import { TxEffect, TxHash } from '@aztec/stdlib/tx';
|
|
4
4
|
export async function makeTxEffect(noteCache, txBlockNumber) {
|
|
5
5
|
const txEffect = TxEffect.empty();
|
|
6
|
-
noteCache.finish();
|
|
7
6
|
const nonceGenerator = noteCache.getNonceGenerator();
|
|
8
7
|
txEffect.noteHashes = await Promise.all(noteCache.getAllNotes().map(async (pendingNote, i)=>computeUniqueNoteHash(await computeNoteHashNonce(nonceGenerator, i), await siloNoteHash(pendingNote.note.contractAddress, pendingNote.noteHashForConsumption))));
|
|
9
8
|
// Nullifiers are already siloed
|