Skip to content

Commit 70dd00c

Browse files
paritytech-release-backport-bot[bot]eskimorgithub-actions[bot]
authored
[stable2503] Backport #8447 (#8448)
Backport #8447 into `stable2503` from eskimor. See the [documentation](https://github.com/paritytech/polkadot-sdk/blob/master/docs/BACKPORT.md) on how to use this bot. <!-- # To be used by other automation, do not modify: original-pr-number: #${pull_number} --> --------- Co-authored-by: eskimor <[email protected]> Co-authored-by: Robert <[email protected]> Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 2963a90 commit 70dd00c

File tree

3 files changed

+12
-16
lines changed

3 files changed

+12
-16
lines changed

polkadot/node/network/dispute-distribution/src/receiver/mod.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,6 @@ const COST_NOT_A_VALIDATOR: Rep = Rep::CostMajor("Reporting peer was not a valid
7272
const COST_INVALID_IMPORT: Rep =
7373
Rep::CostMinor("Import was deemed invalid by dispute-coordinator.");
7474

75-
/// Mildly punish peers exceeding their rate limit.
76-
///
77-
/// For honest peers this should rarely happen, but if it happens we would not want to disconnect
78-
/// too quickly. Minor cost should suffice for disconnecting any real flooder.
79-
const COST_APPARENT_FLOOD: Rep = Rep::CostMinor("Peer exceeded the rate limit.");
80-
8175
/// How many votes must have arrived in the last `BATCH_COLLECTING_INTERVAL`
8276
///
8377
/// in order for a batch to stay alive and not get flushed/imported to the dispute-coordinator.
@@ -311,7 +305,7 @@ where
311305
);
312306
req.send_outgoing_response(OutgoingResponse {
313307
result: Err(()),
314-
reputation_changes: vec![COST_APPARENT_FLOOD],
308+
reputation_changes: vec![],
315309
sent_feedback: None,
316310
})
317311
.map_err(|_| JfyiError::SendResponses(vec![peer]))?;

polkadot/node/network/dispute-distribution/src/tests/mod.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -390,17 +390,12 @@ fn receive_rate_limit_is_enforced() {
390390
rx_response_flood.await,
391391
Ok(resp) => {
392392
let sc_network::config::OutgoingResponse {
393-
result: _,
394-
reputation_changes,
393+
result,
394+
reputation_changes: _,
395395
sent_feedback: _,
396396
} = resp;
397-
gum::trace!(
398-
target: LOG_TARGET,
399-
?reputation_changes,
400-
"Received reputation changes."
401-
);
402-
// Received punishment for flood:
403-
assert_eq!(reputation_changes.len(), 1);
397+
// Received error because of flood.
398+
assert!(!result.is_ok());
404399
}
405400
);
406401
gum::trace!("Need to wait 2 patch intervals:");

prdoc/pr_8447.prdoc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: Fix a potential cause of slow parachain blocks
2+
doc:
3+
- audience: Node Operator
4+
description: This fix removes a needless reputation change, which might be causing the longer parachain block times on Polkadot.
5+
crates:
6+
- name: polkadot-dispute-distribution
7+
bump: minor

0 commit comments

Comments
 (0)