1723 Commits

Author SHA1 Message Date
Joonas Koivunen
f8332818ff doc(fs): note why the combinators are used 2021-08-04 12:49:48 +03:00
Joonas Koivunen
ef0577e540 refactor(fs): simplify Either usage
either required the use of the empty stream, which probably was an
additional extra type which is now worked away with.
2021-08-04 12:49:48 +03:00
Joonas Koivunen
a6f877b50c fix(fs): move FsBlockStore::list outside of async_trait
see comments in #458. it is unknown why this is needed but it does work
away of the compiler error.

it was later found out by bisecting Cargo.lock that this is caused by
async-trait 0.1.42 => 0.1.43 upgrade, but it's very unclear why this
would be caused by the only PR in that release.
2021-08-04 12:49:34 +03:00
bors[bot]
f403c350e6
Merge #468
468: chore(clippy) r=koivunej a=Mirko-von-Leipzig

Changes with clippy fixes. Split into smaller commits -- can be squashed if desired.

Co-authored-by: Mirko von Leipzig <mirko.vonleipzig@gmail.com>
2021-08-02 15:00:30 +00:00
Mirko von Leipzig
8581e3ed18 Revert "ci: allow rustfmt and clippy to fail"
This reverts commit 019613425d14164c077419bca90d8483571adbae.
2021-08-02 14:49:56 +02:00
Mirko von Leipzig
7594c6af3a chore(fmt) 2021-08-02 14:49:09 +02:00
Mirko von Leipzig
5e1427c563 chore(clippy): prefer Path to PathBuf 2021-08-02 14:49:09 +02:00
Mirko von Leipzig
d793ad8313 chore(clippy): assert_eq on bool 2021-08-02 14:49:09 +02:00
Mirko von Leipzig
c4e1b13a2e chore(clippy): manual re-impl of container methods 2021-08-02 14:49:09 +02:00
Mirko von Leipzig
24839d70cd chore(clippy): nested patterns 2021-08-02 14:49:09 +02:00
Mirko von Leipzig
4ff39a7998 chore(clippy): panic should use fmt style 2021-08-02 14:49:09 +02:00
Mirko von Leipzig
f4a1a9bfca chore(clippy): clone of copy type 2021-08-02 14:49:09 +02:00
Mirko von Leipzig
b732b7ab24 chore(clippy): redundant borrows 2021-08-02 14:49:09 +02:00
Mirko von Leipzig
5340a38fa2 chore(clippy): prefer From to Into 2021-08-02 14:49:08 +02:00
bors[bot]
7ab0939886
Merge #469
469: Fix (windows) build r=koivunej a=koivunej

The old vcpkg commit `ffa41582f78478812c836a6e8ce315fb27431182` has started segfaulting for some unknown reason. This PR:

1. updates run-vcpkg, openssl-sys, openssl along with vcpkg revision `261c458af6e3eed5d099144aff95d2b5035f656b`
2. disables CI on mobile platforms for now
3. allows rustfmt and clippy to fail

(2) is to save CI seconds until we know better; when this was decided previously CI seconds were practically unlimited; we'll need another decision on that. I don't think anyone is using the android build for example yet.

(3) will follow up with another PR to handle these.

Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2021-08-02 12:03:25 +00:00
Joonas Koivunen
019613425d ci: allow rustfmt and clippy to fail 2021-08-02 14:43:27 +03:00
Joonas Koivunen
ecd163ada9 chore: bump vcpkg, openssl-sys, openssl 2021-08-02 14:42:10 +03:00
Joonas Koivunen
e093e7546d ci: upgrade to run-vcpkg 7.4
hopefully it would have better diagnostic.
2021-08-02 14:42:10 +03:00
Joonas Koivunen
86b85b7bb9 ci: disable building on mobile platforms for now
if you want to contest this change, please do go ahead and let us know
you'd benefit from having these enabled. originally they were added
because adding multiple images to build worked most of the time without
any downside with unlimited free CI.
2021-08-02 14:42:10 +03:00
bors[bot]
4bce4679de
Merge #457
457: Migrate dnslink to trust-dns r=koivunej a=koivunej

Ahead next version of libp2p-dns which will finally use trust-dns. Added FIXMEs and more importantly get rid of the windows specific ipconfig, custom future impl around selectok. This shouldn't really affect anything so I doubt this needs to be mentioned in changelog. The IPNS story is quite weak as it is.

Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2021-02-09 17:42:56 +00:00
Joonas Koivunen
07458ac010 refactor(dnslink): refresh tests, try with ci 2021-02-05 22:30:31 +02:00
Joonas Koivunen
02336a5380 feat(dnslink): impl with trust-dns-resolver 2021-02-05 22:30:24 +02:00
bors[bot]
7ae8ff953f
Merge #456
456: Fix swarmapi tests and add more cases r=koivunej a=koivunej

This PR fixes the swarm tests and yet another swarmapi related panic reachable through only the swarmapi "unit tests". It also adds a two new cases which would had been quite ugly add to under `tests/`. 

First of all, the test had been broken long time ago in a rust-libp2p update when the listening address adding became asynchronous.

The additional panic exposed by now working test case comes from the `inject_connected` never arriving when only using SwarmApi as the only behaviour. It uses the DummyProtocolHandler which opens no streams and demands keepalive, the connection is immediatedly closed.

The additional test cases cover connecting to wrong peerid, and dialing multiple addresses when only first one succeeds, the second errors.

Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Co-authored-by: Joonas Koivunen <joonas@equilibrium.co>
2021-02-02 15:12:47 +00:00
Joonas Koivunen
0a4c2648ef
doc(swarmapi): apply comment suggestions
Co-authored-by: ljedrz <ljedrz@users.noreply.github.com>
2021-02-02 17:11:16 +02:00
Joonas Koivunen
83bef83ed4 refactor(swarmapi): make mk_transport build the swarm 2021-02-02 17:10:07 +02:00
Joonas Koivunen
f064389c92 chore: clippy 2021-02-01 19:02:05 +02:00
Joonas Koivunen
1807d13b28 add(subscription): SubscriptionErr::into_inner
this allows not leaking the SubscriptionErr type anywhere more, but it
is sort of kicking the can on the way as we are starting to desperately
need proper error types instead of the stringified one.
2021-02-01 19:02:05 +02:00
Joonas Koivunen
9908ae953b doc(subscription): add a note why assertion exists 2021-02-01 19:02:05 +02:00
Joonas Koivunen
eccc632f51 refactor(swarmapi): split test into two
noted that these two tests are borderline cases to explore through
exercising only the networkbehaviour api surface of swarmapi.
2021-02-01 19:02:05 +02:00
Joonas Koivunen
efab455c7d test(swarmapi): add case for bad peerid, one winner 2021-02-01 19:02:05 +02:00
Joonas Koivunen
222817437f doc(swarmapi): discuss alternatives in test case 2021-02-01 19:02:05 +02:00
Joonas Koivunen
9daf24c395 fix(swarmapi): fix bug found with fixed test
the test case is rather special one: when the connection is established
there will be a disconnect right away. the unconditional subscription
finishing tripped up the "debug assert" in subscriptions. it might be a
bit wrong to end up with an `Ok(())` value with the test case, but that
is the outcome currently.
2021-02-01 19:02:05 +02:00
Joonas Koivunen
79fba49b79 fix(swarmapi): unit test
this was broken in some upgrade, not the most recent one. it cleverly
only looked like it was doing something but since starting to listen on
an address doesn't do anything but queue up the request, there is
nothing to do for the for-loop and so everything dies down. luckily we
might not need this async unit test here.
2021-02-01 19:02:05 +02:00
bors[bot]
2c540928c0
Merge #454
454: Fix connecting to peers r=koivunej a=koivunej

