EIP-3041 Adding baseFee to eth_getBlockByHash (Adds `baseFee` to `eth_getBlockByHash`)

No call decision · Fees & gas · EIP status Stagnant · created 2020-10-13

Adds the base fee value as a new field in the eth_getBlockByHash API response, which looks up a block by its hash, for blocks after the EIP-1559 fork.

Why it is needed

Since the introduction of EIP-1559, Ethereum blocks record a protocol-level base fee. However, the eth_getBlockByHash API, which looks up block information by block hash, did not include this value in its response. Users who want to predict gas prices more accurately need to know the base fee of a specific block, but there was no way to check this value through this endpoint alone. This EIP therefore proposes adding a baseFee field to the response so the base fee value can be looked up directly.

What changes

Today

After EIP-3041

Who is affected

In depth

Change in endpoint behavior

eth_getBlockByHash is a JSON-RPC method that returns block information by block hash. This proposal specifies that if the queried block is before the EIP-1559 fork block, the response MUST NOT include a baseFee field, and if it is at or after the fork block, the response MUST include it. The parameters remain unchanged; only a field is added to the return value structure.

baseFee field format

The newly added baseFee field is a value following the Quantity type defined in EIP-1474, holding the base fee of that block. The full eth_getBlockByHash response specification refers to EIP-1474, and this EIP is defined as adding just one field on top of that.

Backward compatibility handling

Omitting the baseFee field when calling on pre-fork blocks does not break existing clients' parsing logic. The source document states that this makes it fully backward compatible.

Why a field was added instead of a new endpoint

The source document chose to add a single field to the existing eth_getBlockByHash response rather than creating a new RPC endpoint for the base fee. It explains that this is the simplest change and the easiest to integrate into implementations.

Security considerations

The added baseFee field is an informational value, and the source document states that adding this field does not introduce any separate technical security concerns.

Progress status

This EIP's status is marked Stagnant and is no longer being actively discussed. The call records contain no decision on whether to include it in a fork.

Original EIP · ← EIPs