EIP-3045 Add base fee to uncle block queries (Adds `baseFee` to `eth_getUncleByBlockHashAndIndex`)
No call decision · Networking & nodes · EIP status Stagnant · created 2020-10-14
A proposal to add the EIP-1559 base fee (baseFee) field to the eth_getUncleByBlockHashAndIndex RPC response, which retrieves uncle block information.
Why it is needed
With the introduction of EIP-1559, every block header includes a base fee value as part of the consensus rules. However, the response from the eth_getUncleByBlockHashAndIndex RPC method, which queries uncle blocks, does not include this value. Wallets and apps need to know a block's base fee to predict gas costs, but there was no way to retrieve this information for uncle blocks. This EIP fills that gap by adding a baseFee field to the RPC response, improving gas fee prediction accuracy.
What changes
Today
- The eth_getUncleByBlockHashAndIndex response lacks a baseFee field
- The base fee value of an uncle block is unknown and cannot be used for gas fee prediction
After EIP-3045
- Querying a block after the EIP-1559 fork includes a baseFee field in the response
- Querying a block before the fork still omits the baseFee field (backward compatible)
Who is affected
- Wallet & app developers: The base fee value of an uncle block can be read directly from the RPC response and used for gas fee prediction.
- Client teams: The baseFee field must be added to the eth_getUncleByBlockHashAndIndex implementation.
- Users: There is no direct impact, but there is an indirect effect of improving the accuracy of wallets' gas fee predictions.
In depth
Scope of application
This EIP only changes the response format of a single JSON-RPC method, eth_getUncleByBlockHashAndIndex. The parameters (block hash, uncle index) remain unchanged; only a single baseFee field is added to the result object.
Field definition
The added baseFee is of Quantity type (a hexadecimal string), following the Quantity format defined in EIP-1474. The value is the base fee per gas for that block.
Branching based on the fork
Blocks with a number before the EIP-1559 fork block MUST NOT include a baseFee field in the response, and blocks at or after the fork block MUST include it. This is because pre-fork block headers do not actually have a base fee value.
Design choices
Rather than creating a new RPC endpoint, the approach taken was to add a single field to the existing eth_getUncleByBlockHashAndIndex response. The author describes this as the simplest change to integrate.
Security impact
The added baseFee field is for informational purposes only, and the original text states that it introduces no technical security issues.
Status and prerequisites
This EIP depends on EIP-1474 (the JSON-RPC specification) and EIP-1559 (the introduction of the base fee), and its status is Stagnant. Stagnant means discussion has stopped and is no longer progressing, so actual adoption status and details may have changed or not progressed since the original was written.