@aztec/txe 0.0.1-commit.27d773e65 → 0.0.1-commit.2b2662070
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 +28 -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 -21
- package/dest/oracle/txe_oracle_top_level_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_top_level_context.js +56 -39
- package/dest/rpc_translator.d.ts +120 -82
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +371 -161
- 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 +4 -3
- package/dest/txe_session.d.ts.map +1 -1
- package/dest/txe_session.js +27 -15
- 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 +27 -31
- package/src/oracle/txe_oracle_public_context.ts +12 -12
- package/src/oracle/txe_oracle_top_level_context.ts +66 -43
- package/src/rpc_translator.ts +430 -182
- 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 +8 -2
- package/src/state_machine/mock_epoch_cache.ts +46 -3
- package/src/state_machine/synchronizer.ts +4 -4
- package/src/txe_session.ts +29 -13
- package/src/util/encoding.ts +5 -0
- package/src/util/txe_public_contract_data_source.ts +0 -2
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
|
|
101
|
-
|
|
102
|
-
|
|
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);
|
|
105
|
+
await topLevelOracleHandler.advanceBlocksBy(1);
|
|
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'
|
|
@@ -276,8 +285,8 @@ import { makeTxEffect } from './utils/tx_effect_creation.js';
|
|
|
276
285
|
}
|
|
277
286
|
// Note that while all public and private contexts do is build a single block that we then process when exiting
|
|
278
287
|
// those, the top level context performs a large number of actions not captured in the following 'close' call. Among
|
|
279
|
-
// others, it will create empty blocks (via `
|
|
280
|
-
// `
|
|
288
|
+
// others, it will create empty blocks (via `advanceBlocksBy` and `deploy`), create blocks with transactions via
|
|
289
|
+
// `privateCallNewFlow` and `publicCallNewFlow`, add accounts to PXE via `addAccount`, etc. This is a
|
|
281
290
|
// slight inconsistency in the working model of this class, but is not too bad.
|
|
282
291
|
// TODO: it's quite unfortunate that we need to capture the authwits created to later pass them again when the top
|
|
283
292
|
// level context is re-created. This is because authwits create a temporary utility context that'd otherwise reset
|
|
@@ -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
|
@@ -2,6 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
3
3
|
import { type ContractArtifact } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
5
6
|
import { type ContractInstanceWithAddress } from '@aztec/stdlib/contract';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
export type ForeignCallSingle = string;
|
|
@@ -12,6 +13,7 @@ export type ForeignCallResult = {
|
|
|
12
13
|
};
|
|
13
14
|
export declare function fromSingle(obj: ForeignCallSingle): Fr;
|
|
14
15
|
export declare function addressFromSingle(obj: ForeignCallSingle): AztecAddress;
|
|
16
|
+
export declare function blockHashFromSingle(obj: ForeignCallSingle): BlockHash;
|
|
15
17
|
export declare function fromArray(obj: ForeignCallArray): Fr[];
|
|
16
18
|
/**
|
|
17
19
|
* Converts an array of Noir unsigned integers to a single tightly-packed buffer.
|
|
@@ -261,12 +263,30 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
261
263
|
files: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
262
264
|
source: z.ZodString;
|
|
263
265
|
path: z.ZodString;
|
|
266
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
267
|
+
start: z.ZodNumber;
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
}, "strip", z.ZodTypeAny, {
|
|
270
|
+
start: number;
|
|
271
|
+
name: string;
|
|
272
|
+
}, {
|
|
273
|
+
start: number;
|
|
274
|
+
name: string;
|
|
275
|
+
}>, "many">;
|
|
264
276
|
}, "strip", z.ZodTypeAny, {
|
|
265
277
|
source: string;
|
|
266
278
|
path: string;
|
|
279
|
+
function_locations: {
|
|
280
|
+
start: number;
|
|
281
|
+
name: string;
|
|
282
|
+
}[];
|
|
267
283
|
}, {
|
|
268
284
|
source: string;
|
|
269
285
|
path: string;
|
|
286
|
+
function_locations: {
|
|
287
|
+
start: number;
|
|
288
|
+
name: string;
|
|
289
|
+
}[];
|
|
270
290
|
}>>;
|
|
271
291
|
}, "strip", z.ZodTypeAny, {
|
|
272
292
|
debugSymbols: {
|
|
@@ -288,6 +308,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
288
308
|
files: Record<string, {
|
|
289
309
|
source: string;
|
|
290
310
|
path: string;
|
|
311
|
+
function_locations: {
|
|
312
|
+
start: number;
|
|
313
|
+
name: string;
|
|
314
|
+
}[];
|
|
291
315
|
}>;
|
|
292
316
|
}, {
|
|
293
317
|
debugSymbols: {
|
|
@@ -309,6 +333,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
309
333
|
files: Record<string, {
|
|
310
334
|
source: string;
|
|
311
335
|
path: string;
|
|
336
|
+
function_locations: {
|
|
337
|
+
start: number;
|
|
338
|
+
name: string;
|
|
339
|
+
}[];
|
|
312
340
|
}>;
|
|
313
341
|
}>>;
|
|
314
342
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -335,6 +363,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
335
363
|
files: Record<string, {
|
|
336
364
|
source: string;
|
|
337
365
|
path: string;
|
|
366
|
+
function_locations: {
|
|
367
|
+
start: number;
|
|
368
|
+
name: string;
|
|
369
|
+
}[];
|
|
338
370
|
}>;
|
|
339
371
|
} | undefined;
|
|
340
372
|
}, {
|
|
@@ -361,6 +393,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
361
393
|
files: Record<string, {
|
|
362
394
|
source: string;
|
|
363
395
|
path: string;
|
|
396
|
+
function_locations: {
|
|
397
|
+
start: number;
|
|
398
|
+
name: string;
|
|
399
|
+
}[];
|
|
364
400
|
}>;
|
|
365
401
|
} | undefined;
|
|
366
402
|
}>>, "many">;
|
|
@@ -477,12 +513,30 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
477
513
|
fileMap: z.ZodRecord<z.ZodNumber, z.ZodObject<{
|
|
478
514
|
source: z.ZodString;
|
|
479
515
|
path: z.ZodString;
|
|
516
|
+
function_locations: z.ZodArray<z.ZodObject<{
|
|
517
|
+
start: z.ZodNumber;
|
|
518
|
+
name: z.ZodString;
|
|
519
|
+
}, "strip", z.ZodTypeAny, {
|
|
520
|
+
start: number;
|
|
521
|
+
name: string;
|
|
522
|
+
}, {
|
|
523
|
+
start: number;
|
|
524
|
+
name: string;
|
|
525
|
+
}>, "many">;
|
|
480
526
|
}, "strip", z.ZodTypeAny, {
|
|
481
527
|
source: string;
|
|
482
528
|
path: string;
|
|
529
|
+
function_locations: {
|
|
530
|
+
start: number;
|
|
531
|
+
name: string;
|
|
532
|
+
}[];
|
|
483
533
|
}, {
|
|
484
534
|
source: string;
|
|
485
535
|
path: string;
|
|
536
|
+
function_locations: {
|
|
537
|
+
start: number;
|
|
538
|
+
name: string;
|
|
539
|
+
}[];
|
|
486
540
|
}>>;
|
|
487
541
|
}, "strip", z.ZodTypeAny, {
|
|
488
542
|
name: string;
|
|
@@ -532,6 +586,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
532
586
|
files: Record<string, {
|
|
533
587
|
source: string;
|
|
534
588
|
path: string;
|
|
589
|
+
function_locations: {
|
|
590
|
+
start: number;
|
|
591
|
+
name: string;
|
|
592
|
+
}[];
|
|
535
593
|
}>;
|
|
536
594
|
} | undefined;
|
|
537
595
|
})[];
|
|
@@ -568,6 +626,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
568
626
|
fileMap: Record<number, {
|
|
569
627
|
source: string;
|
|
570
628
|
path: string;
|
|
629
|
+
function_locations: {
|
|
630
|
+
start: number;
|
|
631
|
+
name: string;
|
|
632
|
+
}[];
|
|
571
633
|
}>;
|
|
572
634
|
}, {
|
|
573
635
|
name: string;
|
|
@@ -617,6 +679,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
617
679
|
files: Record<string, {
|
|
618
680
|
source: string;
|
|
619
681
|
path: string;
|
|
682
|
+
function_locations: {
|
|
683
|
+
start: number;
|
|
684
|
+
name: string;
|
|
685
|
+
}[];
|
|
620
686
|
}>;
|
|
621
687
|
} | undefined;
|
|
622
688
|
})[];
|
|
@@ -653,6 +719,10 @@ export declare const ForeignCallArgsSchema: z.ZodArray<z.ZodUnion<[z.ZodString,
|
|
|
653
719
|
fileMap: Record<number, {
|
|
654
720
|
source: string;
|
|
655
721
|
path: string;
|
|
722
|
+
function_locations: {
|
|
723
|
+
start: number;
|
|
724
|
+
name: string;
|
|
725
|
+
}[];
|
|
656
726
|
}>;
|
|
657
727
|
}>, z.ZodIntersection<z.ZodObject<{
|
|
658
728
|
version: z.ZodLiteral<1>;
|
|
@@ -717,4 +787,4 @@ export declare const ForeignCallResultSchema: z.ZodObject<{
|
|
|
717
787
|
}, {
|
|
718
788
|
values: (string | string[])[];
|
|
719
789
|
}>;
|
|
720
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
790
|
+
//# sourceMappingURL=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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAEjC,CAAC;AAEF,eAAO,MAAM,uBAAuB;;;;;;EAElC,CAAC"}
|
package/dest/util/encoding.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Fr } from '@aztec/foundation/curves/bn254';
|
|
|
2
2
|
import { hexToBuffer } from '@aztec/foundation/string';
|
|
3
3
|
import { ContractArtifactSchema } from '@aztec/stdlib/abi';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
+
import { BlockHash } from '@aztec/stdlib/block';
|
|
5
6
|
import { ContractInstanceWithAddressSchema } from '@aztec/stdlib/contract';
|
|
6
7
|
import { z } from 'zod';
|
|
7
8
|
export function fromSingle(obj) {
|
|
@@ -10,6 +11,9 @@ export function fromSingle(obj) {
|
|
|
10
11
|
export function addressFromSingle(obj) {
|
|
11
12
|
return new AztecAddress(fromSingle(obj));
|
|
12
13
|
}
|
|
14
|
+
export function blockHashFromSingle(obj) {
|
|
15
|
+
return new BlockHash(fromSingle(obj));
|
|
16
|
+
}
|
|
13
17
|
export function fromArray(obj) {
|
|
14
18
|
return obj.map((str)=>Fr.fromBuffer(hexToBuffer(str)));
|
|
15
19
|
}
|
|
@@ -17,4 +17,4 @@ export declare class TXEPublicContractDataSource implements ContractDataSource {
|
|
|
17
17
|
getDebugFunctionName(address: AztecAddress, selector: FunctionSelector): Promise<string | undefined>;
|
|
18
18
|
registerContractFunctionSignatures(_signatures: []): Promise<void>;
|
|
19
19
|
}
|
|
20
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
20
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3V0aWwvdHhlX3B1YmxpY19jb250cmFjdF9kYXRhX3NvdXJjZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsV0FBVyxFQUFFLE1BQU0saUNBQWlDLENBQUM7QUFDOUQsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLGdDQUFnQyxDQUFDO0FBQ3BELE9BQU8sS0FBSyxFQUFFLGFBQWEsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQ3ZELE9BQU8sRUFBRSxLQUFLLGdCQUFnQixFQUFFLGdCQUFnQixFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDNUUsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0sNkJBQTZCLENBQUM7QUFDaEUsT0FBTyxLQUFLLEVBQUUsbUJBQW1CLEVBQUUsa0JBQWtCLEVBQUUsMkJBQTJCLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUVuSCxxQkFBYSwy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,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAEnH,qBAAa,2BAA4B,YAAW,kBAAkB;IAElE,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,aAAa;IAFvB,YACU,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAClC;IAEJ,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAErC;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"txe_public_contract_data_source.d.ts","sourceRoot":"","sources":["../../src/util/txe_public_contract_data_source.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,MAAM,wBAAwB,CAAC;AAEnH,qBAAa,2BAA4B,YAAW,kBAAkB;IAElE,OAAO,CAAC,WAAW;IACnB,OAAO,CAAC,aAAa;IAFvB,YACU,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,EAClC;IAEJ,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAErC;IAEK,gBAAgB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAYvE;IAEK,qBAAqB,CAAC,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,EAAE,GAAG,SAAS,CAAC,CAG3D;IAEK,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,2BAA2B,GAAG,SAAS,CAAC,CAGzF;IAED,mBAAmB,IAAI,OAAO,CAAC,EAAE,EAAE,CAAC,CAEnC;IAEK,mBAAmB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,gBAAgB,GAAG,SAAS,CAAC,CAGtF;IAEK,oBAAoB,CAAC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAEzG;IAED,kCAAkC,CAAC,WAAW,EAAE,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACF"}
|
|
@@ -18,9 +18,7 @@ export class TXEPublicContractDataSource {
|
|
|
18
18
|
artifactHash: contractClass.artifactHash,
|
|
19
19
|
packedBytecode: contractClass.packedBytecode,
|
|
20
20
|
privateFunctionsRoot: contractClass.privateFunctionsRoot,
|
|
21
|
-
version: contractClass.version
|
|
22
|
-
privateFunctions: [],
|
|
23
|
-
utilityFunctions: []
|
|
21
|
+
version: contractClass.version
|
|
24
22
|
};
|
|
25
23
|
}
|
|
26
24
|
async getBytecodeCommitment(id) {
|
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.2b2662070",
|
|
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.2b2662070",
|
|
65
|
+
"@aztec/archiver": "0.0.1-commit.2b2662070",
|
|
66
|
+
"@aztec/aztec-node": "0.0.1-commit.2b2662070",
|
|
67
|
+
"@aztec/aztec.js": "0.0.1-commit.2b2662070",
|
|
68
|
+
"@aztec/bb-prover": "0.0.1-commit.2b2662070",
|
|
69
|
+
"@aztec/constants": "0.0.1-commit.2b2662070",
|
|
70
|
+
"@aztec/foundation": "0.0.1-commit.2b2662070",
|
|
71
|
+
"@aztec/key-store": "0.0.1-commit.2b2662070",
|
|
72
|
+
"@aztec/kv-store": "0.0.1-commit.2b2662070",
|
|
73
|
+
"@aztec/protocol-contracts": "0.0.1-commit.2b2662070",
|
|
74
|
+
"@aztec/pxe": "0.0.1-commit.2b2662070",
|
|
75
|
+
"@aztec/simulator": "0.0.1-commit.2b2662070",
|
|
76
|
+
"@aztec/stdlib": "0.0.1-commit.2b2662070",
|
|
77
|
+
"@aztec/world-state": "0.0.1-commit.2b2662070",
|
|
78
78
|
"zod": "^3.23.8"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
package/src/index.ts
CHANGED
|
@@ -32,6 +32,7 @@ import {
|
|
|
32
32
|
type ForeignCallResult,
|
|
33
33
|
ForeignCallResultSchema,
|
|
34
34
|
type ForeignCallSingle,
|
|
35
|
+
addressFromSingle,
|
|
35
36
|
fromArray,
|
|
36
37
|
fromSingle,
|
|
37
38
|
toSingle,
|
|
@@ -105,6 +106,8 @@ class TXEDispatcher {
|
|
|
105
106
|
|
|
106
107
|
const decodedArgs = fromArray(inputs[3] as ForeignCallArray);
|
|
107
108
|
const secret = fromSingle(inputs[4] as ForeignCallSingle);
|
|
109
|
+
const salt = fromSingle(inputs[5] as ForeignCallSingle);
|
|
110
|
+
const deployer = addressFromSingle(inputs[6] as ForeignCallSingle);
|
|
108
111
|
const publicKeys = secret.equals(Fr.ZERO) ? PublicKeys.default() : (await deriveKeys(secret)).publicKeys;
|
|
109
112
|
const publicKeysHash = await publicKeys.hash();
|
|
110
113
|
|
|
@@ -135,7 +138,7 @@ class TXEDispatcher {
|
|
|
135
138
|
|
|
136
139
|
const cacheKey = `${contractDirectory ?? ''}-${contractFilename}-${initializer}-${decodedArgs
|
|
137
140
|
.map(arg => arg.toString())
|
|
138
|
-
.join('-')}-${publicKeysHash}-${fileHash}`;
|
|
141
|
+
.join('-')}-${publicKeysHash}-${salt}-${deployer}-${fileHash}`;
|
|
139
142
|
|
|
140
143
|
let instance;
|
|
141
144
|
let artifact: ContractArtifactWithHash;
|
|
@@ -161,10 +164,10 @@ class TXEDispatcher {
|
|
|
161
164
|
const computedInstance = await getContractInstanceFromInstantiationParams(computedArtifact, {
|
|
162
165
|
constructorArgs: decodedArgs,
|
|
163
166
|
skipArgsDecoding: true,
|
|
164
|
-
salt
|
|
167
|
+
salt,
|
|
165
168
|
publicKeys,
|
|
166
169
|
constructorArtifact: initializer ? initializer : undefined,
|
|
167
|
-
deployer
|
|
170
|
+
deployer,
|
|
168
171
|
});
|
|
169
172
|
const result = { artifact: computedArtifact, instance: computedInstance };
|
|
170
173
|
TXEArtifactsCache.set(cacheKey, result);
|
|
@@ -247,11 +250,11 @@ class TXEDispatcher {
|
|
|
247
250
|
}
|
|
248
251
|
|
|
249
252
|
switch (functionName) {
|
|
250
|
-
case '
|
|
253
|
+
case 'aztec_txe_deploy': {
|
|
251
254
|
await this.#processDeployInputs(callData);
|
|
252
255
|
break;
|
|
253
256
|
}
|
|
254
|
-
case '
|
|
257
|
+
case 'aztec_txe_addAccount': {
|
|
255
258
|
await this.#processAddAccountInputs(callData);
|
|
256
259
|
break;
|
|
257
260
|
}
|
package/src/oracle/interfaces.ts
CHANGED
|
@@ -24,18 +24,18 @@ import type { UInt64 } from '@aztec/stdlib/types';
|
|
|
24
24
|
export interface IAvmExecutionOracle {
|
|
25
25
|
isAvm: true;
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
27
|
+
address(): Promise<AztecAddress>;
|
|
28
|
+
sender(): Promise<AztecAddress>;
|
|
29
|
+
blockNumber(): Promise<BlockNumber>;
|
|
30
|
+
timestamp(): Promise<bigint>;
|
|
31
|
+
isStaticCall(): Promise<boolean>;
|
|
32
|
+
chainId(): Promise<Fr>;
|
|
33
|
+
version(): Promise<Fr>;
|
|
34
|
+
emitNullifier(nullifier: Fr): Promise<void>;
|
|
35
|
+
emitNoteHash(noteHash: Fr): Promise<void>;
|
|
36
|
+
nullifierExists(siloedNullifier: Fr): Promise<boolean>;
|
|
37
|
+
storageWrite(slot: Fr, value: Fr): Promise<void>;
|
|
38
|
+
storageRead(slot: Fr, contractAddress: AztecAddress): Promise<Fr>;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
/**
|
|
@@ -44,27 +44,23 @@ export interface IAvmExecutionOracle {
|
|
|
44
44
|
export interface ITxeExecutionOracle {
|
|
45
45
|
isTxe: true;
|
|
46
46
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
): Promise<CompleteAddress>;
|
|
59
|
-
txeAddAuthWitness(address: AztecAddress, messageHash: Fr): Promise<void>;
|
|
60
|
-
txeGetLastBlockTimestamp(): Promise<bigint>;
|
|
61
|
-
txeGetLastTxEffects(): Promise<{
|
|
47
|
+
getDefaultAddress(): AztecAddress;
|
|
48
|
+
getNextBlockNumber(): Promise<BlockNumber>;
|
|
49
|
+
getNextBlockTimestamp(): Promise<UInt64>;
|
|
50
|
+
advanceBlocksBy(blocks: number): Promise<void>;
|
|
51
|
+
advanceTimestampBy(duration: UInt64): void;
|
|
52
|
+
deploy(artifact: ContractArtifact, instance: ContractInstanceWithAddress, foreignSecret: Fr): Promise<void>;
|
|
53
|
+
createAccount(secret: Fr): Promise<CompleteAddress>;
|
|
54
|
+
addAccount(artifact: ContractArtifact, instance: ContractInstanceWithAddress, secret: Fr): Promise<CompleteAddress>;
|
|
55
|
+
addAuthWitness(address: AztecAddress, messageHash: Fr): Promise<void>;
|
|
56
|
+
getLastBlockTimestamp(): Promise<bigint>;
|
|
57
|
+
getLastTxEffects(): Promise<{
|
|
62
58
|
txHash: TxHash;
|
|
63
59
|
noteHashes: Fr[];
|
|
64
60
|
nullifiers: Fr[];
|
|
65
61
|
}>;
|
|
66
|
-
|
|
67
|
-
|
|
62
|
+
getPrivateEvents(selector: EventSelector, contractAddress: AztecAddress, scope: AztecAddress): Promise<Fr[][]>;
|
|
63
|
+
privateCallNewFlow(
|
|
68
64
|
from: AztecAddress,
|
|
69
65
|
targetContractAddress: AztecAddress,
|
|
70
66
|
functionSelector: FunctionSelector,
|
|
@@ -73,13 +69,13 @@ export interface ITxeExecutionOracle {
|
|
|
73
69
|
isStaticCall: boolean,
|
|
74
70
|
jobId: string,
|
|
75
71
|
): Promise<Fr[]>;
|
|
76
|
-
|
|
72
|
+
executeUtilityFunction(
|
|
77
73
|
targetContractAddress: AztecAddress,
|
|
78
74
|
functionSelector: FunctionSelector,
|
|
79
75
|
args: Fr[],
|
|
80
76
|
jobId: string,
|
|
81
77
|
): Promise<Fr[]>;
|
|
82
|
-
|
|
78
|
+
publicCallNewFlow(
|
|
83
79
|
from: AztecAddress,
|
|
84
80
|
targetContractAddress: AztecAddress,
|
|
85
81
|
calldata: Fr[],
|
|
@@ -39,46 +39,46 @@ export class TXEOraclePublicContext implements IAvmExecutionOracle {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
address(): Promise<AztecAddress> {
|
|
43
43
|
return Promise.resolve(this.contractAddress);
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
sender(): Promise<AztecAddress> {
|
|
47
47
|
return Promise.resolve(AztecAddress.ZERO); // todo: change?
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
blockNumber(): Promise<BlockNumber> {
|
|
51
51
|
return Promise.resolve(this.globalVariables.blockNumber);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
timestamp(): Promise<bigint> {
|
|
55
55
|
return Promise.resolve(this.globalVariables.timestamp);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
|
|
58
|
+
isStaticCall(): Promise<boolean> {
|
|
59
59
|
return Promise.resolve(false);
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
chainId(): Promise<Fr> {
|
|
63
63
|
return Promise.resolve(this.globalVariables.chainId);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
version(): Promise<Fr> {
|
|
67
67
|
return Promise.resolve(this.globalVariables.version);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
async
|
|
70
|
+
async emitNullifier(nullifier: Fr) {
|
|
71
71
|
const siloedNullifier = await siloNullifier(this.contractAddress, nullifier);
|
|
72
72
|
this.transientSiloedNullifiers.push(siloedNullifier);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
async
|
|
75
|
+
async emitNoteHash(noteHash: Fr) {
|
|
76
76
|
const siloedNoteHash = await siloNoteHash(this.contractAddress, noteHash);
|
|
77
77
|
// TODO: make the note hash unique - they are only siloed right now
|
|
78
78
|
this.transientUniqueNoteHashes.push(siloedNoteHash);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
async
|
|
81
|
+
async nullifierExists(siloedNullifier: Fr): Promise<boolean> {
|
|
82
82
|
const treeIndex = (
|
|
83
83
|
await this.forkedWorldTrees.findLeafIndices(MerkleTreeId.NULLIFIER_TREE, [siloedNullifier.toBuffer()])
|
|
84
84
|
)[0];
|
|
@@ -87,7 +87,7 @@ export class TXEOraclePublicContext implements IAvmExecutionOracle {
|
|
|
87
87
|
return treeIndex !== undefined || transientIndex !== undefined;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
async
|
|
90
|
+
async storageWrite(slot: Fr, value: Fr) {
|
|
91
91
|
this.logger.debug('AVM storage write', { slot, value });
|
|
92
92
|
|
|
93
93
|
const dataWrite = new PublicDataWrite(await computePublicDataTreeLeafSlot(this.contractAddress, slot), value);
|
|
@@ -99,7 +99,7 @@ export class TXEOraclePublicContext implements IAvmExecutionOracle {
|
|
|
99
99
|
]);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
async
|
|
102
|
+
async storageRead(slot: Fr, contractAddress: AztecAddress): Promise<Fr> {
|
|
103
103
|
const leafSlot = await computePublicDataTreeLeafSlot(contractAddress, slot);
|
|
104
104
|
|
|
105
105
|
const lowLeafResult = await this.forkedWorldTrees.getPreviousValueIndex(
|