Skip to content

Commit

Permalink
Require clients to cache result of validation and remove 3860 charge
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Feb 6, 2025
1 parent 9f1e800 commit d704e79
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions EIPS/eip-7873.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |

Expand Down Expand Up @@ -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**
Expand All @@ -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`.
Expand Down

0 comments on commit d704e79

Please sign in to comment.