54 Commits

Author SHA1 Message Date
ljedrz
e251a2de29 chore: remove unused async-trait dep in bitswap
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-14 11:26:36 +02:00
ljedrz
4001e01a44 refactor: remove unused tokio features
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:15:47 +02:00
ljedrz
8be75f7a4a feat: change the async executor to tokio
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-13 16:15:14 +02:00
ljedrz
a9712ef740 chore: put Rust-IPFS contributors as authors
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-11 15:14:43 +02:00
ljedrz
d20131077a fix: consider the possibility that a peer is no longer available in send_block
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-06 16:02:05 +02:00
ljedrz
b5c0dcf907 docs: comment on not dropping peer stats on disconnects
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-06 16:02:05 +02:00
ljedrz
576ee6b92e fix: tweak a comment (drive-by)
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-06 16:02:05 +02:00
ljedrz
2dfabdf66a fix: patch a Bitswap leak and test it
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-08-06 16:02:04 +02:00
Caio
94d9b0a358 Future-proof unused dependencies 2020-08-01 13:44:27 -03:00
Caio
d3bd3f649f Use default-features = false where applicable 2020-08-01 13:29:48 -03:00
ljedrz
0e45c71c7f
chore: expand a bitswap comment
Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2020-07-31 16:35:42 +02:00
ljedrz
c0524d5791 fix: don't report bogus empty bitswap messages
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-31 16:12:55 +02:00
ljedrz
dc4cea6df5 refactor: less noisy upgrade_outbound
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-31 14:45:49 +02:00
bors[bot]
02beb5f46b
Merge #263
263: move bitswap Stats directly under Bitswap r=koivunej a=ljedrz

This makes the bitswap `Stats` persistent between peer disconnects.

In addition, remove the unused and no longer compatible `Ledger` tests.

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-07-30 14:04:16 +00:00
ljedrz
c1b30ff89f fix: persist the bitswap peer stats
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-30 12:50:36 +02:00
ljedrz
e52108d564 feat: improve some Debug impls and add a few extra logs
Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-29 14:54:38 +02:00
ljedrz
a284c1f841 feat: replace log with tracing
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-29 14:50:00 +02:00
ljedrz
6188425c59 chore: remove unused Ledger tests
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-27 11:14:32 +02:00
ljedrz
b1aa5a2a7d refactor: move bitswap stats directly under the Bitswap object
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-27 11:11:56 +02:00
ljedrz
fc5d63319e perf: make Block equality depend only on its Multihash
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-23 12:52:23 +02:00
bors[bot]
7a74c74c35
Merge #255
255: update libp2p again r=koivunej a=ljedrz

Needed for our `substrate-ipfs` project, as `substrate` just updated it.

Co-authored-by: ljedrz <ljedrz@gmail.com>
2020-07-21 14:50:47 +00:00
Joonas Koivunen
578cebc820
doc: apply suggestions from code review
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2020-07-21 16:39:27 +03:00
ljedrz
cc26f40d14 feat: update libp2p again
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-21 14:50:06 +02:00
Joonas Koivunen
b6b14e93ba doc: add fixmes to bitswap 2020-07-21 15:44:21 +03:00
Joonas Koivunen
cb6e57a8a6 fix: use unbounded ch instead of Arc<Mutex<Vec<_>>>
Arc<Mutex<Vec<_>>> depended on the fact that the blocks were read
blockingly. This way we will get wakeups when the reads complete.
2020-07-21 15:44:21 +03:00
ljedrz
88c7219790 feat: update some dependencies
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-21 10:31:55 +02:00
ljedrz
0635c57b8a chore: remove some logs
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-15 12:23:01 +02:00
ljedrz
5fe6fa9b70 fix: don't send out received wanted Cids if we already have them in the wantlist
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-15 11:40:58 +02:00
ljedrz
19a77616d7 refactor: keep subscription accounting within the registry
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-14 16:04:28 +02:00
ljedrz
3d564526e8 fix: make wantlist conformance tests pass
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-14 11:43:11 +02:00
ljedrz
a5f17bb4ed perf: remove an unneeded to_vec()
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-13 15:43:42 +02:00
ljedrz
91d97b2586 feat: change Message.cancel from Vec to a HashSet
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-08 11:42:43 +02:00
ljedrz
e670faf1b4 chore: fix a bitswap comment
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-08 11:42:43 +02:00
ljedrz
fb1742a38e refactor: minify empty structs
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-08 10:45:26 +02:00
ljedrz
872913ce3f refactor: remove Bitswap.io_events, use NetworkBehaviourEventProcess for BitswapEvents
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-06 11:32:45 +02:00
ljedrz
33935bc109 refactor: better ledger stat handling
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-03 11:25:19 +02:00
ljedrz
dfe28f742b feat: remove the strategy from Bitswap
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-02 15:16:31 +02:00
ljedrz
78237faf43 feat: improve event handling
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-01 16:04:26 +02:00
ljedrz
29d22dfd2e refactor: move Stats into Ledger
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-01 15:44:41 +02:00
ljedrz
1df93d2a42 chore: cargo fmt
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-01 14:51:00 +02:00
ljedrz
078e506b5a refactor: remove the Strategy generic
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-01 14:51:00 +02:00
ljedrz
e0ea83cb7c chore: replace libipld dep with cid in bitswap
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-07-01 14:02:50 +02:00
ljedrz
304cef3d48 refactor: use a type alias for pinned+boxed futures
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-06-26 15:11:05 +02:00
ljedrz
1756d584e5 refactor: simplify ledger::Message
Signed-off-by: ljedrz <ljedrz@gmail.com>
2020-06-26 13:34:28 +02:00
Joonas Koivunen
02987aa77e chore: update rust-libp2p 2020-06-23 16:57:27 +03:00
Joonas Koivunen
7799d888f6
Upgrade libp2p 0.19.0 (#169)
* chore: upgrade the libp2p to 0.18.(0|1)
* refactor: fix most of the swarm with todos

mainly leaving the multiple connections case to panic.

* feat: add ability to configure listening addr

the original random listening address is still in place.

* add test case for the panic with two connections

* fix: allow multiple connections in p2p/swarm
* doc: Connection and the any connecting address
* chore: cleanup libp2p patching examples

* refactor: rename SwarmApi::stats

perhaps roundtrip_times is more readable.

* chore: upgrade to libp2p 0.19

* fix: awaiting for binding new listening addresses

the initial implementation didn't actually wait for anything other than
asking the swarm to start listening, but now the await will complete
only after a listening address has actually been bound. this required
some nasty matching on the multiaddr protocol parts which will hopefully
ever be used by test code but ... it works now, at least a bit better.

* fix test on macos, fix unspecified addr handling
2020-05-19 17:26:57 +03:00
David Craven
028b8074c3 wip dag put 2020-04-14 08:04:06 -04:00
Joonas Koivunen
2af43b4782 refactor: to_vec to into_vec per clippy 2020-04-02 13:04:00 +03:00
Joonas Koivunen
c1b1626399 chore: cargo fmt 2020-04-02 13:04:00 +03:00
Joonas Koivunen
608ca9f174 feat: bitswap stats with repo changes
this adds a BlockPut result in two places which is inferior to the more
complete bitswap refactoring. BlockPut will let the caller know if the
block was added or if it existed already. This is poorly implemented in
the fs blockstore.
2020-04-02 13:04:00 +03:00