Skip to content

ICA forwarding prototype#328

Draft
Manav-Aggarwal wants to merge 1 commit intomainfrom
manav/prototype-ica
Draft

ICA forwarding prototype#328
Manav-Aggarwal wants to merge 1 commit intomainfrom
manav/prototype-ica

Conversation

@Manav-Aggarwal
Copy link
Copy Markdown
Member

@Manav-Aggarwal Manav-Aggarwal commented Dec 17, 2025

Overview


Note

Vendors noble-curves and noble-hashes into the SDK, adding elliptic curves, hashes, and KDFs for cryptographic operations.

  • SDK:
    • Add @noble/curves sources (secp256k1, p256/p384/p521, ed25519/ed448, bls12-381, bn254, misc) and core abstractions (weierstrass/edwards, tower fields).
    • Add @noble/hashes sources (sha2/sha3, blake1/2/3, hmac, hkdf, pbkdf2, scrypt, argon2, eskdf) with utils and crypto adapters.
    • Include ESM module configs and supporting files.

Written by Cursor Bugbot for commit 36cc939. This will update automatically on new commits. Configure here.

@mergify
Copy link
Copy Markdown

mergify bot commented Dec 17, 2025

❌ This pull request cannot be evaluated by Mergify

Details

The pull request reports more than 18400 files, reaching the limit of 10000 files.

2 similar comments
@mergify
Copy link
Copy Markdown

mergify bot commented Dec 17, 2025

❌ This pull request cannot be evaluated by Mergify

Details

The pull request reports more than 18400 files, reaching the limit of 10000 files.

@mergify
Copy link
Copy Markdown

mergify bot commented Dec 17, 2025

❌ This pull request cannot be evaluated by Mergify

Details

The pull request reports more than 18400 files, reaching the limit of 10000 files.

@Manav-Aggarwal Manav-Aggarwal marked this pull request as draft December 17, 2025 04:43
@mergify
Copy link
Copy Markdown

mergify bot commented Dec 17, 2025

❌ This pull request cannot be evaluated by Mergify

Details

The pull request reports more than 18400 files, reaching the limit of 10000 files.

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

// We represent this as a bytes32 with zero-padding
bytes32 preimage = keccak256(abi.encodePacked(celestiaICAModule, salt));
// Take last 20 bytes (like Cosmos address derivation)
return preimage;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Address derivation uses wrong hash and no truncation

The _deriveCelestiaAddress function has two issues that would cause cross-chain address mismatches. According to the documentation in IMPLEMENTATION_STATUS.md, the final address derivation should be sha256(addressPreimage)[:20], but the implementation uses keccak256 instead of sha256, and returns the full 32-byte hash without truncating to 20 bytes. The comment even acknowledges this with "Take last 20 bytes" but the code never performs this truncation. This would cause the Solidity-computed forwarding addresses to never match the Cosmos SDK addresses on Celestia, breaking the entire forwarding mechanism.

Fix in Cursor Fix in Web

bytes32 constant CELESTIA_ICA_MODULE = bytes32(uint256(0x696361000000000000000000000000000000000000000000000000000000));

// Celestia ICA router address (Hyperlane ICA router identifier on Celestia)
bytes32 constant CELESTIA_ICA_ROUTER = bytes32(uint256(0x696361726f7574657200000000000000000000000000000000000000000000));
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: Bytes32 conversion causes wrong byte alignment for module identifiers

The bytes32(uint256(...)) conversion pattern used for CELESTIA_ICA_MODULE and CELESTIA_ICA_ROUTER produces incorrectly aligned bytes. When a hex literal shorter than 64 characters is cast through uint256 then to bytes32, the bytes become right-aligned (padded with leading zeros). For example, bytes32(uint256(0x696361...)) with 60 hex chars produces 0x00696361... instead of the expected left-aligned 0x696361...0000. This contrasts with the direct literal assignment in EnrollCelestiaDomain.s.sol. Since these values are passed to CelestiaICAHelper and used in address derivation, this byte shift would cause forwarding addresses to mismatch the Cosmos SDK implementation.

Fix in Cursor Fix in Web

@mergify
Copy link
Copy Markdown

mergify bot commented Dec 17, 2025

❌ This pull request cannot be evaluated by Mergify

Details

The pull request reports more than 18400 files, reaching the limit of 10000 files.

1 similar comment
@mergify
Copy link
Copy Markdown

mergify bot commented Dec 17, 2025

❌ This pull request cannot be evaluated by Mergify

Details

The pull request reports more than 18400 files, reaching the limit of 10000 files.

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.

1 participant