feat(dot/parachain): create skeleton for bitfield signing subsystem #4413
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 Signing subsystem, which is described in the Host Implementers' Guide, utilizing the subsystem pattern that has been used in other Gossamer subsystems.
Implementation Details
bitfieldsigning
indot/parachain/bitfield-signing
BitfieldSigning
and implement theSubsystem
interface on itDistributeBitfield
It might make sense to duplicate the type
UncheckedSignedAvailabilityBitfield
asCheckedSignedAvailabilityBitfield
, add a methodToChecked()
onUncheckedSignedAvailabilityBitfield
that performs the validation and use that type inDistributeBitfield
to ensure only valid bitfields are sent to peers.parachaintypes.ActiveLeavesUpdateSignal
Subsystem State
The subsystem needs access to the parachain session keys for signing bitfields. The appropriate
Keystore
should bepassed to the subsystem constructor as a dependency to facilitate testing. Since each new active leave results in a
goroutine being spawned, the subsystem needs to maintain state to receive data from them and to cancel them when
appropriate.
Ideally the implementation should avoid lock contention around the keystore. Since the signing key remains the same for the duration of the signing task, the subsystem could pass in the key pair or just the private key. The implementer should double-check that this approach is thread-safe.
This is out of scope for this issue though. It should be taken into account when implementing the signing tasks as part of the
parachaintypes.ActiveLeavesUpdateSignal
handler.Again, the response channel in the signing tasks should probably use a (to be created) type
CheckedSignedAvailabilityBitfield
.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
Acceptance criteria
Acceptance criteria are listed under Implementation Details.
The text was updated successfully, but these errors were encountered: