@aztec/txe 0.0.1-commit.ffe5b04ea → 0.0.1-commit.fff30aa
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/oracle/txe_oracle_top_level_context.d.ts +10 -4
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +34 -17
- package/dest/rpc_translator.d.ts +58 -20
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +171 -41
- 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/index.d.ts +4 -2
- package/dest/state_machine/index.d.ts.map +1 -1
- package/dest/state_machine/index.js +6 -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 +4 -3
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +24 -12
- package/dest/util/encoding.d.ts +40 -41
- package/dest/util/encoding.d.ts.map +1 -1
- package/package.json +15 -15
- package/src/oracle/txe_oracle_top_level_context.ts +44 -21
- package/src/rpc_translator.ts +216 -51
- package/src/state_machine/archiver.ts +5 -5
- package/src/state_machine/index.ts +5 -1
- package/src/state_machine/synchronizer.ts +4 -4
- package/src/txe_session.ts +26 -10
package/dest/txe_session.js
CHANGED
|
@@ -3,7 +3,7 @@ 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 { openTmpStore } from '@aztec/kv-store/lmdb-v2';
|
|
6
|
-
import { AddressStore, AnchorBlockStore, CapsuleStore, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
6
|
+
import { AddressStore, AnchorBlockStore, CapsuleService, CapsuleStore, ContractSyncService, JobCoordinator, NoteService, NoteStore, PrivateEventStore, RecipientTaggingStore, SenderAddressBookStore, SenderTaggingStore } from '@aztec/pxe/server';
|
|
7
7
|
import { ExecutionNoteCache, ExecutionTaggingIndexCache, HashedValuesCache, Oracle, PrivateExecutionOracle, UtilityExecutionOracle } from '@aztec/pxe/simulator';
|
|
8
8
|
import { ExecutionError, WASMSimulator, createSimulationError, extractCallStack, resolveAssertionMessageFromError, toACVMWitness } from '@aztec/simulator/client';
|
|
9
9
|
import { FunctionSelector, FunctionType } from '@aztec/stdlib/abi';
|
|
@@ -44,9 +44,10 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
44
44
|
chainId;
|
|
45
45
|
version;
|
|
46
46
|
nextBlockTimestamp;
|
|
47
|
+
contractSyncService;
|
|
47
48
|
state;
|
|
48
49
|
authwits;
|
|
49
|
-
constructor(logger, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, currentJobId, chainId, version, nextBlockTimestamp){
|
|
50
|
+
constructor(logger, stateMachine, oracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, currentJobId, chainId, version, nextBlockTimestamp, contractSyncService){
|
|
50
51
|
this.logger = logger;
|
|
51
52
|
this.stateMachine = stateMachine;
|
|
52
53
|
this.oracleHandler = oracleHandler;
|
|
@@ -65,6 +66,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
65
66
|
this.chainId = chainId;
|
|
66
67
|
this.version = version;
|
|
67
68
|
this.nextBlockTimestamp = nextBlockTimestamp;
|
|
69
|
+
this.contractSyncService = contractSyncService;
|
|
68
70
|
this.state = {
|
|
69
71
|
name: 'TOP_LEVEL'
|
|
70
72
|
};
|
|
@@ -97,9 +99,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
97
99
|
const version = new Fr(await stateMachine.node.getVersion());
|
|
98
100
|
const chainId = new Fr(await stateMachine.node.getChainId());
|
|
99
101
|
const initialJobId = jobCoordinator.beginJob();
|
|
100
|
-
const
|
|
102
|
+
const logger = createLogger('txe:session');
|
|
103
|
+
const contractSyncService = new ContractSyncService(stateMachine.node, contractStore, noteStore, logger);
|
|
104
|
+
const topLevelOracleHandler = new TXEOracleTopLevelContext(stateMachine, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, nextBlockTimestamp, version, chainId, new Map(), contractSyncService);
|
|
101
105
|
await topLevelOracleHandler.advanceBlocksBy(1);
|
|
102
|
-
return new TXESession(
|
|
106
|
+
return new TXESession(logger, stateMachine, topLevelOracleHandler, contractStore, noteStore, keyStore, addressStore, accountStore, senderTaggingStore, recipientTaggingStore, senderAddressBookStore, capsuleStore, privateEventStore, jobCoordinator, initialJobId, version, chainId, nextBlockTimestamp, contractSyncService);
|
|
103
107
|
}
|
|
104
108
|
/**
|
|
105
109
|
* Processes an oracle function invoked by the Noir test associated to this session.
|
|
@@ -158,7 +162,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
158
162
|
}
|
|
159
163
|
// Commit all staged stores from the job that was just completed, then begin a new job
|
|
160
164
|
await this.cycleJob();
|
|
161
|
-
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);
|
|
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.contractSyncService);
|
|
162
166
|
this.state = {
|
|
163
167
|
name: 'TOP_LEVEL'
|
|
164
168
|
};
|
|
@@ -170,7 +174,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
170
174
|
// build the proof), and the *next* block, i.e. the one we'll create once the execution ends, and which will contain
|
|
171
175
|
// a single transaction with the effects of what was done in the test.
|
|
172
176
|
const anchorBlock = await this.stateMachine.node.getBlockHeader(anchorBlockNumber ?? 'latest');
|
|
173
|
-
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress,
|
|
177
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlock, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
174
178
|
const latestBlock = await this.stateMachine.node.getBlockHeader('latest');
|
|
175
179
|
const nextBlockGlobalVariables = makeGlobalVariables(undefined, {
|
|
176
180
|
blockNumber: BlockNumber(latestBlock.globalVariables.blockNumber + 1),
|
|
@@ -202,11 +206,13 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
202
206
|
senderTaggingStore: this.senderTaggingStore,
|
|
203
207
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
204
208
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
205
|
-
|
|
209
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
206
210
|
privateEventStore: this.privateEventStore,
|
|
207
211
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
212
|
+
l2TipsStore: this.stateMachine.node,
|
|
208
213
|
jobId: this.currentJobId,
|
|
209
|
-
scopes:
|
|
214
|
+
scopes: await this.keyStore.getAccounts(),
|
|
215
|
+
messageContextService: this.stateMachine.messageContextService
|
|
210
216
|
});
|
|
211
217
|
// We store the note and tagging index caches fed into the PrivateExecutionOracle (along with some other auxiliary
|
|
212
218
|
// data) in order to refer to it later, mimicking the way this object is used by the ContractFunctionSimulator. The
|
|
@@ -247,7 +253,7 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
247
253
|
// we perform this. We therefore search for known nullifiers now, as otherwise notes that were nullified would not
|
|
248
254
|
// be removed from the database.
|
|
249
255
|
// TODO(#12553): make the synchronizer sync here instead and remove this
|
|
250
|
-
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress,
|
|
256
|
+
await new NoteService(this.noteStore, this.stateMachine.node, anchorBlockHeader, this.currentJobId).syncNoteNullifiers(contractAddress, await this.keyStore.getAccounts());
|
|
251
257
|
this.oracleHandler = new UtilityExecutionOracle({
|
|
252
258
|
contractAddress,
|
|
253
259
|
authWitnesses: [],
|
|
@@ -260,10 +266,13 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
260
266
|
aztecNode: this.stateMachine.node,
|
|
261
267
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
262
268
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
263
|
-
|
|
269
|
+
capsuleService: new CapsuleService(this.capsuleStore, await this.keyStore.getAccounts()),
|
|
264
270
|
privateEventStore: this.privateEventStore,
|
|
271
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
272
|
+
contractSyncService: this.contractSyncService,
|
|
273
|
+
l2TipsStore: this.stateMachine.node,
|
|
265
274
|
jobId: this.currentJobId,
|
|
266
|
-
scopes:
|
|
275
|
+
scopes: await this.keyStore.getAccounts()
|
|
267
276
|
});
|
|
268
277
|
this.state = {
|
|
269
278
|
name: 'UTILITY'
|
|
@@ -339,8 +348,11 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
339
348
|
aztecNode: this.stateMachine.node,
|
|
340
349
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
341
350
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
342
|
-
|
|
351
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
343
352
|
privateEventStore: this.privateEventStore,
|
|
353
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
354
|
+
contractSyncService: this.contractSyncService,
|
|
355
|
+
l2TipsStore: this.stateMachine.node,
|
|
344
356
|
jobId: this.currentJobId,
|
|
345
357
|
scopes
|
|
346
358
|
});
|
package/dest/util/encoding.d.ts
CHANGED
|
@@ -258,16 +258,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
258
258
|
acir_locations: Record<string, number>;
|
|
259
259
|
brillig_locations: Record<string, Record<string, number>>;
|
|
260
260
|
}>;
|
|
261
|
-
files: z.
|
|
262
|
-
source: z.ZodString;
|
|
263
|
-
path: z.ZodString;
|
|
264
|
-
}, "strip", z.ZodTypeAny, {
|
|
265
|
-
source: string;
|
|
266
|
-
path: string;
|
|
267
|
-
}, {
|
|
268
|
-
source: string;
|
|
269
|
-
path: string;
|
|
270
|
-
}>>;
|
|
261
|
+
files: z.ZodType<import("@aztec/stdlib/abi").DebugFileMap, z.ZodTypeDef, import("@aztec/stdlib/abi").DebugFileMap>;
|
|
271
262
|
}, "strip", z.ZodTypeAny, {
|
|
272
263
|
debugSymbols: {
|
|
273
264
|
location_tree: {
|
|
@@ -285,10 +276,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
285
276
|
acir_locations: Record<string, number>;
|
|
286
277
|
brillig_locations: Record<string, Record<string, number>>;
|
|
287
278
|
};
|
|
288
|
-
files:
|
|
289
|
-
source: string;
|
|
290
|
-
path: string;
|
|
291
|
-
}>;
|
|
279
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
292
280
|
}, {
|
|
293
281
|
debugSymbols: {
|
|
294
282
|
location_tree: {
|
|
@@ -306,10 +294,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
306
294
|
acir_locations: Record<string, number>;
|
|
307
295
|
brillig_locations: Record<string, Record<string, number>>;
|
|
308
296
|
};
|
|
309
|
-
files:
|
|
310
|
-
source: string;
|
|
311
|
-
path: string;
|
|
312
|
-
}>;
|
|
297
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
313
298
|
}>>;
|
|
314
299
|
}, "strip", z.ZodTypeAny, {
|
|
315
300
|
bytecode: Buffer<ArrayBufferLike>;
|
|
@@ -332,10 +317,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
332
317
|
acir_locations: Record<string, number>;
|
|
333
318
|
brillig_locations: Record<string, Record<string, number>>;
|
|
334
319
|
};
|
|
335
|
-
files:
|
|
336
|
-
source: string;
|
|
337
|
-
path: string;
|
|
338
|
-
}>;
|
|
320
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
339
321
|
} | undefined;
|
|
340
322
|
}, {
|
|
341
323
|
bytecode?: any;
|
|
@@ -358,10 +340,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
358
340
|
acir_locations: Record<string, number>;
|
|
359
341
|
brillig_locations: Record<string, Record<string, number>>;
|
|
360
342
|
};
|
|
361
|
-
files:
|
|
362
|
-
source: string;
|
|
363
|
-
path: string;
|
|
364
|
-
}>;
|
|
343
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
365
344
|
} | undefined;
|
|
366
345
|
}>>, "many">;
|
|
367
346
|
nonDispatchPublicFunctions: z.ZodArray<z.ZodObject<{
|
|
@@ -474,16 +453,41 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
474
453
|
}, {
|
|
475
454
|
slot: string;
|
|
476
455
|
}>>;
|
|
477
|
-
fileMap: z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
456
|
+
fileMap: z.ZodEffects<z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
478
457
|
source: z.ZodString;
|
|
479
458
|
path: z.ZodString;
|
|
459
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
460
|
+
start: z.ZodNumber;
|
|
461
|
+
name: z.ZodString;
|
|
462
|
+
}, "strip", z.ZodTypeAny, {
|
|
463
|
+
start: number;
|
|
464
|
+
name: string;
|
|
465
|
+
}, {
|
|
466
|
+
start: number;
|
|
467
|
+
name: string;
|
|
468
|
+
}>, "many">;
|
|
480
469
|
}, "strip", z.ZodTypeAny, {
|
|
481
470
|
source: string;
|
|
482
471
|
path: string;
|
|
472
|
+
function_locations: {
|
|
473
|
+
start: number;
|
|
474
|
+
name: string;
|
|
475
|
+
}[];
|
|
483
476
|
}, {
|
|
484
477
|
source: string;
|
|
485
478
|
path: string;
|
|
486
|
-
|
|
479
|
+
function_locations: {
|
|
480
|
+
start: number;
|
|
481
|
+
name: string;
|
|
482
|
+
}[];
|
|
483
|
+
}>>, Record<number, {
|
|
484
|
+
source: string;
|
|
485
|
+
path: string;
|
|
486
|
+
function_locations: {
|
|
487
|
+
start: number;
|
|
488
|
+
name: string;
|
|
489
|
+
}[];
|
|
490
|
+
}>, unknown>;
|
|
487
491
|
}, "strip", z.ZodTypeAny, {
|
|
488
492
|
name: string;
|
|
489
493
|
functions: ({
|
|
@@ -529,10 +533,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
529
533
|
acir_locations: Record<string, number>;
|
|
530
534
|
brillig_locations: Record<string, Record<string, number>>;
|
|
531
535
|
};
|
|
532
|
-
files:
|
|
533
|
-
source: string;
|
|
534
|
-
path: string;
|
|
535
|
-
}>;
|
|
536
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
536
537
|
} | undefined;
|
|
537
538
|
})[];
|
|
538
539
|
nonDispatchPublicFunctions: {
|
|
@@ -568,6 +569,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
568
569
|
fileMap: Record<number, {
|
|
569
570
|
source: string;
|
|
570
571
|
path: string;
|
|
572
|
+
function_locations: {
|
|
573
|
+
start: number;
|
|
574
|
+
name: string;
|
|
575
|
+
}[];
|
|
571
576
|
}>;
|
|
572
577
|
}, {
|
|
573
578
|
name: string;
|
|
@@ -614,10 +619,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
614
619
|
acir_locations: Record<string, number>;
|
|
615
620
|
brillig_locations: Record<string, Record<string, number>>;
|
|
616
621
|
};
|
|
617
|
-
files:
|
|
618
|
-
source: string;
|
|
619
|
-
path: string;
|
|
620
|
-
}>;
|
|
622
|
+
files: import("@aztec/stdlib/abi").DebugFileMap;
|
|
621
623
|
} | undefined;
|
|
622
624
|
})[];
|
|
623
625
|
nonDispatchPublicFunctions: {
|
|
@@ -650,10 +652,7 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
650
652
|
storageLayout: Record<string, {
|
|
651
653
|
slot: string;
|
|
652
654
|
}>;
|
|
653
|
-
fileMap
|
|
654
|
-
source: string;
|
|
655
|
-
path: string;
|
|
656
|
-
}>;
|
|
655
|
+
fileMap?: unknown;
|
|
657
656
|
}>, z.ZodIntersection<z.ZodObject<{
|
|
658
657
|
version: z.ZodLiteral<1>;
|
|
659
658
|
salt: import("@aztec/foundation/schemas").ZodFor<Fr>;
|
|
@@ -717,4 +716,4 @@ export declare const ForeignCallResultSchema: z.ZodObject<{
|
|
|
717
716
|
}, {
|
|
718
717
|
values: (string | string[])[];
|
|
719
718
|
}>;
|
|
720
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
719
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5jb2RpbmcuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy91dGlsL2VuY29kaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxFQUFFLEVBQU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;;;;;;;;;;;;;;;;;;;;;;;;cAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/txe",
|
|
3
|
-
"version": "0.0.1-commit.
|
|
3
|
+
"version": "0.0.1-commit.fff30aa",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"bin": "./dest/bin/index.js",
|
|
@@ -61,20 +61,20 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aztec/accounts": "0.0.1-commit.
|
|
65
|
-
"@aztec/archiver": "0.0.1-commit.
|
|
66
|
-
"@aztec/aztec-node": "0.0.1-commit.
|
|
67
|
-
"@aztec/aztec.js": "0.0.1-commit.
|
|
68
|
-
"@aztec/bb-prover": "0.0.1-commit.
|
|
69
|
-
"@aztec/constants": "0.0.1-commit.
|
|
70
|
-
"@aztec/foundation": "0.0.1-commit.
|
|
71
|
-
"@aztec/key-store": "0.0.1-commit.
|
|
72
|
-
"@aztec/kv-store": "0.0.1-commit.
|
|
73
|
-
"@aztec/protocol-contracts": "0.0.1-commit.
|
|
74
|
-
"@aztec/pxe": "0.0.1-commit.
|
|
75
|
-
"@aztec/simulator": "0.0.1-commit.
|
|
76
|
-
"@aztec/stdlib": "0.0.1-commit.
|
|
77
|
-
"@aztec/world-state": "0.0.1-commit.
|
|
64
|
+
"@aztec/accounts": "0.0.1-commit.fff30aa",
|
|
65
|
+
"@aztec/archiver": "0.0.1-commit.fff30aa",
|
|
66
|
+
"@aztec/aztec-node": "0.0.1-commit.fff30aa",
|
|
67
|
+
"@aztec/aztec.js": "0.0.1-commit.fff30aa",
|
|
68
|
+
"@aztec/bb-prover": "0.0.1-commit.fff30aa",
|
|
69
|
+
"@aztec/constants": "0.0.1-commit.fff30aa",
|
|
70
|
+
"@aztec/foundation": "0.0.1-commit.fff30aa",
|
|
71
|
+
"@aztec/key-store": "0.0.1-commit.fff30aa",
|
|
72
|
+
"@aztec/kv-store": "0.0.1-commit.fff30aa",
|
|
73
|
+
"@aztec/protocol-contracts": "0.0.1-commit.fff30aa",
|
|
74
|
+
"@aztec/pxe": "0.0.1-commit.fff30aa",
|
|
75
|
+
"@aztec/simulator": "0.0.1-commit.fff30aa",
|
|
76
|
+
"@aztec/stdlib": "0.0.1-commit.fff30aa",
|
|
77
|
+
"@aztec/world-state": "0.0.1-commit.fff30aa",
|
|
78
78
|
"zod": "^3.23.8"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CONTRACT_INSTANCE_REGISTRY_CONTRACT_ADDRESS,
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
DEFAULT_TEARDOWN_DA_GAS_LIMIT,
|
|
6
|
-
DEFAULT_TEARDOWN_L2_GAS_LIMIT,
|
|
3
|
+
MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT,
|
|
4
|
+
MAX_PROCESSABLE_L2_GAS,
|
|
7
5
|
NUMBER_OF_L1_L2_MESSAGES_PER_ROLLUP,
|
|
8
6
|
} from '@aztec/constants';
|
|
9
7
|
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
@@ -12,13 +10,14 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
12
10
|
import { LogLevels, type Logger, applyStringFormatting, createLogger } from '@aztec/foundation/log';
|
|
13
11
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
14
12
|
import type { KeyStore } from '@aztec/key-store';
|
|
15
|
-
import type { AccessScopes } from '@aztec/pxe/client/lazy';
|
|
16
13
|
import {
|
|
17
14
|
AddressStore,
|
|
15
|
+
CapsuleService,
|
|
18
16
|
CapsuleStore,
|
|
19
17
|
type ContractStore,
|
|
18
|
+
type ContractSyncService,
|
|
20
19
|
NoteStore,
|
|
21
|
-
|
|
20
|
+
ORACLE_VERSION_MAJOR,
|
|
22
21
|
PrivateEventStore,
|
|
23
22
|
RecipientTaggingStore,
|
|
24
23
|
SenderAddressBookStore,
|
|
@@ -56,7 +55,13 @@ import { AuthWitness } from '@aztec/stdlib/auth-witness';
|
|
|
56
55
|
import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
|
|
57
56
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
58
57
|
import { type ContractInstanceWithAddress, computePartialAddress } from '@aztec/stdlib/contract';
|
|
59
|
-
import {
|
|
58
|
+
import {
|
|
59
|
+
FALLBACK_TEARDOWN_DA_GAS_LIMIT,
|
|
60
|
+
FALLBACK_TEARDOWN_L2_GAS_LIMIT,
|
|
61
|
+
Gas,
|
|
62
|
+
GasFees,
|
|
63
|
+
GasSettings,
|
|
64
|
+
} from '@aztec/stdlib/gas';
|
|
60
65
|
import { computeCalldataHash, computeProtocolNullifier, siloNullifier } from '@aztec/stdlib/hash';
|
|
61
66
|
import {
|
|
62
67
|
PartialPrivateTailPublicInputsForPublic,
|
|
@@ -111,17 +116,30 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
111
116
|
private version: Fr,
|
|
112
117
|
private chainId: Fr,
|
|
113
118
|
private authwits: Map<string, AuthWitness>,
|
|
119
|
+
private readonly contractSyncService: ContractSyncService,
|
|
114
120
|
) {
|
|
115
121
|
this.logger = createLogger('txe:top_level_context');
|
|
116
122
|
this.logger.debug('Entering Top Level Context');
|
|
117
123
|
}
|
|
118
124
|
|
|
119
|
-
|
|
120
|
-
|
|
125
|
+
private contractOracleVersion: { major: number; minor: number } | undefined;
|
|
126
|
+
|
|
127
|
+
assertCompatibleOracleVersion(major: number, minor: number): void {
|
|
128
|
+
if (major !== ORACLE_VERSION_MAJOR) {
|
|
129
|
+
const hint =
|
|
130
|
+
major > ORACLE_VERSION_MAJOR
|
|
131
|
+
? '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.'
|
|
132
|
+
: '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.';
|
|
121
133
|
throw new Error(
|
|
122
|
-
`Incompatible
|
|
134
|
+
`Incompatible aztec cli version: ${hint} See https://docs.aztec.network/errors/8 (expected oracle major version ${ORACLE_VERSION_MAJOR}, got ${major})`,
|
|
123
135
|
);
|
|
124
136
|
}
|
|
137
|
+
this.contractOracleVersion = { major, minor };
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// Prefixed with "nonOracleFunction" as it is not used as an oracle handler.
|
|
141
|
+
nonOracleFunctionGetContractOracleVersion(): { major: number; minor: number } | undefined {
|
|
142
|
+
return this.contractOracleVersion;
|
|
125
143
|
}
|
|
126
144
|
|
|
127
145
|
// This is typically only invoked in private contexts, but it is convenient to also have it in top-level for testing
|
|
@@ -322,7 +340,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
322
340
|
const effectiveScopes = from.isZero() ? [] : [from];
|
|
323
341
|
|
|
324
342
|
// Sync notes before executing private function to discover notes from previous transactions
|
|
325
|
-
const utilityExecutor = async (call: FunctionCall, execScopes:
|
|
343
|
+
const utilityExecutor = async (call: FunctionCall, execScopes: AztecAddress[]) => {
|
|
326
344
|
await this.executeUtilityCall(call, execScopes, jobId);
|
|
327
345
|
};
|
|
328
346
|
|
|
@@ -340,8 +358,8 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
340
358
|
|
|
341
359
|
const callContext = new CallContext(from, targetContractAddress, functionSelector, isStaticCall);
|
|
342
360
|
|
|
343
|
-
const gasLimits = new Gas(
|
|
344
|
-
const teardownGasLimits = new Gas(
|
|
361
|
+
const gasLimits = new Gas(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS);
|
|
362
|
+
const teardownGasLimits = new Gas(FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT);
|
|
345
363
|
const gasSettings = new GasSettings(gasLimits, teardownGasLimits, GasFees.empty(), GasFees.empty());
|
|
346
364
|
|
|
347
365
|
const txContext = new TxContext(this.chainId, this.version, gasSettings);
|
|
@@ -376,7 +394,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
376
394
|
senderTaggingStore: this.senderTaggingStore,
|
|
377
395
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
378
396
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
379
|
-
|
|
397
|
+
capsuleService: new CapsuleService(this.capsuleStore, effectiveScopes),
|
|
380
398
|
privateEventStore: this.privateEventStore,
|
|
381
399
|
contractSyncService: this.stateMachine.contractSyncService,
|
|
382
400
|
jobId,
|
|
@@ -387,6 +405,8 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
387
405
|
// contract would perform, including setting senderForTags.
|
|
388
406
|
senderForTags: from,
|
|
389
407
|
simulator,
|
|
408
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
409
|
+
l2TipsStore: this.stateMachine.node,
|
|
390
410
|
});
|
|
391
411
|
|
|
392
412
|
// 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.
|
|
@@ -409,7 +429,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
409
429
|
);
|
|
410
430
|
const publicFunctionsCalldata = await Promise.all(
|
|
411
431
|
publicCallRequests.map(async r => {
|
|
412
|
-
const calldata = await privateExecutionOracle.
|
|
432
|
+
const calldata = await privateExecutionOracle.getHashPreimage(r.calldataHash);
|
|
413
433
|
return new HashedValues(calldata, r.calldataHash);
|
|
414
434
|
}),
|
|
415
435
|
);
|
|
@@ -535,9 +555,9 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
535
555
|
|
|
536
556
|
const blockNumber = await this.getNextBlockNumber();
|
|
537
557
|
|
|
538
|
-
const gasLimits = new Gas(
|
|
558
|
+
const gasLimits = new Gas(MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT, MAX_PROCESSABLE_L2_GAS);
|
|
539
559
|
|
|
540
|
-
const teardownGasLimits = new Gas(
|
|
560
|
+
const teardownGasLimits = new Gas(FALLBACK_TEARDOWN_DA_GAS_LIMIT, FALLBACK_TEARDOWN_L2_GAS_LIMIT);
|
|
541
561
|
|
|
542
562
|
const gasSettings = new GasSettings(gasLimits, teardownGasLimits, GasFees.empty(), GasFees.empty());
|
|
543
563
|
|
|
@@ -699,7 +719,7 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
699
719
|
},
|
|
700
720
|
blockHeader,
|
|
701
721
|
jobId,
|
|
702
|
-
|
|
722
|
+
await this.keyStore.getAccounts(),
|
|
703
723
|
);
|
|
704
724
|
|
|
705
725
|
const call = FunctionCall.from({
|
|
@@ -713,10 +733,10 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
713
733
|
returnTypes: [],
|
|
714
734
|
});
|
|
715
735
|
|
|
716
|
-
return this.executeUtilityCall(call,
|
|
736
|
+
return this.executeUtilityCall(call, await this.keyStore.getAccounts(), jobId);
|
|
717
737
|
}
|
|
718
738
|
|
|
719
|
-
private async executeUtilityCall(call: FunctionCall, scopes:
|
|
739
|
+
private async executeUtilityCall(call: FunctionCall, scopes: AztecAddress[], jobId: string): Promise<Fr[]> {
|
|
720
740
|
const entryPointArtifact = await this.contractStore.getFunctionArtifactWithDebugMetadata(call.to, call.selector);
|
|
721
741
|
if (entryPointArtifact.functionType !== FunctionType.UTILITY) {
|
|
722
742
|
throw new Error(`Cannot run ${entryPointArtifact.functionType} function as utility`);
|
|
@@ -741,8 +761,11 @@ export class TXEOracleTopLevelContext implements IMiscOracle, ITxeExecutionOracl
|
|
|
741
761
|
aztecNode: this.stateMachine.node,
|
|
742
762
|
recipientTaggingStore: this.recipientTaggingStore,
|
|
743
763
|
senderAddressBookStore: this.senderAddressBookStore,
|
|
744
|
-
|
|
764
|
+
capsuleService: new CapsuleService(this.capsuleStore, scopes),
|
|
745
765
|
privateEventStore: this.privateEventStore,
|
|
766
|
+
messageContextService: this.stateMachine.messageContextService,
|
|
767
|
+
contractSyncService: this.contractSyncService,
|
|
768
|
+
l2TipsStore: this.stateMachine.node,
|
|
746
769
|
jobId,
|
|
747
770
|
scopes,
|
|
748
771
|
});
|