From d68d7c8da0f13acfa356284c4ecf54047f964c25 Mon Sep 17 00:00:00 2001 From: Dan Cline <6798349+Rjected@users.noreply.github.com> Date: Mon, 9 Dec 2024 06:15:41 -0500 Subject: [PATCH] feat: bound NetworkPrimitives types by proper traits (#13196) --- crates/net/eth-wire-types/src/primitives.rs | 43 ++------------------- 1 file changed, 4 insertions(+), 39 deletions(-) diff --git a/crates/net/eth-wire-types/src/primitives.rs b/crates/net/eth-wire-types/src/primitives.rs index 78083e9e09..17f1943186 100644 --- a/crates/net/eth-wire-types/src/primitives.rs +++ b/crates/net/eth-wire-types/src/primitives.rs @@ -1,7 +1,7 @@ //! Abstraction over primitive types in network messages. use alloy_rlp::{Decodable, Encodable}; -use reth_primitives_traits::{Block, BlockHeader, SignedTransaction}; +use reth_primitives_traits::{Block, BlockBody, BlockHeader, SignedTransaction}; use std::fmt::Debug; /// Abstraction over primitive types which might appear in network messages. See @@ -10,56 +10,21 @@ pub trait NetworkPrimitives: Send + Sync + Unpin + Clone + Debug + PartialEq + Eq + 'static { /// The block header type. - type BlockHeader: BlockHeader - + Encodable - + Decodable - + Send - + Sync - + Unpin - + Clone - + Debug - + PartialEq - + Eq - + 'static; + type BlockHeader: BlockHeader + 'static; /// The block body type. - type BlockBody: Encodable - + Decodable - + Send - + Sync - + Unpin - + Clone - + Debug - + PartialEq - + Eq - + 'static; + type BlockBody: BlockBody + 'static; /// Full block type. type Block: Block
+ Encodable + Decodable - + Send - + Sync - + Unpin - + Clone - + Debug - + PartialEq - + Eq + 'static; /// The transaction type which peers announce in `Transactions` messages. It is different from /// `PooledTransactions` to account for Ethereum case where EIP-4844 transactions are not being /// announced and can only be explicitly requested from peers. - type BroadcastedTransaction: Encodable - + Decodable - + Send - + Sync - + Unpin - + Clone - + Debug - + PartialEq - + Eq - + 'static; + type BroadcastedTransaction: SignedTransaction + 'static; /// The transaction type which peers return in `PooledTransactions` messages. type PooledTransaction: SignedTransaction + TryFrom + 'static;