mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 19:17:58 +00:00
Only fetch one collation at a time per relay parent (#3333)
* Only fetch one collation at a time per relay parent Before a validator would fetch all collations that were advertised to him. This pr changes the behavior to always just fetch one collation at a time. If fetching fails, the validator will start fetching one of the other collations. * Use enum to be more explicit * Review comments
This commit is contained in:
@@ -44,7 +44,7 @@ pub use sc_network::config::RequestResponseConfig;
|
||||
|
||||
/// All requests that can be sent to the network bridge.
|
||||
pub mod request;
|
||||
pub use request::{IncomingRequest, OutgoingRequest, Requests, Recipient, OutgoingResult};
|
||||
pub use request::{IncomingRequest, OutgoingRequest, Requests, Recipient, OutgoingResult, ResponseSender};
|
||||
|
||||
///// Multiplexer for incoming requests.
|
||||
// pub mod multiplexer;
|
||||
|
||||
@@ -29,6 +29,9 @@ use crate::UnifiedReputationChange;
|
||||
|
||||
use super::{v1, Protocol};
|
||||
|
||||
/// Used by the network to send us a response to a request.
|
||||
pub type ResponseSender = oneshot::Sender<Result<Vec<u8>, network::RequestFailure>>;
|
||||
|
||||
/// Common properties of any `Request`.
|
||||
pub trait IsRequest {
|
||||
/// Each request has a corresponding `Response`.
|
||||
@@ -109,7 +112,7 @@ pub struct OutgoingRequest<Req> {
|
||||
/// The actual request to send over the wire.
|
||||
pub payload: Req,
|
||||
/// Sender which is used by networking to get us back a response.
|
||||
pub pending_response: oneshot::Sender<Result<Vec<u8>, network::RequestFailure>>,
|
||||
pub pending_response: ResponseSender,
|
||||
}
|
||||
|
||||
/// Any error that can occur when sending a request.
|
||||
|
||||
Reference in New Issue
Block a user