Added ATOM (Cosmos Hub) chain support for transaction broadcasting#526
Added ATOM (Cosmos Hub) chain support for transaction broadcasting#526
Conversation
WalkthroughAdds Atom (Cosmos) chain support and related routing/verification, removes a previous IBC provider export, and enhances hex-string handling in Uint8Array validation across SDK components. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
||||||||||||||
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/utilities/validateUint8Array.ts (1)
7-11: Hex string normalization looks correct; consider minor robustness tweaks.The early
"0x"guard cleanly converts hex-encoded payloads to aBuffer, which fits the existing return contract. If you expect slightly messy inputs, you might optionally normalize by trimming whitespace and/or accepting"0X"as well, and (if desired) pre-validating the hex string beforeBuffer.fromto fail with a clearer error.sdk/localsdk/multichain/configs/ibcProviders.ts (1)
3-4: Cosmos IBC endpoints look consistent; watch out for duplicated URLs.The new cosmos mainnet/testnet RPCs are aligned with the
atomchain providers. Since the same URLs now live both here and inchainProviders.atom, consider centralizing them (or at least adding a small comment) so future endpoint changes don’t require touching multiple configs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (5)
sdk/localsdk/multichain/configs/chainProviders.ts(1 hunks)sdk/localsdk/multichain/configs/ibcProviders.ts(1 hunks)src/features/multichain/routines/executors/pay.ts(1 hunks)src/libs/blockchain/gcr/gcr_routines/identityManager.ts(2 hunks)src/utilities/validateUint8Array.ts(1 hunks)
🔇 Additional comments (3)
src/libs/blockchain/gcr/gcr_routines/identityManager.ts (1)
40-51: Atom → IBC mapping and public-key verification path look consistent.Wiring
atomto reuse theIBCchain inchainsand adding it to thepublicKey-based verification branch keeps the identity flow aligned with how other IBC-style chains are handled. Please just confirm that the demosdk IBCverifyMessageimplementation for Atom indeed expects apublicKey(and nottargetAddress) so this branch matches the underlying SDK semantics.Also applies to: 207-213
src/features/multichain/routines/executors/pay.ts (1)
48-56: Routing Atom through the IBC JSON‑RPC path is coherent with the new config.Using
case "atom"to share thegenericJsonRpcPay(multichain.IBC, rpcUrl, operation)path reuses existing IBC logic and the newchainProviders.atomRPCs, and pairs well with the hex‑string normalization invalidateIfUint8Array. Please verify on testnet/mainnet that the demosdk IBC client handles Atom’s signed payload format identically to the existing IBC chain so broadcasts succeed end‑to‑end.Also applies to: 71-74, 135-141
sdk/localsdk/multichain/configs/chainProviders.ts (1)
36-39: Atom chain provider config is aligned with the new pay/IBC wiring.Defining
atomwith Cosmos Hub mainnet/testnet RPCs matches the new non‑EVMatomcase inhandlePayOperationand the cosmos IBC provider settings, so Atom transactions will resolve an RPC URL correctly.
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
src/utilities/validateUint8Array.ts (1)
7-16: Hex string handling is correct; consider a couple of edge‑case tweaksThe validation and guarded
Buffer.fromcall look solid and match the existing “transform only when clearly recognized, otherwise passthrough” pattern. Two minor, optional refinements you may want to consider:
- Decide whether
"0x"(no payload) should really produce an emptyBufferor be treated as invalid and returned unchanged.- If inputs might come from less strict sources, you could also accept uppercase
"0X"(e.g.input.toLowerCase().startsWith("0x")) and/or trim surrounding whitespace before checking the prefix.These are non-blocking; current behavior is safe and consistent with the rest of the utility.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (2)
sdk/localsdk/multichain/configs/ibcProviders.ts(0 hunks)src/utilities/validateUint8Array.ts(1 hunks)
💤 Files with no reviewable changes (1)
- sdk/localsdk/multichain/configs/ibcProviders.ts



PR Type
Enhancement
Description
Added ATOM (Cosmos Hub) chain support for transaction broadcasting
Updated Cosmos chain RPC endpoints with production URLs
Extended pay operation handler to support ATOM chain
Added hex string conversion support in validation utility
Diagram Walkthrough
File Walkthrough
chainProviders.ts
Add ATOM chain RPC provider configurationsdk/localsdk/multichain/configs/chainProviders.ts
https://cosmos-rpc.publicnode.com:443https://rpc.provider-sentry-01.ics-testnet.polypore.xyzibcProviders.ts
Update Cosmos IBC provider endpointssdk/localsdk/multichain/configs/ibcProviders.ts
URL
configuration
pay.ts
Route ATOM transactions through IBC handlersrc/features/multichain/routines/executors/pay.ts
module
identityManager.ts
Map ATOM chain to IBC implementationsrc/libs/blockchain/gcr/gcr_routines/identityManager.ts
registry
validateUint8Array.ts
Add hex string to Buffer conversionsrc/utilities/validateUint8Array.ts
0xprefix and converts to Buffer using hexencoding
Summary by CodeRabbit
New Features
Behavior Changes
Bug Fixes
✏️ Tip: You can customize this high-level summary in your review settings.