Repository navigation
Description
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
Delegateinstruction, 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
DelegationStatedescribed by Replace legacy delegation PDAs with a wheels-based DelegationState #249. - Bind the delegated account to its
DelegationClusterand preserve the account information needed by commit, finalization, and undelegation flows. - Let the cluster identify its current validator. Do not add a separate
DelegateWithAnyValidatorinstruction. - 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
- Replace legacy delegation PDAs with a wheels-based DelegationState #249 defines the shared
DelegationStatedirection and tracks replacing legacy delegation accounts in existing v2 instructions. - Streamline the MagicBlock Protocol v2 delegation account lifecycle #203 tracks the broader delegation and undelegation account lifecycle.
- Remove commit_frequency_ms from MagicBlock Protocol v2 #239 removes the unused commit-frequency setting.
Outcome
Both Direct and Challenge clusters can start from the same v2 delegation state without depending on legacy delegation accounts.
Activity
[-]Implement Delegate for the primary protocol[/-][+]Implement Delegate for v2[/+]