From d704e7911e3b1aae99f370e69cc4981b51b3cdc4 Mon Sep 17 00:00:00 2001 From: Andrei Maiboroda Date: Thu, 6 Feb 2025 16:31:38 +0100 Subject: [PATCH] Require clients to cache result of validation and remove 3860 charge --- EIPS/eip-7873.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EIPS/eip-7873.md b/EIPS/eip-7873.md index 89e968e17314dd..c8b822115d1354 100644 --- a/EIPS/eip-7873.md +++ b/EIPS/eip-7873.md @@ -42,7 +42,6 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S | `GAS_CODE_DEPOSIT` | Defined as `200` in the [Ethereum Execution Layer Specs](https://github.com/ethereum/execution-specs/blob/0f9e4345b60d36c23fffaa69f70cf9cdb975f4ba/src/ethereum/shanghai/vm/gas.py#L44) | | `TX_DATA_COST_PER_ZERO` | Defined as `4` in the [Ethereum Execution Layer Specs](https://github.com/ethereum/execution-specs/blob/0f9e4345b60d36c23fffaa69f70cf9cdb975f4ba/src/ethereum/shanghai/fork_types.py#L41) | | `TX_DATA_COST_PER_NON_ZERO` | Defined as `16` in the [Ethereum Execution Layer Specs](https://github.com/ethereum/execution-specs/blob/0f9e4345b60d36c23fffaa69f70cf9cdb975f4ba/src/ethereum/shanghai/fork_types.py#L40) | -| `INITCODE_WORD_COST` | Defined as `2` in [EIP-3860](./eip-3860.md) | | `MAX_CODE_SIZE` | Defined as `24576` in [EIP-170](./eip-170.md) | | `MAX_INITCODE_SIZE` | Defined as `2 * MAX_CODE_SIZE` in [EIP-3860](./eip-3860.md) | @@ -111,7 +110,6 @@ Introduce a new instruction on the same block number [EIP-3540](./eip-3540.md) i - fails (returns 0 on the stack) if such initcode does not exist in the transaction, or if called from a transaction of `TransactionType` other than `INITCODE_TX_TYPE` - caller's nonce is not updated and gas for initcode execution is not consumed. Only `TXCREATE` constant gas was consumed - let `initcontainer` be that EOF container, and `initcontainer_size` its length in bytes -- deduct `INITCODE_WORD_COST * ((initcontainer_size + 31) // 32)` gas ([EIP-3860](./eip-3860.md) charge) - check that current call depth is below `STACK_DEPTH_LIMIT` and that caller balance is enough to transfer `value` - in case of failure return 0 on the stack, caller's nonce is not updated and gas for initcode execution is not consumed. Only `TX_CREATE_COST` constant and [EIP-3860](./eip-3860.md) gas are consumed. - **validate the initcode container and all its subcontainers recursively** @@ -135,6 +133,8 @@ Introduce a new instruction on the same block number [EIP-3540](./eip-3540.md) i - push `new_address` onto the stack - deduct `GAS_CODE_DEPOSIT * deployed_code_size` gas +Note that the implementations are expected to cache the result of container validation for the time of current transaction execution, and therefore the cost of each container's validation is sufficiently covered by `InitcodeTransaction` intrinsic cost (initcodes charge). + ### Creator Contract We introduce a standardised Creator Contract (i.e. written in EVM, but existing at a known address), which eliminates the need to have create transactions with empty `to`.