diff --git a/libp2p/protocols/pubsub/gossipsub.nim b/libp2p/protocols/pubsub/gossipsub.nim index 6ae7158e23..c8deca4fba 100644 --- a/libp2p/protocols/pubsub/gossipsub.nim +++ b/libp2p/protocols/pubsub/gossipsub.nim @@ -51,7 +51,6 @@ when defined(libp2p_expensive_metrics): proc init*( _: type[GossipSubParams], - explicit = true, pruneBackoff = 1.minutes, unsubscribeBackoff = 5.seconds, floodPublish = true, diff --git a/libp2p/protocols/pubsub/gossipsub/types.nim b/libp2p/protocols/pubsub/gossipsub/types.nim index e75abfd516..e4efb8d7cb 100644 --- a/libp2p/protocols/pubsub/gossipsub/types.nim +++ b/libp2p/protocols/pubsub/gossipsub/types.nim @@ -102,6 +102,11 @@ type behaviourPenalty*: float64 # the eventual penalty score GossipSubParams* {.public.} = object + # explicit is used to check if the GossipSubParams instance was created by the user either passing params to GossipSubParams(...) + # or GossipSubParams.init(...). In the first case explicit should be set to true when calling the Nim constructor. + # In the second case, the param isn't necessary and should be always be set to true by init. + # If none of those options were used, it means the instance was created using Nim default values. + # In this case, GossipSubParams.init() should be called when initing GossipSub to set the values to their default value defined by nim-libp2p. explicit*: bool pruneBackoff*: Duration unsubscribeBackoff*: Duration