Bridge hub kusama fine-tuning before release (#1999)

* Fix benchmarks-ci.sh - missing pallet_utility/pallet_multisig

* Missing ParentAsSuperuser for bridge-hubs

* Fixed missing stuff in benchmarks.yml

* Added MigrateToTrackInactive + CheckingAccount (for completness as other runtimes)

* Measured xcm weights for bridge-hubs

* Fix for fungible benchmarks

* ".git/.scripts/bench-bot.sh" xcm bridge-hub-kusama bridge-hubs pallet_xcm_benchmarks::fungible

* ".git/.scripts/bench-bot.sh" xcm bridge-hub-rococo bridge-hubs pallet_xcm_benchmarks::generic

* ".git/.scripts/bench-bot.sh" xcm bridge-hub-rococo bridge-hubs pallet_xcm_benchmarks::fungible

* ".git/.scripts/bench-bot.sh" xcm bridge-hub-kusama bridge-hubs pallet_xcm_benchmarks::generic

* Reverting migrations - no need for them

* script for generate genesis spec/head/wasm

* Adding invulnerables and session.keys to the script
(https://github.com/paritytech/devops/issues/2196)

* update chainspec with cmd: ./scripts/create_bridge_hub_kusama_spec.sh ./target/release/wbuild/bridge-hub-kusama-runtime/bridge_hub_kusama_runtime.compact.compressed.wasm 1003

* para_id 1003 -> 1002, cmd: ./scripts/create_bridge_hub_kusama_spec.sh ./target/release/wbuild/bridge-hub-kusama-runtime/bridge_hub_kusama_runtime.compact.compressed.wasm 1002

Co-authored-by: command-bot <>
This commit is contained in:
Branislav Kontur
2022-12-21 09:59:00 +01:00
committed by GitHub
parent b7dff85939
commit 489a5b501a
18 changed files with 1284 additions and 29 deletions
@@ -32,9 +32,10 @@ use xcm::latest::prelude::*;
use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, AllowUnpaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
FixedWeightBounds, IsConcrete, LocationInverter, ParentIsPreset, RelayChainAsNative,
IsConcrete, LocationInverter, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
WeightInfoBounds,
};
use xcm_executor::XcmExecutor;
@@ -43,6 +44,7 @@ parameter_types! {
pub const RelayNetwork: NetworkId = NetworkId::Kusama;
pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
pub Ancestry: MultiLocation = Parachain(ParachainInfo::parachain_id().into()).into();
pub const MaxInstructions: u32 = 100;
}
/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
@@ -85,6 +87,9 @@ pub type XcmOriginToTransactDispatchOrigin = (
// Native converter for sibling Parachains; will convert to a `SiblingPara` origin when
// recognized.
SiblingParachainAsNative<cumulus_pallet_xcm::Origin, RuntimeOrigin>,
// Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a
// transaction from the Root origin.
ParentAsSuperuser<RuntimeOrigin>,
// Native signed account converter; this just converts an `AccountId32` origin into a normal
// `Origin::Signed` origin of the same 32-byte value.
SignedAccountId32AsNative<RelayNetwork, RuntimeOrigin>,
@@ -92,13 +97,6 @@ pub type XcmOriginToTransactDispatchOrigin = (
XcmPassthrough<RuntimeOrigin>,
);
parameter_types! {
// TODO: change to meassured weights - https://github.com/paritytech/parity-bridges-common/issues/391
// One XCM operation is 1_000_000_000 weight - almost certainly a conservative estimate.
pub UnitWeightCost: u64 = 1_000_000_000;
pub const MaxInstructions: u32 = 100;
}
match_types! {
// TODO: map gov2 origins here - after merge https://github.com/paritytech/cumulus/pull/1895
pub type ParentOrParentsExecutivePlurality: impl Contains<MultiLocation> = {
@@ -140,8 +138,11 @@ impl xcm_executor::Config for XcmConfig {
type IsTeleporter = ConcreteNativeAssetFrom<KsmRelayLocation>;
type LocationInverter = LocationInverter<Ancestry>;
type Barrier = Barrier;
// TODO: change to meassured weights - https://github.com/paritytech/parity-bridges-common/issues/391
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type Weigher = WeightInfoBounds<
crate::weights::xcm::BridgeHubKusamaXcmWeight<RuntimeCall>,
RuntimeCall,
MaxInstructions,
>;
type Trader =
UsingComponents<WeightToFee, KsmRelayLocation, AccountId, Balances, ToAuthor<Runtime>>;
type ResponseHandler = PolkadotXcm;
@@ -175,9 +176,11 @@ impl pallet_xcm::Config for Runtime {
type XcmExecutor = XcmExecutor<XcmConfig>;
type XcmTeleportFilter = Everything;
type XcmReserveTransferFilter = Nothing; // This parachain is not meant as a reserve location.
// TODO: change to meassured weights - https://github.com/paritytech/parity-bridges-common/issues/391
type Weigher = FixedWeightBounds<UnitWeightCost, RuntimeCall, MaxInstructions>;
type Weigher = WeightInfoBounds<
crate::weights::xcm::BridgeHubKusamaXcmWeight<RuntimeCall>,
RuntimeCall,
MaxInstructions,
>;
type LocationInverter = LocationInverter<Ancestry>;
type RuntimeOrigin = RuntimeOrigin;
type RuntimeCall = RuntimeCall;