Skip to content

chore(op-reth): remove op-reth dependencies from core reth library crates#21492

Merged
mattsse merged 1 commit intoparadigmxyz:mainfrom
theochap:push-mkrtuxxptrnm
Jan 28, 2026
Merged

chore(op-reth): remove op-reth dependencies from core reth library crates#21492
mattsse merged 1 commit intoparadigmxyz:mainfrom
theochap:push-mkrtuxxptrnm

Conversation

@theochap
Copy link
Contributor

@theochap theochap commented Jan 27, 2026

Note

Should make progress towards ethereum-optimism/optimism#18916

Summary

Removes direct dependencies on reth-optimism-primitives, reth-optimism-chainspec, and reth-storage-api from core reth library crates, replacing them with lighter upstream op-alloy-consensus types where needed. This reduces coupling between the base Ethereum client and the Optimism feature layer.

This is possible because the reth-optimism-primitives types used in these crates are thin wrappers over op-alloy-consensus:

  • reth_optimism_primitives::OpReceipt is a re-export of op_alloy_consensus::OpReceipt
  • reth_optimism_primitives::OpTransactionSigned is a type alias for op_alloy_consensus::OpTxEnvelope

Since these are not distinct types, the affected crates can depend on op-alloy-consensus directly instead of pulling in reth-optimism-primitives.

Changes per crate

  • reth-rpc-convert: Removed reth-optimism-primitives and reth-storage-api dependencies from the op feature. The try_into_op_tx_info helper (which required ReceiptProvider and DepositReceipt from op-reth) is moved out of this crate; the logic is inlined into crates/optimism/rpc/src/eth/transaction.rs where the op-reth context is already available. TryFromTransactionResponse and TryFromReceiptResponse impls now target the op-alloy-consensus types directly (OpTxEnvelope, OpReceipt).

  • reth-engine-local: Removed reth-optimism-chainspec dependency. The TX_SET_L1_BLOCK_OP_MAINNET_BLOCK_124665056 constant (only used in dev-mode payload building) is inlined as a local const instead of pulling in the entire optimism chainspec crate.

  • reth-db-api: Replaced reth-optimism-primitives with op-alloy-consensus in the op feature. The impl_compression_for_compact! invocations now reference OpTxEnvelope / OpReceipt from op-alloy-consensus directly.

  • reth-optimism-chainspec: Removed the now-unused TX_SET_L1_BLOCK_OP_MAINNET_BLOCK_124665056 constant and its hex import.

Test plan

  • CI passes (cargo +nightly clippy --workspace --all-features, cargo nextest run --workspace)
  • Existing optimism integration tests continue to pass
  • op feature gates still compile correctly across affected crates

🤖 Generated partly with Claude Code

/// <https://optimistic.etherscan.io/tx/0x312e290cf36df704a2217b015d6455396830b0ce678b860ebfcc30f41403d7b1>
pub const TX_SET_L1_BLOCK_OP_MAINNET_BLOCK_124665056: [u8; 251] = hex!(
"7ef8f8a0683079df94aa5b9cf86687d739a60a9b4f0835e520ec4d664e2e415dca17a6df94deaddeaddeaddeaddeaddeaddeaddeaddead00019442000000000000000000000000000000000000158080830f424080b8a4440a5e200000146b000f79c500000000000000040000000066d052e700000000013ad8a3000000000000000000000000000000000000000000000000000000003ef1278700000000000000000000000000000000000000000000000000000000000000012fdf87b89884a61e74b322bbcf60386f543bfae7827725efaaf0ab1de2294a590000000000000000000000006887246668a3b87f54deb3b94ba47a6f63f32985"
);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No reason to keep that one around

}
.unwrap_or_default();

Ok(OpTransactionInfo::new(tx_info, deposit_meta))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just inlined that method

impl TryFromTransactionResponse<op_alloy_network::Optimism>
for reth_optimism_primitives::OpTransactionSigned
{
impl TryFromTransactionResponse<op_alloy_network::Optimism> for op_alloy_consensus::OpTxEnvelope {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

OpTxEnvelope is a type alias of OpTransactionSigned

Comment on lines +75 to +81
/// Dummy system transaction for dev mode.
/// OP Mainnet transaction at index 0 in block 124665056.
///
/// <https://optimistic.etherscan.io/tx/0x312e290cf36df704a2217b015d6455396830b0ce678b860ebfcc30f41403d7b1>
const TX_SET_L1_BLOCK_OP_MAINNET_BLOCK_124665056: [u8; 251] = alloy_primitives::hex!(
"7ef8f8a0683079df94aa5b9cf86687d739a60a9b4f0835e520ec4d664e2e415dca17a6df94deaddeaddeaddeaddeaddeaddeaddeaddead00019442000000000000000000000000000000000000158080830f424080b8a4440a5e200000146b000f79c500000000000000040000000066d052e700000000013ad8a3000000000000000000000000000000000000000000000000000000003ef1278700000000000000000000000000000000000000000000000000000000000000012fdf87b89884a61e74b322bbcf60386f543bfae7827725efaaf0ab1de2294a590000000000000000000000006887246668a3b87f54deb3b94ba47a6f63f32985"
);
Copy link
Contributor

Choose a reason for hiding this comment

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

what's the purpose of always setting this dummy deposit tx?

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Jan 28, 2026
@mattsse mattsse added this pull request to the merge queue Jan 28, 2026
Merged via the queue into paradigmxyz:main with commit 88eb0be Jan 28, 2026
52 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Jan 28, 2026
theochap added a commit to ethereum-optimism/optimism that referenced this pull request Jan 29, 2026
theochap added a commit to ethereum-optimism/optimism that referenced this pull request Feb 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants