Repository navigation
fix(dashpay): fund contested identity with the contested denomination - #866
Merged
romchornyi merged 1 commit intoJul 24, 2026
Merged
Conversation
`startCreateUsername` hardcoded `DWDP_MIN_BALANCE_TO_CREATE_USERNAME` (0.03 DASH) for the `.core` and `.platformPayment` funding paths, so a contested username registered via transparent funding under-provisioned the new identity. DPNS registration then failed with "Insufficient identity balance" (~0.028 vs the ~0.2 DASH the contested name requires), spending funds and leaving a funded orphan identity with no name and no retry path. Branch the funding amount on `isContested` (`DWDP_MIN_BALANCE_FOR_CONTESTED_USERNAME` = 0.25 DASH) for both `.core` and `.platformPayment`; the shielded path already used the contested denomination. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ 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 |
romchornyi
pushed a commit
that referenced
this pull request
Jul 24, 2026
Why: - PR #866 changed contested identity funding while PR #867 had added the registration recovery branch in the same coordinator. What: - keep the interrupted-registration recovery flow intact - fund new contested Core and Platform identities with the contested amount Validation: - xcodebuild dashpay for a generic iOS Simulator succeeded
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
Registering a contested username via the Core / Platform-Payment funding path under-funded the new identity.
DWIdentityRegistrationCoordinator.startCreateUsernamehardcodedDWDP_MIN_BALANCE_TO_CREATE_USERNAME(0.03 DASH) for both.coreand.platformPayment, ignoring whether the name is contested (which needsDWDP_MIN_BALANCE_FOR_CONTESTED_USERNAME= 0.25 DASH). The identity was created with ~0.03, then DPNS registration failed withInsufficient identity balance(~0.028 vs the ~0.2 DASH a contested name requires), spending funds and leaving a funded orphan identity with no name and no retry path. The.shieldedpath was unaffected — it already used the contested denomination.What was done?
Compute the funding amount once, branching on
isContested, and use it for both funding paths:.core→registerIdentityWithFunding(amountDuffs: requiredIdentityFundingDuffs, …).platformPayment→targetCredits = UInt64(requiredIdentityFundingDuffs) * creditsPerDuffisContestedSubmissioncomputation up (removing the later duplicate) and added a diagnostic log line (identityFundingDuffs=…).How Has This Been Tested?
Manual smoke on testnet, on device (iPhone 17 Pro):
Insufficient identity balance→ orphan identity, no name.Adddavia Core → identity funded 0.25 (funding tx+0.25, identitybb732e81…balance0.24878120), username registered, no error, no orphan.(No automated test added — the unit-test target is currently broken; verified via testnet smoke per the repo's current verification standard.)
Breaking Changes
None.
Checklist:
For repository code-owners and collaborators only
🤖 Generated with Claude Code