Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit bf14dc3

Browse files
authored
Add more depth size pairs (#3972)
1 parent 9853e0a commit bf14dc3

File tree

5 files changed

+25
-5
lines changed

5 files changed

+25
-5
lines changed

account-compression/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

account-compression/programs/account-compression/src/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ fn merkle_tree_get_size(header: &ConcurrentMerkleTreeHeader) -> Result<usize> {
153153
(14, 256) => Ok(size_of::<ConcurrentMerkleTree<14, 256>>()),
154154
(14, 1024) => Ok(size_of::<ConcurrentMerkleTree<14, 1024>>()),
155155
(14, 2048) => Ok(size_of::<ConcurrentMerkleTree<14, 2048>>()),
156+
(15, 64) => Ok(size_of::<ConcurrentMerkleTree<15, 64>>()),
157+
(16, 64) => Ok(size_of::<ConcurrentMerkleTree<16, 64>>()),
158+
(17, 64) => Ok(size_of::<ConcurrentMerkleTree<17, 64>>()),
159+
(18, 64) => Ok(size_of::<ConcurrentMerkleTree<18, 64>>()),
160+
(19, 64) => Ok(size_of::<ConcurrentMerkleTree<19, 64>>()),
156161
(20, 64) => Ok(size_of::<ConcurrentMerkleTree<20, 64>>()),
157162
(20, 256) => Ok(size_of::<ConcurrentMerkleTree<20, 256>>()),
158163
(20, 1024) => Ok(size_of::<ConcurrentMerkleTree<20, 1024>>()),
@@ -192,6 +197,11 @@ macro_rules! merkle_tree_apply_fn {
192197
(14, 256) => merkle_tree_depth_size_apply_fn!(14, 256, $id, $bytes, $func, $($arg)*),
193198
(14, 1024) => merkle_tree_depth_size_apply_fn!(14, 1024, $id, $bytes, $func, $($arg)*),
194199
(14, 2048) => merkle_tree_depth_size_apply_fn!(14, 2048, $id, $bytes, $func, $($arg)*),
200+
(15, 64) => merkle_tree_depth_size_apply_fn!(15, 64, $id, $bytes, $func, $($arg)*),
201+
(16, 64) => merkle_tree_depth_size_apply_fn!(16, 64, $id, $bytes, $func, $($arg)*),
202+
(17, 64) => merkle_tree_depth_size_apply_fn!(17, 64, $id, $bytes, $func, $($arg)*),
203+
(18, 64) => merkle_tree_depth_size_apply_fn!(18, 64, $id, $bytes, $func, $($arg)*),
204+
(19, 64) => merkle_tree_depth_size_apply_fn!(19, 64, $id, $bytes, $func, $($arg)*),
195205
(20, 64) => merkle_tree_depth_size_apply_fn!(20, 64, $id, $bytes, $func, $($arg)*),
196206
(20, 256) => merkle_tree_depth_size_apply_fn!(20, 256, $id, $bytes, $func, $($arg)*),
197207
(20, 1024) => merkle_tree_depth_size_apply_fn!(20, 1024, $id, $bytes, $func, $($arg)*),

account-compression/sdk/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
"import": "./dist/esm/index.js",
3131
"types": "./dist/types/index.d.ts"
3232
},
33-
"./idl/spl_account_compression.json": "./idl/spl_account_compression.json",
34-
"./src/merkle-tree": "./src/merkle-tree/index.ts"
33+
"./idl/spl_account_compression.json": "./idl/spl_account_compression.json"
3534
},
3635
"scripts": {
3736
"build": "rm -rf dist/ && tsc && tsc -p tsconfig.cjs.json",

account-compression/sdk/src/constants/index.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { PublicKey } from '@solana/web3.js';
1+
import { PublicKey } from "@solana/web3.js";
22

3-
export const SPL_NOOP_ADDRESS = 'noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV';
3+
export const SPL_NOOP_ADDRESS = "noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV";
44
export const SPL_NOOP_PROGRAM_ID = new PublicKey(SPL_NOOP_ADDRESS);
55

66
/**
@@ -20,6 +20,11 @@ const allPairs: number[][] = [
2020
[14, 256],
2121
[14, 1024],
2222
[14, 2048],
23+
[15, 64],
24+
[16, 64],
25+
[17, 64],
26+
[18, 64],
27+
[19, 64],
2328
[20, 64],
2429
[20, 256],
2530
[20, 1024],
@@ -56,6 +61,11 @@ export type ValidDepthSizePair =
5661
| { maxDepth: 14; maxBufferSize: 256 }
5762
| { maxDepth: 14; maxBufferSize: 1024 }
5863
| { maxDepth: 14; maxBufferSize: 2048 }
64+
| { maxDepth: 15; maxBufferSize: 64 }
65+
| { maxDepth: 16; maxBufferSize: 64 }
66+
| { maxDepth: 17; maxBufferSize: 64 }
67+
| { maxDepth: 18; maxBufferSize: 64 }
68+
| { maxDepth: 19; maxBufferSize: 64 }
5969
| { maxDepth: 20; maxBufferSize: 64 }
6070
| { maxDepth: 20; maxBufferSize: 256 }
6171
| { maxDepth: 20; maxBufferSize: 1024 }

account-compression/sdk/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ export * from './accounts';
88
export * from './events';
99
export * from './constants';
1010
export * from './types';
11+
export * from './merkle-tree';
1112
export type { ChangeLogEventV1 } from './types';

0 commit comments

Comments
 (0)