Skip to content

DKG coordinator: policy_owner_idx write failure should fail the ceremony, not just warn #34

@aruokhai

Description

@aruokhai

Problem

cosigner-runtime/src/dkg_coordinator/handlers.rs around the DKG-step-3 finalize:

  • persist_policy(...) returns Err on failure → caller treats it as fatal ✓
  • The subsequent policy_owner_idx write only logs a warning if it fails (lines ~498-501).

If the forward-index write fails (disk full mid-flush, permission flip, sled corruption), the policy is persisted but un-discoverable by owner pubkey — only by recovery_id. The user would appear to onboard successfully but later fail in any flow that looks up policy by owner.

Impact

Low frequency (sled write failure is rare), but the failure mode is silent and split-state: the user can't tell from the success status that lookups will later fail.

Suggested fix

Either:

  • Propagate the index write failure as Err for symmetry with persist_policy, OR
  • Rebuild the index lazily on first lookup-miss if the underlying policy row exists (self-healing).

The first is simpler; the second is more resilient. Either is better than the current silent warn.

Discovered during PR #32 review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions