Skip to content

chore(spec-specs): EIP-8037 backports and refactors#10

Open
spencer-tb wants to merge 8 commits into
eips/amsterdam/eip-8037from
eips/amsterdam/eip-8037-spec-backports-and-refactors
Open

chore(spec-specs): EIP-8037 backports and refactors#10
spencer-tb wants to merge 8 commits into
eips/amsterdam/eip-8037from
eips/amsterdam/eip-8037-spec-backports-and-refactors

Conversation

@spencer-tb
Copy link
Copy Markdown
Owner

@spencer-tb spencer-tb commented Jun 2, 2026

🗒️ Description

Companion PR to ethereum#2901 (EIP-8037), addressing the backport/refactor review comments so the forks/osaka to forks/amsterdam diff shows only genuine EIP-8037 changes.

Backports

  • chore(spec-specs): move state fields to end of message call output (f04b6a4)
  • chore(spec-specs): backport intrinsic gas cost dataclass (5f1b567)
    • Replaces the (intrinsic_gas, calldata_floor) tuple from calculate_intrinsic_cost/validate_transaction with an IntrinsicGasCost dataclass in the tuple returning forks (Prague, Osaka, BPO1 to BPO5), mirroring amsterdam minus its state field. Resolves review comment.
  • chore(spec-specs): backport calculate message call gas keyword arguments (be445af)
    • Converts the call() invocation of calculate_message_call_gas from positional to keyword arguments across Tangerine Whistle to BPO5, so amsterdam's switch to keyword form reads as a value only diff. Resolves review comment.
  • chore(spec-specs): add generic call params dataclass for generic call (97e342e)
    • Bundles generic_call's long positional argument list into a per fork GenericCallParams dataclass across all 24 forks. Resolves review comment.

Refactors

  • chore(spec-specs): inline the sstore state gas constant (5f3144d)
    • Drops the redundant state_gas_storage_set local in sstore and uses StateGasCosts.STORAGE_SET directly (amsterdam only). Resolves review comment (and suggestion).
  • chore(spec-specs): split sstore regular and state gas (ade3f44)
    • Separates sstore's state gas updates into their own if stack and lifts credit_state_gas_refund out of the nested refund branch (amsterdam only). Resolves review comment.
  • chore(spec-specs): trim state gas costs docstring (3754685)
    • Moves the "patched at runtime" implementation detail out of the StateGasCosts docstring into a comment above the class (amsterdam only). Resolves review comment.

Explicitly Unchanged

Merging charge_state_gas into charge_gas? Should the two functions be folded into a single charge_gas(evm, *, regular, state)?

The decision was to keep it as 2 separate functions so each function emits its own EIP-3155 trace event GasAndRefund & StateGasAndRefund. We can reopen this question once tracing is consolidated in a follow up PR.

🔗 Related Issues or PRs

N/A.

✅ Checklist

  • All: Ran fast static checks to avoid unnecessary CI fails, see also Code Standards and Enabling Pre-commit Checks:
    just static
  • All: PR title adheres to the repo standard - it will be used as the squash commit message and should start type(scope):.
  • All: Considered updating the online docs in the ./docs/ directory.
  • All: Set appropriate labels for the changes (only maintainers can apply labels).

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

spencer-tb and others added 7 commits June 2, 2026 12:25
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
Co-authored-by: Sam Wilson <57262657+SamWilsn@users.noreply.github.com>
@spencer-tb spencer-tb self-assigned this Jun 2, 2026
@spencer-tb spencer-tb force-pushed the eips/amsterdam/eip-8037-spec-backports-and-refactors branch from 0d8b8b9 to 3754685 Compare June 2, 2026 19:10
memory_output_size: U256,
) -> None:
@dataclass
class GenericCallParams:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about just GenericCall?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me! :D

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed!

is_static=True if is_staticcall else evm.message.is_static,
code_address=params.code_address,
should_transfer_value=params.should_transfer_value,
is_static=True if params.is_staticcall else evm.message.is_static,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
is_static=True if params.is_staticcall else evm.message.is_static,
is_static=params.is_staticcall or evm.message.is_static,

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pushed!

@spencer-tb spencer-tb force-pushed the eips/amsterdam/eip-8037-spec-backports-and-refactors branch from 337a502 to 35db224 Compare June 3, 2026 09:20
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.

2 participants