Skip to content

Separate precompile gas cost calculation and runtime implementation#2099

Merged
goodlyrottenapple merged 1 commit intomainfrom
sam/precompile_costs_reorg
Mar 27, 2026
Merged

Separate precompile gas cost calculation and runtime implementation#2099
goodlyrottenapple merged 1 commit intomainfrom
sam/precompile_costs_reorg

Conversation

@goodlyrottenapple
Copy link
Copy Markdown
Contributor

Depends on #2098

More prep-work for zkVM compilation. This will allow us to conditionally compile precompiles_impl.cpp for x86 only and supply an alternative precompiles_impl.cpp for the different zkVMs, whilst always compiling precompiles_gas_cost_impl.cpp for all targets.

@goodlyrottenapple goodlyrottenapple force-pushed the sam/precompile_costs_remove_silkpre branch 2 times, most recently from 7c36bfe to a866e05 Compare February 27, 2026 11:56
@goodlyrottenapple goodlyrottenapple force-pushed the sam/precompile_costs_reorg branch from 6516285 to 87648e4 Compare February 27, 2026 11:57
@goodlyrottenapple goodlyrottenapple force-pushed the sam/precompile_costs_remove_silkpre branch 3 times, most recently from 36dda45 to 9f61a8b Compare March 4, 2026 11:06
@goodlyrottenapple goodlyrottenapple force-pushed the sam/precompile_costs_remove_silkpre branch 5 times, most recently from e51a8ef to 051bd44 Compare March 19, 2026 09:59
@goodlyrottenapple goodlyrottenapple marked this pull request as draft March 19, 2026 09:59
@goodlyrottenapple goodlyrottenapple force-pushed the sam/precompile_costs_remove_silkpre branch 11 times, most recently from fb9191e to 7f38537 Compare March 26, 2026 08:12
Base automatically changed from sam/precompile_costs_remove_silkpre to main March 26, 2026 13:09
@goodlyrottenapple goodlyrottenapple force-pushed the sam/precompile_costs_reorg branch from 87648e4 to cdcbe9e Compare March 26, 2026 14:40
@goodlyrottenapple goodlyrottenapple marked this pull request as ready for review March 26, 2026 15:49
Copilot AI review requested due to automatic review settings March 26, 2026 15:49
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors precompile logic to separate gas cost calculation from runtime execution, enabling gas-cost code to be built for all targets (including zkVM guests) while leaving execution implementations target-specific (e.g., x86-only).

Changes:

  • Introduces dedicated gas-cost implementation TUs for Ethereum and Monad precompiles.
  • Removes gas-cost logic from precompiles_impl.cpp, leaving it focused on execution/runtime.
  • Updates category/execution/CMakeLists.txt to compile the new gas-cost implementation files.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
category/execution/monad/monad_precompiles_gas_cost_impl.cpp Adds Monad-specific precompile gas-cost implementations (pricing-factor adjusted).
category/execution/ethereum/precompiles_impl.cpp Removes gas-cost helpers/templates from the runtime execution implementation file.
category/execution/ethereum/precompiles_gas_cost_impl.cpp Adds Ethereum precompile gas-cost implementations previously embedded in precompiles_impl.cpp.
category/execution/CMakeLists.txt Wires new gas-cost implementation files into the build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@goodlyrottenapple goodlyrottenapple force-pushed the sam/precompile_costs_reorg branch from cdcbe9e to 4670b0b Compare March 26, 2026 16:14
@Baltoli Baltoli force-pushed the sam/precompile_costs_reorg branch from 4670b0b to fb0593a Compare March 26, 2026 16:54
@Baltoli Baltoli requested review from dhil and mkolosick March 26, 2026 16:54
@goodlyrottenapple goodlyrottenapple force-pushed the sam/precompile_costs_reorg branch from fb0593a to cf0cfab Compare March 26, 2026 18:02
@goodlyrottenapple goodlyrottenapple merged commit 4772a0c into main Mar 27, 2026
14 checks passed
@goodlyrottenapple goodlyrottenapple deleted the sam/precompile_costs_reorg branch March 27, 2026 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

5 participants