Skip to content

Commit

Permalink
Update EIP-7620: minor fixes and clarifications in the spec
Browse files Browse the repository at this point in the history
Merged by EIP-Bot.
  • Loading branch information
gumb0 committed Mar 18, 2024
1 parent a0ef833 commit 28ebf81
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions EIPS/eip-7620.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "S
| `MAX_INITCODE_COUNT` | `256` |
| `GAS_KECCAK256_WORD` | Defined as `6` in the [Ethereum Execution Layer Specs](https://github.com/ethereum/execution-specs/blob/0f9e4345b60d36c23fffaa69f70cf9cdb975f4ba/src/ethereum/shanghai/vm/gas.py#L37C1-L37C19) |
| `TX_CREATE_COST` | Defined as `32000` in the [Ethereum Execution Layer Specs](https://github.com/ethereum/execution-specs/blob/0f9e4345b60d36c23fffaa69f70cf9cdb975f4ba/src/ethereum/shanghai/fork_types.py#L42) |
| `STACK_DEPTH_LIMIT` | Defined as `1024` in the [Ethereum Execution Layer Specs](https://github.com/ethereum/execution-specs/blob/0f9e4345b60d36c23fffaa69f70cf9cdb975f4ba/src/ethereum/shanghai/vm/interpreter.py#L60) |
| `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) |
Expand Down Expand Up @@ -118,6 +119,8 @@ Details on each instruction follow in the next sections.
- pop `value`, `salt`, `data_offset`, `data_size` from the operand stack
- load initcode EOF subcontainer at `initcontainer_index` in the container from which `EOFCREATE` is executed
- deduct `GAS_KECCAK256_WORD * ((initcontainer_size + 31) // 32)` gas (hashing 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.
- follow steps in the [Initcontainer execution](#initcontainer-execution) below
- deduct `GAS_CODE_DEPOSIT * deployed_code_size` gas

Expand All @@ -129,11 +132,12 @@ Details on each instruction follow in the next sections.
- 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
- deduct `INITCODE_WORD_COST * ((initcontainer_size + 31) // 32)` gas
- deduct `GAS_KECCAK256_WORD * ((initcontainer_size + 31) // 32)` gas (hashing charge)
- check that current call depth is below `STACK_DEPTH_LIMIT` and that caller balance is enough to transfer `value`
- **validate the initcode container and all its subcontainers recursively**
- in addition to this, check if the initcode container has its `len(data_section)` equal `data_size`, i.e. data section content is exactly as the size declared in the header (see [Data section lifecycle](#data-section-lifecycle))
- fails (returns 0 on the stack) if any of those was invalid
- caller’s nonce is not updated and gas for initcode execution is not consumed. Only `TXCREATE` constant and [EIP-3860](./eip-3860.md) gas were consumed
- deduct `GAS_KECCAK256_WORD * ((initcontainer_size + 31) // 32)` gas (hashing charge)
- fails (returns 0 on the stack) if any of the checks above was invalid
- caller’s nonce is not updated and gas for initcode execution is not consumed. Only `TX_CREATE_COST` constant, [EIP-3860](./eip-3860.md) gas and hashing gas were consumed
- follow steps in the [Initcontainer execution](#initcontainer-execution) below
- deduct `GAS_CODE_DEPOSIT * deployed_code_size` gas

Expand Down

0 comments on commit 28ebf81

Please sign in to comment.