ChainSafe / gossamer

🕸️ Go Implementation of the Polkadot Host
https://chainsafe.github.io/gossamer
GNU Lesser General Public License v3.0
432 stars 116 forks source link

feat(statement-distribution): implement V2 task responder #4285

Open EclesioMeloJunior opened 3 weeks ago

EclesioMeloJunior commented 3 weeks ago

Issue summary

The statement distribution subsystem spawn two processes large-statement-responder (handled by legacy_v1 module) and candidate-responder (handled by v2 module).

The main Statement Distribution struct holds two receive only "channels"

type StatmentDistribution struct {
    v2ReqReceiver // receiver for incoming candidate requests
}

and each channel goes to its respective spawned process, in order to receive the outputs of each process we need to hold another receive channel for each process.

v2OutCh := make(chan any, 1)

go runv2RespondTask(sd.v2ReqReceiver, v2OutCh) // candidate-responder

The v2OutCh will be used by the MuxedMessage handler

V2RespondTask (candidate-responder)

Other links

https://github.com/paritytech/polkadot-sdk/blob/9584dbda9ed5fc91b1837f35f401659239fdaff1/polkadot/node/network/statement-distribution/src/v2/mod.rs#L3446