Skip to content

Conversation

@Agusx1211
Copy link
Member

  • 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

@Agusx1211 Agusx1211 requested a review from Copilot April 24, 2025 18:33
Copy link
Contributor

Copilot AI left a 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)

@Agusx1211 Agusx1211 requested a review from Copilot May 5, 2025 17:34
Copy link
Contributor

Copilot AI left a 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 introduces a recovery extension to enhance the wallet by adding support for recovery key management—allowing devices to be added/removed, recovery payloads to be queued and listened for—and replaces the legacy Janitor module with a new Cron module for flexible scheduled tasks.

  • Adds new recovery types (RecoverySigner, QueuedRecoveryPayload) and endpoints across types, signers, manager, signatures, and handlers.
  • Integrates a recovery database, a RecoveryHandler, and updates primitive payload and extension modules to support recovery functionality.

Reviewed Changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/wallet/wdk/src/sequence/types/index.ts Adds new export types for recovery support.
packages/wallet/wdk/src/sequence/signers.ts Adds a recovery check returning Kinds.Recovery.
packages/wallet/wdk/src/sequence/signatures.ts Introduces a cron job for signature pruning.
packages/wallet/wdk/src/sequence/manager.ts Updates manager to integrate recovery options and register a RecoveryHandler.
packages/wallet/wdk/src/sequence/janitor.ts Removes obsolete janitor module.
packages/wallet/wdk/src/sequence/handlers/recovery.ts Implements the new RecoveryHandler.
packages/wallet/wdk/src/sequence/cron.ts Introduces a new Cron module for scheduled jobs.
packages/wallet/dbs/recovery.ts Adds a new recovery database layer.
Other files (primitives, extensions, CLI, wallet core, state) Update APIs, payload handling, and state management for recovery support.
Comments suppressed due to low confidence (1)

packages/wallet/wdk/src/sequence/manager.ts:317

  • [nitpick] Consider explicitly verifying that module.initialize is a function before invoking it to prevent potential runtime errors if a module’s initialize property is not callable.
for (const module of Object.values(modules)) { if ('initialize' in module) { module.initialize() } }

@Agusx1211 Agusx1211 marked this pull request as ready for review May 5, 2025 17:40
@Agusx1211 Agusx1211 requested review from a team as code owners May 5, 2025 17:40
@Agusx1211 Agusx1211 merged commit 1d15e59 into master May 5, 2025
3 checks passed
@Agusx1211 Agusx1211 deleted the recovery-topology branch May 5, 2025 17:42
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.

2 participants