Skip to content
This repository was archived by the owner on Oct 23, 2022. It is now read-only.

Commit ede42eb

Browse files
bors[bot]koivunejCHr15F0x
authored
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>
2 parents 08f840b + c7a7998 commit ede42eb

File tree

13 files changed

+189
-111
lines changed

13 files changed

+189
-111
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
* fix: connect using DialPeer instead of DialAddress [#454]
1111
* fix: compilation error when used as a dependency [#470]
1212
* perf: use hash_hasher where the key is Cid [#467]
13+
* chore: upgrade to libp2p 0.39.1, update most of the other deps with the notable exception of cid and multihash [#472]
1314

1415
[#429]: https://github.com/rs-ipfs/rust-ipfs/pull/429
1516
[#428]: https://github.com/rs-ipfs/rust-ipfs/pull/428
@@ -23,6 +24,7 @@
2324
[#454]: https://github.com/rs-ipfs/rust-ipfs/pull/454
2425
[#470]: https://github.com/rs-ipfs/rust-ipfs/pull/470
2526
[#467]: https://github.com/rs-ipfs/rust-ipfs/pull/467
27+
[#472]: https://github.com/rs-ipfs/rust-ipfs/pull/472
2628

2729
# 0.2.1
2830

Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test_js_interop = []
2121
anyhow = "1.0"
2222
async-stream = { default-features = false, version = "0.3" }
2323
async-trait = { default-features = false, version = "0.1" }
24-
base64 = { default-features = false, features = ["alloc"], version = "0.12" }
24+
base64 = { default-features = false, features = ["alloc"], version = "0.13" }
2525
ipfs-bitswap = { version = "0.1", path = "bitswap" }
2626
byteorder = { default-features = false, version = "1.3" }
2727
bytes = { default-features = false, version = "1" }
@@ -31,10 +31,10 @@ either = { default-features = false, version = "1.5" }
3131
futures = { default-features = false, version = "0.3.9", features = ["alloc", "std"] }
3232
hash_hasher = "2.0.3"
3333
ipfs-unixfs = { version = "0.2", path = "unixfs" }
34-
libp2p = { default-features = false, features = ["floodsub", "identify", "kad", "tcp-tokio", "mplex", "noise", "ping", "yamux", "dns"], version = "0.34" }
35-
multibase = { default-features = false, version = "0.8" }
34+
libp2p = { default-features = false, features = ["floodsub", "identify", "kad", "tcp-tokio", "mplex", "noise", "ping", "yamux", "dns-tokio"], version = "0.39" }
35+
multibase = { default-features = false, version = "0.9" }
3636
multihash = { default-features = false, version = "0.11" }
37-
prost = { default-features = false, version = "0.7" }
37+
prost = { default-features = false, version = "0.8" }
3838
serde = { default-features = false, features = ["derive"], version = "1.0" }
3939
serde_json = { default-features = false, features = ["std"], version = "1.0" }
4040
thiserror = { default-features = false, version = "1.0" }
@@ -49,7 +49,7 @@ sled = "0.34"
4949
once_cell = "1.5.2"
5050

5151
[build-dependencies]
52-
prost-build = { default-features = false, version = "0.7" }
52+
prost-build = { default-features = false, version = "0.8" }
5353

5454
[dev-dependencies]
5555
criterion = { default-features = false, version = "0.3" }

bitswap/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ license = "MIT OR Apache-2.0"
88
repository = "https://github.com/rs-ipfs/rust-ipfs"
99

1010
[build-dependencies]
11-
prost-build = { default-features = false, version = "0.7" }
11+
prost-build = { default-features = false, version = "0.8" }
1212

1313
[dependencies]
1414
cid = { default-features = false, version = "0.5" }
1515
fnv = { default-features = false, version = "1.0" }
1616
futures = { default-features = false, version = "0.3" }
1717
hash_hasher = "2.0.3"
18-
libp2p-core = { default-features = false, version = "0.27" }
19-
libp2p-swarm = { default-features = false, version = "0.27" }
18+
libp2p-core = { default-features = false, version = "0.29" }
19+
libp2p-swarm = { default-features = false, version = "0.30" }
2020
multihash = { default-features = false, version = "0.11" }
21-
prost = { default-features = false, version = "0.7" }
21+
prost = { default-features = false, version = "0.8" }
2222
thiserror = { default-features = false, version = "1.0" }
2323
tokio = { default-features = false, version = "1", features = ["rt"] }
2424
tracing = { default-features = false, version = "0.1" }

bitswap/src/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use thiserror::Error;
33
#[derive(Debug, Error)]
44
pub enum BitswapError {
55
#[error("Error while reading from socket: {0}")]
6-
ReadError(#[from] libp2p_core::upgrade::ReadOneError),
6+
ReadError(#[from] std::io::Error),
77
#[error("Error while decoding bitswap message: {0}")]
88
ProtobufError(#[from] prost::DecodeError),
99
#[error("Error while parsing cid: {0}")]

bitswap/src/protocol.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ use crate::ledger::Message;
88
use core::future::Future;
99
use core::iter;
1010
use core::pin::Pin;
11-
use futures::io::{AsyncRead, AsyncWrite};
11+
use futures::{
12+
io::{AsyncRead, AsyncWrite},
13+
AsyncWriteExt,
14+
};
1215
use libp2p_core::{upgrade, InboundUpgrade, OutboundUpgrade, UpgradeInfo};
1316
use std::io;
1417

@@ -42,7 +45,7 @@ where
4245
#[inline]
4346
fn upgrade_inbound(self, mut socket: TSocket, _info: Self::Info) -> Self::Future {
4447
Box::pin(async move {
45-
let packet = upgrade::read_one(&mut socket, MAX_BUF_SIZE).await?;
48+
let packet = upgrade::read_length_prefixed(&mut socket, MAX_BUF_SIZE).await?;
4649
let message = Message::from_bytes(&packet)?;
4750
Ok(message)
4851
})
@@ -71,7 +74,8 @@ where
7174
fn upgrade_outbound(self, mut socket: TSocket, _info: Self::Info) -> Self::Future {
7275
Box::pin(async move {
7376
let bytes = self.to_bytes();
74-
upgrade::write_one(&mut socket, bytes).await
77+
upgrade::write_length_prefixed(&mut socket, bytes).await?;
78+
socket.close().await
7579
})
7680
}
7781
}

http/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ name = "ipfs-http"
66
version = "0.1.0"
77

88
[build-dependencies]
9-
prost-build = { default-features = false, version = "0.7" }
9+
prost-build = { default-features = false, version = "0.8" }
1010
vergen = { default-features = false, version = "3.1" }
1111

1212
[dependencies]
@@ -19,12 +19,12 @@ humantime = { default-features = false, version = "2.0" }
1919
ipfs = { path = "../" }
2020
mime = { default-features = false, version = "0.3" }
2121
mpart-async = { default-features = false, version = "0.5" }
22-
multibase = { default-features = false, version = "0.8" }
22+
multibase = { default-features = false, features = ["std"], version = "0.9" }
2323
multihash = { default-features = false, version = "0.11" }
2424
# openssl is required for rsa keygen but not used by the rust-ipfs or its dependencies
2525
openssl = { default-features = false, version = "0.10" }
2626
percent-encoding = { default-features = false, version = "2.1" }
27-
prost = { default-features = false, version = "0.7" }
27+
prost = { default-features = false, version = "0.8" }
2828
serde = { default-features = false, features = ["derive"], version = "1.0" }
2929
serde_json = { default-features = false, version = "1.0" }
3030
structopt = { default-features = false, version = "0.3" }

0 commit comments

Comments
 (0)