1772 Commits

Author SHA1 Message Date
Addy Bryant
c3a48c9699 fix: updated libp2p in the bitswap crate 2022-04-01 12:11:39 +03:00
Addy Bryant
f601b8d3c7 fix: update libp2p and renamed the changed types 2022-04-01 12:11:39 +03:00
Christopher Joel
80d2b79cb7
Update src/ipld/dag_cbor.rs
Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2022-01-31 14:50:42 -08:00
Christopher Joel
888776f279
Update src/ipld/dag_cbor.rs
Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2022-01-31 14:50:27 -08:00
Chris Joel
8e0d5d5192 Update changelog 2022-01-31 10:47:30 -08:00
Chris Joel
c843f07d75 Strict ordering for DAG-CBOR-encoded map keys 2022-01-31 10:47:30 -08:00
bors[bot]
a78a6237db
Merge #480
480: build: fix wrong repo urls, clippies r=koivunej a=koivunej

I had forgotten some old urls there which are sure to cause build failures, as seen in the #479.


Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2022-01-31 10:44:18 +00:00
Joonas Koivunen
b4547596ae chore(ipfs/ipns): work around unused warning
this probably makes sense in the future if ipns dht records ever become
supported.
2022-01-31 12:10:00 +02:00
Joonas Koivunen
0927be1193 chore(ipfs): clippies
assorted unused or idiomatic changes.
2022-01-31 12:10:00 +02:00
Joonas Koivunen
e9355bd498 chore(http): unused warnings on query structs
these query types were originally observing what kind of requests
conformance tests do and what kind of requests go-ipfs supports, so
keeping them as there might be some value. to be removed when upgrading
conformance tests.
2022-01-31 12:10:00 +02:00
Joonas Koivunen
8b7011f638 chore(unixfs): clippies
this includes a change on making `unixfs::InvalidCidInLink` properly
`#[non_exhaustive]` instead of using the hidden field trick. it probably
isn't a breaking change, but then again requires a more recent rustc,
which sort of makes it a breaking change.
2022-01-31 12:10:00 +02:00
Joonas Koivunen
1b3842c769 ci: lock nodejs version 14 2022-01-31 12:10:00 +02:00
Joonas Koivunen
ed430faed0 build: fix wrong repo urls 2021-12-02 11:46:14 +02:00
bors[bot]
ad3ab49b4d
Merge #475
475: Fixing build issue described in: https://github.com/libp2p/rust-libp2p/issues/2231 r=koivunej a=karim-agha

When including rust-ipfs as a dependency in any crate, it fails with the following error:

```
error: failed to select a version for the requirement `aesni = "^0.7"`
candidate versions found which didn't match: 0.99.99, 0.10.0, 0.9.0, ...
location searched: crates.io index
required by package `aes v0.4.0`
    ... which is depended on by `aes-gcm v0.6.0`
    ... which is depended on by `snow v0.7.1`
    ... which is depended on by `libp2p-noise v0.30.0 (/home/alexander/dev/misc/rust-libp2p/transports/noise)`
    ... which is depended on by `libp2p v0.37.1 (/home/alexander/dev/misc/rust-libp2p)`
    ... which is depended on by `libp2p-relay v0.2.0 (/home/alexander/dev/misc/rust-libp2p/protocols/relay)`
```

This fix updates the libp2p version into one that has a fix for this dependency and now it compiles fine


Co-authored-by: Karim Agha <karim.dev@gmail.com>
2021-11-03 09:26:16 +00:00
Karim Agha
6f23f715e2 Fixing build issue described in: https://github.com/libp2p/rust-libp2p/issues/2231
When including rust-ipfs as a dependency in any crate, it fails with the following error:

    ```
    error: failed to select a version for the requirement `aesni = "^0.7"`
    candidate versions found which didn't match: 0.99.99, 0.10.0, 0.9.0, ...
    location searched: crates.io index
    required by package `aes v0.4.0`
        ... which is depended on by `aes-gcm v0.6.0`
        ... which is depended on by `snow v0.7.1`
        ... which is depended on by `libp2p-noise v0.30.0 (/home/alexander/dev/misc/rust-libp2p/transports/noise)`
        ... which is depended on by `libp2p v0.37.1 (/home/alexander/dev/misc/rust-libp2p)`
        ... which is depended on by `libp2p-relay v0.2.0 (/home/alexander/dev/misc/rust-libp2p/protocols/relay)`
    ```

    This fix updates the libp2p version into one that has a fix for this dependency and now it compiles fine
2021-10-20 10:32:26 +00:00
bors[bot]
111f116e36
Merge #473
473: Swarm cleanup following libp2p upgrade to v0.39.1 r=koivunej a=CHr15F0x

This is a follow up of https://github.com/rs-ipfs/rust-ipfs/pull/472. There are two changes introduced:
* remove eq_greedy as `Multiaddr` in `SwarmApi::pending_{addresses, connections}` contains p2p, align conversions accordingly (136496f7de),
* explicitly use `MultiaddrWithPeerId` in `SwarmApi::pending_{addresses, connections}` (3b6f69530f).

