Issue summary
from design doc:
SetReservedPeers, AddPeersToReservedSet, and RemovePeersFromReservedSet are all methods to modify the reserved set of peers specific to a protocol. This will definitely be needed for the Parachains initiative. AddPeersToReservedSet and RemovedPeersFromReservedSet are called by AddSetReserved and RemoveSetReserved which are just helper functions to add one or remove one peer. These two helper methods are called in the GRANDPA integration. Our current peerset Handler exposes a AddReservedPeer and RemoveReservedPeer but takes a int param for setID. We will need to translate the ProtocolName type using a mapping to int. The integer setID is enumerated based on the order it is added as a supported notification protocol (see code).
Implementation details
- Introduce mapping of
ProtocolName to int set ID in translation shim type.
- Implement
AddPeersToReservedSet and RemovePeersFromReserveSet in translation shim type, by utilizing protocol name to set id mapping, and calling Handler.AddReservedPeer and Handler.RemoveReservedPeer respectively.
Other information and links
Acceptance criteria
[] 70% code coverage on implemented functions
[] Able to add and remove from reserved set using ProtocolName as set.
Issue summary
from design doc:
Implementation details
ProtocolNametointset ID in translation shim type.AddPeersToReservedSetandRemovePeersFromReserveSetin translation shim type, by utilizing protocol name to set id mapping, and callingHandler.AddReservedPeerandHandler.RemoveReservedPeerrespectively.Other information and links
Acceptance criteria
[] 70% code coverage on implemented functions
[] Able to add and remove from reserved set using
ProtocolNameas set.