Skip to content

Commit d0dbeea

Browse files
committed
remove Ethspec from types where it's possible to do so
1 parent f870b66 commit d0dbeea

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

beacon_node/lighthouse_network/src/rpc/codec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const CONTEXT_BYTES_LEN: usize = 4;
2828

2929
/* Inbound Codec */
3030

31-
pub struct SSZSnappyInboundCodec<E: EthSpec> {
31+
pub struct SSZSnappyInboundCodec<E> {
3232
protocol: ProtocolId,
3333
inner: Uvi<usize>,
3434
len: Option<usize>,
@@ -194,7 +194,7 @@ impl<E: EthSpec> Decoder for SSZSnappyInboundCodec<E> {
194194
}
195195

196196
/* Outbound Codec: Codec for initiating RPC requests */
197-
pub struct SSZSnappyOutboundCodec<E: EthSpec> {
197+
pub struct SSZSnappyOutboundCodec<E> {
198198
inner: Uvi<usize>,
199199
len: Option<usize>,
200200
protocol: ProtocolId,

beacon_node/lighthouse_network/src/rpc/methods.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ pub struct Ping {
9393
variant_attributes(derive(Clone, Debug, PartialEq, Serialize),)
9494
)]
9595
#[derive(Clone, Debug, PartialEq)]
96-
pub struct MetadataRequest<E: EthSpec> {
96+
pub struct MetadataRequest<E> {
9797
_phantom_data: PhantomData<E>,
9898
}
9999

@@ -343,7 +343,7 @@ pub struct DataColumnsByRangeRequest {
343343
}
344344

345345
impl DataColumnsByRangeRequest {
346-
pub fn max_requested<E: EthSpec>(&self) -> u64 {
346+
pub fn max_requested(&self) -> u64 {
347347
self.count.saturating_mul(self.columns.len() as u64)
348348
}
349349

beacon_node/lighthouse_network/src/rpc/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl RequestId {
113113

114114
/// An Rpc Request.
115115
#[derive(Debug, Clone)]
116-
pub struct Request<E: EthSpec> {
116+
pub struct Request<E> {
117117
pub id: RequestId,
118118
pub substream_id: SubstreamId,
119119
pub r#type: RequestType<E>,

beacon_node/lighthouse_network/src/rpc/protocol.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ where
711711
}
712712

713713
#[derive(Debug, Clone, PartialEq)]
714-
pub enum RequestType<E: EthSpec> {
714+
pub enum RequestType<E> {
715715
Status(StatusMessage),
716716
Goodbye(GoodbyeReason),
717717
BlocksByRange(OldBlocksByRangeRequest),
@@ -741,7 +741,7 @@ impl<E: EthSpec> RequestType<E> {
741741
RequestType::BlobsByRange(req) => req.max_blobs_requested::<E>(),
742742
RequestType::BlobsByRoot(req) => req.blob_ids.len() as u64,
743743
RequestType::DataColumnsByRoot(req) => req.data_column_ids.len() as u64,
744-
RequestType::DataColumnsByRange(req) => req.max_requested::<E>(),
744+
RequestType::DataColumnsByRange(req) => req.max_requested(),
745745
RequestType::Ping(_) => 1,
746746
RequestType::MetaData(_) => 1,
747747
RequestType::LightClientBootstrap(_) => 1,

beacon_node/network/src/network_beacon_processor/rpc_methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -998,7 +998,7 @@ impl<T: BeaconChainTypes> NetworkBeaconProcessor<T> {
998998
);
999999

10001000
// Should not send more than max request data columns
1001-
if req.max_requested::<T::EthSpec>() > self.chain.spec.max_request_data_column_sidecars {
1001+
if req.max_requested() > self.chain.spec.max_request_data_column_sidecars {
10021002
return Err((
10031003
RpcErrorResponse::InvalidRequest,
10041004
"Request exceeded `MAX_REQUEST_BLOBS_SIDECARS`",

0 commit comments

Comments
 (0)