Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion EIPS/eip-3416.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble is missing header(s): `description`

warning[preamble-req]: preamble is missing header(s): `description` --> EIPS/eip-3416.md | | = help: see https://ethereum.github.io/eipw/preamble-req/

Check warning on line 1 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble is missing header(s): `description`

warning[preamble-req]: preamble is missing header(s): `description` --> EIPS/eip-3416.md | | = help: see https://ethereum.github.io/eipw/preamble-req/

Check warning on line 1 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

preamble is missing header(s): `description`

warning[preamble-req]: preamble is missing header(s): `description` --> EIPS/eip-3416.md | | = help: see https://ethereum.github.io/eipw/preamble-req/
eip: 3416
title: Median Gas Premium
author: HexZorro (@hexzorro), Mojtaba Tefagh (@mtefagh)
Expand All @@ -9,7 +9,7 @@
created: 2021-03-18
---

## Simple Summary

Check warning on line 12 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

warning[markdown-order-section]: body has extra section(s) --> EIPS/eip-3416.md | 12 | ## Simple Summary | = help: see https://ethereum.github.io/eipw/markdown-order-section/

Check warning on line 12 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

warning[markdown-order-section]: body has extra section(s) --> EIPS/eip-3416.md | 12 | ## Simple Summary | = help: see https://ethereum.github.io/eipw/markdown-order-section/

Check warning on line 12 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

body has extra section(s)

warning[markdown-order-section]: body has extra section(s) --> EIPS/eip-3416.md | 12 | ## Simple Summary | = help: see https://ethereum.github.io/eipw/markdown-order-section/

A transaction pricing mechanism with a fixed-per-block network fee and a median inclusion fee with additive updates.

Expand All @@ -25,7 +25,7 @@

We target the following goals:

* Gas prices spikes are mathematically smoothed out. EIP1559 does not seems to really tackle gas premium volatility and UX.

Check warning on line 28 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`)

warning[markdown-re-eip-dash]: proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`) --> EIPS/eip-3416.md | 28 | * Gas prices spikes are mathematically smoothed out. EIP1559 does not seems to really tackle gas premium volatility and UX. | = info: the pattern in question: `(?i)eip[\s]*[0-9]+` = help: see https://ethereum.github.io/eipw/markdown-re-eip-dash/

Check warning on line 28 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`)

warning[markdown-re-eip-dash]: proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`) --> EIPS/eip-3416.md | 28 | * Gas prices spikes are mathematically smoothed out. EIP1559 does not seems to really tackle gas premium volatility and UX. | = info: the pattern in question: `(?i)eip[\s]*[0-9]+` = help: see https://ethereum.github.io/eipw/markdown-re-eip-dash/

