@aztec/txe 5.0.0-nightly.20260706 → 5.0.0-nightly.20260708
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/AuthRegistry-D774QM2G.js +3 -0
- package/dest/AuthRegistry-D774QM2G.js.map +7 -0
- package/dest/HandshakeRegistry-4AIT55KH.js +3 -0
- package/dest/HandshakeRegistry-4AIT55KH.js.map +7 -0
- package/dest/{MultiCallEntrypoint-L4TYDBCW.js → MultiCallEntrypoint-WICVQACI.js} +1 -1
- package/dest/{MultiCallEntrypoint-L4TYDBCW.js.map → MultiCallEntrypoint-WICVQACI.js.map} +2 -2
- package/dest/SchnorrAccount-Y2WZTBJF.js +3 -0
- package/dest/SchnorrAccount-Y2WZTBJF.js.map +7 -0
- package/dest/{SchnorrInitializerlessAccount-U2A3DVSR.js → SchnorrInitializerlessAccount-3AKXYJQI.js} +1 -1
- package/dest/{SchnorrInitializerlessAccount-U2A3DVSR.js.map → SchnorrInitializerlessAccount-3AKXYJQI.js.map} +1 -1
- package/dest/bin/index.js +1 -1
- package/dest/{chunk-6JTAVPZJ.js → chunk-2LYGEVHI.js} +2 -2
- package/dest/{chunk-6JTAVPZJ.js.map → chunk-2LYGEVHI.js.map} +3 -3
- package/dest/{chunk-SJX3LB7U.js → chunk-HLH2NBQI.js} +9 -9
- package/dest/{chunk-SJX3LB7U.js.map → chunk-HLH2NBQI.js.map} +4 -4
- package/dest/index.d.ts +1 -1
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +5 -3
- package/dest/metafile.json +226 -183
- package/dest/oracle/interfaces.d.ts +5 -5
- package/dest/oracle/interfaces.d.ts.map +1 -1
- package/dest/oracle/test-resolver/default_fixtures.d.ts +3 -3
- package/dest/oracle/test-resolver/default_fixtures.d.ts.map +1 -1
- package/dest/oracle/test-resolver/default_fixtures.js +54 -11
- package/dest/oracle/test-resolver/resolver.js +38 -1
- package/dest/oracle/txe_oracle_public_context.d.ts +5 -5
- package/dest/oracle/txe_oracle_public_context.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_public_context.js +13 -8
- package/dest/oracle/txe_oracle_registry.d.ts +10 -10
- package/dest/oracle/txe_oracle_registry.d.ts.map +1 -1
- package/dest/oracle/txe_oracle_registry.js +21 -12
- package/dest/oracle/txe_oracle_version.d.ts +2 -2
- package/dest/oracle/txe_oracle_version.js +2 -2
- package/dest/rpc_translator.d.ts +2 -2
- package/dest/rpc_translator.d.ts.map +1 -1
- package/dest/rpc_translator.js +3 -3
- package/dest/server.bundle.js +1 -1
- package/dest/state_machine/synchronizer.d.ts +3 -1
- package/dest/state_machine/synchronizer.d.ts.map +1 -1
- package/dest/state_machine/synchronizer.js +3 -0
- package/dest/worker.bundle.js +1 -1
- package/package.json +17 -17
- package/src/index.ts +5 -3
- package/src/oracle/interfaces.ts +4 -4
- package/src/oracle/test-resolver/default_fixtures.ts +73 -17
- package/src/oracle/test-resolver/resolver.ts +48 -1
- package/src/oracle/txe_oracle_public_context.ts +8 -7
- package/src/oracle/txe_oracle_registry.ts +14 -4
- package/src/oracle/txe_oracle_version.ts +2 -2
- package/src/rpc_translator.ts +3 -3
- package/src/state_machine/synchronizer.ts +5 -0
- package/dest/AuthRegistry-HBL4YLHF.js +0 -3
- package/dest/AuthRegistry-HBL4YLHF.js.map +0 -7
- package/dest/HandshakeRegistry-RLXDBPFJ.js +0 -3
- package/dest/HandshakeRegistry-RLXDBPFJ.js.map +0 -7
- package/dest/SchnorrAccount-TM347UJ7.js +0 -3
- package/dest/SchnorrAccount-TM347UJ7.js.map +0 -7
package/dest/rpc_translator.js
CHANGED
|
@@ -450,11 +450,11 @@ export class RPCTranslator {
|
|
|
450
450
|
});
|
|
451
451
|
}
|
|
452
452
|
// eslint-disable-next-line camelcase
|
|
453
|
-
|
|
453
|
+
aztec_utl_getPendingTaggedLogsV2(...inputs) {
|
|
454
454
|
return callTxeHandler({
|
|
455
|
-
oracle: '
|
|
455
|
+
oracle: 'aztec_utl_getPendingTaggedLogsV2',
|
|
456
456
|
inputs,
|
|
457
|
-
handler: ([scope, providedSecrets])=>this.handlerAsUtility().
|
|
457
|
+
handler: ([scope, providedSecrets])=>this.handlerAsUtility().getPendingTaggedLogsV2(scope, providedSecrets)
|
|
458
458
|
});
|
|
459
459
|
}
|
|
460
460
|
// eslint-disable-next-line camelcase
|
package/dest/server.bundle.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __txeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __txeCreateRequire(import.meta.url);
|
|
3
|
-
import{createTXERpcServer}from"./chunk-
|
|
3
|
+
import{createTXERpcServer}from"./chunk-2LYGEVHI.js";import"./chunk-HLH2NBQI.js";import"./chunk-BJVAAXNA.js";export{createTXERpcServer};
|
|
@@ -22,6 +22,8 @@ export declare class TXESynchronizer implements WorldStateSynchronizer {
|
|
|
22
22
|
fork(block?: number): Promise<MerkleTreeWriteOperations>;
|
|
23
23
|
/** Gets a handle that allows reading the state as it was at the given block number. */
|
|
24
24
|
getSnapshot(blockNumber: number): MerkleTreeReadOperations;
|
|
25
|
+
/** Gets a snapshot at the given block number. The TXE has no reorgs, so the fork hash is not verified. */
|
|
26
|
+
getVerifiedSnapshot(blockNumber: number, _blockHash: BlockHash): Promise<MerkleTreeReadOperations>;
|
|
25
27
|
/** Backups the db to the target path. */
|
|
26
28
|
backupTo(dstPath: string, compact?: boolean): Promise<Record<Exclude<SnapshotDataKeys, 'archiver'>, string>>;
|
|
27
29
|
start(): Promise<void>;
|
|
@@ -31,4 +33,4 @@ export declare class TXESynchronizer implements WorldStateSynchronizer {
|
|
|
31
33
|
resumeSync(): void;
|
|
32
34
|
clear(): Promise<void>;
|
|
33
35
|
}
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY2hyb25pemVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291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;IAEM,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE5B;IAEM,MAAM,IAAI,OAAO,CAAC,4BAA4B,CAAC,CAErD;IAEM,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE3B;IAEM,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/B;IAEM,UAAU,IAAI,IAAI,CAExB;IAEM,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE5B;CACF"}
|
|
@@ -36,6 +36,9 @@ export class TXESynchronizer {
|
|
|
36
36
|
/** Gets a handle that allows reading the state as it was at the given block number. */ getSnapshot(blockNumber) {
|
|
37
37
|
return this.nativeWorldStateService.getSnapshot(BlockNumber(blockNumber));
|
|
38
38
|
}
|
|
39
|
+
/** Gets a snapshot at the given block number. The TXE has no reorgs, so the fork hash is not verified. */ getVerifiedSnapshot(blockNumber, _blockHash) {
|
|
40
|
+
return Promise.resolve(this.getSnapshot(blockNumber));
|
|
41
|
+
}
|
|
39
42
|
/** Backups the db to the target path. */ backupTo(dstPath, compact) {
|
|
40
43
|
return this.nativeWorldStateService.backupTo(dstPath, compact);
|
|
41
44
|
}
|
package/dest/worker.bundle.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { createRequire as __txeCreateRequire } from 'node:module';
|
|
2
2
|
const require = __txeCreateRequire(import.meta.url);
|
|
3
|
-
import{TXEDispatcher,activeSessionCount,createLogger}from"./chunk-
|
|
3
|
+
import{TXEDispatcher,activeSessionCount,createLogger}from"./chunk-HLH2NBQI.js";import{__name}from"./chunk-BJVAAXNA.js";import{BackendType,Barretenberg,BarretenbergSync}from"@aztec/bb.js";import{parentPort,workerData}from"node:worker_threads";Barretenberg.initSingleton({backend:BackendType.Wasm,skipSrsInit:!0,threads:1});BarretenbergSync.initSingleton({backend:BackendType.Wasm});if(!parentPort)throw new Error("worker.ts must be loaded as a worker_thread");var port=parentPort,logger=createLogger("txe:worker"),dispatcherOpts={contractStoreSourceDir:workerData.contractStoreSourceDir,schnorrClassId:workerData.schnorrClassId},dispatcher=new TXEDispatcher(logger,dispatcherOpts);function serializeError(err){return err instanceof Error?{message:err.message,name:err.name,stack:err.stack}:{message:String(err)}}__name(serializeError,"serializeError");process.env.TXE_WORKER_MEMSTAT==="1"&&setInterval(()=>{let m=process.memoryUsage();port.postMessage({type:"memstat",sessions:activeSessionCount(),rss:m.rss,heapTotal:m.heapTotal,heapUsed:m.heapUsed,external:m.external,arrayBuffers:m.arrayBuffers})},2e3).unref();port.on("message",msg=>{switch(msg.type){case"foreign-call":(async()=>{try{let value=await dispatcher.resolve_foreign_call(msg.callData);port.postMessage({type:"result",requestId:msg.requestId,ok:!0,value})}catch(err){port.postMessage({type:"result",requestId:msg.requestId,ok:!1,error:serializeError(err)})}})();return;case"dispose-session":dispatcher.disposeSession(msg.sessionId).catch(err=>logger.warn("disposeSession failed",err));return}});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/txe",
|
|
3
|
-
"version": "5.0.0-nightly.
|
|
3
|
+
"version": "5.0.0-nightly.20260708",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -69,22 +69,22 @@
|
|
|
69
69
|
]
|
|
70
70
|
},
|
|
71
71
|
"dependencies": {
|
|
72
|
-
"@aztec/accounts": "5.0.0-nightly.
|
|
73
|
-
"@aztec/archiver": "5.0.0-nightly.
|
|
74
|
-
"@aztec/aztec-node": "5.0.0-nightly.
|
|
75
|
-
"@aztec/aztec.js": "5.0.0-nightly.
|
|
76
|
-
"@aztec/bb-prover": "5.0.0-nightly.
|
|
77
|
-
"@aztec/bb.js": "5.0.0-nightly.
|
|
78
|
-
"@aztec/constants": "5.0.0-nightly.
|
|
79
|
-
"@aztec/foundation": "5.0.0-nightly.
|
|
80
|
-
"@aztec/key-store": "5.0.0-nightly.
|
|
81
|
-
"@aztec/kv-store": "5.0.0-nightly.
|
|
82
|
-
"@aztec/protocol-contracts": "5.0.0-nightly.
|
|
83
|
-
"@aztec/pxe": "5.0.0-nightly.
|
|
84
|
-
"@aztec/simulator": "5.0.0-nightly.
|
|
85
|
-
"@aztec/standard-contracts": "5.0.0-nightly.
|
|
86
|
-
"@aztec/stdlib": "5.0.0-nightly.
|
|
87
|
-
"@aztec/world-state": "5.0.0-nightly.
|
|
72
|
+
"@aztec/accounts": "5.0.0-nightly.20260708",
|
|
73
|
+
"@aztec/archiver": "5.0.0-nightly.20260708",
|
|
74
|
+
"@aztec/aztec-node": "5.0.0-nightly.20260708",
|
|
75
|
+
"@aztec/aztec.js": "5.0.0-nightly.20260708",
|
|
76
|
+
"@aztec/bb-prover": "5.0.0-nightly.20260708",
|
|
77
|
+
"@aztec/bb.js": "5.0.0-nightly.20260708",
|
|
78
|
+
"@aztec/constants": "5.0.0-nightly.20260708",
|
|
79
|
+
"@aztec/foundation": "5.0.0-nightly.20260708",
|
|
80
|
+
"@aztec/key-store": "5.0.0-nightly.20260708",
|
|
81
|
+
"@aztec/kv-store": "5.0.0-nightly.20260708",
|
|
82
|
+
"@aztec/protocol-contracts": "5.0.0-nightly.20260708",
|
|
83
|
+
"@aztec/pxe": "5.0.0-nightly.20260708",
|
|
84
|
+
"@aztec/simulator": "5.0.0-nightly.20260708",
|
|
85
|
+
"@aztec/standard-contracts": "5.0.0-nightly.20260708",
|
|
86
|
+
"@aztec/stdlib": "5.0.0-nightly.20260708",
|
|
87
|
+
"@aztec/world-state": "5.0.0-nightly.20260708",
|
|
88
88
|
"msgpackr": "^1.11.2",
|
|
89
89
|
"zod": "^4"
|
|
90
90
|
},
|
package/src/index.ts
CHANGED
|
@@ -21,9 +21,11 @@ import {
|
|
|
21
21
|
} from './utils/encoding.js';
|
|
22
22
|
import { TXEArtifactResolver } from './utils/txe_artifact_resolver.js';
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
export const TXE_REQUIRED_PROTOCOL_CONTRACTS: ProtocolContractName[] = [
|
|
25
|
+
'ContractClassRegistry',
|
|
26
|
+
'ContractInstanceRegistry',
|
|
27
|
+
'FeeJuice',
|
|
28
|
+
];
|
|
27
29
|
|
|
28
30
|
const sessions = new Map<number, TXESession>();
|
|
29
31
|
|
package/src/oracle/interfaces.ts
CHANGED
|
@@ -39,10 +39,10 @@ export interface IAvmExecutionOracle {
|
|
|
39
39
|
nullifierExists(siloedNullifier: Fr): Promise<boolean>;
|
|
40
40
|
storageWrite(slot: Fr, value: Fr): Promise<void>;
|
|
41
41
|
storageRead(slot: Fr, contractAddress: AztecAddress): Promise<Fr>;
|
|
42
|
-
getContractInstanceDeployer(address: AztecAddress): Promise<{ member: Fr; exists: boolean }>;
|
|
43
|
-
getContractInstanceClassId(address: AztecAddress): Promise<{ member: Fr; exists: boolean }>;
|
|
44
|
-
getContractInstanceInitializationHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }>;
|
|
45
|
-
getContractInstanceImmutablesHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }>;
|
|
42
|
+
getContractInstanceDeployer(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]>;
|
|
43
|
+
getContractInstanceClassId(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]>;
|
|
44
|
+
getContractInstanceInitializationHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]>;
|
|
45
|
+
getContractInstanceImmutablesHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]>;
|
|
46
46
|
returndataSize(): Promise<number>;
|
|
47
47
|
returndataCopy(rdOffset: number, copySize: number): Promise<Fr[]>;
|
|
48
48
|
call(l2Gas: number, daGas: number, address: AztecAddress, argsLength: number, args: Fr[]): Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AztecAddress } from '@aztec/aztec.js/addresses';
|
|
2
|
-
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
|
+
import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
|
|
3
3
|
import { Fr } from '@aztec/foundation/curves/bn254';
|
|
4
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
5
5
|
import {
|
|
@@ -10,24 +10,29 @@ import {
|
|
|
10
10
|
BOOL,
|
|
11
11
|
BYTE,
|
|
12
12
|
BoundedVec,
|
|
13
|
+
DELIVERY_MODE,
|
|
13
14
|
ETH_ADDRESS,
|
|
14
15
|
FIELD,
|
|
15
16
|
FUNCTION_SELECTOR,
|
|
16
17
|
NOTE_SELECTOR,
|
|
17
18
|
Option,
|
|
18
19
|
type OracleRegistryEntry,
|
|
20
|
+
SLOT_NUMBER,
|
|
21
|
+
type StructField,
|
|
19
22
|
type TypeMapping,
|
|
20
23
|
U32,
|
|
24
|
+
tryFieldWidth,
|
|
21
25
|
} from '@aztec/pxe/simulator';
|
|
22
26
|
import { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
23
27
|
import { BlockHash } from '@aztec/stdlib/block';
|
|
28
|
+
import { AppTaggingSecretKind } from '@aztec/stdlib/logs';
|
|
24
29
|
|
|
25
30
|
import type { OracleTestScenario } from './resolver.js';
|
|
26
31
|
|
|
27
32
|
/**
|
|
28
33
|
* Synthesizes fixture scenarios for every oracle in the registry whose parameters and return are built from scalars,
|
|
29
|
-
* arrays/bounded vecs of them,
|
|
30
|
-
* `#[generate_oracle_tests]` from the same seed/scenario convention.
|
|
34
|
+
* arrays/bounded vecs of them, `Option`s of them, or `STRUCT`s over them. The matching Noir serialization tests are
|
|
35
|
+
* auto-generated by `#[generate_oracle_tests]` from the same seed/scenario convention.
|
|
31
36
|
*/
|
|
32
37
|
export function synthesizeDefaultFixtures(
|
|
33
38
|
registry: Record<string, OracleRegistryEntry>,
|
|
@@ -45,8 +50,8 @@ export function synthesizeDefaultFixtures(
|
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
/**
|
|
48
|
-
* The test-value implementations, one per oracle type, mirroring the Noir `
|
|
49
|
-
*
|
|
53
|
+
* The test-value implementations, one per oracle type, mirroring the Noir synthesizer tables (`scalars` and
|
|
54
|
+
* `synthesizers` in `noir-projects/aztec-nr/.../macros/oracle_testing.nr`) exactly.
|
|
50
55
|
*/
|
|
51
56
|
const TEST_VALUE_IMPLS: TestValueImpl[] = [
|
|
52
57
|
scalar(FIELD, seed => new Fr(seed)),
|
|
@@ -60,6 +65,11 @@ const TEST_VALUE_IMPLS: TestValueImpl[] = [
|
|
|
60
65
|
scalar(FUNCTION_SELECTOR, seed => FunctionSelector.fromField(new Fr(seed))),
|
|
61
66
|
scalar(NOTE_SELECTOR, seed => NoteSelector.fromField(new Fr(seed))),
|
|
62
67
|
scalar(BLOCK_HASH, seed => new BlockHash(new Fr(seed))),
|
|
68
|
+
scalar(SLOT_NUMBER, seed => SlotNumber(seed)),
|
|
69
|
+
// Only two delivery modes are valid for tagging, so the seed alternates between them, matching the Noir impl.
|
|
70
|
+
scalar(DELIVERY_MODE, seed =>
|
|
71
|
+
seed % 2 === 0 ? AppTaggingSecretKind.UNCONSTRAINED : AppTaggingSecretKind.CONSTRAINED,
|
|
72
|
+
),
|
|
63
73
|
composite(isOption, (type, seed) => [
|
|
64
74
|
named(Option.some(firstValue(type.inner, seed)), 'some'),
|
|
65
75
|
named(Option.none(firstValue(type.inner, seed)), 'none'),
|
|
@@ -73,6 +83,15 @@ const TEST_VALUE_IMPLS: TestValueImpl[] = [
|
|
|
73
83
|
}),
|
|
74
84
|
),
|
|
75
85
|
]),
|
|
86
|
+
composite(isStruct, (type, seed) => [unnamed(structValue(type, seed))]),
|
|
87
|
+
// A fixed-length array uses its real (signature) length, unlike the generic-length ARRAY which is pinned to
|
|
88
|
+
// DEFAULT_ARRAY_LENGTH.
|
|
89
|
+
composite(isFixedArray, (type, seed) => [unnamed(collectionData(type.inner, seed, type.length))]),
|
|
90
|
+
// Same for a fixed-capacity bounded vec: real capacity, DEFAULT_ARRAY_LENGTH elements (its value type is a plain
|
|
91
|
+
// element array, unlike the two-slot BOUNDED_VEC), clamped to the capacity so small vecs stay valid.
|
|
92
|
+
composite(isFixedBoundedVec, (type, seed) => [
|
|
93
|
+
unnamed(collectionData(type.inner, seed, Math.min(DEFAULT_ARRAY_LENGTH, type.maxLength))),
|
|
94
|
+
]),
|
|
76
95
|
];
|
|
77
96
|
|
|
78
97
|
/**
|
|
@@ -107,9 +126,9 @@ function named(value: unknown, name: string): Scenario {
|
|
|
107
126
|
}
|
|
108
127
|
|
|
109
128
|
/**
|
|
110
|
-
* One type's test-value implementation, mirroring a Noir `
|
|
111
|
-
* `scenarios` yields its [`Scenario`]s for `seed`, one per serialization shape, like Noir's
|
|
112
|
-
*
|
|
129
|
+
* One type's test-value implementation, mirroring a Noir `TestValueSynthesizer` entry: `match` selects the type and
|
|
130
|
+
* `scenarios` yields its [`Scenario`]s for `seed`, one per serialization shape, like the Noir entry's `scenarios`
|
|
131
|
+
* function.
|
|
113
132
|
*/
|
|
114
133
|
interface TestValueImpl {
|
|
115
134
|
match: (type: TypeMapping<any>) => boolean;
|
|
@@ -135,8 +154,27 @@ function collectionData(element: TypeMapping<any>, seed: number, length: number)
|
|
|
135
154
|
}
|
|
136
155
|
|
|
137
156
|
/**
|
|
138
|
-
* The
|
|
139
|
-
*
|
|
157
|
+
* The synthesized prop bag for a struct: each field's first scenario, seeded at the field's flat wire offset so the
|
|
158
|
+
* values depend on the wire layout rather than on how each side groups its fields. Mirrors the Noir reflected impls.
|
|
159
|
+
*/
|
|
160
|
+
function structValue(type: StructMapping, seed: number): Record<string, unknown> {
|
|
161
|
+
const value: Record<string, unknown> = {};
|
|
162
|
+
let offset = 0;
|
|
163
|
+
for (const field of type.fields) {
|
|
164
|
+
value[field.name] = firstValue(field.type, seed + offset);
|
|
165
|
+
const width = tryFieldWidth(field.type.shape);
|
|
166
|
+
if (width === undefined) {
|
|
167
|
+
// A variable-width field has no flat offset to seed the next field at, so only this oracle is unsynthesizable.
|
|
168
|
+
throw new UnsynthesizableTypeError(field.type, `struct field '${field.name}' has a variable-width shape`);
|
|
169
|
+
}
|
|
170
|
+
offset += width;
|
|
171
|
+
}
|
|
172
|
+
return value;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* The [`Scenario`]s for `type` at `seed`, one per serialization *shape*, mirroring the Noir `scenarios_for`
|
|
177
|
+
* dispatcher. Throws if the type has no matching impl.
|
|
140
178
|
*/
|
|
141
179
|
function scenariosForType(type: TypeMapping<any>, seed: number): Scenario[] {
|
|
142
180
|
const impl = TEST_VALUE_IMPLS.find(i => i.match(type));
|
|
@@ -152,8 +190,8 @@ function firstValue(type: TypeMapping<any>, seed: number): unknown {
|
|
|
152
190
|
}
|
|
153
191
|
|
|
154
192
|
class UnsynthesizableTypeError extends Error {
|
|
155
|
-
constructor(type: TypeMapping<any
|
|
156
|
-
super(`No test-value impl for type: ${JSON.stringify(Object.keys(type))}`);
|
|
193
|
+
constructor(type: TypeMapping<any>, detail?: string) {
|
|
194
|
+
super(detail ?? `No test-value impl for type: ${JSON.stringify(Object.keys(type))}`);
|
|
157
195
|
this.name = 'UnsynthesizableTypeError';
|
|
158
196
|
}
|
|
159
197
|
}
|
|
@@ -161,7 +199,7 @@ class UnsynthesizableTypeError extends Error {
|
|
|
161
199
|
/**
|
|
162
200
|
* Synthesizes the scenarios for one oracle by zipping every position's [`Scenario`] list to one case per test (a
|
|
163
201
|
* shorter list wraps around via mod), mirroring the Noir macro. Returns `undefined` if any param or return type is
|
|
164
|
-
* unsynthesizable (
|
|
202
|
+
* unsynthesizable (ephemeral arrays, structs with a variable-width field).
|
|
165
203
|
*/
|
|
166
204
|
function synthesizeScenarios(entry: OracleRegistryEntry): OracleTestScenario[] | undefined {
|
|
167
205
|
try {
|
|
@@ -206,14 +244,23 @@ function synthesizeScenariosOrThrow(entry: OracleRegistryEntry): OracleTestScena
|
|
|
206
244
|
}
|
|
207
245
|
|
|
208
246
|
/**
|
|
209
|
-
* The composite `TypeMapping`s (`ARRAY`/`BOUNDED_VEC`/`OPTION`),
|
|
210
|
-
* plus the inner mapping at construction; the registry
|
|
211
|
-
* recover the structure for recursion.
|
|
247
|
+
* The composite `TypeMapping`s (`ARRAY`/`BOUNDED_VEC`/`OPTION`/`STRUCT`/`FIXED_ARRAY`/`FIXED_BOUNDED_VEC`),
|
|
248
|
+
* discriminated by `kind`. The combinators attach `kind` plus the inner mapping(s) at construction; the registry
|
|
249
|
+
* erases params to the base `TypeMapping`, so the guards below recover the structure for recursion.
|
|
212
250
|
*/
|
|
213
251
|
type ArrayMapping = TypeMapping & { kind: 'array'; inner: TypeMapping };
|
|
214
252
|
type BoundedVecMapping = TypeMapping & { kind: 'bounded-vec'; inner: TypeMapping };
|
|
215
253
|
type OptionMapping = TypeMapping & { kind: 'option'; inner: TypeMapping };
|
|
216
|
-
type
|
|
254
|
+
type StructMapping = TypeMapping & { kind: 'struct'; fields: readonly StructField[] };
|
|
255
|
+
type FixedArrayMapping = TypeMapping & { kind: 'fixed-array'; inner: TypeMapping; length: number };
|
|
256
|
+
type FixedBoundedVecMapping = TypeMapping & { kind: 'fixed-bounded-vec'; inner: TypeMapping; maxLength: number };
|
|
257
|
+
type CompositeMapping =
|
|
258
|
+
| ArrayMapping
|
|
259
|
+
| BoundedVecMapping
|
|
260
|
+
| OptionMapping
|
|
261
|
+
| StructMapping
|
|
262
|
+
| FixedArrayMapping
|
|
263
|
+
| FixedBoundedVecMapping;
|
|
217
264
|
|
|
218
265
|
function isArray(type: TypeMapping<any>): type is ArrayMapping {
|
|
219
266
|
return 'kind' in type && type.kind === 'array';
|
|
@@ -224,3 +271,12 @@ function isBoundedVec(type: TypeMapping<any>): type is BoundedVecMapping {
|
|
|
224
271
|
function isOption(type: TypeMapping<any>): type is OptionMapping {
|
|
225
272
|
return 'kind' in type && type.kind === 'option';
|
|
226
273
|
}
|
|
274
|
+
function isStruct(type: TypeMapping<any>): type is StructMapping {
|
|
275
|
+
return 'kind' in type && type.kind === 'struct';
|
|
276
|
+
}
|
|
277
|
+
function isFixedArray(type: TypeMapping<any>): type is FixedArrayMapping {
|
|
278
|
+
return 'kind' in type && type.kind === 'fixed-array';
|
|
279
|
+
}
|
|
280
|
+
function isFixedBoundedVec(type: TypeMapping<any>): type is FixedBoundedVecMapping {
|
|
281
|
+
return 'kind' in type && type.kind === 'fixed-bounded-vec';
|
|
282
|
+
}
|
|
@@ -179,6 +179,11 @@ function decodeScenarioName(inputs: ForeignCallArgs): string {
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
function valuesEqual(actual: unknown, expected: unknown): boolean {
|
|
182
|
+
if (!isNonNullObject(actual) || !isNonNullObject(expected)) {
|
|
183
|
+
// Primitive scalars; String() bridges bigint vs number representations of the same seed. A primitive compared
|
|
184
|
+
// against an object is never equal.
|
|
185
|
+
return isNonNullObject(actual) === isNonNullObject(expected) && String(actual) === String(expected);
|
|
186
|
+
}
|
|
182
187
|
if (actual instanceof Option && expected instanceof Option) {
|
|
183
188
|
return actual.equals(expected, valuesEqual);
|
|
184
189
|
}
|
|
@@ -188,7 +193,49 @@ function valuesEqual(actual: unknown, expected: unknown): boolean {
|
|
|
188
193
|
if (Array.isArray(actual) && Array.isArray(expected)) {
|
|
189
194
|
return actual.length === expected.length && actual.every((v, i) => valuesEqual(v, expected[i]));
|
|
190
195
|
}
|
|
191
|
-
|
|
196
|
+
if (isPlainObject(actual) && isPlainObject(expected)) {
|
|
197
|
+
const expectedKeys = Object.keys(expected);
|
|
198
|
+
return (
|
|
199
|
+
Object.keys(actual).length === expectedKeys.length &&
|
|
200
|
+
expectedKeys.every(key => valuesEqual(actual[key], expected[key]))
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
if (actual.constructor !== expected.constructor) {
|
|
204
|
+
return false;
|
|
205
|
+
}
|
|
206
|
+
if (hasEquals(actual)) {
|
|
207
|
+
return actual.equals(expected);
|
|
208
|
+
}
|
|
209
|
+
const actualStr = customStringForm(actual);
|
|
210
|
+
const expectedStr = customStringForm(expected);
|
|
211
|
+
if (actualStr !== undefined && expectedStr !== undefined) {
|
|
212
|
+
return actualStr === expectedStr;
|
|
213
|
+
}
|
|
214
|
+
// Comparing blindly here could pass vacuously (e.g. two '[object Object]' strings), so refuse instead.
|
|
215
|
+
throw new Error(
|
|
216
|
+
`valuesEqual cannot compare a '${actual.constructor?.name}' against a '${expected.constructor?.name}'. Add a branch for the type.`,
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
function isNonNullObject(value: unknown): value is object {
|
|
221
|
+
return typeof value === 'object' && value !== null;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function isPlainObject(value: unknown): value is Record<string, unknown> {
|
|
225
|
+
return isNonNullObject(value) && value.constructor === Object;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function hasEquals(value: object): value is { equals(other: unknown): boolean } {
|
|
229
|
+
return typeof (value as { equals?: unknown }).equals === 'function';
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** The value's string form when its class overrides `toString` (a meaningful representation), undefined otherwise. */
|
|
233
|
+
function customStringForm(value: object): string | undefined {
|
|
234
|
+
const { toString } = value;
|
|
235
|
+
if (typeof toString !== 'function' || toString === Object.prototype.toString) {
|
|
236
|
+
return undefined;
|
|
237
|
+
}
|
|
238
|
+
return toString.call(value);
|
|
192
239
|
}
|
|
193
240
|
|
|
194
241
|
function versionBumpHint(oracle: string): string {
|
|
@@ -125,32 +125,33 @@ export class TXEOraclePublicContext implements IAvmExecutionOracle {
|
|
|
125
125
|
return value;
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
-
getContractInstanceDeployer(address: AztecAddress): Promise<{ member: Fr; exists: boolean }> {
|
|
128
|
+
getContractInstanceDeployer(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]> {
|
|
129
129
|
return this.getContractInstanceMember(address, i => i.deployer.toField());
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
getContractInstanceClassId(address: AztecAddress): Promise<{ member: Fr; exists: boolean }> {
|
|
132
|
+
getContractInstanceClassId(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]> {
|
|
133
133
|
// TXE has no contract updates, so the current class always equals the original.
|
|
134
134
|
return this.getContractInstanceMember(address, i => i.originalContractClassId);
|
|
135
135
|
}
|
|
136
136
|
|
|
137
|
-
getContractInstanceInitializationHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }> {
|
|
137
|
+
getContractInstanceInitializationHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]> {
|
|
138
138
|
return this.getContractInstanceMember(address, i => i.initializationHash);
|
|
139
139
|
}
|
|
140
140
|
|
|
141
|
-
getContractInstanceImmutablesHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }> {
|
|
141
|
+
getContractInstanceImmutablesHash(address: AztecAddress): Promise<{ member: Fr; exists: boolean }[]> {
|
|
142
142
|
return this.getContractInstanceMember(address, i => i.immutablesHash);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
// The one-element array mirrors the oracles' Noir return type, `[GetContractInstanceResult; 1]`.
|
|
145
146
|
private async getContractInstanceMember(
|
|
146
147
|
address: AztecAddress,
|
|
147
148
|
accessor: (instance: ContractInstancePreimageWithAddress) => Fr,
|
|
148
|
-
): Promise<{ member: Fr; exists: boolean }> {
|
|
149
|
+
): Promise<{ member: Fr; exists: boolean }[]> {
|
|
149
150
|
const instance = await this.contractStore.getContractInstance(address);
|
|
150
151
|
if (!instance) {
|
|
151
|
-
return { member: Fr.ZERO, exists: false };
|
|
152
|
+
return [{ member: Fr.ZERO, exists: false }];
|
|
152
153
|
}
|
|
153
|
-
return { member: accessor(instance), exists: true };
|
|
154
|
+
return [{ member: accessor(instance), exists: true }];
|
|
154
155
|
}
|
|
155
156
|
|
|
156
157
|
returndataSize(): Promise<number> {
|
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
BOOL,
|
|
20
20
|
ETH_ADDRESS,
|
|
21
21
|
FIELD,
|
|
22
|
+
FIXED_ARRAY,
|
|
22
23
|
FUNCTION_SELECTOR,
|
|
23
24
|
type InputSlot,
|
|
24
25
|
type MaybePromise,
|
|
@@ -28,6 +29,7 @@ import {
|
|
|
28
29
|
type OutputSlot,
|
|
29
30
|
type ParamTypes,
|
|
30
31
|
STR,
|
|
32
|
+
STRUCT,
|
|
31
33
|
type SlotShape,
|
|
32
34
|
type TypeMapping,
|
|
33
35
|
U32,
|
|
@@ -70,6 +72,7 @@ const GAS_SETTINGS: TypeMapping<GasSettings> = {
|
|
|
70
72
|
const STRATEGY_NON_INTERACTIVE_HANDSHAKE = 1;
|
|
71
73
|
const STRATEGY_ARBITRARY_SECRET = 2;
|
|
72
74
|
const STRATEGY_ADDRESS_DERIVED = 3;
|
|
75
|
+
const STRATEGY_INTERACTIVE_HANDSHAKE = 4;
|
|
73
76
|
|
|
74
77
|
const TAGGING_SECRET_STRATEGY: TypeMapping<TaggingSecretStrategy> = {
|
|
75
78
|
serialization: {
|
|
@@ -77,6 +80,8 @@ const TAGGING_SECRET_STRATEGY: TypeMapping<TaggingSecretStrategy> = {
|
|
|
77
80
|
switch (strategy.type) {
|
|
78
81
|
case 'non-interactive-handshake':
|
|
79
82
|
return [new Fr(STRATEGY_NON_INTERACTIVE_HANDSHAKE), Fr.ZERO, Fr.ZERO];
|
|
83
|
+
case 'interactive-handshake':
|
|
84
|
+
return [new Fr(STRATEGY_INTERACTIVE_HANDSHAKE), Fr.ZERO, Fr.ZERO];
|
|
80
85
|
case 'address-derived':
|
|
81
86
|
return [new Fr(STRATEGY_ADDRESS_DERIVED), Fr.ZERO, Fr.ZERO];
|
|
82
87
|
case 'arbitrary-secret':
|
|
@@ -91,6 +96,8 @@ const TAGGING_SECRET_STRATEGY: TypeMapping<TaggingSecretStrategy> = {
|
|
|
91
96
|
switch (kind) {
|
|
92
97
|
case STRATEGY_NON_INTERACTIVE_HANDSHAKE:
|
|
93
98
|
return { type: 'non-interactive-handshake' };
|
|
99
|
+
case STRATEGY_INTERACTIVE_HANDSHAKE:
|
|
100
|
+
return { type: 'interactive-handshake' };
|
|
94
101
|
case STRATEGY_ADDRESS_DERIVED:
|
|
95
102
|
return { type: 'address-derived' };
|
|
96
103
|
case STRATEGY_ARBITRARY_SECRET:
|
|
@@ -193,10 +200,13 @@ const TXE_CALL_CONTEXT: TypeMapping<{ txHash: Fr; anchorBlockTimestamp: bigint }
|
|
|
193
200
|
shape: ['scalar', 'scalar', 'scalar'], // discriminant, txHash, anchor block timestamp
|
|
194
201
|
};
|
|
195
202
|
|
|
196
|
-
const CONTRACT_INSTANCE_MEMBER: TypeMapping<{
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
}
|
|
203
|
+
const CONTRACT_INSTANCE_MEMBER: TypeMapping<{ exists: boolean; member: Fr }[]> = FIXED_ARRAY(
|
|
204
|
+
STRUCT([
|
|
205
|
+
{ name: 'exists', type: BOOL },
|
|
206
|
+
{ name: 'member', type: FIELD },
|
|
207
|
+
]),
|
|
208
|
+
1,
|
|
209
|
+
);
|
|
200
210
|
|
|
201
211
|
const EVENT_SELECTOR: TypeMapping<EventSelector> = {
|
|
202
212
|
serialization: { fn: v => [v.toField()] },
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* The Noir counterparts are in `noir-projects/aztec-nr/aztec/src/test/helpers/txe_oracles.nr`.
|
|
7
7
|
*/
|
|
8
8
|
export const TXE_ORACLE_VERSION_MAJOR = 2;
|
|
9
|
-
export const TXE_ORACLE_VERSION_MINOR =
|
|
9
|
+
export const TXE_ORACLE_VERSION_MINOR = 3;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* This hash is computed from the TXE oracle interfaces (IAvmExecutionOracle and ITxeExecutionOracle) and is used to
|
|
@@ -14,4 +14,4 @@ export const TXE_ORACLE_VERSION_MINOR = 2;
|
|
|
14
14
|
* - TXE_ORACLE_VERSION_MAJOR (and reset MINOR to 0) for breaking changes, or
|
|
15
15
|
* - TXE_ORACLE_VERSION_MINOR for additive changes (new oracle method added).
|
|
16
16
|
*/
|
|
17
|
-
export const TXE_ORACLE_INTERFACE_HASH = '
|
|
17
|
+
export const TXE_ORACLE_INTERFACE_HASH = '4ed3618087fafb4aa63c6580996a69bf6bc257844035a2019692586b5b8daf34';
|
package/src/rpc_translator.ts
CHANGED
|
@@ -582,11 +582,11 @@ export class RPCTranslator {
|
|
|
582
582
|
}
|
|
583
583
|
|
|
584
584
|
// eslint-disable-next-line camelcase
|
|
585
|
-
|
|
585
|
+
aztec_utl_getPendingTaggedLogsV2(...inputs: ForeignCallArgs) {
|
|
586
586
|
return callTxeHandler({
|
|
587
|
-
oracle: '
|
|
587
|
+
oracle: 'aztec_utl_getPendingTaggedLogsV2',
|
|
588
588
|
inputs,
|
|
589
|
-
handler: ([scope, providedSecrets]) => this.handlerAsUtility().
|
|
589
|
+
handler: ([scope, providedSecrets]) => this.handlerAsUtility().getPendingTaggedLogsV2(scope, providedSecrets),
|
|
590
590
|
});
|
|
591
591
|
}
|
|
592
592
|
|
|
@@ -58,6 +58,11 @@ export class TXESynchronizer implements WorldStateSynchronizer {
|
|
|
58
58
|
return this.nativeWorldStateService.getSnapshot(BlockNumber(blockNumber));
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
+
/** Gets a snapshot at the given block number. The TXE has no reorgs, so the fork hash is not verified. */
|
|
62
|
+
public getVerifiedSnapshot(blockNumber: number, _blockHash: BlockHash): Promise<MerkleTreeReadOperations> {
|
|
63
|
+
return Promise.resolve(this.getSnapshot(blockNumber));
|
|
64
|
+
}
|
|
65
|
+
|
|
61
66
|
/** Backups the db to the target path. */
|
|
62
67
|
public backupTo(dstPath: string, compact?: boolean): Promise<Record<Exclude<SnapshotDataKeys, 'archiver'>, string>> {
|
|
63
68
|
return this.nativeWorldStateService.backupTo(dstPath, compact);
|