From 14d1a35e0cbaf080b6590530c53702d2df90fa74 Mon Sep 17 00:00:00 2001 From: vyzo Date: Fri, 4 Sep 2020 14:49:25 +0300 Subject: [PATCH] more docs --- gossip_tracer.go | 10 ++++++++-- pubsub.go | 3 ++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/gossip_tracer.go b/gossip_tracer.go index cdf91212..bafb8f4d 100644 --- a/gossip_tracer.go +++ b/gossip_tracer.go @@ -14,8 +14,14 @@ import ( // The tracking of promises is probabilistic to avoid using too much memory. type gossipTracer struct { sync.Mutex - msgID MsgIdFunction - promises map[string]map[peer.ID]time.Time + + msgID MsgIdFunction + + // promises for messages by message ID; for each message tracked, we track the promise + // expiration time for each peer. + promises map[string]map[peer.ID]time.Time + // promises for each peer; for each peer, we track the promised message IDs. + // this index allows us to quickly void promises when a peer is throttled. peerPromises map[peer.ID]map[string]struct{} } diff --git a/pubsub.go b/pubsub.go index 6cab8d49..c2624dab 100644 --- a/pubsub.go +++ b/pubsub.go @@ -188,7 +188,8 @@ type AcceptStatus int const ( // AcceptAll signals to accept the incoming RPC for full processing AcceptNone AcceptStatus = iota - // AcceptControl signals to accept the incoming RPC only for control message processing + // AcceptControl signals to accept the incoming RPC only for control message processing by + // the router. Included payload messages will _not_ be pushed to the validation queue. AcceptControl // AcceptNone signals to drop the incoming RPC AcceptAll