From b0f56c379257ee01f820884129951d310e003992 Mon Sep 17 00:00:00 2001 From: MadelineMurray <43356962+MadelineMurray@users.noreply.github.com> Date: Sat, 2 Dec 2023 04:01:10 +1000 Subject: [PATCH] Added zeroBaseFee genesis item and impact on tx-pool-price-bump (#1464) * Added zeroBaseFee genesis item and impact on tx-pool-price-bump Signed-off-by: madelinemurray * Apply suggestions from code review Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> --------- Signed-off-by: madelinemurray Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> Co-authored-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> --- .../how-to/configure/free-gas.md | 2 + .../how-to/send-transactions/index.md | 1 + .../concepts/transactions/pool.md | 12 +++++ docs/public-networks/reference/cli/options.md | 3 +- .../reference/genesis-items.md | 45 +++++++++---------- 5 files changed, 38 insertions(+), 25 deletions(-) diff --git a/docs/private-networks/how-to/configure/free-gas.md b/docs/private-networks/how-to/configure/free-gas.md index 9eccfd2666d..ef9d412a757 100644 --- a/docs/private-networks/how-to/configure/free-gas.md +++ b/docs/private-networks/how-to/configure/free-gas.md @@ -107,6 +107,8 @@ If your network is configured to use the `londonBlock` or a later hard fork, the } ``` +If zero base fee is enabled, you cannot specify a value for [`--tx-pool-price-bump`](../../../public-networks/reference/cli/options.md#tx-pool-price-bump). + ## Configure free gas in Hardhat If using Hardhat to develop on your free gas network, you also need to configure free gas in Hardhat. diff --git a/docs/private-networks/how-to/send-transactions/index.md b/docs/private-networks/how-to/send-transactions/index.md index 3f9920a3d31..c5700401e42 100644 --- a/docs/private-networks/how-to/send-transactions/index.md +++ b/docs/private-networks/how-to/send-transactions/index.md @@ -14,3 +14,4 @@ You can also: - [Send private transactions](private-transactions.md). - [Send concurrent private transactions](concurrent-private-transactions.md). - [Include revert reason in transactions](revert-reason.md). +- [Replace transactions in the transaction pool](../../../public-networks/concepts/transactions/pool.md#in-networks-with-zero-base-base-or-free-gas). diff --git a/docs/public-networks/concepts/transactions/pool.md b/docs/public-networks/concepts/transactions/pool.md index 0ecc1d19137..4f176469d9e 100644 --- a/docs/public-networks/concepts/transactions/pool.md +++ b/docs/public-networks/concepts/transactions/pool.md @@ -69,6 +69,8 @@ When the transaction pool is full, it accepts and retains local transactions in ## Replacing transactions with the same sender and nonce +### In networks with a base fee and priced gas + You can replace a pending transaction with a transaction that has the same sender and nonce but a higher gas price. If sending a [legacy transaction](types.md#frontier-transactions), the old transaction is replaced if the new transaction has a gas price higher than the existing gas price by the percentage specified by [`--tx-pool-price-bump`](../../reference/cli/options.md#tx-pool-price-bump). @@ -80,3 +82,13 @@ If sending an [`EIP1559` transaction](types.md#eip1559-transactions), the old tr - The new transaction's effective gas price is the equal to the existing gas price AND the new effective priority fee is higher than the existing priority fee by the percentage specified by [`--tx-pool-price-bump`](../../reference/cli/options.md#tx-pool-price-bump). The default value for [`--tx-pool-price-bump`](../../reference/cli/options.md#tx-pool-price-bump) is 10%. + +### In networks with zero base base or free gas + +To enable replacing transactions in the transaction pool for zero base fee networks, +or free gas networks: + +* If you set [`zeroBaseFee`](../../reference/genesis-items.md) to `true` in the genesis file, + the transaction pool price bump is set to `0`. Specifying a value for transaction pool price bump using [`--tx-pool-price-bump`](../../reference/cli/options.md#tx-pool-price-bump) + will cause an error. +* If the [minimum gas price is zero](../../../private-networks/how-to/configure/free-gas.md), the transaction pool price bump is set to `0`, unless you specify a different value using [`--tx-pool-price-bump`](../../reference/cli/options.md#tx-pool-price-bump). \ No newline at end of file diff --git a/docs/public-networks/reference/cli/options.md b/docs/public-networks/reference/cli/options.md index ea7b80e70b8..e64c506db92 100644 --- a/docs/public-networks/reference/cli/options.md +++ b/docs/public-networks/reference/cli/options.md @@ -4150,7 +4150,8 @@ tx-pool-price-bump=25 The price bump percentage to [replace an existing transaction in the transaction pool](../../concepts/transactions/pool.md#replacing-transactions-with-the-same-sender-and-nonce). -The default is `10`, or 10%. +For networks with a [base fee and priced gas](../../concepts/transactions/pool.md#in-networks-with-a-base-fee-and-priced-gas), the default is `10`, or 10%. +For networks with [zero base fee, or free gas](../../concepts/transactions/pool.md#in-networks-with-zero-base-base-or-free-gas), the default is `0`. ### `tx-pool-priority-senders` diff --git a/docs/public-networks/reference/genesis-items.md b/docs/public-networks/reference/genesis-items.md index dbf4089990c..a837fc24a4a 100644 --- a/docs/public-networks/reference/genesis-items.md +++ b/docs/public-networks/reference/genesis-items.md @@ -15,19 +15,20 @@ The [Besu genesis file](../concepts/genesis-file.md) contains [network configura Network configuration items are specified in the genesis file in the `config` object. -| Item | Description | -| --- | --: | -| Milestone blocks | [Milestone blocks for the network](#milestone-blocks). | -| `chainID` | [Chain ID for the network](../concepts/network-and-chain-id.md). | -| `ethash` | Specifies network uses [Ethash](../../private-networks/how-to/configure/consensus/index.md) and contains [`fixeddifficulty`](#fixed-difficulty). | -| `clique` | Specifies network uses [Clique](../../private-networks/how-to/configure/consensus/clique.md) and contains [Clique configuration items](../../private-networks/how-to/configure/consensus/clique.md#genesis-file). | -| `ibft2` | Specifies network uses [IBFT 2.0](../../private-networks/how-to/configure/consensus/ibft.md) and contains [IBFT 2.0 configuration items](../../private-networks/how-to/configure/consensus/ibft.md#genesis-file). | -| `qbft` | Specifies network uses [QBFT](../../private-networks/how-to/configure/consensus/qbft.md) and contains [QBFT configuration items](../../private-networks/how-to/configure/consensus/qbft.md#genesis-file). | -| `transitions` | Specifies block at which to [change IBFT 2.0 or QBFT validators](../../private-networks/how-to/configure/consensus/add-validators-without-voting.md). | -| `contractSizeLimit` | Maximum contract size in bytes. Specify in [free gas networks](../../private-networks/how-to/configure/free-gas.md). The default is `24576` and the maximum size is `2147483647`. | -| `evmStackSize` | Maximum stack size. Specify to increase the maximum stack size in private networks with complex smart contracts. The default is `1024`. | -| `ecCurve` | Specifies [the elliptic curve to use](../../private-networks/how-to/configure/curves.md). Default is `secp256k1`. | -| `discovery` | Specifies [discovery configuration items](#discovery-configuration-items). The `discovery` object can be left empty. | +| Item | Description | +|---------------------|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Milestone blocks | [Milestone blocks for the network](#milestone-blocks). | +| `chainID` | [Chain ID for the network](../concepts/network-and-chain-id.md). | +| `ethash` | Specifies network uses [Ethash](../../private-networks/how-to/configure/consensus/index.md) and contains [`fixeddifficulty`](#fixed-difficulty). | +| `clique` | Specifies network uses [Clique](../../private-networks/how-to/configure/consensus/clique.md) and contains [Clique configuration items](../../private-networks/how-to/configure/consensus/clique.md#genesis-file). | +| `ibft2` | Specifies network uses [IBFT 2.0](../../private-networks/how-to/configure/consensus/ibft.md) and contains [IBFT 2.0 configuration items](../../private-networks/how-to/configure/consensus/ibft.md#genesis-file). | +| `qbft` | Specifies network uses [QBFT](../../private-networks/how-to/configure/consensus/qbft.md) and contains [QBFT configuration items](../../private-networks/how-to/configure/consensus/qbft.md#genesis-file). | +| `transitions` | Specifies block at which to [change IBFT 2.0 or QBFT validators](../../private-networks/how-to/configure/consensus/add-validators-without-voting.md). | +| `contractSizeLimit` | Maximum contract size in bytes. Specify in [free gas networks](../../private-networks/how-to/configure/free-gas.md). The default is `24576` and the maximum size is `2147483647`. | +| `evmStackSize` | Maximum stack size. Specify to increase the maximum stack size in private networks with complex smart contracts. The default is `1024`. | +| `ecCurve` | Specifies [the elliptic curve to use](../../private-networks/how-to/configure/curves.md). Default is `secp256k1`. | +| `discovery` | Specifies [discovery configuration items](#discovery-configuration-items). The `discovery` object can be left empty. | +| `zeroBaseFee` | Specifies a base fee of `0` for [free gas networks](../../private-networks/how-to/configure/free-gas.md#4-enable-zero-base-fee-if-using-london-fork-or-later). | ## Genesis block parameters @@ -39,12 +40,12 @@ The purpose of some genesis block parameters varies depending on the consensus p The following table describes the genesis block parameters with the same purpose across all consensus protocols. -| Item | Description | -| --- | --: | -| `coinbase` | Address to pay mining rewards to. Can be any value in the genesis block (commonly set to `0x0000000000000000000000000000000000000000`). | -| `gasLimit` | Block gas limit. Total gas limit for all transactions in a block. | -| `nonce` | Used in block computation. Can be any value in the genesis block (commonly set to `0x0`). | -| `timestamp` | Creation date and time of the block. Must be before the next block so we recommend specifying `0x0` in the genesis file. | +| Item | Description | +| --- |:-----------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `coinbase` | Address to pay mining rewards to. Can be any value in the genesis block (commonly set to `0x0000000000000000000000000000000000000000`). | +| `gasLimit` | Block gas limit. Total gas limit for all transactions in a block. | +| `nonce` | Used in block computation. Can be any value in the genesis block (commonly set to `0x0`). | +| `timestamp` | Creation date and time of the block. Must be before the next block so we recommend specifying `0x0` in the genesis file. | | `alloc` | Defines [accounts with balances](../../private-networks/reference/accounts-for-testing.md) or [contracts](../../private-networks/how-to/configure/contracts.md). | :::caution @@ -144,8 +145,4 @@ Use the `discovery` configuration items to specify the [`bootnodes`](cli/options } } } -``` - - - -[GoQuorum clients]: https://consensys.net/docs/goquorum/en/stable/ +``` \ No newline at end of file