Split signature throughput tracking out of FeeCalculator (#8447)

* SDK: Split new `FeeRateGovernor` out of `FeeCalculator`

Leaving `FeeCalculator` to *only* calculate transaction fees

* Replace `FeeCalculator` with `FeeRateGovernor` as appropriate

* Expose recent `FeeRateGovernor` to clients

* Move `burn()` back into `FeeCalculator`

Appease BPF tests

* Revert "Move `burn()` back into `FeeCalculator`"

This reverts commit f3035624307196722b62ff8b74c12cfcc13b1941.

* Adjust BPF `Fee` sysvar test to reflect removal of `burn()` from `FeeCalculator`

* Make `FeeRateGovernor`'s `lamports_per_signature` private

* rebase artifacts

* fmt

* Drop 'Recent'

* Drop _with_commitment variant

* Use a more portable integer for `target_signatures_per_slot`

* Add docs for `getReeRateCalculator` JSON RPC method

* Don't return `lamports_per_signature` in `getFeeRateGovernor` JSONRPC reply
This commit is contained in:
Trent Nelson
2020-02-28 13:27:01 -07:00
committed by GitHub
parent 7d27be2a73
commit 90bedd7e06
22 changed files with 298 additions and 118 deletions

View File

@@ -1,6 +1,6 @@
use solana_sdk::{
account::Account,
fee_calculator::FeeCalculator,
fee_calculator::FeeRateGovernor,
genesis_config::GenesisConfig,
pubkey::Pubkey,
rent::Rent,
@@ -140,11 +140,11 @@ pub fn create_genesis_config_with_leader_ex(
solana_stake_program!(),
];
let fee_calculator = FeeCalculator::new(0, 0); // most tests can't handle transaction fees
let fee_rate_governor = FeeRateGovernor::new(0, 0); // most tests can't handle transaction fees
let mut genesis_config = GenesisConfig {
accounts,
native_instruction_processors,
fee_calculator,
fee_rate_governor,
rent,
..GenesisConfig::default()
};