Skip to content

refactor: clarify EIP-7702 regular-gas GasId names - #3725

Merged
rakita merged 2 commits into
mainfrom
fixes
Jun 29, 2026
Merged

rakita merged 2 commits into
mainfrom
fixes

Conversation

@rakita

@rakita rakita commented May 27, 2026

Copy link
Copy Markdown
Member

Summary

Addresses the confusing overlap where GasId::tx_eip7702_per_empty_account_cost() returns the regular (non-state) cost while GasParams::tx_eip7702_per_empty_account_cost() returns the total (regular + state). The GasId accessors are renamed to say what the table slot actually holds; the GasParams total-returning methods keep their names.

GasId (slot = regular portion) GasParams method (returns total)
tx_eip7702_per_empty_account_cost() → tx_eip7702_regular_gas() tx_eip7702_per_empty_account_cost() (unchanged)
tx_eip7702_auth_refund() → tx_eip7702_regular_refund() tx_eip7702_auth_refund() (unchanged)

The name() / from_name() string keys are renamed to match ("tx_eip7702_regular_gas", "tx_eip7702_regular_refund"), and the doc comments now spell out the regular-vs-total split and cross-link the GasParams methods.

Also drops the unused reservoir parameter from Handler::last_frame_result (and the inspector's call site).

Breaking change

The gas-override string keys changed: anyone overriding by name must switch from "tx_eip7702_per_empty_account_cost" / "tx_eip7702_auth_refund" to "tx_eip7702_regular_gas" / "tx_eip7702_regular_refund".

Testing

  • cargo build --workspace — clean
  • cargo test -p revm-context-interface --lib gas_params — 5 passed (incl. name/from_name round-trip coverage)

Rename the GasId table-slot accessors so they read as the regular
(non-state) portion they store, distinct from the GasParams methods of
the same name that return the combined total:

  GasId::tx_eip7702_per_empty_account_cost -> tx_eip7702_regular_gas
  GasId::tx_eip7702_auth_refund            -> tx_eip7702_regular_refund

The GasParams::tx_eip7702_per_empty_account_cost / tx_eip7702_auth_refund
methods (which sum regular + state gas) keep their names. The name() /
from_name() string keys are renamed to match.

Also drop the unused reservoir parameter from Handler::last_frame_result.
@codspeed

codspeed Bot commented May 27, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 176 untouched benchmarks
⏩ 1 skipped benchmark1


Comparing fixes (c727ad0) with main (e549d0b)

Open in CodSpeed

Footnotes

  1. 1 benchmark was skipped, so the baseline result was used instead. If it was deleted from the codebase, click here and archive it to remove it from the performance reports. ↩

Have tx_eip7702_state_gas delegate to tx_eip7702_state_refund(1, 1) and
generalize the latter's parameter names (refunded_* -> num_*) so it reads
as a shared primitive for both the pessimistic per-auth charge and the
per-transaction state-gas refund.
@rakita

rakita commented Jun 29, 2026

Copy link
Copy Markdown
Member Author

Fn rename

@rakita
rakita merged commit 0d4112b into main Jun 29, 2026
34 checks passed
This was referenced Jun 29, 2026
This was referenced Jul 22, 2026
RealiCZ added a commit to megaeth-labs/revm that referenced this pull request Sep 16, 2026
@RealiCZ RealiCZ mentioned this pull request Sep 18, 2026
43 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant