Skip to content
Closed
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
13 changes: 13 additions & 0 deletions feature-set/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,18 @@ pub mod enforce_fixed_fec_set {
solana_pubkey::declare_id!("fixfecLZYMfkGzwq6NJA11Yw6KYztzXiK9QcL3K78in");
}

pub mod replace_spl_token_with_p_token {
use super::Pubkey;

solana_pubkey::declare_id!("ptokSWRqZz5u2xdqMdstkMKpFurauUpVen7TZXgDpkQ");

pub const SPL_TOKEN_PROGRAM_ID: Pubkey =
Pubkey::from_str_const("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");

pub const PTOKEN_PROGRAM_BUFFER: Pubkey =
Pubkey::from_str_const("ptokNfvuU7terQ2r2452RzVXB3o4GT33yPWo1fUkkZ2");
}

pub static FEATURE_NAMES: LazyLock<AHashMap<Pubkey, &'static str>> = LazyLock::new(|| {
[
(secp256k1_program_enabled::id(), "secp256k1 program"),
Expand Down Expand Up @@ -1368,6 +1380,7 @@ pub static FEATURE_NAMES: LazyLock<AHashMap<Pubkey, &'static str>> = LazyLock::n
(raise_account_cu_limit::id(), "SIMD-0306: Raise account CU limit to 40% max"),
(raise_cpi_nesting_limit_to_8::id(), "SIMD-0296: Raise CPI nesting limit from 4 to 8"),
(enforce_fixed_fec_set::id(), "SIMD-0317: Enforce 32 data + 32 coding shreds"),
(replace_spl_token_with_p_token::id(), "SIMD-0266: Efficient Token program"),
/*************** ADD NEW FEATURES HERE ***************/
]
.iter()
Expand Down
13 changes: 13 additions & 0 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5324,6 +5324,19 @@ impl Bank {
if new_feature_activations.contains(&feature_set::raise_account_cu_limit::id()) {
self.apply_simd_0306_cost_tracker_changes();
}

if new_feature_activations.contains(&feature_set::replace_spl_token_with_p_token::id()) {
if let Err(e) = self.upgrade_loader_v2_owned_program(
&feature_set::replace_spl_token_with_p_token::SPL_TOKEN_PROGRAM_ID,
&feature_set::replace_spl_token_with_p_token::PTOKEN_PROGRAM_BUFFER,
"replace_spl_token_with_p_token",
) {
warn!(
"Failed to replace SPL Token with p-token buffer '{}': {e}",
feature_set::replace_spl_token_with_p_token::PTOKEN_PROGRAM_BUFFER,
);
}
}
}

fn adjust_sysvar_balance_for_rent(&self, account: &mut AccountSharedData) {
Expand Down
Loading
Loading