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: remove chain_id in authorization tuple #9152

Closed
wants to merge 7 commits into from
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
EIP-7702: update text
fjl committed Dec 18, 2024

Verified

This commit was signed with the committer’s verified signature.
lilyinstarlight Lily Foster
commit b944cc2deb5189f6b86e8faf44fe2c29328c3358
4 changes: 2 additions & 2 deletions EIPS/eip-7702.md
Original file line number Diff line number Diff line change
@@ -44,9 +44,9 @@
authorization_list = [[all_chains, address, nonce, y_parity, r, s], ...]
```

The transaction fields `chain_id`, `nonce`, `max_priority_fee_per_gas`, `max_fee_per_gas`, `gas_limit`, `destination`, `value`, `data`, and `access_list` of the outer transaction follow the same semantics as [EIP-4844](./eip-4844.md). *Note, this means a null destination is not valid.*
The transaction fields `chain_id`, `nonce`, `max_priority_fee_per_gas`, `max_fee_per_gas`, `gas_limit`, `destination`, `value`, `data`, and `access_list` follow the same semantics as [EIP-4844](./eip-4844.md). *Note, this means a null destination is not valid.*

The `authorization_list` is a list of tuples that store the address to code which the signer desires to execute in the context of their EOA. The transaction is considered invalid if the length of `authorization_list` is zero. It is also considered invalid when any field in an authorization tuple exceeds the following bounds:
`authorization_list` is a list of tuples that store the address to code which the signer desires to execute in the context of their EOA. The transaction is considered invalid if the length of `authorization_list` is zero. It is also considered invalid when any field in an authorization tuple exceeds the following bounds:

```python
assert auth.all_chains == 0 || auth.all_chains == 1
@@ -63,18 +63,18 @@

At the start of executing the transaction, after incrementing the sender's nonce, for each `[chain_id, address, nonce, y_parity, r, s]` tuple do the following:

1. Establish chain ID for authorizations:

Check failure on line 66 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "1. Establish chain ID for auth..."]

EIPS/eip-7702.md:66 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "1. Establish chain ID for auth..."]
* 1a. If `all_chains` is zero, set `auth_chain_id` to the transaction `chain_id` (which must equal the executing chain's ID).

Check failure on line 67 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "* 1a. If `all_chains` is zero,..."]

EIPS/eip-7702.md:67 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* 1a. If `all_chains` is zero,..."]
* 1b. If `all_chains` is one, set `auth_chain_id` to zero.

Check failure on line 68 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "* 1b. If `all_chains` is one, ..."]

EIPS/eip-7702.md:68 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* 1b. If `all_chains` is one, ..."]
2. Verify the `nonce` is less than `2**64 - 1`.

Check failure on line 69 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "2. Verify the `nonce` is less ..."]

EIPS/eip-7702.md:69 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "2. Verify the `nonce` is less ..."]
3. `authority = ecrecover(keccak(MAGIC || rlp([auth_chain_id, address, nonce])), y_parity, r, s]`

Check failure on line 70 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "3. `authority = ecrecover(kecc..."]

EIPS/eip-7702.md:70 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "3. `authority = ecrecover(kecc..."]
* 3a. The `s` value must be less than or equal to `secp256k1n/2`, as specified in [EIP-2](./eip-2.md).

Check failure on line 71 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "* 3a. The `s` value must be le..."]

EIPS/eip-7702.md:71 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* 3a. The `s` value must be le..."]

Check failure on line 71 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "* 3a. The `s` value must be le..."]

EIPS/eip-7702.md:71 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* 3a. The `s` value must be le..."]
4. Add `authority` to `accessed_addresses` (as defined in [EIP-2929](./eip-2929.md).)

Check failure on line 72 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "4. Add `authority` to `accesse..."]

EIPS/eip-7702.md:72 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "4. Add `authority` to `accesse..."]
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.

Check failure on line 76 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "8. Set the code of `authority`..."]

EIPS/eip-7702.md:76 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "8. Set the code of `authority`..."]
* 8a. 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`.

Check failure on line 77 in EIPS/eip-7702.md

GitHub Actions / Markdown Linter

Lists should be surrounded by blank lines [Context: "* 8a. As a special case, if `a..."]

EIPS/eip-7702.md:77 MD032/blanks-around-lists Lists should be surrounded by blank lines [Context: "* 8a. As a special case, if `a..."]
9. Increase the nonce of `authority` by one.

If any of the above steps fail, immediately stop processing that tuple and continue to the next tuple in the list. It will in the case of multiple tuples for the same authority, set the code using the address in the last valid occurrence.