Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Companion for #14178: Update color-eyre to v0.6.2 #7268

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
670 changes: 340 additions & 330 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repository = "https://github.com/paritytech/polkadot.git"
version = "0.9.41"

[dependencies]
color-eyre = { version = "0.6.1", default-features = false }
color-eyre = { version = "0.6.2", default-features = false }
tikv-jemallocator = "0.5.0"

# Crates in our workspace, defined as dependencies so we can pass them feature flags.
Expand Down
2 changes: 1 addition & 1 deletion node/malus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ polkadot-node-core-backing = { path = "../core/backing" }
polkadot-node-core-pvf-worker = { path = "../core/pvf/worker" }
polkadot-node-primitives = { path = "../primitives" }
polkadot-primitives = { path = "../../primitives" }
color-eyre = { version = "0.6.1", default-features = false }
color-eyre = { version = "0.6.2", default-features = false }
assert_matches = "1.5"
async-trait = "0.1.57"
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
2 changes: 1 addition & 1 deletion node/network/collator-protocol/src/collator_side/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ use super::*;
use std::{collections::HashSet, sync::Arc, time::Duration};

use assert_matches::assert_matches;
use futures::{executor, future, Future, SinkExt};
use futures::{executor, future, Future};
use futures_timer::Delay;

use parity_scale_codec::{Decode, Encode};
Expand Down
1 change: 1 addition & 0 deletions node/network/dispute-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ lru = "0.9.0"
indexmap = "1.9.1"

[dev-dependencies]
async-channel = "1.8.0"
async-trait = "0.1.57"
polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
12 changes: 6 additions & 6 deletions node/network/dispute-distribution/src/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ use std::{

use assert_matches::assert_matches;
use futures::{
channel::{mpsc, oneshot},
channel::oneshot,
future::{poll_fn, ready},
pin_mut, Future, SinkExt,
pin_mut, Future,
};
use futures_timer::Delay;
use parity_scale_codec::{Decode, Encode};
Expand Down Expand Up @@ -590,14 +590,14 @@ fn dispute_retries_and_works_across_session_boundaries() {
}

async fn send_network_dispute_request(
req_tx: &mut mpsc::Sender<sc_network::config::IncomingRequest>,
req_tx: &mut async_channel::Sender<sc_network::config::IncomingRequest>,
peer: PeerId,
message: DisputeRequest,
) -> oneshot::Receiver<sc_network::config::OutgoingResponse> {
let (pending_response, rx_response) = oneshot::channel();
let req =
sc_network::config::IncomingRequest { peer, payload: message.encode(), pending_response };
req_tx.feed(req).await.unwrap();
req_tx.send(req).await.unwrap();
rx_response
}

Expand All @@ -606,7 +606,7 @@ async fn send_network_dispute_request(
/// Passed in function will be called while votes are still being imported.
async fn nested_network_dispute_request<'a, F, O>(
handle: &'a mut TestSubsystemContextHandle<DisputeDistributionMessage>,
req_tx: &'a mut mpsc::Sender<sc_network::config::IncomingRequest>,
req_tx: &'a mut async_channel::Sender<sc_network::config::IncomingRequest>,
peer: PeerId,
message: DisputeRequest,
import_result: ImportStatementsResult,
Expand All @@ -615,7 +615,7 @@ async fn nested_network_dispute_request<'a, F, O>(
) where
F: FnOnce(
&'a mut TestSubsystemContextHandle<DisputeDistributionMessage>,
&'a mut mpsc::Sender<sc_network::config::IncomingRequest>,
&'a mut async_channel::Sender<sc_network::config::IncomingRequest>,
DisputeRequest,
) -> O
+ 'a,
Expand Down
1 change: 1 addition & 0 deletions node/network/protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ edition.workspace = true
description = "Primitives types for the Node-side"

[dependencies]
async-channel = "1.8.0"
async-trait = "0.1.57"
hex = "0.4.3"
polkadot-primitives = { path = "../../../primitives" }
Expand Down
7 changes: 2 additions & 5 deletions node/network/protocol/src/request_response/incoming/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@

use std::marker::PhantomData;

use futures::{
channel::{mpsc, oneshot},
StreamExt,
};
use futures::{channel::oneshot, StreamExt};

use parity_scale_codec::{Decode, Encode};

Expand Down Expand Up @@ -208,7 +205,7 @@ pub struct OutgoingResponse<Response> {
///
/// Takes care of decoding and handling of invalid encoded requests.
pub struct IncomingRequestReceiver<Req> {
raw: mpsc::Receiver<netconfig::IncomingRequest>,
raw: async_channel::Receiver<netconfig::IncomingRequest>,
phantom: PhantomData<Req>,
}

Expand Down
7 changes: 3 additions & 4 deletions node/network/protocol/src/request_response/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

use std::{collections::HashMap, time::Duration, u64};

use futures::channel::mpsc;
use polkadot_primitives::{MAX_CODE_SIZE, MAX_POV_SIZE};
use strum::{EnumIter, IntoEnumIterator};

Expand Down Expand Up @@ -144,16 +143,16 @@ impl Protocol {
pub fn get_config(
self,
req_protocol_names: &ReqProtocolNames,
) -> (mpsc::Receiver<network::IncomingRequest>, RequestResponseConfig) {
let (tx, rx) = mpsc::channel(self.get_channel_size());
) -> (async_channel::Receiver<network::IncomingRequest>, RequestResponseConfig) {
let (tx, rx) = async_channel::bounded(self.get_channel_size());
let cfg = self.create_config(req_protocol_names, Some(tx));
(rx, cfg)
}

fn create_config(
self,
req_protocol_names: &ReqProtocolNames,
tx: Option<mpsc::Sender<network::IncomingRequest>>,
tx: Option<async_channel::Sender<network::IncomingRequest>>,
) -> RequestResponseConfig {
let name = req_protocol_names.get_name(self);
let fallback_names = self.get_fallback_names();
Expand Down