diff --git a/Cargo.lock b/Cargo.lock index ccf3dad5b11945..4cc49b5febbe81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,9 +1064,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", @@ -2407,9 +2407,9 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "hidapi" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b125253e27c9fd67beac20665348f4bfc5b488b5c8a1020610eeb7e6d205cde" +checksum = "830eccace7c861211d0ad04288e5dad690d6711b0db152084da58882ee7a840a" dependencies = [ "cc", "cfg-if 1.0.0", @@ -4841,9 +4841,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] @@ -4859,9 +4859,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -4870,9 +4870,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", diff --git a/Cargo.toml b/Cargo.toml index e1177f23f60c80..095f844475fe32 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -170,7 +170,7 @@ bzip2 = "0.4.4" caps = "0.5.5" cargo_metadata = "0.15.4" cc = "1.0.83" -chrono = { version = "0.4.32", default-features = false } +chrono = { version = "0.4.33", default-features = false } chrono-humanize = "0.2.3" clap = "2.33.1" console = "0.15.8" @@ -212,7 +212,7 @@ gethostname = "0.2.3" getrandom = "0.2.10" goauth = "0.13.1" hex = "0.4.3" -hidapi = { version = "2.5.0", default-features = false } +hidapi = { version = "2.5.1", default-features = false } histogram = "0.6.9" hmac = "0.12.1" http = "0.2.11" @@ -292,10 +292,10 @@ rustversion = "1.0.14" scopeguard = "1.2.0" semver = "1.0.21" seqlock = "0.2.0" -serde = "1.0.195" +serde = "1.0.196" serde_bytes = "0.11.14" serde_derive = "1.0.103" -serde_json = "1.0.111" +serde_json = "1.0.113" serde_with = { version = "2.3.3", default-features = false } serde_yaml = "0.9.30" serial_test = "2.0.0" diff --git a/accounts-db/src/cache_hash_data.rs b/accounts-db/src/cache_hash_data.rs index e9675b9fd22798..a0e8507c50520e 100644 --- a/accounts-db/src/cache_hash_data.rs +++ b/accounts-db/src/cache_hash_data.rs @@ -214,7 +214,7 @@ impl CacheHashData { cache_dir, pre_existing_cache_files: Arc::new(Mutex::new(HashSet::default())), deletion_policy, - stats: Arc::default(), + stats: Arc::new(CacheHashDataStats::default()), }; result.get_cache_files(); diff --git a/accounts-db/src/tiered_storage/hot.rs b/accounts-db/src/tiered_storage/hot.rs index 730ace5aa310ed..311da9916785f6 100644 --- a/accounts-db/src/tiered_storage/hot.rs +++ b/accounts-db/src/tiered_storage/hot.rs @@ -326,7 +326,7 @@ impl HotStorageReader { } /// Returns the offset to the account given the specified index. - fn get_account_offset( + pub(super) fn get_account_offset( &self, index_offset: IndexOffset, ) -> TieredStorageResult { diff --git a/accounts-db/src/tiered_storage/readable.rs b/accounts-db/src/tiered_storage/readable.rs index aff29a79fb03ab..647c78d5ca91c1 100644 --- a/accounts-db/src/tiered_storage/readable.rs +++ b/accounts-db/src/tiered_storage/readable.rs @@ -1,9 +1,12 @@ use { crate::{ + account_storage::meta::StoredAccountMeta, + accounts_file::MatchAccountOwnerError, accounts_hash::AccountHash, tiered_storage::{ footer::{AccountMetaFormat, TieredStorageFooter}, hot::HotStorageReader, + index::IndexOffset, meta::TieredAccountMeta, TieredStorageResult, }, @@ -111,4 +114,38 @@ impl TieredStorageReader { Self::Hot(hot) => hot.num_accounts(), } } + + /// Returns the account located at the specified index offset. + pub fn get_account( + &self, + index_offset: u32, + ) -> TieredStorageResult, usize)>> { + match self { + Self::Hot(hot) => hot.get_account(IndexOffset(index_offset)), + } + } + + /// Returns Ok(index_of_matching_owner) if the account owner at + /// `account_offset` is one of the pubkeys in `owners`. + /// + /// Returns Err(MatchAccountOwnerError::NoMatch) if the account has 0 + /// lamports or the owner is not one of the pubkeys in `owners`. + /// + /// Returns Err(MatchAccountOwnerError::UnableToLoad) if there is any internal + /// error that causes the data unable to load, including `account_offset` + /// causes a data overrun. + pub fn account_matches_owners( + &self, + index_offset: u32, + owners: &[Pubkey], + ) -> Result { + match self { + Self::Hot(hot) => { + let account_offset = hot + .get_account_offset(IndexOffset(index_offset)) + .map_err(|_| MatchAccountOwnerError::UnableToLoad)?; + hot.account_matches_owners(account_offset, owners) + } + } + } } diff --git a/gossip/src/cluster_info.rs b/gossip/src/cluster_info.rs index 23038b0407d30e..7cddbdb5a963b1 100644 --- a/gossip/src/cluster_info.rs +++ b/gossip/src/cluster_info.rs @@ -32,8 +32,8 @@ use { CrdsFilter, CrdsTimeouts, ProcessPullStats, CRDS_GOSSIP_PULL_CRDS_TIMEOUT_MS, }, crds_value::{ - self, AccountsHashes, CrdsData, CrdsValue, CrdsValueLabel, EpochSlotsIndex, LowestSlot, - NodeInstance, SnapshotHashes, Version, Vote, MAX_WALLCLOCK, + self, CrdsData, CrdsValue, CrdsValueLabel, EpochSlotsIndex, LowestSlot, NodeInstance, + SnapshotHashes, Version, Vote, MAX_WALLCLOCK, }, duplicate_shred::DuplicateShred, epoch_slots::EpochSlots, @@ -259,14 +259,6 @@ struct PullData { filter: CrdsFilter, } -pub fn make_accounts_hashes_message( - keypair: &Keypair, - accounts_hashes: Vec<(Slot, Hash)>, -) -> Option { - let message = CrdsData::AccountsHashes(AccountsHashes::new(keypair.pubkey(), accounts_hashes)); - Some(CrdsValue::new_signed(message, keypair)) -} - pub(crate) type Ping = ping_pong::Ping<[u8; GOSSIP_PING_TOKEN_SIZE]>; // TODO These messages should go through the gpu pipeline for spam filtering @@ -392,7 +384,6 @@ fn retain_staked(values: &mut Vec, stakes: &HashMap) { // the various dashboards. CrdsData::Version(_) => true, CrdsData::NodeInstance(_) => true, - // getHealth fails if account hashes are not propagated. CrdsData::AccountsHashes(_) => true, CrdsData::LowestSlot(_, _) | CrdsData::LegacyVersion(_) @@ -1021,19 +1012,6 @@ impl ClusterInfo { .push(message); } - pub fn push_accounts_hashes(&self, accounts_hashes: Vec<(Slot, Hash)>) { - if accounts_hashes.len() > MAX_ACCOUNTS_HASHES { - warn!( - "accounts hashes too large, ignored: {}", - accounts_hashes.len(), - ); - return; - } - - let message = CrdsData::AccountsHashes(AccountsHashes::new(self.id(), accounts_hashes)); - self.push_message(CrdsValue::new_signed(message, &self.keypair())); - } - pub fn push_snapshot_hashes( &self, full: (Slot, Hash), @@ -1221,16 +1199,6 @@ impl ClusterInfo { Ok(()) } - pub fn get_accounts_hash_for_node(&self, pubkey: &Pubkey, map: F) -> Option - where - F: FnOnce(&Vec<(Slot, Hash)>) -> Y, - { - self.time_gossip_read_lock("get_accounts_hash", &self.stats.get_accounts_hash) - .get::<&CrdsValue>(&CrdsValueLabel::AccountsHashes(*pubkey)) - .map(|x| &x.accounts_hash().unwrap().hashes) - .map(map) - } - pub fn get_snapshot_hashes_for_node(&self, pubkey: &Pubkey) -> Option { self.gossip .crds @@ -3185,7 +3153,7 @@ mod tests { super::*, crate::{ crds_gossip_pull::tests::MIN_NUM_BLOOM_FILTERS, - crds_value::{CrdsValue, CrdsValueLabel, Vote as CrdsVote}, + crds_value::{AccountsHashes, CrdsValue, CrdsValueLabel, Vote as CrdsVote}, duplicate_shred::{self, tests::new_rand_shred, MAX_DUPLICATE_SHREDS}, }, itertools::izip, diff --git a/gossip/src/crds_value.rs b/gossip/src/crds_value.rs index ad6422fc2e5188..6dcbbde2d14373 100644 --- a/gossip/src/crds_value.rs +++ b/gossip/src/crds_value.rs @@ -87,7 +87,7 @@ pub enum CrdsData { Vote(VoteIndex, Vote), LowestSlot(/*DEPRECATED:*/ u8, LowestSlot), LegacySnapshotHashes(LegacySnapshotHashes), // Deprecated - AccountsHashes(AccountsHashes), + AccountsHashes(AccountsHashes), // Deprecated EpochSlots(EpochSlotsIndex, EpochSlots), LegacyVersion(LegacyVersion), Version(Version), @@ -663,13 +663,6 @@ impl CrdsValue { } } - pub(crate) fn accounts_hash(&self) -> Option<&AccountsHashes> { - match &self.data { - CrdsData::AccountsHashes(slots) => Some(slots), - _ => None, - } - } - pub(crate) fn epoch_slots(&self) -> Option<&EpochSlots> { match &self.data { CrdsData::EpochSlots(_, slots) => Some(slots), diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 50bc3a40263743..d4a5a3eb18ea69 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -819,12 +819,13 @@ fn main() { ), ) .arg( - Arg::with_name("snapshot_archive_path") - .long("snapshot-archive-path") + Arg::with_name("snapshots") + .long("snapshots") + .alias("snapshot-archive-path") .value_name("DIR") .takes_value(true) .global(true) - .help("Use DIR for snapshot location"), + .help("Use DIR for snapshot location [default: --ledger value]"), ) .arg( Arg::with_name("incremental_snapshot_archive_path") @@ -1420,7 +1421,7 @@ fn main() { info!("{} {}", crate_name!(), solana_version::version!()); let ledger_path = PathBuf::from(value_t_or_exit!(matches, "ledger_path", String)); - let snapshot_archive_path = value_t!(matches, "snapshot_archive_path", String) + let snapshot_archive_path = value_t!(matches, "snapshots", String) .ok() .map(PathBuf::from); let incremental_snapshot_archive_path = diff --git a/ledger-tool/src/program.rs b/ledger-tool/src/program.rs index 732c2e8fe3aaee..b56affd4c905c2 100644 --- a/ledger-tool/src/program.rs +++ b/ledger-tool/src/program.rs @@ -71,7 +71,7 @@ fn load_accounts(path: &Path) -> Result { fn load_blockstore(ledger_path: &Path, arg_matches: &ArgMatches<'_>) -> Arc { let process_options = parse_process_options(ledger_path, arg_matches); - let snapshot_archive_path = value_t!(arg_matches, "snapshot_archive_path", String) + let snapshot_archive_path = value_t!(arg_matches, "snapshots", String) .ok() .map(PathBuf::from); let incremental_snapshot_archive_path = diff --git a/programs/sbf/Cargo.lock b/programs/sbf/Cargo.lock index d441666b28835f..d0a8a630e415e7 100644 --- a/programs/sbf/Cargo.lock +++ b/programs/sbf/Cargo.lock @@ -940,9 +940,9 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", @@ -4279,9 +4279,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] @@ -4297,9 +4297,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -4308,9 +4308,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", diff --git a/runtime/src/bank.rs b/runtime/src/bank.rs index e7b17913e3aa57..6f5cd9a07f607b 100644 --- a/runtime/src/bank.rs +++ b/runtime/src/bank.rs @@ -1853,7 +1853,7 @@ impl Bank { fields.epoch, ))), check_program_modification_slot: false, - epoch_reward_status: EpochRewardStatus::default(), + epoch_reward_status: fields.epoch_reward_status, }; bank.finish_init( genesis_config, @@ -5370,7 +5370,6 @@ impl Bank { self.get_reward_interval(), &program_accounts_map, &programs_loaded_for_tx_batch.borrow(), - self.should_collect_rent(), ); load_time.stop(); @@ -6720,17 +6719,6 @@ impl Bank { &self.runtime_config.compute_budget.unwrap_or_default(), false, /* debugging_features */ )); - - // genesis_config loaded by accounts_db::open_genesis_config() from ledger - // has it's lamports_per_signature set to zero; bank sets its value correctly - // after the first block with a transaction in it. This is a hack to mimic - // the process. - let derived_fee_rate_governor = - FeeRateGovernor::new_derived(&genesis_config.fee_rate_governor, 0); - // new bank's fee_structure.lamports_per_signature should be inline with - // what's configured in GenesisConfig - self.fee_structure.lamports_per_signature = - derived_fee_rate_governor.lamports_per_signature; } pub fn set_inflation(&self, inflation: Inflation) { diff --git a/runtime/src/bank/serde_snapshot.rs b/runtime/src/bank/serde_snapshot.rs index ca6c6ee6adebd8..df51d31e568cee 100644 --- a/runtime/src/bank/serde_snapshot.rs +++ b/runtime/src/bank/serde_snapshot.rs @@ -411,7 +411,7 @@ mod tests { ); // assert epoch_reward_status is the same as the set epoch reward status - let epoch_reward_status = bank + let epoch_reward_status = dbank .get_epoch_reward_status_to_serialize() .unwrap_or(&EpochRewardStatus::Inactive); if let Some(rewards) = epoch_reward_status_active { @@ -504,7 +504,7 @@ mod tests { ); // assert epoch_reward_status is the same as the set epoch reward status - let epoch_reward_status = bank + let epoch_reward_status = dbank .get_epoch_reward_status_to_serialize() .unwrap_or(&EpochRewardStatus::Inactive); if let Some(rewards) = epoch_reward_status_active { @@ -593,7 +593,7 @@ mod tests { assert_eq!(0, dbank.fee_rate_governor.lamports_per_signature); // epoch_reward status should default to `Inactive` - let epoch_reward_status = bank + let epoch_reward_status = dbank .get_epoch_reward_status_to_serialize() .unwrap_or(&EpochRewardStatus::Inactive); assert_matches!(epoch_reward_status, EpochRewardStatus::Inactive); diff --git a/runtime/src/bank/tests.rs b/runtime/src/bank/tests.rs index e19eaa9aca96ad..ad28005fccfe7e 100644 --- a/runtime/src/bank/tests.rs +++ b/runtime/src/bank/tests.rs @@ -3335,6 +3335,7 @@ fn test_bank_parent_account_spend() { let key2 = Keypair::new(); let (parent, bank_forks) = Bank::new_with_bank_forks_for_tests(&genesis_config); let amount = genesis_config.rent.minimum_balance(0); + println!("==== amount {}", amount); let tx = system_transaction::transfer(&mint_keypair, &key1.pubkey(), amount, genesis_config.hash()); @@ -10998,7 +10999,6 @@ fn test_rent_state_list_len() { RewardInterval::OutsideInterval, &HashMap::new(), &LoadedProgramsForTxBatch::default(), - true, ); let compute_budget = bank.runtime_config.compute_budget.unwrap_or_else(|| { diff --git a/runtime/src/svm/account_loader.rs b/runtime/src/svm/account_loader.rs index beedace9ede1ac..31ce63654670e5 100644 --- a/runtime/src/svm/account_loader.rs +++ b/runtime/src/svm/account_loader.rs @@ -22,7 +22,7 @@ use { create_executable_meta, is_builtin, is_executable, Account, AccountSharedData, ReadableAccount, WritableAccount, }, - feature_set::{include_loaded_accounts_data_size_in_fee_calculation, FeatureSet}, + feature_set::{self, include_loaded_accounts_data_size_in_fee_calculation, FeatureSet}, fee::FeeStructure, message::SanitizedMessage, native_loader, @@ -52,7 +52,6 @@ pub(crate) fn load_accounts( in_reward_interval: RewardInterval, program_accounts: &HashMap, loaded_programs: &LoadedProgramsForTxBatch, - should_collect_rent: bool, ) -> Vec { txs.iter() .zip(lock_results) @@ -87,7 +86,6 @@ pub(crate) fn load_accounts( in_reward_interval, program_accounts, loaded_programs, - should_collect_rent, ) { Ok(loaded_transaction) => loaded_transaction, Err(e) => return (Err(e), None), @@ -128,7 +126,6 @@ fn load_transaction_accounts( reward_interval: RewardInterval, program_accounts: &HashMap, loaded_programs: &LoadedProgramsForTxBatch, - should_collect_rent: bool, ) -> Result { let in_reward_interval = reward_interval == RewardInterval::InsideInterval; @@ -190,7 +187,9 @@ fn load_transaction_accounts( .load_with_fixed_root(ancestors, key) .map(|(mut account, _)| { if message.is_writable(i) { - if should_collect_rent { + if !feature_set + .is_active(&feature_set::disable_rent_fees_collection::id()) + { let rent_due = rent_collector .collect_from_existing_account( key, @@ -514,7 +513,7 @@ mod tests { lamports_per_signature: u64, rent_collector: &RentCollector, error_counters: &mut TransactionErrorMetrics, - feature_set: &FeatureSet, + feature_set: &mut FeatureSet, fee_structure: &FeeStructure, ) -> Vec { let accounts_db = AccountsDb::new_single_for_tests(); @@ -524,6 +523,7 @@ mod tests { } let ancestors = vec![(0, 0)].into_iter().collect(); + feature_set.deactivate(&feature_set::disable_rent_fees_collection::id()); let sanitized_tx = SanitizedTransaction::from_transaction_for_tests(tx); load_accounts( &accounts.accounts_db, @@ -538,7 +538,6 @@ mod tests { RewardInterval::OutsideInterval, &HashMap::new(), &LoadedProgramsForTxBatch::default(), - true, ) } @@ -565,7 +564,7 @@ mod tests { lamports_per_signature, &RentCollector::default(), error_counters, - &all_features_except(exclude_features), + &mut all_features_except(exclude_features), &FeeStructure { lamports_per_signature, ..FeeStructure::default() @@ -768,7 +767,7 @@ mod tests { lamports_per_signature, &rent_collector, &mut error_counters, - &all_features_except(None), + &mut all_features_except(None), &FeeStructure::default(), ); assert_eq!(loaded_accounts.len(), 1); @@ -784,7 +783,7 @@ mod tests { lamports_per_signature, &rent_collector, &mut error_counters, - &FeatureSet::all_enabled(), + &mut FeatureSet::all_enabled(), &FeeStructure::default(), ); assert_eq!(loaded_accounts.len(), 1); @@ -801,7 +800,7 @@ mod tests { lamports_per_signature, &rent_collector, &mut error_counters, - &FeatureSet::all_enabled(), + &mut FeatureSet::all_enabled(), &FeeStructure::default(), ); assert_eq!(loaded_accounts.len(), 1); @@ -1013,7 +1012,6 @@ mod tests { RewardInterval::OutsideInterval, &HashMap::new(), &LoadedProgramsForTxBatch::default(), - true, ) } diff --git a/sdk/src/fee.rs b/sdk/src/fee.rs index de77ac11436595..f3377b5254f0a6 100644 --- a/sdk/src/fee.rs +++ b/sdk/src/fee.rs @@ -31,19 +31,6 @@ pub struct FeeStructure { pub compute_fee_bins: Vec, } -/// Return type of calculate_fee(...) -#[derive(Debug, Default, Clone, Eq, PartialEq)] -pub struct FeeDetails { - transaction_fee: u64, - prioritization_fee: u64, -} - -impl FeeDetails { - pub fn total_fee(&self) -> u64 { - self.transaction_fee.saturating_add(self.prioritization_fee) - } -} - pub const ACCOUNT_DATA_COST_PAGE_SIZE: u64 = 32_u64.saturating_mul(1024); impl FeeStructure { @@ -88,30 +75,22 @@ impl FeeStructure { .saturating_mul(heap_cost) } + /// Calculate fee for `SanitizedMessage` #[cfg(not(target_os = "solana"))] pub fn calculate_fee( &self, message: &SanitizedMessage, - _unused: u64, + lamports_per_signature: u64, budget_limits: &FeeBudgetLimits, include_loaded_account_data_size_in_fee: bool, ) -> u64 { - self.calculate_fee_details( - message, - budget_limits, - include_loaded_account_data_size_in_fee, - ) - .total_fee() - } + // Fee based on compute units and signatures + let congestion_multiplier = if lamports_per_signature == 0 { + 0.0 // test only + } else { + 1.0 // multiplier that has no effect + }; - /// Calculate fee details for `SanitizedMessage` - #[cfg(not(target_os = "solana"))] - pub fn calculate_fee_details( - &self, - message: &SanitizedMessage, - budget_limits: &FeeBudgetLimits, - include_loaded_account_data_size_in_fee: bool, - ) -> FeeDetails { let signature_fee = message .num_signatures() .saturating_mul(self.lamports_per_signature); @@ -143,13 +122,13 @@ impl FeeStructure { .unwrap_or_default() }); - FeeDetails { - transaction_fee: (signature_fee - .saturating_add(write_lock_fee) - .saturating_add(compute_fee) as f64) - .round() as u64, - prioritization_fee: budget_limits.prioritization_fee, - } + ((budget_limits + .prioritization_fee + .saturating_add(signature_fee) + .saturating_add(write_lock_fee) + .saturating_add(compute_fee) as f64) + * congestion_multiplier) + .round() as u64 } }