Skip to content

feat: separate rebalancer package#7544

Merged
paulbalaji merged 9 commits intomainfrom
pbio/rebalancer-package-move
Dec 18, 2025
Merged

feat: separate rebalancer package#7544
paulbalaji merged 9 commits intomainfrom
pbio/rebalancer-package-move

Conversation

@paulbalaji
Copy link
Collaborator

@paulbalaji paulbalaji commented Dec 5, 2025

Summary

  • Extract rebalancer logic from CLI into dedicated @hyperlane-xyz/rebalancer package
  • New package supports both manual CLI execution and continuous daemon mode for K8s deployments
  • CLI now imports from new package, maintaining backward compatibility for manual rebalancing

https://www.notion.so/hyperlanexyz/Split-Rebalancer-logic-out-of-CLI-2bd6d35200d680ff8bd9f236833b5d59?source=copy_link

Test plan

  • Build passes
  • Tests pass
  • Tested in infra (replaced an existing rebalancer with this new monorepo image)

Follow-Up (TBD)

#7545

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a dedicated rebalancer package enabling standalone daemon mode for continuous Kubernetes deployments, while maintaining manual CLI execution support.
  • Refactoring

    • Extracted rebalancer logic from CLI into a separate package with a unified service interface for both interactive and continuous operation modes.

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

@changeset-bot
Copy link

changeset-bot bot commented Dec 5, 2025

🦋 Changeset detected

Latest commit: 59a5414

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 20 packages
Name Type
@hyperlane-xyz/rebalancer Minor
@hyperlane-xyz/cli Minor
@hyperlane-xyz/aleo-sdk Minor
@hyperlane-xyz/starknet-core Minor
@hyperlane-xyz/ccip-server Minor
@hyperlane-xyz/cosmos-sdk Minor
@hyperlane-xyz/cosmos-types Minor
@hyperlane-xyz/eslint-config Minor
@hyperlane-xyz/github-proxy Minor
@hyperlane-xyz/helloworld Minor
@hyperlane-xyz/http-registry-server Minor
@hyperlane-xyz/infra Minor
@hyperlane-xyz/radix-sdk Minor
@hyperlane-xyz/sdk Minor
@hyperlane-xyz/tsconfig Minor
@hyperlane-xyz/utils Minor
@hyperlane-xyz/widgets Minor
@hyperlane-xyz/deploy-sdk Patch
@hyperlane-xyz/provider-sdk Patch
@hyperlane-xyz/core Patch

Not sure what this means? Click here to learn what changesets are.

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

@codecov
Copy link

codecov bot commented Dec 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 0.00%. Comparing base (b3027cf) to head (59a5414).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #7544   +/-   ##
============================
============================
Components Coverage Δ
core ∅ <ø> (∅)
hooks ∅ <ø> (∅)
isms ∅ <ø> (∅)
token ∅ <ø> (∅)
middlewares ∅ <ø> (∅)
🚀 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.

@paulbalaji paulbalaji force-pushed the pbio/rebalancer-package-move branch 2 times, most recently from a174445 to a4ca220 Compare December 5, 2025 13:07
@paulbalaji paulbalaji marked this pull request as ready for review December 5, 2025 16:44
@paulbalaji paulbalaji requested review from Mo-Hussain and removed request for yorhodes December 5, 2025 16:45
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Warning

Rate limit exceeded

@paulbalaji has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 24 minutes and 35 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 749c8c214dca9d68d9a354db010f52d75f2db3a5 and 59a5414.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (22)
  • .changeset/separate-rebalancer-package.md (1 hunks)
  • Dockerfile (1 hunks)
  • typescript/cli/package.json (1 hunks)
  • typescript/cli/src/commands/warp.ts (3 hunks)
  • typescript/cli/src/context/strategies/chain/chainResolver.ts (1 hunks)
  • typescript/cli/src/rebalancer/README.md (0 hunks)
  • typescript/cli/src/rebalancer/index.ts (0 hunks)
  • typescript/cli/src/rebalancer/runner.ts (0 hunks)
  • typescript/rebalancer/.gitignore (1 hunks)
  • typescript/rebalancer/.mocharc.json (1 hunks)
  • typescript/rebalancer/README.md (1 hunks)
  • typescript/rebalancer/eslint.config.mjs (1 hunks)
  • typescript/rebalancer/package.json (1 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.test.ts (10 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.ts (1 hunks)
  • typescript/rebalancer/src/core/RebalancerService.ts (1 hunks)
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts (6 hunks)
  • typescript/rebalancer/src/index.ts (1 hunks)
  • typescript/rebalancer/src/interfaces/IMonitor.ts (1 hunks)
  • typescript/rebalancer/src/service.ts (1 hunks)
  • typescript/rebalancer/src/utils/errors.ts (1 hunks)
  • typescript/rebalancer/tsconfig.json (1 hunks)
📝 Walkthrough

Walkthrough

This PR separates the Warp Route rebalancer from the CLI into a dedicated @hyperlane-xyz/rebalancer package. The rebalancer gains support for daemon-mode continuous operation alongside manual CLI execution. The CLI imports rebalancer components from the new package, the old RebalancerRunner is removed, and RebalancerContextFactory is refactored to accept MultiProvider and registry instead of WriteCommandContext.

Changes

Cohort / File(s) Summary
Rebalancer Package Initialization
typescript/rebalancer/package.json, typescript/rebalancer/tsconfig.json, typescript/rebalancer/.gitignore, typescript/rebalancer/.mocharc.json, typescript/rebalancer/eslint.config.mjs, typescript/rebalancer/README.md
New package scaffolding with build configuration, lint rules disabling Node.js-restricted imports, and service documentation.
Rebalancer Core Service
typescript/rebalancer/src/core/RebalancerService.ts, typescript/rebalancer/src/service.ts
New RebalancerService class orchestrating manual and daemon-mode rebalancing; service.ts entry point reads env vars, initializes providers/registry, and starts the service.
Rebalancer Configuration & Exports
typescript/rebalancer/src/config/RebalancerConfig.ts, typescript/rebalancer/src/index.ts, typescript/rebalancer/src/utils/errors.ts, typescript/rebalancer/src/interfaces/IMonitor.ts
Config import paths updated to use @hyperlane-xyz/utils; central index.ts establishes public API; new WrappedError utility; monitor interface import adjusted.
Rebalancer Factory Refactoring
typescript/rebalancer/src/factories/RebalancerContextFactory.ts
Constructor and static factory signatures updated to accept MultiProvider, MultiProtocolProvider, and registry directly instead of WriteCommandContext.
CLI Integration
typescript/cli/package.json, typescript/cli/src/commands/warp.ts, typescript/cli/src/context/strategies/chain/chainResolver.ts
CLI adds rebalancer workspace dependency; warp.ts imports RebalancerService and RebalancerConfig from new package with mode-driven execution; chainResolver import path updated.
CLI Rebalancer Cleanup
typescript/cli/src/rebalancer/index.ts, typescript/cli/src/rebalancer/runner.ts, typescript/cli/src/rebalancer/README.md
RebalancerRunner class and related interfaces removed; index.ts exports removed; README deleted.
Build Configuration
Dockerfile, .changeset/separate-rebalancer-package.md
Docker build includes rebalancer package.json; changeset documents extraction and CLI version bump.
Tests
typescript/rebalancer/src/config/RebalancerConfig.test.ts
Test config path moved to temp directory; import sources updated to use @hyperlane-xyz/utils/fs.

Sequence Diagram

sequenceDiagram
    participant Service as RebalancerService
    participant Factory as RebalancerContextFactory
    participant Monitor as Monitor
    participant Strategy as Strategy
    participant Rebalancer as Rebalancer

    alt Manual Mode
        Service->>Factory: initialize(config, providers, registry)
        Factory-->>Service: Monitor, Strategy, Rebalancer
        Service->>Service: executeManual(request)
        Service->>Strategy: getRebalancingRoutes()
        Strategy-->>Service: routes
        Service->>Rebalancer: rebalance(routes)
        Rebalancer-->>Service: success
        Service->>Service: log & metrics
    else Daemon Mode
        Service->>Factory: initialize(config, providers, registry)
        Factory-->>Service: Monitor, Strategy, Rebalancer
        Service->>Monitor: start()
        loop On Token Info Events
            Monitor->>Service: onTokenInfo(event)
            Service->>Strategy: getRebalancingRoutes()
            Strategy-->>Service: routes
            Service->>Rebalancer: rebalance(routes)
            Rebalancer-->>Service: result
            Service->>Service: update metrics
        end
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

  • RebalancerService implementation: New orchestration logic with manual/daemon execution paths and event-driven monitor integration requires careful review of initialization, execution flow, and error handling.
  • RebalancerContextFactory refactoring: Signature changes from WriteCommandContext to MultiProvider/registry parameters; verify all internal accessors correctly use new properties.
  • CLI warp.ts integration: Ensures mode detection, config loading, and service instantiation properly wire environment variables and logging.
  • Import path consolidation: Verify all rebalancer imports throughout CLI correctly reference new package; no dangling references to deleted runner.ts.
  • Package exports from index.ts: Large set of re-exports establishes public API surface; confirm all expected types/classes are included and nothing unnecessary is exposed.

Possibly related PRs

Suggested reviewers

  • antigremlin
  • ltyu
  • yorhodes

🌿 A rebalancer sprouts free,
From CLI's embrace it breaks,
Now daemon-bound it wakes—
Daemon dreams, where layers agree. 🧅

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 3.70% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Title clearly describes the main change: extracting rebalancer logic into a separate package, which is the primary objective of this PR.
Description check ✅ Passed Description covers the main changes, test plan validation, and references related work, though some template sections like 'Drive-by changes' and 'Backward compatibility' are not explicitly addressed.

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: 2

🧹 Nitpick comments (7)
typescript/cli/package.json (1)

18-18: Consider using workspace protocol for the rebalancer dependency.

The other internal Hyperlane packages in this file use versions like "19.11.0" or "workspace:^". Since @hyperlane-xyz/rebalancer is a new internal package in the monorepo, you might want to use "workspace:*" instead of "0.0.0" for consistency with how monorepo dependencies are typically managed. This'll make it clearer that it's a workspace package.

-    "@hyperlane-xyz/rebalancer": "0.0.0",
+    "@hyperlane-xyz/rebalancer": "workspace:*",
typescript/cli/src/commands/warp.ts (1)

532-538: This validation is like putting a lock on a door that's already locked, if you catch my drift.

The yargs config at lines 471-491 already uses implies to enforce that origin, destination, and amount are required when manual is set. This runtime check is redundant. That said, it provides a clearer error message, so it's not harmful — just a wee bit of belt-and-suspenders.

typescript/rebalancer/src/service.ts (2)

61-63: Consider validating the parsed CHECK_FREQUENCY value, friend.

If someone passes a non-numeric value like CHECK_FREQUENCY=banana, parseInt will return NaN, and that'll cause all sorts of mischief down in the swamp. A simple check would save ye some headaches later.

   const checkFrequency = process.env.CHECK_FREQUENCY
     ? parseInt(process.env.CHECK_FREQUENCY, 10)
     : 60_000;
+
+  if (isNaN(checkFrequency) || checkFrequency <= 0) {
+    rootLogger.error('CHECK_FREQUENCY must be a positive number');
+    process.exit(1);
+  }

105-108: Private key validation before Wallet creation would be wise.

Right now, if HYP_KEY contains malformed data (not a valid private key), the Wallet constructor will throw an opaque error. Might be worth catching that specifically and giving a more helpful message about what went wrong in the key formatting.

     // Create MultiProvider with signer
     const multiProvider = new MultiProvider(chainMetadata);
-    const signer = new Wallet(privateKey);
+    let signer: Wallet;
+    try {
+      signer = new Wallet(privateKey);
+    } catch (error) {
+      logger.error({ error }, 'Invalid HYP_KEY: must be a valid private key');
+      process.exit(1);
+    }
     multiProvider.setSharedSigner(signer);
     logger.info('✅ Initialized MultiProvider with signer');
typescript/rebalancer/src/core/RebalancerService.ts (2)

269-271: Careful with removeAllListeners - it's a bit heavy-handed.

Using process.removeAllListeners('SIGINT') and process.removeAllListeners('SIGTERM') will remove ALL listeners for these signals, not just the ones this service registered. If something else in the process also listens for these signals, they'll get removed too.

Consider storing the handler references and removing only those specific listeners:

+  private sigintHandler?: () => void;
+  private sigtermHandler?: () => void;
+
   async start(): Promise<void> {
     // ...
     // Set up signal handlers for graceful shutdown
-    process.on('SIGINT', () => this.gracefulShutdown());
-    process.on('SIGTERM', () => this.gracefulShutdown());
+    this.sigintHandler = () => this.gracefulShutdown();
+    this.sigtermHandler = () => this.gracefulShutdown();
+    process.on('SIGINT', this.sigintHandler);
+    process.on('SIGTERM', this.sigtermHandler);
   }
   
   async gracefulShutdown(): Promise<void> {
     // ...
-    process.removeAllListeners('SIGINT');
-    process.removeAllListeners('SIGTERM');
+    if (this.sigintHandler) process.removeListener('SIGINT', this.sigintHandler);
+    if (this.sigtermHandler) process.removeListener('SIGTERM', this.sigtermHandler);
   }

273-274: Calling process.exit(0) in gracefulShutdown limits reusability.

Calling process.exit(0) directly here means this service can only be used as the main process controller. If someone wanted to embed this in a larger application or test it, they couldn't cleanly shut it down without exiting the whole process. Might want to make this configurable or let the caller handle the exit.

typescript/rebalancer/src/utils/files.ts (1)

1-16: Consider whether this duplicates the CLI's files.ts utility.

Based on the imports, there's already a typescript/cli/src/utils/files.ts with similar functionality. Duplicating utilities across packages can lead to maintenance headaches. Would it make sense to either:

  1. Extract shared utilities to @hyperlane-xyz/utils, or
  2. Import from the CLI package (if that doesn't create circular deps)?
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d5af0db and a4ca220227ddf43dbd82207d860f8249b34b8579.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (26)
  • .changeset/separate-rebalancer-package.md (1 hunks)
  • Dockerfile (1 hunks)
  • typescript/cli/package.json (1 hunks)
  • typescript/cli/src/commands/warp.ts (3 hunks)
  • typescript/cli/src/context/strategies/chain/chainResolver.ts (1 hunks)
  • typescript/cli/src/rebalancer/README.md (0 hunks)
  • typescript/cli/src/rebalancer/config/RebalancerConfig.test.ts (0 hunks)
  • typescript/cli/src/rebalancer/index.ts (0 hunks)
  • typescript/cli/src/rebalancer/runner.ts (0 hunks)
  • typescript/http-registry-server/src/routes/chain.ts (2 hunks)
  • typescript/http-registry-server/src/routes/root.ts (1 hunks)
  • typescript/http-registry-server/src/routes/warp.ts (2 hunks)
  • typescript/rebalancer/.gitignore (1 hunks)
  • typescript/rebalancer/.mocharc.json (1 hunks)
  • typescript/rebalancer/README.md (1 hunks)
  • typescript/rebalancer/eslint.config.mjs (1 hunks)
  • typescript/rebalancer/package.json (1 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.ts (1 hunks)
  • typescript/rebalancer/src/core/RebalancerService.ts (1 hunks)
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts (6 hunks)
  • typescript/rebalancer/src/index.ts (1 hunks)
  • typescript/rebalancer/src/interfaces/IMonitor.ts (1 hunks)
  • typescript/rebalancer/src/service.ts (1 hunks)
  • typescript/rebalancer/src/utils/errors.ts (1 hunks)
  • typescript/rebalancer/src/utils/files.ts (1 hunks)
  • typescript/rebalancer/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (4)
  • typescript/cli/src/rebalancer/index.ts
  • typescript/cli/src/rebalancer/config/RebalancerConfig.test.ts
  • typescript/cli/src/rebalancer/runner.ts
  • typescript/cli/src/rebalancer/README.md
🧰 Additional context used
🧠 Learnings (11)
📚 Learning: 2025-11-24T17:19:38.362Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: Applies to typescript/sdk/src/**/*.ts : Use `ChainMap<T>` for type-safe per-chain configuration mapping in TypeScript SDK

Applied to files:

  • typescript/cli/src/context/strategies/chain/chainResolver.ts
  • typescript/rebalancer/tsconfig.json
  • typescript/http-registry-server/src/routes/chain.ts
  • typescript/rebalancer/.mocharc.json
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-10-21T14:26:22.163Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7223
File: typescript/infra/src/config/chain.ts:56-58
Timestamp: 2025-10-21T14:26:22.163Z
Learning: When adding chains to chainsToSkip in typescript/infra/src/config/chain.ts, it's the expected pattern to keep the chain's configurations in other files like supportedChainNames.ts, agent.ts, validators.ts, and owners.ts. The chainsToSkip array is used selectively by specific scripts (e.g., check-owner-ica.ts) to exclude chains from certain operations, not as a signal to remove all configurations.

Applied to files:

  • typescript/cli/src/context/strategies/chain/chainResolver.ts
📚 Learning: 2025-07-14T23:18:11.350Z
Learnt from: ltyu
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6715
File: typescript/cli/src/deploy/warp.ts:941-948
Timestamp: 2025-07-14T23:18:11.350Z
Learning: In the Hyperlane CLI warp.ts file, casting ExtendedSubmissionStrategy to SubmissionStrategy is acceptable because getStrategy has runtime checks that throw if the strategy factory doesn't exist, providing safety even with the type cast.

Applied to files:

  • typescript/cli/src/context/strategies/chain/chainResolver.ts
  • typescript/http-registry-server/src/routes/warp.ts
  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.

Applied to files:

  • typescript/rebalancer/tsconfig.json
  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/eslint.config.mjs
  • typescript/rebalancer/src/config/RebalancerConfig.ts
  • typescript/rebalancer/.mocharc.json
  • typescript/rebalancer/.gitignore
📚 Learning: 2025-11-24T17:19:38.362Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK must provide `MultiProvider` for multi-chain provider management, `HyperlaneCore` factory for core contract interactions, and `MultiProtocolCore` for protocol-agnostic abstractions across EVM, Cosmos, Sealevel, and Starknet

Applied to files:

  • typescript/rebalancer/tsconfig.json
  • typescript/rebalancer/src/service.ts
  • typescript/cli/package.json
  • Dockerfile
  • typescript/rebalancer/src/index.ts
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-06-16T11:17:55.750Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6486
File: typescript/cli/src/tests/warp/warp-check.e2e-test.ts:490-494
Timestamp: 2025-06-16T11:17:55.750Z
Learning: In the Hyperlane registry, the label part of warp IDs can now be any value that matches the registry's regex requirements, not just actual chain names. This means functions like getCombinedWarpRoutePath can accept descriptive filenames like WARP_DEPLOY_DEFAULT_FILE_NAME as valid label components for constructing registry paths.

Applied to files:

  • typescript/http-registry-server/src/routes/warp.ts
  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.

Applied to files:

  • typescript/cli/package.json
  • typescript/rebalancer/package.json
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-07-01T18:44:43.514Z
Learnt from: larryob
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6661
File: solidity/contracts/avs/HyperlaneServiceManager.sol:21-23
Timestamp: 2025-07-01T18:44:43.514Z
Learning: Test files and script files in Solidity projects typically don't need absolute import fixes with the same urgency as contract files, since they are not imported by other modules in the codebase. The compilation issues from absolute imports mainly affect files under the contracts directory that users import from.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.ts
📚 Learning: 2025-11-24T17:19:38.362Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: For agent deployment, redeployment, RPC URL rotation, validator operations, manual message processing, balance management, key funding, security incident response, and Lander configuration, follow procedures detailed in the Operations Runbook at https://www.notion.so/hyperlanexyz/Runbook-AI-Agent-24a6d35200d680229b38e8501164ca66

Applied to files:

  • typescript/rebalancer/README.md
📚 Learning: 2025-06-16T16:22:12.017Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 5883
File: typescript/cli/src/commands/fork.ts:12-39
Timestamp: 2025-06-16T16:22:12.017Z
Learning: In yargs CLI applications, hyphenated option names (kebab-case) like 'fork-config' are automatically converted to camelCase (forkConfig) when passed to handler functions. This means destructuring { forkConfig } from handler arguments when the option is defined as 'fork-config' is correct and will work as expected.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-11-24T17:19:38.362Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: Applies to typescript/sdk/src/**/*.ts : Use adapter pattern for protocol-specific implementations in the TypeScript SDK for different VMs

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
🧬 Code graph analysis (4)
typescript/http-registry-server/src/routes/chain.ts (1)
typescript/http-registry-server/src/services/chainService.ts (1)
  • ChainService (9-43)
typescript/rebalancer/src/service.ts (2)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (12-39)
typescript/rebalancer/src/core/RebalancerService.ts (1)
  • RebalancerService (95-333)
typescript/cli/src/commands/warp.ts (5)
typescript/cli/src/logger.ts (3)
  • logCommandHeader (60-62)
  • errorRed (55-55)
  • logGreen (44-45)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (12-39)
typescript/sdk/src/rebalancer/types.ts (1)
  • RebalancerConfig (155-155)
typescript/rebalancer/src/core/RebalancerService.ts (1)
  • RebalancerService (95-333)
typescript/utils/src/index.ts (1)
  • rootLogger (119-119)
typescript/rebalancer/src/factories/RebalancerContextFactory.ts (2)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (12-39)
typescript/rebalancer/src/index.ts (1)
  • RebalancerConfig (23-23)
🪛 markdownlint-cli2 (0.18.1)
typescript/rebalancer/README.md

115-115: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (29)
typescript/rebalancer/.gitignore (1)

1-3: Looks good, ogre or shrek. Standard ignores are all there.

The entries cover the essentials—environment secrets, built artifacts, and cache directories. All makes sense for a TypeScript package.

If you feel like it down the road, you might toss in node_modules and .DS_Store to keep things even tidier, but what's here is solid as a swamp. No issues blocking anything.

typescript/rebalancer/.mocharc.json (1)

1-3: Configuration looks sound for the new rebalancer package.

Configuring Mocha to use TSX for TypeScript imports is a solid choice—keeps things simple and gets the test harness running with minimal fuss. The setup aligns with what you'd want for a dedicated package that needs to handle TypeScript out of the box.

Just make sure the tsx dependency is pinned in the package.json and that this config lines up with how other packages in the monorepo handle their test setups (if there's a pattern already in place, we'd want to keep things consistent).

typescript/cli/src/context/strategies/chain/chainResolver.ts (1)

1-1: Import path updated correctly.

The import now references the new dedicated package instead of the local path. Usage downstream remains consistent with the existing pattern.

.changeset/separate-rebalancer-package.md (1)

1-10: Changeset looks solid.

Properly documents the package split and the dual-mode functionality. The versioning strategy (minor bumps for both packages) makes sense for this feature addition.

typescript/rebalancer/README.md (2)

1-178: Well-documented package introduction.

The README provides clear guidance for both manual and daemon usage modes. The examples are practical and the migration notes will help existing users. Good work laying this all out.


115-137: Markdown linter false positive on directory tree.

The linter flagged line 115 for missing a language specifier, but it's a directory tree structure diagram—doesn't need one. You can safely ignore that warning or add text if you want to quiet the linter.

typescript/rebalancer/eslint.config.mjs (1)

1-14: ESLint config looks appropriate.

Extending the monorepo defaults and disabling import restrictions for Node.js built-ins makes sense since this is a service package. The comment explains the reasoning clearly.

typescript/rebalancer/src/config/RebalancerConfig.ts (1)

10-10: Import path adjusted for new package structure.

The relative path now correctly points to the utility module within the rebalancer package hierarchy.

typescript/rebalancer/src/interfaces/IMonitor.ts (1)

3-3: Import path updated consistently.

The error utility import now reflects the rebalancer package structure, matching the pattern used in other files.

typescript/rebalancer/tsconfig.json (1)

1-8: TypeScript configuration follows monorepo conventions.

The setup extends the base config properly and sets up the standard build structure. All looks good here.

Dockerfile (1)

35-35: Looks good to me, donkey!

The new rebalancer package manifest is placed right where it belongs in the swamp — er, I mean alphabetically between radix-sdk and sdk. This ensures proper dependency installation during image build. Nice and tidy.

typescript/http-registry-server/src/routes/chain.ts (1)

1-1: These type annotations are worth their weight in onions.

Adding explicit IRouter return type and using type-only import is a solid improvement. Makes the code more self-documenting and aligns nicely with the other router files in this PR. No functional changes, just cleaner typing.

Also applies to: 13-13

typescript/http-registry-server/src/routes/warp.ts (1)

1-1: This is my swamp, and these types are welcome in it.

Consistent with the chain.ts changes — explicit IRouter return type and proper type-only import. Keeps all router factories speaking the same language.

Also applies to: 13-13

typescript/rebalancer/src/utils/errors.ts (1)

1-5: A proper error wrapper, like layers on an ogre.

Clean implementation using ES2022's error cause option. Since the package requires Node >= 18, this works perfectly fine. Handy for preserving the original error context when wrapping exceptions.

typescript/http-registry-server/src/routes/root.ts (1)

1-1: All three router files now match, like a proper set of layers.

Consistent IRouter typing across chain.ts, warp.ts, and now root.ts. Good housekeeping.

Also applies to: 8-8

typescript/cli/src/commands/warp.ts (2)

5-5: The rebalancer integration looks proper and tidy.

Good use of the new @hyperlane-xyz/rebalancer package APIs. The RebalancerConfig.load() and RebalancerService constructor usage aligns with the package's interface. Using rootLogger.child({ module: 'rebalancer' }) for scoped logging is a nice touch.

Also applies to: 19-19, 508-554


547-550: Signal handling is already implemented in RebalancerService.start().

The daemon service properly registers SIGINT and SIGTERM handlers (lines 237–238 in RebalancerService.ts) before starting the monitor, and implements graceful shutdown cleanup. No additional signal handling is needed in the CLI.

typescript/rebalancer/package.json (1)

8-10: > Likely an incorrect or invalid review comment.

typescript/rebalancer/src/service.ts (2)

31-44: Version loading looks good, just a wee note.

The fallback to 'unknown' and the warning log when package.json can't be read is sensible. The dynamic imports for fs, path, and url work fine here since this is an async context. Nice and tidy.


86-137: Service initialization and startup flow looks solid.

The sequence of loading config, initializing registry, setting up providers, and starting the service is well-structured. Error handling wraps the whole block and exits with a non-zero code on failure, which is what ye want for container environments.

typescript/rebalancer/src/core/RebalancerService.ts (4)

119-163: Initialization flow is clean and well-structured.

The lazy initialization pattern with the early return if already initialized is a good approach. The conditional creation of monitor, metrics, strategy, and rebalancer based on mode and config options is nicely organized.


168-216: Manual rebalance execution looks proper.

Good validation of the origin token lookup, amount parsing, and the assert for positive amounts. The error handling with re-throwing after logging is appropriate for letting callers handle failures.


312-325: Monitor error handling re-throws MonitorStartError.

Just confirming this is intentional - throwing from an event handler will cause an unhandled rejection if the monitor emits this error asynchronously. If MonitorStartError only occurs during the synchronous start() call, this should be fine.


297-306: The fire-and-forget pattern is safe. The rebalancer instance returned by createRebalancer() is wrapped with WithSemaphore, which uses an executing flag to prevent concurrent rebalance operations. If a rebalance call arrives while one is already executing, WithSemaphore.rebalance() returns early (line 30-34 in WithSemaphore.ts), ensuring no overlaps occur regardless of checkFrequency timing.

typescript/rebalancer/src/index.ts (1)

1-68: Nice and tidy barrel file for the new package.

The exports are well-organized with clear section comments. Types are properly exported using export type where appropriate, and the public API surface looks comprehensive. This gives consumers a clean entry point without exposing internal implementation details.

typescript/rebalancer/src/utils/files.ts (1)

205-237: Interactive file selection utility looks handy.

The runFileSelectionStep function with inquirer prompts is well-structured. Good error messages and the fallback to manual input is a nice touch.

typescript/rebalancer/src/factories/RebalancerContextFactory.ts (3)

67-72: Nice fallback for MultiProtocolProvider creation.

The pattern of accepting an optional MultiProtocolProvider and creating one from MultiProvider if not provided gives flexibility. This allows the CLI to pass its existing provider while the daemon can just pass undefined.


49-99: Factory creation cleanly decoupled from CLI context.

The refactoring to accept MultiProvider and IRegistry directly instead of WriteCommandContext makes this factory reusable across different entry points - CLI, daemon, or tests. The warp route config loading and WarpCore creation flow is straightforward.


160-188: Rebalancer creation looks proper with the new provider pattern.

Using this.multiProvider.metadata for chain metadata and passing the multiProvider directly to the Rebalancer keeps things consistent. The semaphore wrapping for concurrency control is in place.

@paulbalaji paulbalaji force-pushed the pbio/rebalancer-package-move branch from 5a8bd28 to 7d3cf0f Compare December 8, 2025 15:39
@paulbalaji paulbalaji requested a review from xeno097 December 8, 2025 15:39
xeno097
xeno097 previously approved these changes Dec 8, 2025
@paulbalaji paulbalaji force-pushed the pbio/rebalancer-package-move branch from 7d3cf0f to 36aa15c Compare December 8, 2025 18:19
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 (5)
typescript/rebalancer/package.json (1)

33-34: Move development-only packages to devDependencies.

Since this package is published (indicated by the "files" and "bin" entries), the @inquirer/prompts, @inquirer/select, and pino-pretty packages should be in devDependencies rather than dependencies. These are development tools - the inquirer packages are for interactive CLI prompts (not needed for the daemon service), and pino-pretty is a log formatter typically only used during local development.

Move these three packages to the devDependencies section:

  "dependencies": {
    "@google-cloud/pino-logging-gcp-config": "^1.0.6",
    "@hyperlane-xyz/core": "10.0.5",
    "@hyperlane-xyz/provider-sdk": "0.3.0",
    "@hyperlane-xyz/registry": "23.7.0",
    "@hyperlane-xyz/sdk": "19.11.0",
    "@hyperlane-xyz/utils": "19.11.0",
-   "@inquirer/prompts": "3.3.2",
-   "@inquirer/select": "^1.3.3",
    "bignumber.js": "^9.1.1",
    "ethers": "^5.8.0",
    "express": "^5.1.0",
    "pino": "^8.19.0",
-   "pino-pretty": "^13.0.0",
    "prom-client": "^14.0.1",
    "yaml": "2.4.5",
    "zod": "^3.21.2",
    "zod-validation-error": "^3.3.0"
  },
  "devDependencies": {
+   "@inquirer/prompts": "3.3.2",
+   "@inquirer/select": "^1.3.3",
    "@types/express": "^5.0.3",
    "@types/mocha": "^10.0.1",
    "@types/node": "^18.14.5",
    "chai": "^4.5.0",
    "eslint": "^9.31.0",
    "mocha": "^11.5.0",
+   "pino-pretty": "^13.0.0",
    "prettier": "^3.5.3",
    "tsx": "^4.19.1",
    "typescript": "5.3.3"
  },

Also applies to: 39-39

typescript/rebalancer/README.md (1)

115-136: Add language specifier to fenced code block.

The package structure diagram would benefit from a language identifier. Consider using text or plaintext for the tree structure to ensure consistent rendering across different Markdown viewers.

Apply this change:

-```
+```text
 typescript/rebalancer/
 ├── src/
 │   ├── core/
typescript/rebalancer/src/config/RebalancerConfig.test.ts (3)

4-5: Temp-path setup and cleanup look solid; consider uniqueness if you go parallel later

Using tmpdir() plus a shared TEST_CONFIG_PATH and cleaning it up with rmSync(..., { force: true }) keeps the repo from getting muddy and is fine for the usual single-process Mocha run. If you ever start running this suite in parallel workers or multiple processes, it might be worth salting the filename (e.g. with PID or a random suffix) so separate workers don’t stomp on each other’s config file in the same OS temp dir.

Also applies to: 12-17, 47-52


54-59: Exact error-message match is a bit brittle

Asserting the full error string, including the entire TEST_CONFIG_PATH, ties this test pretty hard to the current wording of readYamlOrJson’s error and to that path format. If the helper ever tweaks its phrasing, behavior stays fine but this test breaks. You might consider a looser check (e.g. regex or includes('File doesn\'t exist')) while still asserting that the thrown error mentions the path.


47-48: Tiny helper could DRY up config-file writes

Right now each test hand-rolls writeYamlOrJson(TEST_CONFIG_PATH, data) after shaping data. That’s perfectly workable, but if you want to keep this swamp a bit tidier, a small local helper like const writeConfig = (cfg: RebalancerConfigFileInput) => writeYamlOrJson(TEST_CONFIG_PATH, cfg); would cut the repetition and make any future path or write behavior changes a one-liner.

Also applies to: 92-93, 103-104, 138-139, 176-177, 229-232, 281-284, 321-324, 367-370

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5a8bd28ab3eb56ba442f38ad2f50af3dadf64e65 and 36aa15cad1d6cad3cd8e0b42c83fc0fb2c5bf2dc.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (25)
  • .changeset/separate-rebalancer-package.md (1 hunks)
  • Dockerfile (1 hunks)
  • typescript/cli/package.json (1 hunks)
  • typescript/cli/src/commands/warp.ts (3 hunks)
  • typescript/cli/src/context/strategies/chain/chainResolver.ts (1 hunks)
  • typescript/cli/src/rebalancer/README.md (0 hunks)
  • typescript/cli/src/rebalancer/index.ts (0 hunks)
  • typescript/cli/src/rebalancer/runner.ts (0 hunks)
  • typescript/http-registry-server/src/routes/chain.ts (2 hunks)
  • typescript/http-registry-server/src/routes/root.ts (1 hunks)
  • typescript/http-registry-server/src/routes/warp.ts (2 hunks)
  • typescript/rebalancer/.gitignore (1 hunks)
  • typescript/rebalancer/.mocharc.json (1 hunks)
  • typescript/rebalancer/README.md (1 hunks)
  • typescript/rebalancer/eslint.config.mjs (1 hunks)
  • typescript/rebalancer/package.json (1 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.test.ts (10 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.ts (1 hunks)
  • typescript/rebalancer/src/core/RebalancerService.ts (1 hunks)
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts (6 hunks)
  • typescript/rebalancer/src/index.ts (1 hunks)
  • typescript/rebalancer/src/interfaces/IMonitor.ts (1 hunks)
  • typescript/rebalancer/src/service.ts (1 hunks)
  • typescript/rebalancer/src/utils/errors.ts (1 hunks)
  • typescript/rebalancer/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (3)
  • typescript/cli/src/rebalancer/index.ts
  • typescript/cli/src/rebalancer/runner.ts
  • typescript/cli/src/rebalancer/README.md
🚧 Files skipped from review as they are similar to previous changes (11)
  • typescript/http-registry-server/src/routes/warp.ts
  • typescript/rebalancer/tsconfig.json
  • typescript/http-registry-server/src/routes/root.ts
  • .changeset/separate-rebalancer-package.md
  • typescript/http-registry-server/src/routes/chain.ts
  • typescript/rebalancer/.gitignore
  • typescript/cli/package.json
  • typescript/rebalancer/eslint.config.mjs
  • typescript/rebalancer/src/config/RebalancerConfig.ts
  • typescript/rebalancer/src/core/RebalancerService.ts
  • typescript/cli/src/context/strategies/chain/chainResolver.ts
🧰 Additional context used
🧠 Learnings (11)
📚 Learning: 2025-11-24T17:19:38.362Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK must provide `MultiProvider` for multi-chain provider management, `HyperlaneCore` factory for core contract interactions, and `MultiProtocolCore` for protocol-agnostic abstractions across EVM, Cosmos, Sealevel, and Starknet

Applied to files:

  • Dockerfile
  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/src/index.ts
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.

Applied to files:

  • typescript/rebalancer/package.json
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.

Applied to files:

  • typescript/rebalancer/package.json
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.

Applied to files:

  • typescript/rebalancer/package.json
  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
  • typescript/rebalancer/.mocharc.json
📚 Learning: 2025-10-21T14:26:22.163Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7223
File: typescript/infra/src/config/chain.ts:56-58
Timestamp: 2025-10-21T14:26:22.163Z
Learning: When adding chains to chainsToSkip in typescript/infra/src/config/chain.ts, it's the expected pattern to keep the chain's configurations in other files like supportedChainNames.ts, agent.ts, validators.ts, and owners.ts. The chainsToSkip array is used selectively by specific scripts (e.g., check-owner-ica.ts) to exclude chains from certain operations, not as a signal to remove all configurations.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
📚 Learning: 2025-06-16T11:17:55.750Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6486
File: typescript/cli/src/tests/warp/warp-check.e2e-test.ts:490-494
Timestamp: 2025-06-16T11:17:55.750Z
Learning: In the Hyperlane registry, the label part of warp IDs can now be any value that matches the registry's regex requirements, not just actual chain names. This means functions like getCombinedWarpRoutePath can accept descriptive filenames like WARP_DEPLOY_DEFAULT_FILE_NAME as valid label components for constructing registry paths.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-07-14T23:18:11.350Z
Learnt from: ltyu
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6715
File: typescript/cli/src/deploy/warp.ts:941-948
Timestamp: 2025-07-14T23:18:11.350Z
Learning: In the Hyperlane CLI warp.ts file, casting ExtendedSubmissionStrategy to SubmissionStrategy is acceptable because getStrategy has runtime checks that throw if the strategy factory doesn't exist, providing safety even with the type cast.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-06-16T16:22:12.017Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 5883
File: typescript/cli/src/commands/fork.ts:12-39
Timestamp: 2025-06-16T16:22:12.017Z
Learning: In yargs CLI applications, hyphenated option names (kebab-case) like 'fork-config' are automatically converted to camelCase (forkConfig) when passed to handler functions. This means destructuring { forkConfig } from handler arguments when the option is defined as 'fork-config' is correct and will work as expected.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-11-24T17:19:38.362Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: Applies to typescript/sdk/src/**/*.ts : Use `ChainMap<T>` for type-safe per-chain configuration mapping in TypeScript SDK

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-08-26T13:46:37.695Z
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.

Applied to files:

  • typescript/rebalancer/.mocharc.json
📚 Learning: 2025-11-24T17:19:38.362Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-11-24T17:19:38.362Z
Learning: For agent deployment, redeployment, RPC URL rotation, validator operations, manual message processing, balance management, key funding, security incident response, and Lander configuration, follow procedures detailed in the Operations Runbook at https://www.notion.so/hyperlanexyz/Runbook-AI-Agent-24a6d35200d680229b38e8501164ca66

Applied to files:

  • typescript/rebalancer/README.md
🧬 Code graph analysis (4)
typescript/rebalancer/src/service.ts (3)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/rebalancer/src/index.ts (2)
  • RebalancerConfig (23-23)
  • RebalancerService (11-11)
typescript/rebalancer/src/core/RebalancerService.ts (1)
  • RebalancerService (95-333)
typescript/rebalancer/src/config/RebalancerConfig.test.ts (1)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/cli/src/commands/warp.ts (4)
typescript/cli/src/logger.ts (3)
  • logCommandHeader (60-62)
  • errorRed (55-55)
  • logGreen (44-45)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/sdk/src/rebalancer/types.ts (1)
  • RebalancerConfig (155-155)
typescript/rebalancer/src/core/RebalancerService.ts (1)
  • RebalancerService (95-333)
typescript/rebalancer/src/factories/RebalancerContextFactory.ts (1)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
🪛 markdownlint-cli2 (0.18.1)
typescript/rebalancer/README.md

115-115: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (59)
  • GitHub Check: cli-evm-e2e-matrix (warp-send)
  • GitHub Check: cli-evm-e2e-matrix (warp-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-3)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-5)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-4)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
  • GitHub Check: cli-evm-e2e-matrix (relay)
  • GitHub Check: cli-evm-e2e-matrix (core-check)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
  • GitHub Check: cli-evm-e2e-matrix (core-deploy)
  • GitHub Check: cli-evm-e2e-matrix (core-init)
  • GitHub Check: cli-evm-e2e-matrix (core-read)
  • GitHub Check: cli-evm-e2e-matrix (core-apply)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
  • GitHub Check: env-test-matrix (mainnet3, optimism, igp)
  • GitHub Check: env-test-matrix (mainnet3, optimism, core)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, core)
  • GitHub Check: env-test-matrix (testnet4, sepolia, core)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
  • GitHub Check: aleo-sdk-e2e-run
  • GitHub Check: cli-cosmos-e2e-matrix (warp-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-read)
  • GitHub Check: cosmos-sdk-e2e-run
  • GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
  • GitHub Check: cli-cosmos-e2e-matrix (core-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (core-check)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-radix-e2e-matrix (core-deploy)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
  • GitHub Check: cli-radix-e2e-matrix (warp-deploy)
  • GitHub Check: cli-install-test-run
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
  • GitHub Check: yarn-test-run
  • GitHub Check: infra-test
  • GitHub Check: build-and-push-to-gcr
  • GitHub Check: agent-configs (mainnet3)
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: agent-configs (testnet4)
  • GitHub Check: lint-rs
  • GitHub Check: lander-coverage
  • GitHub Check: test-rs
🔇 Additional comments (16)
typescript/rebalancer/.mocharc.json (1)

1-3: Configuration is solid and properly aligned.

TSX is correctly listed as a dependency in the rebalancer package ("tsx": "^4.19.1"), and this minimal Mocha config matches the pattern used across most other TypeScript packages in the monorepo (deploy-sdk, http-registry-server, sdk, utils). The setup is straightforward and correct.

Dockerfile (1)

36-36: Looks good!

The new rebalancer package is properly included in the Docker build context, following the same pattern as the other packages. Nice and tidy.

typescript/rebalancer/src/interfaces/IMonitor.ts (1)

3-3: Import path updated correctly.

The path adjustment from ../../utils/errors.js to ../utils/errors.js is spot-on for the new package structure.

typescript/rebalancer/src/utils/errors.ts (1)

1-5: Clean error wrapper implementation.

The WrappedError class is well-implemented, properly leveraging the modern Error constructor's cause option. Simple and effective.

typescript/cli/src/commands/warp.ts (2)

5-5: Imports updated correctly.

The CLI now imports from the new @hyperlane-xyz/rebalancer package and uses rootLogger from utils. Clean separation of concerns.

Also applies to: 19-19


494-554: Rebalancer handler refactored successfully.

The handler logic has been nicely refactored to use the new RebalancerService. The manual mode validation (lines 533-538) ensures required parameters are present, and both manual and daemon execution paths are handled cleanly. Error handling looks solid throughout.

typescript/rebalancer/src/service.ts (2)

34-45: Version resolution handled well.

The getVersion function safely reads from package.json with proper error handling. The fallback to "unknown" ensures the service can start even if version detection fails.


47-148: Service initialization is solid.

The main function provides thorough environment variable validation, clear error messages, and a well-structured initialization sequence. The balance check frequency validation (lines 64-73) ensures only positive values are accepted, and the service setup properly wires together all the required components (MultiProvider, MultiProtocolProvider, registry, config).

typescript/rebalancer/src/index.ts (1)

1-68: Public API surface is well-organized.

The index file cleanly exposes the package's public API with clear sections for each concern (core service, configuration, strategy, monitor, metrics, interfaces, utils, factory). The use of type-only exports where appropriate keeps things tidy.

typescript/rebalancer/src/factories/RebalancerContextFactory.ts (7)

3-10: Well organized imports, looking good!

The imports align nicely with the refactor objectives. MultiProvider and IRegistry give you the tools needed for multi-chain operations and registry access without the CLI context dependency.


33-40: Constructor refactor is solid.

Swapping out the context for multiProvider and registry makes this factory reusable outside the CLI. The parameter list is clean and well-documented.


68-72: MultiProtocolProvider setup looks proper.

The nullish coalescing operator handles the optional parameter gracefully, and extending chain metadata with mailboxes ensures Sealevel warp adapters have what they need. Nice and tidy.


190-209: Private helper method looks good.

The getInitialTotalCollateral() logic is unchanged and correctly calculates the total bridged supply across eligible collateralized tokens. No concerns here.


114-118: No action needed. The migration to this.multiProvider.metadata is correct—this property returns ChainMap<ChainMetadata>, which is exactly what PriceGetter.create() expects as its first parameter. This is the standard pattern used throughout the codebase for accessing chain metadata.


52-52: The optional multiProtocolProvider parameter is not used in practice — the only caller (RebalancerService) always passes a pre-constructed instance.

The factory signature accepts multiProtocolProvider as optional and falls back to creating it from multiProvider if undefined (lines 69–72), but RebalancerService.ts (lines 128–134) always constructs and passes an explicit MultiProtocolProvider instance. This pattern is defensive but unnecessary given current usage. Consider making the parameter required if it will always be provided, or document the optional fallback for future extensibility.


180-187: Reconsider the WithSemaphore concerns—it serves rate limiting, not concurrency control.

The WithSemaphore wrapper is designed for timing control between rebalancing operations, not concurrency limits. It uses a simple executing flag to prevent overlapping executions and a waitUntil timestamp to enforce waiting periods based on bridge lock times from the configuration. The locking duration is determined per-route by the highest bridgeLockTime in the involved chains, which is appropriate for both daemon and manual execution modes.

Only one caller exists in the codebase (RebalancerService in daemon mode), so there are no manual/CLI execution paths affected. Comprehensive tests already cover the semaphore behavior including concurrent execution prevention and waiting period enforcement.

Likely an incorrect or invalid review comment.

@paulbalaji paulbalaji force-pushed the pbio/rebalancer-package-move branch from 36aa15c to 594f40d Compare December 15, 2025 15:47
@socket-security
Copy link

socket-security bot commented Dec 15, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

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 (5)
typescript/rebalancer/eslint.config.mjs (2)

5-7: Remove the unused files pattern.

This config object only specifies a files pattern without any rules or settings, so it doesn't actually do anything in the flat config format. Each object in the array is independent, and a standalone files pattern won't scope the rules that follow.

If you meant to apply the no-restricted-imports override only to TypeScript files, combine the files pattern with the rules in a single object. Otherwise, this can be removed.

Apply this diff to remove the unnecessary object:

 export default [
   ...MonorepoDefaults,
-  {
-    files: ['./src/**/*.ts'],
-  },
   {
     rules: {

9-11: Consider using string syntax for consistency.

While ['off'] works fine, the more idiomatic syntax for disabling a rule is just 'off' as a string rather than wrapping it in an array.

Apply this diff for consistency:

     rules: {
       // Disable restricted imports for Node.js built-ins since rebalancer is a Node.js-only service
-      'no-restricted-imports': ['off'],
+      'no-restricted-imports': 'off',
     },
typescript/rebalancer/src/config/RebalancerConfig.test.ts (2)

4-5: Temp-file setup is sane; consider per-test isolation if you ever go parallel

Using tmpdir() plus join and a shared TEST_CONFIG_PATH keeps the tests tidy and OS-agnostic, and wiring them through @hyperlane-xyz/utils/fs mirrors production nicely.

Only thing to keep in the back of your mind: if these tests ever run in parallel workers, a single fixed filename in the global tmpdir can cause cross-test clobbering. If that becomes a problem later, switching to something like a per-test directory (e.g. via mkdtemp or a randomized filename) would harden things without changing the assertions.

Also applies to: 12-16


47-52: Good alignment between config writer, loader, and error expectations

All the spots where you now writeYamlOrJson(TEST_CONFIG_PATH, data) and then call RebalancerConfig.load(TEST_CONFIG_PATH) make the tests exercise exactly the same read/write path as real usage, which is solid.

You’re also asserting on the full error string including TEST_CONFIG_PATH. Since both the throw site and the expectation interpolate the same constant, that’s stable enough, just a bit tightly coupled to the exact message shape. If you ever want looser coupling, you could assert on a substring (e.g. message containing "File doesn't exist at"), but there’s nothing functionally wrong with the current setup.

Also applies to: 55-59, 63-64, 92-95, 103-106, 138-142, 176-180, 229-233, 281-284, 321-324, 367-370

typescript/rebalancer/README.md (1)

115-136: Add a language identifier to the code fence.

The directory structure block at line 115 should specify a language (e.g., text or plaintext) for proper rendering.

Apply this diff:

-```
+```text
 typescript/rebalancer/
 ├── src/
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 36aa15cad1d6cad3cd8e0b42c83fc0fb2c5bf2dc and 594f40d7911977d15d5907a01c9264ec4afab6f2.

📒 Files selected for processing (20)
  • .changeset/separate-rebalancer-package.md (1 hunks)
  • Dockerfile (1 hunks)
  • typescript/cli/package.json (1 hunks)
  • typescript/cli/src/commands/warp.ts (3 hunks)
  • typescript/cli/src/context/strategies/chain/chainResolver.ts (1 hunks)
  • typescript/cli/src/rebalancer/README.md (0 hunks)
  • typescript/cli/src/rebalancer/index.ts (0 hunks)
  • typescript/cli/src/rebalancer/runner.ts (0 hunks)
  • typescript/rebalancer/.gitignore (1 hunks)
  • typescript/rebalancer/.mocharc.json (1 hunks)
  • typescript/rebalancer/README.md (1 hunks)
  • typescript/rebalancer/eslint.config.mjs (1 hunks)
  • typescript/rebalancer/package.json (1 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.test.ts (10 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.ts (1 hunks)
  • typescript/rebalancer/src/core/RebalancerService.ts (1 hunks)
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts (6 hunks)
  • typescript/rebalancer/src/index.ts (1 hunks)
  • typescript/rebalancer/src/interfaces/IMonitor.ts (1 hunks)
  • typescript/rebalancer/src/service.ts (1 hunks)
💤 Files with no reviewable changes (3)
  • typescript/cli/src/rebalancer/README.md
  • typescript/cli/src/rebalancer/runner.ts
  • typescript/cli/src/rebalancer/index.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • typescript/rebalancer/.gitignore
  • typescript/cli/package.json
  • Dockerfile
  • typescript/cli/src/context/strategies/chain/chainResolver.ts
  • typescript/rebalancer/src/core/RebalancerService.ts
  • typescript/rebalancer/src/config/RebalancerConfig.ts
  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/package.json
🧰 Additional context used
📓 Path-based instructions (1)
typescript/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

typescript/**/*.{ts,tsx,js,jsx}: Format TypeScript/JavaScript code using Prettier with: pnpm prettier
Lint TypeScript/JavaScript code with: pnpm lint

Files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
  • typescript/rebalancer/src/index.ts
  • typescript/cli/src/commands/warp.ts
  • typescript/rebalancer/src/interfaces/IMonitor.ts
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
🧠 Learnings (12)
📓 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/testnet_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/mainnet_config.json in future code reviews as requested by paulbalaji.
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
  • typescript/rebalancer/eslint.config.mjs
  • typescript/rebalancer/.mocharc.json
📚 Learning: 2025-10-21T14:26:22.163Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7223
File: typescript/infra/src/config/chain.ts:56-58
Timestamp: 2025-10-21T14:26:22.163Z
Learning: When adding chains to chainsToSkip in typescript/infra/src/config/chain.ts, it's the expected pattern to keep the chain's configurations in other files like supportedChainNames.ts, agent.ts, validators.ts, and owners.ts. The chainsToSkip array is used selectively by specific scripts (e.g., check-owner-ica.ts) to exclude chains from certain operations, not as a signal to remove all configurations.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
📚 Learning: 2025-12-15T15:33:46.049Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.049Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use HyperlaneCore factory for core contract interactions and MultiProtocolCore for protocol-agnostic abstractions (EVM, Cosmos, Sealevel, Starknet)

Applied to files:

  • typescript/rebalancer/src/index.ts
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-06-16T11:17:55.750Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6486
File: typescript/cli/src/tests/warp/warp-check.e2e-test.ts:490-494
Timestamp: 2025-06-16T11:17:55.750Z
Learning: In the Hyperlane registry, the label part of warp IDs can now be any value that matches the registry's regex requirements, not just actual chain names. This means functions like getCombinedWarpRoutePath can accept descriptive filenames like WARP_DEPLOY_DEFAULT_FILE_NAME as valid label components for constructing registry paths.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-07-14T23:18:11.350Z
Learnt from: ltyu
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6715
File: typescript/cli/src/deploy/warp.ts:941-948
Timestamp: 2025-07-14T23:18:11.350Z
Learning: In the Hyperlane CLI warp.ts file, casting ExtendedSubmissionStrategy to SubmissionStrategy is acceptable because getStrategy has runtime checks that throw if the strategy factory doesn't exist, providing safety even with the type cast.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-06-16T16:22:12.017Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 5883
File: typescript/cli/src/commands/fork.ts:12-39
Timestamp: 2025-06-16T16:22:12.017Z
Learning: In yargs CLI applications, hyphenated option names (kebab-case) like 'fork-config' are automatically converted to camelCase (forkConfig) when passed to handler functions. This means destructuring { forkConfig } from handler arguments when the option is defined as 'fork-config' is correct and will work as expected.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-12-15T15:33:46.049Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.049Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use MultiProvider for multi-chain provider management with protocol adapters

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-12-15T15:33:46.049Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.049Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use ChainMap<T> for type-safe per-chain configuration mapping

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-08-26T13:46:37.695Z
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.

Applied to files:

  • typescript/rebalancer/.mocharc.json
📚 Learning: 2025-08-26T13:46:37.695Z
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.

Applied to files:

  • typescript/rebalancer/.mocharc.json
🧬 Code graph analysis (2)
typescript/rebalancer/src/config/RebalancerConfig.test.ts (1)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/rebalancer/src/factories/RebalancerContextFactory.ts (1)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
🪛 markdownlint-cli2 (0.18.1)
typescript/rebalancer/README.md

115-115: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: test-rs
  • GitHub Check: lander-coverage
  • GitHub Check: lint-rs
🔇 Additional comments (10)
typescript/rebalancer/.mocharc.json (1)

1-3: LGTM! Clean and simple.

The tsx import configuration lets you run TypeScript tests without compiling first. Good stuff.

typescript/rebalancer/src/interfaces/IMonitor.ts (1)

3-3: Path update looks right.

The import path correctly reflects the new package structure with WrappedError now coming from the rebalancer's utils.

.changeset/separate-rebalancer-package.md (1)

1-10: Changeset looks solid.

The package separation and version bumps are well documented. Both minor bumps make sense for this feature addition.

typescript/cli/src/commands/warp.ts (2)

5-5: Good import setup.

The new rebalancer package integration is clean, pulling in RebalancerConfig and RebalancerService from the dedicated package, and rootLogger for proper logging infrastructure.

Also applies to: 19-19


493-555: Mode type is locked in tight - handler's all good.

The mode strings are perfectly type-safe. RebalancerServiceConfig.mode accepts 'manual' | 'daemon' (literal union type), and the code generates exactly those values. The ternary operator creates the right string every time, so no runtime type mishaps lurking about. Handler refactoring is solid.

typescript/rebalancer/src/index.ts (1)

1-68: Well-organized public API surface.

The exports are logically grouped with clear documentation, proper separation of types and values, and comprehensive coverage of all the core components. Nice barrel export structure.

typescript/rebalancer/src/factories/RebalancerContextFactory.ts (4)

29-40: Clean refactoring to multiProvider and registry.

The constructor and static create method now take explicit dependencies instead of context, which is better for testing and clearer about what's actually needed. Good separation of concerns.

Also applies to: 44-54


68-72: Smart fallback for MultiProtocolProvider.

Creating the MultiProtocolProvider from the MultiProvider when not provided is a nice convenience. Keeps the API flexible.


180-187: Semaphore wrapping for concurrency control.

Wrapping the rebalancer with WithSemaphore for concurrency control makes sense. Just make sure this doesn't change the interface in unexpected ways.


114-121: Migration to multiProvider.metadata and registry.getWarpDeployConfig is clean.

No stray WriteCommandContext references or context usage patterns found in the rebalancer package. The migration is complete and there are no leftover context references hanging around like an ogre's layers.

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

♻️ Duplicate comments (1)
typescript/rebalancer/package.json (1)

26-44: Remove unused dependencies from package.json

Neither pino-pretty nor the @inquirer packages are actually used anywhere in the rebalancer codebase—not in runtime code, not in tests, nowhere. The code uses pino directly (for type imports and test setup) and gets logger utilities from @hyperlane-xyz/utils. These belong in the dependencies section in name only, which is a bit like paying rent on rooms you never step into.

Remove "pino-pretty": "^13.0.0" and both @inquirer packages from dependencies. If pretty-printed logging is needed, it should be an optional peer dependency (like it is in the utils package), so consuming projects opt into the extra weight.

🧹 Nitpick comments (1)
typescript/rebalancer/README.md (1)

115-115: Specify language for fenced code block.

The architecture code block should declare the language for proper syntax highlighting and linting compliance.

-```
+```
typescript/rebalancer/
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 64a6f48c0d7faac4527f6c1f6ecd5a7030ac2463 and a9c9627fff165845c1d9e29e0ce99533a56385e5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • typescript/rebalancer/README.md (1 hunks)
  • typescript/rebalancer/package.json (1 hunks)
🧰 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.
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.

Applied to files:

  • typescript/rebalancer/package.json
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.

Applied to files:

  • typescript/rebalancer/package.json
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.

Applied to files:

  • typescript/rebalancer/package.json
🪛 markdownlint-cli2 (0.18.1)
typescript/rebalancer/README.md

115-115: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (61)
  • GitHub Check: cli-cosmos-e2e-matrix (core-check)
  • GitHub Check: cli-evm-e2e-matrix (core-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-3)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-5)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-send)
  • GitHub Check: cli-evm-e2e-matrix (core-check)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
  • GitHub Check: cli-evm-e2e-matrix (core-read)
  • GitHub Check: cli-evm-e2e-matrix (relay)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
  • GitHub Check: cli-evm-e2e-matrix (core-deploy)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-4)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-1)
  • GitHub Check: cli-evm-e2e-matrix (core-apply)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (core-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-apply)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
  • GitHub Check: env-test-matrix (testnet4, sepolia, core)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
  • GitHub Check: pnpm-test-run
  • GitHub Check: env-test-matrix (mainnet3, optimism, igp)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, core)
  • GitHub Check: cli-radix-e2e-matrix (warp-deploy)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
  • GitHub Check: cli-install-test-run
  • GitHub Check: env-test-matrix (mainnet3, optimism, core)
  • GitHub Check: cli-radix-e2e-matrix (core-deploy)
  • GitHub Check: cosmos-sdk-e2e-run
  • GitHub Check: cli-radix-e2e-matrix (core-apply)
  • GitHub Check: aleo-sdk-e2e-run
  • GitHub Check: infra-test
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: lint-prettier
  • GitHub Check: agent-configs (testnet4)
  • GitHub Check: agent-configs (mainnet3)
  • GitHub Check: build-and-push-to-gcr
  • GitHub Check: lint-rs
  • GitHub Check: lander-coverage
  • GitHub Check: test-rs
🔇 Additional comments (2)
typescript/rebalancer/package.json (2)

30-30: Registry dependency pinned correctly.

Good catch using a pinned version (23.7.0) for @hyperlane-xyz/registry instead of workspace:*. That's the right pattern since registry is maintained separately and published to npm.


62-64: Node engine requirement is reasonable.

Requiring Node >=18 aligns with modern TypeScript tooling and async/await support.

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

♻️ Duplicate comments (2)
typescript/rebalancer/package.json (1)

26-44: Move development packages to devDependencies.

Three packages have no usage in the runtime service code and should live in devDependencies:

  • @inquirer/prompts (line 33)
  • @inquirer/select (line 34)
  • pino-pretty (line 39)

All occurrences of these are zero in the service runtime. They belong in dev tooling, not in the production dependency tree.

typescript/rebalancer/src/service.ts (1)

34-45: Version getter could live inside main, mate.

There was a previous comment asking why this isn't inside the main function. Moving getVersion() inline or calling it within main would keep all initialization logic together in one place, like layers on a... well, you know.

🧹 Nitpick comments (3)
typescript/rebalancer/README.md (1)

115-136: Add language identifier to the code fence.

The directory tree structure would render better with a language identifier. Toss a text or plaintext after those opening backticks at line 115.

-```
+```text
 typescript/rebalancer/
 ├── src/
typescript/rebalancer/src/service.ts (1)

50-60: Environment validation looks good, but consider validating the private key format.

The required env var checks are solid. However, new Wallet(privateKey) on line 117 will throw a cryptic error if the key format is invalid. A quick validation before constructing the wallet would give users a clearer error message about what went wrong.

  const privateKey = process.env.HYP_KEY;
  if (!privateKey) {
    rootLogger.error('HYP_KEY environment variable is required');
    process.exit(1);
  }
+
+  // Basic format validation - Wallet constructor will do full validation
+  if (!privateKey.startsWith('0x') || privateKey.length !== 66) {
+    rootLogger.error('HYP_KEY must be a valid 64-character hex string prefixed with 0x');
+    process.exit(1);
+  }
typescript/rebalancer/src/core/RebalancerService.ts (1)

269-275: Calling process.exit(0) in gracefulShutdown may complicate testing.

Directly calling process.exit() makes this class harder to test in isolation. Consider making the exit behavior injectable or conditional, or returning a status instead of exiting. For production daemon use this is fine, but it's something to keep in mind if you want unit test coverage on the shutdown path.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a9c9627fff165845c1d9e29e0ce99533a56385e5 and 9f87fea57ddf781d6523c81aa5377b890f7d3091.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (23)
  • .changeset/separate-rebalancer-package.md (1 hunks)
  • Dockerfile (1 hunks)
  • typescript/cli/package.json (2 hunks)
  • typescript/cli/src/commands/warp.ts (3 hunks)
  • typescript/cli/src/context/strategies/chain/chainResolver.ts (1 hunks)
  • typescript/cli/src/rebalancer/README.md (0 hunks)
  • typescript/cli/src/rebalancer/index.ts (0 hunks)
  • typescript/cli/src/rebalancer/runner.ts (0 hunks)
  • typescript/infra/package.json (1 hunks)
  • typescript/rebalancer/.gitignore (1 hunks)
  • typescript/rebalancer/.mocharc.json (1 hunks)
  • typescript/rebalancer/README.md (1 hunks)
  • typescript/rebalancer/eslint.config.mjs (1 hunks)
  • typescript/rebalancer/package.json (1 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.test.ts (10 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.ts (1 hunks)
  • typescript/rebalancer/src/core/RebalancerService.ts (1 hunks)
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts (6 hunks)
  • typescript/rebalancer/src/index.ts (1 hunks)
  • typescript/rebalancer/src/interfaces/IMonitor.ts (1 hunks)
  • typescript/rebalancer/src/service.ts (1 hunks)
  • typescript/rebalancer/src/utils/errors.ts (1 hunks)
  • typescript/rebalancer/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (3)
  • typescript/cli/src/rebalancer/runner.ts
  • typescript/cli/src/rebalancer/index.ts
  • typescript/cli/src/rebalancer/README.md
🚧 Files skipped from review as they are similar to previous changes (8)
  • typescript/cli/src/context/strategies/chain/chainResolver.ts
  • typescript/rebalancer/.gitignore
  • typescript/cli/package.json
  • typescript/rebalancer/tsconfig.json
  • typescript/rebalancer/.mocharc.json
  • typescript/infra/package.json
  • typescript/rebalancer/eslint.config.mjs
  • Dockerfile
🧰 Additional context used
📓 Path-based instructions (1)
typescript/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

typescript/**/*.{ts,tsx,js,jsx}: Format TypeScript/JavaScript code using Prettier with: pnpm prettier
Lint TypeScript/JavaScript code with: pnpm lint

Files:

  • typescript/rebalancer/src/config/RebalancerConfig.ts
  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
  • typescript/rebalancer/src/interfaces/IMonitor.ts
  • typescript/cli/src/commands/warp.ts
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
  • typescript/rebalancer/src/core/RebalancerService.ts
  • typescript/rebalancer/src/index.ts
  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/src/utils/errors.ts
🧠 Learnings (14)
📓 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.
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6486
File: typescript/cli/src/tests/warp/warp-check.e2e-test.ts:490-494
Timestamp: 2025-06-16T11:17:55.750Z
Learning: In the Hyperlane registry, the label part of warp IDs can now be any value that matches the registry's regex requirements, not just actual chain names. This means functions like getCombinedWarpRoutePath can accept descriptive filenames like WARP_DEPLOY_DEFAULT_FILE_NAME as valid label components for constructing registry paths.
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.ts
  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
  • typescript/rebalancer/package.json
  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/README.md
📚 Learning: 2025-12-11T16:29:54.086Z
Learnt from: ltyu
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7577
File: typescript/cli/src/commands/submit.ts:60-71
Timestamp: 2025-12-11T16:29:54.086Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, the `writeYamlOrJson` utility function (from typescript/cli/src/utils/files.ts) automatically handles directory creation when writing files, so there's no need to explicitly check or create directories before calling it.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.ts
📚 Learning: 2025-10-21T14:26:22.163Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7223
File: typescript/infra/src/config/chain.ts:56-58
Timestamp: 2025-10-21T14:26:22.163Z
Learning: When adding chains to chainsToSkip in typescript/infra/src/config/chain.ts, it's the expected pattern to keep the chain's configurations in other files like supportedChainNames.ts, agent.ts, validators.ts, and owners.ts. The chainsToSkip array is used selectively by specific scripts (e.g., check-owner-ica.ts) to exclude chains from certain operations, not as a signal to remove all configurations.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.

Applied to files:

  • typescript/rebalancer/package.json
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.

Applied to files:

  • typescript/rebalancer/package.json
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-06-16T11:17:55.750Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6486
File: typescript/cli/src/tests/warp/warp-check.e2e-test.ts:490-494
Timestamp: 2025-06-16T11:17:55.750Z
Learning: In the Hyperlane registry, the label part of warp IDs can now be any value that matches the registry's regex requirements, not just actual chain names. This means functions like getCombinedWarpRoutePath can accept descriptive filenames like WARP_DEPLOY_DEFAULT_FILE_NAME as valid label components for constructing registry paths.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-07-14T23:18:11.350Z
Learnt from: ltyu
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6715
File: typescript/cli/src/deploy/warp.ts:941-948
Timestamp: 2025-07-14T23:18:11.350Z
Learning: In the Hyperlane CLI warp.ts file, casting ExtendedSubmissionStrategy to SubmissionStrategy is acceptable because getStrategy has runtime checks that throw if the strategy factory doesn't exist, providing safety even with the type cast.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-06-16T16:22:12.017Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 5883
File: typescript/cli/src/commands/fork.ts:12-39
Timestamp: 2025-06-16T16:22:12.017Z
Learning: In yargs CLI applications, hyphenated option names (kebab-case) like 'fork-config' are automatically converted to camelCase (forkConfig) when passed to handler functions. This means destructuring { forkConfig } from handler arguments when the option is defined as 'fork-config' is correct and will work as expected.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use MultiProvider for multi-chain provider management with protocol adapters

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
  • typescript/rebalancer/src/service.ts
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use HyperlaneCore factory for core contract interactions and MultiProtocolCore for protocol-agnostic abstractions (EVM, Cosmos, Sealevel, Starknet)

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
  • typescript/rebalancer/src/index.ts
  • typescript/rebalancer/src/service.ts
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use ChainMap<T> for type-safe per-chain configuration mapping

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-08-26T13:46:37.695Z
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.

Applied to files:

  • typescript/rebalancer/README.md
📚 Learning: 2025-08-26T13:46:37.695Z
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.

Applied to files:

  • typescript/rebalancer/README.md
🧬 Code graph analysis (2)
typescript/rebalancer/src/config/RebalancerConfig.test.ts (1)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/rebalancer/src/service.ts (2)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/rebalancer/src/core/RebalancerService.ts (1)
  • RebalancerService (95-333)
🪛 markdownlint-cli2 (0.18.1)
typescript/rebalancer/README.md

115-115: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (62)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-4)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-3)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
  • GitHub Check: cli-evm-e2e-matrix (core-check)
  • GitHub Check: cli-evm-e2e-matrix (warp-send)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-2)
  • GitHub Check: cli-evm-e2e-matrix (core-init)
  • GitHub Check: cli-evm-e2e-matrix (core-read)
  • GitHub Check: cli-evm-e2e-matrix (core-apply)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-5)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
  • GitHub Check: cli-evm-e2e-matrix (relay)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
  • GitHub Check: cli-evm-e2e-matrix (core-deploy)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-read)
  • GitHub Check: cli-radix-e2e-matrix (warp-deploy)
  • GitHub Check: env-test-matrix (testnet4, sepolia, core)
  • GitHub Check: env-test-matrix (mainnet3, optimism, igp)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
  • GitHub Check: cli-cosmos-e2e-matrix (core-check)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
  • GitHub Check: cli-radix-e2e-matrix (core-deploy)
  • GitHub Check: env-test-matrix (mainnet3, optimism, core)
  • GitHub Check: cli-cosmos-e2e-matrix (core-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
  • GitHub Check: cli-radix-e2e-matrix (core-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (core-read)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, core)
  • GitHub Check: cosmos-sdk-e2e-run
  • GitHub Check: aleo-sdk-e2e-run
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
  • GitHub Check: pnpm-test-run
  • GitHub Check: cli-install-test-run
  • GitHub Check: infra-test
  • GitHub Check: build-and-push-to-gcr
  • GitHub Check: Socket Security: Pull Request Alerts
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: agent-configs (testnet4)
  • GitHub Check: agent-configs (mainnet3)
  • GitHub Check: lint-prettier
  • GitHub Check: test-rs
  • GitHub Check: lint-rs
  • GitHub Check: lander-coverage
🔇 Additional comments (23)
.changeset/separate-rebalancer-package.md (1)

1-10: Looks good—changeset is clear and captures the essence of the package split.

The version bumps make sense: minor for both packages fits the bill here. The new rebalancer package is a fresh feature, and the CLI updates maintain backward compatibility while gaining the daemon mode capability. The summary accurately reflects the PR objectives without any fluff. Shrek'd say this is as straightforward as a good swamp—layered, purposeful, and well-documented.

typescript/rebalancer/src/utils/errors.ts (1)

1-5: Good implementation of Error cause pattern.

This follows the standard Error cause API nicely. The conditional options object ensures we don't pass undefined cause values.

typescript/rebalancer/src/interfaces/IMonitor.ts (1)

3-3: Import path correctly updated for new package structure.

The path adjustment reflects the rebalancer logic moving into its own package. All good here.

typescript/rebalancer/src/factories/RebalancerContextFactory.ts (5)

3-10: Clean refactor removing CLI dependency.

Replacing WriteCommandContext with direct MultiProvider and IRegistry parameters makes this factory properly reusable. The constructor is well-documented with clear parameter descriptions.

Also applies to: 24-40


49-99: Solid factory method with sensible defaults.

The fallback to create MultiProtocolProvider from MultiProvider when not supplied (lines 69-72) is a thoughtful touch. Keeps the API flexible while ensuring all needs are met.


109-130: Registry and provider access updated correctly.

The switch from this.context.chainMetadata to this.multiProvider.metadata (line 115) and this.context.registry to this.registry (line 119) properly reflects the new architecture.


160-188: Rebalancer properly wrapped for concurrency control.

The WithSemaphore wrapper at lines 181-186 provides thread-safe access to the rebalancer. The comment clarifies the intent, and the usage of multiProvider throughout is consistent.


190-209: Initial collateral calculation looks solid.

The method correctly sums bridged supply for eligible collateralized tokens. The filtering logic and async handling are appropriate.

typescript/rebalancer/src/config/RebalancerConfig.ts (1)

9-9: Import correctly updated to use published utils package.

Switching from a relative import to @hyperlane-xyz/utils/fs aligns with the monorepo structure and makes the dependency explicit.

typescript/rebalancer/src/config/RebalancerConfig.test.ts (2)

4-5: Better test isolation with tmpdir().

Using tmpdir() for the test config path (line 16) keeps test artifacts out of the source tree. Nice cleanup. The import updates align with the package restructuring.

Also applies to: 12-12, 16-16


47-387: Consistent test config path usage throughout.

All test cases properly updated to use TEST_CONFIG_PATH. The coverage remains intact, just with better test hygiene.

typescript/cli/src/commands/warp.ts (3)

5-5: Clean integration with the new rebalancer package.

Importing RebalancerConfig and RebalancerService from @hyperlane-xyz/rebalancer properly separates concerns. The rootLogger import ensures consistent logging.

Also applies to: 19-19


493-530: Well-structured handler with clear mode determination.

The handler cleanly loads configuration (line 510), determines execution mode (line 513), and creates the service with all necessary context. Using a child logger with module scope (line 527) is a nice touch for log organization.


531-555: Execution logic handles both modes correctly.

Manual mode properly validates required parameters (lines 533-538) before executing, and daemon mode cleanly starts the service (line 549). Error handling is appropriate with clear user feedback.

typescript/rebalancer/src/service.ts (3)

115-119: Signer setup looks proper.

Creating the MultiProvider with chain metadata and setting a shared signer is the right approach here. Clean and straightforward - no onion-like complexity needed.


150-154: Top-level error handling is appropriate.

The catch-all at the entry point ensures any uncaught errors are logged and result in a non-zero exit. This is exactly what you want for a daemon running in Kubernetes - get out of my swamp gracefully when things go wrong.


96-107: Empty registryUris array uses defaults intentionally—consider making it configurable via environment variable.

The empty registryUris array here is by design: when passed empty, the registry falls back to its defaults. This works fine as-is, but if you'd like operators to customize registry URIs without code changes, you might add an optional REGISTRY_URIS environment variable to make it configurable in the daemon setup.

typescript/rebalancer/src/core/RebalancerService.ts (5)

25-46: Well-structured configuration interface.

The RebalancerServiceConfig interface is clean with good JSDoc comments. The optional fields have sensible defaults implied by their usage. This is the kind of thing that makes other developers' lives easier - like a warm bowl of rat stew on a cold night.


119-163: Initialization is well-guarded with idempotency check.

The early return when contextFactory already exists prevents double initialization. The conditional component creation based on mode and config flags is clean and logical.


168-216: Manual rebalance execution looks solid.

Good validation of the request parameters and proper error handling. The amount conversion using toWei with the token's decimals is correct. One small thing - the Number(amount) check on line 194 could fail for very large amounts that exceed JavaScript's safe integer range, but since you're ultimately using BigInt, this validation is just for sanity checking positivity.


312-325: Error handling distinguishes error types appropriately.

Good pattern here - MonitorPollingError is logged and metrics recorded (non-fatal), while MonitorStartError is re-thrown to bubble up (fatal). The catch-all for unexpected errors is also sensible. Layered error handling, if you will.


293-307: Fire-and-forget call is safe thanks to WithSemaphore wrapper.

The fire-and-forget rebalance() call looks bare, but the Rebalancer instance is always wrapped with WithSemaphore (see RebalancerContextFactory line 181-187). WithSemaphore has an executing flag that skips concurrent calls—so if another monitor event fires while a rebalance is in flight, it gets dropped gracefully. The guards are there, the pattern's intentional, and it's all covered with tests to boot.

typescript/rebalancer/src/index.ts (1)

1-68: Clean and well-organized barrel file.

This index file does exactly what it should - provides a clear, organized public API for the package. The section comments make it easy to find what you're looking for, and separating export type from value exports is good TypeScript practice for consumers using isolatedModules. All the .js extensions are in place for ESM compatibility.

Like a well-organized swamp - everything in its rightful place.

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 (1)
typescript/rebalancer/package.json (1)

39-39: Consider moving pino-pretty to devDependencies.

pino-pretty is typically a development-only formatter for prettifying log output. Since your start script uses the compiled Node binary while start:dev uses tsx, you might only need pino-pretty when developing locally. If that's the case, moving it to devDependencies would keep your production bundle leaner.

If pino-pretty is needed at runtime (e.g., for daemon mode in non-containerized environments), keep it in dependencies. But if it's only for the start:dev development workflow, this minor cleanup could help.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9f87fea57ddf781d6523c81aa5377b890f7d3091 and 47b88f4022b34351eed6bdb3c54db7fd76d4ba8a.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (1)
  • typescript/rebalancer/package.json (1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 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/testnet_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/mainnet_config.json in future code reviews as requested by paulbalaji.
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.{ts,tsx} : Build TypeScript SDK with: pnpm -C typescript/sdk build

Applied to files:

  • typescript/rebalancer/package.json
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.

Applied to files:

  • typescript/rebalancer/package.json
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.

Applied to files:

  • typescript/rebalancer/package.json
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.

Applied to files:

  • typescript/rebalancer/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (61)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-3)
  • GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
  • GitHub Check: cli-evm-e2e-matrix (warp-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-send)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-4)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
  • GitHub Check: cli-evm-e2e-matrix (core-check)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-5)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-2)
  • GitHub Check: cli-evm-e2e-matrix (core-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
  • GitHub Check: cli-evm-e2e-matrix (core-deploy)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
  • GitHub Check: cli-evm-e2e-matrix (relay)
  • GitHub Check: cli-evm-e2e-matrix (core-apply)
  • GitHub Check: cli-evm-e2e-matrix (core-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-check)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, core)
  • GitHub Check: env-test-matrix (mainnet3, optimism, core)
  • GitHub Check: env-test-matrix (mainnet3, optimism, igp)
  • GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: env-test-matrix (testnet4, sepolia, core)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
  • GitHub Check: cli-radix-e2e-matrix (core-deploy)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
  • GitHub Check: cli-cosmos-e2e-matrix (core-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (core-read)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-read)
  • GitHub Check: cli-radix-e2e-matrix (warp-deploy)
  • GitHub Check: cli-radix-e2e-matrix (core-apply)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
  • GitHub Check: cosmos-sdk-e2e-run
  • GitHub Check: aleo-sdk-e2e-run
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
  • GitHub Check: pnpm-test-run
  • GitHub Check: cli-install-test-run
  • GitHub Check: infra-test
  • GitHub Check: build-and-push-to-gcr
  • GitHub Check: agent-configs (testnet4)
  • GitHub Check: lint-prettier
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: agent-configs (mainnet3)
  • GitHub Check: lint-rs
  • GitHub Check: lander-coverage
  • GitHub Check: test-rs
