@aztec/pxe 3.0.0-nightly.20251126 → 3.0.0-nightly.20251127
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/pxe_oracle_interface.d.ts.map +1 -1
- package/dest/contract_function_simulator/pxe_oracle_interface.js +1 -1
- package/dest/pxe.d.ts +3 -2
- package/dest/pxe.d.ts.map +1 -1
- package/dest/pxe.js +1 -5
- package/dest/storage/note_data_provider/index.d.ts +1 -1
- package/dest/storage/note_data_provider/index.d.ts.map +1 -1
- package/dest/storage/note_data_provider/index.js +1 -1
- package/dest/storage/note_data_provider/note_data_provider.d.ts +1 -1
- package/dest/storage/note_data_provider/note_data_provider.d.ts.map +1 -1
- package/dest/storage/note_data_provider/note_data_provider.js +1 -1
- package/package.json +17 -17
- package/src/contract_function_simulator/pxe_oracle_interface.ts +1 -1
- package/src/pxe.ts +4 -7
- package/src/storage/note_data_provider/index.ts +1 -1
- package/src/storage/note_data_provider/note_data_provider.ts +1 -2
- package/dest/storage/note_data_provider/note_dao.d.ts +0 -98
- package/dest/storage/note_data_provider/note_dao.d.ts.map +0 -1
- package/dest/storage/note_data_provider/note_dao.js +0 -101
- package/src/storage/note_data_provider/note_dao.ts +0 -153
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe_oracle_interface.d.ts","sourceRoot":"","sources":["../../src/contract_function_simulator/pxe_oracle_interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAEjE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,KAAK,gCAAgC,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3G,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;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C;IA2B1E,QAAQ,IAAI,cAAc;CAM3B"}
|
|
@@ -6,10 +6,10 @@ import { computeAddressSecret } from '@aztec/stdlib/keys';
|
|
|
6
6
|
import { PendingTaggedLog, PrivateLogWithTxData, PublicLogWithTxData, deriveEcdhSharedSecret } from '@aztec/stdlib/logs';
|
|
7
7
|
import { getNonNullifiedL1ToL2MessageWitness } from '@aztec/stdlib/messaging';
|
|
8
8
|
import { Note } from '@aztec/stdlib/note';
|
|
9
|
+
import { NoteDao } from '@aztec/stdlib/note';
|
|
9
10
|
import { MerkleTreeId } from '@aztec/stdlib/trees';
|
|
10
11
|
import { MessageLoadOracleInputs } from '../contract_function_simulator/oracle/message_load_oracle_inputs.js';
|
|
11
12
|
import { ORACLE_VERSION } from '../oracle_version.js';
|
|
12
|
-
import { NoteDao } from '../storage/note_data_provider/note_dao.js';
|
|
13
13
|
import { DirectionalAppTaggingSecret, SiloedTag, Tag, WINDOW_HALF_SIZE, getInitialIndexesMap, getPreTagsForTheWindow } from '../tagging/index.js';
|
|
14
14
|
import { EventValidationRequest } from './noir-structs/event_validation_request.js';
|
|
15
15
|
import { LogRetrievalRequest } from './noir-structs/log_retrieval_request.js';
|
package/dest/pxe.d.ts
CHANGED
|
@@ -9,7 +9,8 @@ import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
|
9
9
|
import type { L2BlockHash } from '@aztec/stdlib/block';
|
|
10
10
|
import { CompleteAddress, type ContractClassWithId, type ContractInstanceWithAddress, type PartialAddress } from '@aztec/stdlib/contract';
|
|
11
11
|
import type { AztecNode, PrivateKernelProver } from '@aztec/stdlib/interfaces/client';
|
|
12
|
-
import {
|
|
12
|
+
import type { NotesFilter } from '@aztec/stdlib/note';
|
|
13
|
+
import { NoteDao } from '@aztec/stdlib/note';
|
|
13
14
|
import { SimulationOverrides, TxExecutionRequest, TxHash, TxProfileResult, TxProvingResult, TxSimulationResult, UtilitySimulationResult } from '@aztec/stdlib/tx';
|
|
14
15
|
import type { PXEConfig } from './config/index.js';
|
|
15
16
|
export type PrivateEvent = {
|
|
@@ -166,7 +167,7 @@ export declare class PXE {
|
|
|
166
167
|
* @param filter - The filter to apply to the notes.
|
|
167
168
|
* @returns The requested notes.
|
|
168
169
|
*/
|
|
169
|
-
getNotes(filter: NotesFilter): Promise<
|
|
170
|
+
getNotes(filter: NotesFilter): Promise<NoteDao[]>;
|
|
170
171
|
/**
|
|
171
172
|
* Proves the private portion of a simulated transaction, ready to send to the network
|
|
172
173
|
* (where validators prove the public portion).
|
package/dest/pxe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":["../src/pxe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,0BAA0B,CAAC;AAC9C,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAIlE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,OAAO,EAAE,KAAK,yBAAyB,EAAyB,MAAM,2BAA2B,CAAC;AAClG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EACL,KAAK,gBAAgB,EACrB,aAAa,EACb,YAAY,EAKb,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EACL,eAAe,EACf,KAAK,mBAAmB,EACxB,KAAK,2BAA2B,EAChC,KAAK,cAAc,EAGpB,MAAM,wBAAwB,CAAC;AAGhC,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAMtF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"pxe.d.ts","sourceRoot":"","sources":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AsBG;IACI,UAAU,CACf,SAAS,EAAE,kBAAkB,EAC7B,cAAc,EAAE,OAAO,EACvB,gBAAgB,GAAE,OAAe,EACjC,kBAAkB,GAAE,OAAe,EACnC,SAAS,CAAC,EAAE,mBAAmB,EAC/B,MAAM,CAAC,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,kBAAkB,CAAC;IAgI9B;;;;;;;;OAQG;IACI,eAAe,CACpB,IAAI,EAAE,YAAY,EAClB,QAAQ,CAAC,EAAE,WAAW,EAAE,EACxB,MAAM,CAAC,EAAE,YAAY,EAAE,GACtB,OAAO,CAAC,uBAAuB,CAAC;IAwCnC;;;;;;;;OAQG;IACU,gBAAgB,CAC3B,eAAe,EAAE,YAAY,EAC7B,aAAa,EAAE,aAAa,EAC5B,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,YAAY,EAAE,GACzB,OAAO,CAAC,YAAY,EAAE,CAAC;IAc1B;;OAEG;IACI,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAG7B"}
|
package/dest/pxe.js
CHANGED
|
@@ -9,7 +9,6 @@ import { FunctionSelector, FunctionType, decodeFunctionSignature, encodeArgument
|
|
|
9
9
|
import { computeContractAddressFromInstance, getContractClassFromArtifact } from '@aztec/stdlib/contract';
|
|
10
10
|
import { SimulationError } from '@aztec/stdlib/errors';
|
|
11
11
|
import { computeProtocolNullifier, siloNullifier } from '@aztec/stdlib/hash';
|
|
12
|
-
import { UniqueNote } from '@aztec/stdlib/note';
|
|
13
12
|
import { PrivateSimulationResult, TxProfileResult, TxProvingResult, TxSimulationResult } from '@aztec/stdlib/tx';
|
|
14
13
|
import { inspect } from 'util';
|
|
15
14
|
import { ContractFunctionSimulator, generateSimulatedProvingResult } from './contract_function_simulator/contract_function_simulator.js';
|
|
@@ -456,10 +455,7 @@ import { Synchronizer } from './synchronizer/index.js';
|
|
|
456
455
|
// We need to manually trigger private state sync to have a guarantee that all the notes are available.
|
|
457
456
|
const call = await this.#getFunctionCall('sync_private_state', [], filter.contractAddress);
|
|
458
457
|
await this.simulateUtility(call);
|
|
459
|
-
|
|
460
|
-
return noteDaos.map((dao)=>{
|
|
461
|
-
return new UniqueNote(dao.note, dao.contractAddress, dao.storageSlot, dao.txHash, dao.noteNonce);
|
|
462
|
-
});
|
|
458
|
+
return this.noteDataProvider.getNotes(filter);
|
|
463
459
|
}
|
|
464
460
|
/**
|
|
465
461
|
* Proves the private portion of a simulated transaction, ready to send to the network
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { NoteDao } from '
|
|
1
|
+
export { NoteDao } from '@aztec/stdlib/note';
|
|
2
2
|
export { NoteDataProvider } from './note_data_provider.js';
|
|
@@ -3,7 +3,7 @@ import type { AztecAsyncKVStore } from '@aztec/kv-store';
|
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import type { InBlock } from '@aztec/stdlib/block';
|
|
5
5
|
import { type NotesFilter } from '@aztec/stdlib/note';
|
|
6
|
-
import { NoteDao } from '
|
|
6
|
+
import { NoteDao } from '@aztec/stdlib/note';
|
|
7
7
|
/**
|
|
8
8
|
* NoteDataProvider manages the storage and retrieval of notes.
|
|
9
9
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note_data_provider.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_data_provider.ts"],"names":[],"mappings":"AACA,OAAO,KAA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,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IA8FvD;;;;;;;;;;OAUG;IACH,eAAe,CAAC,UAAU,EAAE,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;CA+D/D"}
|
|
@@ -2,7 +2,7 @@ import { toBufferBE } from '@aztec/foundation/bigint-buffer';
|
|
|
2
2
|
import { toArray } from '@aztec/foundation/iterable';
|
|
3
3
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
4
|
import { NoteStatus } from '@aztec/stdlib/note';
|
|
5
|
-
import { NoteDao } from '
|
|
5
|
+
import { NoteDao } from '@aztec/stdlib/note';
|
|
6
6
|
/**
|
|
7
7
|
* NoteDataProvider manages the storage and retrieval of notes.
|
|
8
8
|
*
|
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.20251127",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": "./dest/entrypoints/server/index.js",
|
|
@@ -61,29 +61,29 @@
|
|
|
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.20251127",
|
|
65
|
+
"@aztec/bb.js": "3.0.0-nightly.20251127",
|
|
66
|
+
"@aztec/builder": "3.0.0-nightly.20251127",
|
|
67
|
+
"@aztec/constants": "3.0.0-nightly.20251127",
|
|
68
|
+
"@aztec/ethereum": "3.0.0-nightly.20251127",
|
|
69
|
+
"@aztec/foundation": "3.0.0-nightly.20251127",
|
|
70
|
+
"@aztec/key-store": "3.0.0-nightly.20251127",
|
|
71
|
+
"@aztec/kv-store": "3.0.0-nightly.20251127",
|
|
72
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20251127",
|
|
73
|
+
"@aztec/noir-types": "3.0.0-nightly.20251127",
|
|
74
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20251127",
|
|
75
|
+
"@aztec/simulator": "3.0.0-nightly.20251127",
|
|
76
|
+
"@aztec/stdlib": "3.0.0-nightly.20251127",
|
|
77
77
|
"koa": "^2.16.1",
|
|
78
78
|
"koa-router": "^13.1.1",
|
|
79
79
|
"lodash.omit": "^4.5.0",
|
|
80
80
|
"sha3": "^2.1.4",
|
|
81
81
|
"tslib": "^2.4.0",
|
|
82
|
-
"viem": "npm:@
|
|
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.20251127",
|
|
86
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20251127",
|
|
87
87
|
"@jest/globals": "^30.0.0",
|
|
88
88
|
"@types/jest": "^30.0.0",
|
|
89
89
|
"@types/lodash.omit": "^4.5.7",
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
} from '@aztec/stdlib/logs';
|
|
22
22
|
import { getNonNullifiedL1ToL2MessageWitness } from '@aztec/stdlib/messaging';
|
|
23
23
|
import { Note, type NoteStatus } from '@aztec/stdlib/note';
|
|
24
|
+
import { NoteDao } from '@aztec/stdlib/note';
|
|
24
25
|
import { MerkleTreeId, type NullifierMembershipWitness, PublicDataWitness } from '@aztec/stdlib/trees';
|
|
25
26
|
import type { BlockHeader } from '@aztec/stdlib/tx';
|
|
26
27
|
import { TxHash } from '@aztec/stdlib/tx';
|
|
@@ -31,7 +32,6 @@ import { ORACLE_VERSION } from '../oracle_version.js';
|
|
|
31
32
|
import type { AddressDataProvider } from '../storage/address_data_provider/address_data_provider.js';
|
|
32
33
|
import type { CapsuleDataProvider } from '../storage/capsule_data_provider/capsule_data_provider.js';
|
|
33
34
|
import type { ContractDataProvider } from '../storage/contract_data_provider/contract_data_provider.js';
|
|
34
|
-
import { NoteDao } from '../storage/note_data_provider/note_dao.js';
|
|
35
35
|
import type { NoteDataProvider } from '../storage/note_data_provider/note_data_provider.js';
|
|
36
36
|
import type { PrivateEventDataProvider } from '../storage/private_event_data_provider/private_event_data_provider.js';
|
|
37
37
|
import type { SyncDataProvider } from '../storage/sync_data_provider/sync_data_provider.js';
|
package/src/pxe.ts
CHANGED
|
@@ -35,7 +35,8 @@ import type {
|
|
|
35
35
|
PrivateKernelExecutionProofOutput,
|
|
36
36
|
PrivateKernelTailCircuitPublicInputs,
|
|
37
37
|
} from '@aztec/stdlib/kernel';
|
|
38
|
-
import {
|
|
38
|
+
import type { NotesFilter } from '@aztec/stdlib/note';
|
|
39
|
+
import { NoteDao } from '@aztec/stdlib/note';
|
|
39
40
|
import {
|
|
40
41
|
type ContractOverrides,
|
|
41
42
|
PrivateExecutionResult,
|
|
@@ -672,16 +673,12 @@ export class PXE {
|
|
|
672
673
|
* @param filter - The filter to apply to the notes.
|
|
673
674
|
* @returns The requested notes.
|
|
674
675
|
*/
|
|
675
|
-
public async getNotes(filter: NotesFilter): Promise<
|
|
676
|
+
public async getNotes(filter: NotesFilter): Promise<NoteDao[]> {
|
|
676
677
|
// We need to manually trigger private state sync to have a guarantee that all the notes are available.
|
|
677
678
|
const call = await this.#getFunctionCall('sync_private_state', [], filter.contractAddress);
|
|
678
679
|
await this.simulateUtility(call);
|
|
679
680
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
return noteDaos.map(dao => {
|
|
683
|
-
return new UniqueNote(dao.note, dao.contractAddress, dao.storageSlot, dao.txHash, dao.noteNonce);
|
|
684
|
-
});
|
|
681
|
+
return this.noteDataProvider.getNotes(filter);
|
|
685
682
|
}
|
|
686
683
|
|
|
687
684
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { NoteDao } from '
|
|
1
|
+
export { NoteDao } from '@aztec/stdlib/note';
|
|
2
2
|
export { NoteDataProvider } from './note_data_provider.js';
|
|
@@ -5,8 +5,7 @@ import type { AztecAsyncKVStore, AztecAsyncMap, AztecAsyncMultiMap } from '@azte
|
|
|
5
5
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
6
6
|
import type { InBlock } from '@aztec/stdlib/block';
|
|
7
7
|
import { NoteStatus, type NotesFilter } from '@aztec/stdlib/note';
|
|
8
|
-
|
|
9
|
-
import { NoteDao } from './note_dao.js';
|
|
8
|
+
import { NoteDao } from '@aztec/stdlib/note';
|
|
10
9
|
|
|
11
10
|
/**
|
|
12
11
|
* NoteDataProvider manages the storage and retrieval of notes.
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { Fr } from '@aztec/foundation/fields';
|
|
2
|
-
import { BufferReader } from '@aztec/foundation/serialize';
|
|
3
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
4
|
-
import { Note } from '@aztec/stdlib/note';
|
|
5
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
6
|
-
import type { NoteData } from '../../contract_function_simulator/oracle/interfaces.js';
|
|
7
|
-
/**
|
|
8
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
9
|
-
* information required to use it during execution and manage its state.
|
|
10
|
-
*/
|
|
11
|
-
export declare class NoteDao implements NoteData {
|
|
12
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
13
|
-
note: Note;
|
|
14
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
15
|
-
contractAddress: AztecAddress;
|
|
16
|
-
/**
|
|
17
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
18
|
-
* since contracts typically make queries based on it.
|
|
19
|
-
*/
|
|
20
|
-
storageSlot: Fr;
|
|
21
|
-
/**
|
|
22
|
-
* The randomness injected to the note.
|
|
23
|
-
*/
|
|
24
|
-
randomness: Fr;
|
|
25
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
26
|
-
noteNonce: Fr;
|
|
27
|
-
/**
|
|
28
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
29
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
30
|
-
*/
|
|
31
|
-
noteHash: Fr;
|
|
32
|
-
/**
|
|
33
|
-
* The nullifier of the note, siloed by contract address.
|
|
34
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
35
|
-
*/
|
|
36
|
-
siloedNullifier: Fr;
|
|
37
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
38
|
-
* when searching for txEffects.
|
|
39
|
-
*/
|
|
40
|
-
txHash: TxHash;
|
|
41
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
42
|
-
* reorgs.*/
|
|
43
|
-
l2BlockNumber: number;
|
|
44
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
45
|
-
* reorgs.*/
|
|
46
|
-
l2BlockHash: string;
|
|
47
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
48
|
-
index: bigint;
|
|
49
|
-
constructor(
|
|
50
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
51
|
-
note: Note,
|
|
52
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
53
|
-
contractAddress: AztecAddress,
|
|
54
|
-
/**
|
|
55
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
56
|
-
* since contracts typically make queries based on it.
|
|
57
|
-
*/
|
|
58
|
-
storageSlot: Fr,
|
|
59
|
-
/**
|
|
60
|
-
* The randomness injected to the note.
|
|
61
|
-
*/
|
|
62
|
-
randomness: Fr,
|
|
63
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
64
|
-
noteNonce: Fr,
|
|
65
|
-
/**
|
|
66
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
67
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
68
|
-
*/
|
|
69
|
-
noteHash: Fr,
|
|
70
|
-
/**
|
|
71
|
-
* The nullifier of the note, siloed by contract address.
|
|
72
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
73
|
-
*/
|
|
74
|
-
siloedNullifier: Fr,
|
|
75
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
76
|
-
* when searching for txEffects.
|
|
77
|
-
*/
|
|
78
|
-
txHash: TxHash,
|
|
79
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
80
|
-
* reorgs.*/
|
|
81
|
-
l2BlockNumber: number,
|
|
82
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
83
|
-
* reorgs.*/
|
|
84
|
-
l2BlockHash: string,
|
|
85
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
86
|
-
index: bigint);
|
|
87
|
-
toBuffer(): Buffer;
|
|
88
|
-
static fromBuffer(buffer: Buffer | BufferReader): NoteDao;
|
|
89
|
-
toString(): string;
|
|
90
|
-
static fromString(str: string): NoteDao;
|
|
91
|
-
/**
|
|
92
|
-
* Returns the size in bytes of the Note Dao.
|
|
93
|
-
* @returns - Its size in bytes.
|
|
94
|
-
*/
|
|
95
|
-
getSize(): number;
|
|
96
|
-
static random({ note, contractAddress, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, }?: Partial<NoteDao>): Promise<NoteDao>;
|
|
97
|
-
}
|
|
98
|
-
//# sourceMappingURL=note_dao.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"note_dao.d.ts","sourceRoot":"","sources":["../../../src/storage/note_data_provider/note_dao.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAS,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wDAAwD,CAAC;AAEvF;;;GAGG;AACH,qBAAa,OAAQ,YAAW,QAAQ;IAIpC,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;OAGG;IACI,WAAW,EAAE,EAAE;IACtB;;OAEG;IACI,UAAU,EAAE,EAAE;IACrB,gGAAgG;IACzF,SAAS,EAAE,EAAE;IAGpB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB;;;OAGG;IACI,eAAe,EAAE,EAAE;IAG1B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;gBACY;IACL,aAAa,EAAE,MAAM;IAC5B;gBACY;IACL,WAAW,EAAE,MAAM;IAC1B,+EAA+E;IACxE,KAAK,EAAE,MAAM;;IAxCpB,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;OAGG;IACI,WAAW,EAAE,EAAE;IACtB;;OAEG;IACI,UAAU,EAAE,EAAE;IACrB,gGAAgG;IACzF,SAAS,EAAE,EAAE;IAGpB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB;;;OAGG;IACI,eAAe,EAAE,EAAE;IAG1B;;OAEG;IACI,MAAM,EAAE,MAAM;IACrB;gBACY;IACL,aAAa,EAAE,MAAM;IAC5B;gBACY;IACL,WAAW,EAAE,MAAM;IAC1B,+EAA+E;IACxE,KAAK,EAAE,MAAM;IAGtB,QAAQ,IAAI,MAAM;IAgBlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IA8B/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAK7B;;;OAGG;IACI,OAAO;WAMD,MAAM,CAAC,EAClB,IAAoB,EACpB,eAA2B,EAC3B,WAAyB,EACzB,UAAwB,EACxB,SAAuB,EACvB,QAAsB,EACtB,eAA6B,EAC7B,MAAwB,EACxB,aAAgD,EAChD,WAAoC,EACpC,KAA8B,GAC/B,GAAE,OAAO,CAAC,OAAO,CAAM;CAezB"}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import { Note } from '@aztec/stdlib/note';
|
|
6
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
7
|
-
/**
|
|
8
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
9
|
-
* information required to use it during execution and manage its state.
|
|
10
|
-
*/ export class NoteDao {
|
|
11
|
-
note;
|
|
12
|
-
contractAddress;
|
|
13
|
-
storageSlot;
|
|
14
|
-
randomness;
|
|
15
|
-
noteNonce;
|
|
16
|
-
noteHash;
|
|
17
|
-
siloedNullifier;
|
|
18
|
-
txHash;
|
|
19
|
-
l2BlockNumber;
|
|
20
|
-
l2BlockHash;
|
|
21
|
-
index;
|
|
22
|
-
constructor(// Note information
|
|
23
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */ note, /** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */ contractAddress, /**
|
|
24
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
25
|
-
* since contracts typically make queries based on it.
|
|
26
|
-
*/ storageSlot, /**
|
|
27
|
-
* The randomness injected to the note.
|
|
28
|
-
*/ randomness, /** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */ noteNonce, // Computed values
|
|
29
|
-
/**
|
|
30
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
31
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
32
|
-
*/ noteHash, /**
|
|
33
|
-
* The nullifier of the note, siloed by contract address.
|
|
34
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
35
|
-
*/ siloedNullifier, // Metadata
|
|
36
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
37
|
-
* when searching for txEffects.
|
|
38
|
-
*/ txHash, /** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
39
|
-
* reorgs.*/ l2BlockNumber, /** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
40
|
-
* reorgs.*/ l2BlockHash, /** The index of the leaf in the global note hash tree the note is stored at */ index){
|
|
41
|
-
this.note = note;
|
|
42
|
-
this.contractAddress = contractAddress;
|
|
43
|
-
this.storageSlot = storageSlot;
|
|
44
|
-
this.randomness = randomness;
|
|
45
|
-
this.noteNonce = noteNonce;
|
|
46
|
-
this.noteHash = noteHash;
|
|
47
|
-
this.siloedNullifier = siloedNullifier;
|
|
48
|
-
this.txHash = txHash;
|
|
49
|
-
this.l2BlockNumber = l2BlockNumber;
|
|
50
|
-
this.l2BlockHash = l2BlockHash;
|
|
51
|
-
this.index = index;
|
|
52
|
-
}
|
|
53
|
-
toBuffer() {
|
|
54
|
-
return serializeToBuffer([
|
|
55
|
-
this.note,
|
|
56
|
-
this.contractAddress,
|
|
57
|
-
this.storageSlot,
|
|
58
|
-
this.randomness,
|
|
59
|
-
this.noteNonce,
|
|
60
|
-
this.noteHash,
|
|
61
|
-
this.siloedNullifier,
|
|
62
|
-
this.txHash,
|
|
63
|
-
this.l2BlockNumber,
|
|
64
|
-
Fr.fromHexString(this.l2BlockHash),
|
|
65
|
-
this.index
|
|
66
|
-
]);
|
|
67
|
-
}
|
|
68
|
-
static fromBuffer(buffer) {
|
|
69
|
-
const reader = BufferReader.asReader(buffer);
|
|
70
|
-
const note = Note.fromBuffer(reader);
|
|
71
|
-
const contractAddress = AztecAddress.fromBuffer(reader);
|
|
72
|
-
const storageSlot = Fr.fromBuffer(reader);
|
|
73
|
-
const randomness = Fr.fromBuffer(reader);
|
|
74
|
-
const noteNonce = Fr.fromBuffer(reader);
|
|
75
|
-
const noteHash = Fr.fromBuffer(reader);
|
|
76
|
-
const siloedNullifier = Fr.fromBuffer(reader);
|
|
77
|
-
const txHash = reader.readObject(TxHash);
|
|
78
|
-
const l2BlockNumber = reader.readNumber();
|
|
79
|
-
const l2BlockHash = Fr.fromBuffer(reader).toString();
|
|
80
|
-
const index = toBigIntBE(reader.readBytes(32));
|
|
81
|
-
return new NoteDao(note, contractAddress, storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index);
|
|
82
|
-
}
|
|
83
|
-
toString() {
|
|
84
|
-
return '0x' + this.toBuffer().toString('hex');
|
|
85
|
-
}
|
|
86
|
-
static fromString(str) {
|
|
87
|
-
const hex = str.replace(/^0x/, '');
|
|
88
|
-
return NoteDao.fromBuffer(Buffer.from(hex, 'hex'));
|
|
89
|
-
}
|
|
90
|
-
/**
|
|
91
|
-
* Returns the size in bytes of the Note Dao.
|
|
92
|
-
* @returns - Its size in bytes.
|
|
93
|
-
*/ getSize() {
|
|
94
|
-
const indexSize = Math.ceil(Math.log2(Number(this.index)));
|
|
95
|
-
const noteSize = 4 + this.note.items.length * Fr.SIZE_IN_BYTES;
|
|
96
|
-
return noteSize + AztecAddress.SIZE_IN_BYTES + Fr.SIZE_IN_BYTES * 4 + TxHash.SIZE + Point.SIZE_IN_BYTES + indexSize;
|
|
97
|
-
}
|
|
98
|
-
static async random({ note = Note.random(), contractAddress = undefined, storageSlot = Fr.random(), randomness = Fr.random(), noteNonce = Fr.random(), noteHash = Fr.random(), siloedNullifier = Fr.random(), txHash = TxHash.random(), l2BlockNumber = Math.floor(Math.random() * 1000), l2BlockHash = Fr.random().toString(), index = Fr.random().toBigInt() } = {}) {
|
|
99
|
-
return new NoteDao(note, contractAddress ?? await AztecAddress.random(), storageSlot, randomness, noteNonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index);
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
2
|
-
import { Fr, Point } from '@aztec/foundation/fields';
|
|
3
|
-
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
4
|
-
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
|
-
import { Note } from '@aztec/stdlib/note';
|
|
6
|
-
import { TxHash } from '@aztec/stdlib/tx';
|
|
7
|
-
|
|
8
|
-
import type { NoteData } from '../../contract_function_simulator/oracle/interfaces.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
12
|
-
* information required to use it during execution and manage its state.
|
|
13
|
-
*/
|
|
14
|
-
export class NoteDao implements NoteData {
|
|
15
|
-
constructor(
|
|
16
|
-
// Note information
|
|
17
|
-
|
|
18
|
-
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
19
|
-
public note: Note,
|
|
20
|
-
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
21
|
-
public contractAddress: AztecAddress,
|
|
22
|
-
/**
|
|
23
|
-
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
24
|
-
* since contracts typically make queries based on it.
|
|
25
|
-
*/
|
|
26
|
-
public storageSlot: Fr,
|
|
27
|
-
/**
|
|
28
|
-
* The randomness injected to the note.
|
|
29
|
-
*/
|
|
30
|
-
public randomness: Fr,
|
|
31
|
-
/** The nonce that was injected into the note hash preimage in order to guarantee uniqueness. */
|
|
32
|
-
public noteNonce: Fr,
|
|
33
|
-
|
|
34
|
-
// Computed values
|
|
35
|
-
/**
|
|
36
|
-
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note is hashed. Can
|
|
37
|
-
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
38
|
-
*/
|
|
39
|
-
public noteHash: Fr,
|
|
40
|
-
/**
|
|
41
|
-
* The nullifier of the note, siloed by contract address.
|
|
42
|
-
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
43
|
-
*/
|
|
44
|
-
public siloedNullifier: Fr,
|
|
45
|
-
|
|
46
|
-
// Metadata
|
|
47
|
-
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
48
|
-
* when searching for txEffects.
|
|
49
|
-
*/
|
|
50
|
-
public txHash: TxHash,
|
|
51
|
-
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
52
|
-
* reorgs.*/
|
|
53
|
-
public l2BlockNumber: number,
|
|
54
|
-
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
55
|
-
* reorgs.*/
|
|
56
|
-
public l2BlockHash: string,
|
|
57
|
-
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
58
|
-
public index: bigint,
|
|
59
|
-
) {}
|
|
60
|
-
|
|
61
|
-
toBuffer(): Buffer {
|
|
62
|
-
return serializeToBuffer([
|
|
63
|
-
this.note,
|
|
64
|
-
this.contractAddress,
|
|
65
|
-
this.storageSlot,
|
|
66
|
-
this.randomness,
|
|
67
|
-
this.noteNonce,
|
|
68
|
-
this.noteHash,
|
|
69
|
-
this.siloedNullifier,
|
|
70
|
-
this.txHash,
|
|
71
|
-
this.l2BlockNumber,
|
|
72
|
-
Fr.fromHexString(this.l2BlockHash),
|
|
73
|
-
this.index,
|
|
74
|
-
]);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
static fromBuffer(buffer: Buffer | BufferReader) {
|
|
78
|
-
const reader = BufferReader.asReader(buffer);
|
|
79
|
-
|
|
80
|
-
const note = Note.fromBuffer(reader);
|
|
81
|
-
const contractAddress = AztecAddress.fromBuffer(reader);
|
|
82
|
-
const storageSlot = Fr.fromBuffer(reader);
|
|
83
|
-
const randomness = Fr.fromBuffer(reader);
|
|
84
|
-
const noteNonce = Fr.fromBuffer(reader);
|
|
85
|
-
const noteHash = Fr.fromBuffer(reader);
|
|
86
|
-
const siloedNullifier = Fr.fromBuffer(reader);
|
|
87
|
-
const txHash = reader.readObject(TxHash);
|
|
88
|
-
const l2BlockNumber = reader.readNumber();
|
|
89
|
-
const l2BlockHash = Fr.fromBuffer(reader).toString();
|
|
90
|
-
const index = toBigIntBE(reader.readBytes(32));
|
|
91
|
-
|
|
92
|
-
return new NoteDao(
|
|
93
|
-
note,
|
|
94
|
-
contractAddress,
|
|
95
|
-
storageSlot,
|
|
96
|
-
randomness,
|
|
97
|
-
noteNonce,
|
|
98
|
-
noteHash,
|
|
99
|
-
siloedNullifier,
|
|
100
|
-
txHash,
|
|
101
|
-
l2BlockNumber,
|
|
102
|
-
l2BlockHash,
|
|
103
|
-
index,
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
toString() {
|
|
108
|
-
return '0x' + this.toBuffer().toString('hex');
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
static fromString(str: string) {
|
|
112
|
-
const hex = str.replace(/^0x/, '');
|
|
113
|
-
return NoteDao.fromBuffer(Buffer.from(hex, 'hex'));
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Returns the size in bytes of the Note Dao.
|
|
118
|
-
* @returns - Its size in bytes.
|
|
119
|
-
*/
|
|
120
|
-
public getSize() {
|
|
121
|
-
const indexSize = Math.ceil(Math.log2(Number(this.index)));
|
|
122
|
-
const noteSize = 4 + this.note.items.length * Fr.SIZE_IN_BYTES;
|
|
123
|
-
return noteSize + AztecAddress.SIZE_IN_BYTES + Fr.SIZE_IN_BYTES * 4 + TxHash.SIZE + Point.SIZE_IN_BYTES + indexSize;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
static async random({
|
|
127
|
-
note = Note.random(),
|
|
128
|
-
contractAddress = undefined,
|
|
129
|
-
storageSlot = Fr.random(),
|
|
130
|
-
randomness = Fr.random(),
|
|
131
|
-
noteNonce = Fr.random(),
|
|
132
|
-
noteHash = Fr.random(),
|
|
133
|
-
siloedNullifier = Fr.random(),
|
|
134
|
-
txHash = TxHash.random(),
|
|
135
|
-
l2BlockNumber = Math.floor(Math.random() * 1000),
|
|
136
|
-
l2BlockHash = Fr.random().toString(),
|
|
137
|
-
index = Fr.random().toBigInt(),
|
|
138
|
-
}: Partial<NoteDao> = {}) {
|
|
139
|
-
return new NoteDao(
|
|
140
|
-
note,
|
|
141
|
-
contractAddress ?? (await AztecAddress.random()),
|
|
142
|
-
storageSlot,
|
|
143
|
-
randomness,
|
|
144
|
-
noteNonce,
|
|
145
|
-
noteHash,
|
|
146
|
-
siloedNullifier,
|
|
147
|
-
txHash,
|
|
148
|
-
l2BlockNumber,
|
|
149
|
-
l2BlockHash,
|
|
150
|
-
index,
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
}
|