Skip to content

Fix/cross chain hash message 293 - #345

Merged
Dev-Zully merged 4 commits into
OdyxeeeLabs:mainfrom
rabsqueen:fix/cross-chain-hash-message-293
Aug 26, 2026
Merged

Fix/cross chain hash message 293#345
Dev-Zully merged 4 commits into
OdyxeeeLabs:mainfrom
rabsqueen:fix/cross-chain-hash-message-293

Conversation

@rabsqueen

@rabsqueen rabsqueen commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes a critical compilation error in cross_chain_verifier caused by two private hash_message implementations with effectively identical logic.

Both implementations generated the cross-chain message hash using the CROSS_CHAIN_MESSAGE_V1 domain prefix and the same message fields, resulting in a duplicate function definition within the contract.

What Changed

🐛 Removed Duplicate Implementation

  • Removed the redundant hash_message function.
  • Retained the cleaner implementation using Bytes::from_slice.
  • Preserved the existing CROSS_CHAIN_MESSAGE_V1 domain separator.
  • Preserved the existing message fields and hashing order.

🔐 Hashing Behaviour Preserved

The retained implementation continues to construct the message hash using the established cross-chain domain:

CROSS_CHAIN_MESSAGE_V1
        +
Cross-chain message fields
        ↓
Deterministic hash

No changes were made to the intended hashing scheme or message format.

Before

impl CrossChainVerifier {
    fn hash_message(...) {
        // Implementation A
    }

    ...

    fn hash_message(...) {
        // Implementation B ❌
    }
}

The duplicate private function caused the contract to fail compilation.

After

impl CrossChainVerifier {
    fn hash_message(...) {
        // Consistent Bytes::from_slice implementation
        // CROSS_CHAIN_MESSAGE_V1
        // Same message fields and hashing order
    }
}

A single authoritative implementation now handles cross-chain message hashing.

Validation

Verified that:

  • Only one hash_message implementation remains.
  • The retained implementation consistently uses Bytes::from_slice.
  • CROSS_CHAIN_MESSAGE_V1 remains unchanged.
  • Message fields and hashing order are preserved.
  • Existing signature verification compatibility is maintained.
  • The contract compiles successfully.

Acceptance Criteria

  • Remove one of the duplicate hash_message implementations.
  • Retain the cleaner Bytes::from_slice implementation.
  • Preserve CROSS_CHAIN_MESSAGE_V1.
  • Preserve the existing message hashing logic.
  • Restore successful contract compilation.

Result

cross_chain_verifier now contains a single, consistent hash_message implementation, eliminating the critical build failure while preserving the established cross-chain message hashing scheme.

Closes #292
Closes #293
Closes #295
Closes #294

@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@rabsqueen Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Dev-Zully
Dev-Zully merged commit ee4c9ef into OdyxeeeLabs:main Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment