From 396b9a5b28561cda06556a56e2f72c06bcd25441 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 10:45:48 +0800 Subject: [PATCH 1/5] Assign Ed25519 precompile to native loader --- ...ign-ed25519-precompile-to-native-loader.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 proposals/XXXX-assign-ed25519-precompile-to-native-loader.md diff --git a/proposals/XXXX-assign-ed25519-precompile-to-native-loader.md b/proposals/XXXX-assign-ed25519-precompile-to-native-loader.md new file mode 100644 index 000000000..6250cd827 --- /dev/null +++ b/proposals/XXXX-assign-ed25519-precompile-to-native-loader.md @@ -0,0 +1,87 @@ +--- +simd: 'XXXX' +title: Assign Ed25519 Precompile to Native Loader +authors: + - Dean Little (Blueshift) + - David Leung (Blueshift) +category: Standard +type: Core +status: Review +created: 2027-11-27 +feature: (fill in with feature tracking issues once accepted) +--- + +## Summary + +This proposal restores nominal functionality of the Ed25519 precompile to +testnet witohut any changes to mainnet and devnet. + +## Motivation + +As a result of the Ed25519 program belonging to the System Program instead of +the Native Loader on testnet due to an old cluster configuration issue +https://github.com/solana-labs/solana/pull/23219, recent activation of SIMD-0186 +broke the Ed25519 precompile on the testnet cluster due to this branch of code +*correctly* enforcing the behavior we should have initially solved for: + +https://github.com/anza-xyz/agave/blob/89ead14a0fd576a13c37513419f8e2406769684f/svm/src/account_loader.rs#L607-L610 + +## New Terminology + +N/A + +## Detailed Design + +Introduce a feature gated change to `bank.rs` that, upon activation, updates +the owner of the Ed25519 program to the Native Loader program if it is not +already owned by it, also explicitly flagging its account as executable, +leaving all other fields unchanged. + +```rust +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); + } +} +``` + +## Alternatives Considered + +- Patch SIMD-0186 to add an exception in the case of the Ed25519 program +- Leave the functionality broken on testnet +- Only activate feature on testnet + +## Impact + +When activated on testnet, this feature will restore nominal behavior to the +Ed25519 precompile. When activated on mainnet and devnet, nothing will change. + +## Security Considerations + +None. + +## Drawbacks + +None. + +## Backwards Compatibility + +This feature is backwards compatible with mainnet and devnet, but results in +breaking changes on testnet required to resolve the existing regression. From 9dd73b8ed6ccf4aa23200d5876b3511873e37043 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 10:47:12 +0800 Subject: [PATCH 2/5] Assign SIMD number --- ...er.md => 0417-assign-ed25519-precompile-to-native-loader.md} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename proposals/{XXXX-assign-ed25519-precompile-to-native-loader.md => 0417-assign-ed25519-precompile-to-native-loader.md} (99%) diff --git a/proposals/XXXX-assign-ed25519-precompile-to-native-loader.md b/proposals/0417-assign-ed25519-precompile-to-native-loader.md similarity index 99% rename from proposals/XXXX-assign-ed25519-precompile-to-native-loader.md rename to proposals/0417-assign-ed25519-precompile-to-native-loader.md index 6250cd827..eba804ce2 100644 --- a/proposals/XXXX-assign-ed25519-precompile-to-native-loader.md +++ b/proposals/0417-assign-ed25519-precompile-to-native-loader.md @@ -1,5 +1,5 @@ --- -simd: 'XXXX' +simd: '0417' title: Assign Ed25519 Precompile to Native Loader authors: - Dean Little (Blueshift) From 428ec5fa00cb1bd17b4c85b72f1175093238c861 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 10:56:10 +0800 Subject: [PATCH 3/5] Remove agave-specific reference to bank.rs --- proposals/0417-assign-ed25519-precompile-to-native-loader.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/proposals/0417-assign-ed25519-precompile-to-native-loader.md b/proposals/0417-assign-ed25519-precompile-to-native-loader.md index eba804ce2..f9e43a913 100644 --- a/proposals/0417-assign-ed25519-precompile-to-native-loader.md +++ b/proposals/0417-assign-ed25519-precompile-to-native-loader.md @@ -32,10 +32,10 @@ N/A ## Detailed Design -Introduce a feature gated change to `bank.rs` that, upon activation, updates +Introduce a feature gated change to the bank that, upon activation, updates the owner of the Ed25519 program to the Native Loader program if it is not already owned by it, also explicitly flagging its account as executable, -leaving all other fields unchanged. +leaving all other remaining fields unchanged. ```rust if new_feature_activations From 50e3a4715b0c980657a18f4d7b1c7fd65525becb 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:29:02 +0800 Subject: [PATCH 4/5] Add ed25519_program data to account --- proposals/0417-assign-ed25519-precompile-to-native-loader.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/proposals/0417-assign-ed25519-precompile-to-native-loader.md b/proposals/0417-assign-ed25519-precompile-to-native-loader.md index f9e43a913..5bc1f8e1e 100644 --- a/proposals/0417-assign-ed25519-precompile-to-native-loader.md +++ b/proposals/0417-assign-ed25519-precompile-to-native-loader.md @@ -35,7 +35,8 @@ N/A Introduce a feature gated change to the bank that, upon activation, updates the owner of the Ed25519 program to the Native Loader program if it is not already owned by it, also explicitly flagging its account as executable, -leaving all other remaining fields unchanged. +and setting the data to `ed25519_program` to match all other clusters. All +other fields remain unchanged. ```rust if new_feature_activations @@ -54,6 +55,7 @@ if new_feature_activations let new_account = AccountSharedData::from(Account { owner: native_loader::ID, executable: true, + data: b"ed25519_program".to_vec(), ..Account::from(account) }); From e545721209053dddc8608e56bd067242b33ed718 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dean=20=E5=88=A9=E8=BF=AA=E6=81=A9?= <10921578+deanmlittle@users.noreply.github.com> Date: Thu, 27 Nov 2025 20:58:27 +0800 Subject: [PATCH 5/5] Update proposals/0417-assign-ed25519-precompile-to-native-loader.md Co-authored-by: Joe C --- proposals/0417-assign-ed25519-precompile-to-native-loader.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proposals/0417-assign-ed25519-precompile-to-native-loader.md b/proposals/0417-assign-ed25519-precompile-to-native-loader.md index 5bc1f8e1e..127f343cd 100644 --- a/proposals/0417-assign-ed25519-precompile-to-native-loader.md +++ b/proposals/0417-assign-ed25519-precompile-to-native-loader.md @@ -14,7 +14,7 @@ feature: (fill in with feature tracking issues once accepted) ## Summary This proposal restores nominal functionality of the Ed25519 precompile to -testnet witohut any changes to mainnet and devnet. +testnet without any changes to mainnet and devnet. ## Motivation