Revert "Remove feature switch for secp256k1 program (#18467)"

This reverts commit fd574dcb3b.
This commit is contained in:
Trent Nelson
2021-07-13 14:20:02 -06:00
committed by mergify[bot]
parent c19fce1b19
commit 568660b402
10 changed files with 103 additions and 41 deletions

View File

@@ -25,7 +25,7 @@ use solana_sdk::{
bpf_loader_upgradeable::{self, UpgradeableLoaderState},
clock::{BankId, Slot, INITIAL_RENT_EPOCH},
feature_set::{self, FeatureSet},
fee_calculator::FeeCalculator,
fee_calculator::{FeeCalculator, FeeConfig},
genesis_config::ClusterType,
hash::Hash,
message::Message,
@@ -424,6 +424,10 @@ impl Accounts {
rent_collector: &RentCollector,
feature_set: &FeatureSet,
) -> Vec<TransactionLoadResult> {
let fee_config = FeeConfig {
secp256k1_program_enabled: feature_set
.is_active(&feature_set::secp256k1_program_enabled::id()),
};
txs.zip(lock_results)
.map(|etx| match etx {
(tx, (Ok(()), nonce_rollback)) => {
@@ -436,7 +440,7 @@ impl Accounts {
.cloned()
});
let fee = if let Some(fee_calculator) = fee_calculator {
fee_calculator.calculate_fee(tx.message())
fee_calculator.calculate_fee_with_config(tx.message(), &fee_config)
} else {
return (Err(TransactionError::BlockhashNotFound), None);
};