152 Commits

Author SHA1 Message Date
vyzo
f1be0f1296 don't spawn an extra goroutine for the validator context 2018-01-13 22:14:01 +02:00
vyzo
145a84a33b use a single channel for all validation results 2018-01-13 22:02:28 +02:00
vyzo
f6081fb061 pushMsg should just call maybePublishMessage when it doesn't need validation 2018-01-13 21:56:57 +02:00
vyzo
473a5d2873 sendMsg should have a buffer 2018-01-13 21:39:35 +02:00
vyzo
edcb251ad1 install global validation throttle, use reasonable defaults. 2018-01-13 21:15:40 +02:00
vyzo
856a25c8eb WithMaxConcurrency is WithValidatorConcurrency
and defaultMaxConcurrency is defaultValidateConcurrency.
2018-01-13 20:56:03 +02:00
vyzo
bf2151ba5f the sendMsg channel should yield pointers for consistency 2018-01-13 20:47:28 +02:00
vyzo
5ef13c764e don't always spawn a goroutine for sending a new message 2018-01-13 20:11:32 +02:00
vyzo
c95ed28496 add validation context for cancelation on aborts 2018-01-13 18:34:00 +02:00
vyzo
fba445bc6d code cosmetics
reword pushMsg for less indentation nesting.
2018-01-13 14:44:33 +02:00
vyzo
982c4de960 per subscription validation throttle and more efficient dispatch logic 2018-01-13 14:31:34 +02:00
vyzo
d2f6a0050f WithValidator and WithValidatorTimeout are subscription options 2018-01-13 12:33:03 +02:00
vyzo
4241241031 fix dangling maxConcurrency reference 2018-01-13 12:24:31 +02:00
keks
88274db0bb make maximum concurrency configurable, split loop 2018-01-13 12:15:27 +02:00
keks
fe09d1eea3 make validator timeout configurable 2018-01-13 12:13:54 +02:00
keks
6e8b9f2d5c fix timeout 2018-01-13 12:13:54 +02:00
keks
02877cda71 complete validator functions
- make validators time out after 100ms
  - add context param to validator functions
  - add type Validator func(context.Context, *Message) bool
- drop message if more than 10 messages are already being validated
2018-01-13 12:13:54 +02:00
keks
89e6a06f3c better tests for validation 2018-01-13 12:12:21 +02:00
keks
197a5982a4 ungxify 2018-01-13 12:12:21 +02:00
keks
7dd4e0bfeb vet
used for range variable inside goroutine, now passed as argument
2018-01-13 12:12:21 +02:00
keks
1945f895a2 log when validator discards message 2018-01-13 12:12:21 +02:00
keks
930f264a27 typedef subscription options and fix typo 2018-01-13 12:12:21 +02:00
keks
647bb98655 optionally allow caller to validate messages 2018-01-13 12:12:21 +02:00
vyzo
0ec8f2fa08
Merge pull request #54 from libp2p/feat/better-atomic-counter
Narrow the message seqno to 64bit
2018-01-03 22:43:49 +02:00
vyzo
95dce910ba narrow the message seqno to 64bit again
Uses the atomic counter initialized at instantiation time, which saves
a few bytes and a syscall per message.
2018-01-03 20:30:28 +02:00
vyzo
979ae33fc7
Merge pull request #53 from libp2p/fix/atomic-counter
Use atomic counter for message seqnos
2018-01-03 19:53:33 +02:00
vyzo
8a31b41b4c use atomic counter for message seqnos; timestamp is insufficient 2018-01-03 11:25:20 +02:00
ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ
54413c29cc
Merge pull request #50 from libp2p/jenkinsfile
Create Jenkinsfile
2017-12-13 21:19:31 +01:00
Steven Allen
3856705124
Merge pull request #48 from libp2p/kevina/travisci
Update Travis CI to use standard test script and go 1.9.x.
2017-12-05 01:11:40 +00:00
Steven Allen
923bb920bf gx publish 0.9.7 gx/v0.9.7 2017-12-05 01:11:18 +00:00
ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ
d545c905e2
Create Jenkinsfile 2017-11-27 13:15:23 +01:00
Steven Allen
5eedebda93 gx publish 0.9.6 gx/v0.9.6 2017-11-20 14:23:56 -08:00
Kevin Atkinson
c17c7236b5 Disable sudo in Travis CI. 2017-11-17 23:04:19 -05:00
Kevin Atkinson
a3f5dc469d Update Travis CI to use standard test script and go 1.9.x. 2017-11-17 22:36:56 -05:00
Steven Allen
10a9fb0903 gx publish 0.9.5 gx/v0.9.5 2017-11-14 12:49:43 -08:00
Steven Allen
e3844b7d14 Merge pull request #44 from libp2p/gx/update-lxc2hc
gx: update go-peerstream
2017-10-19 08:12:54 -07:00
Steven Allen
c000ea01e2 gx publish 0.9.4 gx/v0.9.4 2017-10-19 07:41:34 -07:00
Steven Allen
fb6cc3172e Merge pull request #41 from film42/gt/package-name
Rename gx package to go-libp2p-floodsub
2017-10-16 08:53:31 -07:00
Garrett Thornburg
9db226f672 Rename gx package to go-libp2p-floodsub
Resolves https://github.com/libp2p/go-floodsub/issues/7
2017-10-16 09:22:10 -04:00
Steven Allen
6d14add4a3 Merge pull request #39 from libp2p/fix/38
mark the peer as dead if the inbound stream closes
2017-10-14 16:26:20 -07:00
Steven Allen
56ea7752e8 better worker cleanup
1. Don't hang marking a peer as dead if we're shutting down.
2. No need to "drain" the outgoing channel anymore. This may have been necessary
to prevent a deadlock where the main loop blocked on sending on sending a
message while we waited to tell the main loop that the peer was dead. However,
this is no longer an issue (we never block on sending).
2017-10-14 11:19:21 -07:00
Steven Allen
a01778ac78 test peer disconnect 2017-10-14 09:32:31 -07:00
Steven Allen
3e0c53e2a7 mark the peer as dead if the inbound stream closes
fixes #38
2017-10-14 09:24:44 -07:00
Jeromy
82b5814c05 gx publish 0.9.3 gx/v0.9.3 2017-10-06 07:29:47 -07:00
Steven Allen
9366bd3c31 gx publish 0.9.2 gx/v0.9.2 2017-09-15 18:50:52 -07:00
Steven Allen
0e28f929b8 gx publish 0.9.1 gx/v0.9.1 2017-09-15 16:57:36 -07:00
Jeromy Johnson
2b1a843e79 Merge pull request #37 from libp2p/fix/use-reset
use reset where appropriate
2017-09-15 16:42:11 -07:00
Steven Allen
238bd82a7f use reset where appropriate
(especially when walking away from read-only streams)
2017-09-15 16:28:46 -07:00
Steven Allen
33a57ac760 gx publish 0.9.0 gx/v0.9.0 2017-09-12 23:42:37 -07:00
Steven Allen
2709da6f16 Merge pull request #36 from libp2p/gx/update-37wfbd
gx: update go-ws-transport
2017-09-05 16:28:38 -07:00