Skip to content

feat(fork-types): add RegularGas and StateGas NewType wrappers to ams…#3121

Open
mandeepmourya007 wants to merge 1 commit into
ethereum:forks/amsterdamfrom
mandeepmourya007:refactor/gas-newtypes
Open

feat(fork-types): add RegularGas and StateGas NewType wrappers to ams…#3121
mandeepmourya007 wants to merge 1 commit into
ethereum:forks/amsterdamfrom
mandeepmourya007:refactor/gas-newtypes

Conversation

@mandeepmourya007

Copy link
Copy Markdown
Contributor

Description

Applies the RegularGas and StateGas NewType wrappers (introduced in
fork_types.py by #3037) to all EVM gas fields and constants across the
amsterdam fork, preventing accidental mixing of state-gas with regular-gas
at the type level.

Changes:

  • All GasCosts constants typed as RegularGas; StateGasCosts already typed as StateGas
  • Evm.gas_left, state_gas_left, regular_gas_used, state_gas_spilled typed
  • Message.gas, state_gas_reservoir and TransactionEnvironment fields typed
  • MessageCallOutput and GenericCall gas fields typed
  • max_message_call_gas and calculate_delegation_cost return types updated to RegularGas

Related Issues or PRs

Closes #3015. Follows on from #3037.

Checklist

  • Ran fast static checks to avoid CI fails, see Code Standards & Verifying Changes: just static
  • PR title has the form <type>(<area>): <title>, where <type> and <area> come from an appropriate C-<type>, respectively A-<area>, label. The title should match the target squash commit message.

Cute Animal Picture

Typing cat

…terdam EVM

Applies the RegularGas and StateGas NewType wrappers (introduced in
fork_types.py) to all EVM gas fields and constants across the amsterdam
fork, preventing accidental mixing of state-gas with regular-gas.

- Types all GasCosts constants, ExtendMemory.cost, MessageCallGas fields
- Types Evm.gas_left/state_gas_left/regular_gas_used/state_gas_spilled
- Types Message.gas/state_gas_reservoir and TransactionEnvironment fields
- Types MessageCallOutput gas fields and GenericCall parameters
- Updates max_message_call_gas and calculate_delegation_cost return types

Closes ethereum#3015
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.

Add newtype wrappers for StateGas and RegularGas

1 participant