Skip to content

fix(wallet): restore scans all keysets including inactive#1753

Merged
thesimplekid merged 6 commits intocashubtc:mainfrom
Forte11Cuba:fix/restore-inactive-keysets
Mar 23, 2026
Merged

fix(wallet): restore scans all keysets including inactive#1753
thesimplekid merged 6 commits intocashubtc:mainfrom
Forte11Cuba:fix/restore-inactive-keysets

Conversation

@Forte11Cuba
Copy link
Contributor

Description

restore() in wallet/mod.rs only scanned active keysets via load_mint_keysets(). If a mint has rotated keysets, proofs signed with the old (now inactive) keyset were never found during restore.

Added get_all_mint_keysets() which returns all keysets for the wallet's unit regardless of active status, and updated restore() to use it.

Closes #1752


Notes to the reviewers

The fix is minimal a new method get_all_mint_keysets() in keysets.rs that drops the keyset.active filter, and a one-line change in restore() to call it. The active filter remains correct for all other operations (mint, swap, melt) where you want the current keyset. - cdk: restore() now scans inactive keysets so proofs from rotated keysets are recovered


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED

  • cdk: restore() now scans inactive keysets so proofs from rotated keysets are recovered

Checklist

@github-project-automation github-project-automation bot moved this to Backlog in CDK Mar 20, 2026
Copy link
Collaborator

@thesimplekid thesimplekid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally we could add a tests that uses the fake mints rotate keyset to ensure we can restore both inactive and active.

@thesimplekid thesimplekid merged commit 34b7040 into cashubtc:main Mar 23, 2026
87 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in CDK Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

cdk-restore inactive keysets issue

3 participants