paritytech / polkadot-sdk

The Parity Polkadot Blockchain SDK
https://polkadot.network/
1.81k stars 660 forks source link

Avoid using unbounded channels for prioritization #824

Closed drahnr closed 1 month ago

drahnr commented 2 years ago

Currently we abuse the unbounded channels for prioritization, since they are used more sparingly compared to the bounded ones (which is good in itself!).

Proposal:

Extend the metered::* types to have send::<Priority = Standard> generic argument which can either be Droppable, Low, Standard, High (not an enum!, all marker types).

Pros:

Cons:

eskimor commented 2 years ago

I think Andrei created a similar issue, yeah here it is: https://github.com/paritytech/polkadot/issues/5475

AndreiEres commented 1 month ago

Since https://github.com/paritytech/polkadot-sdk/pull/4755, we have the ability to send prioritized messages. However, we still have a number of messages that we send over an unbounded channel. Changing this would disrupt the current message order; see https://github.com/paritytech/polkadot-sdk/pull/5547#discussion_r1740828588 for more details. We have decided to leave it as is.

Following prioritization should only occur over priority channels.