Skip to content

Reserve shielded identity slots across creation and local registration #5950

Open

Description

@thepastaclaw

Concurrent shielded identity creation calls can both observe the same empty identity index, spend different shielded notes, and broadcast creations before local registration. The wallet-manager write lock only serializes registration, so the later call can fail with IdentityIndexOccupied after its on-chain identity and pool funds are irreversible. Add a per-slot reservation held from the occupied-slot check through proving, broadcast, and local registration, and coordinate it with preparation and discovery moves. Release the reservation on every failure path.

Origin

Deferred from #5288 (review thread: #5288 (comment)) at the request of maintainer PastaPastaPasta.

PastaClaw finding (blocking): Reserve shielded identity slots across creation and local registration

The new occupied-slot check is performed under a wallet-manager read lock, but that lock is released before key derivation, proving, pool spending, broadcast, and local registration. Two concurrent calls for the same empty identity_index can both pass the preflight and broadcast identity creations. When they later take the manager write lock, only one can register locally; the other returns IdentityCreatedButNotRegistered after its on-chain creation and pool funds are already irreversible. Hold an identity-creation or placement reservation from the slot check through local registration, re

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions