Skip to content

Commit

Permalink
Backport from polkadot-sdk with actual master (paritytech#2633)
Browse files Browse the repository at this point in the history
* Backport from `polkadot-sdk`

* lingua stuff

* Fixes

* Fix

* Features?

* Fix - v5 -> v6

* zepter format features

* try zepter with CI

* Fix imports

* Fix

* Fix

* Fix

* Revert zepther pipeline
  • Loading branch information
bkontur authored Oct 19, 2023
1 parent b917553 commit 51bec19
Show file tree
Hide file tree
Showing 29 changed files with 353 additions and 143 deletions.
4 changes: 1 addition & 3 deletions bridges/bin/millau/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,4 @@ frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", b

[features]
default = []
runtime-benchmarks = [
"millau-runtime/runtime-benchmarks",
]
runtime-benchmarks = [ "millau-runtime/runtime-benchmarks" ]
3 changes: 2 additions & 1 deletion bridges/bin/millau/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ pub fn new_partial(

/// Builds a new service for a full client.
pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
use sc_network_common::sync::warp::WarpSyncParams;
use sc_service::WarpSyncParams;

let sc_service::PartialComponents {
client,
Expand Down Expand Up @@ -242,6 +242,7 @@ pub fn new_full(config: Configuration) -> Result<TaskManager, ServiceError> {
import_queue,
block_announce_validator_builder: None,
warp_sync_params: Some(WarpSyncParams::WithProvider(warp_sync)),
block_relay: None,
})?;

if config.offchain_worker.enabled {
Expand Down
15 changes: 8 additions & 7 deletions bridges/bin/millau/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,15 @@ static_assertions = "1.1"
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }

[features]
default = ["std"]
default = [ "std" ]
std = [
"sp-consensus-beefy/std",
"bp-messages/std",
"bp-millau/std",
"bp-parachains/std",
"bp-polkadot-core/std",
"bp-relayers/std",
"bp-rialto/std",
"bp-rialto-parachain/std",
"bp-rialto/std",
"bp-runtime/std",
"bp-westend/std",
"bp-xcm-bridge-hub-router/std",
Expand All @@ -104,8 +103,8 @@ std = [
"pallet-aura/std",
"pallet-authorship/std",
"pallet-balances/std",
"pallet-beefy/std",
"pallet-beefy-mmr/std",
"pallet-beefy/std",
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
"pallet-bridge-parachains/std",
Expand All @@ -120,12 +119,13 @@ std = [
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-utility/std",
"pallet-xcm/std",
"pallet-xcm-bridge-hub-router/std",
"pallet-xcm/std",
"scale-info/std",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-consensus-beefy/std",
"sp-core/std",
"sp-inherents/std",
"sp-io/std",
Expand All @@ -135,20 +135,21 @@ std = [
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"xcm/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
]
runtime-benchmarks = [
"bridge-runtime-common/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-bridge-grandpa/runtime-benchmarks",
"pallet-bridge-messages/runtime-benchmarks",
"pallet-bridge-parachains/runtime-benchmarks",
"pallet-bridge-relayers/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"pallet-xcm-bridge-hub-router/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
]
13 changes: 10 additions & 3 deletions bridges/bin/millau/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ use sp_std::prelude::*;
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
use xcm_builder::NetworkExportTable;
use xcm_builder::{NetworkExportTable, NetworkExportTableItem};

// to be able to use Millau runtime in `bridge-runtime-common` tests
pub use bridge_runtime_common;
Expand Down Expand Up @@ -583,8 +583,15 @@ impl pallet_utility::Config for Runtime {
// this config is totally incorrect - the pallet is not actually used at this runtime. We need
// it only to be able to run benchmarks and make required traits (and default weights for tests).
parameter_types! {
pub BridgeTable: Vec<(xcm::prelude::NetworkId, xcm::prelude::MultiLocation, Option<xcm::prelude::MultiAsset>)>
= vec![(xcm_config::RialtoNetwork::get(), xcm_config::TokenLocation::get(), Some((xcm_config::TokenAssetId::get(), 1_000_000_000_u128).into()))];
pub BridgeTable: Vec<NetworkExportTableItem>
= vec![
NetworkExportTableItem::new(
xcm_config::RialtoNetwork::get(),
None,
xcm_config::TokenLocation::get(),
Some((xcm_config::TokenAssetId::get(), 1_000_000_000_u128).into())
)
];
}
impl pallet_xcm_bridge_hub_router::Config for Runtime {
type WeightInfo = ();
Expand Down
2 changes: 1 addition & 1 deletion bridges/bin/rialto-parachain/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name = 'rialto-parachain-collator'

[features]
default = []
runtime-benchmarks = ['rialto-parachain-runtime/runtime-benchmarks']
runtime-benchmarks = [ 'rialto-parachain-runtime/runtime-benchmarks' ]

[dependencies]
clap = { version = "4.4.6", features = ["derive"] }
Expand Down
1 change: 1 addition & 0 deletions bridges/bin/rialto-parachain/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ where
Box::new(block_announce_validator)
})),
warp_sync_params: None,
block_relay: None,
})?;

let rpc_client = client.clone();
Expand Down
60 changes: 32 additions & 28 deletions bridges/bin/rialto-parachain/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,62 +81,66 @@ bridge-runtime-common = { path = "../../runtime-common", features = ["integrity-
static_assertions = "1.1"

[features]
default = ['std']
default = [ 'std' ]
runtime-benchmarks = [
'sp-runtime/runtime-benchmarks',
'bridge-runtime-common/runtime-benchmarks',
'frame-benchmarking',
'frame-support/runtime-benchmarks',
'frame-system-benchmarking/runtime-benchmarks',
'frame-system/runtime-benchmarks',
'pallet-balances/runtime-benchmarks',
'pallet-bridge-grandpa/runtime-benchmarks',
'pallet-bridge-messages/runtime-benchmarks',
'pallet-bridge-relayers/runtime-benchmarks',
'pallet-timestamp/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
]
std = [
"bp-messages/std",
"bp-millau/std",
"bp-relayers/std",
"bp-runtime/std",
"bp-rialto-parachain/std",
"bp-runtime/std",
"bridge-runtime-common/std",
"codec/std",
"scale-info/std",
"sp-api/std",
"sp-std/std",
"sp-io/std",
"sp-core/std",
"sp-runtime/std",
"sp-version/std",
"sp-offchain/std",
"sp-session/std",
"sp-block-builder/std",
"sp-transaction-pool/std",
"sp-inherents/std",
"frame-support/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-xcm/std",
"cumulus-pallet-xcmp-queue/std",
"cumulus-primitives-core/std",
"cumulus-primitives-timestamp/std",
"frame-executive/std",
"frame-system/std",
"frame-support/std",
"frame-system-rpc-runtime-api/std",
"frame-system/std",
"pallet-aura/std",
"pallet-balances/std",
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
"pallet-bridge-relayers/std",
"pallet-timestamp/std",
"pallet-sudo/std",
"pallet-transaction-payment/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-xcm/std",
"parachain-info/std",
"polkadot-parachain-primitives/std",
"cumulus-pallet-aura-ext/std",
"cumulus-pallet-parachain-system/std",
"cumulus-pallet-xcmp-queue/std",
"cumulus-pallet-xcm/std",
"cumulus-primitives-core/std",
"cumulus-primitives-timestamp/std",
"xcm/std",
"scale-info/std",
"sp-api/std",
"sp-block-builder/std",
"sp-consensus-aura/std",
"sp-core/std",
"sp-inherents/std",
"sp-io/std",
"sp-offchain/std",
"sp-runtime/std",
"sp-session/std",
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"xcm-builder/std",
"xcm-executor/std",
"pallet-aura/std",
"sp-consensus-aura/std",
"xcm/std",
]
2 changes: 1 addition & 1 deletion bridges/bin/rialto/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ polkadot-node-core-pvf-execute-worker = { git = "https://github.com/paritytech/p
polkadot-node-core-pvf-prepare-worker = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false, features = [ "full-node", "polkadot-native" ] }
polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master", default-features = false, features = [ "full-node" ] }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
Expand Down
6 changes: 3 additions & 3 deletions bridges/bin/rialto/node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// You should have received a copy of the GNU General Public License
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.

use polkadot_primitives::v5::{AssignmentId, ValidatorId};
use polkadot_primitives::v6::{AssignmentId, ValidatorId};
use rialto_runtime::{
AccountId, BabeConfig, BalancesConfig, BeefyConfig, BridgeMillauMessagesConfig,
ConfigurationConfig, GrandpaConfig, RuntimeGenesisConfig, SessionConfig, SessionKeys,
Expand Down Expand Up @@ -245,8 +245,8 @@ fn testnet_genesis(
validation_upgrade_cooldown: 2u32,
validation_upgrade_delay: 2,
code_retention_period: 1200,
max_code_size: polkadot_primitives::v5::MAX_CODE_SIZE,
max_pov_size: polkadot_primitives::v5::MAX_POV_SIZE,
max_code_size: polkadot_primitives::v6::MAX_CODE_SIZE,
max_pov_size: polkadot_primitives::v6::MAX_POV_SIZE,
max_head_data_size: 32 * 1024,
group_rotation_frequency: 20,
max_upward_queue_count: 8,
Expand Down
13 changes: 8 additions & 5 deletions bridges/bin/rialto/runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ static_assertions = "1.1"
substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }

[features]
default = ["std"]
default = [ "std" ]
std = [
"sp-consensus-beefy/std",
"bp-messages/std",
"bp-millau/std",
"bp-relayers/std",
Expand All @@ -99,8 +98,8 @@ std = [
"pallet-authorship/std",
"pallet-babe/std",
"pallet-balances/std",
"pallet-beefy/std",
"pallet-beefy-mmr/std",
"pallet-beefy/std",
"pallet-bridge-beefy/std",
"pallet-bridge-grandpa/std",
"pallet-bridge-messages/std",
Expand All @@ -109,13 +108,13 @@ std = [
"pallet-message-queue/std",
"pallet-mmr/std",
"pallet-offences/std",
"pallet-xcm/std",
"pallet-session/std",
"pallet-shift-session-manager/std",
"pallet-sudo/std",
"pallet-timestamp/std",
"pallet-transaction-payment-rpc-runtime-api/std",
"pallet-transaction-payment/std",
"pallet-xcm/std",
"polkadot-primitives/std",
"polkadot-runtime-common/std",
"polkadot-runtime-parachains/std",
Expand All @@ -124,6 +123,7 @@ std = [
"sp-authority-discovery/std",
"sp-block-builder/std",
"sp-consensus-babe/std",
"sp-consensus-beefy/std",
"sp-core/std",
"sp-inherents/std",
"sp-io/std",
Expand All @@ -133,18 +133,21 @@ std = [
"sp-std/std",
"sp-transaction-pool/std",
"sp-version/std",
"xcm/std",
"xcm-builder/std",
"xcm-executor/std",
"xcm/std",
]
runtime-benchmarks = [
"bridge-runtime-common/runtime-benchmarks",
"frame-benchmarking/runtime-benchmarks",
"frame-support/runtime-benchmarks",
"frame-system/runtime-benchmarks",
"pallet-bridge-grandpa/runtime-benchmarks",
"pallet-bridge-messages/runtime-benchmarks",
"pallet-bridge-relayers/runtime-benchmarks",
"pallet-message-queue/runtime-benchmarks",
"pallet-xcm/runtime-benchmarks",
"polkadot-runtime-common/runtime-benchmarks",
"sp-runtime/runtime-benchmarks",
"xcm-builder/runtime-benchmarks",
]
Loading

0 comments on commit 51bec19

Please sign in to comment.