# Notes for EVM Repricing Workgroup (15th January 2025)
## Summary
The meeting focused on resource pricing strategies for Ethereum, with discussions on short-term and medium to long-term changes.
- Marek presented a gas pricing tool that identified significant differences in gas costs across clients, highlighting bottlenecks.
- Jacek Glen shared a gas cost estimator project, proposing adjustments to opcode and precompile costs.
- Ansgar Dietrichs discussed potential repricing strategies, emphasizing the need for metrics to assess real-world impacts.
- The group considered the implications of gas smuggling and state repricing, with Toni Wahrstätter suggesting [block-level state warming](https://github.com/ethereum/EIPs/pull/9246) could yield up to 15% efficiency gains.
The meeting concluded with plans to further explore these topics in future sessions.
## Action Items
- [ ] Jacek Glen from Imapp to share the updated results for Gas Cost Estimator
- [ ] (unassigned) to explore the impact of different repricing approaches on Mainnet transaction throughput
- [ ] (unassigned) to prepare a EIP proposal for adjusting the pricing of one or more operations based on the benchmark results
- [ ] Possibly Marek / Ben Adams from Nethermind to investigate the feasibility and implications of using gas smuggling to decouple gas refunds from block gas usage
- [ ] Davide Crapis to schedule follow-up call to discuss medium-term gas pricing roadmap
- [x] Toni Wahrstätter to share his work on block-level state warming
# Outline
## Formation and Purpose of the Working Group
- Davide Crapis introduces the working group, explaining its origins and focus on resource pricing, particularly in the context of short-term pricing changes and multi-dimensional pricing mechanisms.
- The group aims to apply research to practical scenarios, with a plan to discuss benchmarking work and short-term changes that could be implemented in upcoming forks.
- The meeting's agenda includes presentations on initial analysis and multi-dimensional pricing mechanisms, with a focus on keeping discussions concrete and actionable.
- The goal is to draft EIPs for short-term changes and eventually work towards more ambitious multi-dimensional changes.
## Marek's Presentation on Gas Pricing Tooling
- Marek presents a [tool developed at Nethermind for gas pricing](https://github.com/NethermindEth/gas-benchmarks), which can be used for benchmarking and testing gas limits.
- The tool measures the execution time of blocks and can identify bottlenecks, using Engine API requests to simulate real-world scenarios.
- Marek highlights the benefits and limitations of the tool, noting that it is less accurate than language-specific benchmarking tools but can still provide valuable insights.
- The tool has identified significant differences in gas pricing across clients, which could impact gas limits on L1 and Ethereum-based L2 systems.
## Discussion on Tooling and Analysis Findings
- Davide Crapis asks Marek about plans to propose changes based on the analysis findings.
- Marek confirms that some issues have been addressed between client teams and mentions an upcoming EIP to adjust the cost of a specific operation that was significant.
- Ameziane Hamlat thanks Marek for the presentation and shares that their team used the tool to reproduce and improve opcodes, addressing issues raised by the Nethermind report.
## Imapp Gas Cost Estimator Project
- Jacek Glen presents the [gas cost estimator project](https://github.com/imapp-pl/gas-cost-estimator), which tests EVM implementations in isolation using specific language native tools.
- The project involves generating 50,000 bytecode programs to test opcodes and precompiles under various conditions, with results normalized to current gas costs.
- Jacek shares preliminary findings, proposing adjustments to opcode costs based on computational expense, with a focus on arithmetic opcodes and precompiles.
- The group discusses the implications of these proposals, including potential impacts on block size and storage costs.
## Short-Term Pricing Changes and Repricing Strategy
- Ansgar Dietrichs introduces the topic of short-term pricing changes, focusing on the strategy for the next few hard forks and specific changes for the upcoming forks.
- The group discusses the goals of the initial repricing effort, including harmonizing compute costs and potentially allowing for more compute in the block.
- Concerns are raised about the potential increase in block size and the need to balance compute costs with storage costs.
- The group considers different approaches to repricing, including using [fractional gas costs](https://eips.ethereum.org/EIPS/eip-2045) and increasing the gas limit to offset changes in non-compute operations.
- There was soft consensus that fractional gas or particle gas, might be too radical of a change.
- There was also a suggestion to rebase the price of opcodes to 1 gas, ie the minimum gas unit would be 1 gas and everything else is scaled up from that
## Backwards Compatibility and Impact on Legacy Contracts
- Ansgar Dietrichs raises the issue of backwards compatibility and the potential impact on legacy contracts with hard-coded gas values.
- The group discusses the challenges of analyzing the breadth of mainnet contracts and the potential risks of breaking existing contracts.
- Ansgar notes that it is not possible to exhaustively check whether a gas reprice will break a contract because there might be code that branches on the gas price.
- Ben Adams and others express concerns about increasing prices and the potential for unexpected out-of-gas issues.
- The group agrees that while backwards compatibility should be considered, the focus should be on understanding the real-world impact of pricing changes.
## Exploring EOF-Specific Pricing Changes
- The group discusses the potential for limiting pricing changes to newly introduced EOF contracts to incentivize adoption
- Danno Ferrin highlights the benefits of EOF in reducing gas introspection and the potential for easier pricing changes
- The group considers the trade-offs of limiting changes to EOF, including the risk of slowing down the ecosystem's transition to EOF.
- The consensus leans towards applying pricing changes to both legacy and EOF contracts to maximize throughput improvements.
## Gas Smuggling and State Repricing
- Ben Adams explains the [concept of gas smuggling](https://eips.ethereum.org/EIPS/eip-7778) and its impact on block gas usage, suggesting changes to reduce the impact of refunds on block limits.
- The group discusses the potential benefits and theoretical implications of gas smuggling, with [Barnabe's analysis](https://ethresear.ch/t/block-level-fee-markets-four-easy-pieces/21448) noted as a reference.
- Toni Wahrstätter summarizes his work on [block-level state warming](https://github.com/ethereum/EIPs/pull/9246), which could provide efficiency gains by treating state slots as warm if they have been touched in previous transactions.
- The group considers the potential for multi-block warming and its impact on throughput, with Paweł Bylica raising concerns about the accounting changes.
## Next Steps and Closing Remarks
- The group acknowledges the need for further discussion and tooling to understand the real-world impact of proposed pricing changes.
- Ansgar Dietrichs emphasizes the importance of metrics in informing decisions and suggests scheduling another call to delve deeper into medium-term changes.
- Davide Crapis confirms plans to schedule a follow-up call to continue the discussion.
- The meeting concludes with a reminder to consider pricing for ZK proving as part of the long-term strategy.