Skip to content

Commit

Permalink
Added zeroBaseFee genesis item and impact on tx-pool-price-bump (#1464)
Browse files Browse the repository at this point in the history
* Added zeroBaseFee genesis item and impact on tx-pool-price-bump

Signed-off-by: madelinemurray <madeline.murray@consensys.net>

* Apply suggestions from code review

Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com>

---------

Signed-off-by: madelinemurray <madeline.murray@consensys.net>
Signed-off-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com>
Co-authored-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com>
  • Loading branch information
MadelineMurray and alexandratran authored Dec 1, 2023
1 parent aa9b5d7 commit b0f56c3
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
2 changes: 2 additions & 0 deletions docs/private-networks/how-to/configure/free-gas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions docs/private-networks/how-to/send-transactions/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
12 changes: 12 additions & 0 deletions docs/public-networks/concepts/transactions/pool.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand All @@ -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).
3 changes: 2 additions & 1 deletion docs/public-networks/reference/cli/options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
45 changes: 21 additions & 24 deletions docs/public-networks/reference/genesis-items.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -144,8 +145,4 @@ Use the `discovery` configuration items to specify the [`bootnodes`](cli/options
}
}
}
```

<!--links-->

[GoQuorum clients]: https://consensys.net/docs/goquorum/en/stable/
```

0 comments on commit b0f56c3

Please sign in to comment.