Repository navigation
feat(wallet): domain model for sending to any destination - #1406
romchornyi wants to merge 1 commit into
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 59 minutes. View limit details
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. |
|
✅ Final review complete — no blockers (commit 3d7d56a) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The PR introduces three confirmed blocking issues: active localization keys are removed, SendSource does not compile with its new Set usage, and malformed Unicode input can crash the Bech32 decoder. Additional suggestions cover unbounded URI parsing, incomplete pre-broadcast outcome mapping, and unresolved or incorrect ADR references. The available CI snapshot has no failed code check; title validation failed as a policy check, while other checks remain queued.
🔴 3 blocking | 🟡 4 suggestion(s)
7 finding(s) not shown inline (GitHub refused the PR diff as too large)
🔴 Blocking: Restore localization keys still used by the application
DashWallet/en.lproj/Localizable.strings:307-311
This catalog cleanup removes keys that remain in active source, and the same deletions appear across the localized catalogs. Confirmed live lookups include "The wallet could not check your DashPay username. Open the link again." in PlatformDashConnectDataSource.swift, "The details of this connection could not be read." in ConnectionSheet.swift, "No biometric spending limit is set" in AdvancedSecurityViewModel.swift, and "You need at least %@ Dash to create this username" in CreateUsernameViewModel.swift. Removing these entries causes every non-English locale to fall back to the key/English default for those screens. Restore the entries or remove/update every corresponding lookup.
source: gpt-6.1-sol (phase2-reviewer: general, security-auditor)
🔴 Blocking: Declare SendSource as Hashable
DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendSource.swift:21
The new tests construct Set(SendSource.allCases), and SendPairPolicy compares SendSource values. SendSource only declares CaseIterable, so the required Hashable and Equatable conformances are not synthesized and the app/test targets cannot compile.
enum SendSource: CaseIterable, Hashable {
source: fresh:general
🔴 Blocking: Reject non-ASCII input before invoking Bech32m.decode
DashWallet/Sources/UI/Payments/PaymentModels/DWParsedPaymentURI.swift:56
DashAddressClassifier forwards arbitrary input directly to the SDK decoder. For a malformed value such as "é1qqqqqq", the decoder reaches checksum verification with a non-ASCII HRP; its hrpExpand implementation force-unwraps char.asciiValue, so the pasted or scanned destination crashes the process instead of returning nil. Guard the input to the decoder to ASCII before calling it.
guard text.utf8.allSatisfy({ $0 < 128 }),
text.utf8.count <= maxBech32mLength,
let decoded = decode(text.lowercased()) else { return nil }
source: fresh:general
🟡 Suggestion: Bound raw URI and clipboard input before parsing
DashWallet/Sources/UI/Payments/ExternalSend/Domain/DestinationParser.swift:37-43
The parser bounds Base58 and Bech32m destinations, but a colon-bearing input is passed to BIP70URI without a raw-size limit. BIP70URI splits and percent-decodes every query pair, so a large dash:?r=...&x=... payload can cause substantial temporary allocations. find(in:) also materializes all whitespace-separated words before any candidate is parsed. Apply a documented input bound before constructing BIP70URI and before components(separatedBy:) so untrusted pasteboard, deep-link, and scan input cannot bypass the parser's existing decoder limits.
source: gpt-6.1-sol (phase2-reviewer: general, security-auditor); security-auditor
🟡 Suggestion: Map known pre-broadcast failures to notSent
DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift:42-51
Only BIP70Error.expired is classified explicitly, so failures such as badURL, malformedRequest, networkMismatch, untrustedCertificate, nonStandardScript, missingPaymentURL, and walletNotReady fall through to the NSError mapping and become inFlight. The same happens to WalletSendService's initialRestoreSync error through the default ErrorCode branch at lines 141-150, even though that gate throws before authentication, input selection, signing, or broadcast. Once the next service layer routes these failures through SendOutcome, users will see an in-progress state for sends that never left the device. Map errors proven to occur before build/lock/signing to notSent while retaining inFlight for post-handover and ambiguous failures.
source: muse-spark-1.3-contributor (phase1-reviewer: general)
🟡 Suggestion: Record or remove the unresolved external-send ADR references
DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendPairPolicy.swift:79
The new policy cites ADR-0038 and ADR-0041, while SendOutcome cites ADR-0040 and SendRoute cites ADR-0041, but none of those records exists in docs/adr at this head; the index ends at ADR-0033. The stack description says the public copies will arrive in #1409, but merging this standalone layer leaves dangling references and places significant decisions outside the PR that introduces them. Add the proposed ADRs and index entries here, or remove the references until the decisions are recorded in this PR.
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.1-sol (phase2-reviewer: general, security-auditor)
🟡 Suggestion: Remove the unrelated ADR-0009 citation
DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendRoute.swift:52-53
The isFeeExact documentation cites ADR-0009, but docs/adr/0009 records the App Connect login decision and does not describe fee exactness or external-send routing. This sends maintainers to an unrelated decision record. Remove the citation or replace it with the decision record that actually governs this fee behavior.
/// Whether the fee prepared at Continue is the fee the send pays. Only Core → Core, which also carries
/// BIP70 payment requests, is built and signed at Continue; every other route's fee is an estimate.
source: muse-spark-1.3-contributor (phase1-reviewer: general)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a substantial domain-logic change spanning destination parsing, network validation, send-pair routing, amount rules, outcome mapping, and shared payment helpers, but it does not itself implement funds movement, cryptography, key handling, or another critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Second Phase-2 pass: on this first full review every Phase-2 reviewer also ran a second, independent time, and the verifier weighed both sets
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `DashWallet/en.lproj/Localizable.strings`:
- [BLOCKING] DashWallet/en.lproj/Localizable.strings:307-311: Restore localization keys still used by the application
This catalog cleanup removes keys that remain in active source, and the same deletions appear across the localized catalogs. Confirmed live lookups include "The wallet could not check your DashPay username. Open the link again." in PlatformDashConnectDataSource.swift, "The details of this connection could not be read." in ConnectionSheet.swift, "No biometric spending limit is set" in AdvancedSecurityViewModel.swift, and "You need at least %@ Dash to create this username" in CreateUsernameViewModel.swift. Removing these entries causes every non-English locale to fall back to the key/English default for those screens. Restore the entries or remove/update every corresponding lookup.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendSource.swift`:
- [BLOCKING] DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendSource.swift:21: Declare SendSource as Hashable
The new tests construct Set(SendSource.allCases), and SendPairPolicy compares SendSource values. SendSource only declares CaseIterable, so the required Hashable and Equatable conformances are not synthesized and the app/test targets cannot compile.
In `DashWallet/Sources/UI/Payments/PaymentModels/DWParsedPaymentURI.swift`:
- [BLOCKING] DashWallet/Sources/UI/Payments/PaymentModels/DWParsedPaymentURI.swift:56: Reject non-ASCII input before invoking Bech32m.decode
DashAddressClassifier forwards arbitrary input directly to the SDK decoder. For a malformed value such as "é1qqqqqq", the decoder reaches checksum verification with a non-ASCII HRP; its hrpExpand implementation force-unwraps char.asciiValue, so the pasted or scanned destination crashes the process instead of returning nil. Guard the input to the decoder to ASCII before calling it.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/DestinationParser.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Payments/ExternalSend/Domain/DestinationParser.swift:37-43: Bound raw URI and clipboard input before parsing
The parser bounds Base58 and Bech32m destinations, but a colon-bearing input is passed to BIP70URI without a raw-size limit. BIP70URI splits and percent-decodes every query pair, so a large dash:?r=...&x=... payload can cause substantial temporary allocations. find(in:) also materializes all whitespace-separated words before any candidate is parsed. Apply a documented input bound before constructing BIP70URI and before components(separatedBy:) so untrusted pasteboard, deep-link, and scan input cannot bypass the parser's existing decoder limits.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift:42-51: Map known pre-broadcast failures to notSent
Only BIP70Error.expired is classified explicitly, so failures such as badURL, malformedRequest, networkMismatch, untrustedCertificate, nonStandardScript, missingPaymentURL, and walletNotReady fall through to the NSError mapping and become inFlight. The same happens to WalletSendService's initialRestoreSync error through the default ErrorCode branch at lines 141-150, even though that gate throws before authentication, input selection, signing, or broadcast. Once the next service layer routes these failures through SendOutcome, users will see an in-progress state for sends that never left the device. Map errors proven to occur before build/lock/signing to notSent while retaining inFlight for post-handover and ambiguous failures.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendPairPolicy.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendPairPolicy.swift:79: Record or remove the unresolved external-send ADR references
The new policy cites ADR-0038 and ADR-0041, while SendOutcome cites ADR-0040 and SendRoute cites ADR-0041, but none of those records exists in docs/adr at this head; the index ends at ADR-0033. The stack description says the public copies will arrive in #1409, but merging this standalone layer leaves dangling references and places significant decisions outside the PR that introduces them. Add the proposed ADRs and index entries here, or remove the references until the decisions are recorded in this PR.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendRoute.swift`:
- [SUGGESTION] DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendRoute.swift:52-53: Remove the unrelated ADR-0009 citation
The isFeeExact documentation cites ADR-0009, but docs/adr/0009 records the App Connect login decision and does not describe fee exactness or external-send routing. This sends maintainers to an unrelated decision record. Remove the citation or replace it with the decision record that actually governs this fee behavior.
209dff0 to
8050bc4
Compare
|
Answers to the review of
|
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Updated after discussion: 2 finding(s) of this review were settled in the inline threads; no blocking finding remains.
- ✅ Withdrawn: 🔴 Declare SendSource as Hashable
- ✅ Withdrawn: 🔴 Declare AddressForm Equatable before comparing forms
The reviewed head still contains two compile-time conformance errors in the new domain model, plus a zero-amount validation defect that can allow an invalid send to pass the domain check. The simulator test check remains in progress; no completed code check failure is available in the supplied CI snapshot.
🔴 2 0 blocking
Follow-up candidates (optional) (1)
New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.
🟡 Suggestion: Reject zero amounts in AmountRules.check
DashWallet/Sources/UI/Payments/ExternalSend/Domain/AmountRules.swift:49-51
The check accepts amount == 0 whenever balance covers the fee, returning .ok for every funded source. This domain method is described as deciding whether a typed amount can be sent, and the existing send boundary rejects zero amounts, so allowing zero here can enable Continue for an invalid zero-value payment before the later executor rejects it. Add an explicit positive-amount guard before the spendable-balance check.
guard amount > 0,
let spendable = spendable(balance: balance, fee: fee),
amount <= spendable else {
return .notEnough
}
source: gpt-6.1-sol (phase2-reviewer: general)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a substantial domain-logic change spanning destination parsing, network validation, send-pair routing, amount rules, outcome mapping, localization, and test-target integration, but the diff itself does not implement funds movement, signing, coin selection, cryptography, key handling, or storage migration. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Code unchanged since the last final review (
209dff05): 2 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed, 1 not confirmed (now follow-up candidates) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendSource.swift`:
- [BLOCKING → WITHDRAWN in discussion; do not fix] DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendSource.swift:21: Declare SendSource as Hashable
The enum still declares only CaseIterable, but SendPairPolicy compares SendSource values and the new tests construct Set<SendSource>. A value-less enum does not acquire the required Hashable conformance merely from having no associated values, so the dashpay target cannot compile these uses until the conformance is declared explicitly.
In `DashWallet/Sources/Models/PaymentProtocol/ScriptAddressCodec.swift`:
- [BLOCKING → WITHDRAWN in discussion; do not fix] DashWallet/Sources/Models/PaymentProtocol/ScriptAddressCodec.swift:61-64: Declare AddressForm Equatable before comparing forms
DestinationParser compares the result of addressForm(forVersion:) with .scriptHash at line 99, but AddressForm has no Equatable conformance. The comparison therefore has no applicable == overload and prevents the destination parser from compiling.
_Raised on code unchanged since the last review, and confirmed by an independent pass: The dashpay target compiles DestinationParser.swift, whose `address` method evaluates `form == .scriptHash`, but AddressForm does not conform to Equatable. Swift has no applicable `==` overload for that enum, so the target fails to compile._
| import Foundation | ||
|
|
||
| /// Where an external send takes its funds from. | ||
| enum SendSource: CaseIterable { |
There was a problem hiding this comment.
✅ Withdrawn at
8050bc47; see the replies below.
🔴 Blocking: Declare SendSource as Hashable
The enum still declares only CaseIterable, but SendPairPolicy compares SendSource values and the new tests construct Set. A value-less enum does not acquire the required Hashable conformance merely from having no associated values, so the dashpay target cannot compile these uses until the conformance is declared explicitly.
| enum SendSource: CaseIterable { | |
| enum SendSource: CaseIterable, Hashable { |
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
Not changing this: an enum without associated values gets Equatable and Hashable synthesized, so SendSource already conforms; the target compiles and DashWalletTests on simulator pass on this head (8050bc4), including the tests that build Set<SendSource>.
There was a problem hiding this comment.
I checked the current checkout: SendSource declares only CaseIterable, and there is no separate Hashable extension. Swift can synthesize Hashable for this enum only after the conformance is declared; having no associated values does not implicitly make the type conform. The Set(SendSource.allCases) test therefore still requires SendSource: Hashable, regardless of the reported simulator result.
There was a problem hiding this comment.
Per the Swift standard library documentation for Hashable: "For an enum, all its associated values must conform to Hashable. (An enum without associated values has Hashable conformance even without the declaration.)" SendSource has no associated values, so it is Hashable without the declaration; the dashpay target compiles Set(SendSource.allCases) and DashWalletTests pass on this head. Leaving this to a maintainer.
There was a problem hiding this comment.
You’re right; my earlier finding was incorrect. Swift automatically provides Equatable and Hashable for enums without associated values, so SendSource is valid in Set<SendSource> without an explicit declaration. The successful CI result is consistent with that behavior.
Withdrawing this finding.
There was a problem hiding this comment.
Withdrawn (re-reviewed at 8050bc47): This is not a compile defect on the reviewed head: SendSource has no associated values, so it has the required Hashable behavior without an explicit declaration, and the successful simulator test check covers Set usage.
| enum AddressForm { | ||
| case pubkeyHash | ||
| case scriptHash | ||
| } |
There was a problem hiding this comment.
✅ Withdrawn at
8050bc47; see the replies below.
🔴 Blocking: Declare AddressForm Equatable before comparing forms
DestinationParser compares the result of addressForm(forVersion:) with .scriptHash at line 99, but AddressForm has no Equatable conformance. The comparison therefore has no applicable == overload and prevents the destination parser from compiling.
Raised on code unchanged since the last review, and confirmed by an independent pass: The dashpay target compiles DestinationParser.swift, whose address method evaluates form == .scriptHash, but AddressForm does not conform to Equatable. Swift has no applicable == overload for that enum, so the target fails to compile.
| enum AddressForm { | |
| case pubkeyHash | |
| case scriptHash | |
| } | |
| enum AddressForm: Equatable { |
source: gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
Not changing this: AddressForm has no associated values, so Equatable is synthesized and form == .scriptHash compiles; DashWalletTests on simulator pass on this head (8050bc4).
There was a problem hiding this comment.
I checked the current checkout: AddressForm declares neither Equatable nor an equality operator, and there is no separate conformance extension. Swift synthesizes Equatable only when the type explicitly declares that conformance; an enum with no associated values does not implicitly conform. The form == .scriptHash expression therefore still needs AddressForm: Equatable, notwithstanding the reported simulator result.
There was a problem hiding this comment.
Per the Swift standard library documentation for Equatable: "(An enum without associated values has Equatable conformance even without the declaration.)" AddressForm has no associated values, so form == .scriptHash compiles; DashWalletTests pass on this head. Leaving this to a maintainer.
There was a problem hiding this comment.
You’re right; my earlier finding was incorrect. Swift automatically provides Equatable for enums without associated values, so form == .scriptHash is valid without an explicit declaration on AddressForm. The successful CI result confirms the parser compiles as written.
Withdrawing this finding.
There was a problem hiding this comment.
Withdrawn (re-reviewed at 8050bc47): This is not a compile defect on the reviewed head: AddressForm has no associated values, so the Swift toolchain synthesizes the required Equatable behavior, and the successful simulator test check confirms the comparison compiles.
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review after discussion — commit 8050bc4
Standing review was CHANGES_REQUESTED; this re-review is COMMENT: no blocking findings remain.
Not approved yet: on a later review round an approval needs the fresh Phase-2 audit of the whole change, which the review of this commit skipped because it had found a blocker. That audit is queued for this commit and approves if it finds nothing.
No longer blocking:
- Declare SendSource as Hashable
- Declare AddressForm Equatable before comparing forms
Same commit as the standing review; the inline threads above carry the per-finding outcome. This follow-up exists only to correct the verdict.
Review provenance
Source: conversation lane gpt-6.1-sol (agent: conversation); no reviewer or verifier lanes ran for this follow-up
- Verdict moved because the inline discussion withdrew or deferred findings of the standing review of this commit; the code was not re-reviewed
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review after discussion — commit 8050bc4
Standing review was COMMENTED; this re-review is REQUEST_CHANGES: 1 blocking finding(s) now stand.
🔴 1 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
No longer blocking:
- Declare SendSource as Hashable
- Declare AddressForm Equatable before comparing forms
The domain model is well covered by focused tests, target membership is present, and the CI snapshot is green for this head. One outcome classification is incorrect for definitive shielded broadcast failures and blocks safe retry on direct Shielded/Platform sends; two lower-severity domain consistency issues remain.
Follow-up candidates (optional) (2)
New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.
🟡 Suggestion: Non-Core dash: links drop label and message
DashWallet/Sources/UI/Payments/ExternalSend/Domain/DestinationParser.swift:72-76
When a dash: link contains a Platform address, Shielded address, or Identity ID, the parser reconstructs Destination with only the type, text, script form, and amount. The same link parser preserves label and message for Core destinations, so non-Core links silently discard merchant-provided metadata even though Destination models both fields. The comment justifies dropping the request URL for non-Core links, not dropping these independent fields.
return .success(Destination(type: destination.type, text: destination.text,
isScriptForm: destination.isScriptForm, amountDuffs: link.amount,
label: link.label, message: link.message))
source: muse-spark-1.3-contributor (phase1-reviewer: general)
🟡 Suggestion: SendBalances fabricates zero for identity
DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendPairPolicy.swift:24-30
SendBalances stores only Core, Shielded, and Platform L1 duffs, while Identity funds are credits represented elsewhere by IdentityCreditBalance. Returning 0 for .identity makes an absent or differently-unitized balance look like a real zero balance. startingSource currently excludes Identity from auto-picking, but the public method still accepts every SendSource, so a future caller could silently treat an Identity source as empty rather than discovering the unit mismatch.
func balance(of source: SendSource) -> UInt64 {
switch source {
case .core: return core
case .shielded: return shielded
case .platform: return platform
case .identity: preconditionFailure("identity balance is credits, not duffs in SendBalances")
}
}
source: muse-spark-1.3-contributor (phase1-reviewer: general)
Same commit as the standing review; the inline threads above carry the per-finding outcome. This follow-up exists only to correct the verdict.
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a large cross-cutting domain-model change that defines destination parsing, routing, amount validation, and send outcomes, but the diff does not itself perform funds movement, signing, key handling, consensus, or other critical-surface operations. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Code unchanged since the last final review (
8050bc47): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed; 2 new suggestion(s) listed as follow-up candidates, not posted inline - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift`:
- [BLOCKING] DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift:117-136: Do not classify definitive shielded broadcast failures as in-flight
`PlatformWalletError.shieldedBroadcastFailed` is documented by the pinned SwiftDashSDK as a definitive failure: the shielded transition was not executed and spent notes were released, so retry is safe. This mapper leaves the case in the `default` branch and returns `.inFlight`, suppressing Retry for direct Shielded/Platform sends that are known not to have executed. The same error can also arise during a Core asset-lock second leg, where the result must remain in-flight if the asset lock was already recorded, so adding a universal enum case is not sufficient; the route/phase must be supplied to this mapping or the executor must normalize the error before calling it. The current `testPlatformRejectionAfterHandoverIsInFlight` test incorrectly treats this definitive failure as universally in-flight.
_Raised on code unchanged since the last review, and confirmed by an independent pass: For a direct Shielded-to-* or Platform-to-Shielded send, a `PlatformWalletError.shieldedBroadcastFailed` reaches `SendOutcome(error:)` and falls through to `.inFlight`, so the result suppresses Retry even though the SDK guarantees that the shielded transition was not executed and the spent notes were released. The same mapper also recursively applies this classification to a Core asset-lock second leg, where `.inFlight` is correct, so the error cannot be fixed with a universal enum mapping._
8050bc4 to
d30bf44
Compare
|
Re-review at 8050bc4, addressed in d30bf44:
|
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The external-send domain model and input-boundary changes are otherwise consistent with the reviewed architecture, and the completed target-membership, workflow, accessibility, and CodeRabbit checks passed. One blocking outcome-classification defect remains: the pinned SDK explicitly marks shielded broadcast failures and address-nonce mismatches as definitive non-execution cases that safely permit retry, but this head still reports both as in flight; the simulator test check was still running.
🔴 1 blocking
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a substantial cross-cutting domain-model change affecting destination parsing, network validation, send-route policy, amount rules, and outcome mapping, but the diff does not itself implement funds movement, cryptography, key handling, or other critical-surface behavior. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift`:
- [BLOCKING] DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift:117-136: Do not classify definitive shielded broadcast failures as in-flight
The pinned Platform revision in `.platform-ref` documents both `ErrorShieldedBroadcastFailed` and `ErrorAddressNonceMismatch` as definitive failures: the transition did not execute, reservations were released, and retry is safe. Because `PlatformWalletError.shieldedBroadcastFailed` and `.addressNonceMismatch` are not handled here, they fall through to `default: .inFlight`, which removes the Retry path and tells the user that a payment may still be processing even though the SDK says no funds left the source. Deferring this to the later pin bump does not resolve the defect for the SDK revision this app currently consumes.
| private static func outcome(for error: PlatformWalletError) -> SendOutcome { | ||
| switch error { | ||
| case .transactionBroadcastRejected: | ||
| return .notSent(.rejected) | ||
| case .signingKeyUnavailable: | ||
| return .notSent(.signingKeyUnavailable) | ||
| case .staleReservationToken, .coreInsufficientFunds, .shieldedNoRecordedAnchor: | ||
| return .notSent(.failed) | ||
| // Refusals of an asset lock's coin selection: nothing was built or broadcast. | ||
| case .assetLockInsufficientFunds, .noSelectableInputs, .assetLockTooManyInputs: | ||
| return .notSent(.failed) | ||
| // The only producer of this code is the FFI's `identity_manager_remove_identity`, which no send calls. | ||
| case .identityNotFound: | ||
| return .notSent(.identityNotFound) | ||
| // The Platform withdrawal's address network check runs before signing; the Platform-to-shielded capacity | ||
| // checks run during input selection and the input fetch, before the proof is built. | ||
| case .invalidNetwork, .shieldedInsufficientBalance: | ||
| return .notSent(.failed) | ||
| default: | ||
| return .inFlight |
There was a problem hiding this comment.
⚖️ Disputed (left to the maintainers; not blocking) at
f5e8f706; see the replies below.
🔴 Blocking: Do not classify definitive shielded broadcast failures as in-flight
The pinned Platform revision in .platform-ref documents both ErrorShieldedBroadcastFailed and ErrorAddressNonceMismatch as definitive failures: the transition did not execute, reservations were released, and retry is safe. Because PlatformWalletError.shieldedBroadcastFailed and .addressNonceMismatch are not handled here, they fall through to default: .inFlight, which removes the Retry path and tells the user that a payment may still be processing even though the SDK says no funds left the source. Deferring this to the later pin bump does not resolve the defect for the SDK revision this app currently consumes.
| private static func outcome(for error: PlatformWalletError) -> SendOutcome { | |
| switch error { | |
| case .transactionBroadcastRejected: | |
| return .notSent(.rejected) | |
| case .signingKeyUnavailable: | |
| return .notSent(.signingKeyUnavailable) | |
| case .staleReservationToken, .coreInsufficientFunds, .shieldedNoRecordedAnchor: | |
| return .notSent(.failed) | |
| // Refusals of an asset lock's coin selection: nothing was built or broadcast. | |
| case .assetLockInsufficientFunds, .noSelectableInputs, .assetLockTooManyInputs: | |
| return .notSent(.failed) | |
| // The only producer of this code is the FFI's `identity_manager_remove_identity`, which no send calls. | |
| case .identityNotFound: | |
| return .notSent(.identityNotFound) | |
| // The Platform withdrawal's address network check runs before signing; the Platform-to-shielded capacity | |
| // checks run during input selection and the input fetch, before the proof is built. | |
| case .invalidNetwork, .shieldedInsufficientBalance: | |
| return .notSent(.failed) | |
| default: | |
| return .inFlight | |
| // Definitive shielded failures at the pinned SDK revision did not execute and released reservations. | |
| case .shieldedBroadcastFailed, .addressNonceMismatch: | |
| return .notSent(.failed) | |
| default: | |
| return .inFlight |
source: muse-spark-1.3-contributor (phase1-reviewer: general); gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
Fixed in 4322c14 for the shielded case: shieldedBroadcastFailed is now .notSent(.failed) and offers Retry. addressNonceMismatch stays in flight on purpose: the Rust-owned delivery class coming in dashpay/platform#5928 classes it as maybe-sent, so the app keeps the safe side until it reads that class.
There was a problem hiding this comment.
Still applies (re-reviewed at 4322c140): The shielded case is now correctly classified, but the pinned platform source still documents address-nonce mismatch as definitively unexecuted and safe to retry. The future platform delivery class is not part of this app revision, so retaining .inFlight remains unsafe for the dependency actually consumed by this head.
There was a problem hiding this comment.
Deferred to #1427: the app will read the outcome from the Rust-owned delivery class (dashpay/platform#5928) when the pin moves, instead of a per-code switch. Until then .inFlight is the funds-safe side: no Retry is offered, so nothing is paid twice. The shielded case was fixed in the previous round.
There was a problem hiding this comment.
Disputed (re-reviewed at f5e8f706): We still disagree on this one, and my answer is above, so I'm leaving the call to the maintainers. It no longer blocks this pull request, and I won't raise it again unless a later change brings the problem back.
d30bf44 to
4322c14
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The exact head fixes the shielded broadcast-failure mapping, but the pinned SDK still defines address-nonce mismatch as a definitive, retry-safe failure while this PR maps it to in-flight. The head also conflicts with the current develop tip in the ADR index, and that conflict must be resolved before merge; the simulator test check was still in progress with no reported code-check failure.
🔴 2 blocking
Still open from earlier rounds (1)
- 🔴 Blocking: Do not classify definitive shielded broadcast failures as in-flight —
DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift:138-140(thread)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a large, cross-cutting domain-model change affecting payment destination parsing, network validation, send routing, amount rules, and outcome mapping, but it does not itself execute funds movement, alter consensus, handle keys, or cross an FFI boundary. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Code unchanged since the last final review (
d30bf44f): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `docs/adr/README.md`:
- [BLOCKING] docs/adr/README.md:40-49: Resolve the ADR index conflict with the current develop branch
The current develop tip `a00541e0db15d9c6571ea3249ed7812ec4f35246` adds ADR-0053 to this same table, while this head adds ADR-0036 through ADR-0045 from the older merge base. The merge-tree reports a content conflict in `docs/adr/README.md`; merging without resolving it can lose either the external-send entries or the newer DashConnect entry. Rebase or otherwise resolve the table so both sets of valid ADR entries remain.
_Raised on code unchanged since the last review, and confirmed by an independent pass: Merging PR head 4322c1408 with develop a00541e0d produces a content conflict in docs/adr/README.md, so the merge cannot complete without manual resolution; choosing either side wholesale would omit the other branch's valid ADR rows._
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift`:
- [BLOCKING] DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift:138-140: Do not classify definitive shielded broadcast failures as in-flight
(carried; thread: https://github.com/dashpay/dashwallet-ios/pull/1406#discussion_r4569201588)
| | [0036](0036-ship-the-ios-screens-and-the-sdk-binding-as-two-surfaces.md) | Ship the iOS screens and the SDK binding as two surfaces | platform | Proposed | | | ||
| | [0037](0037-build-external-send-as-a-new-module-over-the-existing-spend-seams.md) | Build external send as a new module over the existing spend seams | payments | Proposed | | | ||
| | [0038](0038-decide-every-source-and-destination-pair-in-one-policy.md) | Decide every source and destination pair in one policy | payments | Proposed | | | ||
| | [0039](0039-estimate-the-fee-on-send-and-recompute-it-on-confirm.md) | Estimate the fee on Send and recompute it on Confirm | payments | Superseded | [0043](0043-bind-the-fee-where-the-sdk-can-and-mark-the-rest-as-an-estimate.md) | | ||
| | [0040](0040-report-three-send-outcomes-and-retry-only-when-nothing-left-the-source.md) | Report three send outcomes and retry only when nothing left the source | payments | Proposed | | | ||
| | [0041](0041-keep-identity-to-shielded-off-in-this-release.md) | Keep Identity to Shielded off in this release | payments | Proposed | | | ||
| | [0042](0042-report-moved-to-platform-when-a-shielded-to-identity-top-up-fails-after-the-unshield.md) | Report movedToPlatform when a Shielded to Identity top-up fails after the unshield | payments | Superseded | [0044](0044-top-up-an-identity-from-shielded-in-one-step.md) | | ||
| | [0043](0043-bind-the-fee-where-the-sdk-can-and-mark-the-rest-as-an-estimate.md) | Bind the fee where the SDK can and mark the rest as an estimate | payments | Proposed | | | ||
| | [0044](0044-top-up-an-identity-from-shielded-in-one-step.md) | Top up an identity from Shielded in one step | payments | Proposed | | | ||
| | [0045](0045-add-an-external-identity-top-up-and-a-non-blocking-identity-read-to-the-sdk.md) | Add an external-identity top-up and a non-blocking identity read to the SDK | platform | Proposed | | |
There was a problem hiding this comment.
✅ Resolved at
f5e8f706; see the replies below.
🔴 Blocking: Resolve the ADR index conflict with the current develop branch
The current develop tip a00541e0db15d9c6571ea3249ed7812ec4f35246 adds ADR-0053 to this same table, while this head adds ADR-0036 through ADR-0045 from the older merge base. The merge-tree reports a content conflict in docs/adr/README.md; merging without resolving it can lose either the external-send entries or the newer DashConnect entry. Rebase or otherwise resolve the table so both sets of valid ADR entries remain.
Raised on code unchanged since the last review, and confirmed by an independent pass: Merging PR head 4322c14 with develop a00541e produces a content conflict in docs/adr/README.md, so the merge cannot complete without manual resolution; choosing either side wholesale would omit the other branch's valid ADR rows.
source: gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
Resolved (re-reviewed at f5e8f706): The current ADR index lists rows 0036 through 0045 before the existing 0053 row in numeric order, so the previously reported collision is resolved.
4322c14 to
f5e8f70
Compare
|
The stack is rebased on develop |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The external-send domain model and the available CI checks are generally coherent, but the head contains two blocking issues. AmountRules.swift is compiled into the non-DashPay app without its unconditional IdentityCreditBalance dependency, and the carried address-nonce outcome mapping remains inconsistent with the pinned Platform contract.
🔴 1 blocking
Disputed — left to maintainers (1)
- 🔴 Blocking: Do not classify definitive shielded broadcast failures as in-flight —
DashWallet/Sources/UI/Payments/ExternalSend/Domain/SendOutcome.swift:117-136(thread)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a substantial domain-model and parsing change covering payment destinations, network validation, send routing, amount checks, and outcome mapping, but the diff does not itself perform funds movement, signing, key handling, or other critical-surface operations. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Code unchanged since the last final review (
4322c140): 1 new blocker(s) went to an independent confirmation pass (the final verifier's model in a fresh session, without its reasoning): 1 confirmed - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.
In `DashWallet/Sources/UI/Payments/ExternalSend/Domain/AmountRules.swift`:
- [BLOCKING] DashWallet/Sources/UI/Payments/ExternalSend/Domain/AmountRules.swift:40-53: Add IdentityCreditBalance to every target that compiles AmountRules
AmountRules.swift is included in both app source phases, but IdentityCreditBalance.swift is included only in the dashpay source phase. The unconditional references to IdentityCreditBalance.lowBalance in identityMax and check therefore leave the dashwallet target without the symbol when it compiles AmountRules.swift. The successful dashpay CI build does not cover this target. Add IdentityCreditBalance.swift to the dashwallet target as well, or remove this target-specific dependency from AmountRules.
_Raised on code unchanged since the last review, and confirmed by an independent pass: Compiling the dashwallet target includes AmountRules.swift, whose unconditional references to IdentityCreditBalance cannot resolve because IdentityCreditBalance.swift is not in that target and its declaration is additionally guarded by #if DASHPAY. The dashwallet build therefore fails with an unresolved IdentityCreditBalance symbol._
| let reserve = IdentityCreditBalance.lowBalance | ||
| guard let spendable = spendable(balance: balanceCredits, fee: feeCredits), spendable > reserve else { | ||
| return .disabledReserveSpent | ||
| } | ||
| return .amount(spendable - reserve) | ||
| } | ||
|
|
||
| /// `balance`, `fee` and `amount` are in the source's own unit: duffs for Core, Shielded and Platform, | ||
| /// credits for Identity. | ||
| static func check(amount: UInt64, source: SendSource, balance: UInt64, fee: UInt64) -> AmountCheck { | ||
| guard let spendable = spendable(balance: balance, fee: fee), amount <= spendable else { | ||
| return .notEnough | ||
| } | ||
| if source == .identity, spendable - amount < IdentityCreditBalance.lowBalance { |
There was a problem hiding this comment.
✅ Resolved at
3d7d56ac; see the replies below.
🔴 Blocking: Add IdentityCreditBalance to every target that compiles AmountRules
AmountRules.swift is included in both app source phases, but IdentityCreditBalance.swift is included only in the dashpay source phase. The unconditional references to IdentityCreditBalance.lowBalance in identityMax and check therefore leave the dashwallet target without the symbol when it compiles AmountRules.swift. The successful dashpay CI build does not cover this target. Add IdentityCreditBalance.swift to the dashwallet target as well, or remove this target-specific dependency from AmountRules.
Raised on code unchanged since the last review, and confirmed by an independent pass: Compiling the dashwallet target includes AmountRules.swift, whose unconditional references to IdentityCreditBalance cannot resolve because IdentityCreditBalance.swift is not in that target and its declaration is additionally guarded by #if DASHPAY. The dashwallet build therefore fails with an unresolved IdentityCreditBalance symbol.
source: gpt-6.1-sol (phase2-reviewer: general)
There was a problem hiding this comment.
Fixed in 3d7d56a. AmountRules now holds the reserve as identityReserveCredits, so it no longer reads the DashPay-only IdentityCreditBalance; AmountRulesTests checks that the two values agree, and the Send screen preview reads the new constant.
There was a problem hiding this comment.
Resolved (re-reviewed at 3d7d56ac): The current AmountRules implementation owns the reserve as identityReserveCredits and no longer depends on the DashPay-only IdentityCreditBalance symbol, removing the cross-target compilation defect.
The pure core of the new external send, with no screen or service using it yet: the destination types and a parser for every address form, link and Identity ID (network-checked), the four send sources and the routes between them, one policy that decides every source and destination pair, the amount rules, the Confirm warnings, and the three send outcomes the errors of the existing spend paths map to (only "not sent" offers Retry). Supporting changes: ScriptAddressCodec decodes an address's form and hash whatever its network, DashAddressClassifier decodes bech32m without reading the global network, PaymentNetworkResolver maps any network kind, and WalletSendService's error domain and codes become readable so a send outcome can be told from them. The old Send's Confirm texts move to SendWarningText so both Sends show the same words. The feature's decisions are recorded as ADR-0036 to ADR-0045 (docs/adr/). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> SDD-Published-From: 306145f65dadd33ec186527e30890c7bb756d635
f5e8f70 to
3d7d56a
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The exact reviewed head adds an isolated external-send domain layer with destination parsing, route policy, amount rules, and outcome mapping, with the completed simulator, membership, workflow-lint, and accessibility checks passing. One non-blocking documentation defect remains: the new ADRs link to a feature-summary file that is absent from this head.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Follow-up candidates (optional) (1)
New non-blocking observations on code unchanged since the last full review. No inline threads are opened for them and later reviews do not repeat them: fix forward or track separately if they are worth it.
🟡 Suggestion: Do not link new ADRs to a missing feature-summary file
docs/adr/0037-build-external-send-as-a-new-module-over-the-existing-spend-seams.md:46
This ADR links to ../features/external-send/README.md, but that path does not exist at the reviewed head. The same missing feature-summary reference appears throughout the new external-send ADRs, so readers opening these records from the current repository encounter dead internal links. Add the feature summary in this PR or replace the links with an artifact that exists at this head; if stacked PR #1409 is intended to provide it, keep that dependency explicitly tracked.
source: gpt-6.1-sol (phase2-reviewer: general)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a large, cross-cutting domain-model and parsing change with substantial send-policy and outcome logic, but the diff does not itself perform funds movement, cryptography, key handling, or consensus-critical operations. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity quota lookup failed),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Code unchanged since the last final review (
f5e8f706): 1 new suggestion(s) listed as follow-up candidates, not posted inline - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— security-auditor (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
Not approved: 1 blocking finding(s) are disputed and left to the maintainers.
Issue being fixed or feature implemented
First part of the new external Send for MO-1121 (Android parity: dash-wallet#1680): pay from every balance (Core, Shielded, Platform, Identity) to every destination type (Core address, Shielded address, Platform address, Identity ID). This PR adds only the domain model, so it can be reviewed without any UI or money movement.
What was done?
DestinationandDestinationParser: the destination type from typed, pasted, scanned or linked text (Core, Platform and Shielded addresses, Identity IDs,dash:links with an amount), network checks, and a length bound before Base58/Bech32m decoding.SendPairPolicy: one pure rule set for every source × destination pair — the route, or the reason the pair is unavailable — plus the Confirm warnings. [ADR-0038] (added in feat(wallet): new Send screens and entry points #1409)AmountRules: Max, the DashPay reserve on Identity, the balance check.SendOutcome: every send ends as sent, not sent (with Retry) or in progress (no Retry); the mapping from the existing send errors. [ADR-0040] (added in feat(wallet): new Send screens and entry points #1409)ScriptAddressCodec/PaymentNetworkResolver/DWParsedPaymentURI: the address decoding helpers the parser shares with the existing Send;SendScreennow takes its warning texts from the sharedSendWarningText.WalletSendService:ErrorCodeanderrorDomainreadable outside the file so the outcome mapping can name existing send errors.Nothing calls the new types from a screen yet; the services come in #1407 and the screens in #1409. Code comments cite ADRs whose public copies are added in #1409.
Stack
This replaces the single PR #1358 (+21k lines), split by layer so each part can be reviewed and merged on its own. Merge in order:
chore(l10n): drop unused keys and sort the catalogs as BartyCrouch writes them (keeps the diffs below clean)How Has This Been Tested?
dashwallet-dashpay, Debug, iPhone 17 simulator (iOS 26.5): 2374 tests, 0 failures, 1 skipped.DestinationParserTests,SendPairPolicyTests,AmountRulesTests,SendOutcomeMappingTests, the Bech32m URI case inPaymentProtocolTestsscripts/a11y_audit.py --check, and a second build leaves the catalogs unchangedBreaking Changes
None.
Checklist:
🤖 Generated with Claude Code