@aztec/pxe 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2 → 0.75.0
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/bin/index.d.ts +3 -0
- package/dest/bin/index.d.ts.map +1 -0
- package/dest/bin/index.js +5 -3
- package/dest/config/index.d.ts +46 -0
- package/dest/config/index.d.ts.map +1 -0
- package/dest/config/index.js +21 -18
- package/dest/config/package_info.d.ts +5 -0
- package/dest/config/package_info.d.ts.map +1 -0
- package/dest/config/package_info.js +2 -4
- package/dest/contract_data_oracle/index.d.ts +104 -0
- package/dest/contract_data_oracle/index.d.ts.map +1 -0
- package/dest/contract_data_oracle/index.js +79 -69
- package/dest/contract_data_oracle/private_functions_tree.d.ts +65 -0
- package/dest/contract_data_oracle/private_functions_tree.d.ts.map +1 -0
- package/dest/contract_data_oracle/private_functions_tree.js +50 -44
- package/dest/database/contracts/contract_artifact_db.d.ts +20 -0
- package/dest/database/contracts/contract_artifact_db.d.ts.map +1 -0
- package/dest/database/contracts/contract_artifact_db.js +2 -3
- package/dest/database/contracts/contract_instance_db.d.ts +19 -0
- package/dest/database/contracts/contract_instance_db.d.ts.map +1 -0
- package/dest/database/contracts/contract_instance_db.js +2 -3
- package/dest/database/index.d.ts +3 -0
- package/dest/database/index.d.ts.map +1 -0
- package/dest/database/index.js +1 -0
- package/dest/database/kv_pxe_database.d.ts +55 -0
- package/dest/database/kv_pxe_database.d.ts.map +1 -0
- package/dest/database/kv_pxe_database.js +259 -243
- package/dest/database/note_dao.d.ts +103 -0
- package/dest/database/note_dao.d.ts.map +1 -0
- package/dest/database/note_dao.js +43 -28
- package/dest/database/outgoing_note_dao.d.ts +73 -0
- package/dest/database/outgoing_note_dao.d.ts.map +1 -0
- package/dest/database/outgoing_note_dao.js +34 -20
- package/dest/database/pxe_database.d.ts +216 -0
- package/dest/database/pxe_database.d.ts.map +1 -0
- package/dest/database/pxe_database.js +2 -4
- package/dest/database/pxe_database_test_suite.d.ts +7 -0
- package/dest/database/pxe_database_test_suite.d.ts.map +1 -0
- package/dest/database/pxe_database_test_suite.js +151 -296
- package/dest/index.d.ts +15 -0
- package/dest/index.d.ts.map +1 -0
- package/dest/index.js +1 -0
- package/dest/kernel_oracle/index.d.ts +34 -0
- package/dest/kernel_oracle/index.d.ts.map +1 -0
- package/dest/kernel_oracle/index.js +6 -9
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts +28 -0
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.d.ts.map +1 -0
- package/dest/kernel_prover/hints/build_private_kernel_reset_private_inputs.js +66 -68
- package/dest/kernel_prover/hints/index.d.ts +2 -0
- package/dest/kernel_prover/hints/index.d.ts.map +1 -0
- package/dest/kernel_prover/hints/index.js +1 -0
- package/dest/kernel_prover/index.d.ts +3 -0
- package/dest/kernel_prover/index.d.ts.map +1 -0
- package/dest/kernel_prover/index.js +1 -0
- package/dest/kernel_prover/kernel_prover.d.ts +38 -0
- package/dest/kernel_prover/kernel_prover.d.ts.map +1 -0
- package/dest/kernel_prover/kernel_prover.js +65 -60
- package/dest/kernel_prover/proving_data_oracle.d.ts +65 -0
- package/dest/kernel_prover/proving_data_oracle.d.ts.map +1 -0
- package/dest/kernel_prover/proving_data_oracle.js +2 -4
- package/dest/note_decryption_utils/add_public_values_to_payload.d.ts +10 -0
- package/dest/note_decryption_utils/add_public_values_to_payload.d.ts.map +1 -0
- package/dest/note_decryption_utils/add_public_values_to_payload.js +9 -8
- package/dest/pxe_http/index.d.ts +2 -0
- package/dest/pxe_http/index.d.ts.map +1 -0
- package/dest/pxe_http/index.js +1 -0
- package/dest/pxe_http/pxe_http_server.d.ts +16 -0
- package/dest/pxe_http/pxe_http_server.d.ts.map +1 -0
- package/dest/pxe_http/pxe_http_server.js +6 -8
- package/dest/pxe_service/error_enriching.d.ts +11 -0
- package/dest/pxe_service/error_enriching.d.ts.map +1 -0
- package/dest/pxe_service/error_enriching.js +13 -10
- package/dest/pxe_service/index.d.ts +4 -0
- package/dest/pxe_service/index.d.ts.map +1 -0
- package/dest/pxe_service/index.js +1 -0
- package/dest/pxe_service/pxe_service.d.ts +98 -0
- package/dest/pxe_service/pxe_service.d.ts.map +1 -0
- package/dest/pxe_service/pxe_service.js +290 -282
- package/dest/pxe_service/test/pxe_test_suite.d.ts +3 -0
- package/dest/pxe_service/test/pxe_test_suite.d.ts.map +1 -0
- package/dest/pxe_service/test/pxe_test_suite.js +27 -40
- package/dest/simulator/index.d.ts +10 -0
- package/dest/simulator/index.d.ts.map +1 -0
- package/dest/simulator/index.js +3 -1
- package/dest/simulator_oracle/index.d.ts +129 -0
- package/dest/simulator_oracle/index.d.ts.map +1 -0
- package/dest/simulator_oracle/index.js +231 -266
- package/dest/simulator_oracle/tagging_utils.d.ts +16 -0
- package/dest/simulator_oracle/tagging_utils.d.ts.map +1 -0
- package/dest/simulator_oracle/tagging_utils.js +6 -4
- package/dest/synchronizer/index.d.ts +2 -0
- package/dest/synchronizer/index.d.ts.map +1 -0
- package/dest/synchronizer/index.js +1 -0
- package/dest/synchronizer/synchronizer.d.ts +30 -0
- package/dest/synchronizer/synchronizer.d.ts.map +1 -0
- package/dest/synchronizer/synchronizer.js +42 -42
- package/dest/utils/create_pxe_service.d.ts +16 -0
- package/dest/utils/create_pxe_service.d.ts.map +1 -0
- package/dest/utils/create_pxe_service.js +9 -9
- package/package.json +15 -15
- package/src/pxe_service/pxe_service.ts +10 -5
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
+
import { Note, TxHash } from '@aztec/circuit-types';
|
|
4
|
+
import { AztecAddress, Fr, type PublicKey } from '@aztec/circuits.js';
|
|
5
|
+
import { NoteSelector } from '@aztec/foundation/abi';
|
|
6
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
7
|
+
import { type NoteData } from '@aztec/simulator/client';
|
|
8
|
+
/**
|
|
9
|
+
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
10
|
+
* information required to use it during execution and manage its state.
|
|
11
|
+
*/
|
|
12
|
+
export declare class NoteDao implements NoteData {
|
|
13
|
+
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
14
|
+
note: Note;
|
|
15
|
+
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
16
|
+
contractAddress: AztecAddress;
|
|
17
|
+
/**
|
|
18
|
+
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
19
|
+
* since contracts typically make queries based on it.
|
|
20
|
+
* */
|
|
21
|
+
storageSlot: Fr;
|
|
22
|
+
/** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */
|
|
23
|
+
nonce: Fr;
|
|
24
|
+
/**
|
|
25
|
+
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note content is hashed. Can
|
|
26
|
+
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
27
|
+
*/
|
|
28
|
+
noteHash: Fr;
|
|
29
|
+
/**
|
|
30
|
+
* The nullifier of the note, siloed by contract address.
|
|
31
|
+
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
32
|
+
*/
|
|
33
|
+
siloedNullifier: Fr;
|
|
34
|
+
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
35
|
+
* when searching for txEffects.
|
|
36
|
+
*/
|
|
37
|
+
txHash: TxHash;
|
|
38
|
+
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
39
|
+
* reorgs.*/
|
|
40
|
+
l2BlockNumber: number;
|
|
41
|
+
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
42
|
+
* reorgs.*/
|
|
43
|
+
l2BlockHash: string;
|
|
44
|
+
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
45
|
+
index: bigint;
|
|
46
|
+
/** The public key with which the note content was encrypted during delivery. */
|
|
47
|
+
addressPoint: PublicKey;
|
|
48
|
+
/** The note type identifier for the contract.
|
|
49
|
+
* TODO: remove
|
|
50
|
+
*/
|
|
51
|
+
noteTypeId: NoteSelector;
|
|
52
|
+
constructor(
|
|
53
|
+
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
54
|
+
note: Note,
|
|
55
|
+
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
56
|
+
contractAddress: AztecAddress,
|
|
57
|
+
/**
|
|
58
|
+
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
59
|
+
* since contracts typically make queries based on it.
|
|
60
|
+
* */
|
|
61
|
+
storageSlot: Fr,
|
|
62
|
+
/** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */
|
|
63
|
+
nonce: Fr,
|
|
64
|
+
/**
|
|
65
|
+
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note content is hashed. Can
|
|
66
|
+
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
67
|
+
*/
|
|
68
|
+
noteHash: Fr,
|
|
69
|
+
/**
|
|
70
|
+
* The nullifier of the note, siloed by contract address.
|
|
71
|
+
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
72
|
+
*/
|
|
73
|
+
siloedNullifier: Fr,
|
|
74
|
+
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
75
|
+
* when searching for txEffects.
|
|
76
|
+
*/
|
|
77
|
+
txHash: TxHash,
|
|
78
|
+
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
79
|
+
* reorgs.*/
|
|
80
|
+
l2BlockNumber: number,
|
|
81
|
+
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
82
|
+
* reorgs.*/
|
|
83
|
+
l2BlockHash: string,
|
|
84
|
+
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
85
|
+
index: bigint,
|
|
86
|
+
/** The public key with which the note content was encrypted during delivery. */
|
|
87
|
+
addressPoint: PublicKey,
|
|
88
|
+
/** The note type identifier for the contract.
|
|
89
|
+
* TODO: remove
|
|
90
|
+
*/
|
|
91
|
+
noteTypeId: NoteSelector);
|
|
92
|
+
toBuffer(): Buffer;
|
|
93
|
+
static fromBuffer(buffer: Buffer | BufferReader): NoteDao;
|
|
94
|
+
toString(): string;
|
|
95
|
+
static fromString(str: string): NoteDao;
|
|
96
|
+
/**
|
|
97
|
+
* Returns the size in bytes of the Note Dao.
|
|
98
|
+
* @returns - Its size in bytes.
|
|
99
|
+
*/
|
|
100
|
+
getSize(): number;
|
|
101
|
+
static random({ note, contractAddress, storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, addressPoint, noteTypeId, }?: Partial<NoteDao>): Promise<NoteDao>;
|
|
102
|
+
}
|
|
103
|
+
//# sourceMappingURL=note_dao.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"note_dao.d.ts","sourceRoot":"","sources":["../../src/database/note_dao.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAS,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAC9E,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAExD;;;GAGG;AACH,qBAAa,OAAQ,YAAW,QAAQ;IAIpC,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;SAGK;IACE,WAAW,EAAE,EAAE;IACtB,qFAAqF;IAC9E,KAAK,EAAE,EAAE;IAGhB;;;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;IACpB,gFAAgF;IACzE,YAAY,EAAE,SAAS;IAE9B;;OAEG;IACI,UAAU,EAAE,YAAY;;IA3C/B,kFAAkF;IAC3E,IAAI,EAAE,IAAI;IACjB,8GAA8G;IACvG,eAAe,EAAE,YAAY;IACpC;;;SAGK;IACE,WAAW,EAAE,EAAE;IACtB,qFAAqF;IAC9E,KAAK,EAAE,EAAE;IAGhB;;;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;IACpB,gFAAgF;IACzE,YAAY,EAAE,SAAS;IAE9B;;OAEG;IACI,UAAU,EAAE,YAAY;IAGjC,QAAQ,IAAI,MAAM;IAiBlB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IAgC/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAK7B;;;OAGG;IACI,OAAO;WAMD,MAAM,CAAC,EAClB,IAAoB,EACpB,eAA2B,EAC3B,WAAyB,EACzB,KAAmB,EACnB,QAAsB,EACtB,eAA6B,EAC7B,MAAuB,EACvB,aAAgD,EAChD,WAAoC,EACpC,KAA8B,EAC9B,YAAwB,EACxB,UAAkC,GACnC,GAAE,OAAO,CAAC,OAAO,CAAM;CAgBzB"}
|
|
@@ -6,38 +6,51 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
6
6
|
/**
|
|
7
7
|
* A Note Data Access Object, representing a note that was committed to the note hash tree, holding all of the
|
|
8
8
|
* information required to use it during execution and manage its state.
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
l2BlockHash;
|
|
19
|
-
index;
|
|
20
|
-
addressPoint;
|
|
21
|
-
noteTypeId;
|
|
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, /**
|
|
9
|
+
*/
|
|
10
|
+
export class NoteDao {
|
|
11
|
+
constructor(
|
|
12
|
+
// Note information
|
|
13
|
+
/** The packed content of the note, as will be returned in the getNotes oracle. */
|
|
14
|
+
note,
|
|
15
|
+
/** The address of the contract that created the note (i.e. the address used by the kernel during siloing). */
|
|
16
|
+
contractAddress,
|
|
17
|
+
/**
|
|
24
18
|
* The storage location of the note. This value is not used for anything in PXE, but we do index by storage slot
|
|
25
19
|
* since contracts typically make queries based on it.
|
|
26
|
-
* */
|
|
20
|
+
* */
|
|
21
|
+
storageSlot,
|
|
22
|
+
/** The kernel-provided nonce of the note, required to compute the uniqueNoteHash. */
|
|
23
|
+
nonce,
|
|
24
|
+
// Computed values
|
|
27
25
|
/**
|
|
28
26
|
* The inner hash (non-unique, non-siloed) of the note. Each contract determines how the note content is hashed. Can
|
|
29
27
|
* be used alongside contractAddress and nonce to compute the uniqueNoteHash and the siloedNoteHash.
|
|
30
|
-
*/
|
|
28
|
+
*/
|
|
29
|
+
noteHash,
|
|
30
|
+
/**
|
|
31
31
|
* The nullifier of the note, siloed by contract address.
|
|
32
32
|
* Note: Might be set as 0 if the note was added to PXE as nullified.
|
|
33
|
-
*/
|
|
33
|
+
*/
|
|
34
|
+
siloedNullifier,
|
|
35
|
+
// Metadata
|
|
34
36
|
/** The hash of the tx in which this note was created. Knowing the tx hash allows for efficient node queries e.g.
|
|
35
37
|
* when searching for txEffects.
|
|
36
|
-
*/
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
*/
|
|
39
|
+
txHash,
|
|
40
|
+
/** The L2 block number in which the tx with this note was included. Used for note management while processing
|
|
41
|
+
* reorgs.*/
|
|
42
|
+
l2BlockNumber,
|
|
43
|
+
/** The L2 block hash in which the tx with this note was included. Used for note management while processing
|
|
44
|
+
* reorgs.*/
|
|
45
|
+
l2BlockHash,
|
|
46
|
+
/** The index of the leaf in the global note hash tree the note is stored at */
|
|
47
|
+
index,
|
|
48
|
+
/** The public key with which the note content was encrypted during delivery. */
|
|
49
|
+
addressPoint,
|
|
50
|
+
/** The note type identifier for the contract.
|
|
39
51
|
* TODO: remove
|
|
40
|
-
*/
|
|
52
|
+
*/
|
|
53
|
+
noteTypeId) {
|
|
41
54
|
this.note = note;
|
|
42
55
|
this.contractAddress = contractAddress;
|
|
43
56
|
this.storageSlot = storageSlot;
|
|
@@ -64,7 +77,7 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
64
77
|
Fr.fromHexString(this.l2BlockHash),
|
|
65
78
|
this.index,
|
|
66
79
|
this.addressPoint,
|
|
67
|
-
this.noteTypeId
|
|
80
|
+
this.noteTypeId,
|
|
68
81
|
]);
|
|
69
82
|
}
|
|
70
83
|
static fromBuffer(buffer) {
|
|
@@ -91,14 +104,16 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
91
104
|
return NoteDao.fromBuffer(Buffer.from(hex, 'hex'));
|
|
92
105
|
}
|
|
93
106
|
/**
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
107
|
+
* Returns the size in bytes of the Note Dao.
|
|
108
|
+
* @returns - Its size in bytes.
|
|
109
|
+
*/
|
|
110
|
+
getSize() {
|
|
97
111
|
const indexSize = Math.ceil(Math.log2(Number(this.index)));
|
|
98
112
|
const noteSize = 4 + this.note.items.length * Fr.SIZE_IN_BYTES;
|
|
99
113
|
return noteSize + AztecAddress.SIZE_IN_BYTES + Fr.SIZE_IN_BYTES * 4 + TxHash.SIZE + Point.SIZE_IN_BYTES + indexSize;
|
|
100
114
|
}
|
|
101
|
-
static async random({ note = Note.random(), contractAddress = undefined, storageSlot = Fr.random(), nonce = Fr.random(), noteHash = Fr.random(), siloedNullifier = Fr.random(), txHash = randomTxHash(), l2BlockNumber = Math.floor(Math.random() * 1000), l2BlockHash = Fr.random().toString(), index = Fr.random().toBigInt(), addressPoint = undefined, noteTypeId = NoteSelector.random() } = {}) {
|
|
102
|
-
return new NoteDao(note, contractAddress ?? await AztecAddress.random(), storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, addressPoint ?? await Point.random(), noteTypeId);
|
|
115
|
+
static async random({ note = Note.random(), contractAddress = undefined, storageSlot = Fr.random(), nonce = Fr.random(), noteHash = Fr.random(), siloedNullifier = Fr.random(), txHash = randomTxHash(), l2BlockNumber = Math.floor(Math.random() * 1000), l2BlockHash = Fr.random().toString(), index = Fr.random().toBigInt(), addressPoint = undefined, noteTypeId = NoteSelector.random(), } = {}) {
|
|
116
|
+
return new NoteDao(note, contractAddress ?? (await AztecAddress.random()), storageSlot, nonce, noteHash, siloedNullifier, txHash, l2BlockNumber, l2BlockHash, index, addressPoint ?? (await Point.random()), noteTypeId);
|
|
103
117
|
}
|
|
104
118
|
}
|
|
119
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm90ZV9kYW8uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZGF0YWJhc2Uvbm90ZV9kYW8udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDbEUsT0FBTyxFQUFFLFlBQVksRUFBRSxFQUFFLEVBQUUsS0FBSyxFQUFrQixNQUFNLG9CQUFvQixD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FLLEdBQUcsRUFBRSxDQUFDLE1BQU0sRUFBRSxDQUFDLFFBQVEsRUFBRSxFQUM5QixZQUFZLEdBQUcsU0FBUyxFQUN4QixVQUFVLEdBQUcsWUFBWSxDQUFDLE1BQU0sRUFBRSxNQUNkLEVBQUU7UUFDdEIsT0FBTyxJQUFJLE9BQU8sQ0FDaEIsSUFBSSxFQUNKLGVBQWUsSUFBSSxDQUFDLE1BQU0sWUFBWSxDQUFDLE1BQU0sRUFBRSxDQUFDLEVBQ2hELFdBQVcsRUFDWCxLQUFLLEVBQ0wsUUFBUSxFQUNSLGVBQWUsRUFDZixNQUFNLEVBQ04sYUFBYSxFQUNiLFdBQVcsRUFDWCxLQUFLLEVBQ0wsWUFBWSxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsRUFDdEMsVUFBVSxDQUNYLENBQUM7SUFDSixDQUFDO0NBQ0YifQ==
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
+
/// <reference types="node" resolution-mode="require"/>
|
|
3
|
+
import { Note, TxHash } from '@aztec/circuit-types';
|
|
4
|
+
import { AztecAddress, Fr, type PublicKey } from '@aztec/circuits.js';
|
|
5
|
+
import { NoteSelector } from '@aztec/foundation/abi';
|
|
6
|
+
import { BufferReader } from '@aztec/foundation/serialize';
|
|
7
|
+
/**
|
|
8
|
+
* A note with contextual data which was decrypted as outgoing.
|
|
9
|
+
*/
|
|
10
|
+
export declare class OutgoingNoteDao {
|
|
11
|
+
/** The note as emitted from the Noir contract. */
|
|
12
|
+
note: Note;
|
|
13
|
+
/** The contract address this note is created in. */
|
|
14
|
+
contractAddress: AztecAddress;
|
|
15
|
+
/** The specific storage location of the note on the contract. */
|
|
16
|
+
storageSlot: Fr;
|
|
17
|
+
/** The note type identifier for the contract. */
|
|
18
|
+
noteTypeId: NoteSelector;
|
|
19
|
+
/** The hash of the tx the note was created in. */
|
|
20
|
+
txHash: TxHash;
|
|
21
|
+
/** The L2 block number in which the tx with this note was included. */
|
|
22
|
+
l2BlockNumber: number;
|
|
23
|
+
/** The L2 block hash in which the tx with this note was included. */
|
|
24
|
+
l2BlockHash: string;
|
|
25
|
+
/** The nonce of the note. */
|
|
26
|
+
nonce: Fr;
|
|
27
|
+
/**
|
|
28
|
+
* A hash of the note. This is customizable by the app circuit.
|
|
29
|
+
* We can use this value to compute unique note hash and then siloed note hash.
|
|
30
|
+
*/
|
|
31
|
+
noteHash: Fr;
|
|
32
|
+
/** The location of the relevant note in the note hash tree. */
|
|
33
|
+
index: bigint;
|
|
34
|
+
/** The public key with which the note was encrypted. */
|
|
35
|
+
ovpkM: PublicKey;
|
|
36
|
+
constructor(
|
|
37
|
+
/** The note as emitted from the Noir contract. */
|
|
38
|
+
note: Note,
|
|
39
|
+
/** The contract address this note is created in. */
|
|
40
|
+
contractAddress: AztecAddress,
|
|
41
|
+
/** The specific storage location of the note on the contract. */
|
|
42
|
+
storageSlot: Fr,
|
|
43
|
+
/** The note type identifier for the contract. */
|
|
44
|
+
noteTypeId: NoteSelector,
|
|
45
|
+
/** The hash of the tx the note was created in. */
|
|
46
|
+
txHash: TxHash,
|
|
47
|
+
/** The L2 block number in which the tx with this note was included. */
|
|
48
|
+
l2BlockNumber: number,
|
|
49
|
+
/** The L2 block hash in which the tx with this note was included. */
|
|
50
|
+
l2BlockHash: string,
|
|
51
|
+
/** The nonce of the note. */
|
|
52
|
+
nonce: Fr,
|
|
53
|
+
/**
|
|
54
|
+
* A hash of the note. This is customizable by the app circuit.
|
|
55
|
+
* We can use this value to compute unique note hash and then siloed note hash.
|
|
56
|
+
*/
|
|
57
|
+
noteHash: Fr,
|
|
58
|
+
/** The location of the relevant note in the note hash tree. */
|
|
59
|
+
index: bigint,
|
|
60
|
+
/** The public key with which the note was encrypted. */
|
|
61
|
+
ovpkM: PublicKey);
|
|
62
|
+
toBuffer(): Buffer;
|
|
63
|
+
static fromBuffer(buffer: Buffer | BufferReader): OutgoingNoteDao;
|
|
64
|
+
toString(): string;
|
|
65
|
+
static fromString(str: string): OutgoingNoteDao;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the size in bytes of the Note Dao.
|
|
68
|
+
* @returns - Its size in bytes.
|
|
69
|
+
*/
|
|
70
|
+
getSize(): number;
|
|
71
|
+
static random({ note, contractAddress, txHash, storageSlot, noteTypeId, nonce, l2BlockNumber, l2BlockHash, noteHash, index, ovpkM, }?: Partial<OutgoingNoteDao>): Promise<OutgoingNoteDao>;
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=outgoing_note_dao.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outgoing_note_dao.d.ts","sourceRoot":"","sources":["../../src/database/outgoing_note_dao.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAgB,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,EAAE,EAAS,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,EAAE,YAAY,EAAqB,MAAM,6BAA6B,CAAC;AAE9E;;GAEG;AACH,qBAAa,eAAe;IAExB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEAAiE;IAC1D,WAAW,EAAE,EAAE;IACtB,iDAAiD;IAC1C,UAAU,EAAE,YAAY;IAC/B,kDAAkD;IAC3C,MAAM,EAAE,MAAM;IACrB,uEAAuE;IAChE,aAAa,EAAE,MAAM;IAC5B,qEAAqE;IAC9D,WAAW,EAAE,MAAM;IAC1B,6BAA6B;IACtB,KAAK,EAAE,EAAE;IAChB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB,+DAA+D;IACxD,KAAK,EAAE,MAAM;IACpB,wDAAwD;IACjD,KAAK,EAAE,SAAS;;IAxBvB,kDAAkD;IAC3C,IAAI,EAAE,IAAI;IACjB,oDAAoD;IAC7C,eAAe,EAAE,YAAY;IACpC,iEAAiE;IAC1D,WAAW,EAAE,EAAE;IACtB,iDAAiD;IAC1C,UAAU,EAAE,YAAY;IAC/B,kDAAkD;IAC3C,MAAM,EAAE,MAAM;IACrB,uEAAuE;IAChE,aAAa,EAAE,MAAM;IAC5B,qEAAqE;IAC9D,WAAW,EAAE,MAAM;IAC1B,6BAA6B;IACtB,KAAK,EAAE,EAAE;IAChB;;;OAGG;IACI,QAAQ,EAAE,EAAE;IACnB,+DAA+D;IACxD,KAAK,EAAE,MAAM;IACpB,wDAAwD;IACjD,KAAK,EAAE,SAAS;IAGzB,QAAQ,IAAI,MAAM;IAelB,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,YAAY;IA8B/C,QAAQ;IAIR,MAAM,CAAC,UAAU,CAAC,GAAG,EAAE,MAAM;IAK7B;;;OAGG;IACI,OAAO;WAKD,MAAM,CAAC,EAClB,IAAoB,EACpB,eAA2B,EAC3B,MAAuB,EACvB,WAAyB,EACzB,UAAkC,EAClC,KAAmB,EACnB,aAAgD,EAChD,WAAoC,EACpC,QAAsB,EACtB,KAA8B,EAC9B,KAAiB,GAClB,GAAE,OAAO,CAAC,eAAe,CAAM;CAejC"}
|
|
@@ -5,22 +5,34 @@ import { toBigIntBE } from '@aztec/foundation/bigint-buffer';
|
|
|
5
5
|
import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
6
6
|
/**
|
|
7
7
|
* A note with contextual data which was decrypted as outgoing.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
*/
|
|
9
|
+
export class OutgoingNoteDao {
|
|
10
|
+
constructor(
|
|
11
|
+
/** The note as emitted from the Noir contract. */
|
|
12
|
+
note,
|
|
13
|
+
/** The contract address this note is created in. */
|
|
14
|
+
contractAddress,
|
|
15
|
+
/** The specific storage location of the note on the contract. */
|
|
16
|
+
storageSlot,
|
|
17
|
+
/** The note type identifier for the contract. */
|
|
18
|
+
noteTypeId,
|
|
19
|
+
/** The hash of the tx the note was created in. */
|
|
20
|
+
txHash,
|
|
21
|
+
/** The L2 block number in which the tx with this note was included. */
|
|
22
|
+
l2BlockNumber,
|
|
23
|
+
/** The L2 block hash in which the tx with this note was included. */
|
|
24
|
+
l2BlockHash,
|
|
25
|
+
/** The nonce of the note. */
|
|
26
|
+
nonce,
|
|
27
|
+
/**
|
|
21
28
|
* A hash of the note. This is customizable by the app circuit.
|
|
22
29
|
* We can use this value to compute unique note hash and then siloed note hash.
|
|
23
|
-
*/
|
|
30
|
+
*/
|
|
31
|
+
noteHash,
|
|
32
|
+
/** The location of the relevant note in the note hash tree. */
|
|
33
|
+
index,
|
|
34
|
+
/** The public key with which the note was encrypted. */
|
|
35
|
+
ovpkM) {
|
|
24
36
|
this.note = note;
|
|
25
37
|
this.contractAddress = contractAddress;
|
|
26
38
|
this.storageSlot = storageSlot;
|
|
@@ -45,7 +57,7 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
45
57
|
this.nonce,
|
|
46
58
|
this.noteHash,
|
|
47
59
|
this.index,
|
|
48
|
-
this.ovpkM
|
|
60
|
+
this.ovpkM,
|
|
49
61
|
]);
|
|
50
62
|
}
|
|
51
63
|
static fromBuffer(buffer) {
|
|
@@ -71,13 +83,15 @@ import { BufferReader, serializeToBuffer } from '@aztec/foundation/serialize';
|
|
|
71
83
|
return OutgoingNoteDao.fromBuffer(Buffer.from(hex, 'hex'));
|
|
72
84
|
}
|
|
73
85
|
/**
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
86
|
+
* Returns the size in bytes of the Note Dao.
|
|
87
|
+
* @returns - Its size in bytes.
|
|
88
|
+
*/
|
|
89
|
+
getSize() {
|
|
77
90
|
const noteSize = 4 + this.note.items.length * Fr.SIZE_IN_BYTES;
|
|
78
91
|
return noteSize + AztecAddress.SIZE_IN_BYTES + Fr.SIZE_IN_BYTES * 2 + TxHash.SIZE + Point.SIZE_IN_BYTES;
|
|
79
92
|
}
|
|
80
|
-
static async random({ note = Note.random(), contractAddress = undefined, txHash = randomTxHash(), storageSlot = Fr.random(), noteTypeId = NoteSelector.random(), nonce = Fr.random(), l2BlockNumber = Math.floor(Math.random() * 1000), l2BlockHash = Fr.random().toString(), noteHash = Fr.random(), index = Fr.random().toBigInt(), ovpkM = undefined } = {}) {
|
|
81
|
-
return new OutgoingNoteDao(note, contractAddress ?? await AztecAddress.random(), storageSlot, noteTypeId, txHash, l2BlockNumber, l2BlockHash, nonce, noteHash, index, ovpkM ?? await Point.random());
|
|
93
|
+
static async random({ note = Note.random(), contractAddress = undefined, txHash = randomTxHash(), storageSlot = Fr.random(), noteTypeId = NoteSelector.random(), nonce = Fr.random(), l2BlockNumber = Math.floor(Math.random() * 1000), l2BlockHash = Fr.random().toString(), noteHash = Fr.random(), index = Fr.random().toBigInt(), ovpkM = undefined, } = {}) {
|
|
94
|
+
return new OutgoingNoteDao(note, contractAddress ?? (await AztecAddress.random()), storageSlot, noteTypeId, txHash, l2BlockNumber, l2BlockHash, nonce, noteHash, index, ovpkM ?? (await Point.random()));
|
|
82
95
|
}
|
|
83
96
|
}
|
|
97
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3V0Z29pbmdfbm90ZV9kYW8uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZGF0YWJhc2Uvb3V0Z29pbmdfbm90ZV9kYW8udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLElBQUksRUFBRSxNQUFNLEVBQUUsWUFBWSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFDbEUsT0FBTyxF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LEVBQ0wsS0FBSyxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsTUFBTSxFQUFFLENBQUMsQ0FDaEMsQ0FBQztJQUNKLENBQUM7Q0FDRiJ9
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
import { type InBlock, type NotesFilter } from '@aztec/circuit-types';
|
|
2
|
+
import { type BlockHeader, type CompleteAddress, type ContractInstanceWithAddress, type IndexedTaggingSecret, type PublicKey } from '@aztec/circuits.js';
|
|
3
|
+
import { type ContractArtifact } from '@aztec/foundation/abi';
|
|
4
|
+
import { type AztecAddress } from '@aztec/foundation/aztec-address';
|
|
5
|
+
import { type Fr } from '@aztec/foundation/fields';
|
|
6
|
+
import { type ContractArtifactDatabase } from './contracts/contract_artifact_db.js';
|
|
7
|
+
import { type ContractInstanceDatabase } from './contracts/contract_instance_db.js';
|
|
8
|
+
import { type NoteDao } from './note_dao.js';
|
|
9
|
+
/**
|
|
10
|
+
* A database interface that provides methods for retrieving, adding, and removing transactional data related to Aztec
|
|
11
|
+
* addresses, storage slots, and nullifiers.
|
|
12
|
+
*/
|
|
13
|
+
export interface PxeDatabase extends ContractArtifactDatabase, ContractInstanceDatabase {
|
|
14
|
+
getContract(address: AztecAddress): Promise<(ContractInstanceWithAddress & ContractArtifact) | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Add a auth witness to the database.
|
|
17
|
+
* @param messageHash - The message hash.
|
|
18
|
+
* @param witness - An array of field elements representing the auth witness.
|
|
19
|
+
*/
|
|
20
|
+
addAuthWitness(messageHash: Fr, witness: Fr[]): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Fetching the auth witness for a given message hash.
|
|
23
|
+
* @param messageHash - The message hash.
|
|
24
|
+
* @returns A Promise that resolves to an array of field elements representing the auth witness.
|
|
25
|
+
*/
|
|
26
|
+
getAuthWitness(messageHash: Fr): Promise<Fr[] | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Adding a capsule to the capsule dispenser.
|
|
29
|
+
* @remarks A capsule is a "blob" of data that is passed to the contract through an oracle.
|
|
30
|
+
* @param capsule - An array of field elements representing the capsule.
|
|
31
|
+
*/
|
|
32
|
+
addCapsule(capsule: Fr[]): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Get the next capsule from the capsule dispenser.
|
|
35
|
+
* @remarks A capsule is a "blob" of data that is passed to the contract through an oracle.
|
|
36
|
+
* @returns A promise that resolves to an array of field elements representing the capsule.
|
|
37
|
+
*/
|
|
38
|
+
popCapsule(): Promise<Fr[] | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Gets notes based on the provided filter.
|
|
41
|
+
* @param filter - The filter to apply to the notes.
|
|
42
|
+
* @returns The requested notes.
|
|
43
|
+
*/
|
|
44
|
+
getNotes(filter: NotesFilter): Promise<NoteDao[]>;
|
|
45
|
+
/**
|
|
46
|
+
* Adds a note to DB.
|
|
47
|
+
* @param note - The note to add.
|
|
48
|
+
* @param scope - The scope to add the note under. Currently optional.
|
|
49
|
+
* @remark - Will create a database for the scope if it does not already exist.
|
|
50
|
+
*/
|
|
51
|
+
addNote(note: NoteDao, scope?: AztecAddress): Promise<void>;
|
|
52
|
+
/**
|
|
53
|
+
* Adds a nullified note to DB.
|
|
54
|
+
* @param note - The note to add.
|
|
55
|
+
*/
|
|
56
|
+
addNullifiedNote(note: NoteDao): Promise<void>;
|
|
57
|
+
/**
|
|
58
|
+
* Adds an array of notes to DB.
|
|
59
|
+
* This function is used to insert multiple notes to the database at once,
|
|
60
|
+
* which can improve performance when dealing with large numbers of transactions.
|
|
61
|
+
*
|
|
62
|
+
* @param notes - An array of notes.
|
|
63
|
+
* @param scope - The scope to add the notes under. Currently optional.
|
|
64
|
+
* @remark - Will create a database for the scope if it does not already exist.
|
|
65
|
+
*/
|
|
66
|
+
addNotes(notes: NoteDao[], scope?: AztecAddress): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Remove nullified notes associated with the given account and nullifiers.
|
|
69
|
+
*
|
|
70
|
+
* @param nullifiers - An array of Fr instances representing nullifiers to be matched.
|
|
71
|
+
* @param account - A PublicKey instance representing the account for which the records are being removed.
|
|
72
|
+
* @returns Removed notes.
|
|
73
|
+
*/
|
|
74
|
+
removeNullifiedNotes(nullifiers: InBlock<Fr>[], account: PublicKey): Promise<NoteDao[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Gets the most recently processed block number.
|
|
77
|
+
* @returns The most recently processed block number or undefined if never synched.
|
|
78
|
+
*/
|
|
79
|
+
getBlockNumber(): Promise<number | undefined>;
|
|
80
|
+
/**
|
|
81
|
+
* Retrieve the stored Block Header from the database.
|
|
82
|
+
* The function returns a Promise that resolves to the Block Header.
|
|
83
|
+
* This data is required to reproduce block attestations.
|
|
84
|
+
* Throws an error if the block header is not available within the database.
|
|
85
|
+
*
|
|
86
|
+
* note: this data is a combination of the tree roots and the global variables hash.
|
|
87
|
+
*
|
|
88
|
+
* @returns The Block Header.
|
|
89
|
+
* @throws If no block have been processed yet.
|
|
90
|
+
*/
|
|
91
|
+
getBlockHeader(): Promise<BlockHeader>;
|
|
92
|
+
/**
|
|
93
|
+
* Set the latest Block Header.
|
|
94
|
+
* Note that this will overwrite any existing hash or roots in the database.
|
|
95
|
+
*
|
|
96
|
+
* @param header - An object containing the most recent block header.
|
|
97
|
+
* @returns A Promise that resolves when the hash has been successfully updated in the database.
|
|
98
|
+
*/
|
|
99
|
+
setHeader(header: BlockHeader): Promise<void>;
|
|
100
|
+
/**
|
|
101
|
+
* Adds sender address to the database.
|
|
102
|
+
* @param address - The address to add to the address book.
|
|
103
|
+
* @returns A promise resolving to true if the address was added, false if it already exists.
|
|
104
|
+
*/
|
|
105
|
+
addSenderAddress(address: AztecAddress): Promise<boolean>;
|
|
106
|
+
/**
|
|
107
|
+
* Retrieves the list of sender addresses in the address book.
|
|
108
|
+
* @returns An array of Aztec addresses.
|
|
109
|
+
*/
|
|
110
|
+
getSenderAddresses(): Promise<AztecAddress[]>;
|
|
111
|
+
/**
|
|
112
|
+
* Removes a sender address from the database.
|
|
113
|
+
* @param address - The address to remove from the address book.
|
|
114
|
+
* @returns A promise resolving to true if the address was removed, false if it does not exist.
|
|
115
|
+
*/
|
|
116
|
+
removeSenderAddress(address: AztecAddress): Promise<boolean>;
|
|
117
|
+
/**
|
|
118
|
+
* Adds complete address to the database.
|
|
119
|
+
* @param address - The complete address to add.
|
|
120
|
+
* @returns A promise resolving to true if the address was added, false if it already exists.
|
|
121
|
+
* @throws If we try to add a CompleteAddress with the same AztecAddress but different public key or partial
|
|
122
|
+
* address.
|
|
123
|
+
*/
|
|
124
|
+
addCompleteAddress(address: CompleteAddress): Promise<boolean>;
|
|
125
|
+
/**
|
|
126
|
+
* Retrieve the complete address associated to a given address.
|
|
127
|
+
* @param account - The account address.
|
|
128
|
+
* @returns A promise that resolves to a CompleteAddress instance if found, or undefined if not found.
|
|
129
|
+
*/
|
|
130
|
+
getCompleteAddress(account: AztecAddress): Promise<CompleteAddress | undefined>;
|
|
131
|
+
/**
|
|
132
|
+
* Retrieves the list of complete addresses added to this database
|
|
133
|
+
* @returns A promise that resolves to an array of AztecAddress instances.
|
|
134
|
+
*/
|
|
135
|
+
getCompleteAddresses(): Promise<CompleteAddress[]>;
|
|
136
|
+
/**
|
|
137
|
+
* Returns the estimated size in bytes of this db.
|
|
138
|
+
* @returns The estimated size in bytes of this db.
|
|
139
|
+
*/
|
|
140
|
+
estimateSize(): Promise<number>;
|
|
141
|
+
/**
|
|
142
|
+
* Returns the last seen indexes for the provided app siloed tagging secrets or 0 if they've never been seen.
|
|
143
|
+
* @param appTaggingSecrets - The app siloed tagging secrets.
|
|
144
|
+
* @returns The indexes for the provided secrets, 0 if they've never been seen.
|
|
145
|
+
*/
|
|
146
|
+
getTaggingSecretsIndexesAsRecipient(appTaggingSecrets: Fr[]): Promise<number[]>;
|
|
147
|
+
/**
|
|
148
|
+
* Returns the last seen indexes for the provided app siloed tagging secrets or 0 if they've never been used
|
|
149
|
+
* @param appTaggingSecrets - The app siloed tagging secrets.
|
|
150
|
+
* @returns The indexes for the provided secrets, 0 if they've never been seen.
|
|
151
|
+
*/
|
|
152
|
+
getTaggingSecretsIndexesAsSender(appTaggingSecrets: Fr[]): Promise<number[]>;
|
|
153
|
+
/**
|
|
154
|
+
* Sets the index for the provided app siloed tagging secrets
|
|
155
|
+
* To be used when the generated tags have been "seen" as a sender
|
|
156
|
+
* @param appTaggingSecrets - The app siloed tagging secrets.
|
|
157
|
+
*/
|
|
158
|
+
setTaggingSecretsIndexesAsSender(indexedTaggingSecrets: IndexedTaggingSecret[]): Promise<void>;
|
|
159
|
+
/**
|
|
160
|
+
* Sets the index for the provided app siloed tagging secrets
|
|
161
|
+
* To be used when the generated tags have been "seen" as a recipient
|
|
162
|
+
* @param appTaggingSecrets - The app siloed tagging secrets.
|
|
163
|
+
*/
|
|
164
|
+
setTaggingSecretsIndexesAsRecipient(indexedTaggingSecrets: IndexedTaggingSecret[]): Promise<void>;
|
|
165
|
+
/**
|
|
166
|
+
* Deletes all notes synched after this block number.
|
|
167
|
+
* @param blockNumber - All notes strictly after this block number are removed.
|
|
168
|
+
*/
|
|
169
|
+
removeNotesAfter(blockNumber: number): Promise<void>;
|
|
170
|
+
/**
|
|
171
|
+
* Restores notes nullified after the given block.
|
|
172
|
+
* @param blockNumber - All nullifiers strictly after this block are removed.
|
|
173
|
+
*/
|
|
174
|
+
unnullifyNotesAfter(blockNumber: number): Promise<void>;
|
|
175
|
+
/**
|
|
176
|
+
* Resets the indexes used to sync notes to 0 for every sender and recipient, causing the next sync process to
|
|
177
|
+
* start from scratch, taking longer than usual.
|
|
178
|
+
* This can help fix desynchronization issues, including finding logs that had previously been overlooked, and
|
|
179
|
+
* is also required to deal with chain reorgs.
|
|
180
|
+
*/
|
|
181
|
+
resetNoteSyncData(): Promise<void>;
|
|
182
|
+
/**
|
|
183
|
+
* Stores arbitrary information in a per-contract non-volatile database, which can later be retrieved with `dbLoad`.
|
|
184
|
+
* If data was already stored at this slot, it is overwrriten.
|
|
185
|
+
* @param contractAddress - The contract address to scope the data under.
|
|
186
|
+
* @param slot - The slot in the database in which to store the value. Slots need not be contiguous.
|
|
187
|
+
* @param values - The data to store.
|
|
188
|
+
*/
|
|
189
|
+
dbStore(contractAddress: AztecAddress, slot: Fr, values: Fr[]): Promise<void>;
|
|
190
|
+
/**
|
|
191
|
+
* Returns data previously stored via `dbStore` in the per-contract non-volatile database.
|
|
192
|
+
* @param contractAddress - The contract address under which the data is scoped.
|
|
193
|
+
* @param slot - The slot in the database to read.
|
|
194
|
+
* @returns The stored data or `null` if no data is stored under the slot.
|
|
195
|
+
*/
|
|
196
|
+
dbLoad(contractAddress: AztecAddress, slot: Fr): Promise<Fr[] | null>;
|
|
197
|
+
/**
|
|
198
|
+
* Deletes data in the per-contract non-volatile database. Does nothing if no data was present.
|
|
199
|
+
* @param contractAddress - The contract address under which the data is scoped.
|
|
200
|
+
* @param slot - The slot in the database to delete.
|
|
201
|
+
*/
|
|
202
|
+
dbDelete(contractAddress: AztecAddress, slot: Fr): Promise<void>;
|
|
203
|
+
/**
|
|
204
|
+
* Copies a number of contiguous entries in the per-contract non-volatile database. This allows for efficient data
|
|
205
|
+
* structures by avoiding repeated calls to `dbLoad` and `dbStore`.
|
|
206
|
+
* Supports overlapping source and destination regions (which will result in the overlapped source values being
|
|
207
|
+
* overwritten). All copied slots must exist in the database (i.e. have been stored and not deleted)
|
|
208
|
+
*
|
|
209
|
+
* @param contractAddress - The contract address under which the data is scoped.
|
|
210
|
+
* @param srcSlot - The first slot to copy from.
|
|
211
|
+
* @param dstSlot - The first slot to copy to.
|
|
212
|
+
* @param numEntries - The number of entries to copy.
|
|
213
|
+
*/
|
|
214
|
+
dbCopy(contractAddress: AztecAddress, srcSlot: Fr, dstSlot: Fr, numEntries: number): Promise<void>;
|
|
215
|
+
}
|
|
216
|
+
//# sourceMappingURL=pxe_database.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pxe_database.d.ts","sourceRoot":"","sources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O,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACpG"}
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* addresses, storage slots, and nullifiers.
|
|
4
|
-
*/ export { };
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHhlX2RhdGFiYXNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RhdGFiYXNlL3B4ZV9kYXRhYmFzZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type PxeDatabase } from './pxe_database.js';
|
|
2
|
+
/**
|
|
3
|
+
* A common test suite for a PXE database.
|
|
4
|
+
* @param getDatabase - A function that returns a database instance.
|
|
5
|
+
*/
|
|
6
|
+
export declare function describePxeDatabase(getDatabase: () => PxeDatabase): void;
|
|
7
|
+
//# sourceMappingURL=pxe_database_test_suite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pxe_database_test_suite.d.ts","sourceRoot":"","sources":["../../src/database/pxe_database_test_suite.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,WAAW,EAAE,MAAM,WAAW,QA8iBjE"}
|