Skip to content

Define and implement operator stake locking #252

Description

@snawaz

Goal

Make OperatorBond.locked_lamports track the operator stake reserved by active challenge-mode commitments.

Why

RegisterOperator initializes locked_lamports to zero, but no instruction changes it. ProposeCommitment checks that the operator has enough stake without reserving any of it. The same stake can therefore support any number of pending commitments.

Future withdrawal instructions also need this value. They must know how much stake is still tied to unfinished commitments before allowing the operator to withdraw.

Design Decisions

Decide and document:

  • how much stake each pending commitment locks;
  • whether the amount is fixed, configured per cluster, or based on the committed account;
  • when a commitment releases its lock;
  • how expiry, cancellation, finalization, and each dispute outcome affect the lock;
  • what happens to locked stake when the operator is slashed; and
  • how many commitments one bond can support at the same time.

Scope

  • Reject a new commitment when the operator does not have enough unlocked stake.
  • Increase locked_lamports when ProposeCommitment successfully creates a pending commitment.
  • Release or slash the reserved stake exactly once at the lifecycle point selected by the design.
  • Prevent stake withdrawal while that stake remains locked.
  • Handle several pending commitments without overflow or double release.
  • Keep the lock tied to the cluster-scoped OperatorBond, including across validator rotation.
  • Add tests for concurrent commitments, insufficient unlocked stake, every release path, slashing, and withdrawal checks.
  • Update the implementation notes with the selected rules.

Related work:

Outcome

One amount of operator stake cannot protect unlimited pending commitments, and stake that still protects a commitment cannot be withdrawn.

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions