refactor: move OP EVM code into alloy-op-evm newtypes#19536
Merged
refactor: move OP EVM code into alloy-op-evm newtypes#19536
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try using Wiz Code VS Code Extension. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #19536 +/- ##
===========================================
Coverage 75.3% 75.3%
===========================================
Files 194 485 +291
Lines 11276 60694 +49418
===========================================
+ Hits 8493 45735 +37242
- Misses 2639 14959 +12320
+ Partials 144 0 -144
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
cf8487f to
f441447
Compare
wwared
approved these changes
Mar 13, 2026
sebastianst
approved these changes
Mar 16, 2026
f441447 to
676e25d
Compare
Member
Author
|
Last commit moves the newtype to kona and op-reth to remove the dependency of alloy-op-evm on reth. We need to make the OpEvmFactory generic over the transaction type |
4f845f0 to
f2fe1e3
Compare
f2fe1e3 to
4506d7a
Compare
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>
4506d7a to
c85490d
Compare
c85490d to
b9c5431
Compare
ClaytonNorthey92
pushed a commit
to hemilabs/optimism
that referenced
this pull request
Mar 19, 2026
…ism#19536) * refactor: move OP-specific EVM code into alloy-op-evm newtypes 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> * chore(rust): move newtypes to op-reth and kona --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
ClaytonNorthey92
pushed a commit
to hemilabs/optimism
that referenced
this pull request
Mar 23, 2026
…ism#19536) * refactor: move OP-specific EVM code into alloy-op-evm newtypes 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> * chore(rust): move newtypes to op-reth and kona --------- Co-authored-by: Claude Opus 4.6 <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.
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