-
Notifications
You must be signed in to change notification settings - Fork 56
fix(platform-wallet): raise the invitation cap to cover the contested username tier #4351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,15 +45,19 @@ use crate::wallet::identity::network::contact_requests::ContactCryptoProvider; | |
|
|
||
| use super::*; | ||
|
|
||
| /// Hard cap on the amount an invitation can lock (0.05 DASH). The voucher is a | ||
| /// Hard cap on the amount an invitation can lock (0.26 DASH). The voucher is a | ||
| /// bearer credential, so the blast radius of a leaked link is bounded here in | ||
| /// Rust — not just in the UI. Sized for onboarding: the invitee spends the | ||
| /// voucher on identity creation **plus** a normal DPNS name (~0.03 DASH — the | ||
| /// legacy `DASH_PAY_FEE`), so the previous 0.01 cap was actually below a usable | ||
| /// invitation and rejected its own onboarding default. The contested/premium-name | ||
| /// tier (~0.25 DASH) is deferred until contested-name-via-invite claim exists; | ||
| /// raise this cap when it does. | ||
| pub const MAX_INVITATION_DUFFS: u64 = 5_000_000; | ||
| /// Rust — not just in the UI. Sized for onboarding at BOTH username tiers: the | ||
| /// invitee spends the voucher on identity creation **plus** a DPNS name — a | ||
| /// normal name (~0.03 DASH, the legacy `DASH_PAY_FEE`) or a contested/premium | ||
| /// name (~0.25 DASH, `DASH_PAY_FEE_CONTESTED`), with the 0.01 margin covering | ||
| /// the create/claim fees. The earlier 0.05 value deferred the contested tier | ||
| /// "until contested-name-via-invite claim exists" — the claim path is | ||
| /// amount-agnostic and contested-invite claims are verified working, and the | ||
| /// Android wallet has funded contested invitations at 0.25 since 2024, so the | ||
| /// deferral is over. (The pre-merge 0.01 iteration was below even a usable | ||
| /// non-contested invitation and rejected its own onboarding default.) | ||
| pub const MAX_INVITATION_DUFFS: u64 = 26_000_000; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Add regression coverage for the contested invitation boundary The reported failure was specifically caused by 25,000,000 duffs being rejected, but no test references source: ['codex'] |
||
|
|
||
| /// Floor on the amount an invitation can lock (0.003 DASH). A voucher funds a | ||
| /// Platform identity operation, and creating an identity — which is what the | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Update the downstream invitation limits.
The Rust cap now accepts up to
26_000_000duffs, but downstream contracts still use5_000_000.packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Views/DashPay/CreateInvitationSheet.swift, Lines 24-26: update the local validation limit. Otherwise, the Swift flow rejects valid contested invitations before calling Rust.packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/tokens/Dashpay.kt, Lines 405-421: update the SDK documentation to prevent an incorrect public contract.Prefer exposing the Rust limit through the client APIs instead of maintaining independent literals. Add client-level boundary coverage for an amount between the old and new caps.
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Swift cap and Kotlin KDoc mismatches are valid. The obsolete contract also remains in
docs/dashpay/DIP15_INVITATIONS_SPEC.md, the Kotlin example's displayed range and test plan, and the Swift Info.plist security note; the Rust guard also lacks direct coverage for 25,000,000, 26,000,000, and 26,000,001 duffs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 201001
🏁 Script executed:
Length of output: 91544
🏁 Script executed:
Length of output: 60015
@thepastaclaw, confirmed. The expanded scope is valid.CreateInvitationSheet.swifthas the actual stale Swift upper-bound validation. It rejects every amount above5_000_000duffs.0.003–0.05range is stale display text. Rust remains the enforcement point.packages/swift-sdk/SwiftExampleApp/Info.plistpackages/swift-sdk/SwiftExampleApp/SwiftExampleApp/AI_QA/QA004_invitation_reclaim.mdpackages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/dashpay/CreateInvitationSheet.ktpackages/kotlin-sdk/KotlinExampleApp/TEST_PLAN.mdpackages/kotlin-sdk/PARITY.mddocs/dashpay/DIP15_INVITATIONS_SPEC.md, including the old deferred contested-name statement and the obsolete0.01 DASHleak-cap text.MAX_INVITATION_DUFFS.The focused fix should update all user-visible contracts to
26_000_000duffs (0.26 DASH). It should extract the Rust amount guard into a direct test seam. Tests should accept25_000_000and26_000_000duffs, and reject26_000_001duffs. Swift should also test that its local validation accepts25_000_000duffs.✏️ Learnings added
You are interacting with an AI system.