-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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: updates for devnet4 #8929
Conversation
✅ All reviewers have approved. |
a0b6f6f
to
7d7f09a
Compare
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.
All Reviewers Have Approved; Performing Automatic Merge...
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.
All Reviewers Have Approved; Performing Automatic Merge...
@@ -73,7 +73,8 @@ 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 accounts code and reset the account's code hash to `0x0000000000000000000000000000000000000000000000000000000000000000`. |
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.
Why is the account code hash set to these zeros? It should be set to keccak256("")
?
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.
Ah you're right. Let me update it.
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.
I got some minor further questions / clarification comments :)
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a super great addition 😄 👍
placeholder for further devnet changes.
outstanding clarifications to make (from my notes):