Skip to content

platform-wallet: one lifecycle-gated signer for every payment path #5937

Open

Description

@romchornyi

Expected Behavior

Payment paths that let the host sign without the teardown gate, then take the wallet's generation guard after the last signature and hold it through broadcast and bookkeeping, share one Rust helper. A fix to the gating or lock-order policy lands in every such path at once.

Current Behavior

Two separate implementations of the same state machine:

Both run the same steps:

  1. Take the owned payment guard.
  2. Compare the generation with Arc::ptr_eq under the manager lock.
  3. Record the gated or removed state.
  4. Expose gate() and removed().

They differ in the key type (IdentityPublicKey or PlatformAddress), in counting several inputs, and in handing the gate to the caller (into_gate).

Possible Solution

Move the shared part, "take the gate only if this wallet is still the current generation, keep it until released", into one IdentityWallet helper. Keep the two signing adapters thin. This is roughly 20 lines across two files, with no behaviour change.

Context

Raised in the review of #5929 and deferred, so that PR stays narrow. Related: #5925.

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