Skip to content

fix(rpc): resolve ID-typed addresses to pubkey addresses in WalletHas/WalletSign/WalletSignMessage - #140

Merged
Reiers merged 1 commit into
mainfrom
fix/wallet-resolve-id-address
Jul 15, 2026
Merged

fix(rpc): resolve ID-typed addresses to pubkey addresses in WalletHas/WalletSign/WalletSignMessage#140
Reiers merged 1 commit into
mainfrom
fix/wallet-resolve-id-address

Conversation

@Reiers

@Reiers Reiers commented Jul 15, 2026

Copy link
Copy Markdown
Owner

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 hits 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.

Changes:

  • Add resolveToKeyAddress(ctx, addr) that passes pubkey-typed addresses through unchanged, reads the on-chain Account actor via StateAccountKey for ID addresses, and falls back to the original address on resolver error (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) returns true after importing only the pubkey key.

(Replaces PR #139, which was auto-closed when PR #138 merged and deleted its base branch.)

…/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.
@Reiers
Reiers merged commit 9704f1b into main Jul 15, 2026
2 checks passed
@Reiers
Reiers deleted the fix/wallet-resolve-id-address branch July 15, 2026 16:34
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.

1 participant