Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EIP: Add time-weighted averaging to the base fee #7378

Merged
merged 27 commits into from
Sep 19, 2023

Conversation

guy-goren
Copy link
Contributor

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md

We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

@guy-goren guy-goren requested a review from eth-bot as a code owner July 22, 2023 14:20
@github-actions github-actions bot added c-new Creates a brand new proposal s-draft This EIP is a Draft t-core labels Jul 22, 2023
@eth-bot
Copy link
Collaborator

eth-bot commented Jul 22, 2023

✅ All reviewers have approved.

@eth-bot eth-bot changed the title Create eip-xxx_draft_BaseFee_WeightedAveraging.md Add EIP: Add time-weighted averaging to the base fee mechanism Jul 22, 2023
@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels Jul 22, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Jul 22, 2023
guy-goren and others added 2 commits July 22, 2023 17:31
Add number

Co-authored-by: lightclient <[email protected]>
@github-actions github-actions bot added w-ci Waiting on CI to pass and removed w-ci Waiting on CI to pass labels Jul 22, 2023
Copy link
Member

@Pandapip1 Pandapip1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the CI errors.

@github-actions
Copy link

The commit bcf0d2f (as a parent of 303b18e) contains errors.
Please inspect the Run Summary for details.

@eth-bot eth-bot changed the title Add EIP: Add time-weighted averaging to the base fee mechanism Add EIP: Add time-weighted averaging to the base fee Jul 22, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Jul 22, 2023
EIPS/eip-7378.md Outdated Show resolved Hide resolved
EIPS/eip-7378.md Outdated Show resolved Hide resolved
EIPS/eip-7378.md Outdated
## Abstract

The current formula for setting the base fee follows the original [EIP-1559](./eip-1559.md):
$$b[i+1]\triangleq b[i] \cdot \left( 1+\frac{1}{8} \cdot \frac{s[i]-s^* }{s^* }\right)$$ where $i$ enumerates the blocks, $s^*$ is a predetremined block size (the "desired" size, aka gas amount), $b[i]$ is the base fee at block $i$, and $s[i]$ is the size of the block at height $i$. This formula considers only the last block size $s[i]$. This mechanism might lead to incentives for users to bribe miners in order to reduce the base fee, or (in analogous manner) for miners to intiate a collusion with sophisticated users for the benefit of both. (See Motivation section.)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The base fee itself is an accumulator of the past since current base fee is calculated on parents, and with induction on all its parent. So saying it considers only the last block size might not be true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the sentence "This formula considers only the last block size $s[i]$" is accurate, I understand what you mean. How would you phrase it to be clearer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using base fee update clarifies this i think, so even though base fee already is an accumulator, base fee update which is the center of this proposal is just based off last block size.

EIPS/eip-7378.md Outdated Show resolved Hide resolved
EIPS/eip-7378.md Show resolved Hide resolved
@guy-goren guy-goren requested a review from Pandapip1 July 27, 2023 14:40
Clarifying Miners==Proposers
@guy-goren guy-goren requested a review from g11tech July 30, 2023 20:03
EIPS/eip-7378.md Outdated Show resolved Hide resolved
EIPS/eip-7378.md Outdated Show resolved Hide resolved
---

## Abstract

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the abstract can be shorter something along the lines of (rest should be moved in specification)

To prevent proposers/miners and/or users from colluding and gaming the base fee in the scenario of consecutive proposals this EIP proposes a new formula to update the base fee by considering geometric weighted past block sizes instead of just the last block size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The motivation builds on the reader familiarity with the formula. I therefore, find it useful to have it right at the beginning. If you feel strongly on the matter, I can rearrange the presentation.

EIPS/eip-7378.md Outdated Show resolved Hide resolved

Mainly, to reduce bribe motivation (in particular in case the demand for blockspace is high -- see Incentive Considerations section). Additionaly, to reduce oscillations and have a more stable fee setting mechanism.

Proposers use a mechanism described in EIP-1559 to determine which messages to include in a block. This mechanism includes a "base fee": a portion of the transaction fee that is burned. The base fee varies according to the fill rate of blocks. A target block size is defined. If a block exceeds the target size, the base fee increases, and if it is smaller, the base fee lowers.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can this be shortned assuming the audience is a bit aware of 1559

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could certainly be omitted assuming the reader is familiar with the base fee mechanism. However, I believe that dedicating a few lines (approximately three) is reasonable to accommodate readers who may be less familiar with the topic.

EIPS/eip-7378.md Outdated Show resolved Hide resolved
EIPS/eip-7378.md Outdated Show resolved Hide resolved
EIPS/eip-7378.md Outdated Show resolved Hide resolved
guy-goren and others added 8 commits August 4, 2023 13:56
Added paragraph about MEV
remark about alpha=1
remark re. 'max change denominator'
delete redundant part from incentive considerations
@eth-bot eth-bot enabled auto-merge (squash) September 13, 2023 09:21
Copy link
Collaborator

@eth-bot eth-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot eth-bot merged commit d1a68b3 into ethereum:master Sep 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-core
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants