From 83a4b9b83a9739510f21a7de8996c1f5819a4833 Mon Sep 17 00:00:00 2001 From: lightclient Date: Wed, 9 Oct 2024 14:51:53 -0600 Subject: [PATCH 1/2] 7702: fixup gas costs and empty code hash --- EIPS/eip-7702.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/EIPS/eip-7702.md b/EIPS/eip-7702.md index ea81cb7e17f7a..a7d9bc767284d 100644 --- a/EIPS/eip-7702.md +++ b/EIPS/eip-7702.md @@ -31,7 +31,7 @@ There is a lot of interest in adding short-term functionality improvements to EO | ------------------------ | ------- | | `SET_CODE_TX_TYPE` | `0x04` | | `MAGIC` | `0x05` | -| `PER_AUTH_BASE_COST` | `15000` | +| `PER_AUTH_BASE_COST` | `12500` | | `PER_EMPTY_ACCOUNT_COST` | `25000` | ### Set Code Transaction @@ -74,7 +74,7 @@ At the start of executing the transaction, after incrementing the sender's nonce 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. - * 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`. + * 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 the empty hash `0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470`. 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. @@ -115,13 +115,13 @@ Additionally, if a transaction's `destination` has a delegation designation, add 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` +* ferry 101 bytes of calldata = `101 * non-zero cost (16) = 1616` * recovering the `authority` address = `3000` -* reading the nonce and code of `authority` = `5000` +* reading the nonce and code of `authority` = `2600` * storing values in already warm account = `200` * cost to deploy code = `200 * 23 = 4600` -The impact-based assessment leaves us with `14416` gas for the operation. We round up to `15000` to account for miscellaneous costs associated with shuttling data around the state transition. +The impact-based assessment leaves us with `1216` gas for the operation. We round up to `12500` to account for miscellaneous costs associated with shuttling data around the state transition. ### No initcode From 9a363c0e2c2bc7be41cbba6c46522ae621c6d8c1 Mon Sep 17 00:00:00 2001 From: lightclient Date: Wed, 9 Oct 2024 14:53:55 -0600 Subject: [PATCH 2/2] typo --- EIPS/eip-7702.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-7702.md b/EIPS/eip-7702.md index a7d9bc767284d..3561c6bc55ad7 100644 --- a/EIPS/eip-7702.md +++ b/EIPS/eip-7702.md @@ -121,7 +121,7 @@ The `PER_AUTH_BASE_COST` is the cost to process the authorization tuple and set * storing values in already warm account = `200` * cost to deploy code = `200 * 23 = 4600` -The impact-based assessment leaves us with `1216` gas for the operation. We round up to `12500` to account for miscellaneous costs associated with shuttling data around the state transition. +The impact-based assessment leaves us with `12016` gas for the operation. We round up to `12500` to account for miscellaneous costs associated with shuttling data around the state transition. ### No initcode