fix(infra): include all chains in keyfunder config#7957
Conversation
…ains The keyfunder was skipping chains not in CHAINS_TO_SWEEP entirely, even if they had balance configs. This broke: - Mainnet: chains like incentiv with balances but no sweep - Testnet: ALL chains (testnet names don't match CHAINS_TO_SWEEP) Now sweep config is only added for CHAINS_TO_SWEEP chains, but all chains with valid config (balances, igp, or sweep) are included. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughSweep assignment is now restricted to chains in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@typescript/infra/src/funding/key-funder.ts`:
- Around line 138-152: The current validation lets non-numeric strings like
"abc" or "1foo" pass because parseFloat can return a number from partial
strings; update the guard in the CHAINS_TO_SWEEP branch to strictly validate
this.config.lowUrgencyKeyFunderBalances?.[chain] by converting to a Number and
checking Number.isFinite(value) && value > 0 (or use a strict numeric regex on
the trimmed string) before assigning chainConfig.sweep; specifically change the
sweepThreshold handling around the sweepThreshold variable and the parseFloat
usage so only bona fide numeric, positive thresholds are accepted into
chainConfig.sweep.
Use Number() + Number.isFinite() instead of parseFloat() to reject partial numeric strings like "1foo" that parseFloat would accept. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7957 +/- ##
=======================================
Coverage 77.02% 77.02%
=======================================
Files 117 117
Lines 2651 2651
Branches 244 244
=======================================
Hits 2042 2042
Misses 593 593
Partials 16 16
🚀 New features to boost your workflow:
|
Summary
CHAINS_TO_SWEEP, even if they had balance configsincentivwith balances but no sweep were being excludedarbitrumsepoliadon't match mainnet names inCHAINS_TO_SWEEP)Changes
CHAINS_TO_SWEEPTest plan
incentivafter deployment🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
Improvements
✏️ Tip: You can customize this high-level summary in your review settings.