Skip to content

Implement Delegate for v2 #257

Closed

Description

@snawaz

Goal

Implement the v2 protocol's Delegate instruction and create the canonical DelegationState for a delegated account.

Delegate is shared by Direct and Challenge clusters. It must not belong to either the direct or fraud_proofs processor module.

Why

The v2 commitment flows still depend on legacy delegation accounts because there is no v2 delegation instruction that creates their replacement. We need one shared delegation path before either cluster mode can use the wheels-based state model consistently.

Scope

  • Add the v2 Delegate instruction, builder, processor, and focused tests.
  • Keep its processor in the shared processor layer used by both Direct and Challenge clusters.
  • Create and initialize the wheels-based DelegationState described by Replace legacy delegation PDAs with a wheels-based DelegationState #249.
  • Bind the delegated account to its DelegationCluster and preserve the account information needed by commit, finalization, and undelegation flows.
  • Let the cluster identify its current validator. Do not add a separate DelegateWithAnyValidator instruction.
  • Use the v2 one-byte instruction format and the performance constraints in Implement MagicBlock Protocol v2 #132.
  • Keep every legacy delegation instruction, PDA, account layout, and behavior unchanged.

Reference

PR #140 explored an earlier v2 delegation design. Its lifecycle and field choices are useful references, but its raw account implementation, custom validation helpers, and commit-frequency field should not be copied.

Related work

Outcome

Both Direct and Challenge clusters can start from the same v2 delegation state without depending on legacy delegation accounts.

Activity

  1. self-assigned this
    on Oct 21, 2026
  2. added theissue type on Oct 21, 2026
  3. changed the title [-]Implement Delegate for the primary protocol[/-] [+]Implement Delegate for v2[/+] on Oct 22, 2026
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