The correct way to connect to a peer is in my understanding to DialPeer and then proceed to give the address of that said peer from `NetworkBehaviour::addresses_of_peer`. While doing this, the previous workaround for missing events from banning a peer (the way we force a disconnect) was also necessary to fix.

Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2021-01-28 12:21:55 +00:00
bors[bot]
23fc80b360
Merge #455
455: test: split off common_tests from common r=koivunej a=koivunej

Tiny refactoring to stop testing `common::tests` as part of every top level `test/*.rs`, noticed during #454.

Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2021-01-28 08:45:38 +00:00
Joonas Koivunen
d8a282eb65 test: split off common_tests from common 2021-01-28 08:53:16 +02:00
Joonas Koivunen
01e058e4e3 doc(ipfs): update connect and disconnect docs 2021-01-27 19:40:41 +02:00
Joonas Koivunen
590068413d chore(changelog): note the fix 2021-01-27 19:40:41 +02:00
Joonas Koivunen
a54c545017 fix(swarmapi): connect using DialPeer not -Address
while libp2p might soon gain the ability to dial peer addresses
directly, this will be a stopgap until that. updated a bunch of comments
and adapted to the since fixed missing events on banning the peer, which
is still used to disconnect peer at will.
2021-01-27 19:40:27 +02:00
Joonas Koivunen
98ef7d7e8f refactor(swarmapi): prefer hash_map::Entry api 2021-01-27 19:25:29 +02:00
Joonas Koivunen
fa38c27af1 fix(subs): drop mutexguard before panicking
otherwise it'll poison the mutex and we'll get double panic during
unwind.
2021-01-27 19:25:29 +02:00
Joonas Koivunen
225e40ea18 add(p2p): missing std::fmt::Display for MultiaddrWithoutPeerId 2021-01-27 19:25:26 +02:00
Joonas Koivunen
f8a3879ee5 feat(p2p): MultiaddrWithoutPeerId::with
allows converting MultiaddrWithoutPeerId into MultiaddrWithPeerId
2021-01-27 19:25:24 +02:00
Joonas Koivunen
775f162887 add(p2p): PartialEq<Multiaddr> convinience 2021-01-27 19:25:21 +02:00
Joonas Koivunen
22e7b6cb76 test(connectivity): connecting to wrong peerid 2021-01-27 19:04:32 +02:00
bors[bot]
cf37032508
Merge #453
453: Fix multinode test spans r=koivunej a=koivunej

This PR changes how the spans are set up from IpfsOptions and in UninitializedIpfs. While debugging the now ignored test (see #450) I found that the spans were configured wrong and thus none of the multiple nodes created by `spawn_nodes` could be differentiated.

This also renames the spans to more logical from the "$root" given at `IpfsOptions::span`:

`Span::current` => `$root:init`
`Span::current` => `$root:init:swarm`
`$root:swarm` => `$root:exec` (literally the executor libp2p spawns futures through)
`$root` => `$root:bg_task` => `$root:swarm` (background task)
`$root` => `$root:facade` (futures created through Ipfs::* methods)

Still very far from perfect, but perhaps a step into better direction.

Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2021-01-27 14:58:28 +00:00
Joonas Koivunen
329587d793 fix: remove last in_current_span called on async value 2021-01-26 14:37:49 +02:00
Joonas Koivunen
143cdff62d doc: fix comments on spans 2021-01-26 14:34:27 +02:00
Joonas Koivunen
e01b03a247 chore(CHANGELOG): note span renames 2021-01-26 14:23:14 +02:00
Joonas Koivunen
9d7f0929a0 fix: rename spans around
Differences (old => new):
- "ipfs:swarm" => "ipfs::exec"
- "ipfs[:bg_task]" => "ipfs::swarm"

The previous commit already changed introduced and separated "ipfs" and
"ipfs:facade".
2021-01-26 13:45:56 +02:00