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

Complete telemetry for parachain & relaychain #301

Merged
merged 7 commits into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
Changes from 5 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
964 changes: 542 additions & 422 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion collator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ cumulus-runtime = { path = "../runtime" }

# Other dependencies
log = "0.4.8"
codec = { package = "parity-scale-codec", version = "1.3.0", features = [ "derive" ] }
codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] }
futures = { version = "0.3.1", features = ["compat"] }
parking_lot = "0.9"

Expand Down
2 changes: 1 addition & 1 deletion consensus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ polkadot-runtime = { git = "https://github.com/paritytech/polkadot", branch = "m
# Other deps
futures = { version = "0.3.8", features = ["compat"] }
tokio = "0.1.22"
codec = { package = "parity-scale-codec", version = "1.3.0", features = [ "derive" ] }
codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] }
tracing = "0.1.22"

[dev-dependencies]
Expand Down
2 changes: 1 addition & 1 deletion consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ where

match para_best_chain {
Some(best) => Decode::decode(&mut &best[..]).map_err(|e| {
ConsensusError::ChainLookup(format!("Error decoding parachain head: {}", e.what()))
ConsensusError::ChainLookup(format!("Error decoding parachain head: {}", e))
}),
None => Err(ConsensusError::ChainLookup(
"Could not find parachain head for best relay chain!".into(),
Expand Down
2 changes: 1 addition & 1 deletion network/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch =
cumulus-primitives = { path = "../primitives" }

# other deps
codec = { package = "parity-scale-codec", version = "1.3.0", features = [ "derive" ] }
codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ] }
futures = { version = "0.3.1", features = ["compat"] }
futures-timer = "3.0.2"
log = "0.4.8"
Expand Down
2 changes: 1 addition & 1 deletion parachain-system/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ sp-state-machine = { git = "https://github.com/paritytech/substrate", default-fe
sp-trie = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }

# Other Dependencies
codec = { package = "parity-scale-codec", version = "1.0.0", default-features = false, features = ["derive"]}
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"]}
serde = { version = "1.0.101", optional = true, features = ["derive"] }
hash-db = { version = "0.15.2", default-features = false }

Expand Down
2 changes: 1 addition & 1 deletion primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ polkadot-parachain = { git = "https://github.com/paritytech/polkadot", default-f
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }

# Other dependencies
codec = { package = "parity-scale-codec", version = "1.0.5", default-features = false, features = [ "derive" ] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] }
impl-trait-for-tuples = "0.1.3"

# Polkadot dependencies
Expand Down
2 changes: 1 addition & 1 deletion rococo-parachains/pallets/parachain-info/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "parachain-info"
version = "0.1.0"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }

frame-support = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
Expand Down
2 changes: 1 addition & 1 deletion rococo-parachains/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = '2018'

[dependencies]
serde = { version = "1.0.101", optional = true, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }

parachain-info = { path = "../pallets/parachain-info", default-features = false }
rococo-parachain-primitives = { path = "../primitives", default-features = false }
Expand Down
16 changes: 11 additions & 5 deletions rococo-parachains/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ use crate::{
chain_spec,
cli::{Cli, RelayChainCli, Subcommand},
};
use codec::Encode;
use cumulus_primitives::{genesis::generate_genesis_block, ParaId};
use log::info;
use parachain_runtime::Block;
Expand All @@ -31,7 +30,7 @@ use sc_service::{
config::{BasePath, PrometheusConfig},
PartialComponents,
};
use sp_core::hexdisplay::HexDisplay;
use sp_core::{hexdisplay::HexDisplay, Encode};
cecton marked this conversation as resolved.
Show resolved Hide resolved
use sp_runtime::traits::Block as BlockT;
use std::{io::Write, net::SocketAddr};

Expand Down Expand Up @@ -217,7 +216,7 @@ pub fn run() -> Result<()> {
})
}
Some(Subcommand::ExportGenesisState(params)) => {
let mut builder = sc_cli::GlobalLoggerBuilder::new("");
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
let _ = builder.init();

Expand All @@ -241,7 +240,7 @@ pub fn run() -> Result<()> {
Ok(())
}
Some(Subcommand::ExportGenesisWasm(params)) => {
let mut builder = sc_cli::GlobalLoggerBuilder::new("");
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
let _ = builder.init();

Expand Down Expand Up @@ -294,7 +293,7 @@ pub fn run() -> Result<()> {
&polkadot_cli,
&polkadot_cli,
task_executor,
None,
config.telemetry_handle.clone(),
).map_err(|err| format!("Relay chain argument error: {}", err))?;
let collator = cli.run.base.validator || cli.collator;

Expand Down Expand Up @@ -431,4 +430,11 @@ impl CliConfiguration<Self> for RelayChainCli {
fn announce_block(&self) -> Result<bool> {
self.base.base.announce_block()
}

fn telemetry_endpoints(
&self,
chain_spec: &Box<dyn ChainSpec>,
) -> Result<Option<sc_telemetry::TelemetryEndpoints>> {
self.base.base.telemetry_endpoints(chain_spec)
}
}
8 changes: 3 additions & 5 deletions rococo-parachains/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ pub fn new_partial(
(),
sp_consensus::import_queue::BasicQueue<Block, PrefixedMemoryDB<BlakeTwo256>>,
sc_transaction_pool::FullPool<Block, TFullClient<Block, RuntimeApi, Executor>>,
Option<sc_telemetry::TelemetrySpan>,
(),
>,
sc_service::Error,
> {
let inherent_data_providers = sp_inherents::InherentDataProviders::new();

let (client, backend, keystore_container, task_manager, telemetry_span) =
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
let client = Arc::new(client);

Expand Down Expand Up @@ -85,7 +85,7 @@ pub fn new_partial(
transaction_pool,
inherent_data_providers,
select_chain: (),
other: telemetry_span,
other: (),
};

Ok(params)
Expand Down Expand Up @@ -125,7 +125,6 @@ where
)?;

let params = new_partial(&parachain_config)?;
let telemetry_span = params.other;
params
.inherent_data_providers
.register_provider(sp_timestamp::InherentDataProvider)
Expand Down Expand Up @@ -171,7 +170,6 @@ where
network: network.clone(),
network_status_sinks,
system_rpc_tx,
telemetry_span,
})?;

let announce_block = {
Expand Down
4 changes: 2 additions & 2 deletions runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ edition = "2018"

[dependencies]
# Other dependencies
codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = [ "derive" ] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] }
hash-db = { version = "0.15.2", default-features = false }
memory-db = { version = "0.25.0", default-features = false }
memory-db = { version = "0.26.0", default-features = false }
trie-db = { version = "0.22.0", default-features = false }

# Cumulus dependencies
Expand Down
2 changes: 1 addition & 1 deletion test/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,4 @@ cumulus-primitives = { path = "../../primitives" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }

# Other deps
codec = { package = "parity-scale-codec", version = "1.0.5", default-features = false, features = [ "derive" ] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] }
2 changes: 1 addition & 1 deletion test/relay-sproof-builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = '2018'

[dependencies]
# Other dependencies
codec = { package = "parity-scale-codec", version = "1.0.5", default-features = false, features = [ "derive" ] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = [ "derive" ] }

# Substrate dependencies
sp-state-machine = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
Expand Down
2 changes: 1 addition & 1 deletion test/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.3.0", default-features = false, features = ["derive"] }
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.101", optional = true, features = ["derive"] }

# Substrate dependencies
Expand Down
2 changes: 1 addition & 1 deletion test/service/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.

use codec::Encode;
use cumulus_primitives::{genesis::generate_genesis_block, ParaId};
use cumulus_test_runtime::Block;
use polkadot_primitives::v0::HeadData;
use sp_core::Encode;
cecton marked this conversation as resolved.
Show resolved Hide resolved
use sp_runtime::traits::Block as BlockT;

/// Returns the initial head data for a parachain ID.
Expand Down
9 changes: 4 additions & 5 deletions test/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ pub fn new_partial(
(),
sp_consensus::import_queue::BasicQueue<Block, PrefixedMemoryDB<BlakeTwo256>>,
sc_transaction_pool::FullPool<Block, TFullClient<Block, RuntimeApi, RuntimeExecutor>>,
Option<sc_telemetry::TelemetrySpan>,
(),
>,
sc_service::Error,
> {
let inherent_data_providers = sp_inherents::InherentDataProviders::new();

let (client, backend, keystore_container, task_manager, telemetry_span) =
let (client, backend, keystore_container, task_manager) =
sc_service::new_full_parts::<Block, RuntimeApi, RuntimeExecutor>(&config)?;
let client = Arc::new(client);

Expand Down Expand Up @@ -109,7 +109,7 @@ pub fn new_partial(
transaction_pool,
inherent_data_providers,
select_chain: (),
other: telemetry_span,
other: (),
};

Ok(params)
Expand Down Expand Up @@ -146,7 +146,6 @@ where
let mut parachain_config = prepare_node_config(parachain_config);

let params = new_partial(&mut parachain_config)?;
let telemetry_span = params.other;
params
.inherent_data_providers
.register_provider(sp_timestamp::InherentDataProvider)
Expand Down Expand Up @@ -207,7 +206,6 @@ where
network: network.clone(),
network_status_sinks,
system_rpc_tx,
telemetry_span,
})?;

let announce_block = {
Expand Down Expand Up @@ -419,6 +417,7 @@ pub fn node_config(
telemetry_handle: None,
telemetry_endpoints: None,
telemetry_external_transport: None,
telemetry_span: None,
default_heap_pages: None,
offchain_worker: OffchainWorkerConfig {
enabled: true,
Expand Down
2 changes: 1 addition & 1 deletion xcm-handler/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2018"

[dependencies]
# Other dependencies
codec = { package = "parity-scale-codec", version = "1.3.0", features = [ "derive" ], default-features = false }
codec = { package = "parity-scale-codec", version = "2.0.0", features = [ "derive" ], default-features = false }

# Substrate Dependencies
sp-std = { git = "https://github.com/paritytech/substrate", default-features = false, branch = "master" }
Expand Down