-
Notifications
You must be signed in to change notification settings - Fork 62
Recovery extension #735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Recovery extension #735
Conversation
Agusx1211
commented
Apr 24, 2025
- Adds and removes devices from the list of recovery keys (during login and logout)
- Janitor -> Cron (more flexible and can be reused)
- Allows for queuing recovery payloads
- Allows for listening to queued recovery payloads
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a recovery extension that enables adding/removing devices from the list of recovery keys, queues recovery payloads, and listens to queued recovery payload updates by replacing the old janitor and integrating a new cron job mechanism.
- Updates module topology conversion to support recovery modules
- Introduces new recovery-related types and functions (e.g. RecoverySigner, QueuedRecoveryPayload)
- Implements a new Cron scheduler and removes the old Janitor module
Reviewed Changes
Copilot reviewed 15 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
packages/wallet/wdk/src/sequence/wallets.ts | Updates configuration topology handling to integrate recovery options and converts modules to a list of SapientSignerLeaf |
packages/wallet/wdk/src/sequence/types/signer.ts | Adds RecoverySigner type |
packages/wallet/wdk/src/sequence/types/signature-request.ts | Adds a new 'recovery' action type |
packages/wallet/wdk/src/sequence/recovery.ts | Implements recovery module logic including init, add, remove, and queue/complete recovery payload functions |
packages/wallet/wdk/src/sequence/manager.ts | Integrates recovery and cron modules into the manager API |
packages/wallet/wdk/src/sequence/cron.ts | New Cron job scheduler replaces the earlier Janitor module |
packages/wallet/dbs/recovery.ts | Provides a new database for queued recovery payloads |
packages/wallet/primitives/src/payload.ts, extensions/recovery.ts, extensions/index.ts | Updates payload type definitions and adds recovery-related extension functions |
Files not reviewed (2)
- packages/wallet/wdk/package.json: Language not supported
- pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)
packages/wallet/wdk/src/sequence/recovery.ts:129
- [nitpick] The variable name 'recovertLeaf' appears to be misspelled. Consider renaming it to 'recoveryLeaf' for clarity and consistency.
const recovertLeaf = raw.modules.find((m) => m.address === this.shared.sequence.extensions.recovery)