Skip to content

Commit

Permalink
fix(comms/core): upgrade to yamux 0.13 (#6317)
Browse files Browse the repository at this point in the history
Description
---
Updates yamux to 0.13.2 from 0.10.2
Refactor RPC tests to account for internal changes in yamux 

Motivation and Context
---

Includes improvements in yamux since 0.10. Including
libp2p/rust-yamux@460baf2

One major difference is that the substream is not opened until the
client sends a message. This only affects some tests written in a
"weird" way where the outbound stream was notified as an inbound
substream and the inbound stream is written to first. In all real usages
of substreams, the outbound stream always writes first.

This has been tested on the existing nextnet network for breaking
changes and there were no issues detected.

How Has This Been Tested?
---
Existing tests updated, manually syncing nextnet (non-breaking change
test) and wallet

Localnet manual test with 2 base nodes and 1 wallet

What process can a PR reviewer use to test or verify this change?
---
All applications should work as before

<!-- Checklist -->
<!-- 1. Is the title of your PR in the form that would make nice release
notes? The title, excluding the conventional commit
tag, will be included exactly as is in the CHANGELOG, so please think
about it carefully. -->


Breaking Changes
---

- [x] None
- [ ] Requires data directory on base node to be deleted
- [ ] Requires hard fork
- [ ] Other - Please specify

<!-- Does this include a breaking change? If so, include this line as a
footer -->
<!-- BREAKING CHANGE: Description what the user should do, e.g. delete a
database, resync the chain -->
  • Loading branch information
sdbondi authored May 6, 2024
1 parent 925d29a commit 1b5e217
Show file tree
Hide file tree
Showing 10 changed files with 295 additions and 256 deletions.
6 changes: 4 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions comms/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ edition = "2018"
[dependencies]
tari_crypto = { version = "0.20" }
tari_metrics = { path = "../../infrastructure/metrics", optional = true, version = "1.0.0-pre.12" }
tari_storage = { path = "../../infrastructure/storage", version = "1.0.0-pre.12" }
tari_shutdown = { path = "../../infrastructure/shutdown" , version = "1.0.0-pre.12"}
tari_storage = { path = "../../infrastructure/storage", version = "1.0.0-pre.12" }
tari_shutdown = { path = "../../infrastructure/shutdown", version = "1.0.0-pre.12" }
tari_utilities = { version = "0.7" }

anyhow = "1.0.53"
Expand Down Expand Up @@ -44,21 +44,21 @@ thiserror = "1.0.26"
tokio = { version = "1.36", features = ["rt-multi-thread", "time", "sync", "signal", "net", "macros", "io-util"] }
tokio-stream = { version = "0.1.9", features = ["sync"] }
tokio-util = { version = "0.6.7", features = ["codec", "compat"] }
tower = {version = "0.4", features = ["util"]}
tower = { version = "0.4", features = ["util"] }
tracing = "0.1.26"
yamux = "=0.10.2"
yamux = "0.13.2"
zeroize = "1"

[dev-dependencies]
tari_test_utils = { path = "../../infrastructure/test_utils" }
tari_test_utils = { path = "../../infrastructure/test_utils" }
tari_comms_rpc_macros = { path = "../rpc_macros" }

env_logger = "0.7.0"
serde_json = "1.0.39"
tempfile = "3.1.0"

[build-dependencies]
tari_common = { path = "../../common", features = ["build"], version = "1.0.0-pre.12" }
tari_common = { path = "../../common", features = ["build"], version = "1.0.0-pre.12" }

[features]
c_integration = []
Expand Down
2 changes: 1 addition & 1 deletion comms/core/src/connection_manager/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ pub struct PeerListener<TTransport> {
impl<TTransport> PeerListener<TTransport>
where
TTransport: Transport + Clone + Send + Sync + 'static,
TTransport::Output: AsyncRead + AsyncWrite + Send + Unpin + 'static,
TTransport::Output: AsyncRead + AsyncWrite + Send + Sync + Unpin + 'static,
{
pub fn new(
config: ConnectionManagerConfig,
Expand Down
Loading

0 comments on commit 1b5e217

Please sign in to comment.