Skip to content

feat: added internal built-in magic root program#23

Open
bmuddha wants to merge 1 commit into
processorfrom
programs
Open

feat: added internal built-in magic root program#23
bmuddha wants to merge 1 commit into
processorfrom
programs

Conversation

@bmuddha

@bmuddha bmuddha commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

What changed

Added the engine's built-in MagicRoot program as two crates: magic-root-program
(execution) and magic-root-interface (shared instruction schema).

Why

The engine needs a privileged built-in for account changes no ordinary program
may make — patching arbitrary fields, finalizing, and closing accounts — while
letting callers build those instructions without depending on execution logic.

Part of #4.

Impact

  • magic-root-program is wired in as MagicRootEntrypoint; the schema lives in
    nucleus::runtime.
  • Finalize debits lamports from the payer to conserve supply and loads
    executable targets into the tx program cache; Delete sets AccountMode::Closed;
    PostFinalize CPIs follow-ups after rejecting immutable writable accounts.
  • magic-root-interface exposes MagicRootInstruction and compose so engine
    can build instructions without the program crate.

Reviewer notes

The program is unrestricted, so it is authority-gated: every instruction must be
top-level (no CPI) and signed by AUTHORITY, checked before any account is touched.

Follow-up

engine issues account CRUD as MagicRoot instruction sequences upstack.

bmuddha commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator Author

@bmuddha bmuddha force-pushed the programs branch 2 times, most recently from 73c6092 to 3c15947 Compare June 24, 2026 16:22
@bmuddha bmuddha force-pushed the processor branch 2 times, most recently from 076b715 to b45cdf8 Compare June 25, 2026 19:52
@bmuddha bmuddha force-pushed the programs branch 2 times, most recently from 367c7dc to 5f260c4 Compare June 26, 2026 10:36
@bmuddha bmuddha force-pushed the processor branch 2 times, most recently from 114bf56 to 4e0fa26 Compare June 26, 2026 16:33
@bmuddha bmuddha force-pushed the programs branch 3 times, most recently from e26900b to 7921abb Compare June 30, 2026 15:56
@bmuddha bmuddha force-pushed the processor branch 2 times, most recently from 756dc43 to 63b2969 Compare June 30, 2026 21:16
@bmuddha bmuddha force-pushed the programs branch 2 times, most recently from 11b31fc to ffefa44 Compare July 1, 2026 20:03
@bmuddha bmuddha force-pushed the programs branch 2 times, most recently from 6584d35 to 3cab4ae Compare July 2, 2026 19:39
@bmuddha bmuddha force-pushed the processor branch 2 times, most recently from 4017081 to e4a411b Compare July 3, 2026 06:33
@bmuddha bmuddha force-pushed the programs branch 2 times, most recently from 9bb4f46 to 9efac37 Compare July 3, 2026 22:01
@bmuddha bmuddha force-pushed the processor branch 2 times, most recently from b3c95bd to fe72258 Compare July 6, 2026 12:36
@bmuddha bmuddha force-pushed the programs branch 2 times, most recently from 0bf5e1b to c81a74f Compare July 6, 2026 14:46
@bmuddha bmuddha marked this pull request as ready for review July 6, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant