@aztec/txe 0.0.1-commit.934299a21 → 0.0.1-commit.949a33fd8
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/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +8 -6
- package/dest/oracle/interfaces.d.ts +31 -28
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.d.ts +13 -13
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +12 -12
- package/dest/oracle/txe_oracle_top_level_context.d.ts +27 -19
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +72 -42
- package/dest/rpc_translator.d.ts +128 -82
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +458 -170
- package/dest/state_machine/archiver.d.ts +3 -3
- package/dest/state_machine/archiver.d.ts.map +1 -1
- package/dest/state_machine/archiver.js +7 -8
- package/dest/state_machine/dummy_p2p_client.d.ts +3 -2
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +5 -2
- 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 +8 -4
- package/dest/state_machine/mock_epoch_cache.d.ts +18 -3
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +35 -2
- package/dest/state_machine/synchronizer.d.ts +5 -5
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/state_machine/synchronizer.js +3 -3
- package/dest/txe_session.d.ts +46 -1
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +86 -17
- package/dest/util/encoding.d.ts +71 -1
- package/dest/util/encoding.d.ts.map +1 -1
- package/dest/util/encoding.js +4 -0
- package/dest/util/txe_public_contract_data_source.d.ts +1 -1
- package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.js +1 -3
- package/package.json +15 -15
- package/src/index.ts +8 -5
- package/src/oracle/interfaces.ts +28 -32
- package/src/oracle/txe_oracle_public_context.ts +12 -12
- package/src/oracle/txe_oracle_top_level_context.ts +75 -46
- package/src/rpc_translator.ts +532 -204
- package/src/state_machine/archiver.ts +6 -5
- package/src/state_machine/dummy_p2p_client.ts +6 -2
- package/src/state_machine/global_variable_builder.ts +18 -3
- package/src/state_machine/index.ts +9 -2
- package/src/state_machine/mock_epoch_cache.ts +46 -3
- package/src/state_machine/synchronizer.ts +4 -4
- package/src/txe_session.ts +148 -17
- package/src/util/encoding.ts +5 -0
- package/src/util/txe_public_contract_data_source.ts +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
1
|
+
import { CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS, MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS, NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP } from '@aztec/constants';
|
|
2
2
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import { Schnorr } from '@aztec/foundation/crypto/schnorr';
|
|
4
4
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
5
5
|
import { LogLevels, applyStringFormatting, createLogger } from '@aztec/foundation/log';
|
|
6
6
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
7
|
-
import {
|
|
7
|
+
import { CapsuleService, ORACLE_VERSION_MAJOR, enrichPublicSimulationError } from '@aztec/pxe/server';
|
|
8
8
|
import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache, Oracle, PrivateExecutionOracle, UtilityExecutionOracle, executePrivateFunction, generateSimulatedProvingResult } from '@aztec/pxe/simulator';
|
|
9
9
|
import { ExecutionError, WASMSimulator, createSimulationError, extractCallStack, resolveAssertionMessageFromError, toACVMWitness, witnessMapToFields } from '@aztec/simulator/client';
|
|
10
10
|
import { CppPublicTxSimulator, GuardedMerkleTreeOperations, PublicContractsDB, PublicProcessor } from '@aztec/simulator/server';
|
|
@@ -13,7 +13,7 @@ import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
|
13
13
|
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
14
14
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
15
15
|
import { computePartialAddress } from '@aztec/stdlib/contract';
|
|
16
|
-
import { Gas, GasFees, GasSettings } from '@aztec/stdlib/gas';
|
|
16
|
+
import { FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT, Gas, GasFees, GasSettings } from '@aztec/stdlib/gas';
|
|
17
17
|
import { computeCalldataHash, computeProtocolNullifier, siloNullifier } from '@aztec/stdlib/hash';
|
|
18
18
|
import { PartialPrivateTailPublicInputsForPublic, PrivateKernelTailCircuitPublicInputs, PrivateToPublicAccumulatedData, PublicCallRequest } from '@aztec/stdlib/kernel';
|
|
19
19
|
import { ChonkProof } from '@aztec/stdlib/proofs';
|
|
@@ -64,18 +64,28 @@ export class TXEOracleTopLevelContext {
|
|
|
64
64
|
this.logger = createLogger('txe:top_level_context');
|
|
65
65
|
this.logger.debug('Entering Top Level Context');
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
contractOracleVersion;
|
|
68
|
+
assertCompatibleOracleVersion(major, minor) {
|
|
69
|
+
if (major !== ORACLE_VERSION_MAJOR) {
|
|
70
|
+
const hint = major > ORACLE_VERSION_MAJOR ? 'The contract was compiled with a newer version of Aztec.nr than this aztec cli version supports. Upgrade your aztec cli version to a compatible version.' : 'The contract was compiled with an older version of Aztec.nr than this aztec cli version supports. Recompile the contract with a compatible version of Aztec.nr.';
|
|
71
|
+
throw new Error(`Incompatible aztec cli version: ${hint} See https://docs.aztec.network/errors/8 (expected oracle major version ${ORACLE_VERSION_MAJOR}, got ${major})`);
|
|
70
72
|
}
|
|
73
|
+
this.contractOracleVersion = {
|
|
74
|
+
major,
|
|
75
|
+
minor
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
// Prefixed with "nonOracleFunction" as it is not used as an oracle handler.
|
|
79
|
+
nonOracleFunctionGetContractOracleVersion() {
|
|
80
|
+
return this.contractOracleVersion;
|
|
71
81
|
}
|
|
72
82
|
// This is typically only invoked in private contexts, but it is convenient to also have it in top-level for testing
|
|
73
83
|
// setup.
|
|
74
|
-
|
|
84
|
+
getRandomField() {
|
|
75
85
|
return Fr.random();
|
|
76
86
|
}
|
|
77
87
|
// We instruct users to debug contracts via this oracle, so it makes sense that they'd expect it to also work in tests
|
|
78
|
-
|
|
88
|
+
log(level, message, fields) {
|
|
79
89
|
if (!LogLevels[level]) {
|
|
80
90
|
throw new Error(`Invalid log level: ${level}`);
|
|
81
91
|
}
|
|
@@ -85,19 +95,19 @@ export class TXEOracleTopLevelContext {
|
|
|
85
95
|
});
|
|
86
96
|
return Promise.resolve();
|
|
87
97
|
}
|
|
88
|
-
|
|
98
|
+
getDefaultAddress() {
|
|
89
99
|
return DEFAULT_ADDRESS;
|
|
90
100
|
}
|
|
91
|
-
async
|
|
101
|
+
async getNextBlockNumber() {
|
|
92
102
|
return BlockNumber(await this.getLastBlockNumber() + 1);
|
|
93
103
|
}
|
|
94
|
-
|
|
104
|
+
getNextBlockTimestamp() {
|
|
95
105
|
return Promise.resolve(this.nextBlockTimestamp);
|
|
96
106
|
}
|
|
97
|
-
async
|
|
107
|
+
async getLastBlockTimestamp() {
|
|
98
108
|
return (await this.stateMachine.node.getBlockHeader('latest')).globalVariables.timestamp;
|
|
99
109
|
}
|
|
100
|
-
async
|
|
110
|
+
async getLastTxEffects() {
|
|
101
111
|
const latestBlockNumber = await this.stateMachine.archiver.getBlockNumber();
|
|
102
112
|
const block = await this.stateMachine.archiver.getBlock(latestBlockNumber);
|
|
103
113
|
if (block.body.txEffects.length != 1) {
|
|
@@ -113,7 +123,7 @@ export class TXEOracleTopLevelContext {
|
|
|
113
123
|
}
|
|
114
124
|
async syncContractNonOracleMethod(contractAddress, scope, jobId) {
|
|
115
125
|
if (contractAddress.equals(DEFAULT_ADDRESS)) {
|
|
116
|
-
this.logger.debug(`Skipping sync in
|
|
126
|
+
this.logger.debug(`Skipping sync in getPrivateEvents because the events correspond to the default address.`);
|
|
117
127
|
return;
|
|
118
128
|
}
|
|
119
129
|
const blockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
@@ -123,7 +133,7 @@ export class TXEOracleTopLevelContext {
|
|
|
123
133
|
scope
|
|
124
134
|
]);
|
|
125
135
|
}
|
|
126
|
-
async
|
|
136
|
+
async getPrivateEvents(selector, contractAddress, scope) {
|
|
127
137
|
return (await this.privateEventStore.getPrivateEvents(selector, {
|
|
128
138
|
contractAddress,
|
|
129
139
|
scopes: [
|
|
@@ -133,17 +143,17 @@ export class TXEOracleTopLevelContext {
|
|
|
133
143
|
toBlock: await this.getLastBlockNumber() + 1
|
|
134
144
|
})).map((e)=>e.packedEvent);
|
|
135
145
|
}
|
|
136
|
-
async
|
|
146
|
+
async advanceBlocksBy(blocks) {
|
|
137
147
|
this.logger.debug(`time traveling ${blocks} blocks`);
|
|
138
148
|
for(let i = 0; i < blocks; i++){
|
|
139
149
|
await this.mineBlock();
|
|
140
150
|
}
|
|
141
151
|
}
|
|
142
|
-
|
|
152
|
+
advanceTimestampBy(duration) {
|
|
143
153
|
this.logger.debug(`time traveling ${duration} seconds`);
|
|
144
154
|
this.nextBlockTimestamp += duration;
|
|
145
155
|
}
|
|
146
|
-
async
|
|
156
|
+
async deploy(artifact, instance, secret) {
|
|
147
157
|
// Emit deployment nullifier
|
|
148
158
|
await this.mineBlock({
|
|
149
159
|
nullifiers: [
|
|
@@ -151,14 +161,14 @@ export class TXEOracleTopLevelContext {
|
|
|
151
161
|
]
|
|
152
162
|
});
|
|
153
163
|
if (!secret.equals(Fr.ZERO)) {
|
|
154
|
-
await this.
|
|
164
|
+
await this.addAccount(artifact, instance, secret);
|
|
155
165
|
} else {
|
|
156
166
|
await this.contractStore.addContractInstance(instance);
|
|
157
167
|
await this.contractStore.addContractArtifact(artifact);
|
|
158
168
|
this.logger.debug(`Deployed ${artifact.name} at ${instance.address}`);
|
|
159
169
|
}
|
|
160
170
|
}
|
|
161
|
-
async
|
|
171
|
+
async addAccount(artifact, instance, secret) {
|
|
162
172
|
const partialAddress = await computePartialAddress(instance);
|
|
163
173
|
this.logger.debug(`Deployed ${artifact.name} at ${instance.address}`);
|
|
164
174
|
await this.contractStore.addContractInstance(instance);
|
|
@@ -169,7 +179,7 @@ export class TXEOracleTopLevelContext {
|
|
|
169
179
|
this.logger.debug(`Created account ${completeAddress.address}`);
|
|
170
180
|
return completeAddress;
|
|
171
181
|
}
|
|
172
|
-
async
|
|
182
|
+
async createAccount(secret) {
|
|
173
183
|
// This is a foot gun !
|
|
174
184
|
const completeAddress = await this.keyStore.addAccount(secret, secret);
|
|
175
185
|
await this.accountStore.setAccount(completeAddress.address, completeAddress);
|
|
@@ -177,7 +187,7 @@ export class TXEOracleTopLevelContext {
|
|
|
177
187
|
this.logger.debug(`Created account ${completeAddress.address}`);
|
|
178
188
|
return completeAddress;
|
|
179
189
|
}
|
|
180
|
-
async
|
|
190
|
+
async addAuthWitness(address, messageHash) {
|
|
181
191
|
const account = await this.accountStore.getAccount(address);
|
|
182
192
|
const privateKey = await this.keyStore.getMasterSecretKey(account.publicKeys.masterIncomingViewingPublicKey);
|
|
183
193
|
const schnorr = new Schnorr();
|
|
@@ -188,7 +198,7 @@ export class TXEOracleTopLevelContext {
|
|
|
188
198
|
this.authwits.set(authWitness.requestHash.toString(), authWitness);
|
|
189
199
|
}
|
|
190
200
|
async mineBlock(options = {}) {
|
|
191
|
-
const blockNumber = await this.
|
|
201
|
+
const blockNumber = await this.getNextBlockNumber();
|
|
192
202
|
const txEffect = TxEffect.empty();
|
|
193
203
|
txEffect.nullifiers = [
|
|
194
204
|
getSingleTxBlockRequestHash(blockNumber),
|
|
@@ -210,7 +220,7 @@ export class TXEOracleTopLevelContext {
|
|
|
210
220
|
this.logger.info(`Created block ${blockNumber} with timestamp ${block.header.globalVariables.timestamp}`);
|
|
211
221
|
await this.stateMachine.handleL2Block(block);
|
|
212
222
|
}
|
|
213
|
-
async
|
|
223
|
+
async privateCallNewFlow(from, targetContractAddress = AztecAddress.zero(), functionSelector = FunctionSelector.empty(), args, argsHash = Fr.zero(), isStaticCall = false, jobId) {
|
|
214
224
|
this.logger.verbose(`Executing external function ${await this.contractStore.getDebugFunctionName(targetContractAddress, functionSelector)}@${targetContractAddress} isStaticCall=${isStaticCall}`);
|
|
215
225
|
const artifact = await this.contractStore.getFunctionArtifact(targetContractAddress, functionSelector);
|
|
216
226
|
if (!artifact) {
|
|
@@ -228,10 +238,10 @@ export class TXEOracleTopLevelContext {
|
|
|
228
238
|
};
|
|
229
239
|
const blockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
230
240
|
await this.stateMachine.contractSyncService.ensureContractSynced(targetContractAddress, functionSelector, utilityExecutor, blockHeader, jobId, effectiveScopes);
|
|
231
|
-
const blockNumber = await this.
|
|
241
|
+
const blockNumber = await this.getNextBlockNumber();
|
|
232
242
|
const callContext = new CallContext(from, targetContractAddress, functionSelector, isStaticCall);
|
|
233
|
-
const gasLimits = new Gas(
|
|
234
|
-
const teardownGasLimits = new Gas(
|
|
243
|
+
const gasLimits = new Gas(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS);
|
|
244
|
+
const teardownGasLimits = new Gas(FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT);
|
|
235
245
|
const gasSettings = new GasSettings(gasLimits, teardownGasLimits, GasFees.empty(), GasFees.empty());
|
|
236
246
|
const txContext = new TxContext(this.chainId, this.version, gasSettings);
|
|
237
247
|
const protocolNullifier = await computeProtocolNullifier(getSingleTxBlockRequestHash(blockNumber));
|
|
@@ -264,7 +274,7 @@ export class TXEOracleTopLevelContext {
|
|
|
264
274
|
senderTaggingStore: this.senderTaggingStore,
|
|
265
275
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
266
276
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
267
|
-
|
|
277
|
+
capsuleService: new CapsuleService(this.capsuleStore, effectiveScopes),
|
|
268
278
|
privateEventStore: this.privateEventStore,
|
|
269
279
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
270
280
|
jobId,
|
|
@@ -274,7 +284,9 @@ export class TXEOracleTopLevelContext {
|
|
|
274
284
|
// In TXE, the typical transaction entrypoint is skipped, so we need to simulate the actions that such a
|
|
275
285
|
// contract would perform, including setting senderForTags.
|
|
276
286
|
senderForTags: from,
|
|
277
|
-
simulator
|
|
287
|
+
simulator,
|
|
288
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
289
|
+
l2TipsStore: this.stateMachine.node
|
|
278
290
|
});
|
|
279
291
|
// Note: This is a slight modification of simulator.run without any of the checks. Maybe we should modify simulator.run with a boolean value to skip checks.
|
|
280
292
|
let result;
|
|
@@ -287,7 +299,7 @@ export class TXEOracleTopLevelContext {
|
|
|
287
299
|
r.publicInputs.publicTeardownCallRequest
|
|
288
300
|
]));
|
|
289
301
|
const publicFunctionsCalldata = await Promise.all(publicCallRequests.map(async (r)=>{
|
|
290
|
-
const calldata = await privateExecutionOracle.
|
|
302
|
+
const calldata = await privateExecutionOracle.getHashPreimage(r.calldataHash);
|
|
291
303
|
return new HashedValues(calldata, r.calldataHash);
|
|
292
304
|
}));
|
|
293
305
|
noteCache.finish();
|
|
@@ -346,10 +358,20 @@ export class TXEOracleTopLevelContext {
|
|
|
346
358
|
throw new Error('Contract execution has reverted');
|
|
347
359
|
}
|
|
348
360
|
}
|
|
361
|
+
// Walk the nested private-call tree and collect every offchain effect the transaction emitted.
|
|
362
|
+
// PXE stores these on each `PrivateCallExecutionResult` and they never reach TXE via the
|
|
363
|
+
// `aztec_utl_emitOffchainEffect` foreign-call path (that path only fires at the top-level), so
|
|
364
|
+
// we pull them out here and the RPC wrapper will hand them to `TXESession` for buffering.
|
|
365
|
+
const offchainEffects = collectNested([
|
|
366
|
+
executionResult
|
|
367
|
+
], (r)=>r.offchainEffects.map((e)=>e.data));
|
|
349
368
|
if (isStaticCall) {
|
|
350
369
|
await checkpoint.revert();
|
|
351
370
|
await forkedWorldTrees.close();
|
|
352
|
-
return
|
|
371
|
+
return {
|
|
372
|
+
returnValues: executionResult.returnValues ?? [],
|
|
373
|
+
offchainEffects
|
|
374
|
+
};
|
|
353
375
|
}
|
|
354
376
|
const txEffect = TxEffect.empty();
|
|
355
377
|
txEffect.noteHashes = processedTx.txEffect.noteHashes;
|
|
@@ -365,13 +387,16 @@ export class TXEOracleTopLevelContext {
|
|
|
365
387
|
]);
|
|
366
388
|
await this.stateMachine.handleL2Block(l2Block);
|
|
367
389
|
await forkedWorldTrees.close();
|
|
368
|
-
return
|
|
390
|
+
return {
|
|
391
|
+
returnValues: executionResult.returnValues ?? [],
|
|
392
|
+
offchainEffects
|
|
393
|
+
};
|
|
369
394
|
}
|
|
370
|
-
async
|
|
395
|
+
async publicCallNewFlow(from, targetContractAddress, calldata, isStaticCall) {
|
|
371
396
|
this.logger.verbose(`Executing public function ${await this.contractStore.getDebugFunctionName(targetContractAddress, FunctionSelector.fromField(calldata[0]))}@${targetContractAddress} isStaticCall=${isStaticCall}`);
|
|
372
|
-
const blockNumber = await this.
|
|
373
|
-
const gasLimits = new Gas(
|
|
374
|
-
const teardownGasLimits = new Gas(
|
|
397
|
+
const blockNumber = await this.getNextBlockNumber();
|
|
398
|
+
const gasLimits = new Gas(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS);
|
|
399
|
+
const teardownGasLimits = new Gas(FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT);
|
|
375
400
|
const gasSettings = new GasSettings(gasLimits, teardownGasLimits, GasFees.empty(), GasFees.empty());
|
|
376
401
|
const txContext = new TxContext(this.chainId, this.version, gasSettings);
|
|
377
402
|
const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
@@ -461,7 +486,7 @@ export class TXEOracleTopLevelContext {
|
|
|
461
486
|
await forkedWorldTrees.close();
|
|
462
487
|
return returnValues ?? [];
|
|
463
488
|
}
|
|
464
|
-
async
|
|
489
|
+
async executeUtilityFunction(targetContractAddress, functionSelector, args, jobId) {
|
|
465
490
|
const artifact = await this.contractStore.getFunctionArtifact(targetContractAddress, functionSelector);
|
|
466
491
|
if (!artifact) {
|
|
467
492
|
throw new Error(`Cannot call ${functionSelector} as there is no artifact found at ${targetContractAddress}.`);
|
|
@@ -470,7 +495,7 @@ export class TXEOracleTopLevelContext {
|
|
|
470
495
|
const blockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
471
496
|
await this.stateMachine.contractSyncService.ensureContractSynced(targetContractAddress, functionSelector, async (call, execScopes)=>{
|
|
472
497
|
await this.executeUtilityCall(call, execScopes, jobId);
|
|
473
|
-
}, blockHeader, jobId,
|
|
498
|
+
}, blockHeader, jobId, await this.keyStore.getAccounts());
|
|
474
499
|
const call = FunctionCall.from({
|
|
475
500
|
name: artifact.name,
|
|
476
501
|
to: targetContractAddress,
|
|
@@ -481,7 +506,7 @@ export class TXEOracleTopLevelContext {
|
|
|
481
506
|
args,
|
|
482
507
|
returnTypes: []
|
|
483
508
|
});
|
|
484
|
-
return this.executeUtilityCall(call,
|
|
509
|
+
return this.executeUtilityCall(call, await this.keyStore.getAccounts(), jobId);
|
|
485
510
|
}
|
|
486
511
|
async executeUtilityCall(call, scopes, jobId) {
|
|
487
512
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
@@ -494,6 +519,7 @@ export class TXEOracleTopLevelContext {
|
|
|
494
519
|
});
|
|
495
520
|
try {
|
|
496
521
|
const anchorBlockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
522
|
+
const simulator = new WASMSimulator();
|
|
497
523
|
const oracle = new UtilityExecutionOracle({
|
|
498
524
|
contractAddress: call.to,
|
|
499
525
|
authWitnesses: [],
|
|
@@ -506,12 +532,16 @@ export class TXEOracleTopLevelContext {
|
|
|
506
532
|
aztecNode: this.stateMachine.node,
|
|
507
533
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
508
534
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
509
|
-
|
|
535
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
510
536
|
privateEventStore: this.privateEventStore,
|
|
537
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
538
|
+
contractSyncService: this.stateMachine.contractSyncService,
|
|
539
|
+
l2TipsStore: this.stateMachine.node,
|
|
511
540
|
jobId,
|
|
512
|
-
scopes
|
|
541
|
+
scopes,
|
|
542
|
+
simulator
|
|
513
543
|
});
|
|
514
|
-
const acirExecutionResult = await
|
|
544
|
+
const acirExecutionResult = await simulator.executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact, new Oracle(oracle).toACIRCallback()).catch((err)=>{
|
|
515
545
|
err.message = resolveAssertionMessageFromError(err, entryPointArtifact);
|
|
516
546
|
throw new ExecutionError(err.message, {
|
|
517
547
|
contractAddress: call.to,
|