feat(key-wallet): track internal address pools for CoinJoin accounts#821
Conversation
|
Warning Review limit reached
More reviews will be available in 34 minutes and 42 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthrough
ChangesCoinJoin Dual-Pool Refactor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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
🧹 Nitpick comments (1)
key-wallet/src/managed_account/managed_account_collection.rs (1)
588-613: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftConsolidate CoinJoin pool construction into one helper.
This branch now duplicates the same dual-pool CoinJoin build logic in
ManagedAccountType::from_account_type, and those two constructors have already drifted in adjacent Standard-path error handling. Keeping both copies in sync is going to be fragile. Extract the pool-building logic once and have both call sites delegate to it.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@key-wallet/src/managed_account/managed_account_collection.rs` around lines 588 - 613, The CoinJoin dual-pool construction logic is duplicated and should be centralized to avoid future drift. Extract the shared external/internal AddressPool setup into a single helper used by ManagedAccountType::from_account_type and the other CoinJoin constructor path, keeping the base_path cloning, ChildNumber indices, AddressPoolType values, gap limit, network, and key_source wiring in one place.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@key-wallet/src/transaction_checking/account_checker.rs`:
- Around line 559-563: The CoinJoin address matching flow is now classifying
internal addresses, but they are not included in the returned payload. Update
the CoinJoin branch in account_checker.rs, specifically the
ManagedAccountType::CoinJoin handling and the CoreAccountTypeMatch::CoinJoin
builder, so the internal_addresses collection is carried through and merged
alongside the receive/other addresses instead of being dropped. Verify the
returned CoinJoin match data includes external, internal, and any other
classified addresses consistently.
---
Nitpick comments:
In `@key-wallet/src/managed_account/managed_account_collection.rs`:
- Around line 588-613: The CoinJoin dual-pool construction logic is duplicated
and should be centralized to avoid future drift. Extract the shared
external/internal AddressPool setup into a single helper used by
ManagedAccountType::from_account_type and the other CoinJoin constructor path,
keeping the base_path cloning, ChildNumber indices, AddressPoolType values, gap
limit, network, and key_source wiring in one place.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 219b56cf-621c-400d-82dd-d66c78cf142f
📒 Files selected for processing (10)
key-wallet-ffi/src/managed_account.rskey-wallet-ffi/src/utxo_tests.rskey-wallet/src/managed_account/managed_account_collection.rskey-wallet/src/managed_account/managed_account_trait.rskey-wallet/src/managed_account/managed_account_type.rskey-wallet/src/tests/account_tests.rskey-wallet/src/transaction_checking/account_checker.rskey-wallet/src/transaction_checking/transaction_router/tests/conversions.rskey-wallet/src/transaction_checking/transaction_router/tests/routing.rskey-wallet/src/transaction_checking/wallet_checker.rs
2f6e1f7 to
2d0a191
Compare
2d0a191 to
23d0260
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## dev #821 +/- ##
==========================================
- Coverage 73.04% 73.01% -0.03%
==========================================
Files 323 323
Lines 72046 72064 +18
==========================================
- Hits 52623 52619 -4
- Misses 19423 19445 +22
|
Summary by CodeRabbit
New Features
Bug Fixes