🔇 Additional comments (4)
typescript/rebalancer/package.json (4)

26-44: Solid dependencies section structure.

Good separation of runtime dependencies from dev tools. Internal packages correctly use workspace:* and external dependency @hyperlane-xyz/registry is properly pinned to 23.7.0 per the learnings. The mix of pinned and caret versions is intentional and reasonable for this context.


6-10: Entry points are well-configured.

You've got both the library exports and the CLI executable wired up properly. Consumers can import the service as a library from @hyperlane-xyz/rebalancer, and folks installing globally can run hyperlane-rebalancer from the command line.


15-25: Scripts are well-organized.

Standard TypeScript package scripts here—nothing fancy, just what you need. The start and start:dev split handles both production and development contexts properly.


2-5: Package metadata looks good.

Name, description, and engine requirements are all in order. The 0.0.0 version will get bumped when you're ready to publish, which is the standard pattern.

Also applies to: 62-75

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 (1)
typescript/rebalancer/README.md (1)

133-154: Add language specifier to fenced code block.

The directory structure block should have a language specified. You can use text or leave it as a plain code block.

Apply this diff:

-```
+```text
 typescript/rebalancer/
 ├── src/
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47b88f4022b34351eed6bdb3c54db7fd76d4ba8a and bd9edbf92670e276f355c948473be25dce14abfc.

📒 Files selected for processing (2)
  • typescript/rebalancer/README.md (1 hunks)
  • typescript/rebalancer/src/service.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
typescript/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

typescript/**/*.{ts,tsx,js,jsx}: Format TypeScript/JavaScript code using Prettier with: pnpm prettier
Lint TypeScript/JavaScript code with: pnpm lint

Files:

  • typescript/rebalancer/src/service.ts
🧠 Learnings (2)
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use HyperlaneCore factory for core contract interactions and MultiProtocolCore for protocol-agnostic abstractions (EVM, Cosmos, Sealevel, Starknet)

Applied to files:

  • typescript/rebalancer/src/service.ts
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.

Applied to files:

  • typescript/rebalancer/src/service.ts
🧬 Code graph analysis (1)
typescript/rebalancer/src/service.ts (2)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/rebalancer/src/core/RebalancerService.ts (1)
  • RebalancerService (95-333)
🪛 markdownlint-cli2 (0.18.1)
typescript/rebalancer/README.md

133-133: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (61)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-3)
  • GitHub Check: cli-evm-e2e-matrix (warp-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-send)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-5)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-4)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
  • GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
  • GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
  • GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
  • GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
  • GitHub Check: cli-evm-e2e-matrix (core-apply)
  • GitHub Check: cli-evm-e2e-matrix (warp-check-2)
  • GitHub Check: cli-evm-e2e-matrix (core-deploy)
  • GitHub Check: cli-evm-e2e-matrix (relay)
  • GitHub Check: cli-evm-e2e-matrix (core-init)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
  • GitHub Check: cli-evm-e2e-matrix (core-check)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
  • GitHub Check: cli-evm-e2e-matrix (core-read)
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: env-test-matrix (testnet4, sepolia, core)
  • GitHub Check: env-test-matrix (mainnet3, optimism, core)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, core)
  • GitHub Check: env-test-matrix (mainnet3, optimism, igp)
  • GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
  • GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
  • GitHub Check: cli-radix-e2e-matrix (warp-deploy)
  • GitHub Check: cli-radix-e2e-matrix (core-apply)
  • GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
  • GitHub Check: cli-radix-e2e-matrix (core-deploy)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
  • GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
  • GitHub Check: pnpm-test-run
  • GitHub Check: cli-cosmos-e2e-matrix (core-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-check)
  • GitHub Check: cli-cosmos-e2e-matrix (warp-read)
  • GitHub Check: cli-cosmos-e2e-matrix (core-apply)
  • GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
  • GitHub Check: aleo-sdk-e2e-run
  • GitHub Check: cosmos-sdk-e2e-run
  • GitHub Check: cli-install-test-run
  • GitHub Check: infra-test
  • GitHub Check: build-and-push-to-gcr
  • GitHub Check: agent-configs (mainnet3)
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: lint-prettier
  • GitHub Check: agent-configs (testnet4)
  • GitHub Check: test-rs
  • GitHub Check: lander-coverage
  • GitHub Check: lint-rs
🔇 Additional comments (4)
typescript/rebalancer/src/service.ts (4)

36-47: Looks good, mate.

The version retrieval with fallback handling is solid. Keeping it separate from main makes sense for clarity.


49-82: Environment validation is spot on.

Required variables are checked properly, and CHECK_FREQUENCY validation ensures you don't get stuck with negative or zero milliseconds. All good here.


108-116: GithubRegistry setup addresses previous feedback.

The registry initialization with optional uri and branch gives you the flexibility to deploy against specific registry commits or branches, which was mentioned in earlier discussions. Well done.


134-156: Service initialization and startup look solid.

All the pieces are wired together properly - providers, registry, config, and runtime options all flow through cleanly. Error handling wraps it up nicely.

@paulbalaji paulbalaji force-pushed the pbio/rebalancer-package-move branch from 1f14ffa to 47b88f4 Compare December 16, 2025 12:21
@paulbalaji paulbalaji force-pushed the pbio/rebalancer-package-move branch from 47b88f4 to 749c8c2 Compare December 17, 2025 12:39
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

♻️ Duplicate comments (1)
typescript/rebalancer/src/service.ts (1)

101-106: Read REGISTRY_URI and REGISTRY_COMMIT from environment variables.

The code hardcodes an empty registryUris array and doesn't read REGISTRY_URI or REGISTRY_COMMIT from environment variables, despite the PR objectives mentioning this support and the Helm template setting REGISTRY_COMMIT. Similar services like ccip-server properly read REGISTRY_URI from process.env. Update the code to read these environment variables and pass them to getRegistry():

const registryUris = process.env.REGISTRY_URI ? [process.env.REGISTRY_URI] : [];
const registry = getRegistry({
  registryUris,
  enableProxy: false,
  logger: rootLogger,
});

Also ensure REGISTRY_COMMIT is handled appropriately if the registry client supports it.

🧹 Nitpick comments (1)
typescript/rebalancer/README.md (1)

115-136: Add language identifier to the fenced code block.

The directory structure block at line 115 is missing a language identifier. Add text or leave it empty to silence the linter.

Apply this diff:

-```
+```text
 typescript/rebalancer/
 ├── src/
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bd9edbf92670e276f355c948473be25dce14abfc and 749c8c214dca9d68d9a354db010f52d75f2db3a5.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (22)
  • .changeset/separate-rebalancer-package.md (1 hunks)
  • Dockerfile (1 hunks)
  • typescript/cli/package.json (1 hunks)
  • typescript/cli/src/commands/warp.ts (3 hunks)
  • typescript/cli/src/context/strategies/chain/chainResolver.ts (1 hunks)
  • typescript/cli/src/rebalancer/README.md (0 hunks)
  • typescript/cli/src/rebalancer/index.ts (0 hunks)
  • typescript/cli/src/rebalancer/runner.ts (0 hunks)
  • typescript/rebalancer/.gitignore (1 hunks)
  • typescript/rebalancer/.mocharc.json (1 hunks)
  • typescript/rebalancer/README.md (1 hunks)
  • typescript/rebalancer/eslint.config.mjs (1 hunks)
  • typescript/rebalancer/package.json (1 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.test.ts (10 hunks)
  • typescript/rebalancer/src/config/RebalancerConfig.ts (1 hunks)
  • typescript/rebalancer/src/core/RebalancerService.ts (1 hunks)
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts (6 hunks)
  • typescript/rebalancer/src/index.ts (1 hunks)
  • typescript/rebalancer/src/interfaces/IMonitor.ts (1 hunks)
  • typescript/rebalancer/src/service.ts (1 hunks)
  • typescript/rebalancer/src/utils/errors.ts (1 hunks)
  • typescript/rebalancer/tsconfig.json (1 hunks)
💤 Files with no reviewable changes (3)
  • typescript/cli/src/rebalancer/README.md
  • typescript/cli/src/rebalancer/runner.ts
  • typescript/cli/src/rebalancer/index.ts
🚧 Files skipped from review as they are similar to previous changes (9)
  • typescript/cli/src/context/strategies/chain/chainResolver.ts
  • typescript/rebalancer/src/config/RebalancerConfig.ts
  • .changeset/separate-rebalancer-package.md
  • typescript/rebalancer/eslint.config.mjs
  • typescript/cli/package.json
  • typescript/rebalancer/src/index.ts
  • typescript/rebalancer/.gitignore
  • Dockerfile
  • typescript/rebalancer/src/interfaces/IMonitor.ts
🧰 Additional context used
📓 Path-based instructions (1)
typescript/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (CLAUDE.md)

typescript/**/*.{ts,tsx,js,jsx}: Format TypeScript/JavaScript code using Prettier with: pnpm prettier
Lint TypeScript/JavaScript code with: pnpm lint

Files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
  • typescript/cli/src/commands/warp.ts
  • typescript/rebalancer/src/utils/errors.ts
  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
  • typescript/rebalancer/src/core/RebalancerService.ts
🧠 Learnings (14)
📚 Learning: 2025-08-26T13:45:52.227Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
  • typescript/rebalancer/tsconfig.json
  • typescript/rebalancer/package.json
  • typescript/rebalancer/.mocharc.json
📚 Learning: 2025-08-26T13:45:44.656Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:3380-3439
Timestamp: 2025-08-26T13:45:44.656Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json files in rust/main/config/ directory as requested by paulbalaji.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
📚 Learning: 2025-10-21T14:26:22.163Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7223
File: typescript/infra/src/config/chain.ts:56-58
Timestamp: 2025-10-21T14:26:22.163Z
Learning: When adding chains to chainsToSkip in typescript/infra/src/config/chain.ts, it's the expected pattern to keep the chain's configurations in other files like supportedChainNames.ts, agent.ts, validators.ts, and owners.ts. The chainsToSkip array is used selectively by specific scripts (e.g., check-owner-ica.ts) to exclude chains from certain operations, not as a signal to remove all configurations.

Applied to files:

  • typescript/rebalancer/src/config/RebalancerConfig.test.ts
📚 Learning: 2025-06-16T11:17:55.750Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6486
File: typescript/cli/src/tests/warp/warp-check.e2e-test.ts:490-494
Timestamp: 2025-06-16T11:17:55.750Z
Learning: In the Hyperlane registry, the label part of warp IDs can now be any value that matches the registry's regex requirements, not just actual chain names. This means functions like getCombinedWarpRoutePath can accept descriptive filenames like WARP_DEPLOY_DEFAULT_FILE_NAME as valid label components for constructing registry paths.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-07-14T23:18:11.350Z
Learnt from: ltyu
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6715
File: typescript/cli/src/deploy/warp.ts:941-948
Timestamp: 2025-07-14T23:18:11.350Z
Learning: In the Hyperlane CLI warp.ts file, casting ExtendedSubmissionStrategy to SubmissionStrategy is acceptable because getStrategy has runtime checks that throw if the strategy factory doesn't exist, providing safety even with the type cast.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-06-16T16:22:12.017Z
Learnt from: xeno097
Repo: hyperlane-xyz/hyperlane-monorepo PR: 5883
File: typescript/cli/src/commands/fork.ts:12-39
Timestamp: 2025-06-16T16:22:12.017Z
Learning: In yargs CLI applications, hyphenated option names (kebab-case) like 'fork-config' are automatically converted to camelCase (forkConfig) when passed to handler functions. This means destructuring { forkConfig } from handler arguments when the option is defined as 'fork-config' is correct and will work as expected.

Applied to files:

  • typescript/cli/src/commands/warp.ts
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use HyperlaneCore factory for core contract interactions and MultiProtocolCore for protocol-agnostic abstractions (EVM, Cosmos, Sealevel, Starknet)

Applied to files:

  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/tsconfig.json
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use MultiProvider for multi-chain provider management with protocol adapters

Applied to files:

  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-11-26T13:28:51.658Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: typescript/cli/package.json:20-20
Timestamp: 2025-11-26T13:28:51.658Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, hyperlane-xyz/registry is maintained in a separate repository and published to npm, so it should use a pinned version (e.g., "23.6.0") rather than the workspace protocol ("workspace:*") that other internal Hyperlane packages use.

Applied to files:

  • typescript/rebalancer/src/service.ts
  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
  • typescript/rebalancer/package.json
📚 Learning: 2025-08-26T13:46:37.695Z
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.

Applied to files:

  • typescript/rebalancer/tsconfig.json
  • typescript/rebalancer/.mocharc.json
📚 Learning: 2025-08-26T13:46:37.695Z
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.

Applied to files:

  • typescript/rebalancer/tsconfig.json
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.{ts,tsx} : Build TypeScript SDK with: pnpm -C typescript/sdk build

Applied to files:

  • typescript/rebalancer/tsconfig.json
📚 Learning: 2025-12-15T15:33:46.063Z
Learnt from: CR
Repo: hyperlane-xyz/hyperlane-monorepo PR: 0
File: CLAUDE.md:0-0
Timestamp: 2025-12-15T15:33:46.063Z
Learning: Applies to typescript/sdk/src/**/*.ts : TypeScript SDK should use ChainMap<T> for type-safe per-chain configuration mapping

Applied to files:

  • typescript/rebalancer/src/factories/RebalancerContextFactory.ts
📚 Learning: 2025-11-25T17:10:33.369Z
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 7410
File: solidity/foundry.toml:8-8
Timestamp: 2025-11-25T17:10:33.369Z
Learning: In the hyperlane-xyz/hyperlane-monorepo repository, when using pnpm (instead of Yarn), Foundry's `allow_paths` in solidity/foundry.toml should be set to `["./node_modules"]` rather than `["../node_modules"]` because pnpm's default node_modules structure places dependencies locally in the workspace subdirectory, not requiring access to the parent directory's node_modules.

Applied to files:

  • typescript/rebalancer/package.json
🧬 Code graph analysis (4)
typescript/rebalancer/src/config/RebalancerConfig.test.ts (1)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/rebalancer/src/service.ts (3)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/rebalancer/src/index.ts (2)
  • RebalancerConfig (23-23)
  • RebalancerService (11-11)
typescript/rebalancer/src/core/RebalancerService.ts (1)
  • RebalancerService (95-333)
typescript/rebalancer/src/factories/RebalancerContextFactory.ts (1)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/rebalancer/src/core/RebalancerService.ts (8)
typescript/rebalancer/src/factories/RebalancerContextFactory.ts (1)
  • RebalancerContextFactory (24-210)
typescript/rebalancer/src/monitor/Monitor.ts (1)
  • Monitor (18-174)
typescript/rebalancer/src/interfaces/IStrategy.ts (1)
  • IStrategy (11-13)
typescript/rebalancer/src/interfaces/IRebalancer.ts (1)
  • IRebalancer (18-20)
typescript/rebalancer/src/metrics/Metrics.ts (1)
  • Metrics (44-558)
typescript/rebalancer/src/config/RebalancerConfig.ts (1)
  • RebalancerConfig (11-38)
typescript/utils/src/index.ts (1)
  • assert (212-212)
typescript/rebalancer/src/utils/balanceUtils.ts (1)
  • getRawBalances (16-65)
🪛 markdownlint-cli2 (0.18.1)
typescript/rebalancer/README.md

115-115: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: env-test
  • GitHub Check: pnpm-test
  • GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
  • GitHub Check: e2e-matrix (evm)
  • GitHub Check: lander-coverage
  • GitHub Check: test-rs
  • GitHub Check: lint-rs
🔇 Additional comments (14)
typescript/rebalancer/tsconfig.json (1)

1-8: Configuration looks solid.

This setup is clean and proper for the new package. The base tsconfig provides all the strict type checking, module resolution, and compiler settings you need—declaration maps, source maps, the whole layering cake. The rebalancer config extends it nicely, sets the output and source paths, and includes everything under ./src.

No need to mess with project references—the monorepo doesn't use 'em, and pnpm handles the workspace dependencies just fine without 'em.

typescript/rebalancer/.mocharc.json (1)

1-3: Configuration's solid, but tsx could use a bump.

The Mocha setup here does what it needs to - pulls in tsx so your TypeScript tests can run without a fuss. Clean and simple, which is exactly right for a new package.

Now, about that tsx version - 4.19.1's a bit behind. The latest is 4.21.0, so you might want to give that a nudge in your package.json. It's only a couple minor versions back, so nothing alarming, but fresher is generally better for staying ahead of any fixes or improvements.

⛔ Skipped due to 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/testnet_config.json in future code reviews as requested by paulbalaji.
Learnt from: paulbalaji
Repo: hyperlane-xyz/hyperlane-monorepo PR: 6943
File: rust/main/config/testnet_config.json:34-35
Timestamp: 2025-08-26T13:45:52.227Z
Learning: Skip reviewing mainnet_config.json and testnet_config.json configuration files in typescript/infra/config/ and rust/main/config/ directories as requested by paulbalaji to reduce review noise.
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.
typescript/rebalancer/src/utils/errors.ts (1)

1-5: LGTM! Clean error wrapper.

The conditional cause handling is proper for the Error constructor. This gives ya a nice way to chain errors throughout the rebalancer without much fuss.

typescript/rebalancer/src/config/RebalancerConfig.test.ts (1)

4-16: Good move using temp directory for tests.

Switching to tmpdir() keeps test artifacts out of the repo and avoids conflicts. The import consolidation with writeYamlOrJson is clean.

typescript/rebalancer/package.json (1)

26-44: Dependencies properly organized.

The runtime dependencies are now in the right section. Consumers installing this package will get what they need.

typescript/cli/src/commands/warp.ts (2)

532-538: Manual mode validation looks solid.

The guard checking for required params (origin, destination, amount) before executing is proper. Error message is clear and the early exit prevents further issues.


540-544: Clean manual execution flow.

The service call is straightforward and logging is appropriate. Good to see success confirmation for manual operations.

typescript/rebalancer/src/service.ts (1)

63-73: CHECK_FREQUENCY validation is thorough.

The parseInt with NaN and positive number checks prevents bad config from sneaking through. Good defensive programming.

typescript/rebalancer/src/core/RebalancerService.ts (4)

119-163: Initialization guards against double-init.

The early return if contextFactory exists prevents duplicate initialization. Component creation order makes sense: factory, monitor (daemon only), metrics (optional), strategy, rebalancer (unless monitorOnly).


193-196: Amount validation is solid.

Converting to Number, checking NaN, and ensuring positive values covers the common input issues. Good defensive checks before the bigint conversion.


260-275: Graceful shutdown prevents double-exit.

The isExiting flag prevents shutdown re-entry, and cleaning up listeners avoids surprises. Proper cleanup pattern for a daemon service.


297-306: Rebalancer fire-and-forget pattern with error handling.

The .then()/.catch() on the rebalancer call with metrics recording is appropriate for async monitoring. Errors won't crash the monitor loop.

typescript/rebalancer/src/factories/RebalancerContextFactory.ts (2)

68-72: MultiProtocolProvider fallback is handy.

Creating the MultiProtocolProvider from MultiProvider when not provided gives callers flexibility. The provider extension with mailboxes handles Sealevel requirements.


180-187: Semaphore wrapper added for concurrency.

Wrapping the rebalancer with WithSemaphore adds proper concurrency control. This prevents overlapping rebalance operations from stepping on each other.

@paulbalaji paulbalaji force-pushed the pbio/rebalancer-package-move branch from 601d88e to 74ef96f Compare December 17, 2025 12:50
paulbalaji and others added 9 commits December 18, 2025 12:05
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update cli and infra packages to use ^1.3.3 to match rebalancer package
and satisfy syncpack version checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add @hyperlane-xyz/tsconfig, chai-as-promised, sinon and their type
definitions to fix TypeScript compilation errors in tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Update typescript/rebalancer/package.json to use catalog: references
for shared dependencies to align with monorepo conventions and pass
lint:catalog checks.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@paulbalaji paulbalaji force-pushed the pbio/rebalancer-package-move branch from 74ef96f to 59a5414 Compare December 18, 2025 12:05
@hyper-gonk
Copy link
Contributor

hyper-gonk bot commented Dec 18, 2025

🐳 Monorepo Docker Image Built Successfully

Image Tags:

gcr.io/abacus-labs-dev/hyperlane-monorepo:pr-7544
gcr.io/abacus-labs-dev/hyperlane-monorepo:59a5414-20251218-120552

@paulbalaji paulbalaji added this pull request to the merge queue Dec 18, 2025
Merged via the queue into main with commit 9963e0e Dec 18, 2025
85 of 86 checks passed
@paulbalaji paulbalaji deleted the pbio/rebalancer-package-move branch December 18, 2025 12:27
@github-project-automation github-project-automation bot moved this from In Review to Done in Hyperlane Tasks Dec 18, 2025
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.

3 participants