feat: upgrade hyperlane packages to v23 - #265
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
📝 WalkthroughWalkthroughThis PR updates Hyperlane SDK dependencies to version 23.0.0, adds webpack configuration to disable ProvableHQ modules during server builds, enables async WebAssembly support in Next.js, and extends address hash formatting to support Aleo protocol alongside improved CosmosNative handling. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@src/utils/addresses.ts`:
- Around line 21-22: The switch case is using the comma operator so only
ProtocolType.CosmosNative is matched; change the single case expression to two
fall-through case labels: add a separate case for ProtocolType.Cosmos followed
by case ProtocolType.CosmosNative, then return strip0x(hash) (identify the
switch handling ProtocolType and the strip0x call in src/utils/addresses.ts to
locate the lines to update). Ensure both ProtocolType.Cosmos and
ProtocolType.CosmosNative reach the same return branch.
🧹 Nitpick comments (3)
src/utils/addresses.ts (2)
23-25: Aleo formatting looks reasonable, though the comment could use some clarification.Reusing
hexToRadixCustomPrefixfor Aleo since they both use bech32m makes sense for now. Once the dedicated Aleo utility lands in@hyperlane-xyz/utils, you'll want to swap it out.Consider adding a TODO or tracking issue so this doesn't get lost in the swamp:
📝 Suggested improvement
case ProtocolType.Aleo: - // radix and aleo use both bech32m, we use this method until the aleo one is released + // TODO: Replace with dedicated Aleo utility when available in `@hyperlane-xyz/utils` + // Using Radix bech32m helper as both protocols share the same encoding return hexToRadixCustomPrefix(hash, 'txid', 'at');
15-28: Consider adding test coverage for formatTxHash changes.You're addin' new protocol cases and changing existing behavior. Would be good to have some tests to make sure things don't go sideways later. As per coding guidelines, new utility functions in
src/utils/should have.test.tsfiles.next.config.js (1)
64-69: Disabling ProvableHQ modules for SSR is a smart move.These WASM-dependent modules would cause all sorts of trouble during server-side rendering. Aliasing them to
falsekeeps the build from blowin' up.One small thing - you could merge this with the existing alias block above instead of spreadin' it twice:
♻️ Consolidate alias assignments
if (isServer) { // Replace pino with a mock module to avoid SSR errors with pino-pretty transport config.resolve.alias = { ...config.resolve.alias, pino: require.resolve('./src/utils/pino-noop.js'), - }; - - config.resolve.alias = { - ...config.resolve.alias, '@provablehq/wasm': false, '@provablehq/sdk': false, }; }
| case (ProtocolType.Cosmos, ProtocolType.CosmosNative): | ||
| return strip0x(hash); |
There was a problem hiding this comment.
This ain't gonna work the way you think it will - comma operator bug.
The syntax case (ProtocolType.Cosmos, ProtocolType.CosmosNative): uses JavaScript's comma operator, which evaluates to only the last value. This means ProtocolType.Cosmos is completely ignored and only ProtocolType.CosmosNative will match. Cosmos transactions will fall through to the default case and won't get strip0x applied.
🐛 Fix: Use fall-through case syntax
- case (ProtocolType.Cosmos, ProtocolType.CosmosNative):
+ case ProtocolType.Cosmos:
+ case ProtocolType.CosmosNative:
return strip0x(hash);📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| case (ProtocolType.Cosmos, ProtocolType.CosmosNative): | |
| return strip0x(hash); | |
| case ProtocolType.Cosmos: | |
| case ProtocolType.CosmosNative: | |
| return strip0x(hash); |
🤖 Prompt for AI Agents
In `@src/utils/addresses.ts` around lines 21 - 22, The switch case is using the
comma operator so only ProtocolType.CosmosNative is matched; change the single
case expression to two fall-through case labels: add a separate case for
ProtocolType.Cosmos followed by case ProtocolType.CosmosNative, then return
strip0x(hash) (identify the switch handling ProtocolType and the strip0x call in
src/utils/addresses.ts to locate the lines to update). Ensure both
ProtocolType.Cosmos and ProtocolType.CosmosNative reach the same return branch.
|
closing in favor of #276 |
This PR upgrades the hyperlane packages to the latest version and fixes a bug where aleo tx hashes are displayed in the wrong format
Summary by CodeRabbit
Release Notes
New Features
Chores