Delegation program for MagicBlock Ephemeral Rollups, based on the protocol paper.
This repository is a Cargo workspace with two independently versioned packages:
program/contains the on-chain program.interface/contains the public wire types, account layouts, PDA helpers, CPI helpers, instruction builders, and feature-gated off-chain helpers.
Anchor integration tests live in
integration-tests/anchor/. Design documents,
release documentation, IDLs, and audit reports live under docs/,
idl/, and audits/.
Build the Rust workspace:
cargo build --workspaceRun the on-chain program tests with the Solana toolchain:
cargo test-sbf --manifest-path program/Cargo.toml --features unit_test_configRun the Anchor integration tests after building the program:
cargo build-sbf --manifest-path program/Cargo.toml
npm --prefix integration-tests/anchor install
./scripts/run-anchor-tests.shFor line coverage, use cargo llvm-cov, for example:
cargo llvm-cov --manifest-path program/Cargo.toml --test test_commit_statellvm-cov currently does not work with instructions that perform CPIs, such
as delegate and undelegate.
Upgrades go through a Squads multisig whose vault holds the upgrade authority. CI only proposes them.
- Run Actions -> Propose Program Upgrade with the target
cluster(start withdry_run). It buildsdelegation_programverifiably, uploads a buffer, and opens a Squads proposal that upgrades the program and records its verified build. The job summary shows the proposal number and executable hash. - Members review and approve the proposal in the Squads app for mainnet. For devnet, members can use the shared command-line tools with their own keypair.
- Once approved, any member with Execute permission executes it.
- For mainnet, run Actions -> Verify Program (Remote). OtterSec rebuilds the recorded commit and verifies it against the deployed binary.
See the squads-program-upgrade action for setup, membership changes, and per-cluster GitHub environments. See the release process for package and tag conventions.