Skip to content

fix: include solana rpc indexing#8901

Open
troykessler wants to merge 1 commit into
mainfrom
fix/solana-rpc
Open

fix: include solana rpc indexing#8901
troykessler wants to merge 1 commit into
mainfrom
fix/solana-rpc

Conversation

@troykessler

@troykessler troykessler commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Description

rebalancerChains (used to populate RPC_URL_* env vars via ExternalSecret) was built solely from warpCoreConfig.tokens — the warp token chains. Strategy-only chains like solanamainnet (used as a LiFi bridge target in USDC/eclipsemainnet) were never included, so RPC_URL_SOLANAMAINNET was never injected and the rebalancer fell back to the public registry RPC (https://api.mainnet-beta.solana.com).

Under load this causes 429s that wedge the rebalancer's Solana balance monitor, preventing it from detecting and rebalancing a collateral deficit — which in turn blocks arbitrum→solanamainnet transfers from being relayed (gas estimation fails with SPL InsufficientFunds).

Fix: merge strategy chain names into rebalancerChains so all chains the rebalancer interacts with (not just warp token chains) get private RPC URLs injected.

Drive-by changes

None.

Related issues

Backward compatibility

Yes. Additive only — existing rebalancers already have mainnet3-rpc-endpoints-<chain> GCP secrets for their warp token chains; this only adds secrets lookups for chains that were previously missing.

Testing

Manual — redeployed hyperlane-rebalancer-usdc-eclipsemainnet and confirmed RPC_URL_SOLANAMAINNET is now set to the private Alchemy endpoint in the pod.

@coderabbitai

coderabbitai Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

runPreflightChecks in helm.ts now builds rebalancerChains as a deduplicated union of warp token chain names and strategy chain names extracted from the validated rebalancer config, replacing the previous assignment that used only warp token chain names.

Changes

Rebalancer chain name merge

Layer / File(s) Summary
Deduplicated chain name union in runPreflightChecks
typescript/infra/src/rebalancer/helm.ts
this.rebalancerChains is now built by merging warp token chain names with strategy chain names from the validated config into a Set, so chains that live in the strategy but not as warp tokens are no longer left out and don't quietly fall back to the public registry RPC.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix: include solana rpc indexing' is concise and directly relates to the main change: ensuring Solana RPC endpoints are included in the rebalancer configuration.
Description check ✅ Passed The PR description comprehensively covers all required sections: detailed explanation of the problem, drive-by changes noted, backward compatibility confirmed, and testing approach documented.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
typescript/infra/src/rebalancer/helm.ts (1)

56-61: ⚡ Quick win

Consider asserting that warp tokens exist.

You've got a check for the config itself, but if warpCoreConfig.tokens is empty, this rebalancer's got nothing to rebalance. Per the coding guidelines, use assert() liberally for preconditions like this — better to fail fast than proceed with an invalid setup.

Suggested assertion
 const warpCoreConfig = getWarpCoreConfig(this.warpRouteId);
 if (!warpCoreConfig) {
   throw new Error(
     `Warp Route ID not found in registry: ${this.warpRouteId}`,
   );
 }
+assert(
+  warpCoreConfig.tokens.length > 0,
+  `Warp route ${this.warpRouteId} has no tokens`,
+);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@typescript/infra/src/rebalancer/helm.ts` around lines 56 - 61, After the
existing check that warpCoreConfig is not null in the block where
getWarpCoreConfig(this.warpRouteId) is called, add an assert() statement to
verify that warpCoreConfig.tokens exists and is not empty. This precondition
check ensures the rebalancer has tokens to work with and follows the coding
guideline to fail fast with invalid setups rather than proceeding with
incomplete data.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@typescript/infra/src/rebalancer/helm.ts`:
- Around line 77-86: The static method getManagersForChain (line 186) only
checks warpChains from warpCoreConfig, but now that rebalancerChains includes
strategy-only chains (which may not be warp tokens), the method needs to account
for those additional chains. Update getManagersForChain to fetch the deployed
rebalancer config from the configmap (following the pattern in lines 271-287),
parse it with RebalancerConfigSchema, extract strategy chains using
getStrategyChainNames, and then check if the provided chain parameter exists in
either the warpChains set or the strategy chains set before returning matching
managers.

---

Nitpick comments:
In `@typescript/infra/src/rebalancer/helm.ts`:
- Around line 56-61: After the existing check that warpCoreConfig is not null in
the block where getWarpCoreConfig(this.warpRouteId) is called, add an assert()
statement to verify that warpCoreConfig.tokens exists and is not empty. This
precondition check ensures the rebalancer has tokens to work with and follows
the coding guideline to fail fast with invalid setups rather than proceeding
with incomplete data.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2ed9c70c-2660-41f8-afaa-cc1b152b2ddd

📥 Commits

Reviewing files that changed from the base of the PR and between 5a40181 and 026ecc2.

📒 Files selected for processing (1)
  • typescript/infra/src/rebalancer/helm.ts

Comment on lines +77 to 86
// Store chains for helm values (used for private RPC secrets).
// Merge warp token chains and strategy chains — some strategy chains
// (e.g. solanamainnet used as a LiFi bridge target) are not warp tokens
// and would otherwise fall back to the public registry RPC.
this.rebalancerChains = [
...new Set(warpCoreConfig.tokens.map((t) => t.chainName)),
...new Set([
...warpCoreConfig.tokens.map((t) => t.chainName),
...chainNames,
]),
];

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | 🏗️ Heavy lift

Cross-file impact: getManagersForChain won't find strategy-only chains.

The merge here is sound — you're rightly including strategy chains in rebalancerChains for RPC secrets. But look at the static method getManagersForChain (line 186): it only checks warpChains (warp token chains), not the full rebalancerChains that now includes strategy chains.

When a strategy-only chain's RPC rotates, getManagersForChain won't return this rebalancer, so the pods won't refresh. To fix it, getManagersForChain needs to read the deployed rebalancer config (similar to lines 271-287), extract strategy chains with getStrategyChainNames, and check both warp and strategy chains.

Suggested approach

In getManagersForChain, after retrieving warpCoreConfig:

  1. Fetch the deployed rebalancer config from the configmap
  2. Parse it with RebalancerConfigSchema
  3. Extract strategy chains via getStrategyChainNames
  4. Check if chain is in either warpChains or strategy chains
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@typescript/infra/src/rebalancer/helm.ts` around lines 77 - 86, The static
method getManagersForChain (line 186) only checks warpChains from
warpCoreConfig, but now that rebalancerChains includes strategy-only chains
(which may not be warp tokens), the method needs to account for those additional
chains. Update getManagersForChain to fetch the deployed rebalancer config from
the configmap (following the pattern in lines 271-287), parse it with
RebalancerConfigSchema, extract strategy chains using getStrategyChainNames, and
then check if the provided chain parameter exists in either the warpChains set
or the strategy chains set before returning matching managers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

1 participant