Skip to content

feat: enhance route validation for Linea, Zircuit, and zkSync adapters#526

Merged
0xHarbs merged 1 commit intofeat/add-native-bridgesfrom
fix/review_514
Feb 19, 2026
Merged

feat: enhance route validation for Linea, Zircuit, and zkSync adapters#526
0xHarbs merged 1 commit intofeat/add-native-bridgesfrom
fix/review_514

Conversation

@preethamr
Copy link
Copy Markdown
Collaborator

Findings (highest severity first)
High: zkSync callback flow could falsely reject valid withdrawals
l1BatchTxIndex was validated with a falsy check, so 0 (valid first tx in batch) was treated as missing and would block callback finalization.
High: native adapters accepted unsupported route pairs
linea, zircuit, and zksync adapters fell through into assumptions when route pairs didn’t match expected directions, risking malformed transactions on wrong chains.
Medium: zkSync unit tests were stale and no longer reflected implementation
Tests referenced removed helper methods and asserted old behavior (e.g., ETH withdraw target), so they did not protect current production paths.
Low: lint hygiene issues
Unused imports/vars and typing/lint issues in new adapter code.
Implemented fixes
Added explicit route validation guards in:
packages/adapters/rebalance/src/adapters/zksync/zksync.ts
packages/adapters/rebalance/src/adapters/linea/linea.ts
packages/adapters/rebalance/src/adapters/zircuit/zircuit.ts
Fixed zkSync nullish checks so valid zero values are accepted:
l1BatchNumber == null and l1BatchTxIndex == null checks instead of falsy checks.
Cleaned lint/type issues in Zircuit/Linea implementations.
Rebuilt zksync tests to match actual adapter behavior and callback proof flow.
Added route-validation tests for linea and zircuit adapters.

@0xHarbs 0xHarbs merged commit 9d8bd01 into feat/add-native-bridges Feb 19, 2026
2 of 4 checks passed
@0xHarbs 0xHarbs deleted the fix/review_514 branch February 19, 2026 13:22
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