Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions typescript/infra/src/rebalancer/helm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,15 @@ export class RebalancerHelmManager extends HelmManager {
throw new Error('No chains configured');
}

// Store chains for helm values (used for private RPC secrets)
// Warp core config includes all strategy chains
// 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,
]),
];
Comment on lines +77 to 86

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.


// Store the config file content for helm values
Expand Down
Loading