refactor: move OP EVM code into alloy-op-evm newtypes#19533
Closed
theochap wants to merge 1 commit intoethereum-optimism:developfrom
Closed
refactor: move OP EVM code into alloy-op-evm newtypes#19533theochap wants to merge 1 commit intoethereum-optimism:developfrom
theochap wants to merge 1 commit intoethereum-optimism:developfrom
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
theochap
commented
Mar 13, 2026
theochap
commented
Mar 13, 2026
theochap
commented
Mar 13, 2026
Introduce OpTx and OpTxError newtype wrappers in alloy-op-evm to hold all OP-specific EVM implementations that were previously in alloy-evm's `op` module. This satisfies Rust's orphan rule while decoupling alloy-evm from Optimism-specific dependencies. Changes: - Add OpTx newtype wrapping OpTransaction<TxEnv> with all necessary trait impls (Transaction, TransactionEnv, FromRecoveredTx, FromTxWithEncoded, IntoTxEnv, OpTxEnv, TryIntoTxEnv) - Add OpTxError newtype wrapping OpTransactionError with InvalidTxError and map_op_err helper - Move spec ID mapping and EvmEnv constructors as free functions (evm_env_for_op_block, evm_env_for_op_next_block, evm_env_for_op_payload) - Add rpc module with TryIntoTxEnv<OpTx> for OpTransactionRequest - Update all downstream crates (op-reth, kona, custom-node example) - Remove alloy-evm "op" feature usage from kona crates Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
d0717ee to
cf8487f
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.
Summary
OpTxandOpTxErrornewtype wrappers in alloy-op-evm to hold all OP-specific EVM implementations previously in alloy-evm'sopmoduleEvmEnvconstructors as free functions (evm_env_for_op_block,evm_env_for_op_next_block)TryIntoTxEnv<OpTx>forOpTransactionRequestbehindrpcfeatureTransactionEnvimpl forOpTxbehindrethfeaturealloy-evmopfeature usage from kona cratesThis is the companion PR to alloy-rs/evm#312 which removes the OP-specific code from alloy-evm. Together they decouple alloy-evm from Optimism, using newtype wrappers to satisfy Rust's orphan rule.
Test plan
cargo clippypasses with no warningscargo test -p alloy-op-evm— 24 tests passcargo checkpasses🤖 Generated with Claude Code