Skip to content

Commit

Permalink
Update EIP-3860: clarify initcode charge deduction if size above limit
Browse files Browse the repository at this point in the history
  • Loading branch information
gumb0 committed Nov 24, 2022
1 parent 9b8f87b commit c3c14c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EIPS/eip-3860.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ We define `initcode_cost(initcode)` to equal `INITCODE_WORD_COST * ceil(len(init
1. If length of transaction data (`initcode`) in a create transaction exceeds `MAX_INITCODE_SIZE`, transaction is invalid. (*Note that this is similar to transactions considered invalid for not meeting the intrinsic gas cost requirement.*)
2. For a create transaction, extend the transaction data cost formula to include `initcode_cost(initcode)`. (*Note that this is included in transaction intrinsic cost, i.e. transaction with not enough gas to cover initcode cost is invalid.*)
3. If length of `initcode` to `CREATE` or `CREATE2` instructions exceeds `MAX_INITCODE_SIZE`, instruction execution ends with the result `0` pushed on the stack. Gas for initcode execution is not deducted and caller's nonce is not incremented in this case.
4. For the `CREATE` and `CREATE2` instructions charge an extra gas cost equaling to `initcode_cost(initcode)`. This cost is deducted before the calculation of the resulting contract address and the execution of `initcode`. (*Note that this means before or at the same time as the hashing cost is applied in `CREATE2`.*)
4. For the `CREATE` and `CREATE2` instructions charge an extra gas cost equaling to `initcode_cost(initcode)`. This cost is deducted before the calculation of the resulting contract address and the execution of `initcode`. (*Note that this means before or at the same time as the hashing cost is applied in `CREATE2`.*) If the length check of point 3 fails, this cost is not deducted.

## Rationale

Expand Down

0 comments on commit c3c14c8

Please sign in to comment.