Repository navigation
refactor(platform-wallet): drop always-zero Core address balance - #6036
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
✅ Final review complete — no blockers (commit e032667) · triage: normal |
3945502 to
e403e0e
Compare
e403e0e to
8b6bc5b
Compare
…eAddressEntryFFI Preserve the final PR scope, including merge resolutions, on the updated native stack. Co-Authored-By: Codex <[email protected]>
8b6bc5b to
56f0a3a
Compare
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Updated after discussion: 1 finding(s) of this review were settled in the inline threads; no blocking finding remains.
- ⏭️ Deferred (maintainer decision): 🔴 Android’s Core receive sheet shows no QR code when Room has no unused address (tracked in #6389)
Changes requested: 1 0 blockers: none remains
Android’s Core receive sheet shows no QR code when Room has no unused address —— settled: ⏭️ Deferred (maintainer decision)packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/wallet/ReceiveAddressSheet.kt:127-130(new)
Impact: Example-app users who tap Receive before Room contains an unused external address see a prompt to sync instead of a QR code, even if the live wallet can supply an address.
This PR removes the always-zero Core address balance from the native persistence ABI and updates the Swift and Kotlin bindings without changing either database schema or wallet restore behavior. Rust workspace tests, Kotlin emulator build and tests, and the Swift frozen-schema check passed; the Swift SDK build and tests are pending.
🔴 1 0 blocking | 🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: ffi-engineer); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.2-sol(effort low) — Removing one always-zero field is a small, mechanical change across bindings, persistence handlers, and views, with no change to consensus or funds movement. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort high); 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(zai below 15% reserve: 5h 100% left, weekly 0% left) - Fresh verifier:
gpt-6.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6.2-sol— ffi-engineer (completed, effort medium); 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 `packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/wallet/ReceiveAddressSheet.kt`:
- [BLOCKING → DEFERRED by a maintainer; not blocking, do not fix in this PR] packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/wallet/ReceiveAddressSheet.kt:127-130: Android’s Core receive sheet shows no QR code when Room has no unused address
Impact: Example-app users who tap Receive before Room contains an unused external address see a prompt to sync instead of a QR code, even if the live wallet can supply an address.
The sheet cannot show a receive address that is missing from Room: it filters the persisted external pool and picks the lowest unused index itself. Removing the balance check changes that eligibility rule but leaves the address-selection decision in the view, which the book’s wallet ownership rule assigns to Rust. `ManagedCoreWallet.nextReceiveAddress(accountIndex)` already asks the live key-wallet pool for an available address and can derive one if none is available. Use that binding to select the address, and use Room only to look up optional display metadata for the returned address.
In `packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/entities/CoreAddressEntity.kt`:
- [SUGGESTION] packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/entities/CoreAddressEntity.kt:50-54: Android’s Storage Explorer still shows a balance when a Core address is opened
Impact: Developers who open a Core address in Storage Explorer see the retained `balance` column, usually as zero, even though the wallet does not track that value.
The Core address detail makes a schema placeholder look like wallet data. `loadStorageRow` in `StorageModels.kt` selects every column, and `StorageRecordDetailScreen.kt:106–109` renders them all. The Core Addresses list subtitle also displays the column if it contains a positive value. Keep the Room column for schema compatibility, but omit it from the Core Addresses list and detail presentation, as the Swift explorer does. Leave tracked balances on other models visible.
…e Storage Explorer The Core Addresses list and record detail still showed the Room balance column, which the wallet no longer tracks. Keep the column for schema compatibility but leave it out of both views; real balances of other models stay visible. <sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub> Co-Authored-By: Claude Opus 5.5 <[email protected]>
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review after discussion — commit 56f0a3a
Standing review was CHANGES_REQUESTED; this re-review is APPROVE: no blocking findings remain.
Approved: the discussion withdrew or deferred every blocker the full review of 56f0a3ab (run 15324) raised, and the approval rests on that review. The 1 non-blocking finding(s) still standing are optional: fix them forward.
No longer blocking:
- Android’s Core receive sheet shows no QR code when Room has no unused address
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.2-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
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
New on this head: The incremental commit removes the retained Core-address balance from the Kotlin Storage Explorer list and detail views while preserving balances for other models, with regression tests covering null, zero, and positive retained values. Kotlin and Rust checks passed; the Swift SDK build remains in progress, with no failed code checks reported.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-sol (agent: phase2-reviewer, role: ffi-engineer); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.2-sol(effort low) — This is a cross-language API and persistence refactor spanning Rust FFI, JNI, Swift, Kotlin, and example tests, but it does not change consensus, funds movement, cryptography, or storage migration 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.2-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.2-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— architecture-layering (completed, effort high); agentphase2-reviewer,gpt-6.2-sol— ffi-engineer (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.
|
Ready for review — |
HashEngineering
left a comment
There was a problem hiding this comment.
Kotlin side looks good. One nit: the PR title should carry a ! (as commit 56f0a3a does). CoreAddressEntryFFI.balance has shipped in every release from v5.0.0-beta.1 through v5.1.1, and the public Kotlin onPersistAccountAddressPoolEntry signature and the CoreAddressRestoreData constructor change, so a squash merge with the current title would hide the break in the changelog.
|
Policy satisfied — this can merge. |
TL;DR: The per-address balance field that wallet storage hosts received was always zero and never read; it is removed from the native interface and from the Swift and Kotlin apps.
User story
As a Swift or Kotlin SDK developer, I want the address records the wallet hands me to contain only real data, so that I don't show or store a balance that is always zero.
Scenario
Base flow
A host app persists the wallet's Core address pool entries through the persistence callbacks and shows them in its storage explorer.
Actual behavior
Each entry carries a
balancethat is always 0, because the wallet library keeps no per-address balance. The example apps display it, and a Kotlin test asserts it.Expected behavior
The field is gone. Hosts and example apps no longer store or show it.
Detailed discussion
What was done
CoreAddressEntryFFI.balanceis removed from the C struct, the JNI bridge and descriptor, the Kotlin and Swift persistence handlers and models, and the example-app views and tests.Stacked on #6035 (funding-pool fix), which is stacked on #5951; split out of #5951 because the rust-dashcore bump does not require it.
Testing
CI-scope clippy and nextest for the wallet crates pass locally. Swift and Kotlin were not built locally; CI covers them.
Breaking changes
CoreAddressEntryFFIlosesbalance, which changes its C layout and theonPersistAccountAddressPoolEntryJNI signature. Hosts rebuild against the new header. Not consensus.Checklist
🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
https://claude.ai/code/session_01WunYYhpfoE88XJoyRt4hcR
PR Hygiene ·
e032667kotlin-sdk(packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/storage/StorageModels.kt,packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/storage/StorageRecordDetailScreen.kt,packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/ui/wallet/AccountDetailScreen.ktand 7 more) — approved by HashEngineeringrs-platform-wallet-ffi(packages/rs-platform-wallet-ffi/src/core_address_types.rs,packages/rs-platform-wallet-ffi/src/persistence.rs) — approved by HashEngineering, llbartekllswift-sdk(packages/swift-sdk/Sources/SwiftDashSDK/Persistence/Models/PersistentCoreAddress.swift,packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PlatformWalletPersistenceHandler.swift,packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Views/AccountDetailView.swiftand 4 more) — approved by llbartekllWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit