mirror of
https://github.com/logos-storage/nim-libp2p.git
synced 2026-01-07 16:13:10 +00:00
Typo: s/unsubcribeBackoff/unsubscribeBackoff (#675)
This commit is contained in:
parent
2373ee0061
commit
47a35e26d7
@ -43,7 +43,7 @@ proc init*(_: type[GossipSubParams]): GossipSubParams =
|
|||||||
GossipSubParams(
|
GossipSubParams(
|
||||||
explicit: true,
|
explicit: true,
|
||||||
pruneBackoff: 1.minutes,
|
pruneBackoff: 1.minutes,
|
||||||
unsubcribeBackoff: 5.seconds,
|
unsubscribeBackoff: 5.seconds,
|
||||||
floodPublish: true,
|
floodPublish: true,
|
||||||
gossipFactor: 0.25,
|
gossipFactor: 0.25,
|
||||||
d: GossipSubD,
|
d: GossipSubD,
|
||||||
@ -78,8 +78,8 @@ proc validateParameters*(parameters: GossipSubParams): Result[void, cstring] =
|
|||||||
err("gossipsub: dOut parameter error, Number of outbound connections to keep in the mesh. Must be less than D_lo and at most D/2")
|
err("gossipsub: dOut parameter error, Number of outbound connections to keep in the mesh. Must be less than D_lo and at most D/2")
|
||||||
elif parameters.gossipThreshold >= 0:
|
elif parameters.gossipThreshold >= 0:
|
||||||
err("gossipsub: gossipThreshold parameter error, Must be < 0")
|
err("gossipsub: gossipThreshold parameter error, Must be < 0")
|
||||||
elif parameters.unsubcribeBackoff.seconds <= 0:
|
elif parameters.unsubscribeBackoff.seconds <= 0:
|
||||||
err("gossipsub: unsubcribeBackoff parameter error, Must be > 0 seconds")
|
err("gossipsub: unsubscribeBackoff parameter error, Must be > 0 seconds")
|
||||||
elif parameters.publishThreshold >= parameters.gossipThreshold:
|
elif parameters.publishThreshold >= parameters.gossipThreshold:
|
||||||
err("gossipsub: publishThreshold parameter error, Must be < gossipThreshold")
|
err("gossipsub: publishThreshold parameter error, Must be < gossipThreshold")
|
||||||
elif parameters.graylistThreshold >= parameters.publishThreshold:
|
elif parameters.graylistThreshold >= parameters.publishThreshold:
|
||||||
@ -416,11 +416,11 @@ method onTopicSubscription*(g: GossipSub, topic: string, subscribed: bool) =
|
|||||||
prune: @[ControlPrune(
|
prune: @[ControlPrune(
|
||||||
topicID: topic,
|
topicID: topic,
|
||||||
peers: g.peerExchangeList(topic),
|
peers: g.peerExchangeList(topic),
|
||||||
backoff: g.parameters.unsubcribeBackoff.seconds.uint64)])))
|
backoff: g.parameters.unsubscribeBackoff.seconds.uint64)])))
|
||||||
g.broadcast(mpeers, msg)
|
g.broadcast(mpeers, msg)
|
||||||
|
|
||||||
for peer in mpeers:
|
for peer in mpeers:
|
||||||
g.pruned(peer, topic, backoff = some(g.parameters.unsubcribeBackoff))
|
g.pruned(peer, topic, backoff = some(g.parameters.unsubscribeBackoff))
|
||||||
|
|
||||||
g.mesh.del(topic)
|
g.mesh.del(topic)
|
||||||
|
|
||||||
|
|||||||
@ -102,7 +102,7 @@ type
|
|||||||
GossipSubParams* = object
|
GossipSubParams* = object
|
||||||
explicit*: bool
|
explicit*: bool
|
||||||
pruneBackoff*: Duration
|
pruneBackoff*: Duration
|
||||||
unsubcribeBackoff*: Duration
|
unsubscribeBackoff*: Duration
|
||||||
floodPublish*: bool
|
floodPublish*: bool
|
||||||
gossipFactor*: float64
|
gossipFactor*: float64
|
||||||
d*: int
|
d*: int
|
||||||
|
|||||||
@ -40,7 +40,7 @@ proc generateNodes*(
|
|||||||
msgIdProvider = msgIdProvider,
|
msgIdProvider = msgIdProvider,
|
||||||
anonymize = anonymize,
|
anonymize = anonymize,
|
||||||
maxMessageSize = maxMessageSize,
|
maxMessageSize = maxMessageSize,
|
||||||
parameters = (var p = GossipSubParams.init(); p.floodPublish = false; p.historyLength = 20; p.historyGossip = 20; p.unsubcribeBackoff = 1.seconds; p))
|
parameters = (var p = GossipSubParams.init(); p.floodPublish = false; p.historyLength = 20; p.historyGossip = 20; p.unsubscribeBackoff = 1.seconds; p))
|
||||||
# set some testing params, to enable scores
|
# set some testing params, to enable scores
|
||||||
g.topicParams.mgetOrPut("foobar", TopicParams.init()).topicWeight = 1.0
|
g.topicParams.mgetOrPut("foobar", TopicParams.init()).topicWeight = 1.0
|
||||||
g.topicParams.mgetOrPut("foo", TopicParams.init()).topicWeight = 1.0
|
g.topicParams.mgetOrPut("foo", TopicParams.init()).topicWeight = 1.0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user