Update EIP-2780: Add missing 7708 log costs#11586
Open
danceratopz wants to merge 3 commits intoethereum:masterfrom
Open
Update EIP-2780: Add missing 7708 log costs#11586danceratopz wants to merge 3 commits intoethereum:masterfrom
danceratopz wants to merge 3 commits intoethereum:masterfrom
Conversation
Top-level `CREATE` transactions (i.e. `tx.to` is empty) do not pay `GAS_CREATE = 32,000`; that opcode base applies only to the `CREATE` / `CREATE2` *opcodes* executed in running EVM code, so there is no slack to absorb the [EIP-7708](./eip-7708.md) transfer log emitted on a `CREATE` tx with `value > 0`. The intrinsic-gas pseudocode is broadened to charge `TRANSFER_LOG_COST` whenever `tx.is_create() or tx.sender != tx.to`, alongside corresponding updates to the *Notes*, *Rationale*, the *Transaction reference cases* table, and the EIP-7708 interaction line.
…` / `CREATE2` In-EVM `CREATE` / `CREATE2` with non-zero endowment emit an [EIP-7708](./eip-7708.md) transfer log (caller to newly created account). A new bullet under *EVM gas schedule adjustments* charges `TRANSFER_LOG_COST` at the point the endowment transfer is processed, on top of the existing `GAS_CREATE = 32,000`, init-code, and (for `CREATE2`) salt-hashing costs. The newly created account is, by construction, distinct from the caller, so the self-transfer carve-out does not apply, and `GAS_CREATE` continues to price state growth without `GAS_NEW_ACCOUNT` on top. Pre-2780 the LOG3 cost was implicitly absorbed by the over-priced `GAS_CREATE`; this EIP unbundles them and prices the log explicitly. The *Notes*, *Rationale*, and EIP-7708 interaction line are updated to mention this case.
…rn events [EIP-7708](./eip-7708.md) emits a LOG2-shaped burn event in two cases: `SELFDESTRUCT` to self by an in-tx-created contract with non-zero balance, and any non-zero-balance account marked for deletion at transaction finalization. Neither was previously priced. A new `BURN_LOG_COST = 1,381` constant (LOG2 equivalent: `375 + 2*375 + 32*8`) is added to the parameters table, and a new *Burn logs* bullet under *EVM gas schedule adjustments* prices both cases via a single charge at flagging time: per [EIP-6780](./eip-6780.md), an account is only flagged for deletion when SELFDESTRUCTed by a contract created in the same transaction, so charging `BURN_LOG_COST` once at any such SELFDESTRUCT covers whichever of the immediate self-burn or finalization-time burn ultimately emits (at most one per `SELFDESTRUCT`). The charge is applied unconditionally so all gas is paid before finalization, which runs after EVM gas accounting closes; the over-charge is bounded by `BURN_LOG_COST` per `SELFDESTRUCT`. The EIP-7708 interaction line is updated to enumerate both `TRANSFER_LOG_COST` and `BURN_LOG_COST` emission sites and to clarify that the two charges are independent and can both apply to a single `SELFDESTRUCT`. EIP-6780 is added to the `requires` preamble list to reflect the new normative dependency.
Collaborator
File
|
2 tasks
Client applications need information about transferring the ether rather than information about a contract being destroyed, so we should emit an event similar to |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Following the precedent set by #11493, which introduced
TRANSFER_LOG_COSTand documented the EIP-7708 LOG3 transfer-event cost in the EIP-2780 spec, this PR completes that pricing story by adding the remaining EIP-7708 emission sites:CREATEtransactions withvalue > 0: chargeTRANSFER_LOG_COSTat intrinsic level, since top-levelCREATEtxs do not payGAS_CREATE(it is opcode-only) and so have no slack to absorb the LOG3.CREATE/CREATE2with non-zero endowment: chargeTRANSFER_LOG_COSTat the endowment transfer, on top ofGAS_CREATE = 32,000. Pre-2780 the LOG3 cost was implicitly absorbed by the over-pricedGAS_CREATE; under the decomposed schedule we price the log explicitly.BURN_LOG_COST = 1,381, charged once at anySELFDESTRUCTwhose originator was created in the same transaction. This single charge covers both the immediate self-burn and the finalization-time burn cases.