From f00fd98f5f54f5ef937aa53cd8b77a3798cfeedc Mon Sep 17 00:00:00 2001 From: Trent Nelson Date: Fri, 28 Feb 2020 13:27:01 -0700 Subject: [PATCH] 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 --- src/apps/jsonrpc-api.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/apps/jsonrpc-api.md b/src/apps/jsonrpc-api.md index dffb9b3138ded8..7a3d035d064c94 100644 --- a/src/apps/jsonrpc-api.md +++ b/src/apps/jsonrpc-api.md @@ -24,6 +24,7 @@ To interact with a Solana node inside a JavaScript application, use the [solana- * [getConfirmedBlocks](jsonrpc-api.md#getconfirmedblocks) * [getEpochInfo](jsonrpc-api.md#getepochinfo) * [getEpochSchedule](jsonrpc-api.md#getepochschedule) +* [getFeeRateGovernor](jsonrpc-api.md#getfeerategovernor) * [getGenesisHash](jsonrpc-api.md#getgenesishash) * [getInflation](jsonrpc-api.md#getinflation) * [getLeaderSchedule](jsonrpc-api.md#getleaderschedule) @@ -403,6 +404,34 @@ curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "m {"jsonrpc":"2.0","result":{"firstNormalEpoch":8,"firstNormalSlot":8160,"leaderScheduleSlotOffset":8192,"slotsPerEpoch":8192,"warmup":true},"id":1} ``` +### getFeeRateGovernor + +Returns the fee rate governor information from the root bank + +#### Parameters: + +None + +#### Results: + +The `result` field will be an `object` with the following fields: + +* `burnPercent: `, Percentage of fees collected to be destroyed +* `maxLamportsPerSignature: `, Largest value `lamportsPerSignature` can attain for the next slot +* `minLamportsPerSignature: `, Smallest value `lamportsPerSignature` can attain for the next slot +* `targetLamportsPerSignature: `, Desired fee rate for the cluster +* `targetSignaturesPerSlot: `, Desired signature rate for the cluster + +#### Example: + +```bash +// Request +curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1, "method":"getFeeRateGovernor"}' http://localhost:8899 + +// Result +{"jsonrpc":"2.0","result":{"context":{"slot":54},"value":{"feeRateGovernor":{"burnPercent":50,"maxLamportsPerSignature":100000,"minLamportsPerSignature":5000,"targetLamportsPerSignature":10000,"targetSignaturesPerSlot":20000}}},"id":1} +``` + ### getGenesisHash Returns the genesis hash