Skip to content

fix(HubPoolClient): handle zero-address SVM pool rebalance routes - #1499

Merged
pxrl merged 2 commits into
masterfrom
droplet/C0BHMM63D9Q-1785247449
Jul 28, 2026
Merged

fix(HubPoolClient): handle zero-address SVM pool rebalance routes#1499
pxrl merged 2 commits into
masterfrom
droplet/C0BHMM63D9Q-1785247449

Conversation

@droplet-rl

Copy link
Copy Markdown
Contributor

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's SetPoolRebalanceRoute event 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 makes HubPoolClient.update() throw — permanently, for every consumer (dataworker, relayer, finalizer), from the moment the event is mined — since SetPoolRebalanceRoute is searched from deep history on every update.

Changes

  • Exempt the zero address from the SVM USDC translation/validation and store it untranslated, matching EVM route-disable semantics. Downstream lookups already handle it: getL2TokenForL1TokenAtBlock returns undefined, l2TokenEnabledForL1TokenAtBlock returns false, and getL1TokenForL2TokenAtBlock no longer resolves the token from the disable block onwards.
  • The mismatch throw is preserved for genuine non-USDC SVM routes (existing test still passes).

Testing

New test correctly disables an SVM rebalancing route covers: 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

droplet-rl and others added 2 commits July 28, 2026 14:44
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>
@droplet-rl

Copy link
Copy Markdown
Contributor Author

Thanks for the review, @pxrl. No inline comments to address, so no further changes from my side — CI (Builds/Lint/Test) is still running on 37f0b7e; once it's green this is ready to merge.

@droplet-rl

Copy link
Copy Markdown
Contributor Author

🔎 View trace

@pxrl
pxrl merged commit 404a650 into master Jul 28, 2026
4 checks passed
@pxrl
pxrl deleted the droplet/C0BHMM63D9Q-1785247449 branch July 28, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants