@aztec/merkle-tree 0.86.0 → 0.87.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/hasher_with_stats.d.ts +0 -1
- package/dest/hasher_with_stats.d.ts.map +1 -1
- package/dest/interfaces/append_only_tree.d.ts +1 -3
- package/dest/interfaces/append_only_tree.d.ts.map +1 -1
- package/dest/interfaces/indexed_tree.d.ts +0 -2
- package/dest/interfaces/indexed_tree.d.ts.map +1 -1
- package/dest/interfaces/merkle_tree.d.ts +0 -2
- package/dest/interfaces/merkle_tree.d.ts.map +1 -1
- package/dest/interfaces/update_only_tree.d.ts +0 -2
- package/dest/interfaces/update_only_tree.d.ts.map +1 -1
- package/dest/load_tree.d.ts +0 -2
- package/dest/load_tree.d.ts.map +1 -1
- package/dest/pedersen.d.ts +2 -4
- package/dest/pedersen.d.ts.map +1 -1
- package/dest/poseidon.d.ts +2 -4
- package/dest/poseidon.d.ts.map +1 -1
- package/dest/sha_256.d.ts +4 -6
- package/dest/sha_256.d.ts.map +1 -1
- package/dest/snapshots/base_full_snapshot.d.ts +1 -3
- package/dest/snapshots/base_full_snapshot.d.ts.map +1 -1
- package/dest/snapshots/full_snapshot.d.ts +0 -2
- package/dest/snapshots/full_snapshot.d.ts.map +1 -1
- package/dest/snapshots/indexed_tree_snapshot.d.ts +0 -2
- package/dest/snapshots/indexed_tree_snapshot.d.ts.map +1 -1
- package/dest/snapshots/snapshot_builder.d.ts +0 -2
- package/dest/snapshots/snapshot_builder.d.ts.map +1 -1
- package/dest/standard_indexed_tree/standard_indexed_tree.d.ts +1 -3
- package/dest/standard_indexed_tree/standard_indexed_tree.d.ts.map +1 -1
- package/dest/standard_indexed_tree/standard_indexed_tree.js +1 -1
- package/dest/standard_indexed_tree/test/standard_indexed_tree_with_append.d.ts +1 -3
- package/dest/standard_indexed_tree/test/standard_indexed_tree_with_append.d.ts.map +1 -1
- package/dest/standard_indexed_tree/test/standard_indexed_tree_with_append.js +0 -1
- package/dest/standard_tree/standard_tree.d.ts +1 -3
- package/dest/standard_tree/standard_tree.d.ts.map +1 -1
- package/dest/standard_tree/standard_tree.js +0 -1
- package/dest/tree_base.d.ts +3 -5
- package/dest/tree_base.d.ts.map +1 -1
- package/dest/unbalanced_tree.d.ts +1 -3
- package/dest/unbalanced_tree.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/interfaces/append_only_tree.ts +1 -1
- package/src/pedersen.ts +7 -4
- package/src/poseidon.ts +7 -4
- package/src/sha_256.ts +8 -8
- package/src/snapshots/base_full_snapshot.ts +4 -1
- package/src/snapshots/full_snapshot.ts +5 -1
- package/src/snapshots/indexed_tree_snapshot.ts +5 -1
- package/src/standard_indexed_tree/standard_indexed_tree.ts +2 -3
- package/src/standard_indexed_tree/test/standard_indexed_tree_with_append.ts +1 -3
- package/src/standard_tree/standard_tree.ts +1 -3
- package/src/tree_base.ts +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hasher_with_stats.d.ts","sourceRoot":"","sources":["../src/hasher_with_stats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"hasher_with_stats.d.ts","sourceRoot":"","sources":["../src/hasher_with_stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAItD;;GAEG;AACH,qBAAa,eAAgB,YAAW,MAAM;IAC5C,SAAS,SAAK;IACd,eAAe,SAAK;IACpB,aAAa,2CAAqB;IAClC,mBAAmB,2CAAqB;IAExC,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;gBAErB,MAAM,EAAE,MAAM;IAiB1B,KAAK;;;;;;IAUL,KAAK;CAON"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Bufferable } from '@aztec/foundation/serialize';
|
|
4
2
|
import type { TreeSnapshot, TreeSnapshotBuilder } from '../snapshots/snapshot_builder.js';
|
|
5
3
|
import type { MerkleTree } from './merkle_tree.js';
|
|
@@ -11,6 +9,6 @@ export interface AppendOnlyTree<T extends Bufferable = Buffer> extends MerkleTre
|
|
|
11
9
|
* Appends a set of leaf values to the tree.
|
|
12
10
|
* @param leaves - The set of leaves to be appended.
|
|
13
11
|
*/
|
|
14
|
-
appendLeaves(leaves: T[]):
|
|
12
|
+
appendLeaves(leaves: T[]): void;
|
|
15
13
|
}
|
|
16
14
|
//# sourceMappingURL=append_only_tree.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"append_only_tree.d.ts","sourceRoot":"","sources":["../../src/interfaces/append_only_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"append_only_tree.d.ts","sourceRoot":"","sources":["../../src/interfaces/append_only_tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,UAAU,GAAG,MAAM,CAC3D,SAAQ,UAAU,CAAC,CAAC,CAAC,EACnB,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACtC;;;OAGG;IACH,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI,CAAC;CACjC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { IndexedTreeLeaf, IndexedTreeLeafPreimage } from '@aztec/foundation/trees';
|
|
4
2
|
import type { BatchInsertionResult } from '@aztec/stdlib/trees';
|
|
5
3
|
import type { IndexedTreeSnapshot, TreeSnapshot, TreeSnapshotBuilder } from '../snapshots/snapshot_builder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexed_tree.d.ts","sourceRoot":"","sources":["../../src/interfaces/indexed_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"indexed_tree.d.ts","sourceRoot":"","sources":["../../src/interfaces/indexed_tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACxF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAEhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC/G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,uBAAuB,CAAC;IAC7F;;;OAGG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,uBAAuB,CAAC;IACpD;;OAEG;IACH,KAAK,IAAI,uBAAuB,CAAC;IACjC;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,uBAAuB,GAAG,uBAAuB,CAAC;CACnE;AAED;;GAEG;AACH,MAAM,WAAW,WACf,SAAQ,UAAU,CAAC,MAAM,CAAC,EACxB,mBAAmB,CAAC,mBAAmB,CAAC,EACxC,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,MAAM,mBAAmB,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/E;;;;;OAKG;IACH,sBAAsB,CACpB,QAAQ,EAAE,MAAM,EAChB,kBAAkB,EAAE,OAAO,GAEzB;QACE;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,cAAc,EAAE,OAAO,CAAC;KACzB,GACD,SAAS,CAAC;IAEd;;;;;OAKG;IACH,yBAAyB,CAAC,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,GAAG,uBAAuB,GAAG,SAAS,CAAC;IAE3G;;;;;OAKG;IACH,WAAW,CAAC,UAAU,SAAS,MAAM,EAAE,aAAa,SAAS,MAAM,EAAE,wBAAwB,SAAS,MAAM,EAC1G,MAAM,EAAE,MAAM,EAAE,EAChB,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,OAAO,GAC1B,OAAO,CAAC,oBAAoB,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC,CAAC;CACxE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merkle_tree.d.ts","sourceRoot":"","sources":["../../src/interfaces/merkle_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merkle_tree.d.ts","sourceRoot":"","sources":["../../src/interfaces/merkle_tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;CACvG;AAED;;GAEG;AACH,MAAM,WAAW,UAAU,CAAC,CAAC,SAAS,UAAU,GAAG,MAAM,CAAE,SAAQ,iBAAiB;IAClF;;;OAGG;IACH,OAAO,CAAC,kBAAkB,EAAE,OAAO,GAAG,MAAM,CAAC;IAE7C;;;OAGG;IACH,YAAY,CAAC,kBAAkB,EAAE,OAAO,GAAG,MAAM,CAAC;IAElD;;OAEG;IACH,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAExB;;OAEG;IACH,QAAQ,IAAI,MAAM,CAAC;IAEnB;;OAEG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE1B;;;;OAIG;IACH,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,GAAG,CAAC,GAAG,SAAS,CAAC;IAExE;;;;;OAKG;IACH,aAAa,CAAC,IAAI,EAAE,CAAC,EAAE,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;IAExE;;;;;;OAMG;IACH,kBAAkB,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CAClG"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Bufferable } from '@aztec/foundation/serialize';
|
|
4
2
|
import type { TreeSnapshot, TreeSnapshotBuilder } from '../snapshots/snapshot_builder.js';
|
|
5
3
|
import type { MerkleTree } from './merkle_tree.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"update_only_tree.d.ts","sourceRoot":"","sources":["../../src/interfaces/update_only_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"update_only_tree.d.ts","sourceRoot":"","sources":["../../src/interfaces/update_only_tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,UAAU,GAAG,MAAM,CAC3D,SAAQ,UAAU,CAAC,CAAC,CAAC,EACnB,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACtC;;;;OAIG;IACH,UAAU,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD"}
|
package/dest/load_tree.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Bufferable, FromBuffer } from '@aztec/foundation/serialize';
|
|
4
2
|
import type { Hasher } from '@aztec/foundation/trees';
|
|
5
3
|
import type { AztecKVStore } from '@aztec/kv-store';
|
package/dest/load_tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load_tree.d.ts","sourceRoot":"","sources":["../src/load_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"load_tree.d.ts","sourceRoot":"","sources":["../src/load_tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,KAAK,QAAQ,EAAe,MAAM,gBAAgB,CAAC;AAE5D;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,QAAQ,CAAC,UAAU,CAAC,EAAE,CAAC,SAAS,UAAU,CAAC,UAAU,CAAC,EACvF,CAAC,EAAE,KACD,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,CAAC,EACf,IAAI,EAAE,MAAM,KACT,CAAC,EACN,KAAK,EAAE,YAAY,EACnB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,CAAC,GACd,OAAO,CAAC,CAAC,CAAC,CAIZ"}
|
package/dest/pedersen.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Hasher } from '@aztec/foundation/trees';
|
|
4
2
|
/**
|
|
5
3
|
* A helper class encapsulating Pedersen hash functionality.
|
|
@@ -7,7 +5,7 @@ import type { Hasher } from '@aztec/foundation/trees';
|
|
|
7
5
|
* purposes.
|
|
8
6
|
*/
|
|
9
7
|
export declare class Pedersen implements Hasher {
|
|
10
|
-
hash(lhs: Uint8Array, rhs: Uint8Array): Buffer
|
|
11
|
-
hashInputs(inputs: Buffer[]): Buffer
|
|
8
|
+
hash(lhs: Uint8Array, rhs: Uint8Array): Buffer<ArrayBuffer>;
|
|
9
|
+
hashInputs(inputs: Buffer[]): Buffer<ArrayBuffer>;
|
|
12
10
|
}
|
|
13
11
|
//# sourceMappingURL=pedersen.d.ts.map
|
package/dest/pedersen.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pedersen.d.ts","sourceRoot":"","sources":["../src/pedersen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pedersen.d.ts","sourceRoot":"","sources":["../src/pedersen.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;GAIG;AACH,qBAAa,QAAS,YAAW,MAAM;IAK9B,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAIzB,MAAM,CAAC,WAAW,CAAC;IAO/B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAEe,MAAM,CAAC,WAAW,CAAC;CAErE"}
|
package/dest/poseidon.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Hasher } from '@aztec/foundation/trees';
|
|
4
2
|
/**
|
|
5
3
|
* A helper class encapsulating poseidon2 hash functionality.
|
|
@@ -7,7 +5,7 @@ import type { Hasher } from '@aztec/foundation/trees';
|
|
|
7
5
|
* purposes.
|
|
8
6
|
*/
|
|
9
7
|
export declare class Poseidon implements Hasher {
|
|
10
|
-
hash(lhs: Uint8Array, rhs: Uint8Array): Buffer
|
|
11
|
-
hashInputs(inputs: Buffer[]): Buffer
|
|
8
|
+
hash(lhs: Uint8Array, rhs: Uint8Array): Buffer<ArrayBuffer>;
|
|
9
|
+
hashInputs(inputs: Buffer[]): Buffer<ArrayBuffer>;
|
|
12
10
|
}
|
|
13
11
|
//# sourceMappingURL=poseidon.d.ts.map
|
package/dest/poseidon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../src/poseidon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"poseidon.d.ts","sourceRoot":"","sources":["../src/poseidon.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;GAIG;AACH,qBAAa,QAAS,YAAW,MAAM;IAK9B,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAIzB,MAAM,CAAC,WAAW,CAAC;IAO/B,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GAEgB,MAAM,CAAC,WAAW,CAAC;CAEtE"}
|
package/dest/sha_256.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Hasher } from '@aztec/foundation/trees';
|
|
4
2
|
/**
|
|
5
3
|
* A helper class encapsulating SHA256 hash functionality.
|
|
@@ -7,8 +5,8 @@ import type { Hasher } from '@aztec/foundation/trees';
|
|
|
7
5
|
* purposes.
|
|
8
6
|
*/
|
|
9
7
|
export declare class SHA256 implements Hasher {
|
|
10
|
-
hash(lhs: Uint8Array, rhs: Uint8Array): Buffer
|
|
11
|
-
hashInputs(inputs: Buffer[]): Buffer
|
|
8
|
+
hash(lhs: Uint8Array, rhs: Uint8Array): Buffer<ArrayBuffer>;
|
|
9
|
+
hashInputs(inputs: Buffer[]): Buffer<ArrayBuffer>;
|
|
12
10
|
}
|
|
13
11
|
/**
|
|
14
12
|
* A helper class encapsulating truncated SHA256 hash functionality.
|
|
@@ -16,7 +14,7 @@ export declare class SHA256 implements Hasher {
|
|
|
16
14
|
* purposes.
|
|
17
15
|
*/
|
|
18
16
|
export declare class SHA256Trunc implements Hasher {
|
|
19
|
-
hash(lhs: Uint8Array, rhs: Uint8Array): Buffer
|
|
20
|
-
hashInputs(inputs: Buffer[]): Buffer
|
|
17
|
+
hash(lhs: Uint8Array, rhs: Uint8Array): Buffer<ArrayBuffer>;
|
|
18
|
+
hashInputs(inputs: Buffer[]): Buffer<ArrayBuffer>;
|
|
21
19
|
}
|
|
22
20
|
//# sourceMappingURL=sha_256.d.ts.map
|
package/dest/sha_256.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sha_256.d.ts","sourceRoot":"","sources":["../src/sha_256.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sha_256.d.ts","sourceRoot":"","sources":["../src/sha_256.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEtD;;;;GAIG;AACH,qBAAa,MAAO,YAAW,MAAM;IAK5B,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAC4B,MAAM,CAAC,WAAW,CAAC;IAOpF,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GACQ,MAAM,CAAC,WAAW,CAAC;CAE9D;AAED;;;;GAIG;AACH,qBAAa,WAAY,YAAW,MAAM;IAKjC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,GAC4C,MAAM,CAAC,WAAW,CAAC;IAOpG,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,GACwB,MAAM,CAAC,WAAW,CAAC;CAE9E"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { type Bufferable, type FromBuffer } from '@aztec/foundation/serialize';
|
|
4
2
|
import { SiblingPath } from '@aztec/foundation/trees';
|
|
5
3
|
import type { AztecKVStore, AztecMap } from '@aztec/kv-store';
|
|
@@ -58,7 +56,7 @@ export declare class BaseFullTreeSnapshot<T extends Bufferable> implements TreeS
|
|
|
58
56
|
getDepth(): number;
|
|
59
57
|
getRoot(): Buffer;
|
|
60
58
|
getNumLeaves(): bigint;
|
|
61
|
-
protected pathFromRootToLeaf(leafIndex: bigint): Generator<Buffer[], void, unknown>;
|
|
59
|
+
protected pathFromRootToLeaf(leafIndex: bigint): Generator<Buffer<ArrayBufferLike>[], void, unknown>;
|
|
62
60
|
findLeafIndex(value: T): bigint | undefined;
|
|
63
61
|
findLeafIndexAfter(value: T, startIndex: bigint): bigint | undefined;
|
|
64
62
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_full_snapshot.d.ts","sourceRoot":"","sources":["../../src/snapshots/base_full_snapshot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base_full_snapshot.d.ts","sourceRoot":"","sources":["../../src/snapshots/base_full_snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,E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MAAM,GAAG,CAAC;CAKpE;AAED;;GAEG;AACH,qBAAa,oBAAoB,CAAC,CAAC,SAAS,UAAU,CAAE,YAAW,YAAY,CAAC,CAAC,CAAC;;IAE9E,SAAS,CAAC,EAAE,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChD,SAAS,CAAC,YAAY,EAAE,MAAM;IAC9B,SAAS,CAAC,SAAS,EAAE,MAAM;IAC3B,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;IAC3B,SAAS,CAAC,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;gBAJ3B,EAAE,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACtC,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EACjB,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IAGvC,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,WAAW,CAAC,CAAC,CAAC;IAc/D,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS;IAS1C,QAAQ,IAAI,MAAM;IAIlB,OAAO,IAAI,MAAM;IAIjB,YAAY,IAAI,MAAM;IAItB,SAAS,CAAE,kBAAkB,CAAC,SAAS,EAAE,MAAM;IAwC/C,aAAa,CAAC,KAAK,EAAE,CAAC,GAAG,MAAM,GAAG,SAAS;IAIpC,kBAAkB,CAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAW5E"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { Bufferable, FromBuffer } from '@aztec/foundation/serialize';
|
|
4
2
|
import type { AztecKVStore } from '@aztec/kv-store';
|
|
5
3
|
import type { TreeBase } from '../tree_base.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full_snapshot.d.ts","sourceRoot":"","sources":["../../src/snapshots/full_snapshot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"full_snapshot.d.ts","sourceRoot":"","sources":["../../src/snapshots/full_snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAwB,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAE/E;;;;;;;;;;;;;GAaG;AACH,qBAAa,uBAAuB,CAAC,CAAC,SAAS,UAAU,CACvD,SAAQ,2BAA2B,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC,CAChE,YAAW,mBAAmB,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAK7C,OAAO,CAAC,YAAY;gBAFpB,EAAE,EAAE,YAAY,EAChB,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EACT,YAAY,EAAE,UAAU,CAAC,CAAC,CAAC;IAKrC,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,YAAY,CAAC,CAAC,CAAC;CAGzE"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { AztecKVStore, AztecMap } from '@aztec/kv-store';
|
|
4
2
|
import type { IndexedTree, PreimageFactory } from '../interfaces/indexed_tree.js';
|
|
5
3
|
import type { TreeBase } from '../tree_base.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexed_tree_snapshot.d.ts","sourceRoot":"","sources":["../../src/snapshots/indexed_tree_snapshot.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"indexed_tree_snapshot.d.ts","sourceRoot":"","sources":["../../src/snapshots/indexed_tree_snapshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAClF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAwB,2BAA2B,EAAE,MAAM,yBAAyB,CAAC;AAC5F,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAItF,QAAQ;AACR,qBAAa,0BACX,SAAQ,2BAA2B,CAAC,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CACvF,YAAW,mBAAmB,CAAC,mBAAmB,CAAC;IAMjD,OAAO,CAAC,mBAAmB;IAJ7B,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAE/B,KAAK,EAAE,YAAY,EACnB,IAAI,EAAE,WAAW,GAAG,QAAQ,CAAC,MAAM,CAAC,EAC5B,mBAAmB,EAAE,eAAe;IAM9C,SAAS,CAAC,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,mBAAmB;cAIzD,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAM1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot_builder.d.ts","sourceRoot":"","sources":["../../src/snapshots/snapshot_builder.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3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AC,QAAQ,EAAE,MAAM,GAAG;QACxC;;WAEG;QACH,KAAK,EAAE,MAAM,CAAC;QACd;;WAEG;QACH,cAAc,EAAE,OAAO,CAAC;KACzB,CAAC;CACH"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import type { FromBuffer } from '@aztec/foundation/serialize';
|
|
4
2
|
import { SiblingPath } from '@aztec/foundation/trees';
|
|
5
3
|
import type { Hasher, IndexedTreeLeaf, IndexedTreeLeafPreimage } from '@aztec/foundation/trees';
|
|
@@ -45,7 +43,7 @@ export declare class StandardIndexedTree extends TreeBase<Buffer> implements Ind
|
|
|
45
43
|
* @returns Empty promise.
|
|
46
44
|
* @remarks Use batchInsert method instead.
|
|
47
45
|
*/
|
|
48
|
-
appendLeaves(_leaves: Buffer[]):
|
|
46
|
+
appendLeaves(_leaves: Buffer[]): void;
|
|
49
47
|
/**
|
|
50
48
|
* Commits the changes to the database.
|
|
51
49
|
* @returns Empty promise.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard_indexed_tree.d.ts","sourceRoot":"","sources":["../../src/standard_indexed_tree/standard_indexed_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standard_indexed_tree.d.ts","sourceRoot":"","sources":["../../src/standard_indexed_tree/standard_indexed_tree.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAE9D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAChG,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE9D,OAAO,KAAK,EAAE,oBAAoB,EAAyB,MAAM,qBAAqB,CAAC;AAEvF,OA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA0IG;IACU,WAAW,CACtB,UAAU,SAAS,MAAM,EACzB,aAAa,SAAS,MAAM,EAC5B,wBAAwB,SAAS,MAAM,EAEvC,MAAM,EAAE,MAAM,EAAE,EAChB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,oBAAoB,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;IAqHhE,qBAAqB,CAAC,aAAa,SAAS,MAAM,EAAE,wBAAwB,SAAS,MAAM,EAC/F,aAAa,EAAE,aAAa,EAC5B,kBAAkB,EAAE,OAAO,GAC1B,OAAO,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC;IAQjD,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI3D,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAI9D;;;;;OAKG;IACH,OAAO,CAAC,qBAAqB;IAW7B;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;CASnB"}
|
|
@@ -216,7 +216,7 @@ export const noopDeserializer = {
|
|
|
216
216
|
this.cachedSize = index + 1n;
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
|
-
/*
|
|
219
|
+
/* The following doc block messes up with complete-sentence, so we just disable it */ /**
|
|
220
220
|
*
|
|
221
221
|
* Each base rollup needs to provide non membership / inclusion proofs for each of the nullifier.
|
|
222
222
|
* This method will return membership proofs and perform partial node updates that will
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { StandardIndexedTree } from '../standard_indexed_tree.js';
|
|
4
2
|
/**
|
|
5
3
|
* A testing utility which is here to store the original implementation of StandardIndexedTree.appendLeaves method
|
|
@@ -13,7 +11,7 @@ export declare class StandardIndexedTreeWithAppend extends StandardIndexedTree {
|
|
|
13
11
|
* @returns Empty promise.
|
|
14
12
|
* @remarks This method is inefficient and is here mostly for testing. Use batchInsert instead.
|
|
15
13
|
*/
|
|
16
|
-
appendLeaves(leaves: Buffer[]):
|
|
14
|
+
appendLeaves(leaves: Buffer[]): void;
|
|
17
15
|
private appendEmptyLeaf;
|
|
18
16
|
/**
|
|
19
17
|
* Appends the given leaf to the tree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard_indexed_tree_with_append.d.ts","sourceRoot":"","sources":["../../../src/standard_indexed_tree/test/standard_indexed_tree_with_append.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standard_indexed_tree_with_append.d.ts","sourceRoot":"","sources":["../../../src/standard_indexed_tree/test/standard_indexed_tree_with_append.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAElE;;;;GAIG;AACH,qBAAa,6BAA8B,SAAQ,mBAAmB;IACpE;;;;;OAKG;IACa,YAAY,CAAC,MAAM,EAAE,MAAM,EAAE;IAM7C,OAAO,CAAC,eAAe;IAQvB;;;;OAIG;IACH,OAAO,CAAC,UAAU;CA6CnB"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { type Bufferable } from '@aztec/foundation/serialize';
|
|
4
2
|
import type { AppendOnlyTree } from '../interfaces/append_only_tree.js';
|
|
5
3
|
import type { TreeSnapshot } from '../snapshots/snapshot_builder.js';
|
|
@@ -14,7 +12,7 @@ export declare class StandardTree<T extends Bufferable = Buffer> extends TreeBas
|
|
|
14
12
|
* @param leaves - The leaves to append.
|
|
15
13
|
* @returns Empty promise.
|
|
16
14
|
*/
|
|
17
|
-
appendLeaves(leaves: T[]):
|
|
15
|
+
appendLeaves(leaves: T[]): void;
|
|
18
16
|
snapshot(blockNumber: number): Promise<TreeSnapshot<T>>;
|
|
19
17
|
getSnapshot(blockNumber: number): Promise<TreeSnapshot<T>>;
|
|
20
18
|
findLeafIndex(value: T, includeUncommitted: boolean): bigint | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standard_tree.d.ts","sourceRoot":"","sources":["../../src/standard_tree/standard_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standard_tree.d.ts","sourceRoot":"","sources":["../../src/standard_tree/standard_tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,6BAA6B,CAAC;AAIjF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AAExE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C;;GAEG;AACH,qBAAa,YAAY,CAAC,CAAC,SAAS,UAAU,GAAG,MAAM,CAAE,SAAQ,QAAQ,CAAC,CAAC,CAAE,YAAW,cAAc,CAAC,CAAC,CAAC;;IAGvG;;;;OAIG;IACa,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI;IAexC,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAIvD,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IAI1D,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAIxE,kBAAkB,CAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;CAUzG"}
|
package/dest/tree_base.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { type Logger } from '@aztec/foundation/log';
|
|
4
2
|
import { type Bufferable, type FromBuffer } from '@aztec/foundation/serialize';
|
|
5
3
|
import { type Hasher, SiblingPath } from '@aztec/foundation/trees';
|
|
@@ -7,11 +5,11 @@ import type { AztecKVStore } from '@aztec/kv-store';
|
|
|
7
5
|
import { HasherWithStats } from './hasher_with_stats.js';
|
|
8
6
|
import type { MerkleTree } from './interfaces/merkle_tree.js';
|
|
9
7
|
export declare const getTreeMeta: (store: AztecKVStore, treeName: string) => {
|
|
10
|
-
root: Buffer
|
|
8
|
+
root: Buffer<ArrayBufferLike>;
|
|
11
9
|
depth: number;
|
|
12
10
|
size: bigint;
|
|
13
11
|
};
|
|
14
|
-
export declare const INITIAL_LEAF: Buffer
|
|
12
|
+
export declare const INITIAL_LEAF: Buffer<ArrayBuffer>;
|
|
15
13
|
/**
|
|
16
14
|
* A Merkle tree implementation that uses a LevelDB database to store the tree.
|
|
17
15
|
*/
|
|
@@ -30,7 +28,7 @@ export declare abstract class TreeBase<T extends Bufferable> implements MerkleTr
|
|
|
30
28
|
protected hasher: HasherWithStats;
|
|
31
29
|
private nodes;
|
|
32
30
|
private meta;
|
|
33
|
-
constructor(store: AztecKVStore, hasher: Hasher, name: string, depth: number, size: bigint, deserializer: FromBuffer<T>, root?: Buffer);
|
|
31
|
+
constructor(store: AztecKVStore, hasher: Hasher, name: string, depth: number, size: bigint | undefined, deserializer: FromBuffer<T>, root?: Buffer);
|
|
34
32
|
/**
|
|
35
33
|
* Returns the root of the tree.
|
|
36
34
|
* @param includeUncommitted - If true, root incorporating uncommitted changes is returned.
|
package/dest/tree_base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree_base.d.ts","sourceRoot":"","sources":["../src/tree_base.ts"],"names":[],"mappings":"
|
|
1
|
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AAI,CAAC;IAKvD;;;OAGG;IACH,SAAS,CAAC,SAAS;IAKnB;;;;;;;;;;;;;;OAcG;IACH,SAAS,CAAC,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAI;IAgCzC;;;;;OAKG;IACH,QAAQ,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC,EAAE,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;IAEjF;;;;;;OAMG;IACH,QAAQ,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,EAAE,kBAAkB,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS;CAC1G"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
2
|
-
/// <reference types="node" resolution-mode="require"/>
|
|
3
1
|
import { type Bufferable, type FromBuffer } from '@aztec/foundation/serialize';
|
|
4
2
|
import { SiblingPath } from '@aztec/foundation/trees';
|
|
5
3
|
import type { Hasher } from '@aztec/foundation/trees';
|
|
@@ -20,7 +18,7 @@ export declare class UnbalancedTree<T extends Bufferable = Buffer> implements Me
|
|
|
20
18
|
protected readonly maxIndex: bigint;
|
|
21
19
|
protected hasher: HasherWithStats;
|
|
22
20
|
root: Buffer;
|
|
23
|
-
constructor(hasher: Hasher, name: string, maxDepth: number, deserializer: FromBuffer<T>);
|
|
21
|
+
constructor(hasher: Hasher, name: string, maxDepth: number | undefined, deserializer: FromBuffer<T>);
|
|
24
22
|
/**
|
|
25
23
|
* Returns the root of the tree.
|
|
26
24
|
* @returns The root of the tree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unbalanced_tree.d.ts","sourceRoot":"","sources":["../src/unbalanced_tree.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"unbalanced_tree.d.ts","sourceRoot":"","sources":["../src/unbalanced_tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,KA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;;;;OAMG;IACI,kBAAkB,CAAC,KAAK,EAAE,CAAC,EAAE,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAQ3E;;;;;OAKG;IACI,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;IAYhE;;;;;OAKG;IACI,cAAc,CAAC,CAAC,SAAS,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;IAgB/E;;;;OAIG;IACI,YAAY,CAAC,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAc/C;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAyCnB;;;;;OAKG;IACH,OAAO,CAAC,SAAS;CAKlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/merkle-tree",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.87.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"typedocOptions": {
|
|
@@ -54,20 +54,20 @@
|
|
|
54
54
|
]
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@aztec/foundation": "0.
|
|
58
|
-
"@aztec/kv-store": "0.
|
|
59
|
-
"@aztec/stdlib": "0.
|
|
57
|
+
"@aztec/foundation": "0.87.0",
|
|
58
|
+
"@aztec/kv-store": "0.87.0",
|
|
59
|
+
"@aztec/stdlib": "0.87.0",
|
|
60
60
|
"sha256": "^0.2.0",
|
|
61
61
|
"tslib": "^2.4.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@jest/globals": "^29.5.0",
|
|
65
65
|
"@types/jest": "^29.5.0",
|
|
66
|
-
"@types/node": "^
|
|
66
|
+
"@types/node": "^22.15.17",
|
|
67
67
|
"@types/sha256": "^0.2.0",
|
|
68
68
|
"jest": "^29.5.0",
|
|
69
69
|
"ts-node": "^10.9.1",
|
|
70
|
-
"typescript": "^5.
|
|
70
|
+
"typescript": "^5.3.3"
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
73
|
"dest",
|
|
@@ -78,6 +78,6 @@
|
|
|
78
78
|
],
|
|
79
79
|
"types": "./dest/index.d.ts",
|
|
80
80
|
"engines": {
|
|
81
|
-
"node": ">=
|
|
81
|
+
"node": ">=20.10"
|
|
82
82
|
}
|
|
83
83
|
}
|
package/src/pedersen.ts
CHANGED
|
@@ -12,16 +12,19 @@ export class Pedersen implements Hasher {
|
|
|
12
12
|
* @deprecated Don't call pedersen directly in production code. Instead, create suitably-named functions for specific
|
|
13
13
|
* purposes.
|
|
14
14
|
*/
|
|
15
|
-
public hash(lhs: Uint8Array, rhs: Uint8Array)
|
|
16
|
-
return pedersenHash([
|
|
15
|
+
public hash(lhs: Uint8Array, rhs: Uint8Array) {
|
|
16
|
+
return pedersenHash([
|
|
17
|
+
Fr.fromBuffer(Buffer.from(lhs)),
|
|
18
|
+
Fr.fromBuffer(Buffer.from(rhs)),
|
|
19
|
+
]).toBuffer() as Buffer<ArrayBuffer>;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
/*
|
|
20
23
|
* @deprecated Don't call pedersen directly in production code. Instead, create suitably-named functions for specific
|
|
21
24
|
* purposes.
|
|
22
25
|
*/
|
|
23
|
-
public hashInputs(inputs: Buffer[])
|
|
26
|
+
public hashInputs(inputs: Buffer[]) {
|
|
24
27
|
const inputFields = inputs.map(i => Fr.fromBuffer(i));
|
|
25
|
-
return pedersenHash(inputFields).toBuffer()
|
|
28
|
+
return pedersenHash(inputFields).toBuffer() as Buffer<ArrayBuffer>;
|
|
26
29
|
}
|
|
27
30
|
}
|
package/src/poseidon.ts
CHANGED
|
@@ -12,16 +12,19 @@ export class Poseidon implements Hasher {
|
|
|
12
12
|
* @deprecated Don't call poseidon2 directly in production code. Instead, create suitably-named functions for specific
|
|
13
13
|
* purposes.
|
|
14
14
|
*/
|
|
15
|
-
public hash(lhs: Uint8Array, rhs: Uint8Array)
|
|
16
|
-
return poseidon2Hash([
|
|
15
|
+
public hash(lhs: Uint8Array, rhs: Uint8Array) {
|
|
16
|
+
return poseidon2Hash([
|
|
17
|
+
Fr.fromBuffer(Buffer.from(lhs)),
|
|
18
|
+
Fr.fromBuffer(Buffer.from(rhs)),
|
|
19
|
+
]).toBuffer() as Buffer<ArrayBuffer>;
|
|
17
20
|
}
|
|
18
21
|
|
|
19
22
|
/*
|
|
20
23
|
* @deprecated Don't call poseidon2 directly in production code. Instead, create suitably-named functions for specific
|
|
21
24
|
* purposes.
|
|
22
25
|
*/
|
|
23
|
-
public hashInputs(inputs: Buffer[])
|
|
26
|
+
public hashInputs(inputs: Buffer[]) {
|
|
24
27
|
const inputFields = inputs.map(i => Fr.fromBuffer(i));
|
|
25
|
-
return poseidon2Hash(inputFields).toBuffer()
|
|
28
|
+
return poseidon2Hash(inputFields).toBuffer() as Buffer<ArrayBuffer>;
|
|
26
29
|
}
|
|
27
30
|
}
|
package/src/sha_256.ts
CHANGED
|
@@ -12,16 +12,16 @@ export class SHA256 implements Hasher {
|
|
|
12
12
|
* @deprecated Don't call SHA256 directly in production code. Instead, create suitably-named functions for specific
|
|
13
13
|
* purposes.
|
|
14
14
|
*/
|
|
15
|
-
public hash(lhs: Uint8Array, rhs: Uint8Array)
|
|
16
|
-
return sha256(Buffer.concat([Buffer.from(lhs), Buffer.from(rhs)]))
|
|
15
|
+
public hash(lhs: Uint8Array, rhs: Uint8Array) {
|
|
16
|
+
return sha256(Buffer.concat([Buffer.from(lhs), Buffer.from(rhs)])) as Buffer<ArrayBuffer>;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/*
|
|
20
20
|
* @deprecated Don't call SHA256 directly in production code. Instead, create suitably-named functions for specific
|
|
21
21
|
* purposes.
|
|
22
22
|
*/
|
|
23
|
-
public hashInputs(inputs: Buffer[])
|
|
24
|
-
return sha256(Buffer.concat(inputs))
|
|
23
|
+
public hashInputs(inputs: Buffer[]) {
|
|
24
|
+
return sha256(Buffer.concat(inputs)) as Buffer<ArrayBuffer>;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
@@ -35,15 +35,15 @@ export class SHA256Trunc implements Hasher {
|
|
|
35
35
|
* @deprecated Don't call SHA256 directly in production code. Instead, create suitably-named functions for specific
|
|
36
36
|
* purposes.
|
|
37
37
|
*/
|
|
38
|
-
public hash(lhs: Uint8Array, rhs: Uint8Array)
|
|
39
|
-
return truncateAndPad(sha256(Buffer.concat([Buffer.from(lhs), Buffer.from(rhs)])))
|
|
38
|
+
public hash(lhs: Uint8Array, rhs: Uint8Array) {
|
|
39
|
+
return truncateAndPad(sha256(Buffer.concat([Buffer.from(lhs), Buffer.from(rhs)]))) as Buffer<ArrayBuffer>;
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/*
|
|
43
43
|
* @deprecated Don't call SHA256 directly in production code. Instead, create suitably-named functions for specific
|
|
44
44
|
* purposes.
|
|
45
45
|
*/
|
|
46
|
-
public hashInputs(inputs: Buffer[])
|
|
47
|
-
return truncateAndPad(sha256(Buffer.concat(inputs)))
|
|
46
|
+
public hashInputs(inputs: Buffer[]) {
|
|
47
|
+
return truncateAndPad(sha256(Buffer.concat(inputs))) as Buffer<ArrayBuffer>;
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -37,7 +37,10 @@ export abstract class BaseFullTreeSnapshotBuilder<T extends TreeBase<Bufferable>
|
|
|
37
37
|
protected nodes: AztecMap<string, [Buffer, Buffer]>;
|
|
38
38
|
protected snapshotMetadata: AztecMap<number, SnapshotMetadata>;
|
|
39
39
|
|
|
40
|
-
constructor(
|
|
40
|
+
constructor(
|
|
41
|
+
protected db: AztecKVStore,
|
|
42
|
+
protected tree: T,
|
|
43
|
+
) {
|
|
41
44
|
this.nodes = db.openMap(`full_snapshot:${tree.getName()}:node`);
|
|
42
45
|
this.snapshotMetadata = db.openMap(`full_snapshot:${tree.getName()}:metadata`);
|
|
43
46
|
}
|
|
@@ -23,7 +23,11 @@ export class FullTreeSnapshotBuilder<T extends Bufferable>
|
|
|
23
23
|
extends BaseFullTreeSnapshotBuilder<TreeBase<T>, TreeSnapshot<T>>
|
|
24
24
|
implements TreeSnapshotBuilder<TreeSnapshot<T>>
|
|
25
25
|
{
|
|
26
|
-
constructor(
|
|
26
|
+
constructor(
|
|
27
|
+
db: AztecKVStore,
|
|
28
|
+
tree: TreeBase<T>,
|
|
29
|
+
private deserializer: FromBuffer<T>,
|
|
30
|
+
) {
|
|
27
31
|
super(db, tree);
|
|
28
32
|
}
|
|
29
33
|
|
|
@@ -14,7 +14,11 @@ export class IndexedTreeSnapshotBuilder
|
|
|
14
14
|
implements TreeSnapshotBuilder<IndexedTreeSnapshot>
|
|
15
15
|
{
|
|
16
16
|
leaves: AztecMap<string, Buffer>;
|
|
17
|
-
constructor(
|
|
17
|
+
constructor(
|
|
18
|
+
store: AztecKVStore,
|
|
19
|
+
tree: IndexedTree & TreeBase<Buffer>,
|
|
20
|
+
private leafPreimageBuilder: PreimageFactory,
|
|
21
|
+
) {
|
|
18
22
|
super(store, tree);
|
|
19
23
|
this.leaves = store.openMap('indexed_tree_snapshot:' + tree.getName());
|
|
20
24
|
}
|
|
@@ -88,7 +88,7 @@ export class StandardIndexedTree extends TreeBase<Buffer> implements IndexedTree
|
|
|
88
88
|
* @returns Empty promise.
|
|
89
89
|
* @remarks Use batchInsert method instead.
|
|
90
90
|
*/
|
|
91
|
-
override appendLeaves(_leaves: Buffer[]):
|
|
91
|
+
override appendLeaves(_leaves: Buffer[]): void {
|
|
92
92
|
throw new Error('Not implemented');
|
|
93
93
|
}
|
|
94
94
|
|
|
@@ -218,7 +218,7 @@ export class StandardIndexedTree extends TreeBase<Buffer> implements IndexedTree
|
|
|
218
218
|
public getLatestLeafPreimageCopy(index: bigint, includeUncommitted: boolean): IndexedTreeLeafPreimage | undefined {
|
|
219
219
|
const preimage = !includeUncommitted
|
|
220
220
|
? this.getDbPreimage(index)
|
|
221
|
-
: this.getCachedPreimage(index) ?? this.getDbPreimage(index);
|
|
221
|
+
: (this.getCachedPreimage(index) ?? this.getDbPreimage(index));
|
|
222
222
|
return preimage && this.leafPreimageFactory.clone(preimage);
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -319,7 +319,6 @@ export class StandardIndexedTree extends TreeBase<Buffer> implements IndexedTree
|
|
|
319
319
|
}
|
|
320
320
|
}
|
|
321
321
|
|
|
322
|
-
/* eslint-disable jsdoc/require-description-complete-sentence */
|
|
323
322
|
/* The following doc block messes up with complete-sentence, so we just disable it */
|
|
324
323
|
|
|
325
324
|
/**
|
|
@@ -12,12 +12,10 @@ export class StandardIndexedTreeWithAppend extends StandardIndexedTree {
|
|
|
12
12
|
* @returns Empty promise.
|
|
13
13
|
* @remarks This method is inefficient and is here mostly for testing. Use batchInsert instead.
|
|
14
14
|
*/
|
|
15
|
-
public override appendLeaves(leaves: Buffer[])
|
|
15
|
+
public override appendLeaves(leaves: Buffer[]) {
|
|
16
16
|
for (const leaf of leaves) {
|
|
17
17
|
this.appendLeaf(leaf);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
return Promise.resolve();
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
private appendEmptyLeaf() {
|
|
@@ -18,7 +18,7 @@ export class StandardTree<T extends Bufferable = Buffer> extends TreeBase<T> imp
|
|
|
18
18
|
* @param leaves - The leaves to append.
|
|
19
19
|
* @returns Empty promise.
|
|
20
20
|
*/
|
|
21
|
-
public override appendLeaves(leaves: T[]):
|
|
21
|
+
public override appendLeaves(leaves: T[]): void {
|
|
22
22
|
this.hasher.reset();
|
|
23
23
|
const timer = new Timer();
|
|
24
24
|
super.appendLeaves(leaves);
|
|
@@ -31,8 +31,6 @@ export class StandardTree<T extends Bufferable = Buffer> extends TreeBase<T> imp
|
|
|
31
31
|
treeType: 'append-only',
|
|
32
32
|
...this.hasher.stats(),
|
|
33
33
|
} satisfies TreeInsertionStats);
|
|
34
|
-
|
|
35
|
-
return Promise.resolve();
|
|
36
34
|
}
|
|
37
35
|
|
|
38
36
|
public snapshot(blockNumber: number): Promise<TreeSnapshot<T>> {
|
package/src/tree_base.ts
CHANGED
|
@@ -92,7 +92,7 @@ export abstract class TreeBase<T extends Bufferable> implements MerkleTree<T> {
|
|
|
92
92
|
* @returns The root of the tree.
|
|
93
93
|
*/
|
|
94
94
|
public getRoot(includeUncommitted: boolean): Buffer {
|
|
95
|
-
return !includeUncommitted ? this.root : this.cache[indexToKeyHash(this.name, 0, 0n)] ?? this.root;
|
|
95
|
+
return !includeUncommitted ? this.root : (this.cache[indexToKeyHash(this.name, 0, 0n)] ?? this.root);
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
/**
|
|
@@ -101,7 +101,7 @@ export abstract class TreeBase<T extends Bufferable> implements MerkleTree<T> {
|
|
|
101
101
|
* @returns The number of leaves in the tree.
|
|
102
102
|
*/
|
|
103
103
|
public getNumLeaves(includeUncommitted: boolean) {
|
|
104
|
-
return !includeUncommitted ? this.size : this.cachedSize ?? this.size;
|
|
104
|
+
return !includeUncommitted ? this.size : (this.cachedSize ?? this.size);
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/**
|