Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature-Gate: Migrate Address Lookup Table program to Core BPF #1380

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 4 additions & 0 deletions sdk/src/feature_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,9 @@ pub mod migrate_config_program_to_core_bpf {
pub mod enable_get_epoch_stake_syscall {
solana_sdk::declare_id!("7mScTYkJXsbdrcwTQRs7oeCSXoJm4WjzBsRyf8bCU3Np");
}
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
Expand Down Expand Up @@ -1021,6 +1024,7 @@ lazy_static! {
(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"),
(enable_get_epoch_stake_syscall::id(), "Enable syscall: sol_get_epoch_stake #884"),
(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