Backport from polkadot-sdk with actual master (#2633)

* 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
This commit is contained in:
Branislav Kontur
2023-10-19 10:04:26 +02:00
committed by Bastian Köcher
parent dcd2debbb2
commit f539157da2
29 changed files with 353 additions and 143 deletions
+2 -5
View File
@@ -35,7 +35,7 @@ sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master"
bp-test-utils = { path = "../../primitives/test-utils" }
[features]
default = ["std"]
default = [ "std" ]
std = [
"bp-beefy/std",
"bp-runtime/std",
@@ -49,7 +49,4 @@ std = [
"sp-runtime/std",
"sp-std/std",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
]
try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime" ]
+5 -5
View File
@@ -9,15 +9,15 @@ to verify storage proofs, generated at the bridged relay chain.
## A Brief Introduction into Parachains Finality
You can find detailed information on parachains finality in the [Polkadot](https://github.com/paritytech/polkadot)
and [Cumulus](https://github.com/paritytech/cumulus) repositories. This section gives a brief overview of how
the parachain finality works and how to build a light client for a parachain.
You can find detailed information on parachains finality in the
[Polkadot-SDK](https://github.com/paritytech/polkadot-sdk) repository. This section gives a brief overview of how the
parachain finality works and how to build a light client for a parachain.
The main thing there is that the parachain generates blocks on its own, but it can't achieve finality without
help of its relay chain. Instead, the parachain collators create a block and hand it over to the relay chain
validators. Validators validate the block and register the new parachain head in the
[`Heads` map](https://github.com/paritytech/polkadot/blob/88013730166ba90745ae7c9eb3e0c1be1513c7cc/runtime/parachains/src/paras/mod.rs#L645)
of the [`paras`](https://github.com/paritytech/polkadot/tree/master/runtime/parachains/src/paras) pallet,
[`Heads` map](https://github.com/paritytech/polkadot-sdk/blob/bc5005217a8c2e7c95b9011c96d7e619879b1200/polkadot/runtime/parachains/src/paras/mod.rs#L683-L686)
of the [`paras`](https://github.com/paritytech/polkadot-sdk/tree/master/polkadot/runtime/parachains/src/paras) pallet,
deployed at the relay chain. Keep in mind that this pallet, deployed at a relay chain, is **NOT** a bridge pallet,
even though the names are similar.
@@ -25,7 +25,7 @@ sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch
sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "master" }
[features]
default = ["std"]
default = [ "std" ]
std = [
"codec/std",
"frame-support/std",
@@ -35,7 +35,4 @@ std = [
"sp-staking/std",
"sp-std/std",
]
try-runtime = [
"frame-support/try-runtime",
"frame-system/try-runtime",
]
try-runtime = [ "frame-support/try-runtime", "frame-system/try-runtime" ]
@@ -60,6 +60,8 @@ benchmarks_instance_pallet! {
is_congested: false,
delivery_fee_factor: MINIMAL_DELIVERY_FEE_FACTOR + MINIMAL_DELIVERY_FEE_FACTOR,
});
let _ = T::ensure_bridged_target_destination();
T::make_congested();
}: {
crate::Pallet::<T, I>::on_initialize(Zero::zero())
@@ -79,11 +81,11 @@ benchmarks_instance_pallet! {
}
send_message {
// make local queue congested, because it means additional db write
T::make_congested();
let dest = T::ensure_bridged_target_destination();
let xcm = sp_std::vec![].into();
// make local queue congested, because it means additional db write
T::make_congested();
}: {
send_xcm::<crate::Pallet<T, I>>(dest, xcm).expect("message is sent")
}
@@ -27,7 +27,7 @@ use sp_runtime::{
BuildStorage,
};
use xcm::prelude::*;
use xcm_builder::NetworkExportTable;
use xcm_builder::{NetworkExportTable, NetworkExportTableItem};
pub type AccountId = u64;
type Block = frame_system::mocking::MockBlock<TestRuntime>;
@@ -53,8 +53,15 @@ parameter_types! {
pub UniversalLocation: InteriorMultiLocation = X2(GlobalConsensus(ThisNetworkId::get()), Parachain(1000));
pub SiblingBridgeHubLocation: MultiLocation = ParentThen(X1(Parachain(1002))).into();
pub BridgeFeeAsset: AssetId = MultiLocation::parent().into();
pub BridgeTable: Vec<(NetworkId, MultiLocation, Option<MultiAsset>)>
= vec![(BridgedNetworkId::get(), SiblingBridgeHubLocation::get(), Some((BridgeFeeAsset::get(), BASE_FEE).into()))];
pub BridgeTable: Vec<NetworkExportTableItem>
= vec![
NetworkExportTableItem::new(
BridgedNetworkId::get(),
None,
SiblingBridgeHubLocation::get(),
Some((BridgeFeeAsset::get(), BASE_FEE).into())
)
];
}
impl frame_system::Config for TestRuntime {