Skip to content

Add tests for Recovery pallet #491

@rockbmb

Description

@rockbmb

pallet-recovery enables $M$-of- $N$ social recovery for accounts, allowing users to regain access through trusted friends.
It is already deployed on Kusama, and there are plans to deploy it to Polkadot in Q1 2026.

This is a critical security feature that needs comprehensive E2E testing to validate the multi-party workflow and deposit mechanics.
This issue tracks the addition of E2E tests for recovery functionality.

Example tests:

  • CUIs (Critical User Interactions)

    • Create recovery configuration with friends list, threshold, and delay period
    • Initiate recovery attempt for a recoverable account
    • Vouch for an active recovery as a trusted friend
    • Claim recovered account after meeting threshold and delay requirements
    • Execute calls on behalf of recovered account via as_recovered
    • Close active recovery attempts (by either party)
  • CUJs (Critical User Journeys)

    • Complete recovery flow: user sets up recovery → loses access → initiates from new account → friends vouch → claims after delay → executes transactions → cleans up
    • Malicious recovery defense: attacker initiates recovery → victim detects it → victim closes attempt and claims attacker's deposit as penalty
    • Multi-party coordination: multiple friends vouch in arbitrary order until threshold met, then rescuer claims
  • Failure Modes

    • Threshold not met: insufficient friend vouches prevent claiming
    • Delay period not elapsed: premature claim attempts fail
    • Permission violations: non-rescuer cannot call as_recovered, wrong account targeting
    • Cannot remove config while active recoveries exist
  • Edge Cases

    • Multiple concurrent rescuers attempting recovery of same account
    • Deposit adjustments via poke_deposit after governance parameter changes
    • Invalid configurations: zero threshold, unsorted/duplicate friends, threshold > friend count
    • Root origin set_recovered bypass of normal recovery process

Metadata

Metadata

Assignees

Labels

e2e testsRelated to end-to-end testsenhancementNew feature or request
No fields configured for Feature.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions