This EIP defines an extension for eth_getLogs to provide logs for events that are not associated with a given transaction, such as block rewards and withdrawals.
Motivation
With EIP-7708 wallets gain the ability to use eth_getLogs to track changes to their ETH balance. However, the ETH balance may change without an explicit transaction, through block production and withdrawals. By having such operations emit block-level system logs, eth_getLogs provides a complete picture of ETH balance changes.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119 and RFC 8174.
Fee payment logs
A log, identical to a LOG2, is issued for every transaction and appended after all other logs created by EVM execution. The fee amount incorporates the total fee charged during transaction execution, including the base fee, the priority fee, and potential blob fees.
Block header objects in the context of the JSON-RPC API are extended to include:
systemLogsRoot: DATA, 32 Bytes
Log objects in the context of the JSON-RPC API are updated as follows:
logIndex: QUANTITY - The additional system logs are indexed consecutively after the existing logs from transaction receipts
transactionIndex: QUANTITY - null is also used for system logs; pending logs can still be identified by checking the blockHash for null
transactionHash: DATA, 32 Bytes - null is also used for system logs
Engine API
In the engine API, the ExecutionPayload for versions corresponding to forks adopting this EIP is extended to include:
systemLogsRoot: DATA, 32 Bytes
As part of engine_forkchoiceUpdated, Execution Layer implementations SHALL verify that systemLogsRoot for each block matches the actual value computed from local processing. This extends on top of existing receiptsRoot validation.
Consensus ExecutionPayload changes
The consensus ExecutionPayload type is extended with a new field to store the system logs root.
Together with EIP-7708 this EIP provides the ability for wallets to compute the exact ETH balance from logs without requiring download of every single block header and all withdrawals.
The block reward from priority fees no longer has to be summed up by processing all receipts and can be obtained from the system logs root, making it efficiently provable.
Alternatives / Future
The information from withdrawals is now duplicated across both the withdrawals list and the system logs. Maybe the information could be massaged into the emitted Withdrawal log data, allowing the existing withdrawals list to be retired. The current list design requires the wallet to obtain all block headers and all withdrawals to ensure they obtained all data pertaining to the observed account. Allowing them to be queried using eth_getLogs is more in line with how deposits are being tracked.
The log definitions themselves are subject to change. Aligning them with ERC-20 for plain credits provides consistency. For withdrawals, the log data could match the form of deposit logs and EIP-7685 request logs.
Backwards Compatibility
As a new field is added to the block header, applications assuming a specific block header layout may need updating.
Security Considerations
The emitted logs use SYSTEM_ADDRESS as their address which cannot conflict with user controlled smart contracts.