Skip to content

Commit b0f456f

Browse files
authored
chore: bump versions, add batched Merkle tree placeholder bytes (#1767)
* chore: bump light-batched-merkle-tree -> 0.2.0, light-merkle-tree-metadata -> 0.2.0, light-concurrent-merkle-tree -> 2.0.0, light-merkle-tree-reference 2.0.0 * chore: add batched-merkle-tree placeholder bytes * regenerate accounts * fix: make concurrent mt *mut fields private * chore: bump light-hash-set version -> 2.0.0 * bump: light-bloom-filter version -> 0.2.0 * fix: light-test-utils usage of concurrent-merkle-tree * chore: bump concurrent-merkle-tree version -> 2.0.1 * chore: bump light-indexed-merkle-tree version -> 2.0.0
1 parent 7d536af commit b0f456f

23 files changed

+65
-58
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ ark-std = "0.5"
139139

140140

141141
# Light Protocol
142-
light-hash-set = { version = "1.2.0", path = "program-libs/hash-set" }
143-
light-indexed-merkle-tree = { version = "1.1.0", path = "program-libs/indexed-merkle-tree" }
144-
light-concurrent-merkle-tree = { version = "1.1.0", path = "program-libs/concurrent-merkle-tree" }
142+
light-hash-set = { version = "2.0.0", path = "program-libs/hash-set" }
143+
light-indexed-merkle-tree = { version = "2.0.0", path = "program-libs/indexed-merkle-tree" }
144+
light-concurrent-merkle-tree = { version = "2.0.1", path = "program-libs/concurrent-merkle-tree" }
145145
light-client = { path = "sdk-libs/client", version = "0.9.1" }
146146
light-hasher = { path = "program-libs/hasher", version = "3.0.0" }
147147
light-macros = { path = "program-libs/macros", version = "2.0.0" }
148-
light-merkle-tree-reference = { path = "program-tests/merkle-tree", version = "1.1.0" }
148+
light-merkle-tree-reference = { path = "program-tests/merkle-tree", version = "2.0.0" }
149149
light-heap = { path = "program-libs/heap", version = "1.1.0" }
150150
light-prover-client = { path = "prover/client", version = "1.3.0" }
151151
light-sdk = { path = "sdk-libs/sdk", version = "0.12.0" }
@@ -172,11 +172,11 @@ create-address-test-program = { path = "program-tests/create-address-test-progra
172172
"cpi",
173173
] }
174174
light-program-test = { path = "sdk-libs/program-test", version = "0.1.0" }
175-
light-batched-merkle-tree = { path = "program-libs/batched-merkle-tree", version = "0.1.0" }
176-
light-merkle-tree-metadata = { path = "program-libs/merkle-tree-metadata", version = "0.1.0" }
175+
light-batched-merkle-tree = { path = "program-libs/batched-merkle-tree", version = "0.2.0" }
176+
light-merkle-tree-metadata = { path = "program-libs/merkle-tree-metadata", version = "0.2.0" }
177177
aligned-sized = { path = "program-libs/aligned-sized", version = "1.1.0" }
178-
light-bloom-filter = { path = "program-libs/bloom-filter", version = "0.1.0" }
179-
light-bounded-vec = { version = "1.1.0", git = "https://github.com/lightprotocol/program-libs", rev = "f5aa99e4617672bab00073377a2db92e42610a73" }
178+
light-bloom-filter = { path = "program-libs/bloom-filter", version = "0.2.0" }
179+
light-bounded-vec = { version = "2.0.0" }
180180
light-poseidon = { version = "0.3.0" }
181181
light-test-utils = { path = "program-tests/utils", version = "1.2.1" }
182182
light-indexed-array = { path = "program-libs/indexed-array", version = "0.1.0" }

cli/accounts/address_merkle_tree_amt1Ayt45jfbdw5YSo7iz6WZxUmnZsQTYXy82hVwyC2.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

cli/accounts/batch_address_merkle_tree_EzKE84aVTkCUhDHLELqyJaq1Y7UVVmqxXqZjVHwHY3rK.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

cli/accounts/batch_state_merkle_tree_HLKs5NJ8FXkJg8BrzJt56adFYYuwg5etzDtBbQYTsixu.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"pubkey":"32tgQWfaASE7SfTQvMaSJDrqe728tJQ2SGzxtDDrpDwS","account":{"lamports":1392000,"data":["D88EoH8mjqIQpl591jkE+Dg60Dze4Hi5FNhzGIA7FTWAcNeS4Fz950vfSocYeLHitXp0BCgI+ALv3zEIJJy2OBeyZp+6b7UE","base64"],"owner":"compr6CUsB5m2jS4Y3831ztGSTnDpnKJTKS95d64XVq","executable":false,"rentEpoch":18446744073709551615,"space":72}}

program-libs/batched-merkle-tree/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "light-batched-merkle-tree"
3-
version = "0.1.0"
3+
version = "0.2.0"
44
description = "Batch Merkle tree implementation."
55
repository = "https://github.com/Lightprotocol/light-protocol"
66
license = "Apache-2.0"
@@ -62,7 +62,7 @@ tokio = { workspace = true }
6262
serial_test = { workspace = true }
6363
light-account-checks = { workspace = true, features = ["test-only"] }
6464
light-compressed-account = { workspace = true, features = ["new-unique"] }
65-
light-test-utils = { workspace = true, features = [ "test-only"]}
65+
light-test-utils = { workspace = true, features = ["test-only"] }
6666

6767
[lints.rust.unexpected_cfgs]
6868
level = "allow"

program-libs/batched-merkle-tree/src/merkle_tree.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ mod test {
11151115
#[test]
11161116
fn test_zero_out() {
11171117
let current_slot = 1;
1118-
let mut account_data = vec![0u8; 3184];
1118+
let mut account_data = vec![0u8; 3312];
11191119
let batch_size = 4;
11201120
let zkp_batch_size = 1;
11211121
let num_zkp_updates = batch_size / zkp_batch_size;
@@ -1503,7 +1503,7 @@ mod test {
15031503

15041504
#[test]
15051505
fn test_check_queue_next_index_reached_tree_capacity() {
1506-
let mut account_data = vec![0u8; 15728];
1506+
let mut account_data = vec![0u8; 15856];
15071507
let batch_size = 200;
15081508
let zkp_batch_size = 1;
15091509
let root_history_len = 10;
@@ -1557,7 +1557,7 @@ mod test {
15571557

15581558
#[test]
15591559
fn test_check_non_inclusion() {
1560-
let mut account_data = vec![0u8; 3248];
1560+
let mut account_data = vec![0u8; 3376];
15611561
let batch_size = 5;
15621562
let zkp_batch_size = 1;
15631563
let root_history_len = 10;
@@ -1657,7 +1657,7 @@ mod test {
16571657

16581658
#[test]
16591659
fn test_tree_is_full() {
1660-
let mut account_data = vec![0u8; 3248];
1660+
let mut account_data = vec![0u8; 3376];
16611661
let batch_size = 5;
16621662
let zkp_batch_size = 1;
16631663
let root_history_len = 10;
@@ -1692,7 +1692,7 @@ mod test {
16921692
}
16931693
#[test]
16941694
fn test_increment_next_index() {
1695-
let mut account_data = vec![0u8; 3248];
1695+
let mut account_data = vec![0u8; 3376];
16961696
let batch_size = 5;
16971697
let zkp_batch_size = 1;
16981698
let root_history_len = 10;
@@ -1730,7 +1730,7 @@ mod test {
17301730

17311731
#[test]
17321732
fn test_get_pubkey_and_associated_queue() {
1733-
let mut account_data = vec![0u8; 3248];
1733+
let mut account_data = vec![0u8; 3376];
17341734
let batch_size = 5;
17351735
let zkp_batch_size = 1;
17361736
let root_history_len = 10;

program-libs/batched-merkle-tree/src/merkle_tree_metadata.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pub struct BatchedMerkleTreeMetadata {
4646
/// + 1 byte padding) Merkle tree pubkey.
4747
pub hashed_pubkey: [u8; 32],
4848
pub nullifier_next_index: u64,
49+
pub placeholder_bytes: [u8; 128],
4950
}
5051

5152
impl Default for BatchedMerkleTreeMetadata {
@@ -68,6 +69,7 @@ impl Default for BatchedMerkleTreeMetadata {
6869
},
6970
hashed_pubkey: [0u8; 32],
7071
nullifier_next_index: 0,
72+
placeholder_bytes: [0u8; 128],
7173
}
7274
}
7375
}
@@ -158,6 +160,7 @@ impl BatchedMerkleTreeMetadata {
158160
capacity: 2u64.pow(height),
159161
hashed_pubkey: hash_to_bn254_field_size_be(&tree_pubkey.to_bytes()),
160162
nullifier_next_index: 0,
163+
placeholder_bytes: [0u8; 128],
161164
}
162165
}
163166
}

program-libs/batched-merkle-tree/tests/rollover_address_tree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ fn test_rnd_rollover() {
283283
/// 6. failing: rollower threshold not set
284284
#[test]
285285
fn test_batched_tree_is_ready_for_rollover() {
286-
let mut account_data = vec![0u8; 6128];
286+
let mut account_data = vec![0u8; 6256];
287287
let batch_size = 50;
288288
let zkp_batch_size = 1;
289289
let root_history_len = 10;

0 commit comments

Comments
 (0)