-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Add EIP: Emit log on revert #9390
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+52
−0
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
d509968
Add new EIP
shohamc1 aede0ec
Spelling and grammar
shohamc1 9576cf4
Update EIP
shohamc1 f011351
Expound rationale
shohamc1 c1e9035
Update and rename eip-xxxx.md to eip-7889.md
SamWilsn 2293717
Update discussion link
shohamc1 40075ce
Add TODO tag
shohamc1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
eip: 7889 | ||
title: Emit log on revert | ||
description: Top level reverts emit a log with revert message | ||
author: Shoham Chakraborty (@shohamc1), Alex Forshtat (@forshtat) | ||
discussions-to: https://ethereum-magicians.org/t/eip-7889-emit-log-on-revert/22918 | ||
status: Draft | ||
type: Standards Track | ||
category: Core | ||
created: 2025-02-20 | ||
--- | ||
|
||
## Abstract | ||
|
||
All calls to the REVERT opcode with non-zero size must emit a log with revert data, making it accessible via standard RPC without the need for tracing. | ||
|
||
## Motivation | ||
|
||
Revert messages are currently inaccessible to users as they are not available via standard RPC. Instead, users have to request a node to trace the transaction and check the stack and memory at the moment when the REVERT opcode was executed. | ||
|
||
This introduces overhead for users and nodes - users must make an additional request to find out why their transaction failed, and the node has to replay the full transaction (which may be slow and computationally expensive) to get back a relatively small piece of data. | ||
|
||
Currently it is up to smart wallet developers to emit logs before a revert, however this is not a standard feature and thus cannot be relied upon by tools such as client libraries and block explorers. Making this log part of the protocol allows these tools to rely on logs for revert reasons. | ||
|
||
## Specification | ||
|
||
### Parameters | ||
|
||
<!-- TODO --> | ||
Check warning on line 29 in EIPS/eip-7889.md
|
||
|
||
* `REVERTTOPIC`: `TBD` | ||
* `DATA_LIMIT`: `TBD` | ||
|
||
### Functionality | ||
|
||
Whenever `REVERT` is called with non-zero size, emit a log identical to a LOG1 with the topic `REVERTTOPIC`. The log data is the raw bytes of the revert message. The data is truncated to `DATA_LIMIT`. | ||
|
||
## Rationale | ||
|
||
This is the simplest possible implementation that allows revert messages to be accessible via RPC methods. It does not require any changes to client libraries, or other RPC consumers as it is backward compatible. It does not introduce new RPC methods or new opcodes. | ||
|
||
## Backwards Compatibility | ||
|
||
Reverted transactions may now contain up to one log. | ||
|
||
## Security Considerations | ||
|
||
Reverted transactions must cost at least intrinsic gas (21000 gas), which is much more expensive than the LOG1 opcode (750 gas). Hence, this EIP does not introduce any new avenues to inflate Ethereum storage requirements. However, it is expected to increase the average number of logs. | ||
|
||
## Copyright | ||
|
||
Copyright and related rights waived via [CC0](../LICENSE.md). |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a html <-- TODO --> tag for bot to track addressing this for going beyond draft
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
40075ce