Skip to content

plugins: Enrollment & configuration program#2

Open
gzalz wants to merge 3 commits intomasterfrom
feat/maker-program
Open

plugins: Enrollment & configuration program#2
gzalz wants to merge 3 commits intomasterfrom
feat/maker-program

Conversation

@gzalz
Copy link
Copy Markdown
Collaborator

@gzalz gzalz commented Apr 21, 2026

Change Summary
Enable plugin enrollment and configuration on-chain. A program can be enrolled with it's upgrade_authority or the program's override_authority to address lost keys and frozen upgrade authorities. A optional delegate_authority can also be assigned to a program by either the upgrade_authority or override_authority. This is useful in scenarios where a multisig or DAO holds the upgrade authority. See the README.md for a deeper dive.

ProgramConfig
The signers, instruction data memcmp, and writable accounts required for plugin configuration.

MarketConfig
A generated ID and writable account used for inclusion logic in the BAM node.

ProgramConfig Status

  • Enrolled: the upgrade_authority or override_authority has initialized the on-chain state for the programs config
  • Active: The BAM Node set is using the program's config in block building
  • Unenroll: The program has opt-ed out of the plugin
  • OverrideUnenroll: The override_authority has opt-ed the program out of the plugin

Permissions

  • Activate is an instruction that can only be performed by the status_authority (Jito Labs or BAM Node set)
  • Only the admin_authority can set other authorities (other than delegate), this is set when the programconfig is initialized, the admin authority can change itself
  • The delegate_authority can be assigned at the ProgramConfig level only by the upgrade authority or override authority only
  • The delegate_authority can unenroll the programconfig
  • Only the upgrade_authority or override_authority can enroll a program

Milestones

  • M1: Collect enrollment and configuration data on-chain [achieved with follow up CLI PR]
  • M2: Apply configuration changes at N slot intervals on the BAM node

@gzalz gzalz changed the title plugins: Maker Registry Program plugins: Enrollment & configuration program Apr 21, 2026
///
/// Instruction data: none
pub fn process(program_id: &Address, accounts: &[AccountView], _data: &[u8]) -> ProgramResult {
let [authority, config, program_config] = accounts else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need config account here?

pub delegate_authority: Address,
pub seqno_instruction_data_offset: MemCmp,
pub signer_configs: [SignerConfig; PROGRAM_SIGNER_COUNT],
pub market_configs: [MarketConfig; MARKET_CONFIG_COUNT],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what would propAMMs have to do if they exceed 32 markets?

Some(rent_sysvar),
&[signer],
)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems there's no way to actually set the initial admins on the config?

program_config_state.seqno_instruction_data_offset = MemCmp {
offset: instruction_data.offset,
length: instruction_data.length,
};
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worth doing any boundary checks on the offset or length? for example maximum TX size could inform highest possible offset

.map_err(|_| ProgramError::InvalidInstructionData)?;
let bump = instruction_data.bump;
let expected =
pinocchio_pubkey::derive_address(&[b"config".as_ref()], Some(bump), program_id.as_array());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could be nice to put this in a method on Config

&[target_program_id.as_ref()],
Some(bump),
program_id.as_array(),
);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could be nice to put this in a method on Config

Also for future proofing if we want to add multiple plugin types to this program, adding another string "maker_priority" to the seeds could be useful to distinguish from other program configs

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.

3 participants