76 Commits

Author SHA1 Message Date
Steven Allen
19ffbb3a48
Re-enable disabled gossipsub test (#566)
And change it to take into account the fact that libp2p now trims
connections immediately (when no grace-period is specified) instead of
waiting for a timeout.
2024-08-06 20:43:28 +00: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
Marco Munizaga
dbd1c9eade
Fix: Own our CertifiedAddrBook (#555)
* Subscribe to libp2p events to maintain our own Certified Address Book

* Update go version

* Use TestGossipsubStarTopology test instead of new test

* Don't return an error in manageAddrBook

* Return on error while subscribing

* Use null resource manager so that the new IP limit doesn't break tests

* Mod tidy
2024-05-20 17:13:30 -07:00
Marco Munizaga
c0a528ee7b
Replace fragmentRPC with appendOrMergeRPC (#557)
This will allow us to add more logic around when we split/merge
messages. It will also allow us to build the outgoing rpcs as we go
rather than building one giant rpc and then splitting it.
2024-05-02 09:40:54 -07:00
Sukun
d13e24ddc9
remove usage of deprecated peerid.Pretty method (#542) 2023-09-14 11:11:11 +03: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
Marco Munizaga
68cdae031b
Gossipsub: Unsubscribe backoff (#488)
* Implement Unsusbcribe backoff

* Add test to check that prune backoff time is used

* Update which backoff to use in TestGossibSubJoinTopic test

* Fix race in TestGossipSubLeaveTopic

* Wait for all the backoff checks, and check that we aren't missing too many

* Remove open question
2022-06-03 06:46:56 +03:00
nisdas
aeb30a2ac1 Add in Backoff Check 2022-02-08 09:20:54 +02:00
nisdas
3d93f5f991 Add Backoff For Pruned Peers 2022-02-07 14:09:18 +02: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
Ian Davis
2efd313b83
cleanup: fix vet and staticcheck failures (#435)
* cleanup: fix vet failures and most staticcheck failures

* Fix remaining staticcheck failures

* Give test goroutines chance to exit early when context is canceled
2021-07-22 15:27:32 -07:00
Steven Allen
0094708cc4
Refactor Gossipsub Parameters To Make Them More Configurable (#421)
Co-authored-by: nisdas <nishdas93@gmail.com>
2021-05-03 08:59:15 -07:00
nisdas
f7f33e10cc satisfy race detector 2020-09-10 12:39:04 +03:00
nisdas
b0d384d2e8 clean up 2020-09-10 12:39:04 +03:00
nisdas
309d45acef copy string topic 2020-09-10 12:39:04 +03:00
vyzo
73880606b5 add test for topic score parameter reset method 2020-09-09 16:57:36 +03:00
vyzo
769831b478 add regression test for issue 371 2020-08-10 21:00:00 +03:00
Raúl Kripalani
ae55bf9603 upgrade deps + interoperable uvarint delimited writer/reader. 2020-07-30 14:00:54 +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
Yusef Napora
906c941b29 sleep longer for travis 2020-05-19 19:26:53 +03:00
Yusef Napora
568fa5a244 close stream in test 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
4427c3def7 fix prune message in test 2020-05-06 19:01:22 +03:00
Yusef Napora
cb65238a39 fix race condition in rpc fragmentation test 2020-05-06 19:01:22 +03:00
Yusef Napora
8642662340 rewrite test for rpc fragmentation 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
deee35d9b8 fix apparent flakiness in test 2020-05-04 09:42:20 +03:00
vyzo
213da1cf8c add test exercising score integration with extended validation 2020-05-04 09:42:20 +03:00
vyzo
8b7e7a1103 fix typo 2020-04-27 18:35:25 +03:00
vyzo
5c1b637dce add test for peer score inspection 2020-04-27 18:35:25 +03:00
vyzo
01041fa327 improve reliability of star topology tests
Configure the star with 0 D, to act as a proper bootstrapper
2020-04-23 13:40:50 +03:00
vyzo
caffc3bf2c make star topology tests more reliable
probabilities are such that they occasionally fail
2020-04-23 13:40:50 +03:00
vyzo
1a3695988b import grouping 2020-04-23 13:40:50 +03:00
vyzo
94db23fd41 add signed peer records only in the center of the star for signed peer record test 2020-04-23 13:40:50 +03:00
Yusef Napora
516a32c7ad add test with signed peer records 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
a50deb04c0 a little bit more time to avoid races with restoring mutated config variables 2020-04-22 21:08:13 +03:00
vyzo
6a230e711e add a heartbeat's worth of delay before restoring mutated globals
the race detector cries on travis
2020-04-22 21:08:13 +03:00
vyzo
6d24f46a13 reduce prune backoff times for opportunistic grafting test 2020-04-22 21:08:13 +03:00
vyzo
bac5d5910c add test for opportunistic grafting 2020-04-22 21:08:13 +03:00
vyzo
2eaa566371 add direct test for gossipsub router's piggybackControl 2020-04-22 21:08:13 +03:00
vyzo
a67441be61 rename tests for consistency 2020-04-22 21:08:13 +03:00
vyzo
f7c398087a add test for negative scores below the gossip threshold 2020-04-22 21:08:13 +03:00
vyzo
eccded1360 add test for gossipsub enough peers 2020-04-22 21:08:13 +03:00
vyzo
8cffbc4bd6 add test for gossipsub flood publishing 2020-04-22 21:08:13 +03:00
vyzo
c00b476fb4 add test for gossipsub direct peers 2020-04-22 21:08:13 +03:00