diff --git a/substrate/client/network/common/src/sync/message.rs b/substrate/client/network/common/src/sync/message.rs index 27ab2704e64713cb9917ba20928662b58bb82d2e..db9f747108c9fe53b4a0cc16cc1610fa52933f41 100644 --- a/substrate/client/network/common/src/sync/message.rs +++ b/substrate/client/network/common/src/sync/message.rs @@ -158,8 +158,6 @@ pub mod generic { pub fields: BlockAttributes, /// Start from this block. pub from: FromBlock<Hash, Number>, - /// End at this block. An implementation defined maximum is used when unspecified. - pub to: Option<Hash>, /// Sequence direction. pub direction: Direction, /// Maximum number of blocks to return. An implementation defined maximum is used when diff --git a/substrate/client/network/sync/src/lib.rs b/substrate/client/network/sync/src/lib.rs index 6ad4a8fbbdcc51c1e26ed5bcdd1deb3c7177967e..63484903511402736f539cdf3b69588f21a5c835 100644 --- a/substrate/client/network/sync/src/lib.rs +++ b/substrate/client/network/sync/src/lib.rs @@ -650,7 +650,6 @@ where id: 0, fields: BlockAttributes::JUSTIFICATION, from: FromBlock::Hash(request.0), - to: None, direction: Direction::Ascending, max: Some(1), }; @@ -1608,7 +1607,6 @@ where FromBlock::Number(n) => Some(schema::v1::block_request::FromBlock::Number(n.encode())), }, - to_block: request.to.map(|h| h.encode()).unwrap_or_default(), direction: request.direction as i32, max_blocks: request.max.unwrap_or(0), support_multiple_justifications: true, @@ -2252,7 +2250,6 @@ fn ancestry_request<B: BlockT>(block: NumberFor<B>) -> BlockRequest<B> { id: 0, fields: BlockAttributes::HEADER | BlockAttributes::JUSTIFICATION, from: FromBlock::Number(block), - to: None, direction: Direction::Ascending, max: Some(1), } @@ -2368,7 +2365,6 @@ fn peer_block_request<B: BlockT>( id: 0, fields: attrs, from, - to: None, direction: Direction::Descending, max: Some((range.end - range.start).saturated_into::<u32>()), }; @@ -2402,7 +2398,6 @@ fn peer_gap_block_request<B: BlockT>( id: 0, fields: attrs, from, - to: None, direction: Direction::Descending, max: Some((range.end - range.start).saturated_into::<u32>()), }; @@ -2452,7 +2447,6 @@ fn fork_sync_request<B: BlockT>( id: 0, fields: attributes, from: FromBlock::Hash(*hash), - to: None, direction: Direction::Descending, max: Some(count), }, @@ -2702,8 +2696,7 @@ mod test { assert!(sync.justification_requests().any(|(p, r)| { p == peer_id3 && r.fields == BlockAttributes::JUSTIFICATION && - r.from == FromBlock::Hash(b1_hash) && - r.to == None + r.from == FromBlock::Hash(b1_hash) })); assert_eq!( diff --git a/substrate/client/network/sync/src/schema/api.v1.proto b/substrate/client/network/sync/src/schema/api.v1.proto index b51137d1d51d4f332b5504360ea4e630a8137a47..203b157470a5828a34bb5203eebdaa4a52dc6c60 100644 --- a/substrate/client/network/sync/src/schema/api.v1.proto +++ b/substrate/client/network/sync/src/schema/api.v1.proto @@ -23,8 +23,6 @@ message BlockRequest { // Start with given block number. bytes number = 3; } - // End at this block. An implementation defined maximum is used when unspecified. - bytes to_block = 4; // optional // Sequence direction. Direction direction = 5; // Maximum number of blocks to return. An implementation defined maximum is used when unspecified. diff --git a/substrate/client/network/sync/src/warp.rs b/substrate/client/network/sync/src/warp.rs index 4f2a71d98613eb093a013062987bab075c3106c6..ab8a7c66b98560ddc3667c269f311e8e141ac31e 100644 --- a/substrate/client/network/sync/src/warp.rs +++ b/substrate/client/network/sync/src/warp.rs @@ -193,7 +193,6 @@ where fields: BlockAttributes::HEADER | BlockAttributes::BODY | BlockAttributes::JUSTIFICATION, from: FromBlock::Hash(header.hash()), - to: Some(header.hash()), direction: Direction::Ascending, max: Some(1), };