From ced7e8f8de26391555b73269fd49f6820276ac0a Mon Sep 17 00:00:00 2001 From: lightclient <14004106+lightclient@users.noreply.github.com> Date: Mon, 29 Jul 2024 11:51:45 -0600 Subject: [PATCH] Update EIP-7702: various updates (#8766) * 7702: various updates * 7702: typo --- EIPS/eip-7702.md | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/EIPS/eip-7702.md b/EIPS/eip-7702.md index 0ed404e6f780c..56ef8ff9b98ed 100644 --- a/EIPS/eip-7702.md +++ b/EIPS/eip-7702.md @@ -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 @@ -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])`. @@ -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. @@ -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.