EIP-3046 Add baseFee to uncle block queries (Adds `baseFee` to `eth_getUncleByBlockNumberAndIndex`)
No call decision · Fees & gas · EIP status Stagnant · created 2020-10-14
Adds an EIP-1559 base fee (baseFee) value to the eth_getUncleByBlockNumberAndIndex RPC response, which queries uncle blocks. This value is only included for blocks after the 1559 fork.
Why it is needed
EIP-1559 changed the base fee to be managed at the protocol level for each block, and this value is recorded as consensus data in the block header. For users or apps to predict gas prices more accurately, they need to know the base fee value of a specific block, but the eth_getUncleByBlockNumberAndIndex RPC endpoint, which queries uncle blocks, did not include this value in its response. As a result, there was no way to check the base fee for uncle blocks.
What changes
Today
- The eth_getUncleByBlockNumberAndIndex response lacks a baseFee field
- The base fee value of an uncle block cannot be checked via RPC
- Some information needed for gas price prediction is missing
After EIP-3046
- Querying an uncle block after the 1559 fork includes a baseFee field in the response
- Blocks before the 1559 fork still omit the baseFee field (maintaining backward compatibility)
- The base fee value can now be read directly for uncle blocks as well
Who is affected
- Wallet & app developers: The baseFee value can be read directly from the uncle block query response and used in gas price prediction logic.
- Client teams: The eth_getUncleByBlockNumberAndIndex implementation needs the baseFee field added along with branching logic for before and after the fork.
- Users: There is no directly noticeable change, but the accuracy of apps' gas price predictions may improve indirectly.
In depth
Background
EIP-1559 established a base fee for each block and records it as a new field of protocol consensus data in the block header. Knowing the base fee value of a specific block allows users to predict gas prices more accurately, but at the time this EIP was written, the RPC endpoint for querying uncle blocks did not return this value.
Specification
The target is eth_getUncleByBlockNumberAndIndex. The parameters remain unchanged. A new field, baseFee (of Quantity type), is added to the result object. Blocks with a number before the EIP-1559 fork block MUST NOT include the baseFee field, and blocks at or after the fork block number MUST include it. The full specification for all other response fields follows EIP-1474.
Example
The request passes a block number (or "latest") and an uncle index to eth_getUncleByBlockNumberAndIndex, unchanged from before. In the example response, a hexadecimal Quantity value such as "baseFee": "0x7" is added among existing fields like difficulty and gasLimit.
Design rationale
Instead of creating an entirely new endpoint, the approach taken was to add a single field to the existing endpoint. This was judged to be the simplest and easiest change to integrate. For backward compatibility, it was decided not to include baseFee in responses for pre-fork blocks.
Backward compatibility
This change is backward compatible. Calls targeting blocks before the EIP-1559 fork block simply omit the baseFee field from the response, so it does not conflict with existing client behavior.
Security considerations
The original text states that the added baseFee field is for informational purposes and does not introduce any separate technical security issues.
Current status
This EIP's status is marked Stagnant, meaning discussion has stalled. It has not been adopted as a standard and may be resumed or abandoned in the future.