From d818887746ff601a6af4ca883d647070a212b6b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20=E5=88=A9=E8=BF=AA=E6=81=A9?= Date: Thu, 27 Nov 2025 09:51:30 +0800 Subject: [PATCH 1/2] Added feature gate to assign Ed25519 precompile to native loader if not already assigned --- feature-set/src/lib.rs | 8 ++++++++ runtime/src/bank.rs | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/feature-set/src/lib.rs b/feature-set/src/lib.rs index b43a52acdfd..378fcac36c0 100644 --- a/feature-set/src/lib.rs +++ b/feature-set/src/lib.rs @@ -1204,6 +1204,10 @@ pub mod alt_bn128_little_endian { solana_pubkey::declare_id!("bnS3pWfLrxHRJvMyLm6EaYQkP7A2Fe9DxoKv4aGA8YM"); } +pub mod assign_ed25519_precompile_to_native_loader { + solana_pubkey::declare_id!("ownrov5XivPciuSz7cUNRUpJ4WC82H6N4KXvemHmHpU"); +} + pub static FEATURE_NAMES: LazyLock> = LazyLock::new(|| { [ (secp256k1_program_enabled::id(), "secp256k1 program"), @@ -2159,6 +2163,10 @@ pub static FEATURE_NAMES: LazyLock> = LazyLock::n alt_bn128_little_endian::id(), "SIMD-0284: Add little-endian compatibility for alt_bn128", ), + ( + assign_ed25519_precompile_to_native_loader::id(), + "Assign Ed25519 Precompile to native loader", + ), /*************** ADD NEW FEATURES HERE ***************/ ] .iter() diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 54d59229197..80138b81d56 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -5359,6 +5359,29 @@ impl Bank { self.update_rent(); } + if new_feature_activations + .contains(&feature_set::assign_ed25519_precompile_to_native_loader::id()) + { + if let Some(account) = self + .get_account_with_fixed_root(&solana_sdk_ids::ed25519_program::id()) + .and_then(|account| { + if !native_loader::check_id(account.owner()) { + Some(account) + } else { + None + } + }) + { + let new_account = AccountSharedData::from(Account { + owner: native_loader::ID, + executable: true, + ..Account::from(account) + }); + + self.store_account(&solana_sdk_ids::ed25519_program::id(), &new_account); + } + } + if new_feature_activations.contains(&feature_set::pico_inflation::id()) { *self.inflation.write().unwrap() = Inflation::pico(); self.fee_rate_governor.burn_percent = solana_fee_calculator::DEFAULT_BURN_PERCENT; // 50% fee burn From be144589bd6b99718d14d1fb3bcbae09e1d17f8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20=E5=88=A9=E8=BF=AA=E6=81=A9?= Date: Thu, 27 Nov 2025 15:27:04 +0800 Subject: [PATCH 2/2] Added data field for consistency with other clusters --- runtime/src/bank.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index 80138b81d56..8bb3f267ce6 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -5375,6 +5375,7 @@ impl Bank { let new_account = AccountSharedData::from(Account { owner: native_loader::ID, executable: true, + data: b"ed25519_program".to_vec(), ..Account::from(account) });