Conversation
`PlatformWallet::find_provider_key` delegates to key-wallet's `ManagedWalletInfo::find_provider_key` under the wallet-manager read lock: seedless and blocking, like `derive_provider_key_at_index`. It checks a verified index hint, then the provider pool, then the default window past it. `masternode_withdrawal_keys` finds the owner key through it, replacing its own derive-and-compare scan and window constant. `ProviderKeyRole` is re-exported, and a refused lookup is the typed `PlatformWalletError::ProviderKeyLookup`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hardened index hint is caller input and maps to ErrorInvalidParameter; any other refused lookup maps to ErrorWalletOperation instead of ErrorUnknown. `find_provider_key`'s doc states the lookup window as the index it covers below, not a count past the pool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
Collaborator
|
🕓 Review not started yet because this PR is a draft.
Commit 3fc37c4. Normal review starts when eligible; priority review starts as soon as a slot is available. |
9 tasks
…c link The merge of the split rust-dashcore update removed the platform-node pool writer, the last code user of `ManagedWalletInfo` in this module; the `find_provider_key` doc link now names it by its full path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 22, 2026
Merged
Merged
…r replay Co-Authored-By: Codex <noreply@openai.com>
… replay Co-Authored-By: Codex <noreply@openai.com>
lklimek
force-pushed
the
feat/mn-provider-key-lookup
branch
from
November 24, 2026 11:15
4e2efa6 to
3fc37c4
Compare
14 of 18 tasks
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: platform-wallet can now find a wallet's masternode owner or voting key from the key's hash, using rust-dashcore's lookup instead of its own search, and masternode withdrawals use the same lookup.
User story
As a wallet app developer, I want to ask platform-wallet which of a wallet's owner or voting keys has a given hash, to achieve masternode key matching without the seed and without my own derivation code.
Scenario
Base flow
A wallet app knows the owner or voting key hash of a masternode (for example from the masternode list) and needs the wallet's matching key index and path, for display or to withdraw the node's credits.
Actual behavior
platform-wallet offers no such lookup. Masternode withdrawals use their own private owner-key scan with a separate window constant.
Expected behavior
PlatformWallet::find_provider_keyreturns the key's index and derivation path, orNonewhen the wallet does not hold it. Withdrawals find the owner key the same way.Detailed discussion
Issue being fixed or feature implemented
Stacked atop #6030 (
chore/mn-dashcore-k1-s1), which pins rust-dashcore with key-wallet's provider-key lookup (dashpay/rust-dashcore#1465).What was done?
PlatformWallet::find_provider_key(&self, role: ProviderKeyRole, key_hash160: &[u8; 20], index_hint: Option<u32>) -> Result<Option<(u32, DerivationPath)>, PlatformWalletError>(wallet/provider_key_at_index.rs).ManagedWalletInfo::find_provider_keyunder the wallet-manager read lock. It is seedless and blocking (blocking_read), likederive_provider_key_at_index.index_hintfirst, then the provider pool's entries, then every index belowDEFAULT_PROVIDER_KEY_WINDOW. A key at or past that index and outside the pool is found only through its hint, which is verified, never trusted.WalletNotFoundif the wallet was removed; newPlatformWalletError::ProviderKeyLookup { role, source: key_wallet::Error }if key-wallet refuses the lookup, for example for an index hint in the hardened range.ProviderKeyRole(Owner,Voting) is re-exported from the crate root.masternode_withdrawal_keysfinds the owner key throughfind_provider_key. The privatefind_owner_key,owner_key_matches_atandPROVIDER_KEY_WINDOWare removed.rs-platform-wallet-ffi/src/error.rs): a refused lookup maps by its cause. A hardened index hint (key_wallet::Error::Bip32(InvalidChildNumber)) is caller input and maps toErrorInvalidParameter; any other refused lookup maps toErrorWalletOperation.Not included: operator (BLS) keys, which key-wallet's lookup does not cover; the operator windows from #5889 stay as they are.
How Has This Been Tested?
provider_key_at_index.rs: owner and voting keys found by their hash; a key past the window found only through a matching hint; an owner key not found among the voting keys; a hardened hint refused withProviderKeyLookup.masternode_withdrawal.rs:should_resolve_the_owner_key_from_its_hash.should_map_a_refused_provider_key_lookup_by_its_cause.Breaking Changes
Public Rust API (not consensus), additive:
PlatformWallet::find_provider_key,PlatformWalletError::ProviderKeyLookup, theProviderKeyRolere-export. The removed items were private. FFI: no signature change; a refused lookup maps toErrorInvalidParameterorErrorWalletOperationas described above.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