Skip to content

Commit b05e242

Browse files
feat(rebalancer): mixed-mode movable collateral and inventory rebalancing (#8249)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
1 parent f7ebf6c commit b05e242

43 files changed

Lines changed: 2607 additions & 389 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@hyperlane-xyz/rebalancer': major
3+
---
4+
5+
Mixed-mode rebalancing was added to enable simultaneous movable collateral (EVM) and inventory (multi-VM) execution within a single rebalancer configuration, enabling cross-protocol rebalancing across EVM and Sealevel chains.
6+
7+
**BREAKING CHANGES:**
8+
9+
- `inventorySigner` config field was replaced with `inventorySigners`, a per-protocol map (`Partial<Record<ProtocolType, { address: string; key?: string } | string>>`). Existing configs using `inventorySigner` must migrate to the new schema.
10+
- `IExternalBridge.execute()` signature changed from `(quote, privateKey: string)` to `(quote, privateKeys: Partial<Record<ProtocolType, string>>)`. All `IExternalBridge` implementations must update their `execute` method to accept the new multi-protocol key map.
11+
12+
**New features:**
13+
14+
- Per-protocol signer architecture supporting EVM + Sealevel keys simultaneously.
15+
- `transferRemote` execution refactored to use `WarpCore.getTransferRemoteTxs()` for multi-VM compatibility, with protocol-aware receipt parsing and `SealevelCoreAdapter.parseMessageDispatchLogs` for Sealevel message ID extraction.
16+
- LiFi bridge extended with Sealevel support via `KeypairWalletAdapter`, Hyperlane domain ID to LiFi chain ID translation, and mutex around configure+execute to prevent race conditions.
17+
- Startup validation for signer coverage against all inventory route protocols, per-protocol address format validation, and Solana pubkey cross-check.
18+
- `parseSolanaPrivateKey()` utility with strict 64-byte validation and base58 normalization.
19+
- Zod schemas hardened for strategy configs, external bridges, and inventory signers with per-protocol address validation.
20+
- Private key redaction in log statements and EVM-only filtering for Explorer signer addresses.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hyperlane-xyz/sdk': minor
3+
---
4+
5+
An `extraSigners` field was added to `SolanaWeb3Transaction` and `TransferRemoteParams` to properly thread Sealevel keypairs through the typed transaction pipeline. WarpCore now generates and passes a `Keypair` for SolanaWeb3 transfers, and `SealevelHypTokenAdapter` consumes it instead of generating its own. `KeypairSvmTransactionSigner.signTransaction` was changed to use `partialSign` to preserve extra signer signatures across blockhash resubmits.

pnpm-lock.yaml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

typescript/cli/src/commands/warp.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,6 @@ export const rebalancer: CommandModuleWithWriteContext<{
681681
// Create rebalancer service
682682
const service = new RebalancerService(
683683
context.multiProvider,
684-
undefined,
685684
context.multiProtocolProvider,
686685
context.registry,
687686
rebalancerConfig,

typescript/infra/config/environments/mainnet3/rebalancer/USDC/eclipsemainnet-config.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
warpRouteId: USDC/eclipsemainnet
2+
inventorySigners:
3+
ethereum: '0x6056e8E8e5Db30ffa9d721e3D73b3D558011FdA9'
4+
sealevel: '5seKh2p3B8Kq9nAE7X4svfX9uLt81wWAiDJuLK1XNgXf'
5+
externalBridges:
6+
lifi:
7+
integrator: rebalancer
28
strategy:
39
rebalanceStrategy: weighted
410
chains:
@@ -9,6 +15,10 @@ strategy:
915
bridgeLockTime: 1800
1016
bridgeMinAcceptedAmount: 3500
1117
bridge: '0x8c8D831E1e879604b4B304a2c951B8AEe3aB3a23'
18+
override:
19+
solanamainnet:
20+
executionType: inventory
21+
externalBridge: lifi
1222

1323
base:
1424
weighted:
@@ -17,6 +27,10 @@ strategy:
1727
bridgeLockTime: 1800
1828
bridgeMinAcceptedAmount: 3500
1929
bridge: '0x33e94B6D2ae697c16a750dB7c3d9443622C4405a'
30+
override:
31+
solanamainnet:
32+
executionType: inventory
33+
externalBridge: lifi
2034

2135
arbitrum:
2236
weighted:
@@ -25,6 +39,10 @@ strategy:
2539
bridgeLockTime: 1800
2640
bridgeMinAcceptedAmount: 3500
2741
bridge: '0x4c19c653a8419A475d9B6735511cB81C15b8d9b2'
42+
override:
43+
solanamainnet:
44+
executionType: inventory
45+
externalBridge: lifi
2846

2947
optimism:
3048
weighted:
@@ -33,6 +51,10 @@ strategy:
3351
bridgeLockTime: 1800
3452
bridgeMinAcceptedAmount: 3500
3553
bridge: '0x33e94B6D2ae697c16a750dB7c3d9443622C4405a'
54+
override:
55+
solanamainnet:
56+
executionType: inventory
57+
externalBridge: lifi
3658

3759
polygon:
3860
weighted:
@@ -41,6 +63,10 @@ strategy:
4163
bridgeLockTime: 1800
4264
bridgeMinAcceptedAmount: 2500
4365
bridge: '0x33e94B6D2ae697c16a750dB7c3d9443622C4405a'
66+
override:
67+
solanamainnet:
68+
executionType: inventory
69+
externalBridge: lifi
4470

4571
unichain:
4672
weighted:
@@ -49,6 +75,10 @@ strategy:
4975
bridgeLockTime: 1800
5076
bridgeMinAcceptedAmount: 3500
5177
bridge: '0x33e94B6D2ae697c16a750dB7c3d9443622C4405a'
78+
override:
79+
solanamainnet:
80+
executionType: inventory
81+
externalBridge: lifi
5282

5383
ink:
5484
weighted:
@@ -57,3 +87,14 @@ strategy:
5787
bridgeLockTime: 1800
5888
bridgeMinAcceptedAmount: 2500
5989
bridge: '0x33e94B6D2ae697c16a750dB7c3d9443622C4405a'
90+
override:
91+
solanamainnet:
92+
executionType: inventory
93+
externalBridge: lifi
94+
95+
solanamainnet:
96+
weighted:
97+
weight: 10
98+
tolerance: 5
99+
executionType: inventory
100+
externalBridge: lifi

typescript/rebalancer-sim/src/runners/ProductionRebalancerRunner.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@ export class ProductionRebalancerRunner
228228
// Create service with mock action tracker
229229
this.service = new RebalancerService(
230230
multiProvider,
231-
undefined,
232231
multiProtocolProvider,
233232
registry,
234233
rebalancerConfig,

typescript/rebalancer/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
"@inquirer/prompts": "catalog:",
4747
"@inquirer/select": "catalog:",
4848
"@lifi/sdk": "catalog:",
49+
"@solana/web3.js": "catalog:",
4950
"bignumber.js": "catalog:",
51+
"bs58": "catalog:",
5052
"ethers": "catalog:",
5153
"express": "^5.1.0",
5254
"pino": "catalog:",

0 commit comments

Comments
 (0)