mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 23:57:56 +00:00
client/network: Report reputation changes via response (#7958)
* client/network: Report reputation changes via response When handling a request by a remote peer in a request response handler, one might want to in- or de-crease the reputation of the peer. E.g. one might want to decrease the reputation slightly for each request, given that it forces the local node to do work, or one might want to issue a larger reputation change due to a malformed request by the remote peer. Instead of having to pass a peerset handle to each request response handler, this commit suggests to allow handlers to isssue reputation changes via the provided `pending_response` `oneshot` channel. A reputation change issued by a request response handler via the `pending_response` channel is received by the `RequestResponsesBehaviour` which passes the reputation change up as an event to eventually be send to a peerset via a peerset handle. * client/network/req-resp: Use Vec::new instead of None::<Vec<_>> * client/network: Rename Response to OutgoingResponse Given that a request-response request is not called `Request` but `InomingRequest`, rename a request-response response to `OutgoingResponse`. * client/finality-grandpa-warp: Send empty rep change via response
This commit is contained in:
@@ -23,7 +23,11 @@
|
||||
|
||||
pub use crate::chain::Client;
|
||||
pub use crate::on_demand_layer::{AlwaysBadChecker, OnDemand};
|
||||
pub use crate::request_responses::{IncomingRequest, ProtocolConfig as RequestResponseConfig};
|
||||
pub use crate::request_responses::{
|
||||
IncomingRequest,
|
||||
OutgoingResponse,
|
||||
ProtocolConfig as RequestResponseConfig,
|
||||
};
|
||||
pub use libp2p::{identity, core::PublicKey, wasm_ext::ExtTransport, build_multiaddr};
|
||||
|
||||
// Note: this re-export shouldn't be part of the public API of the crate and will be removed in
|
||||
|
||||
Reference in New Issue
Block a user