@aztec/txe 0.0.1-commit.3d8f95d → 0.0.1-commit.3fd054f6
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 +88 -54
- package/dest/oracle/interfaces.d.ts +29 -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 +23 -23
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +61 -47
- package/dest/rpc_translator.d.ts +87 -82
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +273 -151
- 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 +5 -7
- package/dest/state_machine/dummy_p2p_client.d.ts +8 -5
- package/dest/state_machine/dummy_p2p_client.d.ts.map +1 -1
- package/dest/state_machine/dummy_p2p_client.js +13 -4
- 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 +7 -3
- package/dest/state_machine/mock_epoch_cache.d.ts +17 -3
- package/dest/state_machine/mock_epoch_cache.d.ts.map +1 -1
- package/dest/state_machine/mock_epoch_cache.js +32 -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 +10 -6
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +36 -24
- package/dest/util/encoding.d.ts +69 -1
- package/dest/util/encoding.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.d.ts +2 -3
- package/dest/util/txe_public_contract_data_source.d.ts.map +1 -1
- package/dest/util/txe_public_contract_data_source.js +6 -25
- package/package.json +15 -15
- package/src/index.ts +89 -52
- package/src/oracle/interfaces.ts +32 -31
- package/src/oracle/txe_oracle_public_context.ts +12 -12
- package/src/oracle/txe_oracle_top_level_context.ts +73 -45
- package/src/rpc_translator.ts +305 -173
- package/src/state_machine/archiver.ts +5 -5
- package/src/state_machine/dummy_p2p_client.ts +19 -7
- package/src/state_machine/index.ts +7 -1
- package/src/state_machine/mock_epoch_cache.ts +42 -3
- package/src/state_machine/synchronizer.ts +4 -4
- package/src/txe_session.ts +43 -21
- package/src/util/txe_public_contract_data_source.ts +10 -38
- package/dest/util/txe_contract_store.d.ts +0 -12
- package/dest/util/txe_contract_store.d.ts.map +0 -1
- package/dest/util/txe_contract_store.js +0 -22
- package/src/util/txe_contract_store.ts +0 -36
|
@@ -36,15 +36,15 @@ export class TXEOracleTopLevelContext {
|
|
|
36
36
|
senderAddressBookStore;
|
|
37
37
|
capsuleStore;
|
|
38
38
|
privateEventStore;
|
|
39
|
-
jobId;
|
|
40
39
|
nextBlockTimestamp;
|
|
41
40
|
version;
|
|
42
41
|
chainId;
|
|
43
42
|
authwits;
|
|
43
|
+
contractSyncService;
|
|
44
44
|
isMisc;
|
|
45
45
|
isTxe;
|
|
46
46
|
logger;
|
|
47
|
-
constructor(stateMachine, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore,
|
|
47
|
+
constructor(stateMachine, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, nextBlockTimestamp, version, chainId, authwits, contractSyncService){
|
|
48
48
|
this.stateMachine = stateMachine;
|
|
49
49
|
this.contractStore = contractStore;
|
|
50
50
|
this.noteStore = noteStore;
|
|
@@ -56,28 +56,28 @@ export class TXEOracleTopLevelContext {
|
|
|
56
56
|
this.senderAddressBookStore = senderAddressBookStore;
|
|
57
57
|
this.capsuleStore = capsuleStore;
|
|
58
58
|
this.privateEventStore = privateEventStore;
|
|
59
|
-
this.jobId = jobId;
|
|
60
59
|
this.nextBlockTimestamp = nextBlockTimestamp;
|
|
61
60
|
this.version = version;
|
|
62
61
|
this.chainId = chainId;
|
|
63
62
|
this.authwits = authwits;
|
|
63
|
+
this.contractSyncService = contractSyncService;
|
|
64
64
|
this.isMisc = true;
|
|
65
65
|
this.isTxe = true;
|
|
66
66
|
this.logger = createLogger('txe:top_level_context');
|
|
67
67
|
this.logger.debug('Entering Top Level Context');
|
|
68
68
|
}
|
|
69
|
-
|
|
69
|
+
assertCompatibleOracleVersion(version) {
|
|
70
70
|
if (version !== ORACLE_VERSION) {
|
|
71
71
|
throw new Error(`Incompatible oracle version. TXE is using version '${ORACLE_VERSION}', but got a request for '${version}'.`);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
// This is typically only invoked in private contexts, but it is convenient to also have it in top-level for testing
|
|
75
75
|
// setup.
|
|
76
|
-
|
|
76
|
+
getRandomField() {
|
|
77
77
|
return Fr.random();
|
|
78
78
|
}
|
|
79
79
|
// We instruct users to debug contracts via this oracle, so it makes sense that they'd expect it to also work in tests
|
|
80
|
-
|
|
80
|
+
log(level, message, fields) {
|
|
81
81
|
if (!LogLevels[level]) {
|
|
82
82
|
throw new Error(`Invalid log level: ${level}`);
|
|
83
83
|
}
|
|
@@ -87,19 +87,19 @@ export class TXEOracleTopLevelContext {
|
|
|
87
87
|
});
|
|
88
88
|
return Promise.resolve();
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
getDefaultAddress() {
|
|
91
91
|
return DEFAULT_ADDRESS;
|
|
92
92
|
}
|
|
93
|
-
async
|
|
93
|
+
async getNextBlockNumber() {
|
|
94
94
|
return BlockNumber(await this.getLastBlockNumber() + 1);
|
|
95
95
|
}
|
|
96
|
-
|
|
96
|
+
getNextBlockTimestamp() {
|
|
97
97
|
return Promise.resolve(this.nextBlockTimestamp);
|
|
98
98
|
}
|
|
99
|
-
async
|
|
99
|
+
async getLastBlockTimestamp() {
|
|
100
100
|
return (await this.stateMachine.node.getBlockHeader('latest')).globalVariables.timestamp;
|
|
101
101
|
}
|
|
102
|
-
async
|
|
102
|
+
async getLastTxEffects() {
|
|
103
103
|
const latestBlockNumber = await this.stateMachine.archiver.getBlockNumber();
|
|
104
104
|
const block = await this.stateMachine.archiver.getBlock(latestBlockNumber);
|
|
105
105
|
if (block.body.txEffects.length != 1) {
|
|
@@ -113,7 +113,19 @@ export class TXEOracleTopLevelContext {
|
|
|
113
113
|
nullifiers: txEffects.nullifiers
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
-
async
|
|
116
|
+
async syncContractNonOracleMethod(contractAddress, scope, jobId) {
|
|
117
|
+
if (contractAddress.equals(DEFAULT_ADDRESS)) {
|
|
118
|
+
this.logger.debug(`Skipping sync in getPrivateEvents because the events correspond to the default address.`);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const blockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
122
|
+
await this.stateMachine.contractSyncService.ensureContractSynced(contractAddress, null, async (call, execScopes)=>{
|
|
123
|
+
await this.executeUtilityCall(call, execScopes, jobId);
|
|
124
|
+
}, blockHeader, jobId, [
|
|
125
|
+
scope
|
|
126
|
+
]);
|
|
127
|
+
}
|
|
128
|
+
async getPrivateEvents(selector, contractAddress, scope) {
|
|
117
129
|
return (await this.privateEventStore.getPrivateEvents(selector, {
|
|
118
130
|
contractAddress,
|
|
119
131
|
scopes: [
|
|
@@ -123,17 +135,17 @@ export class TXEOracleTopLevelContext {
|
|
|
123
135
|
toBlock: await this.getLastBlockNumber() + 1
|
|
124
136
|
})).map((e)=>e.packedEvent);
|
|
125
137
|
}
|
|
126
|
-
async
|
|
138
|
+
async advanceBlocksBy(blocks) {
|
|
127
139
|
this.logger.debug(`time traveling ${blocks} blocks`);
|
|
128
140
|
for(let i = 0; i < blocks; i++){
|
|
129
141
|
await this.mineBlock();
|
|
130
142
|
}
|
|
131
143
|
}
|
|
132
|
-
|
|
144
|
+
advanceTimestampBy(duration) {
|
|
133
145
|
this.logger.debug(`time traveling ${duration} seconds`);
|
|
134
146
|
this.nextBlockTimestamp += duration;
|
|
135
147
|
}
|
|
136
|
-
async
|
|
148
|
+
async deploy(artifact, instance, secret) {
|
|
137
149
|
// Emit deployment nullifier
|
|
138
150
|
await this.mineBlock({
|
|
139
151
|
nullifiers: [
|
|
@@ -141,25 +153,25 @@ export class TXEOracleTopLevelContext {
|
|
|
141
153
|
]
|
|
142
154
|
});
|
|
143
155
|
if (!secret.equals(Fr.ZERO)) {
|
|
144
|
-
await this.
|
|
156
|
+
await this.addAccount(artifact, instance, secret);
|
|
145
157
|
} else {
|
|
146
158
|
await this.contractStore.addContractInstance(instance);
|
|
147
|
-
await this.contractStore.addContractArtifact(
|
|
159
|
+
await this.contractStore.addContractArtifact(artifact);
|
|
148
160
|
this.logger.debug(`Deployed ${artifact.name} at ${instance.address}`);
|
|
149
161
|
}
|
|
150
162
|
}
|
|
151
|
-
async
|
|
163
|
+
async addAccount(artifact, instance, secret) {
|
|
152
164
|
const partialAddress = await computePartialAddress(instance);
|
|
153
165
|
this.logger.debug(`Deployed ${artifact.name} at ${instance.address}`);
|
|
154
166
|
await this.contractStore.addContractInstance(instance);
|
|
155
|
-
await this.contractStore.addContractArtifact(
|
|
167
|
+
await this.contractStore.addContractArtifact(artifact);
|
|
156
168
|
const completeAddress = await this.keyStore.addAccount(secret, partialAddress);
|
|
157
169
|
await this.accountStore.setAccount(completeAddress.address, completeAddress);
|
|
158
170
|
await this.addressStore.addCompleteAddress(completeAddress);
|
|
159
171
|
this.logger.debug(`Created account ${completeAddress.address}`);
|
|
160
172
|
return completeAddress;
|
|
161
173
|
}
|
|
162
|
-
async
|
|
174
|
+
async createAccount(secret) {
|
|
163
175
|
// This is a foot gun !
|
|
164
176
|
const completeAddress = await this.keyStore.addAccount(secret, secret);
|
|
165
177
|
await this.accountStore.setAccount(completeAddress.address, completeAddress);
|
|
@@ -167,7 +179,7 @@ export class TXEOracleTopLevelContext {
|
|
|
167
179
|
this.logger.debug(`Created account ${completeAddress.address}`);
|
|
168
180
|
return completeAddress;
|
|
169
181
|
}
|
|
170
|
-
async
|
|
182
|
+
async addAuthWitness(address, messageHash) {
|
|
171
183
|
const account = await this.accountStore.getAccount(address);
|
|
172
184
|
const privateKey = await this.keyStore.getMasterSecretKey(account.publicKeys.masterIncomingViewingPublicKey);
|
|
173
185
|
const schnorr = new Schnorr();
|
|
@@ -178,7 +190,7 @@ export class TXEOracleTopLevelContext {
|
|
|
178
190
|
this.authwits.set(authWitness.requestHash.toString(), authWitness);
|
|
179
191
|
}
|
|
180
192
|
async mineBlock(options = {}) {
|
|
181
|
-
const blockNumber = await this.
|
|
193
|
+
const blockNumber = await this.getNextBlockNumber();
|
|
182
194
|
const txEffect = TxEffect.empty();
|
|
183
195
|
txEffect.nullifiers = [
|
|
184
196
|
getSingleTxBlockRequestHash(blockNumber),
|
|
@@ -200,26 +212,25 @@ export class TXEOracleTopLevelContext {
|
|
|
200
212
|
this.logger.info(`Created block ${blockNumber} with timestamp ${block.header.globalVariables.timestamp}`);
|
|
201
213
|
await this.stateMachine.handleL2Block(block);
|
|
202
214
|
}
|
|
203
|
-
async
|
|
215
|
+
async privateCallNewFlow(from, targetContractAddress = AztecAddress.zero(), functionSelector = FunctionSelector.empty(), args, argsHash = Fr.zero(), isStaticCall = false, jobId) {
|
|
204
216
|
this.logger.verbose(`Executing external function ${await this.contractStore.getDebugFunctionName(targetContractAddress, functionSelector)}@${targetContractAddress} isStaticCall=${isStaticCall}`);
|
|
205
217
|
const artifact = await this.contractStore.getFunctionArtifact(targetContractAddress, functionSelector);
|
|
206
218
|
if (!artifact) {
|
|
207
219
|
const message = functionSelector.equals(await FunctionSelector.fromSignature('verify_private_authwit(Field)')) ? 'Found no account contract artifact for a private authwit check - use `create_contract_account` instead of `create_light_account` for authwit support.' : 'Function Artifact does not exist';
|
|
208
220
|
throw new Error(message);
|
|
209
221
|
}
|
|
210
|
-
// When `from` is the zero address (
|
|
211
|
-
//
|
|
212
|
-
|
|
213
|
-
const effectiveScopes = from.isZero() ? undefined : [
|
|
222
|
+
// When `from` is the zero address (e.g. when deploying a new account contract), we return an
|
|
223
|
+
// empty scope list which acts as deny-all: no notes are visible and no keys are accessible.
|
|
224
|
+
const effectiveScopes = from.isZero() ? [] : [
|
|
214
225
|
from
|
|
215
226
|
];
|
|
216
227
|
// Sync notes before executing private function to discover notes from previous transactions
|
|
217
|
-
const utilityExecutor = async (call)=>{
|
|
218
|
-
await this.executeUtilityCall(call,
|
|
228
|
+
const utilityExecutor = async (call, execScopes)=>{
|
|
229
|
+
await this.executeUtilityCall(call, execScopes, jobId);
|
|
219
230
|
};
|
|
220
231
|
const blockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
221
|
-
await this.stateMachine.contractSyncService.ensureContractSynced(targetContractAddress, functionSelector, utilityExecutor, blockHeader,
|
|
222
|
-
const blockNumber = await this.
|
|
232
|
+
await this.stateMachine.contractSyncService.ensureContractSynced(targetContractAddress, functionSelector, utilityExecutor, blockHeader, jobId, effectiveScopes);
|
|
233
|
+
const blockNumber = await this.getNextBlockNumber();
|
|
223
234
|
const callContext = new CallContext(from, targetContractAddress, functionSelector, isStaticCall);
|
|
224
235
|
const gasLimits = new Gas(DEFAULT_DA_GAS_LIMIT, DEFAULT_L2_GAS_LIMIT);
|
|
225
236
|
const teardownGasLimits = new Gas(DEFAULT_TEARDOWN_DA_GAS_LIMIT, DEFAULT_TEARDOWN_L2_GAS_LIMIT);
|
|
@@ -258,14 +269,15 @@ export class TXEOracleTopLevelContext {
|
|
|
258
269
|
capsuleStore: this.capsuleStore,
|
|
259
270
|
privateEventStore: this.privateEventStore,
|
|
260
271
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
261
|
-
jobId
|
|
272
|
+
jobId,
|
|
262
273
|
totalPublicCalldataCount: 0,
|
|
263
274
|
sideEffectCounter: minRevertibleSideEffectCounter,
|
|
264
275
|
scopes: effectiveScopes,
|
|
265
276
|
// In TXE, the typical transaction entrypoint is skipped, so we need to simulate the actions that such a
|
|
266
277
|
// contract would perform, including setting senderForTags.
|
|
267
278
|
senderForTags: from,
|
|
268
|
-
simulator
|
|
279
|
+
simulator,
|
|
280
|
+
messageContextService: this.stateMachine.messageContextService
|
|
269
281
|
});
|
|
270
282
|
// 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.
|
|
271
283
|
let result;
|
|
@@ -278,7 +290,7 @@ export class TXEOracleTopLevelContext {
|
|
|
278
290
|
r.publicInputs.publicTeardownCallRequest
|
|
279
291
|
]));
|
|
280
292
|
const publicFunctionsCalldata = await Promise.all(publicCallRequests.map(async (r)=>{
|
|
281
|
-
const calldata = await privateExecutionOracle.
|
|
293
|
+
const calldata = await privateExecutionOracle.loadFromExecutionCache(r.calldataHash);
|
|
282
294
|
return new HashedValues(calldata, r.calldataHash);
|
|
283
295
|
}));
|
|
284
296
|
noteCache.finish();
|
|
@@ -290,7 +302,7 @@ export class TXEOracleTopLevelContext {
|
|
|
290
302
|
// According to the protocol rules, there must be at least one nullifier in the tx. The first nullifier is used as
|
|
291
303
|
// the nonce generator for the note hashes.
|
|
292
304
|
// We pass the non-zero minRevertibleSideEffectCounter to make sure the side effects are split correctly.
|
|
293
|
-
const { publicInputs } = await generateSimulatedProvingResult(result, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel), minRevertibleSideEffectCounter);
|
|
305
|
+
const { publicInputs } = await generateSimulatedProvingResult(result, (addr, sel)=>this.contractStore.getDebugFunctionName(addr, sel), this.stateMachine.node, minRevertibleSideEffectCounter);
|
|
294
306
|
const globals = makeGlobalVariables();
|
|
295
307
|
globals.blockNumber = blockNumber;
|
|
296
308
|
globals.timestamp = this.nextBlockTimestamp;
|
|
@@ -358,9 +370,9 @@ export class TXEOracleTopLevelContext {
|
|
|
358
370
|
await forkedWorldTrees.close();
|
|
359
371
|
return executionResult.returnValues ?? [];
|
|
360
372
|
}
|
|
361
|
-
async
|
|
373
|
+
async publicCallNewFlow(from, targetContractAddress, calldata, isStaticCall) {
|
|
362
374
|
this.logger.verbose(`Executing public function ${await this.contractStore.getDebugFunctionName(targetContractAddress, FunctionSelector.fromField(calldata[0]))}@${targetContractAddress} isStaticCall=${isStaticCall}`);
|
|
363
|
-
const blockNumber = await this.
|
|
375
|
+
const blockNumber = await this.getNextBlockNumber();
|
|
364
376
|
const gasLimits = new Gas(DEFAULT_DA_GAS_LIMIT, DEFAULT_L2_GAS_LIMIT);
|
|
365
377
|
const teardownGasLimits = new Gas(DEFAULT_TEARDOWN_DA_GAS_LIMIT, DEFAULT_TEARDOWN_L2_GAS_LIMIT);
|
|
366
378
|
const gasSettings = new GasSettings(gasLimits, teardownGasLimits, GasFees.empty(), GasFees.empty());
|
|
@@ -399,7 +411,7 @@ export class TXEOracleTopLevelContext {
|
|
|
399
411
|
revertibleAccumulatedData.publicCallRequests[0] = new PublicCallRequest(from, targetContractAddress, isStaticCall, calldataHash);
|
|
400
412
|
const inputsForPublic = new PartialPrivateTailPublicInputsForPublic(nonRevertibleAccumulatedData, revertibleAccumulatedData, PublicCallRequest.empty());
|
|
401
413
|
const constantData = new TxConstantData(anchorBlockHeader, txContext, Fr.zero(), Fr.zero());
|
|
402
|
-
const txData = new PrivateKernelTailCircuitPublicInputs(constantData, /*gasUsed=*/ new Gas(0, 0), /*feePayer=*/ AztecAddress.zero(), /*
|
|
414
|
+
const txData = new PrivateKernelTailCircuitPublicInputs(constantData, /*gasUsed=*/ new Gas(0, 0), /*feePayer=*/ AztecAddress.zero(), /*expirationTimestamp=*/ 0n, inputsForPublic, undefined);
|
|
403
415
|
const tx = await Tx.create({
|
|
404
416
|
data: txData,
|
|
405
417
|
chonkProof: ChonkProof.empty(),
|
|
@@ -452,16 +464,16 @@ export class TXEOracleTopLevelContext {
|
|
|
452
464
|
await forkedWorldTrees.close();
|
|
453
465
|
return returnValues ?? [];
|
|
454
466
|
}
|
|
455
|
-
async
|
|
467
|
+
async executeUtilityFunction(targetContractAddress, functionSelector, args, jobId) {
|
|
456
468
|
const artifact = await this.contractStore.getFunctionArtifact(targetContractAddress, functionSelector);
|
|
457
469
|
if (!artifact) {
|
|
458
470
|
throw new Error(`Cannot call ${functionSelector} as there is no artifact found at ${targetContractAddress}.`);
|
|
459
471
|
}
|
|
460
472
|
// Sync notes before executing utility function to discover notes from previous transactions
|
|
461
473
|
const blockHeader = await this.stateMachine.anchorBlockStore.getBlockHeader();
|
|
462
|
-
await this.stateMachine.contractSyncService.ensureContractSynced(targetContractAddress, functionSelector, async (call)=>{
|
|
463
|
-
await this.executeUtilityCall(call);
|
|
464
|
-
}, blockHeader,
|
|
474
|
+
await this.stateMachine.contractSyncService.ensureContractSynced(targetContractAddress, functionSelector, async (call, execScopes)=>{
|
|
475
|
+
await this.executeUtilityCall(call, execScopes, jobId);
|
|
476
|
+
}, blockHeader, jobId, 'ALL_SCOPES');
|
|
465
477
|
const call = FunctionCall.from({
|
|
466
478
|
name: artifact.name,
|
|
467
479
|
to: targetContractAddress,
|
|
@@ -472,9 +484,9 @@ export class TXEOracleTopLevelContext {
|
|
|
472
484
|
args,
|
|
473
485
|
returnTypes: []
|
|
474
486
|
});
|
|
475
|
-
return this.executeUtilityCall(call);
|
|
487
|
+
return this.executeUtilityCall(call, 'ALL_SCOPES', jobId);
|
|
476
488
|
}
|
|
477
|
-
async executeUtilityCall(call, scopes) {
|
|
489
|
+
async executeUtilityCall(call, scopes, jobId) {
|
|
478
490
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
479
491
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
480
492
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
@@ -499,7 +511,9 @@ export class TXEOracleTopLevelContext {
|
|
|
499
511
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
500
512
|
capsuleStore: this.capsuleStore,
|
|
501
513
|
privateEventStore: this.privateEventStore,
|
|
502
|
-
|
|
514
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
515
|
+
contractSyncService: this.contractSyncService,
|
|
516
|
+
jobId,
|
|
503
517
|
scopes
|
|
504
518
|
});
|
|
505
519
|
const acirExecutionResult = await new WASMSimulator().executeUserCircuit(toACVMWitness(0, call.args), entryPointArtifact, new Oracle(oracle).toACIRCallback()).catch((err)=>{
|
|
@@ -511,10 +525,10 @@ export class TXEOracleTopLevelContext {
|
|
|
511
525
|
cause: err
|
|
512
526
|
});
|
|
513
527
|
});
|
|
514
|
-
this.logger.verbose(`Utility
|
|
528
|
+
this.logger.verbose(`Utility execution for ${call.to}.${call.selector} completed`);
|
|
515
529
|
return witnessMapToFields(acirExecutionResult.returnWitness);
|
|
516
530
|
} catch (err) {
|
|
517
|
-
throw createSimulationError(err instanceof Error ? err : new Error('Unknown error during utility
|
|
531
|
+
throw createSimulationError(err instanceof Error ? err : new Error('Unknown error during utility execution'));
|
|
518
532
|
}
|
|
519
533
|
}
|
|
520
534
|
close() {
|