refactor/reputation: unify the values used (#2462)

* refactor/reputation: unify the values used

* chore/rep: rename Annoy* to Cost*, make duplicate message Cost*Repeated

* fix/reputation: lost and found, convert at the boundary to substrate

* refactor/rep: move conversion to base reputation one level down, left conversions

* fix/rep: order of magnitude adjustments

Thanks pierre!

* remove spaces

* chore/rep: give rationale for order of magnitude

* refactor/rep: move UnifiedReputationChange to separate file

* fix/rep: order of magnitudes correction
This commit is contained in:
Bernhard Schuster
2021-02-17 17:18:13 +01:00
committed by GitHub
parent 62c5896592
commit 1e2161258b
16 changed files with 132 additions and 73 deletions
+2 -2
View File
@@ -25,7 +25,7 @@
use futures::channel::{mpsc, oneshot};
use thiserror::Error;
use polkadot_node_network_protocol::{
peer_set::PeerSet, v1 as protocol_v1, ReputationChange, PeerId,
peer_set::PeerSet, v1 as protocol_v1, UnifiedReputationChange, PeerId,
request_response::{Requests, request::IncomingRequest, v1 as req_res_v1},
};
use polkadot_node_primitives::{
@@ -217,7 +217,7 @@ impl CollatorProtocolMessage {
#[derive(Debug)]
pub enum NetworkBridgeMessage {
/// Report a peer for their actions.
ReportPeer(PeerId, ReputationChange),
ReportPeer(PeerId, UnifiedReputationChange),
/// Send a message to one or more peers on the validation peer-set.
SendValidationMessage(Vec<PeerId>, protocol_v1::ValidationProtocol),