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

[secp256k1] Remove old libsecp256k1_fail_on_bad_count features #2795

Merged
merged 1 commit into from
Sep 25, 2024
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
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions sdk/src/secp256k1_instruction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,7 @@ use {
crate::{instruction::Instruction, precompiles::PrecompileError},
digest::Digest,
serde_derive::{Deserialize, Serialize},
solana_feature_set::{
libsecp256k1_fail_on_bad_count, libsecp256k1_fail_on_bad_count2, FeatureSet,
},
solana_feature_set::FeatureSet,
};

pub const HASHED_PUBKEY_SERIALIZED_SIZE: usize = 20;
Expand Down Expand Up @@ -926,17 +924,13 @@ pub fn construct_eth_pubkey(
pub fn verify(
data: &[u8],
instruction_datas: &[&[u8]],
feature_set: &FeatureSet,
_feature_set: &FeatureSet,
) -> Result<(), PrecompileError> {
if data.is_empty() {
return Err(PrecompileError::InvalidInstructionDataSize);
}
let count = data[0] as usize;
if (feature_set.is_active(&libsecp256k1_fail_on_bad_count::id())
|| feature_set.is_active(&libsecp256k1_fail_on_bad_count2::id()))
&& count == 0
&& data.len() > 1
{
if count == 0 && data.len() > 1 {
// count is zero but the instruction data indicates that is probably not
// correct, fail the instruction to catch probable invalid secp256k1
// instruction construction.
Expand Down
Loading