Repository navigation
feat(platform-wallet): fetch the key references of any masternode - #6026
Draft
Claudius-Maginificent wants to merge 5 commits into
Draft
Claudius-Maginificent wants to merge 5 commits into
Claudius-Maginificent wants to merge 5 commits into
Conversation
Contributor
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
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. |
Draft
9 tasks
Collaborator
|
🕓 Review not started yet because this PR is a draft.
Commit 3df63fc. Normal review starts when eligible; priority review starts as soon as a slot is available. |
This was referenced Nov 22, 2026
Merged
lklimek
force-pushed
the
feat/mn-key-reference
branch
from
November 24, 2026 11:15
5e007bf to
9fc64b3
Compare
lklimek
force-pushed
the
feat/mn-key-reference
branch
from
December 1, 2026 07:39
9fc64b3 to
b6f72c8
Compare
…m the list and its Platform identities Add PlatformWalletManager::fetch_masternode_key_reference: the current masternode list's fields joined with the owner and payout key hashes of the node's owner identity and the operator payout key hash of its operator identity, for any node, tracked or not. Nothing is persisted. It fails with MasternodeListUnavailable while the list does not follow the chain; a node absent from the list but with an owner identity (retired, credits still claimable) gets its list fields None; Ok(None) when neither the list nor Platform knows the node. Fix the tracked-node refresh with the same rule: it took any key of the purpose, so after a payout address change it could keep a disabled TRANSFER key depending on key-id order. One helper now picks the enabled ECDSA_HASH160 key. The refresh also reads the list only while it follows the chain, so a stale list no longer overwrites the cached entry. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WunYYhpfoE88XJoyRt4hcR
…entity disables it Reproduction tests: they fail until learn_owner_identity and learn_operator_identity stop keeping a previously learned key when the fetched identity has no enabled key of that purpose. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ched identity disables it The tracked-node refresh kept the last known owner and operator payout key hashes when the freshly fetched identity had no enabled key for them. Drive disables every owner TRANSFER key when the payout is no sole P2PKH output, and the operator TRANSFER key when the operator payout is removed, so the kept key was stale. A fetched identity now sets the key hashes to its enabled keys; a failed or empty fetch still leaves the snapshot as it was. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WunYYhpfoE88XJoyRt4hcR
…ut of tracked reads Once the owner identity has been read, its keys are the current ones: TrackedMasternode::key_reference and record no longer fall back to the registered payout script (or owner key) when the identity holds no enabled key for it, so a retired payout key no longer comes back. Before that read, the registration is still used. Add CurrentMasternodeList::entry and use it for the per-node lookups in key_reference and the tracked refresh. Fold the learn tests that re-asserted the enabled-key ordering into the learn regression tests. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WunYYhpfoE88XJoyRt4hcR
…record Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WunYYhpfoE88XJoyRt4hcR
lklimek
force-pushed
the
feat/mn-key-reference
branch
from
December 3, 2026 18:34
b6f72c8 to
3df63fc
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TL;DR: A wallet can now look up the registered keys of any masternode, tracked or not, from the current masternode list and the node's Platform identities, and tracked nodes no longer show a payout key that the node has since disabled.
User story
As a wallet app developer, I want to fetch the owner, voting, payout and operator payout key references of any masternode without tracking it first, to achieve key checks and withdrawals for nodes the user has just added or that have retired.
Scenario
Base flow
The user adds a masternode to the wallet, or changes the node's payout address, and the app shows or checks the node's keys.
Actual behavior
Expected behavior
Detailed discussion
Issue being fixed or feature implemented
Stacked atop #6025 (
feat/mn-current-list), part of the stack over #5889.What was done?
PlatformWalletManager::fetch_masternode_key_reference(masternode/key_reference.rs): the current list's fields joined with the owner and payout key hashes of the node's owner identity and the operator payout key hash of its operator identity. It fails withMasternodeListUnavailablewhile the list does not follow the chain. A node absent from the list but with an owner identity (retired, credits still claimable) gets its list fieldsNone.Ok(None)when neither the list nor Platform knows the node.ECDSA_HASH160key of a purpose; the tracked refresh (masternode/tracked.rs) uses it too.CurrentMasternodeList::entry); a stale list no longer overwrites the cached entry.TrackedMasternode::key_referenceandrecordno longer fall back to the registered payout script or owner key once the owner identity has been read.FFI / mobile behaviour changes
list/trackreads are still ungated (follow-up).None, so verifying a replaced payout key givesUnverifiableinstead ofMatches. There is no registration fallback once the identity has been read.How Has This Been Tested?
Unit tests in
key_reference.rsandtracked.rs, including reproduction tests that a tracked node forgets its payout key once its fetched identity disables it (they failed before the fix). The gated read inside the tracked refresh and the live-SDK manager path were verified by code trace.Breaking Changes
No Rust signature changes (additive API); the FFI behaviour changes above apply to mobile hosts.
Deferred
platform_roles_from_identity) still matches disabled keys; to be aligned after refactor(platform-wallet): share the masternode update helpers and use rust-dashcore's key and script types #5997.list/trackreads.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
https://claude.ai/code/session_01WunYYk4eUkHuGstPtj83j4
🤖 Co-authored by Claudius the Magnificent AI Agent