Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix MerkleRootMultisigIsm Metadata builder #2831

Merged
merged 3 commits into from
Oct 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,36 +41,43 @@ impl MultisigIsmMetadataBuilder for MerkleRootMultisigMetadataBuilder {
self.highest_known_leaf_index().await,
debug!("Couldn't get highest known leaf index")
);
unwrap_or_none_result!(
leaf_index,
self.get_merkle_leaf_id_by_message_id(message.id())
.await
.context(CTX)?,
debug!(
?message,
"No merkle leaf found for message id, must have not been enqueued in the tree"
)
);
unwrap_or_none_result!(
quorum_checkpoint,
checkpoint_syncer
.fetch_checkpoint_in_range(
validators,
threshold as usize,
message.nonce,
leaf_index,
highest_leaf_index
)
.await
.context(CTX)?,
debug!("Couldn't get checkpoint in range")
debug!(
leaf_index,
highest_leaf_index, "Couldn't get checkpoint in range"
)
);
unwrap_or_none_result!(
proof,
self.get_proof(message.nonce, quorum_checkpoint.checkpoint.checkpoint)
.await
.context(CTX)?
);
unwrap_or_none_result!(
merkle_leaf_id,
self.get_merkle_leaf_id_by_message_id(message.id())
self.get_proof(leaf_index, quorum_checkpoint.checkpoint.checkpoint)
.await
.context(CTX)?,
debug!("Couldn't get merkle proof")
debug!(leaf_index, checkpoint=?quorum_checkpoint, "Couldn't get proof")
);
Ok(Some(MultisigMetadata::new(
quorum_checkpoint.checkpoint.checkpoint,
quorum_checkpoint.signatures,
Some(merkle_leaf_id),
Some(leaf_index),
Some(quorum_checkpoint.checkpoint.message_id),
Some(proof),
)))
Expand Down