Skip to content

Update EIP-2780: Add missing 7708 log costs#11586

Open
danceratopz wants to merge 3 commits intoethereum:masterfrom
danceratopz:2780-add-missing-transfer-log-costs
Open

Update EIP-2780: Add missing 7708 log costs#11586
danceratopz wants to merge 3 commits intoethereum:masterfrom
danceratopz:2780-add-missing-transfer-log-costs

Conversation

@danceratopz
Copy link
Copy Markdown
Member

Following the precedent set by #11493, which introduced TRANSFER_LOG_COST and 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:

  • Top-level CREATE transactions with value > 0: charge TRANSFER_LOG_COST at intrinsic level, since top-level CREATE txs do not pay GAS_CREATE (it is opcode-only) and so have no slack to absorb the LOG3.
  • In-EVM CREATE / CREATE2 with non-zero endowment: charge TRANSFER_LOG_COST at the endowment transfer, on top of GAS_CREATE = 32,000. Pre-2780 the LOG3 cost was implicitly absorbed by the over-priced GAS_CREATE; under the decomposed schedule we price the log explicitly.
  • Burn logs (LOG2): introduce BURN_LOG_COST = 1,381, charged once at any SELFDESTRUCT whose originator was created in the same transaction. This single charge covers both the immediate self-burn and the finalization-time burn cases.

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.
@danceratopz danceratopz requested a review from eth-bot as a code owner April 30, 2026 09:41
@github-actions github-actions Bot added c-update Modifies an existing proposal s-draft This EIP is a Draft t-core labels Apr 30, 2026
@eth-bot
Copy link
Copy Markdown
Collaborator

eth-bot commented Apr 30, 2026

File EIPS/eip-2780.md

Requires 1 more reviewers from @anderselowsson, @benaadams, @lightclient, @misilva73, @sassal, @uriklarman

@abc-123-c
Copy link
Copy Markdown

  • Burn logs (LOG2): introduce BURN_LOG_COST = 1,381, charged once at any SELFDESTRUCT whose originator was created in the same transaction. This single charge covers both the immediate self-burn and the finalization-time burn cases.

Client applications need information about transferring the ether rather than information about a contract being destroyed, so we should emit an event similar to CALL when the value is greater than 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a-review Waiting on author to review c-update Modifies an existing proposal s-draft This EIP is a Draft t-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants