Skip to content

fix(infra): add aleo-sdk to service Dockerfiles and update post-bundle scripts#7730

Merged
paulbalaji merged 1 commit intomainfrom
pb/fix-aleo-sdk-dockerfiles
Jan 9, 2026
Merged

fix(infra): add aleo-sdk to service Dockerfiles and update post-bundle scripts#7730
paulbalaji merged 1 commit intomainfrom
pb/fix-aleo-sdk-dockerfiles

Conversation

@paulbalaji
Copy link
Collaborator

@paulbalaji paulbalaji commented Jan 9, 2026

Summary

  • Added aleo-sdk package.json and source copy to ccip-server, rebalancer, and warp-monitor Dockerfiles
  • Updated rebalancer and warp-monitor ncc.post-bundle.mjs with WASM init patching from CLI (as discussed in feat: aleo cli support #7522)

Context

The deploy-sdk now depends on @hyperlane-xyz/aleo-sdk after #7522, which broke Docker builds for services that depend on deploy-sdk (ccip-server, rebalancer, warp-monitor).

The ncc post-bundle scripts were also updated to include WASM compatibility patches for Aleo and any future WASM-based packages, as discussed in #7522 (comment).

Changes

  1. Dockerfiles: Added aleo-sdk to the COPY commands for:

    • typescript/ccip-server/Dockerfile
    • typescript/rebalancer/Dockerfile
    • typescript/warp-monitor/Dockerfile
  2. Post-bundle scripts: Updated to match CLI's patching logic:

    • typescript/rebalancer/scripts/ncc.post-bundle.mjs
    • typescript/warp-monitor/scripts/ncc.post-bundle.mjs
    • Patches WASM init to use file:// URLs
    • Patches Worker creation to accept file:// URLs
    • Adds pathToFileURL import

Testing

  • Local pnpm -C typescript/deploy-sdk build passes

Summary by CodeRabbit

  • Chores

    • Integrated aleo-sdk package into Docker builds across multiple services.
  • Bug Fixes

    • Enhanced bundle patching to properly handle WASM module initialization and Worker URL handling with file:// URLs. Added detection to prevent redundant patching.

✏️ Tip: You can customize this high-level summary in your review settings.

…e scripts

- Add aleo-sdk package.json and source copy to ccip-server, rebalancer, and warp-monitor Dockerfiles
- Update rebalancer and warp-monitor ncc.post-bundle.mjs with WASM init patching from CLI

The deploy-sdk now depends on aleo-sdk after #7522, which broke Docker builds for services that depend on deploy-sdk.
@changeset-bot
Copy link

changeset-bot bot commented Jan 9, 2026

⚠️ No Changeset found

Latest commit: 636c976

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@hyper-gonk
Copy link
Contributor

hyper-gonk bot commented Jan 9, 2026

♻️ Rebalancer Docker Image Built Successfully

Image Tags:

gcr.io/abacus-labs-dev/hyperlane-rebalancer:pr-7730
gcr.io/abacus-labs-dev/hyperlane-rebalancer:636c976-20260109-163306

@hyper-gonk
Copy link
Contributor

hyper-gonk bot commented Jan 9, 2026

🕵️ Warp Monitor Docker Image Built Successfully

Image Tags:

gcr.io/abacus-labs-dev/hyperlane-warp-monitor:pr-7730
gcr.io/abacus-labs-dev/hyperlane-warp-monitor:636c976-20260109-163303

@hyper-gonk
Copy link
Contributor

hyper-gonk bot commented Jan 9, 2026

🐳 Monorepo Docker Image Built Successfully

Image Tags:

gcr.io/abacus-labs-dev/hyperlane-monorepo:pr-7730
gcr.io/abacus-labs-dev/hyperlane-monorepo:636c976-20260109-163258

@hyper-gonk
Copy link
Contributor

hyper-gonk bot commented Jan 9, 2026

🔍 CCIP Server Docker Image Built Successfully

Image Tags:

gcr.io/abacus-labs-dev/hyperlane-offchain-lookup-server:pr-7730
gcr.io/abacus-labs-dev/hyperlane-offchain-lookup-server:636c976-20260109-163304

@paulbalaji paulbalaji marked this pull request as ready for review January 9, 2026 16:41
@paulbalaji paulbalaji requested a review from troykessler January 9, 2026 16:42
@paulbalaji paulbalaji added this pull request to the merge queue Jan 9, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 9, 2026

📝 Walkthrough

Walkthrough

This PR weaves the aleo-sdk package into the Docker build pipelines for three TypeScript services (ccip-server, rebalancer, and warp-monitor) by adding it to their Dockerfile copy steps. Additionally, the post-bundle patching scripts for rebalancer and warp-monitor get refactored with improved constants and a renamed patching function that handles WASM and Worker URL initialization using file:// protocol paths.

Changes

Cohort / File(s) Summary
Docker aleo-sdk Integration
typescript/ccip-server/Dockerfile, typescript/rebalancer/Dockerfile, typescript/warp-monitor/Dockerfile
Adds aleo-sdk package.json and directory to the build context for each service's Docker image, ensuring aleo-sdk dependencies are installed and included in the final containers.
Post-bundle Script Refactoring
typescript/rebalancer/scripts/ncc.post-bundle.mjs, typescript/warp-monitor/scripts/ncc.post-bundle.mjs
Renames prepend() function to patchServiceExecutable(), introduces OUTPUT_FILE, SHEBANG, and DIRNAME_SHIM constants. Enhanced patching logic detects if already patched, strips leading shebangs, and applies file:// URL handling to WASM initialization and Worker creation calls.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #7522 — Both PRs integrate aleo-sdk into multiple Dockerfiles and apply identical refactoring changes to the post-bundle scripts across services.
  • #7511 — Adds aleo-sdk/package.json to Dockerfile builds, establishing the foundation for this PR's expanded multi-service integration.
  • #7545 — Modifies the rebalancer post-bundle script that this PR refactors, sharing the same patching workflow changes.

Suggested reviewers

  • Mo-Hussain
  • nambrot
  • xeno097

Poem

Like an ogre with layers, this change runs deep—
aleo-sdk now bundled where services sleep.
Paths remade with file:// URLs so bright,
The bundle gets patched, the code shines right. 🧅✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding aleo-sdk to Dockerfiles and updating post-bundle scripts for WASM compatibility.
Description check ✅ Passed The description covers all required sections with clear summaries, context, specific file changes, and testing confirmation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch pb/fix-aleo-sdk-dockerfiles

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (3)
typescript/warp-monitor/scripts/ncc.post-bundle.mjs (2)

35-45: Consider validating that patches actually matched.

The WASM and Worker patching logic looks correct, but there's no feedback if the regex/replacement didn't find anything. In a bundled environment this is probably fine since the patterns are predictable, but logging what was actually patched would make debugging easier if the bundle structure changes.

Optional: Add logging for patch results
    // Patch WASM init to use file:// URLs
-   content = content.replace(
+   const wasmPatched = content.replace(
      /await __wbg_init\(\{ module_or_path: (module\$\d+) \}\)/g,
      'await __wbg_init({ module_or_path: pathToFileURL($1).href })',
    );
+   if (wasmPatched !== content) {
+     console.log('  → Patched WASM initialization');
+   }
+   content = wasmPatched;

    // Patch Worker creation to accept file:// URLs
-   content = content.replace(
+   const workerPatched = content.replace(
      'const worker = new Worker(url,',
      'const worker = new Worker(pathToFileURL(url),',
    );
+   if (workerPatched !== content) {
+     console.log('  → Patched Worker creation');
+   }
+   content = workerPatched;

42-45: Worker replacement pattern might be too literal.

The string match 'const worker = new Worker(url,' works for the current bundle but could break if the bundler changes variable names or formatting. Since you're already using regex for WASM, a more flexible pattern might be safer for the long haul.

Optional: Use a more flexible regex pattern
-   content = content.replace(
-     'const worker = new Worker(url,',
-     'const worker = new Worker(pathToFileURL(url),',
-   );
+   content = content.replace(
+     /new Worker\(([^,]+),/g,
+     'new Worker(pathToFileURL($1),',
+   );

This pattern matches new Worker(<anything>, and wraps the first argument with pathToFileURL(), making it resilient to variable naming changes.

typescript/rebalancer/scripts/ncc.post-bundle.mjs (1)

9-60: Consistent patching logic across services.

This script is identical to the warp-monitor version, which is good for maintainability. The same optional improvements mentioned for warp-monitor apply here (logging patch results, more flexible Worker regex).

If this pattern gets used in more services, might be worth extracting to a shared utility script, but two instances isn't worth the hassle yet.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e5be290 and 636c976.

📒 Files selected for processing (5)
  • typescript/ccip-server/Dockerfile
  • typescript/rebalancer/Dockerfile
  • typescript/rebalancer/scripts/ncc.post-bundle.mjs
  • typescript/warp-monitor/Dockerfile
  • typescript/warp-monitor/scripts/ncc.post-bundle.mjs
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/mainnet_config.json in future code reviews as requested by paulbalaji.
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/mainnet_config.json:965-965
Timestamp: 2025-08-26T13:46:37.695Z
Learning: In the repository hyperlane-xyz/hyperlane-monorepo, skip reviewing the file rust/main/config/testnet_config.json in future code reviews as requested by paulbalaji.
📚 Learning: 2025-12-18T22:36:13.445Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-18T22:36:13.445Z
Learning: Follow existing naming conventions and code organization in both Solidity and TypeScript

Applied to files:

  • typescript/ccip-server/Dockerfile
  • typescript/warp-monitor/Dockerfile
  • typescript/rebalancer/Dockerfile
📚 Learning: 2025-12-18T22:36:13.445Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-18T22:36:13.445Z
Learning: Applies to typescript/**/*.{ts,tsx} : Import types from `hyperlane-xyz/sdk` when using TypeScript SDK types

Applied to files:

  • typescript/ccip-server/Dockerfile
  • typescript/warp-monitor/Dockerfile
  • typescript/rebalancer/Dockerfile
📚 Learning: 2025-12-22T16:50:19.890Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7565
File: typescript/ccip-server/Dockerfile:10-11
Timestamp: 2025-12-22T16:50:19.890Z
Learning: Standardize Foundry installation in Dockerfiles by using the official curl -L https://foundry.paradigm.xyz | bash followed by foundryup. This pattern is already used across multiple Dockerfiles in the repo and should be retained for consistency and reliability wherever Foundry is installed.

Applied to files:

  • typescript/ccip-server/Dockerfile
  • typescript/warp-monitor/Dockerfile
  • typescript/rebalancer/Dockerfile
🔇 Additional comments (4)
typescript/warp-monitor/scripts/ncc.post-bundle.mjs (1)

9-18: Constants look solid.

The OUTPUT_FILE path construction is correct, and the DIRNAME_SHIM properly imports pathToFileURL which is needed for the patches below.

typescript/ccip-server/Dockerfile (1)

38-38: Clean addition of aleo-sdk to the build.

The package follows the same pattern as the other SDK dependencies (cosmos-sdk, radix-sdk, etc.) with both package.json and source copied at the appropriate stages. Placement is logical and consistent.

Also applies to: 66-66

typescript/warp-monitor/Dockerfile (1)

38-38: Dockerfile changes look proper.

The aleo-sdk is correctly included in both the package.json copy stage and the source copy stage, matching the pattern used for other SDKs. The bundled output from the post-bundle script will include the necessary aleo-sdk dependencies.

Also applies to: 57-57

typescript/rebalancer/Dockerfile (1)

38-38: All three services now include aleo-sdk consistently.

The rebalancer Dockerfile follows the same pattern as ccip-server and warp-monitor. With the updated post-bundle script from earlier in this PR, the aleo-sdk dependency should now be properly included in the bundled output.

Also applies to: 57-57

@codecov
Copy link

codecov bot commented Jan 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.02%. Comparing base (e5be290) to head (636c976).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7730   +/-   ##
=======================================
  Coverage   77.02%   77.02%           
=======================================
  Files         117      117           
  Lines        2651     2651           
  Branches      244      244           
=======================================
  Hits         2042     2042           
  Misses        593      593           
  Partials       16       16           
Components Coverage Δ
core 87.80% <ø> (ø)
hooks 71.86% <ø> (ø)
isms 81.10% <ø> (ø)
token 86.67% <ø> (ø)
middlewares 84.98% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Merged via the queue into main with commit 5a2fc4c Jan 9, 2026
101 checks passed
@paulbalaji paulbalaji deleted the pb/fix-aleo-sdk-dockerfiles branch January 9, 2026 16:53
@github-project-automation github-project-automation bot moved this from In Review to Done in Hyperlane Tasks Jan 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants