Commit Graph

44 Commits

Author SHA1 Message Date
vyzo f742e5439f fix bug in penalties from message rejection
the first source of the invalid message was _not_ penalized!
2020-04-27 18:35:25 +03:00
vyzo 1e920ed426 fix IPv4 -vs- IPv6 address handling in peer address tracking 2020-04-18 11:09:06 +03:00
vyzo 432caf4fdf more rigorously defeat unspecified address gremlins 2020-04-18 11:09:06 +03:00
vyzo 0a9a87cf04 fix issue with unspecific IPv6 addrs in conn IP tracking
Also, don't track loopback addrs.
2020-04-18 11:09:06 +03:00
vyzo e1d6b49b2d fix bug in peerScore.setIPs
It was removing all old addresses, not just the ones in the new addres slice
2020-04-18 11:09:06 +03:00
Raúl Kripalani fc38f556a3 comments and nits. 2020-04-18 11:09:06 +03:00
vyzo 8f3471cdfd correctly attribute invalid message deliveries due to self origin rejection 2020-04-18 11:09:06 +03:00
vyzo a1488680e7 rename delivery_ constants to satisfy the camelcase worshipers and nitpickers 2020-04-18 11:09:06 +03:00
vyzo 1c4f0920fe use named constants for tracing message rejection reasons 2020-04-18 11:09:06 +03:00
vyzo ea7305245d add IP whitelist for colocation factor penalty 2020-04-18 11:09:06 +03:00
vyzo 68b86a4b66 use manet.ToIP instead of hand-rolling multiaddr to IP conversion 2020-04-18 11:09:06 +03:00
vyzo 7a3848073e only retain negative scores 2020-04-18 11:09:06 +03:00
vyzo c65a520799 topic score cap 2020-04-18 11:09:06 +03:00
vyzo 1b387b0068 rename score debug option, address some comments around inspection
- Use nil for the never fire channel when there is no inspection
- Defer a score inspection for shutdown to get one final sample on shutdown
2020-04-18 11:09:06 +03:00
vyzo 375b66b0c1 move score parameter types to their own file 2020-04-18 11:09:06 +03:00
vyzo 588f7b85c0 add option to periodically inspect peer scores for debugging purposes 2020-04-18 11:09:06 +03:00
vyzo d5e432a62b move score starting nil check inside the score implementation 2020-04-18 11:09:06 +03:00
vyzo 98671566a2 distinguish throttled validation because of a full worker queue. 2020-04-18 11:09:06 +03:00
vyzo 39e65e8729 peer score parameter validation 2020-04-18 11:09:06 +03:00
vyzo 4175342bc8 implement periodic maintenance 2020-04-18 11:09:06 +03:00
vyzo f550385493 implement getIPs and refreshIPs 2020-04-18 11:09:06 +03:00
vyzo 38fbc7fa47 implement message delivery struct details 2020-04-18 11:09:06 +03:00
vyzo 7d862e2ee6 double check delivery to aboid duplicate counts 2020-04-18 11:09:06 +03:00
vyzo 48b7d01113 finetune sticky mesh failure penalty parameter 2020-04-18 11:09:06 +03:00
vyzo f40b06e515 sticky mesh failure penalty parameter 2020-04-18 11:09:06 +03:00
vyzo b7a49b2708 clean up the logic of mesh delivery window 2020-04-18 11:09:06 +03:00
vyzo 5fa0f9ed6a more logical code ordering 2020-04-18 11:09:06 +03:00
vyzo ca6778bc83 simplify duplicate mesh delivery tracking 2020-04-18 11:09:06 +03:00
vyzo 9c0b96f4e7 comment cosmetics 2020-04-18 11:09:06 +03:00
vyzo e17e266aa9 track message delivery time within the validation pipeline 2020-04-18 11:09:06 +03:00
vyzo 3610b05538 peer tracking 2020-04-18 11:09:06 +03:00
vyzo 283593fbc0 mesh tracking 2020-04-18 11:09:06 +03:00
vyzo 535c04481e minimize hash table accesses 2020-04-18 11:09:06 +03:00
vyzo 16eeacd798 message delivery tracking 2020-04-18 11:09:06 +03:00
vyzo dd3ce7760c respect the time in mesh cap 2020-04-18 11:09:06 +03:00
vyzo 8c0deb877d respec decay to zero parameter in counter decay 2020-04-18 11:09:06 +03:00
vyzo b1aff8d752 add nil check in Score function
necessary for when the score is not specified in gossipsub router.
2020-04-18 11:09:06 +03:00
vyzo 398fb82e5f fix peer IP tracking structure 2020-04-18 11:09:06 +03:00
vyzo 20e3cf02b1 peer score refresh: counter decay and mesh activation 2020-04-18 11:09:06 +03:00
vyzo 38883df429 peer score calculation 2020-04-18 11:09:06 +03:00
vyzo 8d82c2bdec explicit Start for peer scoring to inject the router
so that we can unit test without a router.
2020-04-18 11:09:06 +03:00
vyzo a02c4136b1 peer score parameters 2020-04-18 11:09:06 +03:00
vyzo c13e9c07e4 hook peer score into control message handlers 2020-04-18 11:09:06 +03:00
vyzo 7d928697a2 peer score scaffolding 2020-04-18 11:09:06 +03:00