fix(rpc): resolve ID-typed addresses to pubkey addresses in WalletHas/WalletSign/WalletSignMessage - #140
Merged
Merged
Conversation
…/WalletSign/WalletSignMessage
Wallets store keys under the pubkey (BLS / secp / delegated) address, but
Filecoin miner data (MinerInfo.Worker, MinerGetBaseInfo.WorkerKey) surfaces
the ID-address (f0<n>). A caller that reads MinerGetBaseInfo and then asks
the Lantern wallet to sign for the returned WorkerKey would hit
'keystore: key not found' for the ID-address even when the corresponding
pubkey key was imported. Lotus quietly resolves the ID -> pubkey inside its
wallet path before doing the lookup; we now do the same.
Adds resolveToKeyAddress(ctx, addr) which:
- passes pubkey-typed addresses through unchanged,
- reads the on-chain Account actor via StateAccountKey for ID addresses,
- falls back to the original address on resolver error so the caller
still sees the underlying keystore error verbatim (fail-soft).
WalletHas, WalletSign, and WalletSignMessage all route through the helper.
Fixes the last blocker in Curio's mining loop when Lantern is the node:
'WinPoSt failed to check if we win next round: failed to compute VRF:
chain: keystore: key not found'. Live-verified on calibration 2026-07-15:
WalletHas(f0137632) now returns true after importing only the pubkey key.
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.
Wallets store keys under the pubkey (BLS / secp / delegated) address, but Filecoin miner data (
MinerInfo.Worker,MinerGetBaseInfo.WorkerKey) surfaces the ID-address (f0<n>). A caller that readsMinerGetBaseInfoand then asks the Lantern wallet to sign for the returnedWorkerKeyhitskeystore: key not foundfor the ID-address even when the corresponding pubkey key was imported. Lotus quietly resolves the ID → pubkey inside its wallet path before doing the lookup; we now do the same.Changes:
resolveToKeyAddress(ctx, addr)that passes pubkey-typed addresses through unchanged, reads the on-chain Account actor viaStateAccountKeyfor ID addresses, and falls back to the original address on resolver error (fail-soft).WalletHas,WalletSign, andWalletSignMessageall route through the helper.Fixes the last blocker in Curio's mining loop when Lantern is the node:
WinPoSt failed to check if we win next round: failed to compute VRF: chain: keystore: key not found.Live-verified on calibration 2026-07-15:
WalletHas(f0137632)returnstrueafter importing only the pubkey key.(Replaces PR #139, which was auto-closed when PR #138 merged and deleted its base branch.)