Skip to content

Commit

Permalink
Fix ed25519 builtin program handling
Browse files Browse the repository at this point in the history
  • Loading branch information
jstarry committed Feb 16, 2022
1 parent 577fa4e commit 35ed5c5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
19 changes: 18 additions & 1 deletion runtime/src/builtins.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,15 @@ fn genesis_builtins() -> Vec<Builtin> {
solana_sdk::secp256k1_program::id(),
dummy_process_instruction,
),
Builtin::new(
"ed25519_program",
solana_sdk::ed25519_program::id(),
dummy_process_instruction,
),
]
}

/// place holder for secp256k1, remove when the precompile program is deactivated via feature activation
/// place holder for precompile programs, remove when the precompile program is deactivated via feature activation
fn dummy_process_instruction(
_first_instruction_account: usize,
_data: &[u8],
Expand Down Expand Up @@ -172,6 +177,18 @@ fn feature_builtins() -> Vec<(Builtin, Pubkey, ActivationType)> {
feature_set::prevent_calling_precompiles_as_programs::id(),
ActivationType::RemoveProgram,
),
// TODO when feature `prevent_calling_precompiles_as_programs` is
// cleaned up also remove "ed25519_program" from the main builtins
// list
(
Builtin::new(
"ed25519_program",
solana_sdk::ed25519_program::id(),
dummy_process_instruction,
),
feature_set::prevent_calling_precompiles_as_programs::id(),
ActivationType::RemoveProgram,
),
(
Builtin::new(
"address_lookup_table_program",
Expand Down
2 changes: 1 addition & 1 deletion sdk/src/precompiles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ lazy_static! {
),
Precompile::new(
crate::ed25519_program::id(),
Some(ed25519_program_enabled::id()),
Some(prevent_calling_precompiles_as_programs::id()),
crate::ed25519_instruction::verify,
),
];
Expand Down

0 comments on commit 35ed5c5

Please sign in to comment.