Commit Graph

21 Commits

Author SHA1 Message Date
vyzo 06a12f17b7 reduce log verbosity; debug mostly 2020-09-01 20:42:50 +03:00
vyzo efd56962bc track validation time 2020-08-21 10:51:13 +03:00
Diederik Loerakker 99507107b6
Merge pull request #359 from protolambda/optional-sig-origin-seq
Signing policy + optional Signature, From and Seqno
2020-07-23 08:47:47 +03:00
Edgar Aroutiounian 9de0241df1 [validation] Use label for break 2020-05-13 09:58:12 +03:00
Edgar Aroutiounian 04e971fa0d [validation] break not used correct - need return or give label, i choose return 2020-05-13 09:58:12 +03:00
vyzo ce9a0b7edf use log.Warn instead of Warning 2020-05-05 21:10:14 +03:00
vyzo 63e7ba850c add comment about validationThrottled suerpseding ValidationIgnore 2020-05-04 09:42:20 +03:00
vyzo 5a7a4fcf84 fix typo
Co-Authored-By: Yusef Napora <yusef@protocol.ai>
2020-05-04 09:42:20 +03:00
vyzo 1901383099 implement extended validator support 2020-05-04 09:42:20 +03:00
vyzo 1c4f0920fe use named constants for tracing message rejection reasons 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 e17e266aa9 track message delivery time within the validation pipeline 2020-04-18 11:09:06 +03:00
Piotr Dyraga 499109b165
Configurable size of validate queue
validateWorker() reads from validateQ and invokes validate function
that performs validation of the message. Signature validation is performed
synchronously. The number of validate workers defaults to the number of CPUs
and can be updated with WithValidateWorkers function. With no additional user
validators, signature validation is the bottleneck when receiving new messages.

Increasing the number of validating workers does not help given the context
switching and bottleneck nature of this spot. As stated in WithValidateWorkers
documentation, this function should be used rather to limit the number of workers
to devote less CPU time for synchronous validation. On the other hand, with the
default size of `validateQ`, some applications built on a top of libp2p may
experience throttled validation and lost messages.

This problem is addressed by WithValidateQueueSize allowing to configure the buffer
size for synchronous validation. Application developers knowing the nature of their
protocols can set this value to minimise the possibility of throttled synchronous
validation and dropped messages. Configurable buffer size allows to gracefully
handle peaks of messages and, from the other side, the number of concurrent
synchronous workers is still limited by validateWorkers property so the receiver
should not get congested.
2020-01-21 10:19:42 +01:00
protolambda 7981f9bfbd
fixes #247: implement msg id function as pubsub option 2019-12-16 03:54:40 +01:00
vyzo 958e09a5b3 remove useless nil check when initializing subsystem tracers 2019-11-15 20:42:04 +02:00
vyzo 67275a6382 tracing scaffolding 2019-11-15 20:42:04 +02:00
Adin Schmahmann d28f450046 expose the peer that propagates a message to the recipient 2019-10-18 02:39:37 -04:00
Raúl Kripalani 49274b0e8a
migrate to consolidated types. (#185) 2019-05-26 17:19:03 +01:00
vyzo 2df9d940bf remove unnecessary context in validateSingleTopic 2019-05-14 14:17:32 +03:00
vyzo f4d9eeec26 improve godocs 2019-05-14 14:03:08 +03:00
vyzo cb423f474d split off validation into its own type 2019-05-14 14:03:08 +03:00