---
eip: 7378
label: EIP-7378
title: Add time-weighted averaging to the base fee
status: Stagnant
type: Standards Track
category: Core
created: 2023-07-22
official: https://eips.ethereum.org/EIPS/eip-7378
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7378.md
canonical: https://eips.huatuo.xyz/eip-7378/
lang: en
tldr: A proposed change to EIP-1559 that updates the base fee from an exponential moving average of recent block sizes instead of only the last block, making fee manipulation through bribed empty blocks less profitable.
tags: [gas, fees, base-fee, core, mev]
---

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

> Using geometric weights to average past block sizes into consideration

**TL;DR:** A proposed change to EIP-1559 that updates the base fee from an exponential moving average of recent block sizes instead of only the last block, making fee manipulation through bribed empty blocks less profitable.

## What problem does it solve?

Under [EIP-1559](/eip-1559/) the base fee for the next block depends only on how full the *last* block was. If it was above the gas target the fee goes up; below, it goes down by up to 12.5 %.

Academic work cited by the proposal points out that this makes the base fee cheap to push around. A user with a lot of gas to spend can bribe a proposer to publish an empty block. The bribe only needs to cover the tips the proposer gives up (roughly tip × target size), but the base fee then drops by 1/8 for everyone in the next block, including the briber. Since the base fee is burned, neither the user nor the proposer loses anything from cutting it, so both can profit. The same research also describes the current rule as prone to oscillation.

## How it works

The formula keeps the EIP-1559 shape but swaps the last block size `s[i]` for a smoothed size `s_avg[i]`:

```
b[i+1] = b[i] * (1 + 1/8 * (s_avg[i] - s_target) / s_target)

s_avg[i] = α * s[i] + (1 - α) * s_avg[i-1]       with 0 < α < 1
```

- `α` is a smoothing factor. A larger `α` reacts faster to recent blocks; at `α = 1` the rule becomes the current EIP-1559 rule.
- Because older blocks fade out geometrically, a single empty (or overfull) block only nudges the base fee a little, so a one-block bribe buys much less.
- The running average needs one stored value and constant computation per block.

The author considered simply shrinking the 1/8 "max change denominator" instead, but rejected it because that would make the fee slow to follow real, lasting changes in demand. The moving average aims to keep responsiveness while damping outliers.

## Sample code

Python pseudocode for the proposed update. The spec does not fix a value for `α`; the one below is illustrative only.

```python
BASE_FEE_MAX_CHANGE_DENOMINATOR = 8
ALPHA_NUM, ALPHA_DEN = 1, 4  # α = 0.25, placeholder

def next_size_avg(parent_size_avg: int, parent_gas_used: int) -> int:
    return (ALPHA_NUM * parent_gas_used
            + (ALPHA_DEN - ALPHA_NUM) * parent_size_avg) // ALPHA_DEN

def next_base_fee(parent_base_fee: int, size_avg: int, gas_target: int) -> int:
    if size_avg == gas_target:
        return parent_base_fee
    diff = abs(size_avg - gas_target)
    delta = parent_base_fee * diff // gas_target // BASE_FEE_MAX_CHANGE_DENOMINATOR
    if size_avg > gas_target:
        return parent_base_fee + max(delta, 1)
    return parent_base_fee - delta
```

## Things to know

- Status: **Stagnant**. It was not scheduled for any network upgrade, and mainnet still uses the plain EIP-1559 rule.
- It would require a hard fork, since block validity depends on the base fee.
- The spec leaves the value of `α`, test cases and security analysis open ("TBD" / "Needs discussion"), and does not say how the average would be stored or initialised.
- The authors note the bribery problem grows with demand and only mildly affects Ethereum today; the proposal is framed as preparation.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7378
