Repository: LNP-BP/client_side_validation (language: rust)

Issue:
broken MerkleBlock conceal procedure
Executing rgb-lib tests we found an issue that sometimes happens and seems very similar to https://github.com/RGB-WG/rgb-node/issues/208, but I'm not sure it's the same.

The error we receive is `MerkleBlock conceal procedure is broken` and comes from `~/.cargo/git/checkouts/client_side_validation-8dff74d720902144/46cb8a7/commit_verify/src/mpc/block.rs:418:21`.

@dr-orlovsky could you please investigate this?



Discussion / hints:
No, this appears to be an issue unrelated to the original one. Investigating its possible source. Can you pls provide me with the source data with which you are getting this panic?
Here's the `stock.dat` file for a wallet that encounters the issue while calling `.transfer(contract_id, beneficiaries)` on the `Runtime` (in a regtest environment).

[stock.dat.zip](https://github.com/LNP-BP/client_side_validation/files/11600945/stock.dat.zip)


Fix patch:
diff --git a/commit_verify/src/mpc/tree.rs b/commit_verify/src/mpc/tree.rs
index c6b51b28..97de7643 100644
--- a/commit_verify/src/mpc/tree.rs
+++ b/commit_verify/src/mpc/tree.rs
@@ -123,6 +123,7 @@ mod commit {
 
             let mut depth = source.min_depth;
             loop {
+                map.clear();
                 let width = 2usize.pow(depth.to_u8() as u32) as u16;
                 if source.messages.iter().all(|(protocol, message)| {
                     let pos = protocol_id_pos(*protocol, width);


Test patch: