Bump Substrate/Polkadot/Cumulus refs (aka Weights v1.5) (#1597)

* update Substrate + Polkadot + Cumulus refs

* Origin -> RuntimeOrigin

* weights v1.5

* update refs once again + `cargo test -p pallet-bridge-grandpa` works

* started work on `cargo test -p pallet-bridge-messages`

* cargo test -p pallet-bridge-relayers

* cargo test -p pallet-bridge-parachains

* cargo test -p millau-runtime

* cargo test -p bridge-runtime-common

* cargo test -p rialto-runtime

* cargo test -p rialto-parachain-runtime

* cargo test -p millau-bridge-node

* cargo test -p rialto-bridge-node

* cargo test -p rialto-parachain-collator

* cargo test -p messages-relay

* cargo test -p parachains-relay

* cargo test -p substrate-relay

* cargo test --all

* cargo check -p millau-runtime --locked --features runtime-benchmarks

* fix remaining test

* fmt

* try to allow clippy failure temporarily

* Revert "try to allow clippy failure temporarily"

This reverts commit d1b6593580f07e0dbeecb7ab0aa92cee98888ed3.

* use min_by

* Revert "use min_by"

This reverts commit 33042f49ed37e8dd0505370289e17f03bf1a56ee.

* Revert "Revert "use min_by""

This reverts commit 1d2204f0b14dc81e5650bb574dedb5fa78c7097d.

* trigger CI

* Revert "trigger CI"

This reverts commit 259d91b5606743bba9d043c69f07eac6c8700ef5.

* new day, new clippy warning

* more clippy issues
This commit is contained in:
Svyatoslav Nikolsky
2022-10-20 10:27:23 +03:00
committed by Bastian Köcher
parent 9e1847d12a
commit a3dc2d2748
66 changed files with 991 additions and 893 deletions
+32 -21
View File
@@ -18,7 +18,7 @@
use jsonrpsee::RpcModule;
use millau_runtime::{self, opaque::Block, RuntimeApi};
use sc_client_api::{BlockBackend, ExecutorProvider};
use sc_client_api::BlockBackend;
use sc_consensus_aura::{ImportQueueParams, SlotProportion, StartAuraParams};
pub use sc_executor::NativeElseWasmExecutor;
use sc_finality_grandpa::SharedVoterState;
@@ -140,7 +140,7 @@ pub fn new_partial(
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
let import_queue =
sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _, _>(ImportQueueParams {
sc_consensus_aura::import_queue::<AuraPair, _, _, _, _, _>(ImportQueueParams {
block_import: beefy_block_import,
justification_import: Some(Box::new(grandpa_block_import.clone())),
client: client.clone(),
@@ -153,12 +153,9 @@ pub fn new_partial(
slot_duration,
);
Ok((timestamp, slot))
Ok((slot, timestamp))
},
spawner: &task_manager.spawn_essential_handle(),
can_author_with: sp_consensus::CanAuthorWithNativeVersion::new(
client.executor().clone(),
),
registry: config.prometheus_registry(),
check_for_equivocation: Default::default(),
telemetry: telemetry.as_ref().map(|x| x.handle()),
@@ -207,6 +204,8 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
};
}
let genesis_hash = client.block_hash(0).ok().flatten().expect("Genesis block exists; qed");
// Note: GrandPa is pushed before the Polkadot-specific protocols. This doesn't change
// anything in terms of behaviour, but makes the logs more consistent with the other
// Substrate nodes.
@@ -219,14 +218,21 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
.extra_sets
.push(sc_finality_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()));
let beefy_protocol_name = beefy_gadget::protocol_standard_name(
&client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"),
&config.chain_spec,
);
let beefy_gossip_proto_name =
beefy_gadget::gossip_protocol_name(genesis_hash, config.chain_spec.fork_id());
// `beefy_on_demand_justifications_handler` is given to `beefy-gadget` task to be run,
// while `beefy_req_resp_cfg` is added to `config.network.request_response_protocols`.
let (beefy_on_demand_justifications_handler, beefy_req_resp_cfg) =
beefy_gadget::communication::request_response::BeefyJustifsRequestHandler::new(
genesis_hash,
config.chain_spec.fork_id(),
client.clone(),
);
config
.network
.extra_sets
.push(beefy_gadget::beefy_peers_set_config(beefy_protocol_name.clone()));
.push(beefy_gadget::communication::beefy_peers_set_config(beefy_gossip_proto_name.clone()));
config.network.request_response_protocols.push(beefy_req_resp_cfg);
let warp_sync = Arc::new(sc_finality_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
@@ -234,7 +240,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
Vec::default(),
));
let (network, system_rpc_tx, network_starter) =
let (network, system_rpc_tx, tx_handler_controller, network_starter) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
client: client.clone(),
@@ -327,6 +333,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
backend: backend.clone(),
system_rpc_tx,
config,
tx_handler_controller,
telemetry: telemetry.as_mut(),
})?;
@@ -339,12 +346,9 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
telemetry.as_ref().map(|x| x.handle()),
);
let can_author_with =
sp_consensus::CanAuthorWithNativeVersion::new(client.executor().clone());
let slot_duration = sc_consensus_aura::slot_duration(&*client)?;
let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _, _>(
let aura = sc_consensus_aura::start_aura::<AuraPair, _, _, _, _, _, _, _, _, _, _>(
StartAuraParams {
slot_duration,
client: client.clone(),
@@ -360,12 +364,11 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
slot_duration,
);
Ok((timestamp, slot))
Ok((slot, timestamp))
},
force_authoring,
backoff_authoring_blocks,
keystore: keystore_container.sync_keystore(),
can_author_with,
sync_oracle: network.clone(),
justification_sync_link: network.clone(),
block_proposal_slot_portion: SlotProportion::new(2f32 / 3f32),
@@ -386,23 +389,31 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let keystore =
if role.is_authority() { Some(keystore_container.sync_keystore()) } else { None };
let justifications_protocol_name = beefy_on_demand_justifications_handler.protocol_name();
let payload_provider = beefy_primitives::mmr::MmrRootProvider::new(client.clone());
let beefy_params = beefy_gadget::BeefyParams {
client: client.clone(),
backend,
payload_provider,
runtime: client,
key_store: keystore.clone(),
network: network.clone(),
network_params: beefy_gadget::BeefyNetworkParams {
network: network.clone(),
gossip_protocol_name: beefy_gossip_proto_name,
justifications_protocol_name,
_phantom: core::marker::PhantomData::<Block>,
},
min_block_delta: 2,
prometheus_registry: prometheus_registry.clone(),
protocol_name: beefy_protocol_name,
links: beefy_voter_links,
on_demand_justifications_handler: beefy_on_demand_justifications_handler,
};
// Start the BEEFY bridge gadget.
task_manager.spawn_essential_handle().spawn_blocking(
"beefy-gadget",
None,
beefy_gadget::start_beefy_gadget::<_, _, _, _, _>(beefy_params),
beefy_gadget::start_beefy_gadget::<_, _, _, _, _, _>(beefy_params),
);
let grandpa_config = sc_finality_grandpa::Config {