From 325b4cde9665a78d942ef5b79906ae2bd8380b2d Mon Sep 17 00:00:00 2001 From: madelinemurray Date: Wed, 22 Nov 2023 11:57:52 +1000 Subject: [PATCH 1/2] Added CLI option and API methods for min priority fee Signed-off-by: madelinemurray --- docs/public-networks/reference/api/index.md | 93 ++++++++++++++++++- docs/public-networks/reference/cli/options.md | 35 +++++++ 2 files changed, 127 insertions(+), 1 deletion(-) diff --git a/docs/public-networks/reference/api/index.md b/docs/public-networks/reference/api/index.md index 1a6500e75c6..f7b89bedf43 100644 --- a/docs/public-networks/reference/api/index.md +++ b/docs/public-networks/reference/api/index.md @@ -5408,7 +5408,11 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"eth_uninstallFilter","params":[" ## `MINER` methods -The `MINER` API methods allow you to control the node’s mining operation. +The `MINER` API methods allow you to control: + +* The node’s mining operation. +* Settings related to block creation. + :::note @@ -5459,6 +5463,49 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_changeTargetGasLimit","par +### `miner_getMinPriorityFee` + +Gets the minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The initial value is set using the [`--min-priority-fee`](../cli/options.md#min-priority-fee) command line option, or defaults to 0, if the command line option is not specified. +Use [`miner_setMinPriorityFee`](#minersetminpriorityfee) to change the current value of the fee. + +#### Parameters + +None + +#### Returns + +`result`: _string_ - Minimum priority fee per gas (in Wei) in hexadecimal + + + +# curl HTTP request + +```bash +curl -X POST --data '{"jsonrpc":"2.0","method":"miner_getMinPriorityFee","params":[],"id":1}' http://127.0.0.1:8545 +``` + +# wscat WS request + +```json +{ + "jsonrpc": "2.0", + "method": "miner_getMinPriorityFee", + "params": [], + "id": 1 +} +``` + +# JSON result + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": 0x1 +} +``` + + ### `miner_setCoinbase` Sets the coinbase, the address for the mining rewards. @@ -5508,6 +5555,50 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setCoinbase","params":["0x +### `miner_setMinPriorityFee` + +Sets the minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The initial value is set using the [`--min-priority-fee`](../cli/options.md#min-priority-fee) command line option, or defaults to 0, if the command line option is not specified. +Use [`miner_getMinPriorityFee`](#minergetminpriorityfee) to get the current value of the fee. + +#### Parameters + +`minPriorityFeePerGas`: _integer_ - Minimum priority fee per gas + +#### Returns + +`result`: _boolean_ - `true` when fee is set + + + +# curl HTTP request + +```bash +curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setMinPriorityFee","params":[1],"id":1}' http://127.0.0.1:8545 +``` + +# wscat WS request + +```json +{ + "jsonrpc": "2.0", + "method": "miner_setMinPriorityFee", + "params": [1], + "id": 1 +} +``` + +# JSON result + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": true +} +``` + + + ### `miner_start` Starts the mining process. To start mining, you must first specify a miner coinbase using the [`--miner-coinbase`](../cli/options.md#miner-coinbase) command line option or using [`miner_setCoinbase`](#miner_setcoinbase). diff --git a/docs/public-networks/reference/cli/options.md b/docs/public-networks/reference/cli/options.md index efff24dc2fe..1eb3dc3cccc 100644 --- a/docs/public-networks/reference/cli/options.md +++ b/docs/public-networks/reference/cli/options.md @@ -1873,6 +1873,41 @@ In a [free gas network](../../../private-networks/how-to/configure/free-gas.md), ::: +### `min-priority-fee` + + + +# Syntax + +```bash +--min-priority-fee= +``` + +# Example + +```bash +--min-gas-price=7 +``` + +# Environment variable + +```bash +BESU_MIN_PRIORITY_FEE=7 +``` + +# Configuration file + +```bash +min-priority-fee=7 +``` + + + +The minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The default is 0 Wei. +For a running node, use: +* [`miner_getMinPriorityFee`](../api/index.md#minergetminpriorityfee) to get the value +* [`miner_setMinPriorityFee`](../api/index.md#minersetminpriorityfee) to change the value. + ### `nat-method` From 1c528f5a3472b5b9a0be20a49961945d02e00ed0 Mon Sep 17 00:00:00 2001 From: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> Date: Wed, 22 Nov 2023 11:30:15 -0800 Subject: [PATCH 2/2] Apply suggestions from code review Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> --- docs/public-networks/reference/api/index.md | 6 +++--- docs/public-networks/reference/cli/options.md | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/public-networks/reference/api/index.md b/docs/public-networks/reference/api/index.md index f7b89bedf43..a2432a2d49e 100644 --- a/docs/public-networks/reference/api/index.md +++ b/docs/public-networks/reference/api/index.md @@ -5465,7 +5465,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_changeTargetGasLimit","par ### `miner_getMinPriorityFee` -Gets the minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The initial value is set using the [`--min-priority-fee`](../cli/options.md#min-priority-fee) command line option, or defaults to 0, if the command line option is not specified. +Gets the minimum priority fee per gas (in Wei) offered by a transaction to be included in a block. The initial value is set using the [`--min-priority-fee`](../cli/options.md#min-priority-fee) command line option, or is set to `0` if the command line option is not specified. Use [`miner_setMinPriorityFee`](#minersetminpriorityfee) to change the current value of the fee. #### Parameters @@ -5474,7 +5474,7 @@ None #### Returns -`result`: _string_ - Minimum priority fee per gas (in Wei) in hexadecimal +`result`: _string_ - Minimum priority fee per gas (in Wei) as a hexadecimal string @@ -5557,7 +5557,7 @@ curl -X POST --data '{"jsonrpc":"2.0","method":"miner_setCoinbase","params":["0x ### `miner_setMinPriorityFee` -Sets the minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The initial value is set using the [`--min-priority-fee`](../cli/options.md#min-priority-fee) command line option, or defaults to 0, if the command line option is not specified. +Sets the minimum priority fee per gas (in Wei) offered by a transaction to be included in a block. The initial value is set using the [`--min-priority-fee`](../cli/options.md#min-priority-fee) command line option, or is set to `0` if the command line option is not specified. Use [`miner_getMinPriorityFee`](#minergetminpriorityfee) to get the current value of the fee. #### Parameters diff --git a/docs/public-networks/reference/cli/options.md b/docs/public-networks/reference/cli/options.md index 1eb3dc3cccc..ea7b80e70b8 100644 --- a/docs/public-networks/reference/cli/options.md +++ b/docs/public-networks/reference/cli/options.md @@ -1903,9 +1903,9 @@ min-priority-fee=7 -The minimum priority fee per gas (in Wei) offered by a transaction offers to be included in a block. The default is 0 Wei. +The minimum priority fee per gas (in Wei) offered by a transaction to be included in a block. The default is `0`. For a running node, use: -* [`miner_getMinPriorityFee`](../api/index.md#minergetminpriorityfee) to get the value +* [`miner_getMinPriorityFee`](../api/index.md#minergetminpriorityfee) to get the value. * [`miner_setMinPriorityFee`](../api/index.md#minersetminpriorityfee) to change the value. ### `nat-method`