Conversation
Merging this PR will improve performance by 4.91%Summary
Performance Changes
Comparing |
196e6da to
92c6a93
Compare
883898f to
a552ff9
Compare
klkvr
reviewed
Dec 18, 2025
Comment on lines
+69
to
+71
| /// Returns `EthInstructions` with mainnet spec. | ||
| pub fn new_mainnet_with_spec(spec: SpecId) -> Self { | ||
| Self::new(instruction_table_gas_changes_spec(spec), spec) |
Collaborator
There was a problem hiding this comment.
can this take GasParams as input? so that all instructions have direct access to it without expecting Host to provide it
Member
Author
There was a problem hiding this comment.
It does not work like that, instructions have access to context and interpreter
d733681 to
eb14b9c
Compare
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
17a072d to
536cfb1
Compare
Merged
theochap
pushed a commit
to ethereum-optimism/optimism
that referenced
this pull request
Jan 21, 2026
* feat: move GasParams to Cfg * propagate spec id * use cfg spec when evm is created * nits * nit * doc tests * use derive-where to skip fn * Move SetSpecTr and use it as main tr * remove SetSpecTr, introduce is_custom_gas_param flag * simplification * nits and tests fix * morf spec type * dont compare ptr * import fix * typo * ref alloy-eips * add core::error::Error impl to BalError 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * send/sync on GasParams * relex generic for some Cfg functions --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
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.
Moves GasParams to the
Cfgso that it can be accessed with Context easily from instructions. GasParams is removed from Frame/Interpreter.Gas calculation stuff is moved from Interpreter to cfg.
CfgEnv functions now require setting gas_params and
CfgEnv::with_specgot deprecated and it is pointing towith_spec_and_mainnet_gas_paramsas alternative.Performance boost is because the first time initialisation of Precompiles was inside codspeed scope, with this PR this is moved outside, and simple check if spec is same is done there. Precompiles is still initialised only once, but now outside of codspeed.