Repository navigation
feat(sdk)!: a DashPay profile update can set or remove its payment addresses - #5970
Conversation
…dresses The DashPay contract gives a profile three payment addresses since protocol version 14 (corePaymentAddress, platformPaymentAddress, shieldedAddress), and ProfileFields could not carry them. PaymentAddressUpdate is Keep, Set or Remove, with Keep the default, so an update that names no address leaves the published ones alone. The SDK sends the bytes as given; Platform enforces their length. The wallet's profile update names no address and keeps them. Taken from #5288. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
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 54 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. |
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
✅ Final review complete — no blockers (commit 447c9ae) · triage: normal |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
The SDK change correctly adds Keep/Set/Remove semantics for all three DashPay payment-address properties, preserves unspecified properties during replacement, and keeps existing wallet writes non-destructive through the default Keep behavior. No in-scope correctness, architecture, consensus, or code-quality findings were identified. CI has no failures on this head; the workspace and JS checks were still queued at the captured time.
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); reviewer 7: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 8: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 9: gpt-6.1-sol (agent: phase2-reviewer, role: platform-versioning); reviewer 10: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a contained SDK behavior change involving profile document field overlay and address serialization, but it changes user-visible state and warrants more than a trivial or low-effort review. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer,muse-spark-1.3-contributor— rust-quality (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— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— platform-versioning (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— platform-versioning (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
Out-of-scope follow-up suggestions (1)
These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.
- Wallet profile read/cache drops payment addresses — The wallet parser in
packages/rs-platform-wallet/src/wallet/identity/network/profile.rsonly copies display name, public message, avatar URL, and avatar hashes intoDashPayProfile. Consequently, a profile containing onlycorePaymentAddress,platformPaymentAddress, orshieldedAddressis cached as absent, and profiles with those fields cannot expose them through wallet/FFI reads. This predates the SDK write enablement and does not make the new SDK set/remove path incorrect, so it should be handled in the wallet/storage/host follow-up rather than blocking this SDK PR.- Follow-up: Address this in the #5288 follow-up by adding the three payment-address fields to
DashPayProfile, the wallet cache parsers and persistence model, and the FFI views.
- Follow-up: Address this in the #5288 follow-up by adding the three payment-address fields to
|
Bots are done — your move: post |
Basic explanation
What this does: The Rust SDK can now set, replace or remove the three payment addresses a DashPay profile may publish: a Core address, a Platform address and a private (shielded) address.
Value: The DashPay contract has had these profile fields since protocol version 14, but the SDK's profile helper could not write them. Anything that wants to publish an address on a profile, starting with the wallet, needs this first.
Risks: Low. A profile update that names no address leaves the published ones alone, so existing callers behave as before. Code that builds
ProfileFieldswith a full struct literal must add the new fields or..Default::default().Issue being fixed or feature implemented
Sdk::create_profileandSdk::update_profiletake aProfileFields, which had no way to carrycorePaymentAddress,platformPaymentAddressorshieldedAddress. Those properties are in DashPay contract v2 (protocol version 14) and v3 (protocol version 15).Taken from #5288, which carries the same change together with the wallet, storage and host work that builds on it.
What was done?
PaymentAddressUpdate:Keep(the default),Set(bytes)orRemove, exported fromdash_sdk::platform::dashpay.ProfileFieldsgainscore_payment_address,platform_payment_addressandshielded_address, each aPaymentAddressUpdate.ProfileFields::overlaywrites aSetaddress, removes aRemoveone and leaves aKeepone as the existing document has it.Example, an update that only renames the profile:
and one that sets
shielded_address: Set(..)andcore_payment_address: Removereplaces the first, drops the second and keeps the third.How Has This Been Tested?
New tests in
rs-sdk,dashpay/profile.rs: each address is kept, replaced or removed on its own, and an update that names none keeps all three; removing an address on create leaves it out.Run locally:
cargo test -p dash-sdk --features mocks --lib dashpay::profile(10 passed)cargo clippy -p dash-sdk --features mocks --all-targets: no warningscargo checkofplatform-wallet(--features shielded --tests),platform-wallet-ffi,wasm-sdkanddash-sdk-cxxNot tested: a profile write against a network.
Breaking Changes
No consensus change.
Rust source compatibility:
dash_sdk'sProfileFieldsgains three fields, so code that builds it with a full struct literal must set them or add..Default::default()(the default keeps the published addresses).Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
447c9ae/self-reviewedrs-platform-wallet(packages/rs-platform-wallet/src/wallet/identity/network/profile.rs) — HashEngineering or ZocoLini or llbartekll or romchornyirust-sdk(packages/rs-sdk/src/platform/dashpay/mod.rs,packages/rs-sdk/src/platform/dashpay/profile.rs) — lklimek or shumkovWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.