Skip to content

Commit

Permalink
don't revert on mismatch
Browse files Browse the repository at this point in the history
  • Loading branch information
aroralanuk committed Nov 7, 2023
1 parent 46873ab commit be099d0
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions rust/agents/relayer/src/msg/metadata/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,14 @@ impl BaseMetadataBuilder {
.get_proof(leaf_index, checkpoint.index)
.context(CTX)?;

if proof.root() == checkpoint.root {
Ok(proof)
} else {
if proof.root() != checkpoint.root {
info!(
?checkpoint,
canonical_root = ?proof.root(),
"Could not fetch metadata: checkpoint root does not match canonical root from merkle proof"
);
Err(MerkleTreeBuilderError::MismatchedRoots {
prover_root: proof.root(),
incremental_root: checkpoint.root,
}
.into())
}
Ok(proof)
}

pub async fn highest_known_leaf_index(&self) -> Option<u32> {
Expand Down

0 comments on commit be099d0

Please sign in to comment.