From 86dc1ab36cdaf0554fbf11ef9556759bcbdda38c Mon Sep 17 00:00:00 2001
From: Alexandru Gheorghe <49718502+alexggh@users.noreply.github.com>
Date: Mon, 23 Sep 2024 09:10:40 +0300
Subject: [PATCH] bitfield_distribution: Move on blocking pool and use custom
 capacity (#5787)

## Description

Details and rationale explained here:
https://github.com/paritytech/polkadot-sdk/issues/5657#issuecomment-2363076080

Fixes: https://github.com/paritytech/polkadot-sdk/issues/5657

---------

Signed-off-by: Alexandru Gheorghe <alexandru.gheorghe@parity.io>
---
 polkadot/node/overseer/src/lib.rs |  2 +-
 prdoc/pr_5787.prdoc               | 13 +++++++++++++
 2 files changed, 14 insertions(+), 1 deletion(-)
 create mode 100644 prdoc/pr_5787.prdoc

diff --git a/polkadot/node/overseer/src/lib.rs b/polkadot/node/overseer/src/lib.rs
index 26a6a907e32..23adf4f4d8a 100644
--- a/polkadot/node/overseer/src/lib.rs
+++ b/polkadot/node/overseer/src/lib.rs
@@ -521,7 +521,7 @@ pub struct Overseer<SupportsParachains> {
 	])]
 	bitfield_signing: BitfieldSigning,
 
-	#[subsystem(BitfieldDistributionMessage, sends: [
+	#[subsystem(blocking, message_capacity: 8192, BitfieldDistributionMessage, sends: [
 		RuntimeApiMessage,
 		NetworkBridgeTxMessage,
 		ProvisionerMessage,
diff --git a/prdoc/pr_5787.prdoc b/prdoc/pr_5787.prdoc
new file mode 100644
index 00000000000..59d4118f190
--- /dev/null
+++ b/prdoc/pr_5787.prdoc
@@ -0,0 +1,13 @@
+title: "Move bitfield_distribution to blocking task pool and set capacity to 8192"
+
+doc:
+  - audience: Node Dev
+    description: |
+      This is moving bitfield_distribution to the blocking task pool because it does cpu
+      intensive work and to make it snappier. Additionally, also increase the message
+      capacity of the subsystem to make sure the queue does not get full if there is a
+      burst of messages.
+
+crates:
+  - name: polkadot-overseer
+    bump: patch
-- 
GitLab