mirror of https://github.com/status-im/EIPs.git
Update eip-draft-returndata.md
This commit is contained in:
parent
327c81c581
commit
df687f5208
|
@ -12,14 +12,14 @@
|
|||
|
||||
|
||||
## Abstract
|
||||
This EIP replaces the intermediate state root field of the receipt with either the contract return data and status, or a hash of that value.
|
||||
This EIP replaces the intermediate state root field of the receipt with a status code indicating if the top-level call succeeded or failed.
|
||||
|
||||
## 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.
|
||||
|
||||
Instead, we propose to replace the intermediate state root, already obsoleted by EIP98, with either the return status (1 for success, 0 for failure) and any return/revert data, or the hash of the above. This both allows callers to determine success status, and remedies the previous omission of return data from the receipt.
|
||||
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.
|
||||
|
||||
## Specification
|
||||
For blocks where block.number >= METROPOLIS_FORK_BLKNUM, the intermediate state root is replaced by a status code, a single byte with 0 indicating failure (due to any operation that can cause the transaction or top-level call to revert) and 1 indicating success.
|
||||
|
|
Loading…
Reference in New Issue