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

PoV Distribution optimization #1990

Merged
19 commits merged into from
Nov 25, 2020
Merged
Show file tree
Hide file tree
Changes from 7 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
5 changes: 5 additions & 0 deletions Cargo.lock

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

8 changes: 8 additions & 0 deletions node/network/pov-distribution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,22 @@ edition = "2018"

[dependencies]
futures = "0.3.8"
log = "0.4.11"
montekki marked this conversation as resolved.
Show resolved Hide resolved
thiserror = "1.0.21"
tracing = "0.1.21"
tracing-futures = "0.2.4"

polkadot-primitives = { path = "../../../primitives" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../../subsystem" }
polkadot-node-subsystem-util = { path = "../../subsystem-util" }
polkadot-node-network-protocol = { path = "../../network/protocol" }

[dev-dependencies]
assert_matches = "1.4.0"
env_logger = "0.8.1"
smallvec = "1.4.2"

sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-keyring = { git = "https://github.com/paritytech/substrate", branch = "master" }

polkadot-node-subsystem-test-helpers = { path = "../../subsystem-test-helpers" }
33 changes: 33 additions & 0 deletions node/network/pov-distribution/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// Copyright 2020 Parity Technologies (UK) Ltd.
// This file is part of Polkadot.

// Polkadot is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.

// Polkadot is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.

// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

montekki marked this conversation as resolved.
Show resolved Hide resolved
use thiserror::Error;

#[derive(Debug, Error)]
pub enum Error {
#[error(transparent)]
Subsystem(#[from] polkadot_subsystem::SubsystemError),
#[error(transparent)]
OneshotRecv(#[from] futures::channel::oneshot::Canceled),
#[error(transparent)]
Runtime(#[from] polkadot_subsystem::errors::RuntimeApiError),
#[error(transparent)]
ValidatorDiscovery(#[from] polkadot_node_subsystem_util::validator_discovery::Error),
#[error(transparent)]
Util(#[from] polkadot_node_subsystem_util::Error),
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the team's policy about that, but many of those can be constructed from different places. Having, say, OneshotRecv at hand it would probably hard to tell where that error actually originated from.


pub type Result<T> = std::result::Result<T, Error>;
Loading