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

Commit e619e4d

Browse files
authored
[account compression] add height: 6-9 @ buffer: 16, height: 10-13 @ buffer: 32 (#5438)
1 parent fe2c82d commit e619e4d

File tree

4 files changed

+122
-24
lines changed

4 files changed

+122
-24
lines changed

account-compression/Cargo.lock

Lines changed: 90 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ macro_rules! _merkle_tree_apply_fn {
5959
match ($header.get_max_depth(), $header.get_max_buffer_size()) {
6060
(3, 8) => _merkle_tree_depth_size_apply_fn!(3, 8, $($arg)*),
6161
(5, 8) => _merkle_tree_depth_size_apply_fn!(5, 8, $($arg)*),
62+
(6, 16) => _merkle_tree_depth_size_apply_fn!(6, 16, $($arg)*),
63+
(7, 16) => _merkle_tree_depth_size_apply_fn!(7, 16, $($arg)*),
64+
(8, 16) => _merkle_tree_depth_size_apply_fn!(8, 16, $($arg)*),
65+
(9, 16) => _merkle_tree_depth_size_apply_fn!(9, 16, $($arg)*),
66+
(10, 32) => _merkle_tree_depth_size_apply_fn!(10, 32, $($arg)*),
67+
(11, 32) => _merkle_tree_depth_size_apply_fn!(11, 32, $($arg)*),
68+
(12, 32) => _merkle_tree_depth_size_apply_fn!(12, 32, $($arg)*),
69+
(13, 32) => _merkle_tree_depth_size_apply_fn!(13, 32, $($arg)*),
6270
(14, 64) => _merkle_tree_depth_size_apply_fn!(14, 64, $($arg)*),
6371
(14, 256) => _merkle_tree_depth_size_apply_fn!(14, 256, $($arg)*),
6472
(14, 1024) => _merkle_tree_depth_size_apply_fn!(14, 1024, $($arg)*),

account-compression/programs/account-compression/src/state/concurrent_merkle_tree_header.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ pub fn merkle_tree_get_size(header: &ConcurrentMerkleTreeHeader) -> Result<usize
162162
match (header.get_max_depth(), header.get_max_buffer_size()) {
163163
(3, 8) => Ok(size_of::<ConcurrentMerkleTree<3, 8>>()),
164164
(5, 8) => Ok(size_of::<ConcurrentMerkleTree<5, 8>>()),
165+
(6, 16) => Ok(size_of::<ConcurrentMerkleTree<6, 16>>()),
166+
(7, 16) => Ok(size_of::<ConcurrentMerkleTree<7, 16>>()),
167+
(8, 16) => Ok(size_of::<ConcurrentMerkleTree<8, 16>>()),
168+
(9, 16) => Ok(size_of::<ConcurrentMerkleTree<9, 16>>()),
169+
(10, 32)=> Ok(size_of::<ConcurrentMerkleTree<10, 32>>()),
170+
(11, 32)=> Ok(size_of::<ConcurrentMerkleTree<11, 32>>()),
171+
(12, 32)=> Ok(size_of::<ConcurrentMerkleTree<12, 32>>()),
172+
(13, 32)=> Ok(size_of::<ConcurrentMerkleTree<13, 32>>()),
165173
(14, 64) => Ok(size_of::<ConcurrentMerkleTree<14, 64>>()),
166174
(14, 256) => Ok(size_of::<ConcurrentMerkleTree<14, 256>>()),
167175
(14, 1024) => Ok(size_of::<ConcurrentMerkleTree<14, 1024>>()),

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ export type DepthSizePair = {
1616
const allPairs: number[][] = [
1717
[3, 8],
1818
[5, 8],
19+
[6, 16],
20+
[7, 16],
21+
[8, 16],
22+
[9, 16],
23+
[10, 32],
24+
[11, 32],
25+
[12, 32],
26+
[13, 32],
1927
[14, 64],
2028
[14, 256],
2129
[14, 1024],
@@ -55,6 +63,14 @@ export const ALL_DEPTH_SIZE_PAIRS: ValidDepthSizePair[] = allPairs.map(pair => {
5563
export type ValidDepthSizePair =
5664
| { maxDepth: 3; maxBufferSize: 8 }
5765
| { maxDepth: 5; maxBufferSize: 8 }
66+
| { maxDepth: 6; maxBufferSize: 16 }
67+
| { maxDepth: 7; maxBufferSize: 16 }
68+
| { maxDepth: 8; maxBufferSize: 16 }
69+
| { maxDepth: 9; maxBufferSize: 16 }
70+
| { maxDepth: 10; maxBufferSize: 32 }
71+
| { maxDepth: 11; maxBufferSize: 32 }
72+
| { maxDepth: 12; maxBufferSize: 32 }
73+
| { maxDepth: 13; maxBufferSize: 32 }
5874
| { maxDepth: 14; maxBufferSize: 64 }
5975
| { maxDepth: 14; maxBufferSize: 256 }
6076
| { maxDepth: 14; maxBufferSize: 1024 }

0 commit comments

Comments
 (0)