Skip to content

chore: update rust-dashcore for masternode lookup and lists - #6030

Draft
Claudius-Maginificent wants to merge 32 commits into
feat/mn-withdrawal-key-sourcefrom
chore/mn-dashcore-k1-s1
Draft

Claudius-Maginificent wants to merge 32 commits into
feat/mn-withdrawal-key-sourcefrom
chore/mn-dashcore-k1-s1

Conversation

@Claudius-Maginificent

Copy link
Copy Markdown
Collaborator

TL;DR: Platform's masternode wallet work now builds against a rust-dashcore revision that can find a provider key by its hash and report whether the masternode list is current, with no change to how the network validates state.

User story

As a Platform wallet developer, I want platform-wallet pinned to the rust-dashcore revision that has the provider-key lookup and the current masternode list read, to achieve masternode features that use them instead of re-implementing them in Platform.

Scenario

Base flow

Platform pins rust-dashcore by git revision; the masternode withdrawal stack (#5889 → #6028) needs two new rust-dashcore APIs.

Actual behavior

The pin does not contain key-wallet's ManagedWalletInfo::find_provider_key or dash-spv's DashSpvClient::current_masternode_list.

Expected behavior

The pin is rust-dashcore 27073153, which contains both, and Platform builds and passes its tests on it.

Detailed discussion

Issue being fixed or feature implemented

Stacked atop #6028 (feat/mn-withdrawal-key-source). It builds on #5951 (chore/rust-dashcore-dev, the bump to rust-dashcore dev 399f47f9), which is merged into this branch to reuse its dev compile fixes. Until #5951 lands, most of this PR's diff is #5951's; this PR's own changes are the three commits listed below.

What was done?

The new APIs are adopted in follow-ups; this PR only moves the pin.

How Has This Been Tested?

CI-scope clippy and nextest on this tree (3701 passed). An independent review read the 18 rust-dashcore commits in the range at source, traced Platform's callers and found no behaviour change for them; #5951's own content is reviewed in #5951.

Breaking Changes

None in Platform. No consensus or protocol change.

Checklist:

  • I have performed a self-review of my own code
  • My Rust, FFI, WASM, Swift or Kotlin changes follow the coding conventions
  • 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
  • If I added or changed a system contract's document schemas, I checked the contract 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

https://claude.ai/code/session_01WunYYk4eUkHuGstPtj83j4

🤖 Co-authored by Claudius the Magnificent AI Agent

lklimek and others added 26 commits November 17, 2026 01:24
Move every rust-dashcore git dependency from f6bb90cb (v0.46.0) to
d85f15ac (0.47.0-dev). Upstream now takes base-sdk and rust-bitcoin
crates from crates.io and key-wallet uses bip39 3.

- platform-wallet: drop `monitor_revision` from the core wallet state and
  account metadata snapshots, the FFI structs and the Swift diagnostics;
  key-wallet replaced the counter with a hash of the watched set
  (rust-dashcore#1359).
- platform-wallet: handle the error `ManagedCoreFundsAccount::from_account`
  now returns (rust-dashcore#1378); an external contact xpub that cannot
  build its account is a permanent failure.
- platform-wallet tests: fill `locked_outpoints` in wallet events
  (rust-dashcore#1391), and set the partly mined state of a send directly,
  since key-wallet takes a block to every slice of a send
  (rust-dashcore#1399).
- wasm-sdk: request bip39's `zeroize` feature, which key-wallet no longer
  enables on bip39 2.

BREAKING CHANGE: `CoreWalletStateSnapshot`, `AccountMetadataSnapshot`,
`CoreWalletStateFFI`, `AccountMetadataFFI` and the Swift diagnostics
snapshots no longer carry `monitor_revision`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
rust-dashcore#1379 makes `signer::verify_data_signature` refuse a high-S
signature with an error of its own. Platform already refuses such a
signature at every protocol version, as a signature that does not
verify, so the outcome is unchanged; `util::ecdsa::verify_data_signature`
now maps the new error back to `EcdsaError::VerifyFailed` so consensus
errors keep their message. A key that does not parse keeps its own error,
as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
… cannot be built

`ManagedCoreFundsAccount::from_account` failures now surface as
`PlatformWalletError::DashpayAccountBuild` with the key-wallet error as
its source, instead of a string in `InvalidIdentityData`. The external
contact path keeps classifying it as permanent. Also correct the dpp
manifest comment: dash-pkc comes from crates.io, not a base-sdk rev.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
Move every rust-dashcore crate from d85f15ac to the dev head 399f47f9 and
port the wallet crates to key-wallet's encapsulated AddressPool (#1377).

- Pool fields are private and the used set and high-water marks derive
  from the entries: read them through the accessors, restore rows with
  AddressPool::insert, mark with mark_used, release with unmark_used and
  reserve with reserve.
- The add_to_state flag is gone. The asset-lock funding peek passes no
  key source, so it still never derives an address past the window.
- AddressInfo dropped script_pubkey, the per-address counters, label and
  metadata. The script comes from the address; CoreAddressEntryFFI keeps
  its balance field for ABI stability and always writes 0.
- The V008 legacy migration decodes published V001-V007 pool snapshots
  through a private mirror of the old AddressInfo layout; bincode is
  positional, so the new layout cannot read them.
- FFI restore applies persisted rows in index order and counts a row the
  pool refuses (a gap or a duplicate address) as dropped.
- Tests that hand-built pool states the new API makes unrepresentable
  (high-water marks past the entries, gap limit 0 or past MAX_GAP_LIMIT,
  sparse rows, an empty pool script) are rebuilt on consistent pools or
  removed; the cfg(test) refill cap drops below MAX_GAP_LIMIT so the cap
  guards stay covered.
- The no-change asset-lock projection fixture asserts the shape key-wallet
  emits since #1399: the block re-emits the funding slice and the keys
  marker. The keys-marker-only tests filter the event to the marker.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
…ool gap

key-wallet's AddressPool refuses a row past its next index to derive. The
FFI restore drops such a row with a warning and counts it as dropped; the
pool keeps its pre-derived window.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
key-wallet's AddressPool refuses a row past its next index to derive, so
an FFI host store missing rows below a used one (a lost persistence round)
lost that address on load: unwatched, its funds invisible until a rescan,
its index handed out again.

The restore policy moves from rs-platform-wallet-ffi into
platform_wallet::wallet::address_pool_restore. restore_address_rows sorts
the rows, derives the missing indices from the account's key source (at
most MAX_RESTORE_GAP_FILL per row; hardened pools take any index), keeps
the pre-derived key for key-less legacy rows, and counts refusals with one
warning per pool. The FFI load passes each pool its account's key source
and only marshals the counters. Storage rehydration derives through the
same derive_through helper instead of its own loop.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
…m-wallet

The account routing, pool lookup and drop accounting of the FFI address
pool restore move into platform_wallet::manager::restore_account_address_pools,
which hands each pool's rows to restore_address_rows with its account's key
source. rs-platform-wallet-ffi only decodes rows into
AccountAddressPoolEntry values and adds the rows it cannot decode to the
dropped count. Routing and key-source tests move with the logic; the FFI
keeps its row marshalling tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
Registration (populate_platform_node_pool) and SQLite load
(insert_platform_node_pool_entry) each built and inserted the
ProviderPlatformKeys pool entry. Both now go through
platform_wallet::wallet::provider_key_at_index::insert_platform_node_key
and its PlatformNodePoolError; storage only maps the error. Registration
still builds every entry before inserting any.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
…essEntryFFI

key-wallet keeps no per-address balance, so CoreAddressEntryFFI.balance
was always 0 and ignored on load. The field goes from the FFI struct, the
JNI bridge (row read and onPersistAccountAddressPoolEntry, whose JNI
descriptor loses its `J`), the Kotlin bridge and restore row, and the
Swift snapshot and load path. The Swift and Kotlin platform-payment
writers no longer seed a balance from the pool emit; that balance stays
BLAST-driven.

The SwiftData PersistentCoreAddress.balance property and the Room
core_addresses.balance column stay, unwritten and unread by the SDKs, so
neither store needs a schema migration.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
The rust-dashcore bump re-resolved windows-sys back to 0.52/0.59 for eight
registry crates it does not touch. Regenerated from the merged base lock
with the new pins, so the lock only moves the rust-dashcore packages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
MAX_RESTORE_GAP_FILL capped the addresses derived below each persisted row,
so sparse rows each just under the cap still made load derive without
bound. It is now a budget for the whole restore_address_rows call; a gap
row past the remaining budget is refused and counted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
…lpers

insert_platform_node_key and its helpers spelled key-wallet types with
full paths and imported inside function bodies; they now use top-level
imports and bare names.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
CoreAddressEntry no longer carries a balance, so the out-of-window
address test stops asserting it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01WunYYijwZNbw3EjHtdMAHC
Rows that restore derives to close a gap in an asset-lock funding pool
are marked used: the chain cannot show whether their keys were handed
out, and a lost invitation row may hold a key already exported in a
voucher. Funds pools keep them available, as SPV rediscovers their use.

restore_account_address_pools also merges entries naming the same pool,
so one pool gets one gap-fill budget however many entries carry it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ey is refused

populate_platform_node_pool inserts the batch into a copy of the pool and
keeps it only once every key landed, so an AddressPool::insert refusal
no longer leaves earlier keys behind.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…lished pool layout

seed_base_shaped_rows encodes its snapshot_blob with the published
AddressInfo encoder the legacy migration tests use, so a regenerated
fixture still migrates.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Core address balance column is no longer written, so the account,
storage list and address detail views no longer display it. Platform
address balances are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e does

The lost-invitation-row restart test persists the unused window past the
used rows and picks the next key with `next_address(None)`, the call
`peek_next_funding_address` makes, so it checks what a voucher would
actually receive.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Keep caller-owned wallet and account outputs at their original sizes
and clear each reserved trailing slot on success.

Co-Authored-By: OpenAI Codex <[email protected]>
Reject hardened target indices before extending an address pool and gate
platform-node pool tests on their required EdDSA feature.

Co-Authored-By: OpenAI Codex <[email protected]>

<sub>🤖 Co-authored by [Claudius the Magnificent](https://github.com/lklimek/claudius) AI Agent</sub>
…up and the current masternode list

27073153 adds key-wallet `ManagedWalletInfo::find_provider_key` and dash-spv
`DashSpvClient::current_masternode_list{,_blocking}`. The lock moves only the
rust-dashcore packages and adds `blake3` to dash-spv's dependencies.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cessor

rust-dashcore 399f47f9 made `AddressPool::highest_generated` a method; the
operator and voting tracked windows still read it as a field.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@coderabbitai

coderabbitai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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

…fter restart

An asset-lock funding pool restored on load marked used only the rows it
derived to close a gap. A persisted row lost inside the window
`ManagedWalletInfo::from_wallet` pre-derives was never gap-filled and stayed
available, so the next invitation voucher could reuse a key already exported.

Mark used every address at or below the highest persisted row that no row
restored, whether pre-derived or gap-filled. Funds pools are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@thepastaclaw

thepastaclaw commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

🕓 Review not started yet because this PR is a draft.

  • Request normal review — click when the PR is ready for review.
  • Request priority review — click to move this review to the front of the queue.

Commit 777c291. Normal review starts when eligible; priority review starts as soon as a slot is available.

lklimek and others added 4 commits November 21, 2026 10:44
… a follow-up PR

Removes the rule that marks used every address at or below the highest
persisted row of an asset-lock funding pool. A row lost inside the window
ManagedWalletInfo::from_wallet pre-derives stays available after restart,
as it did before the rust-dashcore bump; the defect predates the bump, so
its fix moves to a follow-up PR. Rows derived to close a gap are still
marked used.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…oval to a follow-up PR

Restores the always-zero balance field of CoreAddressEntryFFI and its
JNI, Kotlin and Swift counterparts, including the example-app views that
show it. The rust-dashcore bump only needs the field written as 0, which
keeps the C layout unchanged; dropping it from every binding is a
separate cleanup and moves to a follow-up PR.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…cs output structs

Removes the reserved trailing fields of CoreWalletStateFFI and
AccountMetadataFFI, their layout test and the Swift default initializers.
The rust-dashcore bump drops monitor_revision from both structs; the SDK
does not guarantee C ABI compatibility between releases, so padding them
back to the old size is not needed and the change is dropped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…entries to a follow-up PR

Registration (populate_platform_node_pool) and SQLite load
(provider_accounts::insert_platform_node_pool_entry) again build and
insert their ProviderPlatformKeys pool entries separately, as before the
rust-dashcore bump; sharing one insert_platform_node_key and its
PlatformNodePoolError is a refactor and moves to a follow-up PR.

AddressPool::insert can refuse a key part-way through a batch, so
populate_platform_node_pool inserts into a copy of the pool and keeps it
only once every key landed; a refused key leaves the pool untouched.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-11-21T12:04:27.889Z

@lklimek
lklimek added this pull request to stack #6211 November 24, 2026 09:56
@lklimek
lklimek force-pushed the chore/mn-dashcore-k1-s1 branch from 8fca07f to 777c291 Compare November 24, 2026 11:15
@Claudius-Maginificent Claudius-Maginificent changed the title chore(deps): bump rust-dashcore to 27073153 for the provider key lookup and the current masternode list chore: update rust-dashcore for masternode lookup and lists Nov 24, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants