Revert "feat(wallet): HD receive rotation via contract repository (#473)"#488
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
💤 Files with no reviewable changes (8)
WalkthroughThis PR removes HD receive-rotation functionality and its supporting infrastructure across the wallet, identity, and contract-sync layers. Specifically, it eliminates ChangesWallet Receive-Rotation Feature Removal
Contract Refresh/Sync Semantics Simplification
Identity and Public API Surface Cleanup
Test and Minor Fix Cleanup
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
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 docstrings
🧪 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.
Review: Revert of #473 (HD receive rotation)
Verdict: APPROVE — clean revert, no cross-repo breakage, returns to stable pre-#473 baseline.
What I checked
- Full diff across all 12 changed files
- Cross-repo grep of all downstream consumers (banco, btcpay-arkade, wallet, demos, arkade-explorer, boltz-swap, go-sdk, rust-sdk, dotnet-sdk) for removed exports (
WalletMode,isHDCapableIdentity,walletReceiveRotator,ReceiveRotatorFactory,includeInactive) - Git history on
feat/hd-wallet-via-contractsbranch vs master - Protocol-critical surface analysis
Findings
No cross-repo breakage. WalletMode was exported from src/index.ts but zero downstream repos import it. All other removed symbols (isHDCapableIdentity, WalletReceiveRotator, ReceiveRotatorFactory) were internal — never exported from the package entrypoint.
No protocol-critical regressions. The reverted code was purely additive (HD receive rotation lifecycle). Removing it returns to the shipping baseline. VTXO handling, transaction signing, forfeit paths, round lifecycle, and exit paths are untouched by this diff — the only wallet.ts changes are removing the rotator wiring and restoring offchainTapscript to readonly (correct — no concurrent mutation without the rotator).
The finalizeAsyncPayment snapshot removal is safe. The pre-#473 code reads this.offchainTapscript directly. The snapshot pattern was only needed because the rotator could mutate offchainTapscript concurrently. No rotator → no race → snapshot unnecessary.
One issue to track separately
src/wallet/unroll.ts — BigInt(feeRate) without Math.ceil will throw RangeError if the onchain provider returns a fractional sat/vB (bitcoind regtest returns e.g. 1.006). PR #473 bundled a fix (Math.ceil(feeRate)) that this revert correctly removes (it wasn't in master before #473). This is a pre-existing bug on master, not introduced by this revert. Recommend a separate 1-line fix PR:
// src/wallet/unroll.ts ~line 335
const feeAmount = txWeightEstimator.vsize().fee(BigInt(Math.ceil(feeRate)));Summary
Clean revert. No orphaned references, no broken imports, no protocol-level concerns. Test count returns to pre-#473 baseline (1137/1138 as noted in PR description). Ship it.
🤖 Reviewed by Arkana
Reverts the squash-merge of #473 (
4eec1120).Merged too early — needs more bake time before HD receive rotation lands. The original PR branch (
feat/hd-wallet-via-contracts) has been restored at its pre-merge tip (afb6def2) and PR #473 will be reopened to continue review.No code changes other than the inverse of the merge commit.
pnpm exec tsc --noEmitclean,pnpm test:unit1137/1138 pass (back to pre-#473 count).Summary by CodeRabbit
Bug Fixes
Refactoring