Skip to content

Reinstate removed IGasPolicy methods and apply for eip-8037#10897

Open
damian-orzechowski wants to merge 9 commits intomasterfrom
refactor/eip8037-gas-policy
Open

Reinstate removed IGasPolicy methods and apply for eip-8037#10897
damian-orzechowski wants to merge 9 commits intomasterfrom
refactor/eip8037-gas-policy

Conversation

@damian-orzechowski
Copy link
Contributor

Fixes Closes Resolves #

PR #10697 removed some IGasPolicy methods which when overriden can be used to apply muli-dimentional gas tracking (e.g. Arbitrum). Replacing them with generic UpdateGasCost methods removes the context of the gas cost and makes it difficult to attribute correct gas type.

Changes

These changes re-add removed method and apply changes for EIP-8037 inside the gas policy:

  • ConsumeStorageWrite
  • ConsumeNewAccountCreation

Types of changes

What types of changes does your code introduce?

  • Bugfix (a non-breaking change that fixes an issue)
  • New feature (a non-breaking change that adds functionality)
  • Breaking change (a change that causes existing functionality not to work as expected)
  • Optimization
  • Refactoring
  • Documentation update
  • Build-related changes
  • Other: Description

Testing

Requires testing

  • Yes
  • No

If yes, did you write tests?

  • Yes
  • No

Notes on testing

Documentation

Requires documentation update

  • Yes
  • No

Requires explanation in Release Notes

  • Yes
  • No

Remarks

Required for 1.37.0 release of Arbitrum Plugin

@damian-orzechowski damian-orzechowski marked this pull request as ready for review March 20, 2026 11:15
@LukaszRozmej
Copy link
Member

tests do fail

@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

EVM Opcode Benchmark Diff

Aggregated runs: base=1, pr=1

No significant regressions or improvements detected.

@damian-orzechowski
Copy link
Contributor Author

tests do fail

Should be fixed now

Comment on lines +203 to +208
(isSlotCreation: TIsSlotCreation.IsActive, isEip8037: TEip8037.IsActive) switch
{
(isSlotCreation: true, isEip8037: true) => ConsumeStateGas(ref gas, GasCostOf.SSetState) && UpdateGas(ref gas, GasCostOf.SSetRegular),
(isSlotCreation: true, isEip8037: false) => UpdateGas(ref gas, GasCostOf.SSet),
(isSlotCreation: false, _) => UpdateGas(ref gas, spec.GasCosts.SStoreResetCost)
};
Copy link
Member

Choose a reason for hiding this comment

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

@benaadams would JIT optimize this?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants