Skip to content

Conversation

@VolodymyrBg
Copy link

Replace boolean return type with Result<(), GerVerificationError> in InsertedGER::verify

  • Add GerVerificationError enum with specific error variants:
    • L1InfoRootMismatch: when L1 info root doesn't match proof root
    • MerkleProofVerificationFailed: when Merkle proof verification fails
  • Update verify function to return detailed error information
  • Remove TODO comment as differentiated errors are now implemented
  • Improve code readability by extracting leaf_hash and index variables
  • Add comprehensive documentation for error types
  • Fix usage in bridge/mod.rs to handle new Result return type

This change provides better error handling and debugging capabilities
by giving specific information about what went wrong during GER verification.
The function now returns meaningful error messages instead of just true/false,
making it easier to diagnose issues in production environments.

@VolodymyrBg VolodymyrBg requested a review from a team as a code owner August 4, 2025 12:41
@atanmarko atanmarko removed their request for review August 4, 2025 17:08
Copy link
Contributor

@Ekleog-Polygon Ekleog-Polygon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conceptually this LGTM! Unfortunately we can't accept external contributions yet. We'll come back to you once the process for external contributors is defined.

Also, this is more a matter of implementation, but IMO GerVerificationError, considering it's only used at a single place for now, would deserve being a ZST like pub struct GerVerificationError; :)

Thank you for your PR anyway!

@polykeith polykeith removed their request for review September 19, 2025 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants