Skip to content

Commit 41b6915

Browse files
jpserrattdimitrov
andauthored
remove ReportCollator message (#6628)
Closes #6415 # Description Remove unused message `ReportCollator` and test related to this message on the collator protocol validator side. cc: @tdimitrov --------- Co-authored-by: Tsvetomir Dimitrov <[email protected]> Co-authored-by: command-bot <>
1 parent c422d8b commit 41b6915

File tree

8 files changed

+20
-88
lines changed

8 files changed

+20
-88
lines changed

polkadot/node/network/collator-protocol/src/collator_side/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -899,7 +899,7 @@ async fn process_msg<Context>(
899899
);
900900
}
901901
},
902-
msg @ (ReportCollator(..) | Invalid(..) | Seconded(..)) => {
902+
msg @ (Invalid(..) | Seconded(..)) => {
903903
gum::warn!(
904904
target: LOG_TARGET,
905905
"{:?} message is not expected on the collator side of the protocol",

polkadot/node/network/collator-protocol/src/validator_side/mod.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,9 +1462,6 @@ async fn process_msg<Context>(
14621462
"DistributeCollation message is not expected on the validator side of the protocol",
14631463
);
14641464
},
1465-
ReportCollator(id) => {
1466-
report_collator(&mut state.reputation, ctx.sender(), &state.peer_data, id).await;
1467-
},
14681465
NetworkBridgeUpdate(event) => {
14691466
if let Err(e) = handle_network_msg(ctx, state, keystore, event).await {
14701467
gum::warn!(

polkadot/node/network/collator-protocol/src/validator_side/tests/mod.rs

Lines changed: 0 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -638,66 +638,6 @@ fn act_on_advertisement_v2() {
638638
});
639639
}
640640

641-
// Test that other subsystems may modify collators' reputations.
642-
#[test]
643-
fn collator_reporting_works() {
644-
let test_state = TestState::default();
645-
646-
test_harness(ReputationAggregator::new(|_| true), |test_harness| async move {
647-
let TestHarness { mut virtual_overseer, .. } = test_harness;
648-
649-
overseer_send(
650-
&mut virtual_overseer,
651-
CollatorProtocolMessage::NetworkBridgeUpdate(NetworkBridgeEvent::OurViewChange(
652-
our_view![test_state.relay_parent],
653-
)),
654-
)
655-
.await;
656-
657-
respond_to_runtime_api_queries(&mut virtual_overseer, &test_state, test_state.relay_parent)
658-
.await;
659-
660-
let peer_b = PeerId::random();
661-
let peer_c = PeerId::random();
662-
663-
connect_and_declare_collator(
664-
&mut virtual_overseer,
665-
peer_b,
666-
test_state.collators[0].clone(),
667-
test_state.chain_ids[0],
668-
CollationVersion::V1,
669-
)
670-
.await;
671-
672-
connect_and_declare_collator(
673-
&mut virtual_overseer,
674-
peer_c,
675-
test_state.collators[1].clone(),
676-
test_state.chain_ids[0],
677-
CollationVersion::V1,
678-
)
679-
.await;
680-
681-
overseer_send(
682-
&mut virtual_overseer,
683-
CollatorProtocolMessage::ReportCollator(test_state.collators[0].public()),
684-
)
685-
.await;
686-
687-
assert_matches!(
688-
overseer_recv(&mut virtual_overseer).await,
689-
AllMessages::NetworkBridgeTx(
690-
NetworkBridgeTxMessage::ReportPeer(ReportPeerMessage::Single(peer, rep)),
691-
) => {
692-
assert_eq!(peer, peer_b);
693-
assert_eq!(rep.value, COST_REPORT_BAD.cost_or_benefit());
694-
}
695-
);
696-
697-
virtual_overseer
698-
});
699-
}
700-
701641
// Test that we verify the signatures on `Declare` and `AdvertiseCollation` messages.
702642
#[test]
703643
fn collator_authentication_verification_works() {

polkadot/node/subsystem-types/src/messages.rs

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ use polkadot_primitives::{
4848
CommittedCandidateReceiptV2 as CommittedCandidateReceipt, CoreState,
4949
},
5050
ApprovalVotingParams, AuthorityDiscoveryId, BlockNumber, CandidateCommitments, CandidateHash,
51-
CandidateIndex, CollatorId, CoreIndex, DisputeState, ExecutorParams, GroupIndex,
52-
GroupRotationInfo, Hash, HeadData, Header as BlockHeader, Id as ParaId, InboundDownwardMessage,
53-
InboundHrmpMessage, MultiDisputeStatementSet, NodeFeatures, OccupiedCoreAssumption,
54-
PersistedValidationData, PvfCheckStatement, PvfExecKind as RuntimePvfExecKind, SessionIndex,
55-
SessionInfo, SignedAvailabilityBitfield, SignedAvailabilityBitfields, ValidationCode,
56-
ValidationCodeHash, ValidatorId, ValidatorIndex, ValidatorSignature,
51+
CandidateIndex, CoreIndex, DisputeState, ExecutorParams, GroupIndex, GroupRotationInfo, Hash,
52+
HeadData, Header as BlockHeader, Id as ParaId, InboundDownwardMessage, InboundHrmpMessage,
53+
MultiDisputeStatementSet, NodeFeatures, OccupiedCoreAssumption, PersistedValidationData,
54+
PvfCheckStatement, PvfExecKind as RuntimePvfExecKind, SessionIndex, SessionInfo,
55+
SignedAvailabilityBitfield, SignedAvailabilityBitfields, ValidationCode, ValidationCodeHash,
56+
ValidatorId, ValidatorIndex, ValidatorSignature,
5757
};
5858
use polkadot_statement_table::v2::Misbehavior;
5959
use std::{
@@ -250,9 +250,6 @@ pub enum CollatorProtocolMessage {
250250
/// The core index where the candidate should be backed.
251251
core_index: CoreIndex,
252252
},
253-
/// Report a collator as having provided an invalid collation. This should lead to disconnect
254-
/// and blacklist of the collator.
255-
ReportCollator(CollatorId),
256253
/// Get a network bridge update.
257254
#[from]
258255
NetworkBridgeUpdate(NetworkBridgeEvent<net_protocol::CollatorProtocolMessage>),

polkadot/roadmap/implementers-guide/src/node/collators/collator-protocol.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,12 +151,6 @@ time per relay parent. This reduces the bandwidth requirements and as we can sec
151151
the others are probably not required anyway. If the request times out, we need to note the collator as being unreliable
152152
and reduce its priority relative to other collators.
153153

154-
As a validator, once the collation has been fetched some other subsystem will inspect and do deeper validation of the
155-
collation. The subsystem will report to this subsystem with a [`CollatorProtocolMessage`][CPM]`::ReportCollator`. In
156-
that case, if we are connected directly to the collator, we apply a cost to the `PeerId` associated with the collator
157-
and potentially disconnect or blacklist it. If the collation is seconded, we notify the collator and apply a benefit to
158-
the `PeerId` associated with the collator.
159-
160154
### Interaction with [Candidate Backing][CB]
161155

162156
As collators advertise the availability, a validator will simply second the first valid parablock candidate per relay

polkadot/roadmap/implementers-guide/src/node/subsystems-and-jobs.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@ digraph {
129129
130130
cand_sel -> coll_prot [arrowhead = "diamond", label = "FetchCollation"]
131131
cand_sel -> cand_back [arrowhead = "onormal", label = "Second"]
132-
cand_sel -> coll_prot [arrowhead = "onormal", label = "ReportCollator"]
133132
134133
cand_val -> runt_api [arrowhead = "diamond", label = "Request::PersistedValidationData"]
135134
cand_val -> runt_api [arrowhead = "diamond", label = "Request::ValidationCode"]
@@ -231,7 +230,7 @@ sequenceDiagram
231230
232231
VS ->> CandidateSelection: Collation
233232
234-
Note over CandidateSelection: Lots of other machinery in play here,<br/>but there are only three outcomes from the<br/>perspective of the `CollatorProtocol`:
233+
Note over CandidateSelection: Lots of other machinery in play here,<br/>but there are only two outcomes from the<br/>perspective of the `CollatorProtocol`:
235234
236235
alt happy path
237236
CandidateSelection -->> VS: FetchCollation
@@ -242,10 +241,6 @@ sequenceDiagram
242241
NB ->> VS: Collation
243242
Deactivate VS
244243
245-
else collation invalid or unexpected
246-
CandidateSelection ->> VS: ReportCollator
247-
VS ->> NB: ReportPeer
248-
249244
else CandidateSelection already selected a different candidate
250245
Note over CandidateSelection: silently drop
251246
end

polkadot/roadmap/implementers-guide/src/types/overseer-protocol.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -436,9 +436,6 @@ enum CollatorProtocolMessage {
436436
DistributeCollation(CandidateReceipt, PoV, Option<oneshot::Sender<CollationSecondedSignal>>),
437437
/// Fetch a collation under the given relay-parent for the given ParaId.
438438
FetchCollation(Hash, ParaId, ResponseChannel<(CandidateReceipt, PoV)>),
439-
/// Report a collator as having provided an invalid collation. This should lead to disconnect
440-
/// and blacklist of the collator.
441-
ReportCollator(CollatorId),
442439
/// Note a collator as having provided a good collation.
443440
NoteGoodCollation(CollatorId, SignedFullStatement),
444441
/// Notify a collator that its collation was seconded.

prdoc/pr_6628.prdoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
title: "Remove ReportCollator message"
2+
3+
doc:
4+
- audience: Node Dev
5+
description: |
6+
Remove unused message ReportCollator and test related to this message on the collator protocol validator side.
7+
8+
crates:
9+
- name: polkadot-node-subsystem-types
10+
bump: patch
11+
- name: polkadot-collator-protocol
12+
bump: major

0 commit comments

Comments
 (0)