fix(HubPoolClient): handle zero-address SVM pool rebalance routes - #1499
Merged
Conversation
Processing a SetPoolRebalanceRoute event that disables an SVM route (destinationToken = zero address) threw "SVM USDC address mismatch", which would permanently crash every HubPoolClient consumer once such an event is emitted on-chain. Exempt the zero address from the SVM USDC translation and store it as-is, matching EVM route-disable semantics: route lookups at or after the disable block resolve to undefined and l2TokenEnabledForL1TokenAtBlock returns false. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
pxrl
approved these changes
Jul 28, 2026
Contributor
Author
Contributor
Author
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
A queued HubPool admin batch prunes pool rebalance routes by setting their destination token to the zero address, including the route for USDC on Solana (
setPoolRebalanceRoute(34268394551451, USDC, 0x0)).HubPoolClient'sSetPoolRebalanceRouteevent processing requires any SVM-destination event to carry (truncated) SVM USDC as the destination token and throws otherwise. A zero-address disable event for Solana therefore makesHubPoolClient.update()throw — permanently, for every consumer (dataworker, relayer, finalizer), from the moment the event is mined — sinceSetPoolRebalanceRouteis searched from deep history on every update.Changes
getL2TokenForL1TokenAtBlockreturnsundefined,l2TokenEnabledForL1TokenAtBlockreturnsfalse, andgetL1TokenForL2TokenAtBlockno longer resolves the token from the disable block onwards.Testing
New test
correctly disables an SVM rebalancing routecovers: update does not throw on the disable event, the route still resolves at pre-disable blocks, and all three lookups correctly report the route as removed at the disable block.yarn hardhat test test/HubPoolClient.DepositToDestinationToken.ts: 9 passing.🤖 Generated with Claude Code