diff --git a/src/task_monitor/tasks/process_identities.rs b/src/task_monitor/tasks/process_identities.rs index e35493d9..cb5d3f39 100644 --- a/src/task_monitor/tasks/process_identities.rs +++ b/src/task_monitor/tasks/process_identities.rs @@ -242,11 +242,23 @@ pub async fn insert_identities( .leaf_index; for update in &updates[1..] { - assert_eq!( - last_index + 1, - update.update.leaf_index, - "Identities are not consecutive leaves in the tree." - ); + if last_index + 1 != update.update.leaf_index { + let leaf_indexes = updates + .iter() + .map(|update| update.update.leaf_index) + .collect::>(); + let commitments = updates + .iter() + .map(|update| update.update.element) + .collect::>(); + + panic!( + "Identities are not consecutive leaves in the tree (leaf_indexes = {:?}, \ + commitments = {:?})", + leaf_indexes, commitments + ); + } + last_index = update.update.leaf_index; }