Registry Mirror
Skip to content

Conversation

@shumkov

@shumkov shumkov commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Platform v5.0-dev pins rust-dashcore at a40daba7 (integration/v5.0-core-v24 with #1204). rust-dashcore v0.45.0 has been released (tag v0.45.0 = merge commit d631aaca, master, rust-dashcore#1208). It contains everything a40daba7 has, plus these backported fixes:

rust-dashcore PR Change
#1147 rpc-client: request arguments and results are no longer written to the dashcore_rpc debug/trace logs, since they can carry credentials
#1187 LLMQ params for llmq_test, llmq_devnet, llmq_devnet_dip0024, llmq_test_platform and llmq_devnet_platform now match Dash Core's params.h. Mainnet and testnet types are unchanged
#1059 MasternodeListEngine::verify_chain_lock rejects a ChainLock signed above the newest masternode list. Before, if the list below the signing height refused it and no list above existed, the check fell through to Ok(())
#1140 headers messages above Core's 2000-header batch limit (and headers2 above 8000) are rejected before allocating
#1014 Observed spends are pruned during the initial sync: dash-spv passes on the height of each chainlock it holds back (note_chain_lock_height)
#1015 A spend processed before the block that funds its coin is re-applied: the wallet reports the spend's height (unrecorded_spend_heights), and dash-spv re-applies that stored block
#1009 Provider transactions (ProReg/ProUp*) look at every fund-bearing account, so inputs funded from DashPay accounts are debited
#1035 DIP-15 contact address pools extend as their payments arrive. The DashPay gap limit is now 10, as DIP-15 recommends
#1037 A late InstantSend lock no longer rewrites a mined record's block context, so a later chainlock can still promote it
#1143 A conflict loser's records in keys-only accounts (e.g. the identity account of an asset lock) are swept too

What was done?

  • All eight rust-dashcore dependencies in the root Cargo.toml now point to d631aaca3632cc713143476e363c9a9aca038d2e (v0.45.0). In Cargo.lock only the 12 rust-dashcore source lines change; nothing else is re-resolved.
  • PlatformWalletInfo now forwards the two new WalletInfoInterface methods to its inner ManagedWalletInfo:
    • unrecorded_spend_heights is a new required method; without it platform-wallet does not compile (E0046). Forwarding it lets WalletManager::process_block_for_wallets fill reapply_heights for Platform wallets. dash-spv then re-applies the spend's block and the spend is recorded. Before, Platform only worked around this case with its ObservedSpent verdict.
    • note_chain_lock_height has a default no-op. Without the forward, chore(release): update changelog and bump version to 0.24.0-dev.31 #1014 would never run for Platform wallets: the noted height would never reach the inner wallet, and observed_spent_outpoints would keep growing for the whole initial sync (on the order of a million entries on a mainnet restore).
  • Two tests in platform_wallet_traits.rs drive WalletManager<PlatformWalletInfo>, the type dash-spv calls:
    • a noted chainlock height prunes observed spends at or below min(noted, synced), keeps those above, and does not count as an applied chainlock;
    • a spend processed before its funding block puts the spend's height into reapply_heights, and applying that block again records the spend.
  • Several comments described the storage tombstone collector (collect_finalized_tombstones and its Swift/Kotlin mirrors) as key-wallet's prune_finalized_observed_spends condition "verbatim". That is no longer accurate. key-wallet now also prunes against the noted heights, which are in memory only. Platform persists only applied chainlocks (chainlock_height), so the collector's chainlock half can trail key-wallet's but never lead it: a tombstone may be held longer, never dropped early. The comments in the Rust storage, SCHEMA.md, the V007 migration doc, the changeset docs and the Swift/Kotlin persistence handlers now say so. Comment-only changes; refinery checksums only the rendered SQL, so the migration doc edit is safe.
  • The late-InstantSend workaround in PlatformWalletInfo::mark_instant_send_utxos stays. With fix(dashmate): set permissions for dashcore log file #1037 it is redundant but harmless (it restores contexts the inner wallet no longer changes). It will be removed in a separate follow-up (platform-wallet: remove the mark_instant_send_utxos wrapper once the rust-dashcore pin carries #1037 #5430).

Impact

Nodes (Drive / rs-dapi): The only change is that dashcore-rpc no longer logs request arguments or results. There is no behaviour, consensus or protocol-version change. Drive, DPP and the SDK never read LLMQParams, and Drive does not use MasternodeListEngine or decode P2P headers.

Clients (platform-wallet / SDK SPV):

Stored formats

Unchanged. The only new persisted-type field upstream is ManagedWalletInfo::noted_chain_lock_height, which is serde(skip). There are no bincode derive changes. Platform rebuilds ManagedWalletInfo from typed rows. The persisted_core_transactions golden rows decode and re-encode unchanged.

How Has This Been Tested?

Local runs on macOS (arm64), cargo 1.98.1:

  • cargo fmt --all -- --check: clean
  • cargo check --workspace --all-targets --locked: pass
  • cargo clippy --workspace --all-targets --all-features --locked -- --no-deps -D warnings: pass
  • cargo test -p platform-wallet -p platform-wallet-ffi: 1734 passed, 0 failed, 6 ignored (doctests included; no shielded doctest collision)
  • cargo test -p platform-wallet-storage: 978 passed, 0 failed, 3 ignored
  • cargo test -p platform-wallet-storage --test integration persisted_core_transactions: 1/1 (golden rows unchanged)
  • cargo test -p drive-abci --lib core_chain_lock: 18/18
  • cargo test -p dash-sdk --lib: 329/329
  • cargo test -p dpp --lib: 5652 passed, 6 ignored

Both new tests fail without their delegation:

  • note_chain_lock_height forward removed (the trait default no-op applies): should_prune_observed_spends_up_to_a_noted_chain_lock_height panics with "a spend below the noted chainlock height is final". Forwarding the synced height instead of the noted one also fails it ("a spend above the noted chainlock height is not final yet").
  • unrecorded_spend_heights forward removed: E0046, so it cannot compile. With the body stubbed to BTreeSet::new(): should_ask_to_reapply_the_block_of_a_spend_seen_before_its_funding fails with left: {}, right: {<wallet_id>: {200}}.

Not run locally: the full workspace / strategy test suites, wasm32 builds and the mobile builds. CI covers them.

Breaking Changes

This changes the public API of the rust-dashcore crates Platform re-exports and builds on. It affects Rust consumers that implement or construct these types themselves:

  • WalletInfoInterface::unrecorded_spend_heights is a new required method.
  • WalletInfoInterface::note_chain_lock_height and WalletInterface::note_chain_lock_height are new methods with no-op defaults. A wrapper that delegates by hand must forward them, or chore(release): update changelog and bump version to 0.24.0-dev.31 #1014 never runs.
  • key_wallet_manager::BlockProcessingResult has a new public field, reapply_heights.
  • Wallet::key_source_for_account_type(&AccountTypeToCheck, Option<u32>) was replaced by key_source_for_account(AccountType).
  • The DashPay contact-chain gap limit drops from 20 to 10.

There are no consensus, protocol-version or stored-format changes.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 4ba7785

  • Bots — coderabbitai ✓ · thepastaclaw ✓
  • Self-review — post /self-reviewed
  • Build running
  • Approvals
    • files with no dedicated owner — you own it
    • kotlin-sdk (packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/PlatformWalletPersistenceHandler.kt, packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/dao/DocumentDao.kt, packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/entities/PendingInputEntity.kt) — HashEngineering
    • wallet-storage (packages/rs-platform-wallet-storage/SCHEMA.md, packages/rs-platform-wallet-storage/migrations/V007__utxo_sweep_winner_height.rs, packages/rs-platform-wallet-storage/src/sqlite/schema/core_state.rs and 1 more) — lklimek
    • rs-platform-wallet (packages/rs-platform-wallet/src/changeset/changeset.rs, packages/rs-platform-wallet/src/wallet/platform_wallet_traits.rs) — HashEngineering or ZocoLini or llbartekll or romchornyi
    • swift-sdk (packages/swift-sdk/Sources/SwiftDashSDK/Persistence/Models/PersistentPendingInput.swift, packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PlatformWalletPersistenceHandler.swift, packages/swift-sdk/SwiftTests/SwiftDashSDKTests/SweptTransactionPersistTests.swift) — llbartekll or romchornyi

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

Summary by CodeRabbit

  • Improvements

    • Improved wallet handling of observed spends and transaction sweep finality, including more consistent treatment of applied ChainLocks and synchronized chain state.
    • Preserved confirmed transaction context during InstantSend processing and improved recovery when related funding data becomes available.
    • Added wallet support for tracking chain-lock heights and unrecorded spend heights.
  • Documentation

    • Clarified finality, tombstone collection, InstantSend behavior, and synchronization requirements across Kotlin, Swift, and Rust SDKs.
  • Tests

    • Added coverage for observed-spend pruning and spend-block reapplication scenarios.

shumkov and others added 2 commits October 21, 2026 20:27
Pin every rust-dashcore dependency to d631aaca (tag v0.45.0), which adds
these backported fixes on top of a40daba7: #1147, #1187, #1059, #1140,
#1014, #1015, #1009, #1035, #1037 and #1143. Cargo.lock moves only the
rust-dashcore sources.

key-wallet's WalletInfoInterface gained two methods, and PlatformWalletInfo
now forwards both to its inner ManagedWalletInfo:

- unrecorded_spend_heights (required, #1015): lets
  WalletManager::process_block_for_wallets report the block of a spend
  processed before its funding, so dash-spv re-applies it and the spend
  is recorded.
- note_chain_lock_height (no-op default, #1014): carries the heights of
  the chainlocks dash-spv holds back during the initial sync, so observed
  spends are pruned as the sync goes instead of growing until it ends.

The late-InstantSend workaround in mark_instant_send_utxos stays; with
#1037 in the pin it is a no-op, and its comment now says so.

Tests drive WalletManager<PlatformWalletInfo>, the type dash-spv calls.
Without the delegations they fail:
- note_chain_lock_height forward removed: the prune test fails ("a spend
  below the noted chainlock height is final"); forwarding the synced
  height instead also fails it.
- unrecorded_spend_heights forward removed: E0046; with an empty-set body
  the re-apply test fails (left: {}, right: {wallet: {200}}).
Both pass with the delegations.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…lied-chainlock only

The sweep-tombstone collectors (SQLite collect_finalized_tombstones and
its Swift and Kotlin mirrors) were documented as key-wallet's
prune_finalized_observed_spends condition "verbatim". Since rust-dashcore
v0.45.0 (#1014) key-wallet also prunes up to the heights of the chainlocks
dash-spv holds back during the initial sync. Those are never persisted,
so the stored chainlock_height counts applied chainlocks only and its
half of the boundary can trail key-wallet's: a tombstone may be held
longer than the in-memory entry, never dropped sooner.

Comments and SCHEMA.md only; no behaviour change, so no test. The V007
migration edit is to its module docs; refinery checksums the rendered
SQL, which is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added this to the v5.0.0 milestone Oct 21, 2026
@coderabbitai

coderabbitai Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: dashpay/platform/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: dbc3a42f-4621-4f38-bce0-fb0e3503a884
📥 Commits

Reviewing files that changed from the base of the PR and between e99300e and 4ba7785.

⛔ Files ignored due to path filters: 1
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 13
  • Cargo.toml
  • packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/PlatformWalletPersistenceHandler.kt
  • packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/dao/DocumentDao.kt
  • packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/entities/PendingInputEntity.kt
  • packages/rs-platform-wallet-storage/SCHEMA.md
  • packages/rs-platform-wallet-storage/migrations/V007__utxo_sweep_winner_height.rs
  • packages/rs-platform-wallet-storage/src/sqlite/schema/core_state.rs
  • packages/rs-platform-wallet-storage/tests/integration/sqlite_transaction_sweeps.rs
  • packages/rs-platform-wallet/src/changeset/changeset.rs
  • packages/rs-platform-wallet/src/wallet/platform_wallet_traits.rs
  • packages/swift-sdk/Sources/SwiftDashSDK/Persistence/Models/PersistentPendingInput.swift
  • packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PlatformWalletPersistenceHandler.swift
  • packages/swift-sdk/SwiftTests/SwiftDashSDKTests/SweptTransactionPersistTests.swift

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Walkthrough

The PR updates the pinned rust-dashcore revision and adds wallet-info delegations for observed-spend heights and chainlock heights. It also clarifies persisted sweep-tombstone finality rules in Rust, Kotlin, and Swift documentation and tests.

Changes: Wallet chainlock and tombstone finality

Layer / File(s) Summary
Wallet chainlock integration
Cargo.toml, packages/rs-platform-wallet/src/wallet/platform_wallet_traits.rs
The rust-dashcore revision changes. PlatformWalletInfo delegates observed-spend heights and chainlock-height updates to its inner wallet. Tests cover observed-spend pruning and out-of-order block processing.
Rust tombstone finality contract
packages/rs-platform-wallet/src/changeset/changeset.rs, packages/rs-platform-wallet-storage/SCHEMA.md, packages/rs-platform-wallet-storage/migrations/*, packages/rs-platform-wallet-storage/src/sqlite/schema/core_state.rs, packages/rs-platform-wallet-storage/tests/integration/sqlite_transaction_sweeps.rs
Documentation describes applied-chainlock finality, unstamped tombstone handling, and collection at the minimum of chainlock and sync heights. Test comments describe the same collection boundary.
Kotlin and Swift finality documentation
packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/*, packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/dao/DocumentDao.kt, packages/kotlin-sdk/sdk/src/main/kotlin/org/dashfoundation/dashsdk/persistence/entities/PendingInputEntity.kt, packages/swift-sdk/Sources/SwiftDashSDK/Persistence/Models/PersistentPendingInput.swift, packages/swift-sdk/Sources/SwiftDashSDK/PlatformWallet/PlatformWalletPersistenceHandler.swift, packages/swift-sdk/SwiftTests/SwiftDashSDKTests/SweptTransactionPersistTests.swift
Comments and test descriptions clarify applied-chainlock finality, the absence of an observation-age margin, and the requirement for a persisted numeric chainlock height.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~12 minutes

Change: Other

Suggested reviewers: romchornyi

Merge Risk: ⚪ Minimal · up to 4ba77

The dependency update, wallet delegations, and finality clarifications are mergeable after normal checks; no specific blocking behavior has been identified.

Pre-merge checks: Passed 4 · Inconclusive 1

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Docstring Coverage Inconclusive Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 10 files. (3 skipped:… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely identifies the main change: updating rust-dashcore to v0.45.0.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 20 functions across 10 files. (3 skipped: 2 unsupported, 1 too large.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Waiting for bot review — coderabbitai ✓ · thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Oct 21, 2026
@thepastaclaw

thepastaclaw commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 4ba7785) · triage: normal

@lklimek

lklimek commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

This PR has partial overlap with changes already present in v5.1-dev. Please verify compatibility.

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Final validation — Phase 1 + Phase 2

Static verification of the complete PR range at 4ba7785 found no actionable in-scope defects: both new trait methods delegate to the upstream owner, and persistence changes are documentation-only. Current CI has no failed checks; Kotlin build/tests and Swift schema checks passed, while Rust workspace tests remain pending. No builds or tests were run locally.

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: rust-quality); reviewer 6: gpt-6.1-sol (agent: phase2-reviewer, role: security-auditor); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)

  • Triage: normal by gpt-6.1-sol (effort low) — The dependency update and wallet-method forwarding warrant ordinary review, but the diff does not itself introduce large or intricate changes to critical logic, and the storage migration edits are explanatory comments.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (lane failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Fresh verifier: gpt-6.1-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — security-auditor (completed, effort high); agent phase2-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.

  • Follow up on the existing SPV block-body authentication gap — The pinned rust-dashcore revision accepts requested blocks in dash-spv/src/sync/blocks/sync_manager.rs without checking their transaction Merkle root. A malicious peer can preserve the requested header while substituting transactions, potentially corrupting wallet balances or spend state. This path is unchanged from the previous dependency pin, so it is not introduced or worsened by this PR. The default upstream branch includes the validation and duplicate-transaction rejection from dashpay/rust-dashcore#1169.
    • Follow-up: Track adoption of rust-dashcore#1169 through a compatible release or upstream backport in a separate Platform issue or maintainer-requested dependency update.

@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Oct 21, 2026
@shumkov
shumkov merged commit 6e1f6b7 into v5.0-dev Oct 21, 2026
53 of 57 checks passed
@shumkov
shumkov deleted the shumkov/v50-rust-dashcore-045 branch October 21, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants