polkadot icon indicating copy to clipboard operation
polkadot copied to clipboard

`bitfield-distribution`: use unbounded channels for own bitfields

Open sandreim opened this issue 3 years ago • 2 comments
trafficstars

Bitfield gossiping is handled here.

  • we can safely prioritise our own bitfields by sending them over the unbounded channel to the network-bridge.
  • alternatively we can send all bitfields via unbounded channel, but we limit them by an arbitrary value per relay block (spam needs to also be considered); when the limit is reached we use the bounded channel.

This would make availability faster in situations when the network-bridge is clogged by too many messages:

Screenshot 2022-05-12 at 13 01 16

sandreim avatar May 12 '22 10:05 sandreim

If bitfields are lagging, this will reduce parachain block production and will thus help reduce load on nodes - which is good! If we want bitfields to propagate faster we have to look into performance optimizations, bypassing natural back pressure will likely make matters worse.

Prioritizing own bitfields might make sense, but I am still a bit uneasy about it. We need to make sure nodes are doing sensible stuff when close to overload. Bitfields in particular are a perfect point in the system to back-pressure, because almost no work will be wasted, things just get slower.

This means if we find bitifields to be delayed because of load on the network bridge, then we should be looking into reducing that load.

eskimor avatar May 12 '22 11:05 eskimor

I think this is a short term solution, created for #5517 mid-term

drahnr avatar May 12 '22 16:05 drahnr