Expand description
Request/response protocols used in Polkadot.
Overview over request/responses as used in Polkadot
.
enum Protocol
…. List of all supported protocols.
enum Requests
…. List of all supported requests, each entry matches one in protocols, but
has the actual request as payload.
struct IncomingRequest
…. wrapper for incoming requests, containing a sender for sending
responses.
struct OutgoingRequest
…. wrapper for outgoing requests, containing a sender used by the
networking code for delivering responses/delivery errors.
trait IsRequest
…. A trait describing a particular request. It is used for gathering meta
data, like what is the corresponding response type.
Versioned (v1 module): The actual requests and responses as sent over the network.
Re-exports
pub use incoming::IncomingRequest;
pub use incoming::IncomingRequestReceiver;
pub use outgoing::OutgoingRequest;
pub use outgoing::OutgoingResult;
pub use outgoing::Recipient;
pub use outgoing::Requests;
pub use outgoing::ResponseSender;
Modules
- Everything related to handling of incoming requests.
- Configuration of the networking layer.
- Everything related to handling of outgoing requests.
- Actual versioned requests and responses, that are sent over the wire. Requests and responses as sent over the wire for the individual protocols.
Structs
- An iterator over the variants of Self
- Type for getting on the wire
Protocol
names using genesis hash & fork id. - Configuration for a single request-response protocol.
Enums
- A protocol per subsystem seems to make the most sense, this way we don’t need any dispatching within protocols.
- The protocol name transmitted on the wire.
Constants
- Timeout for requesting availability chunks.
- We can have relative large timeouts here, there is no value of hitting a timeout as we want to get statements through to each node in any case.
- We don’t want a slow peer to slow down all the others, at the same time we want to get out the data quickly in full to at least some peers (as this will reduce load on us as they then can start serving the data). So this value is a tradeoff. 3 seems to be sensible. So we would need to have 3 slow nodes connected, to delay transfer for others by
STATEMENTS_TIMEOUT
.
Traits
- Common properties of any
Request
.