The former (136496f7de) works fine without the latter (3b6f69530f), however I am leaning more towards keeping both changes. Encoding the information about peer id presence/absence in Multiaddr in _type_ instead of relying on comments and `expect()`s improves readability and _developer experience_.

Please let me know what your thoughts are.

Co-authored-by: Krzysztof Lis <klis33@gmail.com>
2021-08-23 12:33:54 +00:00
Krzysztof Lis
05d420e3be chore(changelog): update 2021-08-23 14:20:48 +02:00
Krzysztof Lis
3b6f69530f refactor(swarm): pending_{addresses, connections} use MultiaddrWithPeerId
Enforce internal represenatation for `SwarmApi::pending_{addresses, connections}` to explicitly show that all multiaddrs include peer IDs by using `MultiaddrWithPeerId`.
2021-08-23 13:32:10 +02:00
Krzysztof Lis
136496f7de refactor(swarm): simplify usage of multiaddr after libp2p upgrade to 0.39
Get rid of eq_greedy.
2021-08-23 13:31:20 +02:00
bors[bot]
ede42ebe3e
Merge #472
472: chore: upgrade to libp2p 0.39 r=koivunej a=CHr15F0x

This PR is a follow up of #463.

It includes the following:
- upgrading libp2p to [v.0.39.1](https://github.com/libp2p/rust-libp2p/releases/tag/v0.39.1)
- upgrading some other deps (e.g.: prost, prost-base, quick-protobuf, base64), **excluding cid and multihash**
- fixes to tests that started failing following upgrade to libp2p v.0.38 in #463

Incoming shortly:
- [x] respective changelog update
- [x] ~~I haven't run the changes against current workflow, so some additional fixes could be necessary;~~ edit: though I did check against all tests locally numerous times during dev, albeit only in a linux/x64 environment; btw looks like the workflows are fine with the changes


Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
Co-authored-by: Krzysztof Lis <klis33@gmail.com>
2021-08-18 13:02:58 +00:00
Krzysztof Lis
c7a79980bd fix: code review - rework 2021-08-18 14:58:33 +02:00
Krzysztof Lis
a8851ebc92 chore: update changelog 2021-08-18 14:58:33 +02:00
Krzysztof Lis
99c3b81661 style: apply cargo fmt 2021-08-18 14:58:33 +02:00
Krzysztof Lis
414ccf5cbd chore: upgrade some of the other deps, fix tests 2021-08-18 14:58:33 +02:00
Krzysztof Lis
6c7004ae14 chore: upgrade to libp2p 0.39
Includes replacing `upgrade::{write_one, read_one}` with `upgrade::{write_length_prefixed, read_length_prefixed}` respectively, which is a direct consequence of [PR2111](https://github.com/libp2p/rust-libp2p/pull/2111).
2021-08-18 14:57:47 +02:00
Joonas Koivunen
b487c3e7fd chore: upgrade to libp2p 0.38 2021-08-17 15:13:40 +02:00
bors[bot]
08f840b834
Merge #471
471: ci: cache improvements r=koivunej a=Mirko-von-Leipzig

This PR improves the CI caching, roughly halving the time required when caches are hit (no dependency or toolchain changes).

Overview of changes:

- Use [rust-cache action](https://github.com/Swatinem/rust-cache). This forms the bulk of the time improvement as Rust dependencies are now cached.
- Improve npm caching for conformance tests. This trims 2-3 minutes of build time.
- Improve job and step naming.
- Add a manual trigger for the workflow.
- Remove core dump for macos, no longer required.

Further details can be found in the commits.

I've been running into sporadic conformance test failures on windows ([link to run](https://github.com/Mirko-von-Leipzig/rust-ipfs/actions/runs/1135372291)):
```
  1) .pubsub.subscribe
       multiple connected nodes
         should send/receive 100 messages:
     FetchError: request to http://127.0.0.1:50533/api/v0/pubsub/pub?arg=pubsub-tests-C-aIrZS_7OSQMNSVOMszV failed, reason: read ECONNRESET
      at ClientRequest.<anonymous> (node_modules\node-fetch\lib\index.js:1455:11)
      at Socket.socketErrorListener (_http_client.js:475:9)
      at emitErrorNT (internal/streams/destroy.js:106:8)
      at emitErrorCloseNT (internal/streams/destroy.js:74:3)
      at processTicksAndRejections (internal/process/task_queues.js:82:21)
```

Co-authored-by: Mirko von Leipzig <mirko.vonleipzig@gmail.com>
2021-08-17 09:43:42 +00:00
Mirko von Leipzig
df11329836 ci: enable caching for vcpkg 2021-08-17 10:38:11 +02:00
Mirko von Leipzig
e2f31bc8de ci: consolidate steps and naming
Groups steps together where sensible, and made the naming more uniform.
2021-08-16 21:54:00 +02:00
Mirko von Leipzig
9d87e212a7 ci: fix conformance test npm caching
The setup for the conformance test would always build the npm packages.

Instead we now check for a cache hit, and only build if we miss.
2021-08-16 21:54:00 +02:00
Mirko von Leipzig
8f48aa0303 ci: remove macos core dump
This was used to debug a crash which no longer occurs.

Removing lets us simplify the workflow file, and improves caching.
2021-08-16 21:54:00 +02:00
Mirko von Leipzig
f8ab359e81 ci: use rust cache action
This replaces the existing one, which wasn't caching much.
2021-08-16 21:54:00 +02:00
Mirko von Leipzig
8c38e55d4d ci: improve job matrix naming
New name is simply the host OS.

Previously was a long string including all parameters, which wouldn't
fit on the GH page.
2021-08-16 21:54:00 +02:00
Mirko von Leipzig
0b3d08f7df ci: add workflow_dispatch trigger
This allows for manually triggering the workflow.
Particularly useful for running CI on forks without creating a PR.
2021-08-16 21:54:00 +02:00
bors[bot]
b37811f4f3
Merge #467
467: Use hash_hasher in hashmaps/sets where the key is a Cid/Multihash #258 r=CHr15F0x a=CHr15F0x

This PR implements a fix for #258, ie. using hash_hasher to improve performance in HashMaps/Sets what utilize Cid as key. hash_hasher provides approx. 40% increase in performance in this case.

There are two things that still need to be done:
- code is **not linted** yet, since this will be done in a separate PR by Mirko,
- a simple benchmark is included for the sake of comparing HashedMap<Cid,> vs HashMap<Cid,>; Imho this bench should not be merged.


Co-authored-by: Krzysztof Lis <klis33@gmail.com>
2021-08-04 13:03:38 +00:00
Krzysztof Lis
f6677d0df1 chore: update changelog 2021-08-04 15:02:00 +02:00
Krzysztof Lis
b713f86819 chore(deps): hash_hasher doesn't have any features 2021-08-04 15:01:03 +02:00
Krzysztof Lis
a0acb295e9 chore(lints): Post-rebase fmt and clippy fixes. 2021-08-04 15:01:03 +02:00
Krzysztof Lis
4e4be38456 perf: add bench for HashMap<Cid,> vs HashedMap<Cid,> 2021-08-04 15:01:03 +02:00
Krzysztof Lis
3254c05d44 perf: Use hash_hasher in hashmaps/sets where the key is a Cid/Multihash
Referenced-issues #258
2021-08-04 15:01:03 +02:00
bors[bot]
81b277ebd5
Merge #470
470: fix: compilation error when used as a dependency r=koivunej a=koivunej

Fixes the issue reported in [comment of #458](https://github.com/rs-ipfs/rust-ipfs/issues/458#issuecomment-869208699) that whenever dependent on, even without any code calling `ipfs`, there is a build failure. This PR:

- removes top-level Cargo.lock now that I've learned why it's not good to keep around
- adds weekly scheduled build
- moves the `FsBlockStore::list` method body over to `FsBlockStore::list0` outside the `#[async_trait] impl BlockStore for FsBlockStore { ... }` where it does get the correct lifetimes inferred for the returned boxed future

The original compilation failure was caused by `async-trait` 0.1.42 => 0.1.43 upgrade deduced by bisecting Cargo.lock changes. It's still unknown why does the moved version work, but there are probably a lot of subleties to the code generated by `async-trait`. I don't yet know if this warrants any upstream bug reports; most likely not, we were stuck on a quite old version and many crates now work with it.

Co-authored-by: Joonas Koivunen <joonas.koivunen@gmail.com>
2021-08-04 10:29:28 +00:00
Joonas Koivunen
2ee14634dc chore: note fix in changelog 2021-08-04 12:49:48 +03:00
Joonas Koivunen
be4043b602 fix(deps): anyhow std feature is required
this was not set originally because probably mpart-async sets it, but
the code in `ipfs` assumed `std` feature was enabled and thus the from
conversion was accessible.
2021-08-04 12:49:48 +03:00
Joonas Koivunen
fe9a0c933b ci: enable weekly builds
hopefully this will catch if we go out of sync with some upstream
crates.
2021-08-04 12:49:48 +03:00
Joonas Koivunen
08cfac9017 fix(ipfs): remove workspace Cargo.lock
this was kept around for ipfs-http but it lead to problems using the
ipfs crate as a dependency.
2021-08-04 12:49:48 +03:00
Joonas Koivunen
e59a1f4e00 doc(fs): update explanation for the list0 2021-08-04 12:49:48 +03:00
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]
b63eb14fda
Merge #466
466: In-memory reading from tar archives instead of extract to temp folder r=koivunej a=Scondo

Get rid of work with filesystem in fs-unrelated tests.

No more problems like https://github.com/rs-ipfs/rust-ipfs/issues/465 lead to tests failure.

Co-authored-by: Scondo <scondo@mail.ru>
2021-08-02 17:44:20 +00:00