Unverified Commit 36e9d17e authored by André Silva's avatar André Silva Committed by GitHub
Browse files

Update substrate (#970)



* update substrate

* Hopefully fix compilation

* network: rename roles to role

* runtime: fix runtime-benchmarks compilation
Co-authored-by: Pierre Krieger's avatarPierre Krieger <pierre.krieger1708@gmail.com>
parent 587588f8
Pipeline #86333 passed with stages
in 19 minutes and 50 seconds
This diff is collapsed.
...@@ -43,7 +43,7 @@ async fn start_inner(chain_spec: String, log_level: String) -> Result<Client, Bo ...@@ -43,7 +43,7 @@ async fn start_inner(chain_spec: String, log_level: String) -> Result<Client, Bo
info!(" by Parity Technologies, 2017-2020"); info!(" by Parity Technologies, 2017-2020");
info!("📋 Chain specification: {}", config.expect_chain_spec().name()); info!("📋 Chain specification: {}", config.expect_chain_spec().name());
info!("🏷 Node name: {}", config.name); info!("🏷 Node name: {}", config.name);
info!("👤 Roles: {}", config.roles); info!("👤 Role: {}", config.display_role());
// Create the service. This is the most heavy initialization step. // Create the service. This is the most heavy initialization step.
let service = service::kusama_new_light(config) let service = service::kusama_new_light(config)
......
...@@ -55,7 +55,7 @@ pub fn run(version: VersionInfo) -> sc_cli::Result<()> { ...@@ -55,7 +55,7 @@ pub fn run(version: VersionInfo) -> sc_cli::Result<()> {
info!(" by {}, 2017-2020", version.author); info!(" by {}, 2017-2020", version.author);
info!("📋 Chain specification: {}", config.expect_chain_spec().name()); info!("📋 Chain specification: {}", config.expect_chain_spec().name());
info!("🏷 Node name: {}", config.name); info!("🏷 Node name: {}", config.name);
info!("👤 Roles: {}", config.display_role()); info!("👤 Role: {}", config.display_role());
if is_kusama { if is_kusama {
info!("⛓ Native runtime: {}", service::KusamaExecutor::native_version().runtime_version); info!("⛓ Native runtime: {}", service::KusamaExecutor::native_version().runtime_version);
......
...@@ -635,7 +635,7 @@ impl<C: ChainContext + ?Sized> MessageValidator<C> { ...@@ -635,7 +635,7 @@ impl<C: ChainContext + ?Sized> MessageValidator<C> {
} }
impl<C: ChainContext + ?Sized> sc_network_gossip::Validator<Block> for MessageValidator<C> { impl<C: ChainContext + ?Sized> sc_network_gossip::Validator<Block> for MessageValidator<C> {
fn new_peer(&self, _context: &mut dyn ValidatorContext<Block>, who: &PeerId, _roles: ObservedRole) { fn new_peer(&self, _context: &mut dyn ValidatorContext<Block>, who: &PeerId, _role: ObservedRole) {
let mut inner = self.inner.write(); let mut inner = self.inner.write();
inner.peers.insert(who.clone(), PeerData::default()); inner.peers.insert(who.clone(), PeerData::default());
} }
......
...@@ -891,8 +891,8 @@ impl<Api, Sp, Gossip> Worker<Api, Sp, Gossip> where ...@@ -891,8 +891,8 @@ impl<Api, Sp, Gossip> Worker<Api, Sp, Gossip> where
fn handle_service_message(&mut self, message: ServiceToWorkerMsg) { fn handle_service_message(&mut self, message: ServiceToWorkerMsg) {
match message { match message {
ServiceToWorkerMsg::PeerConnected(remote, roles) => { ServiceToWorkerMsg::PeerConnected(remote, role) => {
self.protocol_handler.on_connect(remote, roles); self.protocol_handler.on_connect(remote, role);
} }
ServiceToWorkerMsg::PeerDisconnected(remote) => { ServiceToWorkerMsg::PeerDisconnected(remote) => {
self.protocol_handler.on_disconnect(remote); self.protocol_handler.on_disconnect(remote);
......
...@@ -189,8 +189,8 @@ sp_api::mock_impl_runtime_apis! { ...@@ -189,8 +189,8 @@ sp_api::mock_impl_runtime_apis! {
} }
impl super::Service<MockNetworkOps> { impl super::Service<MockNetworkOps> {
async fn connect_peer(&mut self, peer: PeerId, roles: ObservedRole) { async fn connect_peer(&mut self, peer: PeerId, role: ObservedRole) {
self.sender.send(ServiceToWorkerMsg::PeerConnected(peer, roles)).await.unwrap(); self.sender.send(ServiceToWorkerMsg::PeerConnected(peer, role)).await.unwrap();
} }
async fn peer_message(&mut self, peer: PeerId, message: Message) { async fn peer_message(&mut self, peer: PeerId, message: Message) {
...@@ -591,7 +591,7 @@ fn validator_sends_key_to_collator_on_status() { ...@@ -591,7 +591,7 @@ fn validator_sends_key_to_collator_on_status() {
pool.spawner().spawn_local(worker_task).unwrap(); pool.spawner().spawn_local(worker_task).unwrap();
pool.run_until(async move { pool.run_until(async move {
service_clone.synchronize(move |proto| { proto.local_keys.insert(validator_id_clone); }).await; service_clone.synchronize(move |proto| { proto.local_keys.insert(validator_id_clone); }).await;
service_clone.connect_peer(peer_clone.clone(), Roles::AUTHORITY).await; service_clone.connect_peer(peer_clone.clone(), ObservedRole::Authority).await;
service_clone.peer_message(peer_clone.clone(), Message::Status(Status { service_clone.peer_message(peer_clone.clone(), Message::Status(Status {
version: VERSION, version: VERSION,
collating_for: Some((collator_id, para_id)), collating_for: Some((collator_id, para_id)),
......
...@@ -78,5 +78,6 @@ std = [ ...@@ -78,5 +78,6 @@ std = [
runtime-benchmarks = [ runtime-benchmarks = [
"libsecp256k1/hmac", "libsecp256k1/hmac",
"frame-benchmarking", "frame-benchmarking",
"frame-support/runtime-benchmarks" "frame-support/runtime-benchmarks",
"system/runtime-benchmarks",
] ]
...@@ -642,6 +642,7 @@ mod benchmarking { ...@@ -642,6 +642,7 @@ mod benchmarking {
use super::*; use super::*;
use secp_utils::*; use secp_utils::*;
use system::RawOrigin; use system::RawOrigin;
use system as frame_system; // NOTE: required for the benchmarks! macro
use frame_benchmarking::{benchmarks, account}; use frame_benchmarking::{benchmarks, account};
use sp_runtime::DispatchResult; use sp_runtime::DispatchResult;
use sp_runtime::traits::ValidateUnsigned; use sp_runtime::traits::ValidateUnsigned;
......
...@@ -139,8 +139,11 @@ std = [ ...@@ -139,8 +139,11 @@ std = [
"runtime-common/std", "runtime-common/std",
] ]
runtime-benchmarks = [ runtime-benchmarks = [
"collective/runtime-benchmarks",
"frame-benchmarking", "frame-benchmarking",
"frame-support/runtime-benchmarks", "frame-support/runtime-benchmarks",
"runtime-common/runtime-benchmarks", "runtime-common/runtime-benchmarks",
"elections-phragmen/runtime-benchmarks" "elections-phragmen/runtime-benchmarks",
"society/runtime-benchmarks",
"system/runtime-benchmarks",
] ]
...@@ -133,8 +133,10 @@ std = [ ...@@ -133,8 +133,10 @@ std = [
"vesting/std", "vesting/std",
] ]
runtime-benchmarks = [ runtime-benchmarks = [
"collective/runtime-benchmarks",
"frame-benchmarking", "frame-benchmarking",
"frame-support/runtime-benchmarks", "frame-support/runtime-benchmarks",
"runtime-common/runtime-benchmarks", "runtime-common/runtime-benchmarks",
"elections-phragmen/runtime-benchmarks" "elections-phragmen/runtime-benchmarks",
"system/runtime-benchmarks",
] ]
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment