Separate precompile gas cost calculation and runtime implementation#2099
Merged
goodlyrottenapple merged 1 commit intomainfrom Mar 27, 2026
Merged
Separate precompile gas cost calculation and runtime implementation#2099goodlyrottenapple merged 1 commit intomainfrom
goodlyrottenapple merged 1 commit intomainfrom
Conversation
7c36bfe to a866e05 Compare 6516285 to 87648e4 Compare 36dda45 to 9f61a8b Compare e51a8ef to 051bd44 Compare fb9191e to 7f38537 Compare 87648e4 to cdcbe9e Compare There was a problem hiding this comment.
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.txtto 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.
cdcbe9e to 4670b0b Compare 4670b0b to fb0593a Compare Baltoli approved these changes Mar 26, 2026
dhil approved these changes Mar 26, 2026
mkolosick approved these changes Mar 26, 2026
fb0593a to cf0cfab Compare This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #2098
More prep-work for zkVM compilation. This will allow us to conditionally compile
precompiles_impl.cppfor x86 only and supply an alternativeprecompiles_impl.cppfor the different zkVMs, whilst always compilingprecompiles_gas_cost_impl.cppfor all targets.