EIP-7378 Time weighted averaging of the base fee (Add time-weighted averaging to the base fee)

No call decision · Fees & gas · EIP status Stagnant · created 2023-07-22

A proposal to change the base fee from looking only at the size of the single previous block to an exponentially weighted average of past blocks, reducing the incentive to collude to empty blocks in order to manipulate fees.

Why it is needed

The current base fee sets the next block's fee by looking only at the size of the single previous block (s[i]). This means that if a user (or users) bribe the proposer to empty a block, the next block's base fee immediately drops, and that user can then post their own transactions at the lowered fee, capturing a share of what should have been burned. Theoretical research has pointed out that this kind of collusion becomes especially profitable when demand for blockspace is high, and can destabilize or cause swings in the fee mechanism.

What changes

Today

After EIP-7378

Who is affected

In depth

How this differs from the existing formula

The existing EIP-1559 formula b[i+1] = b[i]*(1 + 1/8*(s[i]-s*)/s*) only looks at the immediately preceding block size s[i]. This EIP replaces s[i] with s_avg[i]. s_avg[i] is defined as the geometrically weighted sum alpha*Sum(1-alpha)^k*s[i-k+1], which written as a recurrence is s_avg[i] = alpha*s[i] + (1-alpha)*s_avg[i-1]. alpha in (0,1) is the smoothing factor; when alpha is 1, this reduces exactly to the existing rule.

Conditions for a bribery collusion attack

In the honest equilibrium where users each bid their maximum willingness to pay plus a small tip epsilon, the proposer only collects epsilon. If user(s) holding a transaction with total gas g bribe the proposer with epsilon times s* to produce an empty block, the base fee of the next block falls. If the condition g*b*/8 > s**epsilon holds, this attack is profitable for both the proposer and the users.

Why an exponentially weighted average was chosen

Averaging past block sizes with geometric weights keeps both computation and storage at O(1), lets the influence of any single outlier block fade gradually, and avoids creating large swings in future base fees. An alternative of lowering the 'max change denominator' (1/8, the learning rate) to a smaller value was also considered, but it was judged to slow the response to genuine sustained demand shifts excessively.

Relationship to EIP-1559's design goals

EIP-1559 chose a burn mechanism instead of a first-price auction, designed so that bidding one's true willingness to pay is the optimal strategy for users (per Roughgarden's analysis). However, this analysis assumes the proposer does not account for future rewards. This EIP addresses the problem that, when the proposer acts with an eye to the future, an incentive arises to collude with users to split the base fee that would otherwise be burned.

Scope of application and current status

Since the base fee is used in block validity checks, this change requires a hard fork. Its current status is Stagnant, with Test Cases marked TBD and Security Considerations still left as 'Needs discussion,' so this is not yet a finalized specification.

Original EIP · ← EIPs