From ad26b53ab614943c383d8ca9796a3f2051c05416 Mon Sep 17 00:00:00 2001 From: Joe Caulfield Date: Fri, 7 Jun 2024 16:25:01 -0500 Subject: [PATCH] feature-gate: migrate address lookup table to Core BPF --- runtime/src/bank/builtins/mod.rs | 43 ++++++++++++-------------------- sdk/src/feature_set.rs | 5 ++++ 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/runtime/src/bank/builtins/mod.rs b/runtime/src/bank/builtins/mod.rs index 7178e92a80df49..8a7760850dc64c 100644 --- a/runtime/src/bank/builtins/mod.rs +++ b/runtime/src/bank/builtins/mod.rs @@ -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, @@ -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"); } @@ -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"); @@ -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) diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs index ed3a7ff5162341..d45e4195e4fbc2 100644 --- a/sdk/src/feature_set.rs +++ b/sdk/src/feature_set.rs @@ -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 = [ @@ -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()