-
Notifications
You must be signed in to change notification settings - Fork 556
feat(rebalancer): inflight-aware rebalancing system #7921
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
8ad7e65
feat: implement ActionTracker for inflight-message-aware rebalancing …
Mo-Hussain e4a3647
feat(rebalancer): IStrategy inflight context and adapter (#7698)
Mo-Hussain 96eba9b
feat(rebalancer): BaseStrategy inflight-aware enhancements (#7699)
Mo-Hussain 3bd911e
feat(rebalancer): CollateralDeficitStrategy for just-in-time rebalanc…
Mo-Hussain 16ff4a9
feat(rebalancer): CompositeStrategy and array config format (#7701)
Mo-Hussain 9b22f07
feat(rebalancer): rebalancer service integration for inflight message…
Mo-Hussain 66d3962
feat(rebalancer): query balances at confirmed block to sync with Expl…
Mo-Hussain 785ce8e
refactor(rebalancer): type safety, bug fixes, and comprehensive test …
Mo-Hussain 0e1e48a
chore: add major version changeset for inflight-aware rebalancing
Mo-Hussain 2c1cfcb
fix: PR review feedback for inflight-tracking rebalancer (#7930)
Mo-Hussain cf3f55d
fix(cli): remove unused DEFAULT_METRICS_SERVER variable (#7933)
Mo-Hussain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperlane-xyz/rebalancer': minor | ||
| --- | ||
|
|
||
| Implemented ActionTracker for inflight-message-aware rebalancing. The ActionTracker tracked three entity types: user warp transfers (Transfer), rebalance intents (RebalanceIntent), and rebalance actions (RebalanceAction). It provided startup recovery by querying the Explorer for inflight messages, periodic sync operations to check message delivery status on-chain, and a complete API for creating and managing rebalance intents and actions. The implementation included a generic store interface (IStore) with an InMemoryStore implementation, comprehensive unit tests, and integration with ExplorerClient for querying inflight messages. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperlane-xyz/rebalancer': minor | ||
| --- | ||
|
|
||
| Added CollateralDeficitStrategy for just-in-time rebalancing. This strategy detected collateral deficits (negative effective balances from pending user transfers) and proposed fast rebalances using configured bridges. Modified reserveCollateral() to allow negative values for deficit detection. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperlane-xyz/rebalancer': minor | ||
| --- | ||
|
|
||
| Added CompositeStrategy for chaining multiple rebalancing strategies. Routes from earlier strategies were passed as pending rebalances to later strategies for coordination. Strategy config used array format - single strategy is an array with 1 element. Also unified schema types by making bridgeLockTime optional and added name property to IStrategy interface for better logging. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| '@hyperlane-xyz/rebalancer': minor | ||
| --- | ||
|
|
||
| BaseStrategy is extended with inflight-aware rebalancing capabilities and bridge configuration support. RebalancingRoute extended with optional bridge field for bridge selection. Added three protected methods: reserveCollateral() to prevent draining collateral needed for incoming transfers, simulatePendingRebalances() for optional balance simulation, and filterRebalances() to filter routes based on actual balance sufficiency. The getRebalancingRoutes() method updated to accept optional inflightContext and integrate the new methods. getCategorizedBalances() signature updated to accept optional pendingRebalances parameter. BaseStrategy, WeightedStrategy, and MinAmountStrategy constructors extended with optional bridges parameter (ChainMap<Address[]>) to store configured bridge addresses per chain. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| --- | ||
| '@hyperlane-xyz/rebalancer': major | ||
| --- | ||
|
|
||
| Inflight-aware rebalancing system with ActionTracker, new strategies, and type safety improvements. | ||
|
|
||
| Breaking changes: | ||
| - IRebalancer.rebalance() returned RebalanceExecutionResult[] instead of void | ||
| - IStrategy.getRebalancingRoutes() accepted optional inflightContext parameter | ||
| - IStrategy required a name property | ||
| - RebalancingRoute renamed to StrategyRoute with required bridge field | ||
| - MonitorEvent included confirmedBlockTags for confirmed block queries | ||
|
|
||
| New features: | ||
| - ActionTracker for tracking pending transfers and rebalance actions with Explorer integration | ||
| - CollateralDeficitStrategy for just-in-time rebalancing based on pending inbound transfers | ||
| - CompositeStrategy for chaining multiple strategies with coordination | ||
| - BaseStrategy inflight-aware methods: reserveCollateral(), getAvailableBalance() | ||
| - Query balances at confirmed blocks to sync with Explorer indexing | ||
| - Strategy config supports array format for composing multiple strategies (backwards compatible) | ||
|
|
||
| Bug fixes: | ||
| - Record failure metrics when rebalance results contain failures | ||
| - Treat missing Dispatch event as rebalance failure | ||
| - Fix CompositeStrategy oscillation by separating proposed from pending rebalances | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.