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 May 16, 2024
1 parent ed64bd6 commit edef0e1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 23 deletions.
36 changes: 13 additions & 23 deletions runtime/src/bank/builtins/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,19 @@ 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(),
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 @@ -128,6 +134,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 @@ -251,21 +260,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 const CONFIG: super::CoreBpfMigrationConfig = super::CoreBpfMigrationConfig {
source_buffer_address: source_buffer::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 @@ -332,10 +326,6 @@ 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)
);
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 @@ -809,6 +809,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 @@ -1006,6 +1010,7 @@ lazy_static! {
(abort_on_invalid_curve::id(), "Abort when elliptic curve syscalls invoked on invalid curve id SIMD-0137"),
(migrate_feature_gate_program_to_core_bpf::id(), "Migrate Feature Gate program to Core BPF (programify) #1003"),
(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 #"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()
Expand Down

0 comments on commit edef0e1

Please sign in to comment.