Skip to content

Support allocation-free PDA seed handling in MagicBlock Protocol v2 #108

Description

@snawaz

Goal

Allow MagicBlock Protocol v2 to delegate PDAs using the full runtime-supported seed count without heap allocation for on-chain seed decoding or validation.

Why

The current delegation processor accepts only 1–8 seeds, and its instruction arguments use Vec<Vec<u8>>. Delegation with actions repeats the same limit. The experimental v2 delegation path uses an empty seed slice as a placeholder, not a completed replacement.

The runtime allows 16 seeds total, including the bump. For the usual bump-appending derivation, that means up to 15 caller-provided seeds, each no longer than 32 bytes—not 16 caller-provided seeds plus a bump. See Solana's PDA derivation rules.

Scope

  • Remove the artificial eight-seed limit from v2 delegation, including delegation with actions, while preserving PDA and owning-program authorization checks.
  • Use one allocation-free on-chain seed-handling implementation rather than separate seed-count match tables. A macro is optional, not a requirement.
  • Handle the supported seed-count and length boundaries explicitly, including more than eight caller-provided seeds; reject inputs exceeding the runtime limits without panicking.
  • Coordinate with Streamline the MagicBlock Protocol v2 delegation account lifecycle #203's removal of unnecessary stored seeds. Do not retain seed storage solely to implement this issue. Update the v2 instruction interface and SDK callers together if their seed representation changes.

This is v2 work under #132. Keep v1 instruction encoding and account layouts unchanged.

Activity

  1. self-assigned this
    on Oct 15, 2025
  2. Nitish-bot commented on Feb 21, 2026

    @Nitish-bot

    can I take a shot at this?

  3. added theissue type on Aug 11, 2026
  4. changed the title [-]Support up to 16 seeds without heap allocation[/-] [+]Support allocation-free PDA seed handling in MagicBlock Protocol v2[/+] on Sep 17, 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