Skip to content
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

Update EIP-7702: Change MAGIC from 0x05 to 0x1a #8835

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions EIPS/eip-7702.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ There is a lot of interest in adding short-term functionality improvements to EO
| Parameter | Value |
| ------------------------ | ------- |
| `SET_CODE_TX_TYPE` | `0x04` |
| `MAGIC` | `0x05` |
| `MAGIC` | `0x1a` |
| `PER_AUTH_BASE_COST` | `12500` |
| `PER_EMPTY_ACCOUNT_COST` | `25000` |

Expand Down Expand Up @@ -74,7 +74,7 @@ At the start of executing the transaction, after incrementing the sender's nonce
5. Verify the code of `authority` is either empty or already delegated.
6. Verify the nonce of `authority` is equal to `nonce`. In case `authority` does not exist in the trie, verify that `nonce` is equal to `0`.
7. Add `PER_EMPTY_ACCOUNT_COST - PER_AUTH_BASE_COST` gas to the global refund counter if `authority` exists in the trie.
8. Set the code of `authority` to be `0xef0100 || address`. This is a delegation designation.
8. Set the code of `authority` to be `0xef0100 || address`. This is a delegation designation.
* As a special case, if `address` is `0x0000000000000000000000000000000000000000` do not write the designation. Clear the account's code and reset the account's code hash to the empty hash `0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470`.
9. Increase the nonce of `authority` by one.

Expand Down Expand Up @@ -115,7 +115,7 @@ Additionally, if a transaction's `destination` has a delegation designation, add
The `PER_AUTH_BASE_COST` is the cost to process the authorization tuple and set the delegation destination. We are able to compute a fair cost for this operation by reviewing its impact on the system:

* ferry 101 bytes of calldata = `101 * non-zero cost (16) = 1616`
* recovering the `authority` address = `3000`
* recovering the `authority` address = `3000`
* reading the nonce and code of `authority` = `2600`
* storing values in already warm account = `200`
* cost to deploy code = `200 * 23 = 4600`
Expand Down Expand Up @@ -198,7 +198,7 @@ Specifically:

A general design goal of state transition changes is to minimize the number of special cases an EIP has. In early iterations, this EIP resisted a special case for clearing an account's delegation designation.

For most intents and purposes, an account delegated to `0x0` is indistinguishable from a true EOA. However, one particular unfortunate case is unavoidable. Even if a user has a zeroed out delegation designation, most operations that interact with that account will encounter an additional `COLD_ACCOUNT_READ_COST` upon the first touch.
For most intents and purposes, an account delegated to `0x0` is indistinguishable from a true EOA. However, one particular unfortunate case is unavoidable. Even if a user has a zeroed out delegation designation, most operations that interact with that account will encounter an additional `COLD_ACCOUNT_READ_COST` upon the first touch.

This is not ideal and may be a significant enough concern to impact the overall adoption of the EIP. For these reasons, we have opted to include a mechanism which allow users to restore their EOA to its original pureness.

Expand Down
Loading