EIPs/EIPS/eip-658.md

32 lines
1.8 KiB
Markdown
Raw Normal View History

2017-06-30 09:33:52 +00:00
## Preamble
2017-11-20 13:06:48 +00:00
EIP: 658
Title: Embedding transaction status code in receipts
2017-06-30 09:33:52 +00:00
Author: Nick Johnson <nick@ethereum.org>
Type: Standard Track
Category Core
2017-11-20 13:06:48 +00:00
Status: Final
2017-06-30 09:33:52 +00:00
Created: 2017-06-30
Requires: 140
Replaces: 98
## Abstract
2017-09-04 16:32:22 +00:00
This EIP replaces the intermediate state root field of the receipt with a status code indicating if the top-level call succeeded or failed.
2017-06-30 09:33:52 +00:00
## Motivation
With the introduction of the REVERT opcode in EIP140, it is no longer possible for users to assume that a transaction failed iff it consumed all gas. As a result, there is no clear mechanism for callers to determine whether a transaction succeeded and the state changes contained in it were applied.
Full nodes can provide RPCs to get a transaction return status and value by replaying the transaction, but fast nodes can only do this for nodes after their pivot point, and light nodes cannot do this at all, making a non-consensus solution impractical.
2017-09-04 16:32:22 +00:00
Instead, we propose to replace the intermediate state root, already obsoleted by EIP98, with the return status (1 for success, 0 for failure). This both allows callers to determine success status, and remedies the previous omission of return data from the receipt.
2017-06-30 09:33:52 +00:00
## Specification
2017-11-20 13:06:48 +00:00
For blocks where block.number >= BYZANTIUM_FORK_BLKNUM, the intermediate state root is replaced by a status code, 0 indicating failure (due to any operation that can cause the transaction or top-level call to revert) and 1 indicating success.
2017-06-30 09:33:52 +00:00
## Rationale
2017-07-14 11:23:58 +00:00
This constitutes a minimal possible change that permits fetching the success/failure state of transactions, preserving existing capabilities with minimum disruption or additional work for Metropolis.
2017-06-30 09:33:52 +00:00
## Copyright
Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).