Skip to content

Two-step admin handover with pending_admin slot #231

Description

@kilodesodiq-arch

Problem Statement. Admin is set once at init() and never changed. There is no two-step
rotation, no revocation path for a lost admin key, and no recovery code.

Why it matters. Lost admin keys are an obvious, severe incident. A maintainer must
have a way to rotate the admin without redeploying the Wasm.

Technical Context. KEY_ADMIN is a single value. There is no pending_admin slot.

Expected Outcome.

  • rotate_admin(new_admin) is callable only by current admin, sets KEY_PENDING_ADMIN.
  • accept_admin() is callable only by pending_admin, replaces KEY_ADMIN, clears
    KEY_PENDING_ADMIN, emits AdminRotatedEvent.
  • A 7-day bounded accept_admin deadline enforced (configurable).

Acceptance Criteria.

  • New test asserts old admin cannot pause after accepting-rotation is complete.
  • New test asserts pending_admin does not gain powers until accept_admin.

Files or modules likely to be affected. src/lib.rs, tests/aid_escrow_tests.rs.

Difficulty. Hard
Estimated effort. M



Backlog item #23 from `docs/maintainer-issue-backlog.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions