chore: rm reth-primitives from optimism (#15064)

This commit is contained in:
Matthias Seitz
2025-03-15 14:56:33 +01:00
committed by GitHub
parent 023aad93f8
commit 6193729e7d
15 changed files with 21 additions and 29 deletions

View File

@@ -14,6 +14,7 @@ workspace = true
reth-static-file-types = { workspace = true, features = ["clap"] }
reth-cli-commands.workspace = true
reth-consensus.workspace = true
reth-primitives-traits.workspace = true
reth-db = { workspace = true, features = ["mdbx", "op"] }
reth-db-api.workspace = true
reth-db-common.workspace = true
@@ -25,7 +26,6 @@ reth-static-file.workspace = true
reth-execution-types.workspace = true
reth-node-core.workspace = true
reth-optimism-node.workspace = true
reth-primitives.workspace = true
reth-fs-util.workspace = true
# so jemalloc metrics can be included
@@ -76,7 +76,6 @@ asm-keccak = [
"alloy-primitives/asm-keccak",
"reth-node-core/asm-keccak",
"reth-optimism-node/asm-keccak",
"reth-primitives/asm-keccak",
]
# Jemalloc feature for vergen to generate correct env vars
@@ -98,4 +97,5 @@ serde = [
"reth-execution-types/serde",
"reth-provider/serde",
"reth-optimism-primitives/serde",
"reth-primitives-traits/serde",
]

View File

@@ -16,7 +16,7 @@ use reth_node_builder::ReceiptTy;
use reth_node_core::version::SHORT_VERSION;
use reth_optimism_chainspec::OpChainSpec;
use reth_optimism_primitives::{bedrock::is_dup_tx, OpPrimitives, OpReceipt};
use reth_primitives::NodePrimitives;
use reth_primitives_traits::NodePrimitives;
use reth_provider::{
providers::ProviderNodeTypes, writer::UnifiedStorageWriter, DatabaseProviderFactory,
OriginalValuesKnown, ProviderFactory, StageCheckpointReader, StageCheckpointWriter,

View File

@@ -9,7 +9,7 @@ use reth_optimism_primitives::{
bedrock::{BEDROCK_HEADER, BEDROCK_HEADER_HASH, BEDROCK_HEADER_TTD},
OpPrimitives,
};
use reth_primitives::SealedHeader;
use reth_primitives_traits::SealedHeader;
use reth_provider::{
BlockNumReader, ChainSpecProvider, DatabaseProviderFactory, StaticFileProviderFactory,
StaticFileWriter,

View File

@@ -1,13 +1,13 @@
//! Codec for reading raw receipts from a file.
use alloy_consensus::Receipt;
use alloy_primitives::{
bytes::{Buf, BytesMut},
Address, Bloom, Bytes, B256,
Address, Bloom, Bytes, Log, B256,
};
use alloy_rlp::{Decodable, RlpDecodable};
use op_alloy_consensus::{OpDepositReceipt, OpTxType};
use reth_optimism_primitives::OpReceipt;
use reth_primitives::{Log, Receipt};
use tokio_util::codec::Decoder;
use reth_downloaders::{file_client::FileClientError, receipt_file_client::ReceiptWithBlockNumber};

View File

@@ -15,7 +15,6 @@ workspace = true
reth-chainspec.workspace = true
reth-db = { workspace = true, features = ["op"] }
reth-engine-local = { workspace = true, features = ["op"] }
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-payload-builder.workspace = true
reth-payload-util.workspace = true
@@ -93,7 +92,6 @@ futures.workspace = true
[features]
default = ["reth-codec"]
asm-keccak = [
"reth-primitives/asm-keccak",
"alloy-primitives/asm-keccak",
"revm/asm-keccak",
"reth-optimism-node/asm-keccak",
@@ -113,7 +111,6 @@ test-utils = [
"reth-evm/test-utils",
"reth-network/test-utils",
"reth-payload-builder/test-utils",
"reth-primitives/test-utils",
"reth-revm/test-utils",
"reth-db/test-utils",
"reth-provider/test-utils",
@@ -125,6 +122,5 @@ test-utils = [
"reth-trie-common/test-utils",
]
reth-codec = [
"reth-primitives/reth-codec",
"reth-optimism-primitives/reth-codec",
]

View File

@@ -23,7 +23,7 @@ use reth_optimism_payload_builder::{
OpBuiltPayload, OpExecutionPayloadValidator, OpPayloadBuilderAttributes,
};
use reth_optimism_primitives::{OpBlock, OpPrimitives, ADDRESS_L2_TO_L1_MESSAGE_PASSER};
use reth_primitives::{RecoveredBlock, SealedBlock};
use reth_primitives_traits::{RecoveredBlock, SealedBlock};
use reth_provider::StateProviderFactory;
use reth_trie_common::{HashedPostState, KeyHasher};
use std::sync::Arc;

View File

@@ -838,8 +838,8 @@ pub struct OpNetworkPrimitives;
impl NetworkPrimitives for OpNetworkPrimitives {
type BlockHeader = alloy_consensus::Header;
type BlockBody = reth_primitives::BlockBody<OpTransactionSigned>;
type Block = reth_primitives::Block<OpTransactionSigned>;
type BlockBody = alloy_consensus::BlockBody<OpTransactionSigned>;
type Block = alloy_consensus::Block<OpTransactionSigned>;
type BroadcastedTransaction = OpTransactionSigned;
type PooledTransaction = OpPooledTransaction;
type Receipt = OpReceipt;

View File

@@ -1,6 +1,6 @@
//! Node builder test that customizes priority of transactions in the block.
use alloy_consensus::{SignableTransaction, TxEip1559};
use alloy_consensus::{transaction::Recovered, SignableTransaction, TxEip1559};
use alloy_genesis::Genesis;
use alloy_network::TxSignerSync;
use alloy_primitives::{Address, ChainId, TxKind};
@@ -33,7 +33,6 @@ use reth_payload_util::{
BestPayloadTransactions, PayloadTransactions, PayloadTransactionsChain,
PayloadTransactionsFixed,
};
use reth_primitives::Recovered;
use reth_provider::providers::BlockchainProvider;
use reth_tasks::TaskManager;
use reth_transaction_pool::PoolTransaction;

View File

@@ -14,7 +14,6 @@ workspace = true
[dependencies]
# reth
reth-chainspec.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-revm = { workspace = true, features = ["witness"] }
reth-transaction-pool.workspace = true

View File

@@ -29,7 +29,7 @@ use reth_optimism_txpool::OpPooledTx;
use reth_payload_builder_primitives::PayloadBuilderError;
use reth_payload_primitives::PayloadBuilderAttributes;
use reth_payload_util::{BestPayloadTransactions, NoopPayloadTransactions, PayloadTransactions};
use reth_primitives::{transaction::SignedTransaction, NodePrimitives, SealedHeader, TxTy};
use reth_primitives_traits::{NodePrimitives, SealedHeader, SignedTransaction, TxTy};
use reth_provider::{ProviderError, StateProvider, StateProviderFactory};
use reth_revm::{
cancelled::CancelOnDrop, database::StateProviderDatabase, db::State,

View File

@@ -4,7 +4,7 @@
#[derive(Debug, thiserror::Error)]
pub enum OpPayloadBuilderError {
/// Thrown when a transaction fails to convert to a
/// [`reth_primitives::Recovered`].
/// [`alloy_consensus::transaction::Recovered`].
#[error("failed to convert deposit transaction to RecoveredTx")]
TransactionEcRecoverFailed,
/// Thrown when the L1 block info could not be parsed from the calldata of the

View File

@@ -2,6 +2,7 @@
use std::{fmt::Debug, sync::Arc};
use alloy_consensus::Block;
use alloy_eips::{
eip1559::BaseFeeParams, eip2718::Decodable2718, eip4895::Withdrawals, eip7685::Requests,
};
@@ -12,8 +13,6 @@ use alloy_rpc_types_engine::{
ExecutionPayloadV3, PayloadId,
};
use op_alloy_consensus::{encode_holocene_extra_data, EIP1559ParamError};
/// Re-export for use in downstream arguments.
pub use op_alloy_rpc_types_engine::OpPayloadAttributes;
use op_alloy_rpc_types_engine::{
OpExecutionPayloadEnvelopeV3, OpExecutionPayloadEnvelopeV4, OpExecutionPayloadV4,
};
@@ -21,8 +20,10 @@ use reth_chain_state::ExecutedBlockWithTrieUpdates;
use reth_optimism_primitives::OpPrimitives;
use reth_payload_builder::EthPayloadBuilderAttributes;
use reth_payload_primitives::{BuiltPayload, PayloadBuilderAttributes};
use reth_primitives::{transaction::WithEncoded, Block, NodePrimitives, SealedBlock};
use reth_primitives_traits::SignedTransaction;
use reth_primitives_traits::{NodePrimitives, SealedBlock, SignedTransaction, WithEncoded};
/// Re-export for use in downstream arguments.
pub use op_alloy_rpc_types_engine::OpPayloadAttributes;
/// Optimism Payload Builder Attributes
#[derive(Debug, Clone, PartialEq, Eq)]

View File

@@ -1,7 +1,6 @@
use alloy_consensus::{BlockBody, Header};
use reth_optimism_primitives::{transaction::signed::OpTransaction, DepositReceipt};
use reth_primitives::NodePrimitives;
use reth_primitives_traits::SignedTransaction;
use reth_primitives_traits::{NodePrimitives, SignedTransaction};
/// Helper trait to encapsulate common bounds on [`NodePrimitives`] for OP payload builder.
pub trait OpPayloadPrimitives:

View File

@@ -1,13 +1,13 @@
//! Validates execution payload wrt Optimism consensus rules
use alloc::sync::Arc;
use alloy_consensus::Block;
use alloy_rpc_types_engine::PayloadError;
use derive_more::{Constructor, Deref};
use op_alloy_rpc_types_engine::{OpExecutionData, OpPayloadError};
use reth_optimism_forks::OpHardforks;
use reth_payload_validator::{cancun, prague, shanghai};
use reth_primitives::{Block, SealedBlock};
use reth_primitives_traits::{Block as _, SignedTransaction};
use reth_primitives_traits::{Block as _, SealedBlock, SignedTransaction};
/// Execution payload validator.
#[derive(Clone, Debug, Deref, Constructor)]