feat(parachain): create skeleton for bitfield distribution subsystem #4234
Labels
C-simple
Minor changes changes, no additional research needed. Good first issue/review.
S-subsystems-availability
issues related to polkadot host availability subsystem functionality.
T-implementation
this issue/pr is a new feature or functionality.
Issue summary
Create skeleton code for the implementation of the Bitfield Distribution subsystem which is described in the Host Implementers' Guide, utilizing the subsystem pattern that has been used in other Gossamer subsystems.
bitfielddistribution
indot/parachain/bitfield-distribution
BitfieldDistribution
and implement theSubsystem
interface on itDistributeBitfield
It might make sense to duplicate the type
UncheckedSignedAvailabilityBitfield
asCheckedSignedAvailabilityBitfield
,add a method
ToChecked()
onUncheckedSignedAvailabilityBitfield
that performs the validation and use that type inDistributeBitfield
to ensure only valid bitfields are sent to peers.validationprotocol.BitfieldDistributionMessage
networkbridgevent.PeerConnected
networkbridgevent.PeerDisconnected
networkbridgevent.NewGossipTopology
networkbridgevent.PeerViewChange
networkbridgevent.OurViewChange
networkbridgevent.UpdatedAuthorityIDs
parachaintypes.ActiveLeavesUpdateSignal
ProvisionableDataBitfield
indot/parachain/provisioner/messages/messages.go
If the type
CheckedSignedAvailabilityBitfield
mentioned above is created, it should also be used inProvisionableDataBitfield
.Subsystem State
The subsystem should store the view of each peer the subsystem is informed about via the relevant network bridge events. The Parity node also stores the protocol version of the peer. If our implementation only supports version 2 and 3 messages, the subsystem should probably ignore peers that still use version 1 instead.
The subsystem also needs to know the current and previous network grid topologies and the view of the node ("our view"). The grid topology is out of scope for this design document and the subsystem implementation. The
bitfielddistribution
package should contain an interface that covers the required methods ofSessionBoundGridTopologyStorage
used in the Parity node.For each relay parent the subsystem is instructed by the overseer to work on, it needs to maintain the following data:
This could be implemented roughly as follows:
The Parity node also uses a
ReputationAggregator
. It is up to the implementer of this subsystem to either define an interface analogous toSessionBoundGridTopologyStorage
or adjust peer reputation immediately. The subsystem can be modified to use aReputationAggregator
in a follow-up PR, once it has been implemented.Other information and links
Look at other skeleton PRs to get an idea of what to code and what will become and TODO and a new issue
The text was updated successfully, but these errors were encountered: