Commit Graph

111 Commits

Author SHA1 Message Date
Marco Munizaga
b09e1283ae Use mock clock in pstoreds and tests 2022-05-26 14:47:26 -07:00
Marten Seemann
005ad81f7e remove all calls to peer.ID.Validate 2021-12-19 16:04:37 +04:00
Marten Seemann
048b94159f remove the pstoremanager (will be moved to the Host) 2021-12-08 18:44:20 +04:00
Marten Seemann
51974ae06e when passed an event bus, automatically clean up disconnected peers 2021-12-02 12:07:58 +04:00
Marten Seemann
a3a997d014 implement RemovePeer 2021-12-02 11:57:28 +04:00
Marten Seemann
a66346d0c1
chore: update go-log to v2 (#179) 2021-11-27 17:40:23 +04:00
Marten Seemann
9749083212
Merge pull request #172 from libp2p/limit-protocols
limit the number of protocols we store per peer
2021-10-29 18:43:53 +02:00
Gus Eggert
566ed64074
feat: plumb through datastore contexts (#176) 2021-10-28 16:32:18 -04:00
Marten Seemann
5eae6d6caf limit the number of protocols we store per peer 2021-10-22 18:01:08 +02:00
Marten Seemann
3f028c937b reduce mutex contention in SetProtocols 2021-10-22 15:51:34 +02:00
muXxer
6139fde311 fix: replace deprecated call 2021-08-12 16:09:17 +02:00
Steven Allen
517a48433f chore: cleanup addr book patch
1. Remove duplicate import.
2. Lift empty check to simplify code.
3. Use a more efficient map key (go will optimize this to not allocate).
2021-07-20 17:30:09 -07:00
Maxim Merzhanov
8c02e08cd3 reduce complexity in update addr book method 2021-07-20 17:30:09 -07:00
Steven Allen
d5e4862e0f fix: avoid using the disk in datastore tests
Makes the timing much less problematic, especially in CI.
2021-07-20 17:18:43 -07:00
Steven Allen
7afb11e00d test: don't run datastore tests in parallel
We have timing dependencies in some of these tests.
2021-07-20 17:17:41 -07:00
Steven Allen
99836f05e7 test: use leveldb instead of badger
Badger has issues on 32bit operating systems.
2021-07-16 19:45:29 -07:00
Steven Allen
2c64af26c3 fix: log sequence ds error 2021-07-16 15:40:47 -07:00
Steven Allen
35bbffb1c5 fix: fix some race conditions in the ds address book 2021-07-16 15:37:49 -07:00
Steven Allen
4808543c09 fix: address lints 2021-07-16 10:38:05 -07:00
Steven Allen
90f363555f chore: update to latest go error handling
We no longer need the "errors" package.
2021-07-16 10:38:00 -07:00
Steven Allen
9aa80d7506 fix: avoid copying locks/waitgroups 2021-07-15 17:16:22 -07:00
Steven Allen
56ebb42d5f fix: always update address TTLs in a signed peer record
Previously, we'd only set the TTL if the addresses were new.
2020-06-05 18:36:56 -07:00
Ignacio Hagopian
1542834878
fix other race
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2020-06-05 15:17:36 -03:00
Ignacio Hagopian
33ea692817
fix race
Signed-off-by: Ignacio Hagopian <jsign.uy@gmail.com>
2020-06-05 15:02:43 -03:00
Aarsh Shah
dd0775df6d changes for the new interface 2020-05-11 13:07:08 +05:30
Aarsh Shah
7a58f873f4 peer supports any protocol 2020-05-08 12:10:14 +05:30
Steven Allen
785ee8c8fd fix: handle nil peer IDs
Feels like Java all over again.

fixes #87
2020-04-05 23:05:41 -07:00
Yusef Napora
59abcf549d
Certified addresses (#98) 2020-03-06 12:07:36 +00:00
Steven Allen
b4dc608f50 chore(dep): update go-log 2020-02-17 11:38:14 -05:00
Steven Allen
2fb6d7a48f fix multiple TTL bugs
The first fix independently extends the address expiration time and the address
TTL:

By example:

* We have an address with a TTL of 4s that will expire in 1s.
* We update it with a TTL of 3s.

Before this change:

* We end up with an address with a TTL of 3s that will expire in 3s.

After this change:

* We end up with an address with a TTL of 4s that will expire in 3s.

---

The second fix prevents the in-memory addressbook from announcing existing
addresses every time their TTLs get updated.

---

The third fix correctly updates TTLs for existing addresses in the on-disk
addressbook.

This fixes https://github.com/libp2p/go-libp2p-identify/issues/2
2019-07-24 17:04:37 -07:00
Raúl Kripalani
ad0faef7c7
make RemoveProtocols take the write lock. (#90) 2019-07-10 15:45:49 +01:00
Raúl Kripalani
3d3a10dd54
protobook: support removing protocols. (#84) 2019-06-19 23:53:07 +01:00
Steven Allen
0b5b389640 dep: switch to core (#80)
* dep: switch to core

Specifically, remove go-libp2p-{crypto,peer} deps.

* catch a few more usages of deprecated packages.
2019-05-31 14:51:16 +01:00
vyzo
7fac6b6d98 use segments in ds protobook instead of a lock array 2019-05-18 11:42:47 +03:00
vyzo
07ee3fb062 make lock methods private 2019-05-17 23:41:05 +03:00
vyzo
afca355218 index the peer ID strings directly to avoid copying the byte slice 2019-05-17 23:36:46 +03:00
vyzo
3140aaa2c3 implement protobook for pstoreds 2019-05-17 13:13:18 +03:00
Raúl Kripalani
662be3b0a4 fix error handling: return on err. 2019-04-16 22:11:14 +01:00
Raúl Kripalani
2c5bc31271 migrate to multiformats/go-base32. 2019-02-28 18:34:51 +00:00
Raúl Kripalani
4806c742b5 pstoreds: remove dirty flag when deleting from db. 2019-02-21 19:31:19 +00:00
Raúl Kripalani
135471f291 add io.Closer interface and implementation to Peerstore. 2019-02-19 11:45:32 +00:00
Raúl Kripalani
4e7d772db3 pstoreds: remove async flushing on read: now sync. 2019-02-18 16:35:48 +00:00
Raúl Kripalani
25f53120b8 gc: drain async flush queue with grace period before closing. 2019-02-15 18:44:05 +00:00
Raúl Kripalani
d7e9f78273 increment WaitGroups before spawning goroutines. 2019-02-15 18:43:34 +00:00
Raúl Kripalani
86f1626c51 fix tests; run lookahead after initial delay. 2019-02-06 16:05:02 +00:00
Raúl Kripalani
25e4df45aa change default purge interval to 2 hours. 2019-02-06 14:43:10 +00:00
Raúl Kripalani
e16cac9f5e make addrsRecord.Clean() private. 2019-02-06 14:40:51 +00:00
Raúl Kripalani
3966498df4 improve docs; cyclic batch arg; validations. 2019-02-06 14:36:51 +00:00
Raúl Kripalani
fec786e9ef pstore ds: make gc lookahead window optional. 2019-02-06 09:35:10 +00:00
Raúl Kripalani
9da98d7fcf factor out cyclic batch into file; and gc into type. 2019-02-05 17:53:50 +00:00