156 Commits

Author SHA1 Message Date
vyzo
2bc51e0cf2 peer gater scaffolding 2020-09-07 13:38:02 +03:00
vyzo
3b92bdc1e9 rich router acceptance semantics
Allows us to ignore payload messages when the validation queue is under strain
2020-09-07 13:38:02 +03:00
vyzo
06a12f17b7 reduce log verbosity; debug mostly 2020-09-01 20:42:50 +03:00
vyzo
3a81c24073 don't add direct peers to fanout 2020-08-10 21:00:00 +03:00
Raúl Kripalani
a86ae585a6 reference spec change in comment. 2020-08-10 15:18:25 +03:00
vyzo
46536eccc4 fix backoff slack time 2020-08-10 15:18:25 +03:00
vyzo
8c08ebaecb use the heartbeat interval for slack time 2020-08-10 15:18:25 +03:00
vyzo
f2c25c2228 add slack time to prune backoff clearance 2020-08-10 15:18:25 +03:00
vyzo
8945f91465 only do PX on leave if PX was enabled in the node 2020-06-15 10:30:58 +03:00
Alan Shaw
c0712c6e92 feat: add direct connect ticks option
In [drand](https://github.com/drand/drand) we have a gossipsub relay to allow users to subscribe to getting random values over pubsub. We want to support pure gossip relays who relay from a relay. For this we need direct peering agreements and want to mitigate the possibility of "missing" randomness messages by ensuring the direct connect ticks period is less than the period between updates.

This PR simply adds a new functional option allowing us to set the direct connect ticks value without modifying the global variable.
2020-05-27 16:26:41 +03:00
vyzo
9a1171a0ef fix outbound constraint satisfaction in oversubscription pruning 2020-05-26 20:41:53 +03:00
Yusef Napora
bac68a1ba3 add doc comment for GossipSubDout 2020-05-20 18:48:28 +03:00
Yusef Napora
c041642546 add note about opp. graft threshold 2020-05-20 18:48:28 +03:00
Yusef Napora
22403baadd stop using term "gossip mesh" 2020-05-20 18:48:28 +03:00
Yusef Napora
3dab80fdd5 add doc comments to gossipsub constants 2020-05-20 18:48:28 +03:00
Yusef Napora
9c730661bc add delivery tags for "near-first" msg deliveries 2020-05-19 19:26:53 +03:00
Yusef Napora
28d17a4cab add tagTracer to apply connmgr tags 2020-05-19 19:26:53 +03:00
vyzo
31c9b219f4 use the proto we already have in AddPeer to determine whether the connection houses the stream 2020-05-18 23:20:38 +03:00
vyzo
4207beae0d only count an outbound connection if it has a pubsub stream 2020-05-18 23:20:38 +03:00
vyzo
09e6d9e1e3 cache scores throughout the heartbeat 2020-05-18 23:20:38 +03:00
vyzo
7890c5a458 maintain outboud peer quota 2020-05-18 23:20:38 +03:00
vyzo
d74def1661 precompute outbound peers on AddPeer, add Dout 2020-05-18 23:20:38 +03:00
vyzo
7d320ac87a only allow GRAFT from outbound peers when we are at or over Dhi 2020-05-18 23:20:38 +03:00
vyzo
39fc35f7cb check if already in the mesh in handleGraft to support concurrent grafting 2020-05-18 23:20:38 +03:00
vyzo
375b9b51df gossip tracer implementation 2020-05-08 16:45:31 +03:00
vyzo
4394e52a6f gossip tracer preliminaries 2020-05-08 16:45:31 +03:00
vyzo
d3ae6ab3a7 extended internal tracing for multiple objects, not just score 2020-05-08 16:45:31 +03:00
vyzo
5363d59203 better backoff handling
- Specify backoff in PRUNE message
- Obey peer backoff if specified
- Remove BackoffPenalty, handle lack of respect for backoff through P7
2020-05-07 01:45:04 +03:00
Yusef Napora
94015cee77 factor out doSendRPC and doDropRPC methods 2020-05-06 19:01:22 +03:00
Yusef Napora
21a4f8c0c8 only call fragmentRPC if we're over the size limit 2020-05-06 19:01:22 +03:00
Yusef Napora
cb02a50cd8 split large IWANT / IHAVE messages, add unit test 2020-05-06 19:01:22 +03:00
Yusef Napora
b1de03b608 try to send control messages in one RPC when fragmenting 2020-05-06 19:01:22 +03:00
Yusef Napora
27f009a9c7 fragment large RPCs in sendRPC 2020-05-06 19:01:22 +03:00
vyzo
ce9a0b7edf use log.Warn instead of Warning 2020-05-05 21:10:14 +03:00
vyzo
ea95ae8975 reify fanoutTTL in the GossipSubRouter struct 2020-04-23 18:38:26 +03:00
vyzo
5397bb5abc pull overlay parameters into the GossipSubRouter struct
pacify the race detector in travis
2020-04-23 13:40:50 +03:00
vyzo
11ef2a9cf2 fix the global variable mutation races 2020-04-22 21:08:13 +03:00
vyzo
ca7b1f3dbf make initial delay for direct peer connections a variable 2020-04-22 21:08:13 +03:00
vyzo
32c3fb325d remove unnecessary length check 2020-04-22 21:08:13 +03:00
vyzo
c00b476fb4 add test for gossipsub direct peers 2020-04-22 21:08:13 +03:00
vyzo
235c28ff49 truncate per peer message id lists 2020-04-20 19:53:12 +03:00
vyzo
8bc2c5c0f1 log counts in IHAVE flood protection measures 2020-04-20 19:53:12 +03:00
vyzo
a645afd1b3 add backoff penalty for GRAFT floods 2020-04-20 19:53:12 +03:00
vyzo
9ab44c5069 make maximum number of IHAVE messages accepted per heartbeat configurable 2020-04-20 19:53:12 +03:00
vyzo
8150843cf3 improve handling of IHAVE floods 2020-04-20 19:53:12 +03:00
vyzo
34f2295c19 add protections from IHAVE floods 2020-04-20 19:53:12 +03:00
vyzo
1645516276 add protections from GRAFT floods 2020-04-20 19:53:12 +03:00
vyzo
9904d69cde configurable number of peers for opportunistic grafting 2020-04-18 11:09:06 +03:00
vyzo
6732f9848b fix typo
Co-Authored-By: Raúl Kripalani <raul@protocol.ai>
2020-04-18 11:09:06 +03:00
vyzo
8a53469c43 fix typo
Co-Authored-By: Raúl Kripalani <raul@protocol.ai>
2020-04-18 11:09:06 +03:00