Skip to content

Commit

Permalink
feature-gate: migrate address lookup table to Core BPF
Browse files Browse the repository at this point in the history
  • Loading branch information
buffalojoec committed Jun 7, 2024
1 parent d95bac6 commit ad26b53
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 27 deletions.
43 changes: 16 additions & 27 deletions runtime/src/bank/builtins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,20 @@ pub static BUILTINS: &[BuiltinPrototype] = &[
program_id: solana_sdk::compute_budget::id(),
entrypoint: solana_compute_budget_program::Entrypoint::vm,
}),
testable_prototype!(BuiltinPrototype {
core_bpf_migration_config: None,
name: address_lookup_table_program,
BuiltinPrototype {
core_bpf_migration_config: Some(CoreBpfMigrationConfig {
source_buffer_address: buffer_accounts::address_lookup_table_program::id(),
upgrade_authority_address: None,
feature_id:
solana_sdk::feature_set::migrate_address_lookup_table_program_to_core_bpf::id(),
migration_target: core_bpf_migration::CoreBpfMigrationTargetType::Builtin,
datapoint_name: "migrate_builtin_to_core_bpf_address_lookup_table_program",
}),
name: "address_lookup_table_program",
enable_feature_id: None,
program_id: solana_sdk::address_lookup_table::program::id(),
entrypoint: solana_address_lookup_table_program::processor::Entrypoint::vm,
}),
},
testable_prototype!(BuiltinPrototype {
core_bpf_migration_config: None,
name: zk_token_proof_program,
Expand Down Expand Up @@ -130,6 +137,9 @@ pub static STATELESS_BUILTINS: &[StatelessBuiltinPrototype] = &[StatelessBuiltin

/// Live source buffer accounts for builtin migrations.
mod buffer_accounts {
pub mod address_lookup_table_program {
solana_sdk::declare_id!("AhXWrD9BBUYcKjtpA3zuiiZG4ysbo6C6wjHo1QhERk6A");
}
pub mod config_program {
solana_sdk::declare_id!("BuafH9fBv62u6XjzrzS4ZjAE8963ejqF5rt1f8Uga4Q3");
}
Expand Down Expand Up @@ -281,25 +291,6 @@ mod test_only {
};
}

pub mod address_lookup_table_program {
pub mod feature {
solana_sdk::declare_id!("5G9xu4TnRShZpEhWyjAW2FnRNCwF85g5XKzSbQy4XpCq");
}
pub mod source_buffer {
solana_sdk::declare_id!("DQshE9LTac8eXjZTi8ApeuZJYH67UxTMUxaEGstC6mqJ");
}
pub mod upgrade_authority {
solana_sdk::declare_id!("EPKzhEZxiwQ9n6bCj1pgdcN3nhtecCxjWqUcPGMT3wYK");
}
pub const CONFIG: super::CoreBpfMigrationConfig = super::CoreBpfMigrationConfig {
source_buffer_address: source_buffer::id(),
upgrade_authority_address: Some(upgrade_authority::id()),
feature_id: feature::id(),
migration_target: super::CoreBpfMigrationTargetType::Builtin,
datapoint_name: "migrate_builtin_to_core_bpf_address_lookup_table_program",
};
}

pub mod zk_token_proof_program {
pub mod feature {
solana_sdk::declare_id!("GfeFwUzKP9NmaP5u4VfnFgEvQoeQc2wPgnBFrUZhpib5");
Expand Down Expand Up @@ -376,10 +367,8 @@ mod tests {
&super::BUILTINS[7].core_bpf_migration_config,
&Some(super::test_only::compute_budget_program::CONFIG)
);
assert_eq!(
&super::BUILTINS[8].core_bpf_migration_config,
&Some(super::test_only::address_lookup_table_program::CONFIG)
);
// Address Lookup Table has a live migration config, so it has no
// test-only configs to test here.
assert_eq!(
&super::BUILTINS[9].core_bpf_migration_config,
&Some(super::test_only::zk_token_proof_program::CONFIG)
Expand Down
5 changes: 5 additions & 0 deletions sdk/src/feature_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,10 @@ pub mod migrate_config_program_to_core_bpf {
solana_sdk::declare_id!("2Fr57nzzkLYXW695UdDxDeR5fhnZWSttZeZYemrnpGFV");
}

pub mod migrate_address_lookup_table_program_to_core_bpf {
solana_sdk::declare_id!("C97eKZygrkU4JxJsZdjgbUY7iQR7rKTr4NyDWo2E5pRm");
}

lazy_static! {
/// Map of feature identifiers to user-visible description
pub static ref FEATURE_NAMES: HashMap<Pubkey, &'static str> = [
Expand Down Expand Up @@ -1016,6 +1020,7 @@ lazy_static! {
(migrate_feature_gate_program_to_core_bpf::id(), "Migrate Feature Gate program to Core BPF (programify) #1003"),
(vote_only_full_fec_sets::id(), "vote only full fec sets"),
(migrate_config_program_to_core_bpf::id(), "Migrate Config program to Core BPF #1378"),
(migrate_address_lookup_table_program_to_core_bpf::id(), "Migrate Address Lookup Table program to Core BPF #1651"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()
Expand Down

0 comments on commit ad26b53

Please sign in to comment.