@aztec/pxe 3.0.0-nightly.20251203 → 3.0.0-nightly.20251205
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/contract_function_simulator/execution_data_provider.d.ts +8 -7
- package/dest/contract_function_simulator/execution_data_provider.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/interfaces.d.ts +8 -7
- package/dest/contract_function_simulator/oracle/interfaces.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts +1 -1
- package/dest/contract_function_simulator/oracle/oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/oracle.js +7 -6
- package/dest/contract_function_simulator/oracle/private_execution.d.ts +3 -2
- package/dest/contract_function_simulator/oracle/private_execution.d.ts.map +1 -1
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts +8 -7
- package/dest/contract_function_simulator/oracle/utility_execution_oracle.d.ts.map +1 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts +8 -8
- package/dest/contract_function_simulator/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +5 -5
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts +3 -3
- package/dest/private_kernel/private_kernel_oracle_impl.d.ts.map +1 -1
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts +3 -2
- package/dest/storage/sync_data_provider/sync_data_provider.d.ts.map +1 -1
- package/dest/synchronizer/synchronizer.d.ts +3 -2
- package/dest/synchronizer/synchronizer.d.ts.map +1 -1
- package/dest/synchronizer/synchronizer.js +2 -1
- package/package.json +17 -17
- package/src/contract_function_simulator/execution_data_provider.ts +13 -6
- package/src/contract_function_simulator/oracle/interfaces.ts +7 -6
- package/src/contract_function_simulator/oracle/oracle.ts +10 -6
- package/src/contract_function_simulator/oracle/private_execution.ts +2 -1
- package/src/contract_function_simulator/oracle/utility_execution_oracle.ts +10 -6
- package/src/contract_function_simulator/pxe_oracle_interface.ts +20 -16
- package/src/private_kernel/private_kernel_oracle_impl.ts +2 -2
- package/src/storage/sync_data_provider/sync_data_provider.ts +2 -1
- package/src/synchronizer/synchronizer.ts +2 -1
|
@@ -141,28 +141,28 @@ import { NoteValidationRequest } from './noir-structs/note_validation_request.js
|
|
|
141
141
|
}
|
|
142
142
|
async getLowNullifierMembershipWitness(blockNumber, nullifier) {
|
|
143
143
|
const header = await this.getAnchorBlockHeader();
|
|
144
|
-
if (blockNumber > header.globalVariables.blockNumber) {
|
|
144
|
+
if (blockNumber !== 'latest' && blockNumber > header.globalVariables.blockNumber) {
|
|
145
145
|
throw new Error(`Block number ${blockNumber} is higher than current block ${header.globalVariables.blockNumber}`);
|
|
146
146
|
}
|
|
147
147
|
return this.aztecNode.getLowNullifierMembershipWitness(blockNumber, nullifier);
|
|
148
148
|
}
|
|
149
149
|
async getBlock(blockNumber) {
|
|
150
150
|
const header = await this.getAnchorBlockHeader();
|
|
151
|
-
if (blockNumber > header.globalVariables.blockNumber) {
|
|
151
|
+
if (blockNumber !== 'latest' && blockNumber > header.globalVariables.blockNumber) {
|
|
152
152
|
throw new Error(`Block number ${blockNumber} is higher than current block ${header.globalVariables.blockNumber}`);
|
|
153
153
|
}
|
|
154
154
|
return await this.aztecNode.getBlock(blockNumber);
|
|
155
155
|
}
|
|
156
156
|
async getPublicDataWitness(blockNumber, leafSlot) {
|
|
157
157
|
const header = await this.getAnchorBlockHeader();
|
|
158
|
-
if (blockNumber > header.globalVariables.blockNumber) {
|
|
158
|
+
if (blockNumber !== 'latest' && blockNumber > header.globalVariables.blockNumber) {
|
|
159
159
|
throw new Error(`Block number ${blockNumber} is higher than current block ${header.globalVariables.blockNumber}`);
|
|
160
160
|
}
|
|
161
161
|
return await this.aztecNode.getPublicDataWitness(blockNumber, leafSlot);
|
|
162
162
|
}
|
|
163
163
|
async getPublicStorageAt(blockNumber, contract, slot) {
|
|
164
164
|
const header = await this.getAnchorBlockHeader();
|
|
165
|
-
if (blockNumber > header.globalVariables.blockNumber) {
|
|
165
|
+
if (blockNumber !== 'latest' && blockNumber > header.globalVariables.blockNumber) {
|
|
166
166
|
throw new Error(`Block number ${blockNumber} is higher than current block ${header.globalVariables.blockNumber}`);
|
|
167
167
|
}
|
|
168
168
|
return await this.aztecNode.getPublicStorageAt(blockNumber, contract, slot);
|
|
@@ -472,7 +472,7 @@ import { NoteValidationRequest } from './noir-structs/note_validation_request.js
|
|
|
472
472
|
if (uniqueNoteHashTreeIndexInBlock === undefined) {
|
|
473
473
|
throw new Error(`Note hash ${noteHash} (uniqued as ${uniqueNoteHash}) is not present on the tree at block ${syncedBlockNumber} (from tx ${txHash})`);
|
|
474
474
|
}
|
|
475
|
-
const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, uniqueNoteHashTreeIndexInBlock
|
|
475
|
+
const noteDao = new NoteDao(new Note(content), contractAddress, owner, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, uniqueNoteHashTreeIndexInBlock.l2BlockNumber, uniqueNoteHashTreeIndexInBlock.l2BlockHash.toString(), uniqueNoteHashTreeIndexInBlock.data);
|
|
476
476
|
// The note was found by `recipient`, so we use that as the scope when storing the note.
|
|
477
477
|
await this.noteDataProvider.addNotes([
|
|
478
478
|
noteDao
|
|
@@ -4,7 +4,7 @@ import { MembershipWitness } from '@aztec/foundation/trees';
|
|
|
4
4
|
import type { KeyStore } from '@aztec/key-store';
|
|
5
5
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
6
6
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import type {
|
|
7
|
+
import type { BlockParameter } from '@aztec/stdlib/block';
|
|
8
8
|
import type { AztecNode } from '@aztec/stdlib/interfaces/client';
|
|
9
9
|
import { UpdatedClassIdHints } from '@aztec/stdlib/kernel';
|
|
10
10
|
import type { NullifierMembershipWitness } from '@aztec/stdlib/trees';
|
|
@@ -20,7 +20,7 @@ export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
|
|
|
20
20
|
private node;
|
|
21
21
|
private blockNumber;
|
|
22
22
|
private log;
|
|
23
|
-
constructor(contractDataProvider: ContractDataProvider, keyStore: KeyStore, node: AztecNode, blockNumber?:
|
|
23
|
+
constructor(contractDataProvider: ContractDataProvider, keyStore: KeyStore, node: AztecNode, blockNumber?: BlockParameter, log?: import("@aztec/foundation/log").Logger);
|
|
24
24
|
getContractAddressPreimage(address: AztecAddress): Promise<{
|
|
25
25
|
version: 1;
|
|
26
26
|
salt: Fr;
|
|
@@ -42,4 +42,4 @@ export declare class PrivateKernelOracleImpl implements PrivateKernelOracle {
|
|
|
42
42
|
getDebugFunctionName(contractAddress: AztecAddress, selector: FunctionSelector): Promise<string>;
|
|
43
43
|
getUpdatedClassIdHints(contractAddress: AztecAddress): Promise<UpdatedClassIdHints>;
|
|
44
44
|
}
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
45
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJpdmF0ZV9rZXJuZWxfb3JhY2xlX2ltcGwuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wcml2YXRlX2tlcm5lbC9wcml2YXRlX2tlcm5lbF9vcmFjbGVfaW1wbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUscUJBQXFCLEVBQTJDLE1BQU0sa0JBQWtCLENBQUM7QUFDbEcsT0FBTyxLQUFLLEVBQUUsRUFBRSxFQUFFLGNBQWMsRUFBRSxLQUFLLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUcxRSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUM1RCxPQUFPLEtBQUssRUFBRSxRQUFRLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUdqRCxPQUFPLEtBQUssRUFB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,IAAI,EAAE,SAAS,EACf,WAAW,GAAE,cAAyB,EACtC,GAAG,yCAAoC,EAC7C;IAES,0BAA0B,CAAC,OAAO,EAAE,YAAY;;;;;;;;;;OAS5D;IAEY,0BAA0B,CAAC,eAAe,EAAE,EAAE,qEAM1D;IAEY,4BAA4B,CAAC,eAAe,EAAE,EAAE,EAAE,QAAQ,EAAE,gBAAgB,iCAQxF;IAEM,sBAAsB,CAAC,EAAE,EAAE,uBAAuB,iCAGxD;IAEK,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,OAAO,qBAAqB,CAAC,CAAC,CAO9G;IAED,6BAA6B,CAAC,SAAS,EAAE,EAAE,GAAG,OAAO,CAAC,0BAA0B,GAAG,SAAS,CAAC,CAE5F;IAEK,mBAAmB,IAAI,OAAO,CAAC,EAAE,CAAC,CAMvC;IAEM,kBAAkB,CAAC,eAAe,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,CAEzE;IAEM,oBAAoB,CAAC,eAAe,EAAE,YAAY,EAAE,QAAQ,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtG;IAEY,sBAAsB,CAAC,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,mBAAmB,CAAC,CA8B/F;CACF"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
2
3
|
import { BlockHeader } from '@aztec/stdlib/tx';
|
|
3
4
|
export declare class SyncDataProvider {
|
|
4
5
|
#private;
|
|
5
6
|
constructor(store: AztecAsyncKVStore);
|
|
6
7
|
setHeader(header: BlockHeader): Promise<void>;
|
|
7
|
-
getBlockNumber(): Promise<
|
|
8
|
+
getBlockNumber(): Promise<BlockNumber>;
|
|
8
9
|
getBlockHeader(): Promise<BlockHeader>;
|
|
9
10
|
}
|
|
10
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY19kYXRhX3Byb3ZpZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc3RvcmFnZS9zeW5jX2RhdGFfcHJvdmlkZXIvc3luY19kYXRhX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQUFNLGlDQUFpQyxDQUFDO0FBQ25FLE9BQU8sS0FBSyxFQUFFLGlCQUFpQixFQUF1QixNQUFNLGlCQUFpQixDQUFDO0FBQzlFLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQUUvQyxxQkFBYSxnQkFBZ0I7O0lBSTNCLFlBQVksS0FBSyxFQUFFLGlCQUFpQixFQUduQztJQUVLLFNBQVMsQ0FBQyxNQUFNLEVBQUUsV0FBVyxHQUFHLE9BQU8sQ0FBQyxJQUFJLENBQUMsQ0FFbEQ7SUFFSyxjQUFjLElBQUksT0FBTyxDQUFDLFdBQVcsQ0FBQyxDQU8zQztJQUVLLGNBQWMsSUFBSSxPQUFPLENBQUMsV0FBVyxDQUFDLENBTzNDO0NBQ0YifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/sync_data_provider/sync_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,qBAAa,gBAAgB;;IAI3B,YAAY,KAAK,EAAE,iBAAiB,EAGnC;IAEK,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAElD;IAEK,cAAc,IAAI,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"sync_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/sync_data_provider/sync_data_provider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,iBAAiB,EAAuB,MAAM,iBAAiB,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,qBAAa,gBAAgB;;IAI3B,YAAY,KAAK,EAAE,iBAAiB,EAGnC;IAEK,SAAS,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAElD;IAEK,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAO3C;IAEK,cAAc,IAAI,OAAO,CAAC,WAAW,CAAC,CAO3C;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { type Logger } from '@aztec/foundation/log';
|
|
2
3
|
import type { L2TipsKVStore } from '@aztec/kv-store/stores';
|
|
3
4
|
import { L2BlockStream, type L2BlockStreamEvent, type L2BlockStreamEventHandler } from '@aztec/stdlib/block';
|
|
@@ -30,6 +31,6 @@ export declare class Synchronizer implements L2BlockStreamEventHandler {
|
|
|
30
31
|
*/
|
|
31
32
|
sync(): Promise<void>;
|
|
32
33
|
private doSync;
|
|
33
|
-
getSynchedBlockNumber(): Promise<
|
|
34
|
+
getSynchedBlockNumber(): Promise<BlockNumber>;
|
|
34
35
|
}
|
|
35
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
36
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3luY2hyb25pemVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc3luY2hyb25pemVyL3N5bmNocm9uaXplci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzI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AAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qDAAqD,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2DAA2D,CAAC;AAErG;;;;GAIG;AACH,qBAAa,YAAa,YAAW,yBAAyB;IAM1D,OAAO,CAAC,IAAI;IACZ,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,gBAAgB;IACxB,OAAO,CAAC,mBAAmB;IAC3B,OAAO,CAAC,WAAW;IATrB,OAAO,CAAC,GAAG,CAAS;IACpB,OAAO,CAAC,SAAS,CAA4B;IAC7C,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC;IAE9C,YACU,IAAI,EAAE,SAAS,EACf,gBAAgB,EAAE,gBAAgB,EAClC,gBAAgB,EAAE,gBAAgB,EAClC,mBAAmB,EAAE,mBAAmB,EACxC,WAAW,EAAE,aAAa,EAClC,MAAM,GAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAM,EACzD,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,EAOjC;IAED,SAAS,CAAC,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC,iBAO/E;IAED,iDAAiD;IACpC,sBAAsB,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAgC5E;IAED;;;OAGG;IACU,IAAI,kBAehB;YAEa,MAAM;IAeb,qBAAqB,yBAE3B;CACF"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { createLogger } from '@aztec/foundation/log';
|
|
2
3
|
import { L2BlockStream } from '@aztec/stdlib/block';
|
|
3
4
|
/**
|
|
@@ -91,7 +92,7 @@ import { L2BlockStream } from '@aztec/stdlib/block';
|
|
|
91
92
|
}
|
|
92
93
|
if (!currentHeader) {
|
|
93
94
|
// REFACTOR: We should know the header of the genesis block without having to request it from the node.
|
|
94
|
-
await this.syncDataProvider.setHeader(await this.node.getBlockHeader(
|
|
95
|
+
await this.syncDataProvider.setHeader(await this.node.getBlockHeader(BlockNumber.ZERO));
|
|
95
96
|
}
|
|
96
97
|
await this.blockStream.sync();
|
|
97
98
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/pxe",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20251205",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/entrypoints/server/index.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"bin": "./dest/bin/index.js",
|
|
13
13
|
"scripts": {
|
|
14
14
|
"build": "yarn clean && yarn generate && tsgo -b",
|
|
15
|
-
"build:dev": "
|
|
15
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
16
16
|
"clean": "rm -rf ./dest .tsbuildinfo ./src/config/package_info.ts",
|
|
17
17
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
|
|
18
18
|
"generate": "node ./scripts/generate_package_info.js",
|
|
@@ -61,19 +61,19 @@
|
|
|
61
61
|
]
|
|
62
62
|
},
|
|
63
63
|
"dependencies": {
|
|
64
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
65
|
-
"@aztec/bb.js": "3.0.0-nightly.
|
|
66
|
-
"@aztec/builder": "3.0.0-nightly.
|
|
67
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
68
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
69
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
70
|
-
"@aztec/key-store": "3.0.0-nightly.
|
|
71
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
72
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
73
|
-
"@aztec/noir-types": "3.0.0-nightly.
|
|
74
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
75
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
76
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
64
|
+
"@aztec/bb-prover": "3.0.0-nightly.20251205",
|
|
65
|
+
"@aztec/bb.js": "3.0.0-nightly.20251205",
|
|
66
|
+
"@aztec/builder": "3.0.0-nightly.20251205",
|
|
67
|
+
"@aztec/constants": "3.0.0-nightly.20251205",
|
|
68
|
+
"@aztec/ethereum": "3.0.0-nightly.20251205",
|
|
69
|
+
"@aztec/foundation": "3.0.0-nightly.20251205",
|
|
70
|
+
"@aztec/key-store": "3.0.0-nightly.20251205",
|
|
71
|
+
"@aztec/kv-store": "3.0.0-nightly.20251205",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251205",
|
|
73
|
+
"@aztec/noir-types": "3.0.0-nightly.20251205",
|
|
74
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251205",
|
|
75
|
+
"@aztec/simulator": "3.0.0-nightly.20251205",
|
|
76
|
+
"@aztec/stdlib": "3.0.0-nightly.20251205",
|
|
77
77
|
"koa": "^2.16.1",
|
|
78
78
|
"koa-router": "^13.1.1",
|
|
79
79
|
"lodash.omit": "^4.5.0",
|
|
@@ -82,8 +82,8 @@
|
|
|
82
82
|
"viem": "npm:@aztec/viem@2.38.2"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
86
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
85
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20251205",
|
|
86
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251205",
|
|
87
87
|
"@jest/globals": "^30.0.0",
|
|
88
88
|
"@types/jest": "^30.0.0",
|
|
89
89
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
3
|
import type { Fr, Point } from '@aztec/foundation/fields';
|
|
3
4
|
import type { FunctionArtifactWithContractName, FunctionSelector } from '@aztec/stdlib/abi';
|
|
4
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -151,7 +152,7 @@ export interface ExecutionDataProvider {
|
|
|
151
152
|
* @param leafValue - The leaf value
|
|
152
153
|
* @returns The index and sibling path concatenated [index, sibling_path]
|
|
153
154
|
*/
|
|
154
|
-
getMembershipWitness(blockNumber:
|
|
155
|
+
getMembershipWitness(blockNumber: BlockNumber, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]>;
|
|
155
156
|
|
|
156
157
|
/**
|
|
157
158
|
* Returns a nullifier membership witness for a given nullifier at a given block.
|
|
@@ -159,7 +160,10 @@ export interface ExecutionDataProvider {
|
|
|
159
160
|
* @param nullifier - Nullifier we try to find witness for.
|
|
160
161
|
* @returns The nullifier membership witness (if found).
|
|
161
162
|
*/
|
|
162
|
-
getNullifierMembershipWitness(
|
|
163
|
+
getNullifierMembershipWitness(
|
|
164
|
+
blockNumber: BlockNumber,
|
|
165
|
+
nullifier: Fr,
|
|
166
|
+
): Promise<NullifierMembershipWitness | undefined>;
|
|
163
167
|
|
|
164
168
|
/**
|
|
165
169
|
* Returns a low nullifier membership witness for a given nullifier at a given block.
|
|
@@ -170,14 +174,17 @@ export interface ExecutionDataProvider {
|
|
|
170
174
|
* list structure" of leaves and proving that a lower nullifier is pointing to a bigger next value than the nullifier
|
|
171
175
|
* we are trying to prove non-inclusion for.
|
|
172
176
|
*/
|
|
173
|
-
getLowNullifierMembershipWitness(
|
|
177
|
+
getLowNullifierMembershipWitness(
|
|
178
|
+
blockNumber: BlockNumber,
|
|
179
|
+
nullifier: Fr,
|
|
180
|
+
): Promise<NullifierMembershipWitness | undefined>;
|
|
174
181
|
|
|
175
182
|
/**
|
|
176
183
|
* Returns a witness for a given slot of the public data tree at a given block.
|
|
177
184
|
* @param blockNumber - The block number at which to get the witness.
|
|
178
185
|
* @param leafSlot - The slot of the public data in the public data tree.
|
|
179
186
|
*/
|
|
180
|
-
getPublicDataWitness(blockNumber:
|
|
187
|
+
getPublicDataWitness(blockNumber: BlockNumber, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
|
|
181
188
|
|
|
182
189
|
/**
|
|
183
190
|
* Gets the storage value at the given contract storage slot.
|
|
@@ -191,14 +198,14 @@ export interface ExecutionDataProvider {
|
|
|
191
198
|
* @returns Storage value at the given contract slot.
|
|
192
199
|
* @throws If the contract is not deployed.
|
|
193
200
|
*/
|
|
194
|
-
getPublicStorageAt(blockNumber:
|
|
201
|
+
getPublicStorageAt(blockNumber: BlockNumber, contract: AztecAddress, slot: Fr): Promise<Fr>;
|
|
195
202
|
|
|
196
203
|
/**
|
|
197
204
|
* Fetch a block corresponding to the given block number.
|
|
198
205
|
* @param blockNumber - The block number of a block to fetch.
|
|
199
206
|
* @returns - The block corresponding to the given block number. Undefined if it does not exist.
|
|
200
207
|
*/
|
|
201
|
-
getBlock(blockNumber:
|
|
208
|
+
getBlock(blockNumber: BlockNumber): Promise<L2Block | undefined>;
|
|
202
209
|
|
|
203
210
|
/**
|
|
204
211
|
* Assert that the oracle version is compatible with the expected version.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { L1_TO_L2_MSG_TREE_HEIGHT } from '@aztec/constants';
|
|
2
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
3
|
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
4
|
import type { FunctionSelector, NoteSelector } from '@aztec/stdlib/abi';
|
|
4
5
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
@@ -64,17 +65,17 @@ export interface IUtilityExecutionOracle {
|
|
|
64
65
|
utilityGetUtilityContext(): Promise<UtilityContext>;
|
|
65
66
|
utilityGetKeyValidationRequest(pkMHash: Fr): Promise<KeyValidationRequest>;
|
|
66
67
|
utilityGetContractInstance(address: AztecAddress): Promise<ContractInstance>;
|
|
67
|
-
utilityGetMembershipWitness(blockNumber:
|
|
68
|
+
utilityGetMembershipWitness(blockNumber: BlockNumber, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[] | undefined>;
|
|
68
69
|
utilityGetNullifierMembershipWitness(
|
|
69
|
-
blockNumber:
|
|
70
|
+
blockNumber: BlockNumber,
|
|
70
71
|
nullifier: Fr,
|
|
71
72
|
): Promise<NullifierMembershipWitness | undefined>;
|
|
72
|
-
utilityGetPublicDataWitness(blockNumber:
|
|
73
|
+
utilityGetPublicDataWitness(blockNumber: BlockNumber, leafSlot: Fr): Promise<PublicDataWitness | undefined>;
|
|
73
74
|
utilityGetLowNullifierMembershipWitness(
|
|
74
|
-
blockNumber:
|
|
75
|
+
blockNumber: BlockNumber,
|
|
75
76
|
nullifier: Fr,
|
|
76
77
|
): Promise<NullifierMembershipWitness | undefined>;
|
|
77
|
-
utilityGetBlockHeader(blockNumber:
|
|
78
|
+
utilityGetBlockHeader(blockNumber: BlockNumber): Promise<BlockHeader | undefined>;
|
|
78
79
|
utilityGetPublicKeysAndPartialAddress(account: AztecAddress): Promise<CompleteAddress>;
|
|
79
80
|
utilityGetAuthWitness(messageHash: Fr): Promise<Fr[] | undefined>;
|
|
80
81
|
utilityGetNotes(
|
|
@@ -103,7 +104,7 @@ export interface IUtilityExecutionOracle {
|
|
|
103
104
|
utilityStorageRead(
|
|
104
105
|
contractAddress: AztecAddress,
|
|
105
106
|
startStorageSlot: Fr,
|
|
106
|
-
blockNumber:
|
|
107
|
+
blockNumber: BlockNumber,
|
|
107
108
|
numberOfElements: number,
|
|
108
109
|
): Promise<Fr[]>;
|
|
109
110
|
utilityFetchTaggedLogs(pendingTaggedLogArrayBaseSlot: Fr): Promise<void>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { Fr, Point } from '@aztec/foundation/fields';
|
|
2
3
|
import {
|
|
3
4
|
type ACIRCallback,
|
|
@@ -145,7 +146,7 @@ export class Oracle {
|
|
|
145
146
|
const parsedLeafValue = Fr.fromString(leafValue);
|
|
146
147
|
|
|
147
148
|
const witness = await this.handlerAsUtility().utilityGetMembershipWitness(
|
|
148
|
-
parsedBlockNumber,
|
|
149
|
+
BlockNumber(parsedBlockNumber),
|
|
149
150
|
parsedTreeId,
|
|
150
151
|
parsedLeafValue,
|
|
151
152
|
);
|
|
@@ -165,7 +166,7 @@ export class Oracle {
|
|
|
165
166
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
166
167
|
|
|
167
168
|
const witness = await this.handlerAsUtility().utilityGetNullifierMembershipWitness(
|
|
168
|
-
parsedBlockNumber,
|
|
169
|
+
BlockNumber(parsedBlockNumber),
|
|
169
170
|
parsedNullifier,
|
|
170
171
|
);
|
|
171
172
|
if (!witness) {
|
|
@@ -182,7 +183,7 @@ export class Oracle {
|
|
|
182
183
|
const parsedNullifier = Fr.fromString(nullifier);
|
|
183
184
|
|
|
184
185
|
const witness = await this.handlerAsUtility().utilityGetLowNullifierMembershipWitness(
|
|
185
|
-
parsedBlockNumber,
|
|
186
|
+
BlockNumber(parsedBlockNumber),
|
|
186
187
|
parsedNullifier,
|
|
187
188
|
);
|
|
188
189
|
if (!witness) {
|
|
@@ -200,7 +201,10 @@ export class Oracle {
|
|
|
200
201
|
const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
|
|
201
202
|
const parsedLeafSlot = Fr.fromString(leafSlot);
|
|
202
203
|
|
|
203
|
-
const witness = await this.handlerAsUtility().utilityGetPublicDataWitness(
|
|
204
|
+
const witness = await this.handlerAsUtility().utilityGetPublicDataWitness(
|
|
205
|
+
BlockNumber(parsedBlockNumber),
|
|
206
|
+
parsedLeafSlot,
|
|
207
|
+
);
|
|
204
208
|
if (!witness) {
|
|
205
209
|
throw new Error(`Public data witness not found for slot ${parsedLeafSlot} at block ${parsedBlockNumber}.`);
|
|
206
210
|
}
|
|
@@ -210,7 +214,7 @@ export class Oracle {
|
|
|
210
214
|
async utilityGetBlockHeader([blockNumber]: ACVMField[]): Promise<ACVMField[]> {
|
|
211
215
|
const parsedBlockNumber = Fr.fromString(blockNumber).toNumber();
|
|
212
216
|
|
|
213
|
-
const header = await this.handlerAsUtility().utilityGetBlockHeader(parsedBlockNumber);
|
|
217
|
+
const header = await this.handlerAsUtility().utilityGetBlockHeader(BlockNumber(parsedBlockNumber));
|
|
214
218
|
if (!header) {
|
|
215
219
|
throw new Error(`Block header not found for block ${parsedBlockNumber}.`);
|
|
216
220
|
}
|
|
@@ -348,7 +352,7 @@ export class Oracle {
|
|
|
348
352
|
const values = await this.handlerAsUtility().utilityStorageRead(
|
|
349
353
|
new AztecAddress(Fr.fromString(contractAddress)),
|
|
350
354
|
Fr.fromString(startStorageSlot),
|
|
351
|
-
+blockNumber,
|
|
355
|
+
BlockNumber(+blockNumber),
|
|
352
356
|
+numberOfElements,
|
|
353
357
|
);
|
|
354
358
|
return [values.map(toACVMField)];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PRIVATE_CIRCUIT_PUBLIC_INPUTS_LENGTH, PRIVATE_CONTEXT_INPUTS_LENGTH } from '@aztec/constants';
|
|
2
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
2
3
|
import { Fr } from '@aztec/foundation/fields';
|
|
3
4
|
import { createLogger } from '@aztec/foundation/log';
|
|
4
5
|
import { Timer } from '@aztec/foundation/timer';
|
|
@@ -162,7 +163,7 @@ export async function readCurrentClassId(
|
|
|
162
163
|
contractAddress: AztecAddress,
|
|
163
164
|
instance: ContractInstance,
|
|
164
165
|
executionDataProvider: ExecutionDataProvider | AztecNode,
|
|
165
|
-
blockNumber:
|
|
166
|
+
blockNumber: BlockNumber,
|
|
166
167
|
timestamp: UInt64,
|
|
167
168
|
) {
|
|
168
169
|
const { delayedPublicMutableSlot } = await DelayedPublicMutableValuesWithHash.getContractUpdateSlots(contractAddress);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { Aes128 } from '@aztec/foundation/crypto';
|
|
2
3
|
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
4
|
import { LogLevels, applyStringFormatting, createLogger } from '@aztec/foundation/log';
|
|
@@ -70,7 +71,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
|
|
|
70
71
|
* @param leafValue - The leaf value
|
|
71
72
|
* @returns The index and sibling path concatenated [index, sibling_path]
|
|
72
73
|
*/
|
|
73
|
-
public utilityGetMembershipWitness(blockNumber:
|
|
74
|
+
public utilityGetMembershipWitness(blockNumber: BlockNumber, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]> {
|
|
74
75
|
return this.executionDataProvider.getMembershipWitness(blockNumber, treeId, leafValue);
|
|
75
76
|
}
|
|
76
77
|
|
|
@@ -81,7 +82,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
|
|
|
81
82
|
* @returns The nullifier membership witness (if found).
|
|
82
83
|
*/
|
|
83
84
|
public async utilityGetNullifierMembershipWitness(
|
|
84
|
-
blockNumber:
|
|
85
|
+
blockNumber: BlockNumber,
|
|
85
86
|
nullifier: Fr,
|
|
86
87
|
): Promise<NullifierMembershipWitness | undefined> {
|
|
87
88
|
return await this.executionDataProvider.getNullifierMembershipWitness(blockNumber, nullifier);
|
|
@@ -97,7 +98,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
|
|
|
97
98
|
* we are trying to prove non-inclusion for.
|
|
98
99
|
*/
|
|
99
100
|
public async utilityGetLowNullifierMembershipWitness(
|
|
100
|
-
blockNumber:
|
|
101
|
+
blockNumber: BlockNumber,
|
|
101
102
|
nullifier: Fr,
|
|
102
103
|
): Promise<NullifierMembershipWitness | undefined> {
|
|
103
104
|
return await this.executionDataProvider.getLowNullifierMembershipWitness(blockNumber, nullifier);
|
|
@@ -109,7 +110,10 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
|
|
|
109
110
|
* @param leafSlot - The slot of the public data tree to get the witness for.
|
|
110
111
|
* @returns - The witness
|
|
111
112
|
*/
|
|
112
|
-
public async utilityGetPublicDataWitness(
|
|
113
|
+
public async utilityGetPublicDataWitness(
|
|
114
|
+
blockNumber: BlockNumber,
|
|
115
|
+
leafSlot: Fr,
|
|
116
|
+
): Promise<PublicDataWitness | undefined> {
|
|
113
117
|
return await this.executionDataProvider.getPublicDataWitness(blockNumber, leafSlot);
|
|
114
118
|
}
|
|
115
119
|
|
|
@@ -118,7 +122,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
|
|
|
118
122
|
* @param blockNumber - The number of a block of which to get the block header.
|
|
119
123
|
* @returns Block extracted from a block with block number `blockNumber`.
|
|
120
124
|
*/
|
|
121
|
-
public async utilityGetBlockHeader(blockNumber:
|
|
125
|
+
public async utilityGetBlockHeader(blockNumber: BlockNumber): Promise<BlockHeader | undefined> {
|
|
122
126
|
const block = await this.executionDataProvider.getBlock(blockNumber);
|
|
123
127
|
if (!block) {
|
|
124
128
|
return undefined;
|
|
@@ -249,7 +253,7 @@ export class UtilityExecutionOracle implements IMiscOracle, IUtilityExecutionOra
|
|
|
249
253
|
public async utilityStorageRead(
|
|
250
254
|
contractAddress: AztecAddress,
|
|
251
255
|
startStorageSlot: Fr,
|
|
252
|
-
blockNumber:
|
|
256
|
+
blockNumber: BlockNumber,
|
|
253
257
|
numberOfElements: number,
|
|
254
258
|
) {
|
|
255
259
|
const values = [];
|
|
@@ -5,7 +5,7 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
5
5
|
import type { KeyStore } from '@aztec/key-store';
|
|
6
6
|
import { EventSelector, type FunctionArtifactWithContractName, FunctionSelector } from '@aztec/stdlib/abi';
|
|
7
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import type { DataInBlock, L2Block
|
|
8
|
+
import type { BlockParameter, DataInBlock, L2Block } from '@aztec/stdlib/block';
|
|
9
9
|
import type { CompleteAddress, ContractInstance } from '@aztec/stdlib/contract';
|
|
10
10
|
import { computeUniqueNoteHash, siloNoteHash, siloNullifier, siloPrivateLog } from '@aztec/stdlib/hash';
|
|
11
11
|
import { type AztecNode, MAX_RPC_LEN } from '@aztec/stdlib/interfaces/client';
|
|
@@ -163,12 +163,12 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
163
163
|
return await this.#findLeafIndex('latest', MerkleTreeId.NULLIFIER_TREE, nullifier);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
async #findLeafIndex(blockNumber:
|
|
166
|
+
async #findLeafIndex(blockNumber: BlockParameter, treeId: MerkleTreeId, leafValue: Fr): Promise<bigint | undefined> {
|
|
167
167
|
const [leafIndex] = await this.aztecNode.findLeavesIndexes(blockNumber, treeId, [leafValue]);
|
|
168
168
|
return leafIndex?.data;
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
public async getMembershipWitness(blockNumber:
|
|
171
|
+
public async getMembershipWitness(blockNumber: BlockParameter, treeId: MerkleTreeId, leafValue: Fr): Promise<Fr[]> {
|
|
172
172
|
const witness = await this.#tryGetMembershipWitness(blockNumber, treeId, leafValue);
|
|
173
173
|
if (!witness) {
|
|
174
174
|
throw new Error(`Leaf value ${leafValue} not found in tree ${MerkleTreeId[treeId]} at block ${blockNumber}`);
|
|
@@ -176,7 +176,11 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
176
176
|
return witness;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
async #tryGetMembershipWitness(
|
|
179
|
+
async #tryGetMembershipWitness(
|
|
180
|
+
blockNumber: BlockParameter,
|
|
181
|
+
treeId: MerkleTreeId,
|
|
182
|
+
value: Fr,
|
|
183
|
+
): Promise<Fr[] | undefined> {
|
|
180
184
|
switch (treeId) {
|
|
181
185
|
case MerkleTreeId.NULLIFIER_TREE:
|
|
182
186
|
return (await this.aztecNode.getNullifierMembershipWitness(blockNumber, value))?.withoutPreimage().toFields();
|
|
@@ -197,42 +201,42 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
197
201
|
}
|
|
198
202
|
|
|
199
203
|
public getNullifierMembershipWitness(
|
|
200
|
-
blockNumber:
|
|
204
|
+
blockNumber: BlockParameter,
|
|
201
205
|
nullifier: Fr,
|
|
202
206
|
): Promise<NullifierMembershipWitness | undefined> {
|
|
203
207
|
return this.aztecNode.getNullifierMembershipWitness(blockNumber, nullifier);
|
|
204
208
|
}
|
|
205
209
|
|
|
206
210
|
public async getLowNullifierMembershipWitness(
|
|
207
|
-
blockNumber:
|
|
211
|
+
blockNumber: BlockParameter,
|
|
208
212
|
nullifier: Fr,
|
|
209
213
|
): Promise<NullifierMembershipWitness | undefined> {
|
|
210
214
|
const header = await this.getAnchorBlockHeader();
|
|
211
|
-
if (blockNumber > header.globalVariables.blockNumber) {
|
|
215
|
+
if (blockNumber !== 'latest' && blockNumber > header.globalVariables.blockNumber) {
|
|
212
216
|
throw new Error(`Block number ${blockNumber} is higher than current block ${header.globalVariables.blockNumber}`);
|
|
213
217
|
}
|
|
214
218
|
return this.aztecNode.getLowNullifierMembershipWitness(blockNumber, nullifier);
|
|
215
219
|
}
|
|
216
220
|
|
|
217
|
-
public async getBlock(blockNumber:
|
|
221
|
+
public async getBlock(blockNumber: BlockParameter): Promise<L2Block | undefined> {
|
|
218
222
|
const header = await this.getAnchorBlockHeader();
|
|
219
|
-
if (blockNumber > header.globalVariables.blockNumber) {
|
|
223
|
+
if (blockNumber !== 'latest' && blockNumber > header.globalVariables.blockNumber) {
|
|
220
224
|
throw new Error(`Block number ${blockNumber} is higher than current block ${header.globalVariables.blockNumber}`);
|
|
221
225
|
}
|
|
222
226
|
return await this.aztecNode.getBlock(blockNumber);
|
|
223
227
|
}
|
|
224
228
|
|
|
225
|
-
public async getPublicDataWitness(blockNumber:
|
|
229
|
+
public async getPublicDataWitness(blockNumber: BlockParameter, leafSlot: Fr): Promise<PublicDataWitness | undefined> {
|
|
226
230
|
const header = await this.getAnchorBlockHeader();
|
|
227
|
-
if (blockNumber > header.globalVariables.blockNumber) {
|
|
231
|
+
if (blockNumber !== 'latest' && blockNumber > header.globalVariables.blockNumber) {
|
|
228
232
|
throw new Error(`Block number ${blockNumber} is higher than current block ${header.globalVariables.blockNumber}`);
|
|
229
233
|
}
|
|
230
234
|
return await this.aztecNode.getPublicDataWitness(blockNumber, leafSlot);
|
|
231
235
|
}
|
|
232
236
|
|
|
233
|
-
public async getPublicStorageAt(blockNumber:
|
|
237
|
+
public async getPublicStorageAt(blockNumber: BlockParameter, contract: AztecAddress, slot: Fr): Promise<Fr> {
|
|
234
238
|
const header = await this.getAnchorBlockHeader();
|
|
235
|
-
if (blockNumber > header.globalVariables.blockNumber) {
|
|
239
|
+
if (blockNumber !== 'latest' && blockNumber > header.globalVariables.blockNumber) {
|
|
236
240
|
throw new Error(`Block number ${blockNumber} is higher than current block ${header.globalVariables.blockNumber}`);
|
|
237
241
|
}
|
|
238
242
|
return await this.aztecNode.getPublicStorageAt(blockNumber, contract, slot);
|
|
@@ -699,9 +703,9 @@ export class PXEOracleInterface implements ExecutionDataProvider {
|
|
|
699
703
|
noteHash,
|
|
700
704
|
siloedNullifier,
|
|
701
705
|
txHash,
|
|
702
|
-
uniqueNoteHashTreeIndexInBlock
|
|
703
|
-
uniqueNoteHashTreeIndexInBlock
|
|
704
|
-
uniqueNoteHashTreeIndexInBlock
|
|
706
|
+
uniqueNoteHashTreeIndexInBlock.l2BlockNumber,
|
|
707
|
+
uniqueNoteHashTreeIndexInBlock.l2BlockHash.toString(),
|
|
708
|
+
uniqueNoteHashTreeIndexInBlock.data,
|
|
705
709
|
);
|
|
706
710
|
|
|
707
711
|
// The note was found by `recipient`, so we use that as the scope when storing the note.
|
|
@@ -8,7 +8,7 @@ import { getVKIndex, getVKSiblingPath } from '@aztec/noir-protocol-circuits-type
|
|
|
8
8
|
import { ProtocolContractAddress } from '@aztec/protocol-contracts';
|
|
9
9
|
import type { FunctionSelector } from '@aztec/stdlib/abi';
|
|
10
10
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
11
|
-
import type {
|
|
11
|
+
import type { BlockParameter } from '@aztec/stdlib/block';
|
|
12
12
|
import { computeContractClassIdPreimage, computeSaltedInitializationHash } from '@aztec/stdlib/contract';
|
|
13
13
|
import { DelayedPublicMutableValues, DelayedPublicMutableValuesWithHash } from '@aztec/stdlib/delayed-public-mutable';
|
|
14
14
|
import { computePublicDataTreeLeafSlot } from '@aztec/stdlib/hash';
|
|
@@ -31,7 +31,7 @@ export class PrivateKernelOracleImpl implements PrivateKernelOracle {
|
|
|
31
31
|
private contractDataProvider: ContractDataProvider,
|
|
32
32
|
private keyStore: KeyStore,
|
|
33
33
|
private node: AztecNode,
|
|
34
|
-
private blockNumber:
|
|
34
|
+
private blockNumber: BlockParameter = 'latest',
|
|
35
35
|
private log = createLogger('pxe:kernel_oracle'),
|
|
36
36
|
) {}
|
|
37
37
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import type { AztecAsyncKVStore, AztecAsyncSingleton } from '@aztec/kv-store';
|
|
2
3
|
import { BlockHeader } from '@aztec/stdlib/tx';
|
|
3
4
|
|
|
@@ -14,7 +15,7 @@ export class SyncDataProvider {
|
|
|
14
15
|
await this.#synchronizedHeader.set(header.toBuffer());
|
|
15
16
|
}
|
|
16
17
|
|
|
17
|
-
async getBlockNumber(): Promise<
|
|
18
|
+
async getBlockNumber(): Promise<BlockNumber> {
|
|
18
19
|
const headerBuffer = await this.#synchronizedHeader.getAsync();
|
|
19
20
|
if (!headerBuffer) {
|
|
20
21
|
throw new Error(`Trying to get block number with a not-yet-synchronized PXE - this should never happen`);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { BlockNumber } from '@aztec/foundation/branded-types';
|
|
1
2
|
import { type Logger, createLogger } from '@aztec/foundation/log';
|
|
2
3
|
import type { L2TipsKVStore } from '@aztec/kv-store/stores';
|
|
3
4
|
import { L2BlockStream, type L2BlockStreamEvent, type L2BlockStreamEventHandler } from '@aztec/stdlib/block';
|
|
@@ -109,7 +110,7 @@ export class Synchronizer implements L2BlockStreamEventHandler {
|
|
|
109
110
|
}
|
|
110
111
|
if (!currentHeader) {
|
|
111
112
|
// REFACTOR: We should know the header of the genesis block without having to request it from the node.
|
|
112
|
-
await this.syncDataProvider.setHeader((await this.node.getBlockHeader(
|
|
113
|
+
await this.syncDataProvider.setHeader((await this.node.getBlockHeader(BlockNumber.ZERO))!);
|
|
113
114
|
}
|
|
114
115
|
await this.blockStream.sync();
|
|
115
116
|
}
|