This repository was archived by the owner on Jan 22, 2025. It is now read-only.
File tree 3 files changed +11
-13
lines changed
3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -6660,17 +6660,6 @@ impl Bank {
6660
6660
& self . runtime_config . compute_budget . unwrap_or_default ( ) ,
6661
6661
false , /* debugging_features */
6662
6662
) ) ;
6663
-
6664
- // genesis_config loaded by accounts_db::open_genesis_config() from ledger
6665
- // has it's lamports_per_signature set to zero; bank sets its value correctly
6666
- // after the first block with a transaction in it. This is a hack to mimic
6667
- // the process.
6668
- let derived_fee_rate_governor =
6669
- FeeRateGovernor :: new_derived ( & genesis_config. fee_rate_governor , 0 ) ;
6670
- // new bank's fee_structure.lamports_per_signature should be inline with
6671
- // what's configured in GenesisConfig
6672
- self . fee_structure . lamports_per_signature =
6673
- derived_fee_rate_governor. lamports_per_signature ;
6674
6663
}
6675
6664
6676
6665
pub fn set_inflation ( & self , inflation : Inflation ) {
Original file line number Diff line number Diff line change @@ -3335,6 +3335,7 @@ fn test_bank_parent_account_spend() {
3335
3335
let key2 = Keypair :: new ( ) ;
3336
3336
let ( parent, bank_forks) = Bank :: new_with_bank_forks_for_tests ( & genesis_config) ;
3337
3337
let amount = genesis_config. rent . minimum_balance ( 0 ) ;
3338
+ println ! ( "==== amount {}" , amount) ;
3338
3339
3339
3340
let tx =
3340
3341
system_transaction:: transfer ( & mint_keypair, & key1. pubkey ( ) , amount, genesis_config. hash ( ) ) ;
Original file line number Diff line number Diff line change @@ -80,10 +80,17 @@ impl FeeStructure {
80
80
pub fn calculate_fee (
81
81
& self ,
82
82
message : & SanitizedMessage ,
83
- _lamports_per_signature : u64 ,
83
+ lamports_per_signature : u64 ,
84
84
budget_limits : & FeeBudgetLimits ,
85
85
include_loaded_account_data_size_in_fee : bool ,
86
86
) -> u64 {
87
+ // Fee based on compute units and signatures
88
+ let congestion_multiplier = if lamports_per_signature == 0 {
89
+ 0.0 // test only
90
+ } else {
91
+ 1.0 // multiplier that has no effect
92
+ } ;
93
+
87
94
let signature_fee = message
88
95
. num_signatures ( )
89
96
. saturating_mul ( self . lamports_per_signature ) ;
@@ -115,11 +122,12 @@ impl FeeStructure {
115
122
. unwrap_or_default ( )
116
123
} ) ;
117
124
118
- ( budget_limits
125
+ ( ( budget_limits
119
126
. prioritization_fee
120
127
. saturating_add ( signature_fee)
121
128
. saturating_add ( write_lock_fee)
122
129
. saturating_add ( compute_fee) as f64 )
130
+ * congestion_multiplier)
123
131
. round ( ) as u64
124
132
}
125
133
}
You can’t perform that action at this time.
0 commit comments