ChainSafe / ChainSafe/gossamer

feat(statement-distribution): implement `v2::circulate_statement`

Open
#4,342 0 comments 0 reactions 1 assignee Assigned to @EclesioMeloJunior View on GitHub
Dominant language
Go
Stars
454
Forks
144
PR merge metrics
No merged PRs in 30d

Description

### Description

Circulates a `compact statement` to all peers who need it:
- Those in the current group of local validators (which have the confirmed candidate)
- Grid peers which already have indicated that they know the candidate as backed.

- [ ] Map from `AuthorityID` to `PeerID` and another map from `PeerID` to `PeerState`
- That is needed because in the local validator group we only have authority ids, and to share the stmts we need to have their peer IDs. The second map is needed to ensure that when sharing a candidate stmt we only share with peers that knows the candidate's relay parent, so we need to keep such state.

- [ ] Cluster Tracker [definition](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/node/network/statement-distribution/src/v2/cluster.rs)
- [ ] Grid Tracker [definition](https://github.com/paritytech/polkadot-sdk/blob/master/polkadot/node/network/statement-distribution/src/v2/grid.rs)

- Need to support `ValidationVersion::V2` and `ValidationVersion::V3`, we should filter the peers that support each message and send it accordingly.

### Links

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

### Acceptance Criteria

- [ ] Unit tests

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.