Skip to content

Commit

Permalink
Update EIP-7702: various updates (#8766)
Browse files Browse the repository at this point in the history
* 7702: various updates

* 7702: typo
  • Loading branch information
lightclient committed Jul 29, 2024
1 parent 483db0d commit ced7e8f
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions EIPS/eip-7702.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ There is a lot of interest in adding short-term functionality improvements to EO

### Parameters

| Parameter | Value |
| -------------------- | ------ |
| `SET_CODE_TX_TYPE` | `0x04` |
| `MAGIC` | `0x05` |
| `PER_AUTH_BASE_COST` | `2500` |
| Parameter | Value |
| ------------------------ | ------- |
| `SET_CODE_TX_TYPE` | `0x04` |
| `MAGIC` | `0x05` |
| `PER_AUTH_BASE_COST` | `2500` |
| `PER_EMPTY_ACCOUNT_COST` | `25000` |

### Set Code Transaction

Expand All @@ -43,9 +44,9 @@ rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, dest
authorization_list = [[chain_id, address, nonce, y_parity, r, s], ...]
```

The 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-1559](./eip-1559.md).
The 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 `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 `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.

The [EIP-2718](./eip-2718.md) `ReceiptPayload` for this transaction is `rlp([status, cumulative_transaction_gas_used, logs_bloom, logs])`.

Expand All @@ -57,11 +58,12 @@ At the start of executing the transaction, for each `[chain_id, address, nonce,
2. Verify the chain id is either 0 or the chain's current ID.
3. Verify that the code of `authority` is either empty or already delegated.
4. Verify the nonce of `authority` is equal to `nonce`.
5. Charge the sender `PER_EMPTY_ACCOUNT_COST` if `authority` does not exist in the trie. Abort immediately if the sender balance is less than this value.
5. Set the code of `authority` to be `0xef0100 || address`. This is a delegation designation.
6. Increase the nonce of `authority` by one.
7. Add the `authority` account to `accessed_addresses` (as defined in [EIP-2929](./eip-2929.md).)
7. Add `authority` to `accessed_addresses` (as defined in [EIP-2929](./eip-2929.md).)

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 specified by the address in the last occurrence.
If any of the above steps (except 5) 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 occurrence.

Note that the signer of an authorization tuple may be different than `tx.origin` of the transaction.

Expand All @@ -79,6 +81,8 @@ The intrinsic cost of the new transaction is inherited from [EIP-2930](./eip-293

The transaction sender will pay for all authorization tuples, regardless of validity or duplication.

If a code reading instruction accesses a cold account during the resolution of delegated code, assess an additional [EIP-2929](eip-2929.md) `COLD_ACCOUNT_READ` cost of `2600` gas to the normal cost.

#### Transaction Origination

Modify the restriction put in place by [EIP-3607](./eip-3607.md) to allow EOAs whose code is a valid delegation designation, i.e. `0xef0100 || address`, to continue to originate transactions. Accounts with any other code values may not originate transactions.
Expand Down

0 comments on commit ced7e8f

Please sign in to comment.