Skip to content

Commit

Permalink
fix: remove explicit param from GossipSubParams constructor (#1080)
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomrsantos authored Apr 9, 2024
1 parent 09b3e11 commit 89cad5a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 0 additions & 1 deletion libp2p/protocols/pubsub/gossipsub.nim
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ when defined(libp2p_expensive_metrics):

proc init*(
_: type[GossipSubParams],
explicit = true,
pruneBackoff = 1.minutes,
unsubscribeBackoff = 5.seconds,
floodPublish = true,
Expand Down
5 changes: 5 additions & 0 deletions libp2p/protocols/pubsub/gossipsub/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 89cad5a

Please sign in to comment.