Commit Graph

448 Commits

Author SHA1 Message Date
Steven Allen
243fc72921
Merge pull request #82 from libp2p/test/metadata
test: add metadata test
2019-05-31 20:38:05 -07:00
Steven Allen
9a662b9911 test: add metadata test 2019-05-31 19:58:37 -07:00
Steven Allen
e15116528b
Merge pull request #81 from libp2p/fix/interned-nil-panic
set map in constructor
2019-05-31 19:45:56 -07:00
whyrusleeping
47c4411477 set map in constructor 2019-05-31 18:31:04 -07: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
Steven Allen
aeb6adb266
Merge pull request #79 from libp2p/feat/better-intern
improve interning
2019-05-28 01:38:17 -07:00
Steven Allen
d2e2c56c66 feat: intern agent versions
This also starts taking up a bunch of memory after a while.
2019-05-27 14:41:29 -07:00
Steven Allen
fd3ea885ff feat: improve protocol interning
This used to specify a max size/count but that was only because this logic was
shared between all peerstores (including the on-disk one). Now that:

1. This only applies to the in-memory one.
2. We never actually GC these.

We can just intern indefinitely.
2019-05-27 14:35:05 -07:00
Raúl Kripalani
4353646945
Consolidate abstractions and core types into go-libp2p-core (#69) 2019-05-23 18:11:06 +01:00
vyzo
80303a4b47
Merge pull request #78 from libp2p/feat/segmented-map
segment the memory peerstore + granular locks
2019-05-18 11:45:42 +03: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
28b1a9f31d don't track segment sizes, it's a fruitless optimization 2019-05-17 23:39:21 +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
d340d2983e cosmetics 2019-05-17 13:14:39 +03:00
vyzo
3140aaa2c3 implement protobook for pstoreds 2019-05-17 13:13:18 +03:00
vyzo
a9e3f07759 global interned protocol table 2019-05-17 12:47:07 +03:00
vyzo
5ed17f0b79 embed lock in segment 2019-05-17 12:37:46 +03:00
vyzo
08caa87351 refactor protocol functionality into ProtoBook 2019-05-17 12:33:33 +03:00
vyzo
ea23986270 segmented protocol info 2019-05-09 12:14:03 +03:00
vyzo
303b1b6207 update segment size on gc 2019-05-09 11:20:12 +03:00
Raúl Kripalani
e7e511ba99 segment the memory peerstore; granular locks. 2019-05-09 00:27:58 +01:00
Steven Allen
96639ef5f4
Merge pull request #76 from libp2p/fix/issue-75
don't delete under the read lock
2019-04-28 12:28:17 -07:00
vyzo
f21f6eac4f don't eager gc 2019-04-28 16:21:07 +03:00
vyzo
c58ce1f56f add Close method to memory address book, which cancels the gc process 2019-04-28 12:19:26 +03:00
vyzo
e4cf50160f periodically schedule gc 2019-04-28 12:17:48 +03:00
vyzo
d0a3cc17f4 don't delete under the read lock
let gc clean up the addrs
2019-04-28 11:35:23 +03:00
Steven Allen
3291020401
Merge pull request #74 from libp2p/feat/rwlock
Read/Write locking
2019-04-27 12:53:42 -07:00
vyzo
3cd491431b read/write metadata lock 2019-04-27 22:19:49 +03:00
vyzo
0ddad15bd2 read/write address book lock 2019-04-27 22:19:39 +03:00
vyzo
af2cb17f80 read/write protocol lock 2019-04-27 22:15:45 +03:00
Steven Allen
b496ee5433
Merge pull request #71 from libp2p/feat/optimize-mem
optimize peerstore memory
2019-04-23 09:41:50 -07:00
Steven Allen
b94490421d peerstore: bump number/size of interned protocol names
512 * 256 (max path length on many systems) = 128KiB
2019-04-23 09:36:39 -07:00
Steven Allen
1017515eca
Merge pull request #72 from libp2p/fix/unmarshal-peer-id
fix unmarshalling of peer IDs
2019-04-23 09:29:43 -07:00
Steven Allen
926321cd88 fix unmarshalling of peer IDs 2019-04-23 00:59:28 -07:00
Steven Allen
b65b48dbe1 intern protocol names
Ideally, we'd store a bitmap. But we'll have to think through how we want that
to play out with the datastore-backed peerstore (maybe move the `*Protocols`
methods down to the backend implementation?).
2019-04-23 00:54:18 -07:00
Steven Allen
aae59b7403 optimize memory of in-memory peerstore 2019-04-23 00:10:05 -07:00
Raúl Kripalani
ab02c26ae9
Merge pull request #70 from libp2p/fix/err-handling
fix error handling in UpdateAddrs: return on error
2019-04-16 22:16:09 +01:00
Raúl Kripalani
662be3b0a4 fix error handling: return on err. 2019-04-16 22:11:14 +01:00
Steven Allen
deb2163a68
Merge pull request #67 from libp2p/fix/keep-temp-addresses
keep temp addresses for 2 minutes
2019-04-12 10:32:51 -07:00
Steven Allen
30a9a2acf4 keep temp addresses for 2 minutes
Unfortunately, services like the DHT are slow enough that we can forget
addresses before we successfully dial.
2019-04-11 21:51:01 -07:00
Raúl Kripalani
eaba0f4384 farewell gx; thanks for serving us well. 2019-04-11 21:11:16 +01:00
Yusef Napora
cfad1e67a3 update readme badges 2019-04-09 11:56:53 -04:00
Matt Joiner
9ae3eaaeb0
Add to comment on KeyBook.PrivKey (#64) 2019-04-08 18:11:34 +10:00
Matt Joiner
d9cfa764ad Implement fmt.Stringer for PeerInfo 2019-03-11 14:16:16 +11:00
Raúl Kripalani
d2a21b6d4a
Merge pull request #61 from libp2p/b32migrate
migrate to multiformats/go-base32
2019-02-28 18:47:45 +00:00
Raúl Kripalani
2c5bc31271 migrate to multiformats/go-base32. 2019-02-28 18:34:51 +00:00
Raúl Kripalani
80f2a8c5e1
add go.mod, update travis 2019-02-28 18:33:05 +00:00
Raúl Kripalani
19a5811ba3 update ipfs deps post-gomodding them. 2019-02-28 17:59:54 +00:00
Raúl Kripalani
5866c85fe6 add go.mod and update travis. 2019-02-28 17:04:29 +00:00