ChainSafe / ChainSafe/gossamer

Move overseer messages to a subsystems `messages` package

Open
#4,409 1 comment 0 reactions 0 assignees View on GitHub
C-simple good first issue T-implementation
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

## Issue summary
- While designing the statement distribution subsystem I've noticed that it needs to send messages to `Candidate Backing` subsystems, and after a look into the `Candidate Backing` it will also need to send messages to `Statement Distribution`

- Currently, in Gossamer we have packages contains a filed `message.go` that contains all the messages the subsystem can receive, and other packages that contains an inner package called `messages` that holds a file called `messages.go` that contains the messages.

- In a case where two subsystems should send messages to each other they need to import the receiving subsystem to be able to instantiate the message and sent, so if all the messages stay in the subsystem package this will create an cyclic import

## Implementation details

- We should use the second approach where the subsystem has an inner package called `messages` to avoid such case.

## Other information and links

- `Backing -> Statement Distribution`: [link to the code](https://github.com/paritytech/polkadot-sdk/blob/ec69b612bfa082ada07ceb7d8115e07f943f6815/polkadot/node/core/backing/src/lib.rs#L1697)
- `Statement Distribution -> Backing`: [link to the code](https://github.com/paritytech/polkadot-sdk/blob/ec69b612bfa082ada07ceb7d8115e07f943f6815/polkadot/node/network/statement-distribution/src/v2/mod.rs#L1959)

## Acceptance criteria

[] Move all the messages for each subsystems to the `messages` pkg

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.