Check warning on line 28 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`)

warning[markdown-re-eip-dash]: proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`) --> EIPS/eip-3416.md | 28 | * Gas prices spikes are mathematically smoothed out. EIP1559 does not seems to really tackle gas premium volatility and UX. | = info: the pattern in question: `(?i)eip[\s]*[0-9]+` = help: see https://ethereum.github.io/eipw/markdown-re-eip-dash/
* Maintain gas price preference, i.e. transaction senders willing to pay extra in fees will be rewarded with early preferential inclusion in the blocks, because the miners want to maximize their profits and include transactions with higher fee caps first to maximize the median.
* Final gas price paid by the sender is, most of the time, smaller than the maximum gas price specified by sender.
* Gas pricing is more robust to sender manipulation or miner manipulation.
Expand Down Expand Up @@ -60,13 +60,13 @@
* At `block.number == FORK_BLOCK_NUMBER` we set `BASE_FEE = INITIAL_BASE_FEE`
* `BASE_FEE` is set, from `FORK_BLOCK_NUMBER + 1`, as follows
* Let `GAS_DELTA = (PARENT_GAS_USED - PARENT_GAS_TARGET) // PARENT_GAS_TARGET` (possibly negative).
* Set `BASE_FEE = PARENT_BASE_FEE + GSA_DELTA * BASE_FEE_MAX_CHANGE`
* Set `BASE_FEE = PARENT_BASE_FEE + GAS_DELTA * BASE_FEE_MAX_CHANGE`
* Transactions since `FORK_BLOCK_NUMBER` are encoded the same as the current ones `rlp([nonce, gasPrice, gasLimit, to, value, data, v, r, s])` where `v,r,s` is a signature of `rlp([nonce, gasPrice, gasLimit, to, value, data])` and `gasPrice` is the `FEE_CAP` specified by the sender according to this proposal.
* To produce transactions since `FORK_BLOCK_NUMBER`, the new `FEE_CAP` field (maintaining legacy name of `gasPrice` in the transaction) is set as follows (and the `GAS_PREMIUM` is computed as specified):
* `FEE_CAP`: `tx.gasPrice`, serves as the absolute maximum that the transaction sender is willing to pay.
* `GAS_PREMIUM = (FEE_CAP - BASE_FEE) / 2` serves as a sender-preferred median premium to the miner, beyond the base fee.
* If `FEE_CAP < BASE_FEE` then the transaction is considered invalid and cannot be included in the current block, but might be included in future blocks.
* During transaction execution, for EIP3416 transactions we calculate the cost to the `tx.origin` and the gain to the `block.coinbase` as follows:

Check warning on line 69 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`)

warning[markdown-re-eip-dash]: proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`) --> EIPS/eip-3416.md | 69 | * During transaction execution, for EIP3416 transactions we calculate the cost to the `tx.origin` and the gain to the `block.coinbas... | = info: the pattern in question: `(?i)eip[\s]*[0-9]+`

Check warning on line 69 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`)

warning[markdown-re-eip-dash]: proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`) --> EIPS/eip-3416.md | 69 | * During transaction execution, for EIP3416 transactions we calculate the cost to the `tx.origin` and the gain to the `block.coinbas... | = info: the pattern in question: `(?i)eip[\s]*[0-9]+`

Check warning on line 69 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`)

warning[markdown-re-eip-dash]: proposals must be referenced with the form `EIP-N` (not `EIPN` or `EIP N`) --> EIPS/eip-3416.md | 69 | * During transaction execution, for EIP3416 transactions we calculate the cost to the `tx.origin` and the gain to the `block.coinbas... | = info: the pattern in question: `(?i)eip[\s]*[0-9]+`
* Set `GASPRICE = BASE_FEE + median((tx_i.gasPrice - BASE_FEE) / 2)` among all transactions `tx_i` included in the same block, *weighted by gas consumed* and not including the top 5% of outlier gas price in calculation. By weighted median without 5% of the upper-side outliers, we mean that each gas unit spent is ordered according to the corresponding transaction by `BASE_FEE + tx.gasPrice / 2` and then the value chosen will be the one separating the lower 95% in two parts.
* Let `GASUSED` be the gas used during the transaction execution/state transition.
* The `tx.origin` initially pays `GASPRICE * tx.gasLimit`, and gets refunded `GASPRICE * (tx.gasLimit - GASUSED)`.
Expand All @@ -75,13 +75,13 @@

## Rationale

