101 Commits

Author SHA1 Message Date
sukun
1aeb6ebc6a
chore: upgrade go-libp2p (#575)
Co-authored-by: Steven Allen <steven@stebalien.com>
2024-08-16 19:57:24 +03:00
galargh
097b4671b0 chore: staticcheck 2024-08-06 19:52:49 +00:00
galargh
8f56e8c97a chore: update rand usage 2024-08-06 19:52:49 +00:00
Steven Allen
1f5b81fb61
test: use the regular libp2p host (#565)
This removes dependencies on swarm/testing and the blank host.

1. swarm/testing really shouldn't be used at all except for internal
libp2p stuff.
2. The blank host should only be used in _very_ special cases (autonat,
mostly).
2024-07-11 10:32:18 +00:00
Sukun
b5ee222289
chore: update go-libp2p to v0.32 (#548) 2023-11-01 14:32:36 +01:00
vyzo
829f9026a3
Default validator support (#525)
* add default validator support

* add an implementation for basic seqno as nonce validation

* missing return

* the nonce belongs to the origin peer

* add note about rust predicament

* add seqno validator tests

* minor test tweak, ensure at least 1ms before replay
2023-03-01 16:15:54 +02:00
Marten Seemann
4f56e8f0a7
update go-libp2p to v0.22.0 (#498)
* update go-libp2p to v0.22.0

* skip TestGossipsubConnTagMessageDeliveries
2022-08-26 02:45:41 -07:00
Nishant Das
ca702289e6
update pubsub deps (#491) 2022-06-30 07:30:19 +03:00
Gus Eggert
c6dd285c5d
feat: plumb through context changes (#459) 2021-11-11 11:09:45 -05:00
Simon Zhu
628353661b Create peer filter option 2021-09-21 13:50:09 +03:00
vyzo
b080f595bb add test for inbound stream deduplication 2021-01-12 17:18:00 +02:00
Adin Schmahmann
4336d5ae71 test: add test for if nodes are connected before pubsub is started 2020-12-07 10:27:35 +02:00
vyzo
15f4f1f138 fix flaky test
10ms is _not_ sufficient for travis
2020-07-30 14:27:04 +03:00
Raúl Kripalani
ae55bf9603 upgrade deps + interoperable uvarint delimited writer/reader. 2020-07-30 14:00:54 +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
Yusef Napora
f87e7b72d7 test delivery tags vs sybil storm 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
9c7bc987f7 add test for invalid message author 2020-04-23 18:38:26 +03:00
vyzo
96066d320f increase delay for TestPeerDisconnect
10ms don't seem to be enough for travis
2020-04-23 18:38:26 +03:00
vyzo
8d89949131 increase travis friendliness for new tests 2020-04-23 18:38:26 +03:00
vyzo
7fddef3d6f add test for assorted pubsub options that were not covered 2020-04-23 18:38:26 +03:00
vyzo
1246e80812 add test for announce retry 2020-04-23 18:38:26 +03:00
vyzo
a2f6f7b5b5 increase time to disconnect in floodsub disconnection test
somehow it managed to fail on travis
2020-04-22 21:08:13 +03:00
vyzo
7903222907 move validation tests to their own file 2020-04-21 10:57:28 +03:00
vyzo
7c8e7857fa deflake TestValidatorOverload
reguarly fails on travis with successful validation; the timings were just wrong.
2020-04-21 10:57:28 +03:00
Raúl Kripalani
1f147c2457
make wire protocol message size configurable. (#261) 2020-02-25 18:07:16 -08:00
Adin Schmahmann
5ef7439d71 interface: New Topic + TopicEventHandlers objects.
Added PubSub.Join(topic) that returns a Topic object. This object can be Subscribed and Published to as well as to get a TopicEventHandler for topic events. This means that the Subscription object will no longer handle PeerEvents and that PubSub's Publish and Subscribe functions are deprecated.
2019-10-31 15:37:44 -04:00
Adin Schmahmann
6551b41f12 go fmt 2019-10-18 04:25:52 -04:00
Adin Schmahmann
d28f450046 expose the peer that propagates a message to the recipient 2019-10-18 02:39:37 -04:00
Adin Schmahmann
97e63e477e better context respect when waiting for new peer events. refactored backlog into eventLog. removed test that was no longer useful. 2019-08-06 00:26:40 -04:00
Adin Schmahmann
57f2c1efdd Refactored events to be camel case. 2019-08-02 12:25:57 -04:00
Adin Schmahmann
48c9847240 oops forgot a return. separated out and added more comments to the new tests. 2019-08-02 00:46:49 -04:00
Adin Schmahmann
934b813b9a stronger notification deliveries backed by unbounded buffer 2019-08-01 16:57:05 -04:00
Adin Schmahmann
be69856a1d Fixed some unnecessary Leave notifications.
Combined Join and Leave events into a single API with a struct that specifies whether the event is a Join or a Leave.
2019-06-12 10:06:16 -04:00
Adin Schmahmann
817651a6d1 Subscription Join events now fire even for peers connected to us before we subscribe.
Added a Subscription Leave event
2019-06-11 17:49:28 -04:00
Adin Schmahmann
cc791f28b9 Made TestSubscriptionNotification thread safe 2019-06-07 09:21:17 -04:00
Adin Schmahmann
8037a2e60f Add the ability to handle newly subscribed peers 2019-06-07 08:31:14 -04:00
Raúl Kripalani
49274b0e8a
migrate to consolidated types. (#185) 2019-05-26 17:19:03 +01:00
Raghav Gulati
3c78c237ce
Remove empty line in imports 2019-05-08 10:09:30 -07:00
Raghav Gulati
08c4a28ee3
Better comment for signing with a different key
Note that the second message is the incorrectly signed message.
2019-05-08 09:27:57 -07:00
Raghav Gulati
a726a896db
Use names rather than index
We've aliased array elements, use the explicit names instead.
2019-05-08 09:27:26 -07:00
Raghav Gulati
594e6a4ab9
Add a note why we're expecting two messages
As the adversary has turned of signature verification, we should expect
to see two messages (the correctly signed and the incorrectly signed
one) when we publish. Those that have verification on, should only see
one.
2019-05-08 09:00:25 -07:00
Raghav Gulati
84bb35ebf4
Bump wait from 10 -> 50ms
This matches the waits in the rest of the package.
2019-05-08 09:00:00 -07:00
Raghav Gulati
b136dae80c
Remove erroneous subscribe 2019-05-08 08:59:47 -07:00
Raghav Gulati
8272eb583e
Change test name to reflect no relaying
Improperly named test. In this test, we're only testing that we reject
malicious messages.
2019-05-08 08:59:12 -07:00
Raghav Gulati
516c32e854
Remove commented out code
bhost import was commented out.
2019-05-07 15:05:00 -07:00
Raghav Gulati
6b2635b6ac
adversaryPeer -> adversary 2019-05-07 10:17:55 -07:00
Raghav Gulati
d740f53531
adversarial -> adversary 2019-05-07 10:14:37 -07:00
Raghav Gulati
b44471d7ce
Ensure that the received message is the correct one 2019-05-07 10:10:05 -07:00
Raghav Gulati
ed746477f9
Reduce time to wait
2 seconds per wait seemed a bit aggressive. Halved the total time of the test.
2019-05-07 10:09:40 -07:00