Update EIP-7702: updates for devnet4#8929
Conversation
|
✅ All reviewers have approved. |
a0b6f6f to
7d7f09a
Compare
eth-bot
left a comment
There was a problem hiding this comment.
All Reviewers Have Approved; Performing Automatic Merge...
eth-bot
left a comment
There was a problem hiding this comment.
All Reviewers Have Approved; Performing Automatic Merge...
| 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 accounts code and reset the account's code hash to `0x0000000000000000000000000000000000000000000000000000000000000000`. |
There was a problem hiding this comment.
Why is the account code hash set to these zeros? It should be set to keccak256("")?
There was a problem hiding this comment.
Ah you're right. Let me update it.
|
|
||
| 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 * 16 = 1616` |
There was a problem hiding this comment.
Nit: I see where the 101 comes from (flat bytes of the authority tuple) but this is not super clear. 16 is calldata gas cost for nonzero bytes.
| 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 * 16 = 1616` | ||
| * recovering the `authority` address = `3000` |
There was a problem hiding this comment.
Maybe add a note that this is ecrecover precompile cost?
|
|
||
| * ferry 101 bytes of calldata = `101 * 16 = 1616` | ||
| * recovering the `authority` address = `3000` | ||
| * reading the nonce and code of `authority` = `5000` |
There was a problem hiding this comment.
Where does the 5000 cost come from? (If I would check cold extcodecopy I pay 2600 gas, and then nonce can be directly read since we have to read the account RLP (which contains the nonce))
|
|
||
| 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. |
There was a problem hiding this comment.
This is a super great addition 😄 👍
placeholder for further devnet changes.
outstanding clarifications to make (from my notes):