The rationale behind the premium being 50% of (fee cap - base fee) is that at any given point the average network sender has an average fee cap, and we assume that between base fee and fee cap the sender has no specific preference, as long as the transaction is included in some block. Then, the sender is happy with a median premium among this uniform range. Another justification can be that the user also knows that this new version of the pricing protocol for the complete block uses a median, then is fair for him to apply a median within his preferential range, assuming an uniform sampling there. Simulations ([here](https://hackmd.io/c6kyRNMuTnKf_SlolmevRg#An-improvement-for-the-premium)) with Ethereum gas data shows indeed that median one of the most robust metric.s

Check warning on line 78 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 78 | The rationale behind the premium being 50% of (fee cap - base fee) is that at any given point the average network sender has an aver... | = help: see https://ethereum.github.io/eipw/markdown-rel-links/

Check warning on line 78 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 78 | The rationale behind the premium being 50% of (fee cap - base fee) is that at any given point the average network sender has an aver... | = help: see https://ethereum.github.io/eipw/markdown-rel-links/

Check warning on line 78 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 78 | The rationale behind the premium being 50% of (fee cap - base fee) is that at any given point the average network sender has an aver... | = help: see https://ethereum.github.io/eipw/markdown-rel-links/

The 5% top outliers removal, not considered in the median, or similar number, is to give extra robustness against miner manipulation, because as current network utilization has been around 97% for the last 6 months the miners can include their own transactions on the empty 3% to try to manipulate and increase the median price (even this manipulation effect will be very small on the final price).

The rationale for the `BASE_FEE` update formula is that we are using an additive version (`PARENT_BASE_FEE + GAS_DELTA * BASE_FEE_MAX_CHANGE`) to avoid an attack of senders sending this fee to zero. This attack was simulated and observed for multiplicative formula proposed in previous version (`PARENT_BASE_FEE + PARENT_BASE_FEE * GAS_DELTA * BASE_FEE_MAX_CHANGE`). See an article about the attack and the simulation [here](https://mtefagh.github.io/fee/).

Check warning on line 82 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 82 | The rationale for the `BASE_FEE` update formula is that we are using an additive version (`PARENT_BASE_FEE + GAS_DELTA * BASE_FEE_MA... |

Check warning on line 82 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 82 | The rationale for the `BASE_FEE` update formula is that we are using an additive version (`PARENT_BASE_FEE + GAS_DELTA * BASE_FEE_MA... |

Check warning on line 82 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 82 | The rationale for the `BASE_FEE` update formula is that we are using an additive version (`PARENT_BASE_FEE + GAS_DELTA * BASE_FEE_MA... |

Another rationale for the additive `BASE_FEE` update formula is that it guarantees (see [this](https://pdfs.semanticscholar.org/3d2d/773983c5201b58586af463f045befae5bbf2.pdf) article) that the optimal execution strategy (scheduling broadcasts in order to pay less fee) for a batch of nonurgent transactions is to spread the transactions across different blocks which in turn helps to avoid network congestion and lowers volatility. For the multiplicative formula, it is exactly the reverse, that is, spikes (dumping all your transactions at once) are incentivized as described [here](https://ethresear.ch/t/path-dependence-of-eip-1559-and-the-simulation-of-the-resulting-permanent-loss/8964).

Check warning on line 84 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 84 | Another rationale for the additive `BASE_FEE` update formula is that it guarantees (see [this](https://pdfs.semanticscholar.org/3d2d... |

Check warning on line 84 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 84 | Another rationale for the additive `BASE_FEE` update formula is that it guarantees (see [this](https://pdfs.semanticscholar.org/3d2d... |

Check warning on line 84 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 84 | Another rationale for the additive `BASE_FEE` update formula is that it guarantees (see [this](https://pdfs.semanticscholar.org/3d2d... |

Check warning on line 84 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 84 | Another rationale for the additive `BASE_FEE` update formula is that it guarantees (see [this](https://pdfs.semanticscholar.org/3d2d... |

Check warning on line 84 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 84 | Another rationale for the additive `BASE_FEE` update formula is that it guarantees (see [this](https://pdfs.semanticscholar.org/3d2d... |

Check warning on line 84 in EIPS/eip-3416.md

View workflow job for this annotation

GitHub Actions / EIP Walidator

non-relative link or image

warning[markdown-rel-links]: non-relative link or image --> EIPS/eip-3416.md | 84 | Another rationale for the additive `BASE_FEE` update formula is that it guarantees (see [this](https://pdfs.semanticscholar.org/3d2d... |

The rationale for the `BASE_FEE_MAX_CHANGE` being `1 // 8` is that the `BASE_FEE` is designed to be very adaptative to block utilization changes.

Expand Down
Loading