EIP-7889 Emit a log on revert (Emit log on revert)

No call decision · EVM & execution · EIP status Stagnant · created 2025-02-20

This changes the protocol so that when a transaction reverts along with a failure message, the protocol automatically leaves a log containing that message. Standard RPC can then show the failure reason directly, with no separate tracing request needed.

Why it is needed

Right now, even when a transaction fails, there is no general way to retrieve the revert message that explains why. To see the failure reason, a user must separately request transaction tracing from a node, and the node must re-execute the entire already-finished transaction from the start to inspect the stack and memory at the moment REVERT ran. To pull out one small message, the user sends an extra request and the node performs a slow, costly re-execution. Some smart wallet developers log the message themselves before reverting, but since this is not a standard feature, tools such as client libraries or block explorers cannot rely on it. This EIP turns log emission into a protocol-level rule so tools can reliably read the failure reason from the log.

What changes

Today

After EIP-7889

Who is affected

In depth

Trigger condition

A log is emitted whenever the REVERT opcode is called with data of non-zero size. Reverts without a message (size zero) are not covered. The title and description refer to top-level reverts, but the Specification body states the condition as 'when REVERT is called with non-zero size.'

Log format and parameters

The emitted log takes the same form as LOG1, with REVERTTOPIC as the topic. The log data is the raw bytes of the revert message, truncated to the DATA_LIMIT size. Both parameters, REVERTTOPIC and DATA_LIMIT, are TBD, meaning not yet determined.

Design rationale

This is the simplest implementation for making revert messages accessible via RPC. It introduces no new RPC method and no new opcode, and is backward compatible in that it requires no changes to existing RPC consumers such as client libraries.

Backward compatibility

Until now, reverted transactions emitted no log, but after this EIP a reverted transaction can include up to one log. Any code that assumes failed transactions have no logs needs to account for this.

Security and storage

Even a reverted transaction must pay at least the intrinsic gas of 21000, which is far more expensive than the cost of the LOG1 opcode (750 gas). So this EIP does not create a new attack path for bloating Ethereum's storage. However, the average number of logs is expected to increase.

Current status

This EIP was created on February 20, 2025, and its current status is Stagnant. Discussion has stalled, and core parameters such as REVERTTOPIC and DATA_LIMIT remain undetermined. The content may change or stop progressing, and there is no record of core developer calls deciding on fork inclusion.

Original EIP · ← EIPs