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

Commit

Permalink
Complete telemetry for parachain & relaychain (#301)
Browse files Browse the repository at this point in the history
* Complete telemetry for parachain & relaychain

* Update Substrate & Polkadot
  • Loading branch information
cecton authored Jan 29, 2021
1 parent cb00749 commit 6438d32
Show file tree
Hide file tree
Showing 20 changed files with 407 additions and 317 deletions.
634 changes: 360 additions & 274 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
24 changes: 12 additions & 12 deletions rococo-parachains/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[package]
name = 'rococo-collator'
version = '0.1.0'
name = "rococo-collator"
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
build = 'build.rs'
edition = '2018'
build = "build.rs"
edition = "2018"

[[bin]]
name = 'rococo-collator'
path = 'src/main.rs'
name = "rococo-collator"
path = "src/main.rs"

[dependencies]
derive_more = '0.15.0'
exit-future = '0.1.4'
derive_more = "0.15.0"
exit-future = "0.1.4"
futures = { version = "0.3.1", features = ["compat"] }
log = '0.4.8'
parking_lot = '0.9.0'
trie-root = '0.15.2'
codec = { package = 'parity-scale-codec', version = '1.0.0' }
log = "0.4.8"
parking_lot = "0.9.0"
trie-root = "0.15.2"
codec = { package = "parity-scale-codec", version = "2.0.0" }
structopt = "0.3.3"
serde = { version = "1.0.101", features = ["derive"] }
hex-literal = "0.2.1"
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
13 changes: 10 additions & 3 deletions rococo-parachains/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,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 +241,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 +294,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 +431,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
6 changes: 3 additions & 3 deletions test/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "cumulus-test-service"
version = '0.1.0'
version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]
edition = '2018'
edition = "2018"

[dependencies]
codec = { package = 'parity-scale-codec', version = '1.0.0' }
codec = { package = "parity-scale-codec", version = "2.0.0" }
rand = "0.7.3"
serde = { version = "1.0.101", features = ["derive"] }

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 test/service/tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use substrate_test_runtime_client::AccountKeyring::*;

#[substrate_test_utils::test]
async fn test_collating_and_non_collator_mode_catching_up(task_executor: TaskExecutor) {
let mut builder = sc_cli::GlobalLoggerBuilder::new("");
let mut builder = sc_cli::LoggerBuilder::new("");
builder.with_colors(false);
let _ = builder.init();

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

0 comments on commit 6438d32

Please sign in to comment.