Bump polkadot/substrate (#2134)

* Bump polkadot/substrate

* Fix millau network service

* Fix polkadot_node_core_pvf_worker

* Fix sc-network

* Fix parachain rpc stuff

* Check `integrity-test` for `bridge-runtime-common`

* Backport fix from cumulus https://github.com/paritytech/cumulus/pull/2585/files#diff-5a942d80670b5ef31bb18b5acacab93ff30512d7cd21c19d7da364f76f6bb5c3 because of https://gitlab.parity.io/parity/mirrors/cumulus/-/jobs/2842938

* TODO

* Bump cumulus
This commit is contained in:
Branislav Kontur
2023-05-16 16:46:21 +02:00
committed by Bastian Köcher
parent f25a5f0409
commit 4330d0491c
13 changed files with 61 additions and 37 deletions
+1
View File
@@ -36,6 +36,7 @@ sc-executor = { git = "https://github.com/paritytech/substrate", branch = "maste
sc-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus-grandpa-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "master" }
+11 -12
View File
@@ -178,7 +178,7 @@ pub fn new_partial(
}
/// Builds a new service for a full client.
pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError> {
pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
use sc_network_common::sync::warp::WarpSyncParams;
let sc_service::PartialComponents {
@@ -194,6 +194,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");
let mut net_config = sc_network::config::FullNetworkConfiguration::new(&config.network);
// 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.
@@ -201,10 +203,9 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
&client.block_hash(0).ok().flatten().expect("Genesis block exists; qed"),
&config.chain_spec,
);
config
.network
.extra_sets
.push(sc_consensus_grandpa::grandpa_peers_set_config(grandpa_protocol_name.clone()));
net_config.add_notification_protocol(sc_consensus_grandpa::grandpa_peers_set_config(
grandpa_protocol_name.clone(),
));
let beefy_gossip_proto_name =
sc_consensus_beefy::gossip_protocol_name(genesis_hash, config.chain_spec.fork_id());
@@ -217,13 +218,10 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
client.clone(),
config.prometheus_registry().cloned(),
);
config
.network
.extra_sets
.push(sc_consensus_beefy::communication::beefy_peers_set_config(
beefy_gossip_proto_name.clone(),
));
config.network.request_response_protocols.push(beefy_req_resp_cfg);
net_config.add_notification_protocol(
sc_consensus_beefy::communication::beefy_peers_set_config(beefy_gossip_proto_name.clone()),
);
net_config.add_request_response_protocol(beefy_req_resp_cfg);
let warp_sync = Arc::new(sc_consensus_grandpa::warp_proof::NetworkProvider::new(
backend.clone(),
@@ -234,6 +232,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
net_config,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
+1
View File
@@ -367,6 +367,7 @@ impl pallet_transaction_payment::Config for Runtime {
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
}
parameter_types! {
@@ -188,6 +188,8 @@ impl pallet_xcm::Config for Runtime {
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
type AdminOrigin = EnsureRoot<AccountId>;
type MaxRemoteLockConsumers = ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
}
pub struct ToRialtoOrRialtoParachainSwitchExporter;
+6 -2
View File
@@ -136,7 +136,11 @@ impl RelayChainCli {
) -> Self {
let extension = chain_spec::Extensions::try_get(&*para_config.chain_spec);
let chain_id = extension.map(|e| e.relay_chain.clone());
let base_path = para_config.base_path.as_ref().map(|x| x.path().join("rialto-bridge-node"));
Self { base_path, chain_id, base: polkadot_cli::RunCmd::parse_from(relay_chain_args) }
let base_path = para_config.base_path.path().join("rialto-bridge-node");
Self {
base_path: Some(base_path),
chain_id,
base: polkadot_cli::RunCmd::parse_from(relay_chain_args),
}
}
}
@@ -320,14 +320,10 @@ impl DefaultConfigurationValues for RelayChainCli {
30334
}
fn rpc_ws_listen_port() -> u16 {
fn rpc_listen_port() -> u16 {
9945
}
fn rpc_http_listen_port() -> u16 {
9934
}
fn prometheus_listen_port() -> u16 {
9616
}
@@ -357,16 +353,8 @@ impl CliConfiguration<Self> for RelayChainCli {
.or_else(|| self.base_path.clone().map(Into::into)))
}
fn rpc_http(&self, default_listen_port: u16) -> Result<Option<SocketAddr>> {
self.base.base.rpc_http(default_listen_port)
}
fn rpc_ipc(&self) -> Result<Option<String>> {
self.base.base.rpc_ipc()
}
fn rpc_ws(&self, default_listen_port: u16) -> Result<Option<SocketAddr>> {
self.base.base.rpc_ws(default_listen_port)
fn rpc_addr(&self, default_listen_port: u16) -> Result<Option<SocketAddr>> {
self.base.base.rpc_addr(default_listen_port)
}
fn prometheus_config(
@@ -408,8 +396,8 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.rpc_methods()
}
fn rpc_ws_max_connections(&self) -> Result<Option<usize>> {
self.base.base.rpc_ws_max_connections()
fn rpc_max_connections(&self) -> Result<u32> {
self.base.base.rpc_max_connections()
}
fn rpc_cors(&self, is_dev: bool) -> Result<Option<Vec<String>>> {
@@ -45,7 +45,7 @@ use sc_executor::{
HeapAllocStrategy, NativeElseWasmExecutor, NativeExecutionDispatch, WasmExecutor,
DEFAULT_HEAP_ALLOC_STRATEGY,
};
use sc_network::NetworkBlock;
use sc_network::{config::FullNetworkConfiguration, NetworkBlock};
use sc_network_sync::SyncingService;
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
@@ -278,10 +278,12 @@ where
let prometheus_registry = parachain_config.prometheus_registry().cloned();
let transaction_pool = params.transaction_pool.clone();
let import_queue_service = params.import_queue.service();
let net_config = FullNetworkConfiguration::new(&parachain_config.network);
let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &parachain_config,
net_config,
client: client.clone(),
transaction_pool: transaction_pool.clone(),
spawn_handle: task_manager.spawn_handle(),
@@ -333,7 +335,7 @@ where
&task_manager,
relay_chain_interface.clone(),
transaction_pool,
sync_service,
sync_service.clone(),
params.keystore_container.keystore(),
force_authoring,
)?;
@@ -353,6 +355,7 @@ where
collator_key: collator_key.expect("Command line arguments do not allow this. qed"),
relay_chain_slot_duration,
recovery_handle: Box::new(overseer_handle),
sync_service,
};
start_collator(params).await?;
@@ -366,6 +369,7 @@ where
relay_chain_slot_duration,
import_queue: import_queue_service,
recovery_handle: Box::new(overseer_handle),
sync_service,
};
start_full_node(params)?;
@@ -322,6 +322,7 @@ impl pallet_transaction_payment::Config for Runtime {
impl pallet_sudo::Config for Runtime {
type RuntimeCall = RuntimeCall;
type RuntimeEvent = RuntimeEvent;
type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
}
parameter_types! {
@@ -497,6 +498,8 @@ impl pallet_xcm::Config for Runtime {
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
type AdminOrigin = frame_system::EnsureRoot<AccountId>;
type MaxRemoteLockConsumers = ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
}
impl cumulus_pallet_xcm::Config for Runtime {
+1 -1
View File
@@ -33,7 +33,7 @@ sp-consensus-grandpa = { git = "https://github.com/paritytech/substrate", branch
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
# Polkadot Dependencies
polkadot-node-core-pvf = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-node-core-pvf-worker = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "master", default-features = false, features = [ "full-node", "polkadot-native" ] }
+2 -2
View File
@@ -164,7 +164,7 @@ pub fn run() -> sc_cli::Result<()> {
builder.with_colors(false);
let _ = builder.init();
polkadot_node_core_pvf::prepare_worker_entrypoint(
polkadot_node_core_pvf_worker::prepare_worker_entrypoint(
&cmd.socket_path,
Some(&cmd.node_impl_version),
);
@@ -175,7 +175,7 @@ pub fn run() -> sc_cli::Result<()> {
builder.with_colors(false);
let _ = builder.init();
polkadot_node_core_pvf::execute_worker_entrypoint(
polkadot_node_core_pvf_worker::execute_worker_entrypoint(
&cmd.socket_path,
Some(&cmd.node_impl_version),
);
+1
View File
@@ -365,6 +365,7 @@ impl pallet_transaction_payment::Config for Runtime {
impl pallet_sudo::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type RuntimeCall = RuntimeCall;
type WeightInfo = pallet_sudo::weights::SubstrateWeight<Runtime>;
}
impl pallet_session::Config for Runtime {
@@ -184,6 +184,8 @@ impl pallet_xcm::Config for Runtime {
#[cfg(feature = "runtime-benchmarks")]
type ReachableDest = ReachableDest;
type AdminOrigin = EnsureRoot<AccountId>;
type MaxRemoteLockConsumers = ConstU32<0>;
type RemoteLockConsumerIdentifier = ();
}
#[cfg(test)]
@@ -38,7 +38,7 @@ use sp_std::{
///
/// This particular proof is used to prove that headers on a bridged chain
/// (so not our chain) have been finalized correctly.
#[derive(Encode, Decode, RuntimeDebug, Clone, PartialEq, Eq, TypeInfo)]
#[derive(Encode, Decode, Clone, PartialEq, Eq, TypeInfo)]
pub struct GrandpaJustification<Header: HeaderT> {
/// The round (voting period) this justification is valid for.
pub round: u64,
@@ -49,6 +49,25 @@ pub struct GrandpaJustification<Header: HeaderT> {
pub votes_ancestries: Vec<Header>,
}
// TODO: remove and use `RuntimeDebug` (https://github.com/paritytech/parity-bridges-common/issues/2136)
impl<Header: HeaderT> sp_std::fmt::Debug for GrandpaJustification<Header> {
fn fmt(&self, fmt: &mut sp_std::fmt::Formatter) -> sp_std::fmt::Result {
#[cfg(feature = "std")]
{
fmt.debug_struct("GrandpaJustification")
.field("round", &self.round)
.field("commit", &self.commit)
.field("votes_ancestries", &self.votes_ancestries)
.finish()
}
#[cfg(not(feature = "std"))]
{
fmt.write_str("<stripped>")
}
}
}
impl<H: HeaderT> GrandpaJustification<H> {
/// Returns reasonable size of justification using constants from the provided chain.
///