From 94c44a715820dac0b1edda731045fd2912af8406 Mon Sep 17 00:00:00 2001 From: Svyatoslav Nikolsky Date: Thu, 14 Dec 2023 17:03:35 +0300 Subject: [PATCH] Added Rococo BH <> Rococo Bulletin bridge (#2724) * added Rococo BH <> Rococo Bulletin bridge * init-bridge support * allow customising finality-related runtime APIs * revert me * use Rococo/BridgeHubRococo pretending to be a Polkadot/BridgeHubPolkadot in Rococo <> RococoBulletin bridge * Revert "revert me" This reverts commit 90c598d9d50a25e7182c97eee7818bf8d4bc404c. * Revert "allow customising finality-related runtime APIs" This reverts commit b39c32c34acddfd0b919042122e0e667470bd0a4. * fmt * WITH_BRIDGE_ROCOCO_TO_BULLETIN_MESSAGES_PALLET_INDEX * regenerate bulletin chain runtime (pallet indices have changed) * fx WITH_BRIDGE_ROCOCO_TO_BULLETIN_MESSAGES_PALLET_INDEX constant because of latest changes * also change indices in runtime * fmt * clippy --- Cargo.lock | 4 + modules/beefy/src/mock.rs | 2 +- primitives/chain-bridge-hub-rococo/src/lib.rs | 2 + primitives/runtime/src/chain.rs | 12 +- relays/bin-substrate/Cargo.toml | 4 + relays/bin-substrate/src/bridges/mod.rs | 1 + ..._polkadot_messages_to_polkadot_bulletin.rs | 4 +- ...ulletin_messages_to_bridge_hub_polkadot.rs | 4 +- ..._hub_rococo_messages_to_rococo_bulletin.rs | 65 + .../src/bridges/rococo_bulletin/mod.rs | 259 +++ ...o_bulletin_headers_to_bridge_hub_rococo.rs | 86 + ..._bulletin_messages_to_bridge_hub_rococo.rs | 65 + .../rococo_headers_to_rococo_bulletin.rs | 81 + .../rococo_parachains_to_rococo_bulletin.rs | 91 ++ relays/bin-substrate/src/cli/bridge.rs | 2 + relays/bin-substrate/src/cli/init_bridge.rs | 39 + relays/bin-substrate/src/cli/relay_headers.rs | 12 + .../src/cli/relay_headers_and_messages/mod.rs | 45 + .../bin-substrate/src/cli/relay_messages.rs | 10 + .../bin-substrate/src/cli/relay_parachains.rs | 5 + .../src/codegen_runtime.rs | 1445 ++++++++++++----- relays/client-bridge-hub-rococo/src/lib.rs | 2 + .../src/codegen_runtime.rs | 316 +++- relays/client-polkadot-bulletin/src/lib.rs | 2 +- relays/client-substrate/src/chain.rs | 18 + tools/runtime-codegen/src/main.rs | 8 +- 26 files changed, 2087 insertions(+), 497 deletions(-) create mode 100644 relays/bin-substrate/src/bridges/rococo_bulletin/bridge_hub_rococo_messages_to_rococo_bulletin.rs create mode 100644 relays/bin-substrate/src/bridges/rococo_bulletin/mod.rs create mode 100644 relays/bin-substrate/src/bridges/rococo_bulletin/rococo_bulletin_headers_to_bridge_hub_rococo.rs create mode 100644 relays/bin-substrate/src/bridges/rococo_bulletin/rococo_bulletin_messages_to_bridge_hub_rococo.rs create mode 100644 relays/bin-substrate/src/bridges/rococo_bulletin/rococo_headers_to_rococo_bulletin.rs create mode 100644 relays/bin-substrate/src/bridges/rococo_bulletin/rococo_parachains_to_rococo_bulletin.rs diff --git a/Cargo.lock b/Cargo.lock index 14780b26f72ef..7cd413ede56e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9491,11 +9491,15 @@ dependencies = [ "anyhow", "async-std", "async-trait", + "bp-bridge-hub-polkadot", + "bp-bridge-hub-rococo", "bp-header-chain", "bp-messages", "bp-parachains", + "bp-polkadot", "bp-polkadot-bulletin", "bp-polkadot-core", + "bp-rococo", "bp-runtime", "bp-test-utils", "bridge-runtime-common", diff --git a/modules/beefy/src/mock.rs b/modules/beefy/src/mock.rs index 0b0084609cc55..f89fd1e63480c 100644 --- a/modules/beefy/src/mock.rs +++ b/modules/beefy/src/mock.rs @@ -163,7 +163,7 @@ pub fn validator_ids(index: u32, count: u32) -> Vec { validator_pairs(index, count).into_iter().map(|pair| pair.public()).collect() } -pub fn authority_set_info(id: u64, validators: &Vec) -> TestBridgedAuthoritySetInfo { +pub fn authority_set_info(id: u64, validators: &[BeefyId]) -> TestBridgedAuthoritySetInfo { let merkle_root = get_authorities_mmr_root::(validators.iter()); TestBridgedAuthoritySetInfo { id, len: validators.len() as u32, keyset_commitment: merkle_root } diff --git a/primitives/chain-bridge-hub-rococo/src/lib.rs b/primitives/chain-bridge-hub-rococo/src/lib.rs index 59d293edf1c24..1fe44597c3d40 100644 --- a/primitives/chain-bridge-hub-rococo/src/lib.rs +++ b/primitives/chain-bridge-hub-rococo/src/lib.rs @@ -76,6 +76,8 @@ pub const WITH_BRIDGE_HUB_ROCOCO_RELAYERS_PALLET_NAME: &str = "BridgeRelayers"; /// Pallet index of `BridgeWestendMessages: pallet_bridge_messages::`. pub const WITH_BRIDGE_ROCOCO_TO_WESTEND_MESSAGES_PALLET_INDEX: u8 = 51; +/// Pallet index of `BridgePolkadotBulletinMessages: pallet_bridge_messages::`. +pub const WITH_BRIDGE_ROCOCO_TO_BULLETIN_MESSAGES_PALLET_INDEX: u8 = 61; decl_bridge_finality_runtime_apis!(bridge_hub_rococo); decl_bridge_messages_runtime_apis!(bridge_hub_rococo); diff --git a/primitives/runtime/src/chain.rs b/primitives/runtime/src/chain.rs index b78023efb1b86..469c839ba151f 100644 --- a/primitives/runtime/src/chain.rs +++ b/primitives/runtime/src/chain.rs @@ -15,7 +15,7 @@ // along with Parity Bridges Common. If not, see . use crate::HeaderIdProvider; -use codec::{Decode, Encode, MaxEncodedLen}; +use codec::{Codec, Decode, Encode, MaxEncodedLen}; use frame_support::{weights::Weight, Parameter}; use num_traits::{AsPrimitive, Bounded, CheckedSub, Saturating, SaturatingAdd, Zero}; use sp_runtime::{ @@ -39,7 +39,7 @@ pub enum EncodedOrDecodedCall { Decoded(ChainCall), } -impl EncodedOrDecodedCall { +impl EncodedOrDecodedCall { /// Returns decoded call. pub fn to_decoded(&self) -> Result { match self { @@ -57,6 +57,14 @@ impl EncodedOrDecodedCall { Self::Decoded(decoded_call) => Ok(decoded_call), } } + + /// Converts self to encoded call. + pub fn into_encoded(self) -> Vec { + match self { + Self::Encoded(encoded_call) => encoded_call, + Self::Decoded(decoded_call) => decoded_call.encode(), + } + } } impl From for EncodedOrDecodedCall { diff --git a/relays/bin-substrate/Cargo.toml b/relays/bin-substrate/Cargo.toml index a850f15ed4673..6b9114e3d7e53 100644 --- a/relays/bin-substrate/Cargo.toml +++ b/relays/bin-substrate/Cargo.toml @@ -23,11 +23,15 @@ signal-hook-async-std = "0.2.2" strum = { version = "0.25.0", features = ["derive"] } # Bridge dependencies +bp-bridge-hub-polkadot = { path = "../../primitives/chain-bridge-hub-polkadot" } +bp-bridge-hub-rococo = { path = "../../primitives/chain-bridge-hub-rococo" } bp-header-chain = { path = "../../primitives/header-chain" } bp-messages = { path = "../../primitives/messages" } bp-parachains = { path = "../../primitives/parachains" } bp-polkadot-bulletin = { path = "../../primitives/chain-polkadot-bulletin" } +bp-polkadot = { path = "../../primitives/chain-polkadot" } bp-polkadot-core = { path = "../../primitives/polkadot-core" } +bp-rococo = { path = "../../primitives/chain-rococo" } bp-runtime = { path = "../../primitives/runtime" } bridge-runtime-common = { path = "../../bin/runtime-common" } pallet-bridge-parachains = { path = "../../modules/parachains" } diff --git a/relays/bin-substrate/src/bridges/mod.rs b/relays/bin-substrate/src/bridges/mod.rs index 8dad329cf73be..cfe59c87567da 100644 --- a/relays/bin-substrate/src/bridges/mod.rs +++ b/relays/bin-substrate/src/bridges/mod.rs @@ -18,4 +18,5 @@ pub mod kusama_polkadot; pub mod polkadot_bulletin; +pub mod rococo_bulletin; pub mod rococo_westend; diff --git a/relays/bin-substrate/src/bridges/polkadot_bulletin/bridge_hub_polkadot_messages_to_polkadot_bulletin.rs b/relays/bin-substrate/src/bridges/polkadot_bulletin/bridge_hub_polkadot_messages_to_polkadot_bulletin.rs index 614b42de4ed89..ba80d96a93cc2 100644 --- a/relays/bin-substrate/src/bridges/polkadot_bulletin/bridge_hub_polkadot_messages_to_polkadot_bulletin.rs +++ b/relays/bin-substrate/src/bridges/polkadot_bulletin/bridge_hub_polkadot_messages_to_polkadot_bulletin.rs @@ -36,8 +36,8 @@ impl MessagesCliBridge for BridgeHubPolkadotToPolkadotBulletinMessagesCliBridge substrate_relay_helper::generate_receive_message_proof_call_builder!( BridgeHubPolkadotMessagesToPolkadotBulletinMessageLane, BridgeHubPolkadotMessagesToPolkadotBulletinMessageLaneReceiveMessagesProofCallBuilder, - relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotBridgeHubMessages, - relay_polkadot_bulletin_client::BridgePolkadotBridgeHubMessagesCall::receive_messages_proof + relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotMessages, + relay_polkadot_bulletin_client::BridgePolkadotMessagesCall::receive_messages_proof ); substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!( diff --git a/relays/bin-substrate/src/bridges/polkadot_bulletin/polkadot_bulletin_messages_to_bridge_hub_polkadot.rs b/relays/bin-substrate/src/bridges/polkadot_bulletin/polkadot_bulletin_messages_to_bridge_hub_polkadot.rs index ddfbcea495f90..1db77b6ed47b0 100644 --- a/relays/bin-substrate/src/bridges/polkadot_bulletin/polkadot_bulletin_messages_to_bridge_hub_polkadot.rs +++ b/relays/bin-substrate/src/bridges/polkadot_bulletin/polkadot_bulletin_messages_to_bridge_hub_polkadot.rs @@ -43,8 +43,8 @@ substrate_relay_helper::generate_receive_message_proof_call_builder!( substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!( PolkadotBulletinMessagesToBridgeHubPolkadotMessageLane, PolkadotBulletinMessagesToBridgeHubPolkadotMessageLaneReceiveMessagesDeliveryProofCallBuilder, - relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotBridgeHubMessages, - relay_polkadot_bulletin_client::BridgePolkadotBridgeHubMessagesCall::receive_messages_delivery_proof + relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotMessages, + relay_polkadot_bulletin_client::BridgePolkadotMessagesCall::receive_messages_delivery_proof ); /// PolkadotBulletin-to-BridgeHubPolkadot messages lane. diff --git a/relays/bin-substrate/src/bridges/rococo_bulletin/bridge_hub_rococo_messages_to_rococo_bulletin.rs b/relays/bin-substrate/src/bridges/rococo_bulletin/bridge_hub_rococo_messages_to_rococo_bulletin.rs new file mode 100644 index 0000000000000..a2de83831c9bf --- /dev/null +++ b/relays/bin-substrate/src/bridges/rococo_bulletin/bridge_hub_rococo_messages_to_rococo_bulletin.rs @@ -0,0 +1,65 @@ +// Copyright 2022 Parity Technologies (UK) Ltd. +// This file is part of Parity Bridges Common. + +// Parity Bridges Common is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Bridges Common is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Bridges Common. If not, see . + +//! BridgeHubRococo-to-RococoBulletin messages sync entrypoint. + +use super::BridgeHubRococoAsBridgeHubPolkadot; +use crate::cli::bridge::{CliBridgeBase, MessagesCliBridge}; +use relay_polkadot_bulletin_client::PolkadotBulletin as RococoBulletin; +use substrate_relay_helper::{messages_lane::SubstrateMessageLane, UtilityPalletBatchCallBuilder}; + +/// BridgeHubRococo-to-RococoBulletin messages bridge. +pub struct BridgeHubRococoToRococoBulletinMessagesCliBridge {} + +impl CliBridgeBase for BridgeHubRococoToRococoBulletinMessagesCliBridge { + type Source = BridgeHubRococoAsBridgeHubPolkadot; + type Target = RococoBulletin; +} + +impl MessagesCliBridge for BridgeHubRococoToRococoBulletinMessagesCliBridge { + type MessagesLane = BridgeHubRococoMessagesToRococoBulletinMessageLane; +} + +substrate_relay_helper::generate_receive_message_proof_call_builder!( + BridgeHubRococoMessagesToRococoBulletinMessageLane, + BridgeHubRococoMessagesToRococoBulletinMessageLaneReceiveMessagesProofCallBuilder, + relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotMessages, + relay_polkadot_bulletin_client::BridgePolkadotMessagesCall::receive_messages_proof +); + +substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!( + BridgeHubRococoMessagesToRococoBulletinMessageLane, + BridgeHubRococoMessagesToRococoBulletinMessageLaneReceiveMessagesDeliveryProofCallBuilder, + relay_bridge_hub_rococo_client::RuntimeCall::BridgePolkadotBulletinMessages, + relay_bridge_hub_rococo_client::BridgeBulletinMessagesCall::receive_messages_delivery_proof +); + +/// BridgeHubRococo-to-RococoBulletin messages lane. +#[derive(Clone, Debug)] +pub struct BridgeHubRococoMessagesToRococoBulletinMessageLane; + +impl SubstrateMessageLane for BridgeHubRococoMessagesToRococoBulletinMessageLane { + type SourceChain = BridgeHubRococoAsBridgeHubPolkadot; + type TargetChain = RococoBulletin; + + type ReceiveMessagesProofCallBuilder = + BridgeHubRococoMessagesToRococoBulletinMessageLaneReceiveMessagesProofCallBuilder; + type ReceiveMessagesDeliveryProofCallBuilder = + BridgeHubRococoMessagesToRococoBulletinMessageLaneReceiveMessagesDeliveryProofCallBuilder; + + type SourceBatchCallBuilder = UtilityPalletBatchCallBuilder; + type TargetBatchCallBuilder = (); +} diff --git a/relays/bin-substrate/src/bridges/rococo_bulletin/mod.rs b/relays/bin-substrate/src/bridges/rococo_bulletin/mod.rs new file mode 100644 index 0000000000000..7760913f61c83 --- /dev/null +++ b/relays/bin-substrate/src/bridges/rococo_bulletin/mod.rs @@ -0,0 +1,259 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of Parity Bridges Common. + +// Parity Bridges Common is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Bridges Common is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Bridges Common. If not, see . + +//! Declaration of all bridges between Rococo Bulletin Chain and Rococo Bridge Hub. + +use crate::cli::CliChain; + +use bp_messages::MessageNonce; +use bp_runtime::{ + AccountIdOf, BalanceOf, BlockNumberOf, ChainId, HashOf, HasherOf, HeaderOf, NonceOf, + SignatureOf, +}; +use frame_support::pallet_prelude::Weight; +use relay_substrate_client::{ + Error as SubstrateError, SignParam, SimpleRuntimeVersion, UnsignedTransaction, +}; +use sp_core::storage::StorageKey; +use std::time::Duration; + +pub mod bridge_hub_rococo_messages_to_rococo_bulletin; +pub mod rococo_bulletin_headers_to_bridge_hub_rococo; +pub mod rococo_bulletin_messages_to_bridge_hub_rococo; +pub mod rococo_headers_to_rococo_bulletin; +pub mod rococo_parachains_to_rococo_bulletin; + +/// Base `Chain` implementation of Rococo, pretending to be Polkadot. +pub struct RococoBaseAsPolkadot; + +impl bp_runtime::Chain for RococoBaseAsPolkadot { + type BlockNumber = BlockNumberOf; + type Hash = HashOf; + type Hasher = HasherOf; + type Header = HeaderOf; + + type AccountId = AccountIdOf; + type Balance = BalanceOf; + type Nonce = NonceOf; + type Signature = SignatureOf; + + fn max_extrinsic_size() -> u32 { + bp_rococo::Rococo::max_extrinsic_size() + } + + fn max_extrinsic_weight() -> Weight { + bp_rococo::Rococo::max_extrinsic_weight() + } +} + +impl bp_header_chain::ChainWithGrandpa for RococoBaseAsPolkadot { + const WITH_CHAIN_GRANDPA_PALLET_NAME: &'static str = + bp_polkadot::Polkadot::WITH_CHAIN_GRANDPA_PALLET_NAME; + const MAX_AUTHORITIES_COUNT: u32 = bp_rococo::Rococo::MAX_AUTHORITIES_COUNT; + const REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY: u32 = + bp_rococo::Rococo::REASONABLE_HEADERS_IN_JUSTIFICATON_ANCESTRY; + const MAX_HEADER_SIZE: u32 = bp_rococo::Rococo::MAX_HEADER_SIZE; + const AVERAGE_HEADER_SIZE_IN_JUSTIFICATION: u32 = + bp_rococo::Rococo::AVERAGE_HEADER_SIZE_IN_JUSTIFICATION; +} + +/// Relay `Chain` implementation of Rococo, pretending to be Polkadot. +#[derive(Debug, Clone, Copy)] +pub struct RococoAsPolkadot; + +impl bp_runtime::UnderlyingChainProvider for RococoAsPolkadot { + type Chain = RococoBaseAsPolkadot; +} + +impl relay_substrate_client::Chain for RococoAsPolkadot { + const ID: ChainId = relay_rococo_client::Rococo::ID; + const NAME: &'static str = relay_rococo_client::Rococo::NAME; + const BEST_FINALIZED_HEADER_ID_METHOD: &'static str = + relay_polkadot_client::Polkadot::BEST_FINALIZED_HEADER_ID_METHOD; + const AVERAGE_BLOCK_INTERVAL: Duration = relay_rococo_client::Rococo::AVERAGE_BLOCK_INTERVAL; + + type SignedBlock = ::SignedBlock; + type Call = ::Call; +} + +impl relay_substrate_client::ChainWithGrandpa for RococoAsPolkadot { + const SYNCED_HEADERS_GRANDPA_INFO_METHOD: &'static str = + relay_polkadot_client::Polkadot::SYNCED_HEADERS_GRANDPA_INFO_METHOD; + + type KeyOwnerProof = + ::KeyOwnerProof; +} + +impl relay_substrate_client::ChainWithBalances for RococoAsPolkadot { + fn account_info_storage_key(account_id: &Self::AccountId) -> StorageKey { + relay_rococo_client::Rococo::account_info_storage_key(account_id) + } +} + +impl relay_substrate_client::RelayChain for RococoAsPolkadot { + const PARAS_PALLET_NAME: &'static str = relay_rococo_client::Rococo::PARAS_PALLET_NAME; +} + +impl relay_substrate_client::ChainWithTransactions for RococoAsPolkadot { + type AccountKeyPair = ::AccountKeyPair; + type SignedTransaction = ::SignedTransaction; + + fn sign_transaction( + param: SignParam, + unsigned: UnsignedTransaction, + ) -> Result { + relay_rococo_client::Rococo::sign_transaction( + SignParam { + spec_version: param.spec_version, + transaction_version: param.transaction_version, + genesis_hash: param.genesis_hash, + signer: param.signer, + }, + unsigned.switch_chain(), + ) + } + + fn is_signed(tx: &Self::SignedTransaction) -> bool { + relay_rococo_client::Rococo::is_signed(tx) + } + + fn is_signed_by(signer: &Self::AccountKeyPair, tx: &Self::SignedTransaction) -> bool { + relay_rococo_client::Rococo::is_signed_by(signer, tx) + } + + fn parse_transaction(tx: Self::SignedTransaction) -> Option> { + relay_rococo_client::Rococo::parse_transaction(tx).map(|tx| tx.switch_chain()) + } +} + +impl CliChain for RococoAsPolkadot { + const RUNTIME_VERSION: Option = None; +} + +/// Base `Chain` implementation of Rococo Bridge Hub, pretending to be a Polkadot Bridge Hub. +pub struct BaseBridgeHubRococoAsBridgeHubPolkadot; + +impl bp_runtime::Chain for BaseBridgeHubRococoAsBridgeHubPolkadot { + type BlockNumber = BlockNumberOf; + type Hash = HashOf; + type Hasher = HasherOf; + type Header = HeaderOf; + + type AccountId = AccountIdOf; + type Balance = BalanceOf; + type Nonce = NonceOf; + type Signature = SignatureOf; + + fn max_extrinsic_size() -> u32 { + bp_bridge_hub_rococo::BridgeHubRococo::max_extrinsic_size() + } + + fn max_extrinsic_weight() -> Weight { + bp_bridge_hub_rococo::BridgeHubRococo::max_extrinsic_weight() + } +} + +impl bp_runtime::Parachain for BaseBridgeHubRococoAsBridgeHubPolkadot { + const PARACHAIN_ID: u32 = bp_bridge_hub_rococo::BridgeHubRococo::PARACHAIN_ID; +} + +/// Relay `Chain` implementation of Rococo Bridge Hub, pretending to be a Polkadot Bridge Hub. +#[derive(Debug, Clone, Copy, PartialEq, Eq)] +pub struct BridgeHubRococoAsBridgeHubPolkadot; + +impl bp_runtime::UnderlyingChainProvider for BridgeHubRococoAsBridgeHubPolkadot { + type Chain = BaseBridgeHubRococoAsBridgeHubPolkadot; +} + +impl relay_substrate_client::Chain for BridgeHubRococoAsBridgeHubPolkadot { + const ID: ChainId = relay_bridge_hub_rococo_client::BridgeHubRococo::ID; + const NAME: &'static str = relay_bridge_hub_rococo_client::BridgeHubRococo::NAME; + const BEST_FINALIZED_HEADER_ID_METHOD: &'static str = + relay_bridge_hub_polkadot_client::BridgeHubPolkadot::BEST_FINALIZED_HEADER_ID_METHOD; + const AVERAGE_BLOCK_INTERVAL: Duration = + relay_bridge_hub_rococo_client::BridgeHubRococo::AVERAGE_BLOCK_INTERVAL; + + type SignedBlock = ::SignedBlock; + type Call = + ::Call; +} + +impl relay_substrate_client::ChainWithBalances for BridgeHubRococoAsBridgeHubPolkadot { + fn account_info_storage_key(account_id: &Self::AccountId) -> StorageKey { + relay_bridge_hub_rococo_client::BridgeHubRococo::account_info_storage_key(account_id) + } +} + +impl relay_substrate_client::ChainWithUtilityPallet for BridgeHubRococoAsBridgeHubPolkadot { + type UtilityPallet = relay_substrate_client::MockedRuntimeUtilityPallet< + relay_bridge_hub_rococo_client::RuntimeCall, + >; +} + +impl relay_substrate_client::ChainWithTransactions for BridgeHubRococoAsBridgeHubPolkadot { + type AccountKeyPair = ::AccountKeyPair; + type SignedTransaction = ::SignedTransaction; + + fn sign_transaction( + param: SignParam, + unsigned: UnsignedTransaction, + ) -> Result { + relay_bridge_hub_rococo_client::BridgeHubRococo::sign_transaction( + SignParam { + spec_version: param.spec_version, + transaction_version: param.transaction_version, + genesis_hash: param.genesis_hash, + signer: param.signer, + }, + unsigned.switch_chain(), + ) + } + + fn is_signed(tx: &Self::SignedTransaction) -> bool { + relay_bridge_hub_rococo_client::BridgeHubRococo::is_signed(tx) + } + + fn is_signed_by(signer: &Self::AccountKeyPair, tx: &Self::SignedTransaction) -> bool { + relay_bridge_hub_rococo_client::BridgeHubRococo::is_signed_by(signer, tx) + } + + fn parse_transaction(tx: Self::SignedTransaction) -> Option> { + relay_bridge_hub_rococo_client::BridgeHubRococo::parse_transaction(tx) + .map(|tx| tx.switch_chain()) + } +} + +impl relay_substrate_client::ChainWithMessages for BridgeHubRococoAsBridgeHubPolkadot { + const WITH_CHAIN_MESSAGES_PALLET_NAME: &'static str = + relay_bridge_hub_polkadot_client::BridgeHubPolkadot::WITH_CHAIN_MESSAGES_PALLET_NAME; + const WITH_CHAIN_RELAYERS_PALLET_NAME: Option<&'static str> = + relay_bridge_hub_polkadot_client::BridgeHubPolkadot::WITH_CHAIN_RELAYERS_PALLET_NAME; + + const TO_CHAIN_MESSAGE_DETAILS_METHOD: &'static str = + relay_bridge_hub_polkadot_client::BridgeHubPolkadot::TO_CHAIN_MESSAGE_DETAILS_METHOD; + const FROM_CHAIN_MESSAGE_DETAILS_METHOD: &'static str = + relay_bridge_hub_polkadot_client::BridgeHubPolkadot::FROM_CHAIN_MESSAGE_DETAILS_METHOD; + + const MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX: MessageNonce = + relay_bridge_hub_rococo_client::BridgeHubRococo::MAX_UNREWARDED_RELAYERS_IN_CONFIRMATION_TX; + const MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX: MessageNonce = + relay_bridge_hub_rococo_client::BridgeHubRococo::MAX_UNCONFIRMED_MESSAGES_IN_CONFIRMATION_TX; +} + +impl CliChain for BridgeHubRococoAsBridgeHubPolkadot { + const RUNTIME_VERSION: Option = + Some(SimpleRuntimeVersion { spec_version: 1_003_000, transaction_version: 3 }); +} diff --git a/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_bulletin_headers_to_bridge_hub_rococo.rs b/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_bulletin_headers_to_bridge_hub_rococo.rs new file mode 100644 index 0000000000000..e897cd85967df --- /dev/null +++ b/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_bulletin_headers_to_bridge_hub_rococo.rs @@ -0,0 +1,86 @@ +// Copyright 2022 Parity Technologies (UK) Ltd. +// This file is part of Parity Bridges Common. + +// Parity Bridges Common is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Bridges Common is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Bridges Common. If not, see . + +//! RococoBulletin-to-BridgeHubRococo headers sync entrypoint. + +use super::BridgeHubRococoAsBridgeHubPolkadot; +use crate::cli::bridge::{ + CliBridgeBase, MessagesCliBridge, RelayToRelayEquivocationDetectionCliBridge, + RelayToRelayHeadersCliBridge, +}; + +use async_trait::async_trait; +use substrate_relay_helper::{ + equivocation::SubstrateEquivocationDetectionPipeline, + finality::SubstrateFinalitySyncPipeline, + finality_base::{engine::Grandpa as GrandpaFinalityEngine, SubstrateFinalityPipeline}, +}; + +/// Description of `RococoBulletin` -> `RococoBridgeHub` finalized headers bridge. +#[derive(Clone, Debug)] +pub struct RococoBulletinFinalityToBridgeHubRococo; + +substrate_relay_helper::generate_submit_finality_proof_call_builder!( + RococoBulletinFinalityToBridgeHubRococo, + SubmitFinalityProofCallBuilder, + relay_bridge_hub_rococo_client::RuntimeCall::BridgePolkadotBulletinGrandpa, + relay_bridge_hub_rococo_client::BridgeBulletinGrandpaCall::submit_finality_proof +); + +substrate_relay_helper::generate_report_equivocation_call_builder!( + RococoBulletinFinalityToBridgeHubRococo, + ReportEquivocationCallBuilder, + relay_polkadot_bulletin_client::RuntimeCall::Grandpa, + relay_polkadot_bulletin_client::GrandpaCall::report_equivocation +); + +#[async_trait] +impl SubstrateFinalityPipeline for RococoBulletinFinalityToBridgeHubRococo { + type SourceChain = relay_polkadot_bulletin_client::PolkadotBulletin; + type TargetChain = BridgeHubRococoAsBridgeHubPolkadot; + + type FinalityEngine = GrandpaFinalityEngine; +} + +#[async_trait] +impl SubstrateFinalitySyncPipeline for RococoBulletinFinalityToBridgeHubRococo { + type SubmitFinalityProofCallBuilder = SubmitFinalityProofCallBuilder; +} + +#[async_trait] +impl SubstrateEquivocationDetectionPipeline for RococoBulletinFinalityToBridgeHubRococo { + type ReportEquivocationCallBuilder = ReportEquivocationCallBuilder; +} + +/// `RococoBulletin` to BridgeHub `Rococo` bridge definition. +pub struct RococoBulletinToBridgeHubRococoCliBridge {} + +impl CliBridgeBase for RococoBulletinToBridgeHubRococoCliBridge { + type Source = relay_polkadot_bulletin_client::PolkadotBulletin; + type Target = BridgeHubRococoAsBridgeHubPolkadot; +} + +impl RelayToRelayHeadersCliBridge for RococoBulletinToBridgeHubRococoCliBridge { + type Finality = RococoBulletinFinalityToBridgeHubRococo; +} + +impl RelayToRelayEquivocationDetectionCliBridge for RococoBulletinToBridgeHubRococoCliBridge { + type Equivocation = RococoBulletinFinalityToBridgeHubRococo; +} + +impl MessagesCliBridge for RococoBulletinToBridgeHubRococoCliBridge { + type MessagesLane = crate::bridges::rococo_bulletin::rococo_bulletin_messages_to_bridge_hub_rococo::RococoBulletinMessagesToBridgeHubRococoMessageLane; +} diff --git a/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_bulletin_messages_to_bridge_hub_rococo.rs b/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_bulletin_messages_to_bridge_hub_rococo.rs new file mode 100644 index 0000000000000..856be9cf6f2a8 --- /dev/null +++ b/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_bulletin_messages_to_bridge_hub_rococo.rs @@ -0,0 +1,65 @@ +// Copyright 2022 Parity Technologies (UK) Ltd. +// This file is part of Parity Bridges Common. + +// Parity Bridges Common is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Bridges Common is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Bridges Common. If not, see . + +//! RococoBulletin-to-BridgeHubRococo messages sync entrypoint. + +use super::BridgeHubRococoAsBridgeHubPolkadot; +use crate::cli::bridge::{CliBridgeBase, MessagesCliBridge}; +use relay_polkadot_bulletin_client::PolkadotBulletin as RococoBulletin; +use substrate_relay_helper::{messages_lane::SubstrateMessageLane, UtilityPalletBatchCallBuilder}; + +/// RococoBulletin-to-BridgeHubRococo messages bridge. +pub struct RococoBulletinToBridgeHubRococoMessagesCliBridge {} + +impl CliBridgeBase for RococoBulletinToBridgeHubRococoMessagesCliBridge { + type Source = RococoBulletin; + type Target = BridgeHubRococoAsBridgeHubPolkadot; +} + +impl MessagesCliBridge for RococoBulletinToBridgeHubRococoMessagesCliBridge { + type MessagesLane = RococoBulletinMessagesToBridgeHubRococoMessageLane; +} + +substrate_relay_helper::generate_receive_message_proof_call_builder!( + RococoBulletinMessagesToBridgeHubRococoMessageLane, + RococoBulletinMessagesToBridgeHubRococoMessageLaneReceiveMessagesProofCallBuilder, + relay_bridge_hub_rococo_client::RuntimeCall::BridgePolkadotBulletinMessages, + relay_bridge_hub_rococo_client::BridgeBulletinMessagesCall::receive_messages_proof +); + +substrate_relay_helper::generate_receive_message_delivery_proof_call_builder!( + RococoBulletinMessagesToBridgeHubRococoMessageLane, + RococoBulletinMessagesToBridgeHubRococoMessageLaneReceiveMessagesDeliveryProofCallBuilder, + relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotMessages, + relay_polkadot_bulletin_client::BridgePolkadotMessagesCall::receive_messages_delivery_proof +); + +/// RococoBulletin-to-BridgeHubRococo messages lane. +#[derive(Clone, Debug)] +pub struct RococoBulletinMessagesToBridgeHubRococoMessageLane; + +impl SubstrateMessageLane for RococoBulletinMessagesToBridgeHubRococoMessageLane { + type SourceChain = RococoBulletin; + type TargetChain = BridgeHubRococoAsBridgeHubPolkadot; + + type ReceiveMessagesProofCallBuilder = + RococoBulletinMessagesToBridgeHubRococoMessageLaneReceiveMessagesProofCallBuilder; + type ReceiveMessagesDeliveryProofCallBuilder = + RococoBulletinMessagesToBridgeHubRococoMessageLaneReceiveMessagesDeliveryProofCallBuilder; + + type SourceBatchCallBuilder = (); + type TargetBatchCallBuilder = UtilityPalletBatchCallBuilder; +} diff --git a/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_headers_to_rococo_bulletin.rs b/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_headers_to_rococo_bulletin.rs new file mode 100644 index 0000000000000..8a4b44eec27b9 --- /dev/null +++ b/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_headers_to_rococo_bulletin.rs @@ -0,0 +1,81 @@ +// Copyright 2022 Parity Technologies (UK) Ltd. +// This file is part of Parity Bridges Common. + +// Parity Bridges Common is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Bridges Common is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Bridges Common. If not, see . + +//! Rococo-to-RococoBulletin headers sync entrypoint. + +use super::RococoAsPolkadot; +use crate::cli::bridge::{ + CliBridgeBase, RelayToRelayEquivocationDetectionCliBridge, RelayToRelayHeadersCliBridge, +}; + +use async_trait::async_trait; +use substrate_relay_helper::{ + equivocation::SubstrateEquivocationDetectionPipeline, + finality::SubstrateFinalitySyncPipeline, + finality_base::{engine::Grandpa as GrandpaFinalityEngine, SubstrateFinalityPipeline}, +}; + +/// Description of Rococo -> `RococoBulletin` finalized headers bridge. +#[derive(Clone, Debug)] +pub struct RococoFinalityToRococoBulletin; + +substrate_relay_helper::generate_submit_finality_proof_call_builder!( + RococoFinalityToRococoBulletin, + SubmitFinalityProofCallBuilder, + relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotGrandpa, + relay_polkadot_bulletin_client::BridgePolkadotGrandpaCall::submit_finality_proof +); + +substrate_relay_helper::generate_report_equivocation_call_builder!( + RococoFinalityToRococoBulletin, + ReportEquivocationCallBuilder, + relay_rococo_client::RuntimeCall::Grandpa, + relay_rococo_client::GrandpaCall::report_equivocation +); + +#[async_trait] +impl SubstrateFinalityPipeline for RococoFinalityToRococoBulletin { + type SourceChain = RococoAsPolkadot; + type TargetChain = relay_polkadot_bulletin_client::PolkadotBulletin; + + type FinalityEngine = GrandpaFinalityEngine; +} + +#[async_trait] +impl SubstrateFinalitySyncPipeline for RococoFinalityToRococoBulletin { + type SubmitFinalityProofCallBuilder = SubmitFinalityProofCallBuilder; +} + +#[async_trait] +impl SubstrateEquivocationDetectionPipeline for RococoFinalityToRococoBulletin { + type ReportEquivocationCallBuilder = ReportEquivocationCallBuilder; +} + +/// `Rococo` to BridgeHub `RococoBulletin` bridge definition. +pub struct RococoToRococoBulletinCliBridge {} + +impl CliBridgeBase for RococoToRococoBulletinCliBridge { + type Source = RococoAsPolkadot; + type Target = relay_polkadot_bulletin_client::PolkadotBulletin; +} + +impl RelayToRelayHeadersCliBridge for RococoToRococoBulletinCliBridge { + type Finality = RococoFinalityToRococoBulletin; +} + +impl RelayToRelayEquivocationDetectionCliBridge for RococoToRococoBulletinCliBridge { + type Equivocation = RococoFinalityToRococoBulletin; +} diff --git a/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_parachains_to_rococo_bulletin.rs b/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_parachains_to_rococo_bulletin.rs new file mode 100644 index 0000000000000..ee44bad523b4f --- /dev/null +++ b/relays/bin-substrate/src/bridges/rococo_bulletin/rococo_parachains_to_rococo_bulletin.rs @@ -0,0 +1,91 @@ +// Copyright 2019-2021 Parity Technologies (UK) Ltd. +// This file is part of Parity Bridges Common. + +// Parity Bridges Common is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity Bridges Common is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity Bridges Common. If not, see . + +//! Rococo-to-RococoBulletin parachains sync entrypoint. + +use super::{BridgeHubRococoAsBridgeHubPolkadot, RococoAsPolkadot}; +use crate::cli::bridge::{CliBridgeBase, MessagesCliBridge, ParachainToRelayHeadersCliBridge}; + +use bp_polkadot_core::parachains::{ParaHash, ParaHeadsProof, ParaId}; +use bp_runtime::Chain; +use relay_substrate_client::{CallOf, HeaderIdOf}; +use substrate_relay_helper::{ + messages_lane::MessagesRelayLimits, + parachains::{SubmitParachainHeadsCallBuilder, SubstrateParachainsPipeline}, +}; + +/// Rococo-to-RococoBulletin parachain sync description. +#[derive(Clone, Debug)] +pub struct RococoToRococoBulletin; + +impl SubstrateParachainsPipeline for RococoToRococoBulletin { + type SourceParachain = BridgeHubRococoAsBridgeHubPolkadot; + type SourceRelayChain = RococoAsPolkadot; + type TargetChain = relay_polkadot_bulletin_client::PolkadotBulletin; + + type SubmitParachainHeadsCallBuilder = RococoToRococoBulletinCallBuilder; +} + +pub struct RococoToRococoBulletinCallBuilder; +impl SubmitParachainHeadsCallBuilder for RococoToRococoBulletinCallBuilder { + fn build_submit_parachain_heads_call( + at_relay_block: HeaderIdOf, + parachains: Vec<(ParaId, ParaHash)>, + parachain_heads_proof: ParaHeadsProof, + ) -> CallOf { + relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotParachains( + relay_polkadot_bulletin_client::BridgePolkadotParachainsCall::submit_parachain_heads { + at_relay_block: (at_relay_block.0, at_relay_block.1), + parachains, + parachain_heads_proof, + }, + ) + } +} + +/// Rococo-to-RococoBulletin parachain sync description for the CLI. +pub struct RococoToRococoBulletinCliBridge {} + +impl ParachainToRelayHeadersCliBridge for RococoToRococoBulletinCliBridge { + type SourceRelay = RococoAsPolkadot; + type ParachainFinality = RococoToRococoBulletin; + type RelayFinality = + crate::bridges::rococo_bulletin::rococo_headers_to_rococo_bulletin::RococoFinalityToRococoBulletin; +} + +impl CliBridgeBase for RococoToRococoBulletinCliBridge { + type Source = BridgeHubRococoAsBridgeHubPolkadot; + type Target = relay_polkadot_bulletin_client::PolkadotBulletin; +} + +impl MessagesCliBridge for RococoToRococoBulletinCliBridge { + type MessagesLane = + crate::bridges::rococo_bulletin::bridge_hub_rococo_messages_to_rococo_bulletin::BridgeHubRococoMessagesToRococoBulletinMessageLane; + + fn maybe_messages_limits() -> Option { + // Rococo Bulletin chain is missing the `TransactionPayment` runtime API (as well as the + // transaction payment pallet itself), so we can't estimate limits using runtime calls. + // Let's do it here. + // + // Folloiung constants are just safe **underestimations**. Normally, we are able to deliver + // and dispatch thousands of messages in the same transaction. + Some(MessagesRelayLimits { + max_messages_in_single_batch: 128, + max_messages_weight_in_single_batch: + bp_polkadot_bulletin::PolkadotBulletin::max_extrinsic_weight() / 20, + }) + } +} diff --git a/relays/bin-substrate/src/cli/bridge.rs b/relays/bin-substrate/src/cli/bridge.rs index 2903a290c5b62..6073d9e3155bb 100644 --- a/relays/bin-substrate/src/cli/bridge.rs +++ b/relays/bin-substrate/src/cli/bridge.rs @@ -35,6 +35,8 @@ pub enum FullBridge { BridgeHubPolkadotToBridgeHubKusama, PolkadotBulletinToBridgeHubPolkadot, BridgeHubPolkadotToPolkadotBulletin, + RococoBulletinToBridgeHubRococo, + BridgeHubRococoToRococoBulletin, } /// Minimal bridge representation that can be used from the CLI. diff --git a/relays/bin-substrate/src/cli/init_bridge.rs b/relays/bin-substrate/src/cli/init_bridge.rs index 30875e70cbb35..8be74e5f9b535 100644 --- a/relays/bin-substrate/src/cli/init_bridge.rs +++ b/relays/bin-substrate/src/cli/init_bridge.rs @@ -27,6 +27,10 @@ use crate::{ polkadot_bulletin_headers_to_bridge_hub_polkadot::PolkadotBulletinToBridgeHubPolkadotCliBridge, polkadot_headers_to_polkadot_bulletin::PolkadotToPolkadotBulletinCliBridge, }, + rococo_bulletin::{ + rococo_bulletin_headers_to_bridge_hub_rococo::RococoBulletinToBridgeHubRococoCliBridge, + rococo_headers_to_rococo_bulletin::RococoToRococoBulletinCliBridge, + }, rococo_westend::{ rococo_headers_to_bridge_hub_westend::RococoToBridgeHubWestendCliBridge, westend_headers_to_bridge_hub_rococo::WestendToBridgeHubRococoCliBridge, @@ -66,6 +70,8 @@ pub enum InitBridgeName { PolkadotToBridgeHubKusama, PolkadotToPolkadotBulletin, PolkadotBulletinToBridgeHubPolkadot, + RococoToRococoBulletin, + RococoBulletinToBridgeHubRococo, RococoToBridgeHubWestend, WestendToBridgeHubRococo, } @@ -195,6 +201,35 @@ impl BridgeInitializer for PolkadotBulletinToBridgeHubPolkadotCliBridge { } } +impl BridgeInitializer for RococoToRococoBulletinCliBridge { + type Engine = GrandpaFinalityEngine; + + fn encode_init_bridge( + init_data: >::InitializationData, + ) -> ::Call { + type RuntimeCall = relay_polkadot_bulletin_client::RuntimeCall; + type BridgePolkadotGrandpaCall = relay_polkadot_bulletin_client::BridgePolkadotGrandpaCall; + type SudoCall = relay_polkadot_bulletin_client::SudoCall; + + let initialize_call = + RuntimeCall::BridgePolkadotGrandpa(BridgePolkadotGrandpaCall::initialize { init_data }); + + RuntimeCall::Sudo(SudoCall::sudo { call: Box::new(initialize_call) }) + } +} + +impl BridgeInitializer for RococoBulletinToBridgeHubRococoCliBridge { + type Engine = GrandpaFinalityEngine; + + fn encode_init_bridge( + init_data: >::InitializationData, + ) -> ::Call { + relay_bridge_hub_rococo_client::RuntimeCall::BridgePolkadotBulletinGrandpa( + relay_bridge_hub_rococo_client::BridgeBulletinGrandpaCall::initialize { init_data }, + ) + } +} + impl InitBridge { /// Run the command. pub async fn run(self) -> anyhow::Result<()> { @@ -207,6 +242,10 @@ impl InitBridge { PolkadotToPolkadotBulletinCliBridge::init_bridge(self), InitBridgeName::PolkadotBulletinToBridgeHubPolkadot => PolkadotBulletinToBridgeHubPolkadotCliBridge::init_bridge(self), + InitBridgeName::RococoToRococoBulletin => + RococoToRococoBulletinCliBridge::init_bridge(self), + InitBridgeName::RococoBulletinToBridgeHubRococo => + RococoBulletinToBridgeHubRococoCliBridge::init_bridge(self), InitBridgeName::RococoToBridgeHubWestend => RococoToBridgeHubWestendCliBridge::init_bridge(self), InitBridgeName::WestendToBridgeHubRococo => diff --git a/relays/bin-substrate/src/cli/relay_headers.rs b/relays/bin-substrate/src/cli/relay_headers.rs index 032fe64ef9070..5e43c98770072 100644 --- a/relays/bin-substrate/src/cli/relay_headers.rs +++ b/relays/bin-substrate/src/cli/relay_headers.rs @@ -27,6 +27,10 @@ use crate::bridges::{ polkadot_bulletin_headers_to_bridge_hub_polkadot::PolkadotBulletinToBridgeHubPolkadotCliBridge, polkadot_headers_to_polkadot_bulletin::PolkadotToPolkadotBulletinCliBridge, }, + rococo_bulletin::{ + rococo_bulletin_headers_to_bridge_hub_rococo::RococoBulletinToBridgeHubRococoCliBridge, + rococo_headers_to_rococo_bulletin::RococoToRococoBulletinCliBridge, + }, }; use relay_utils::metrics::{GlobalMetrics, StandaloneMetric}; use substrate_relay_helper::finality::SubstrateFinalitySyncPipeline; @@ -61,6 +65,8 @@ pub enum RelayHeadersBridge { PolkadotToBridgeHubKusama, PolkadotToPolkadotBulletin, PolkadotBulletinToBridgeHubPolkadot, + RococoToRococoBulletin, + RococoBulletinToBridgeHubRococo, } #[async_trait] @@ -98,6 +104,8 @@ impl HeadersRelayer for KusamaToBridgeHubPolkadotCliBridge {} impl HeadersRelayer for PolkadotToBridgeHubKusamaCliBridge {} impl HeadersRelayer for PolkadotToPolkadotBulletinCliBridge {} impl HeadersRelayer for PolkadotBulletinToBridgeHubPolkadotCliBridge {} +impl HeadersRelayer for RococoToRococoBulletinCliBridge {} +impl HeadersRelayer for RococoBulletinToBridgeHubRococoCliBridge {} impl RelayHeaders { /// Run the command. @@ -111,6 +119,10 @@ impl RelayHeaders { PolkadotToPolkadotBulletinCliBridge::relay_headers(self), RelayHeadersBridge::PolkadotBulletinToBridgeHubPolkadot => PolkadotBulletinToBridgeHubPolkadotCliBridge::relay_headers(self), + RelayHeadersBridge::RococoToRococoBulletin => + RococoToRococoBulletinCliBridge::relay_headers(self), + RelayHeadersBridge::RococoBulletinToBridgeHubRococo => + RococoBulletinToBridgeHubRococoCliBridge::relay_headers(self), } .await } diff --git a/relays/bin-substrate/src/cli/relay_headers_and_messages/mod.rs b/relays/bin-substrate/src/cli/relay_headers_and_messages/mod.rs index 87d1c38fab10d..c445bdddcc936 100644 --- a/relays/bin-substrate/src/cli/relay_headers_and_messages/mod.rs +++ b/relays/bin-substrate/src/cli/relay_headers_and_messages/mod.rs @@ -47,6 +47,11 @@ use crate::{ polkadot_bulletin_headers_to_bridge_hub_polkadot::PolkadotBulletinToBridgeHubPolkadotCliBridge, polkadot_parachains_to_polkadot_bulletin::PolkadotToPolkadotBulletinCliBridge, }, + rococo_bulletin::{ + rococo_bulletin_headers_to_bridge_hub_rococo::RococoBulletinToBridgeHubRococoCliBridge, + rococo_parachains_to_rococo_bulletin::RococoToRococoBulletinCliBridge, + BridgeHubRococoAsBridgeHubPolkadot, + }, rococo_westend::{ rococo_parachains_to_bridge_hub_westend::BridgeHubRococoToBridgeHubWestendCliBridge, westend_parachains_to_bridge_hub_rococo::BridgeHubWestendToBridgeHubRococoCliBridge, @@ -199,6 +204,7 @@ declare_chain_cli_schema!(BridgeHubKusama, bridge_hub_kusama); declare_chain_cli_schema!(Polkadot, polkadot); declare_chain_cli_schema!(BridgeHubPolkadot, bridge_hub_polkadot); declare_chain_cli_schema!(PolkadotBulletin, polkadot_bulletin); +declare_chain_cli_schema!(RococoBulletin, rococo_bulletin); // Means to override signers of different layer transactions. declare_chain_cli_schema!(RococoHeadersToBridgeHubWestend, rococo_headers_to_bridge_hub_westend); declare_chain_cli_schema!( @@ -224,15 +230,22 @@ declare_chain_cli_schema!( PolkadotBulletinHeadersToBridgeHubPolkadot, polkadot_bulletin_headers_to_bridge_hub_polkadot ); +declare_chain_cli_schema!( + RococoBulletinHeadersToBridgeHubRococo, + rococo_bulletin_headers_to_bridge_hub_rococo +); declare_chain_cli_schema!(PolkadotHeadersToPolkadotBulletin, polkadot_headers_to_polkadot_bulletin); +declare_chain_cli_schema!(RococoHeadersToRococoBulletin, rococo_headers_to_rococo_bulletin); declare_chain_cli_schema!( PolkadotParachainsToPolkadotBulletin, polkadot_parachains_to_polkadot_bulletin ); +declare_chain_cli_schema!(RococoParachainsToRococoBulletin, rococo_parachains_to_rococo_bulletin); // All supported bridges. declare_parachain_to_parachain_bridge_schema!(BridgeHubRococo, Rococo, BridgeHubWestend, Westend); declare_parachain_to_parachain_bridge_schema!(BridgeHubKusama, Kusama, BridgeHubPolkadot, Polkadot); declare_relay_to_parachain_bridge_schema!(PolkadotBulletin, BridgeHubPolkadot, Polkadot); +declare_relay_to_parachain_bridge_schema!(RococoBulletin, BridgeHubRococo, Rococo); /// Base portion of the bidirectional complex relay. /// @@ -477,6 +490,32 @@ impl Full2WayBridge for PolkadotBulletinBridgeHubPolkadotFull2WayBridge { } } +/// `RococoBulletin` <> `BridgeHubRococo` complex relay. +pub struct RococoBulletinBridgeHubRococoFull2WayBridge { + base: ::Base, +} + +#[async_trait] +impl Full2WayBridge for RococoBulletinBridgeHubRococoFull2WayBridge { + type Base = RelayToParachainBridge; + type Left = relay_polkadot_bulletin_client::PolkadotBulletin; + type Right = BridgeHubRococoAsBridgeHubPolkadot; + type L2R = RococoBulletinToBridgeHubRococoCliBridge; + type R2L = RococoToRococoBulletinCliBridge; + + fn new(base: Self::Base) -> anyhow::Result { + Ok(Self { base }) + } + + fn base(&self) -> &Self::Base { + &self.base + } + + fn mut_base(&mut self) -> &mut Self::Base { + &mut self.base + } +} + /// Complex headers+messages relay. #[derive(Debug, PartialEq, StructOpt)] pub enum RelayHeadersAndMessages { @@ -484,6 +523,8 @@ pub enum RelayHeadersAndMessages { BridgeHubKusamaBridgeHubPolkadot(BridgeHubKusamaBridgeHubPolkadotHeadersAndMessages), /// `PolkadotBulletin` <> `BridgeHubPolkadot` relay. PolkadotBulletinBridgeHubPolkadot(PolkadotBulletinBridgeHubPolkadotHeadersAndMessages), + /// `RococoBulletin` <> `BridgeHubRococo` relay. + RococoBulletinBridgeHubRococo(RococoBulletinBridgeHubRococoHeadersAndMessages), /// BridgeHubRococo <> BridgeHubWestend relay. BridgeHubRococoBridgeHubWestend(BridgeHubRococoBridgeHubWestendHeadersAndMessages), } @@ -504,6 +545,10 @@ impl RelayHeadersAndMessages { PolkadotBulletinBridgeHubPolkadotFull2WayBridge::new(params.into_bridge().await?)? .run() .await, + RelayHeadersAndMessages::RococoBulletinBridgeHubRococo(params) => + RococoBulletinBridgeHubRococoFull2WayBridge::new(params.into_bridge().await?)? + .run() + .await, } } } diff --git a/relays/bin-substrate/src/cli/relay_messages.rs b/relays/bin-substrate/src/cli/relay_messages.rs index 477e9feff050a..b20725b53c743 100644 --- a/relays/bin-substrate/src/cli/relay_messages.rs +++ b/relays/bin-substrate/src/cli/relay_messages.rs @@ -28,6 +28,10 @@ use crate::bridges::{ bridge_hub_polkadot_messages_to_polkadot_bulletin::BridgeHubPolkadotToPolkadotBulletinMessagesCliBridge, polkadot_bulletin_messages_to_bridge_hub_polkadot::PolkadotBulletinToBridgeHubPolkadotMessagesCliBridge, }, + rococo_bulletin::{ + bridge_hub_rococo_messages_to_rococo_bulletin::BridgeHubRococoToRococoBulletinMessagesCliBridge, + rococo_bulletin_messages_to_bridge_hub_rococo::RococoBulletinToBridgeHubRococoMessagesCliBridge, + }, rococo_westend::{ bridge_hub_rococo_messages_to_bridge_hub_westend::BridgeHubRococoToBridgeHubWestendMessagesCliBridge, bridge_hub_westend_messages_to_bridge_hub_rococo::BridgeHubWestendToBridgeHubRococoMessagesCliBridge, @@ -103,6 +107,8 @@ impl MessagesRelayer for BridgeHubKusamaToBridgeHubPolkadotMessagesCliBridge {} impl MessagesRelayer for BridgeHubPolkadotToBridgeHubKusamaMessagesCliBridge {} impl MessagesRelayer for PolkadotBulletinToBridgeHubPolkadotMessagesCliBridge {} impl MessagesRelayer for BridgeHubPolkadotToPolkadotBulletinMessagesCliBridge {} +impl MessagesRelayer for RococoBulletinToBridgeHubRococoMessagesCliBridge {} +impl MessagesRelayer for BridgeHubRococoToRococoBulletinMessagesCliBridge {} impl RelayMessages { /// Run the command. @@ -120,6 +126,10 @@ impl RelayMessages { PolkadotBulletinToBridgeHubPolkadotMessagesCliBridge::relay_messages(self), FullBridge::BridgeHubPolkadotToPolkadotBulletin => BridgeHubPolkadotToPolkadotBulletinMessagesCliBridge::relay_messages(self), + FullBridge::RococoBulletinToBridgeHubRococo => + RococoBulletinToBridgeHubRococoMessagesCliBridge::relay_messages(self), + FullBridge::BridgeHubRococoToRococoBulletin => + BridgeHubRococoToRococoBulletinMessagesCliBridge::relay_messages(self), } .await } diff --git a/relays/bin-substrate/src/cli/relay_parachains.rs b/relays/bin-substrate/src/cli/relay_parachains.rs index 3038d1dfdb91d..1456dddf11e23 100644 --- a/relays/bin-substrate/src/cli/relay_parachains.rs +++ b/relays/bin-substrate/src/cli/relay_parachains.rs @@ -20,6 +20,7 @@ use crate::bridges::{ polkadot_parachains_to_bridge_hub_kusama::BridgeHubPolkadotToBridgeHubKusamaCliBridge, }, polkadot_bulletin::polkadot_parachains_to_polkadot_bulletin::PolkadotToPolkadotBulletinCliBridge, + rococo_bulletin::rococo_parachains_to_rococo_bulletin::RococoToRococoBulletinCliBridge, rococo_westend::{ rococo_parachains_to_bridge_hub_westend::BridgeHubRococoToBridgeHubWestendCliBridge, westend_parachains_to_bridge_hub_rococo::BridgeHubWestendToBridgeHubRococoCliBridge, @@ -67,6 +68,7 @@ pub enum RelayParachainsBridge { KusamaToBridgeHubPolkadot, PolkadotToBridgeHubKusama, PolkadotToPolkadotBulletin, + RococoToRococoBulletin, RococoToBridgeHubWestend, WestendToBridgeHubRococo, } @@ -117,6 +119,7 @@ impl ParachainsRelayer for BridgeHubWestendToBridgeHubRococoCliBridge {} impl ParachainsRelayer for BridgeHubKusamaToBridgeHubPolkadotCliBridge {} impl ParachainsRelayer for BridgeHubPolkadotToBridgeHubKusamaCliBridge {} impl ParachainsRelayer for PolkadotToPolkadotBulletinCliBridge {} +impl ParachainsRelayer for RococoToRococoBulletinCliBridge {} impl RelayParachains { /// Run the command. @@ -132,6 +135,8 @@ impl RelayParachains { BridgeHubPolkadotToBridgeHubKusamaCliBridge::relay_parachains(self), RelayParachainsBridge::PolkadotToPolkadotBulletin => PolkadotToPolkadotBulletinCliBridge::relay_parachains(self), + RelayParachainsBridge::RococoToRococoBulletin => + RococoToRococoBulletinCliBridge::relay_parachains(self), } .await } diff --git a/relays/client-bridge-hub-rococo/src/codegen_runtime.rs b/relays/client-bridge-hub-rococo/src/codegen_runtime.rs index cf125b8cf5966..2afdeb2489363 100644 --- a/relays/client-bridge-hub-rococo/src/codegen_runtime.rs +++ b/relays/client-bridge-hub-rococo/src/codegen_runtime.rs @@ -16,17 +16,27 @@ //! Autogenerated runtime API //! THIS FILE WAS AUTOGENERATED USING parity-bridges-common::runtime-codegen -//! EXECUTED COMMAND: target/debug/runtime-codegen --from-node-url -//! wss://rococo-bridge-hub-rpc.polkadot.io:443 +//! EXECUTED COMMAND: target/debug/runtime-codegen --from-wasm-file +//! /home/svyatonik/dev/polkadot-sdk/target/debug/wbuild/bridge-hub-rococo-runtime/ +//! bridge_hub_rococo_runtime.wasm #[allow(dead_code, unused_imports, non_camel_case_types)] #[allow(clippy::all)] +#[allow(rustdoc::broken_intra_doc_links)] pub mod api { - use super::api as root_mod; + #[allow(unused_imports)] + mod root_mod { + pub use super::*; + } pub mod runtime_types { use super::runtime_types; pub mod bounded_collections { use super::runtime_types; + pub mod bounded_btree_set { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct BoundedBTreeSet<_0>(pub ::std::vec::Vec<_0>); + } pub mod bounded_vec { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -41,6 +51,14 @@ pub mod api { pub mod bp_header_chain { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct AuthoritySet { + pub authorities: ::std::vec::Vec<( + runtime_types::sp_consensus_grandpa::app::Public, + ::core::primitive::u64, + )>, + pub set_id: ::core::primitive::u64, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum HeaderChainError { #[codec(index = 0)] UnknownHeader, @@ -48,6 +66,11 @@ pub mod api { StorageProof(runtime_types::bp_runtime::storage_proof::Error), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct HeaderFinalityInfo<_0, _1> { + pub finality_proof: _0, + pub new_verification_context: ::core::option::Option<_1>, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct StoredHeaderData<_0, _1> { pub number: _0, pub state_root: _1, @@ -256,32 +279,63 @@ pub mod api { XcmpQueue(runtime_types::cumulus_pallet_xcmp_queue::pallet::Call), #[codec(index = 31)] PolkadotXcm(runtime_types::pallet_xcm::pallet::Call), - #[codec(index = 33)] - DmpQueue(runtime_types::cumulus_pallet_dmp_queue::pallet::Call), #[codec(index = 40)] Utility(runtime_types::pallet_utility::pallet::Call), #[codec(index = 36)] Multisig(runtime_types::pallet_multisig::pallet::Call), - #[codec(index = 41)] - BridgeWococoGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Call), - #[codec(index = 43)] - BridgeRococoGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Call), #[codec(index = 48)] BridgeWestendGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Call), - #[codec(index = 42)] - BridgeWococoParachains(runtime_types::pallet_bridge_parachains::pallet::Call), - #[codec(index = 44)] - BridgeRococoParachains(runtime_types::pallet_bridge_parachains::pallet::Call), + #[codec(index = 60)] + BridgePolkadotBulletinGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Call2), #[codec(index = 49)] BridgeWestendParachains(runtime_types::pallet_bridge_parachains::pallet::Call), - #[codec(index = 46)] - BridgeWococoMessages(runtime_types::pallet_bridge_messages::pallet::Call), - #[codec(index = 45)] - BridgeRococoMessages(runtime_types::pallet_bridge_messages::pallet::Call), #[codec(index = 51)] BridgeWestendMessages(runtime_types::pallet_bridge_messages::pallet::Call), + #[codec(index = 61)] + BridgePolkadotBulletinMessages( + runtime_types::pallet_bridge_messages::pallet::Call2, + ), #[codec(index = 47)] BridgeRelayers(runtime_types::pallet_bridge_relayers::pallet::Call), + #[codec(index = 250)] + MessageQueue(runtime_types::pallet_message_queue::pallet::Call), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum RuntimeError { + #[codec(index = 0)] + System(runtime_types::frame_system::pallet::Error), + #[codec(index = 1)] + ParachainSystem(runtime_types::cumulus_pallet_parachain_system::pallet::Error), + #[codec(index = 10)] + Balances(runtime_types::pallet_balances::pallet::Error), + #[codec(index = 21)] + CollatorSelection(runtime_types::pallet_collator_selection::pallet::Error), + #[codec(index = 22)] + Session(runtime_types::pallet_session::pallet::Error), + #[codec(index = 30)] + XcmpQueue(runtime_types::cumulus_pallet_xcmp_queue::pallet::Error), + #[codec(index = 31)] + PolkadotXcm(runtime_types::pallet_xcm::pallet::Error), + #[codec(index = 40)] + Utility(runtime_types::pallet_utility::pallet::Error), + #[codec(index = 36)] + Multisig(runtime_types::pallet_multisig::pallet::Error), + #[codec(index = 48)] + BridgeWestendGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Error), + #[codec(index = 52)] + BridgePolkadotBulletinGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Error2), + #[codec(index = 49)] + BridgeWestendParachains(runtime_types::pallet_bridge_parachains::pallet::Error), + #[codec(index = 51)] + BridgeWestendMessages(runtime_types::pallet_bridge_messages::pallet::Error), + #[codec(index = 53)] + BridgePolkadotBulletinMessages( + runtime_types::pallet_bridge_messages::pallet::Error2, + ), + #[codec(index = 47)] + BridgeRelayers(runtime_types::pallet_bridge_relayers::pallet::Error), + #[codec(index = 250)] + MessageQueue(runtime_types::pallet_message_queue::pallet::Error), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum RuntimeEvent { @@ -303,34 +357,30 @@ pub mod api { PolkadotXcm(runtime_types::pallet_xcm::pallet::Event), #[codec(index = 32)] CumulusXcm(runtime_types::cumulus_pallet_xcm::pallet::Event), - #[codec(index = 33)] - DmpQueue(runtime_types::cumulus_pallet_dmp_queue::pallet::Event), #[codec(index = 40)] Utility(runtime_types::pallet_utility::pallet::Event), #[codec(index = 36)] Multisig(runtime_types::pallet_multisig::pallet::Event), - #[codec(index = 41)] - BridgeWococoGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Event), - #[codec(index = 43)] - BridgeRococoGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Event), #[codec(index = 48)] BridgeWestendGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Event), - #[codec(index = 42)] - BridgeWococoParachains(runtime_types::pallet_bridge_parachains::pallet::Event), - #[codec(index = 44)] - BridgeRococoParachains(runtime_types::pallet_bridge_parachains::pallet::Event), + #[codec(index = 52)] + BridgePolkadotBulletinGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Event2), #[codec(index = 49)] BridgeWestendParachains(runtime_types::pallet_bridge_parachains::pallet::Event), - #[codec(index = 46)] - BridgeWococoMessages(runtime_types::pallet_bridge_messages::pallet::Event), - #[codec(index = 45)] - BridgeRococoMessages(runtime_types::pallet_bridge_messages::pallet::Event), #[codec(index = 51)] BridgeWestendMessages(runtime_types::pallet_bridge_messages::pallet::Event), + #[codec(index = 53)] + BridgePolkadotBulletinMessages( + runtime_types::pallet_bridge_messages::pallet::Event2, + ), #[codec(index = 47)] BridgeRelayers(runtime_types::pallet_bridge_relayers::pallet::Event), + #[codec(index = 250)] + MessageQueue(runtime_types::pallet_message_queue::pallet::Event), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum RuntimeHoldReason {} + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct SessionKeys { pub aura: runtime_types::sp_consensus_aura::sr25519::app_sr25519::Public, } @@ -352,69 +402,11 @@ pub mod api { pub mod refund_relayer_extension { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct RefundBridgedParachainMessages; - } - } - pub mod cumulus_pallet_dmp_queue { - use super::runtime_types; - pub mod pallet { - use super::runtime_types; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum Call { - #[codec(index = 0)] - service_overweight { - index: ::core::primitive::u64, - weight_limit: ::sp_weights::Weight, - }, - } + pub struct RefundBridgedGrandpaMessages; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum Error { - #[codec(index = 0)] - Unknown, - #[codec(index = 1)] - OverLimit, - } + pub struct RefundBridgedParachainMessages; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum Event { - #[codec(index = 0)] - InvalidFormat { message_id: [::core::primitive::u8; 32usize] }, - #[codec(index = 1)] - UnsupportedVersion { message_id: [::core::primitive::u8; 32usize] }, - #[codec(index = 2)] - ExecutedDownward { - message_id: [::core::primitive::u8; 32usize], - outcome: runtime_types::xcm::v3::traits::Outcome, - }, - #[codec(index = 3)] - WeightExhausted { - message_id: [::core::primitive::u8; 32usize], - remaining_weight: ::sp_weights::Weight, - required_weight: ::sp_weights::Weight, - }, - #[codec(index = 4)] - OverweightEnqueued { - message_id: [::core::primitive::u8; 32usize], - overweight_index: ::core::primitive::u64, - required_weight: ::sp_weights::Weight, - }, - #[codec(index = 5)] - OverweightServiced { - overweight_index: ::core::primitive::u64, - weight_used: ::sp_weights::Weight, - }, - #[codec(index = 6)] - MaxMessagesExhausted { message_id: [::core::primitive::u8; 32usize] }, - } - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct ConfigData { - pub max_individual: ::sp_weights::Weight, - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct PageIndexData { - pub begin_used: ::core::primitive::u32, - pub end_used: ::core::primitive::u32, - pub overweight_count: ::core::primitive::u64, + pub struct RefundSignedExtensionAdapter<_0>(pub _0); } } pub mod cumulus_pallet_parachain_system { @@ -469,13 +461,27 @@ pub mod api { pub mod relay_state_snapshot { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct MessagingStateSnapshot { pub dmq_mqc_head : :: subxt :: utils :: H256 , pub relay_dispatch_queue_size : runtime_types :: cumulus_pallet_parachain_system :: relay_state_snapshot :: RelayDispachQueueSize , pub ingress_channels : :: std :: vec :: Vec < (runtime_types :: polkadot_parachain :: primitives :: Id , runtime_types :: polkadot_primitives :: v4 :: AbridgedHrmpChannel ,) > , pub egress_channels : :: std :: vec :: Vec < (runtime_types :: polkadot_parachain :: primitives :: Id , runtime_types :: polkadot_primitives :: v4 :: AbridgedHrmpChannel ,) > , } + pub struct MessagingStateSnapshot { pub dmq_mqc_head : :: subxt :: utils :: H256 , pub relay_dispatch_queue_remaining_capacity : runtime_types :: cumulus_pallet_parachain_system :: relay_state_snapshot :: RelayDispatchQueueRemainingCapacity , pub ingress_channels : :: std :: vec :: Vec < (runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: polkadot_primitives :: v6 :: AbridgedHrmpChannel ,) > , pub egress_channels : :: std :: vec :: Vec < (runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: polkadot_primitives :: v6 :: AbridgedHrmpChannel ,) > , } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct RelayDispachQueueSize { + pub struct RelayDispatchQueueRemainingCapacity { pub remaining_count: ::core::primitive::u32, pub remaining_size: ::core::primitive::u32, } } + pub mod unincluded_segment { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Ancestor < _0 > { pub used_bandwidth : runtime_types :: cumulus_pallet_parachain_system :: unincluded_segment :: UsedBandwidth , pub para_head_hash : :: core :: option :: Option < _0 > , pub consumed_go_ahead_signal : :: core :: option :: Option < runtime_types :: polkadot_primitives :: v6 :: UpgradeGoAhead > , } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct HrmpChannelUpdate { + pub msg_count: ::core::primitive::u32, + pub total_bytes: ::core::primitive::u32, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct SegmentTracker < _0 > { pub used_bandwidth : runtime_types :: cumulus_pallet_parachain_system :: unincluded_segment :: UsedBandwidth , pub hrmp_watermark : :: core :: option :: Option < :: core :: primitive :: u32 > , pub consumed_go_ahead_signal : :: core :: option :: Option < runtime_types :: polkadot_primitives :: v6 :: UpgradeGoAhead > , # [codec (skip)] pub __subxt_unused_type_params : :: core :: marker :: PhantomData < _0 > } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct UsedBandwidth { pub ump_msg_count : :: core :: primitive :: u32 , pub ump_total_bytes : :: core :: primitive :: u32 , pub hrmp_outgoing : :: subxt :: utils :: KeyedVec < runtime_types :: polkadot_parachain_primitives :: primitives :: Id , runtime_types :: cumulus_pallet_parachain_system :: unincluded_segment :: HrmpChannelUpdate > , } + } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct CodeUpgradeAuthorization { pub code_hash: ::subxt::utils::H256, @@ -487,8 +493,6 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum Error {} - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { #[codec(index = 0)] InvalidFormat([::core::primitive::u8; 32usize]), @@ -505,7 +509,7 @@ pub mod api { #[codec(index = 0)] Relay, #[codec(index = 1)] - SiblingParachain(runtime_types::polkadot_parachain::primitives::Id), + SiblingParachain(runtime_types::polkadot_parachain_primitives::primitives::Id), } } } @@ -515,11 +519,6 @@ pub mod api { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Call { - #[codec(index = 0)] - service_overweight { - index: ::core::primitive::u64, - weight_limit: ::sp_weights::Weight, - }, #[codec(index = 1)] suspend_xcm_execution, #[codec(index = 2)] @@ -530,81 +529,25 @@ pub mod api { update_drop_threshold { new: ::core::primitive::u32 }, #[codec(index = 5)] update_resume_threshold { new: ::core::primitive::u32 }, - #[codec(index = 6)] - update_threshold_weight { new: ::sp_weights::Weight }, - #[codec(index = 7)] - update_weight_restrict_decay { new: ::sp_weights::Weight }, - #[codec(index = 8)] - update_xcmp_max_individual_weight { new: ::sp_weights::Weight }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { #[codec(index = 0)] - FailedToSend, + BadQueueConfig, #[codec(index = 1)] - BadXcmOrigin, + AlreadySuspended, #[codec(index = 2)] - BadXcm, - #[codec(index = 3)] - BadOverweightIndex, - #[codec(index = 4)] - WeightOverLimit, + AlreadyResumed, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { #[codec(index = 0)] - Success { - message_hash: ::core::option::Option<[::core::primitive::u8; 32usize]>, - weight: ::sp_weights::Weight, - }, - #[codec(index = 1)] - Fail { - message_hash: ::core::option::Option<[::core::primitive::u8; 32usize]>, - error: runtime_types::xcm::v3::traits::Error, - weight: ::sp_weights::Weight, - }, - #[codec(index = 2)] - BadVersion { - message_hash: ::core::option::Option<[::core::primitive::u8; 32usize]>, - }, - #[codec(index = 3)] - BadFormat { - message_hash: ::core::option::Option<[::core::primitive::u8; 32usize]>, - }, - #[codec(index = 4)] - XcmpMessageSent { - message_hash: ::core::option::Option<[::core::primitive::u8; 32usize]>, - }, - #[codec(index = 5)] - OverweightEnqueued { - sender: runtime_types::polkadot_parachain::primitives::Id, - sent_at: ::core::primitive::u32, - index: ::core::primitive::u64, - required: ::sp_weights::Weight, - }, - #[codec(index = 6)] - OverweightServiced { index: ::core::primitive::u64, used: ::sp_weights::Weight }, + XcmpMessageSent { message_hash: [::core::primitive::u8; 32usize] }, } } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct InboundChannelDetails { - pub sender: runtime_types::polkadot_parachain::primitives::Id, - pub state: runtime_types::cumulus_pallet_xcmp_queue::InboundState, - pub message_metadata: ::std::vec::Vec<( - ::core::primitive::u32, - runtime_types::polkadot_parachain::primitives::XcmpMessageFormat, - )>, - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum InboundState { - #[codec(index = 0)] - Ok, - #[codec(index = 1)] - Suspended, - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct OutboundChannelDetails { - pub recipient: runtime_types::polkadot_parachain::primitives::Id, + pub recipient: runtime_types::polkadot_parachain_primitives::primitives::Id, pub state: runtime_types::cumulus_pallet_xcmp_queue::OutboundState, pub signals_exist: ::core::primitive::bool, pub first_index: ::core::primitive::u16, @@ -627,6 +570,18 @@ pub mod api { pub xcmp_max_individual_weight: ::sp_weights::Weight, } } + pub mod cumulus_primitives_core { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum AggregateMessageOrigin { + #[codec(index = 0)] + Here, + #[codec(index = 1)] + Parent, + #[codec(index = 2)] + Sibling(runtime_types::polkadot_parachain_primitives::primitives::Id), + } + } pub mod cumulus_primitives_parachain_inherent { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -634,7 +589,7 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct ParachainInherentData { pub validation_data: - runtime_types::polkadot_primitives::v4::PersistedValidationData< + runtime_types::polkadot_primitives::v6::PersistedValidationData< ::subxt::utils::H256, ::core::primitive::u32, >, @@ -645,7 +600,7 @@ pub mod api { >, >, pub horizontal_messages: ::subxt::utils::KeyedVec< - runtime_types::polkadot_parachain::primitives::Id, + runtime_types::polkadot_parachain_primitives::primitives::Id, ::std::vec::Vec< runtime_types::polkadot_core_primitives::InboundHrmpMessage< ::core::primitive::u32, @@ -720,6 +675,22 @@ pub mod api { } pub mod traits { use super::runtime_types; + pub mod messages { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum ProcessMessageError { + #[codec(index = 0)] + BadFormat, + #[codec(index = 1)] + Corrupt, + #[codec(index = 2)] + Unsupported, + #[codec(index = 3)] + Overweight(::sp_weights::Weight), + #[codec(index = 4)] + Yield, + } + } pub mod tokens { use super::runtime_types; pub mod misc { @@ -869,9 +840,9 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct AccountInfo<_0, _1> { pub nonce: _0, - pub consumers: _0, - pub providers: _0, - pub sufficients: _0, + pub consumers: ::core::primitive::u32, + pub providers: ::core::primitive::u32, + pub sufficients: ::core::primitive::u32, pub data: _1, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -908,14 +879,6 @@ pub mod api { #[codec(compact)] value: ::core::primitive::u128, }, - #[codec(index = 1)] - set_balance_deprecated { - who: ::subxt::utils::MultiAddress<::sp_core::crypto::AccountId32, ()>, - #[codec(compact)] - new_free: ::core::primitive::u128, - #[codec(compact)] - old_reserved: ::core::primitive::u128, - }, #[codec(index = 2)] force_transfer { source: ::subxt::utils::MultiAddress<::sp_core::crypto::AccountId32, ()>, @@ -941,12 +904,6 @@ pub mod api { }, #[codec(index = 6)] upgrade_accounts { who: ::std::vec::Vec<::sp_core::crypto::AccountId32> }, - #[codec(index = 7)] - transfer { - dest: ::subxt::utils::MultiAddress<::sp_core::crypto::AccountId32, ()>, - #[codec(compact)] - value: ::core::primitive::u128, - }, #[codec(index = 8)] force_set_balance { who: ::subxt::utils::MultiAddress<::sp_core::crypto::AccountId32, ()>, @@ -1143,6 +1100,39 @@ pub mod api { }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Call2 { + #[codec(index = 0)] + submit_finality_proof { + finality_target: ::std::boxed::Box< + ::sp_runtime::generic::Header< + ::core::primitive::u32, + ::sp_runtime::traits::BlakeTwo256, + >, + >, + justification: ::bp_header_chain::justification::GrandpaJustification< + ::sp_runtime::generic::Header< + ::core::primitive::u32, + ::sp_runtime::traits::BlakeTwo256, + >, + >, + }, + #[codec(index = 1)] + initialize { + init_data: ::bp_header_chain::InitializationData< + ::sp_runtime::generic::Header< + ::core::primitive::u32, + ::sp_runtime::traits::BlakeTwo256, + >, + >, + }, + #[codec(index = 2)] + set_owner { new_owner: ::core::option::Option<::sp_core::crypto::AccountId32> }, + #[codec(index = 3)] + set_operating_mode { + operating_mode: runtime_types::bp_runtime::BasicOperatingMode, + }, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { #[codec(index = 0)] InvalidJustification, @@ -1162,11 +1152,56 @@ pub mod api { BridgeModule(runtime_types::bp_runtime::OwnedBridgeModuleError), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Error2 { + #[codec(index = 0)] + InvalidJustification, + #[codec(index = 1)] + InvalidAuthoritySet, + #[codec(index = 2)] + OldHeader, + #[codec(index = 3)] + UnsupportedScheduledChange, + #[codec(index = 4)] + NotInitialized, + #[codec(index = 5)] + AlreadyInitialized, + #[codec(index = 6)] + TooManyAuthoritiesInSet, + #[codec(index = 7)] + BridgeModule(runtime_types::bp_runtime::OwnedBridgeModuleError), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { #[codec(index = 0)] UpdatedBestFinalizedHeader { number: ::core::primitive::u32, hash: ::subxt::utils::H256, + grandpa_info: runtime_types::bp_header_chain::HeaderFinalityInfo< + ::bp_header_chain::justification::GrandpaJustification< + ::sp_runtime::generic::Header< + ::core::primitive::u32, + ::sp_runtime::traits::BlakeTwo256, + >, + >, + runtime_types::bp_header_chain::AuthoritySet, + >, + }, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Event2 { + #[codec(index = 0)] + UpdatedBestFinalizedHeader { + number: ::core::primitive::u32, + hash: ::subxt::utils::H256, + grandpa_info: runtime_types::bp_header_chain::HeaderFinalityInfo< + ::bp_header_chain::justification::GrandpaJustification< + ::sp_runtime::generic::Header< + ::core::primitive::u32, + ::sp_runtime::traits::BlakeTwo256, + >, + >, + runtime_types::bp_header_chain::AuthoritySet, + >, }, } } @@ -1180,6 +1215,14 @@ pub mod api { )>, pub set_id: ::core::primitive::u64, } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct StoredAuthoritySet2 { + pub authorities: runtime_types::bounded_collections::bounded_vec::BoundedVec<( + runtime_types::sp_consensus_grandpa::app::Public, + ::core::primitive::u64, + )>, + pub set_id: ::core::primitive::u64, + } } } pub mod pallet_bridge_messages { @@ -1204,11 +1247,20 @@ pub mod api { pub enum Call { # [codec (index = 0)] set_owner { new_owner : :: core :: option :: Option < :: sp_core :: crypto :: AccountId32 > , } , # [codec (index = 1)] set_operating_mode { operating_mode : runtime_types :: bp_messages :: MessagesOperatingMode , } , # [codec (index = 2)] receive_messages_proof { relayer_id_at_bridged_chain : :: sp_core :: crypto :: AccountId32 , proof : :: bridge_runtime_common :: messages :: target :: FromBridgedChainMessagesProof < :: subxt :: utils :: H256 > , messages_count : :: core :: primitive :: u32 , dispatch_weight : :: sp_weights :: Weight , } , # [codec (index = 3)] receive_messages_delivery_proof { proof : :: bridge_runtime_common :: messages :: source :: FromBridgedChainMessagesDeliveryProof < :: subxt :: utils :: H256 > , relayers_state : :: bp_messages :: UnrewardedRelayersState , } , } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Call2 { + # [codec (index = 0)] set_owner { new_owner : :: core :: option :: Option < :: sp_core :: crypto :: AccountId32 > , } , # [codec (index = 1)] set_operating_mode { operating_mode : runtime_types :: bp_messages :: MessagesOperatingMode , } , # [codec (index = 2)] receive_messages_proof { relayer_id_at_bridged_chain : :: sp_core :: crypto :: AccountId32 , proof : :: bridge_runtime_common :: messages :: target :: FromBridgedChainMessagesProof < :: subxt :: utils :: H256 > , messages_count : :: core :: primitive :: u32 , dispatch_weight : :: sp_weights :: Weight , } , # [codec (index = 3)] receive_messages_delivery_proof { proof : :: bridge_runtime_common :: messages :: source :: FromBridgedChainMessagesDeliveryProof < :: subxt :: utils :: H256 > , relayers_state : :: bp_messages :: UnrewardedRelayersState , } , } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { - # [codec (index = 0)] NotOperatingNormally , # [codec (index = 1)] InactiveOutboundLane , # [codec (index = 2)] MessageRejectedByChainVerifier (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 3)] MessageRejectedByLaneVerifier (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 4)] MessageRejectedByPallet (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 5)] FailedToWithdrawMessageFee , # [codec (index = 6)] TooManyMessagesInTheProof , # [codec (index = 7)] InvalidMessagesProof , # [codec (index = 8)] InvalidMessagesDeliveryProof , # [codec (index = 9)] InvalidUnrewardedRelayersState , # [codec (index = 10)] InsufficientDispatchWeight , # [codec (index = 11)] MessageIsNotYetSent , # [codec (index = 12)] ReceivalConfirmation (runtime_types :: pallet_bridge_messages :: outbound_lane :: ReceivalConfirmationError ,) , # [codec (index = 13)] BridgeModule (runtime_types :: bp_runtime :: OwnedBridgeModuleError ,) , } + # [codec (index = 0)] NotOperatingNormally , # [codec (index = 1)] InactiveOutboundLane , # [codec (index = 2)] MessageDispatchInactive , # [codec (index = 3)] MessageRejectedByChainVerifier (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 4)] MessageRejectedByLaneVerifier (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 5)] MessageRejectedByPallet (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 6)] FailedToWithdrawMessageFee , # [codec (index = 7)] TooManyMessagesInTheProof , # [codec (index = 8)] InvalidMessagesProof , # [codec (index = 9)] InvalidMessagesDeliveryProof , # [codec (index = 10)] InvalidUnrewardedRelayersState , # [codec (index = 11)] InsufficientDispatchWeight , # [codec (index = 12)] MessageIsNotYetSent , # [codec (index = 13)] ReceivalConfirmation (runtime_types :: pallet_bridge_messages :: outbound_lane :: ReceivalConfirmationError ,) , # [codec (index = 14)] BridgeModule (runtime_types :: bp_runtime :: OwnedBridgeModuleError ,) , } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Error2 { + # [codec (index = 0)] NotOperatingNormally , # [codec (index = 1)] InactiveOutboundLane , # [codec (index = 2)] MessageDispatchInactive , # [codec (index = 3)] MessageRejectedByChainVerifier (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 4)] MessageRejectedByLaneVerifier (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 5)] MessageRejectedByPallet (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 6)] FailedToWithdrawMessageFee , # [codec (index = 7)] TooManyMessagesInTheProof , # [codec (index = 8)] InvalidMessagesProof , # [codec (index = 9)] InvalidMessagesDeliveryProof , # [codec (index = 10)] InvalidUnrewardedRelayersState , # [codec (index = 11)] InsufficientDispatchWeight , # [codec (index = 12)] MessageIsNotYetSent , # [codec (index = 13)] ReceivalConfirmation (runtime_types :: pallet_bridge_messages :: outbound_lane :: ReceivalConfirmationError ,) , # [codec (index = 14)] BridgeModule (runtime_types :: bp_runtime :: OwnedBridgeModuleError ,) , } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { # [codec (index = 0)] MessageAccepted { lane_id : runtime_types :: bp_messages :: LaneId , nonce : :: core :: primitive :: u64 , } , # [codec (index = 1)] MessagesReceived (:: std :: vec :: Vec < runtime_types :: bp_messages :: ReceivedMessages < runtime_types :: bridge_runtime_common :: messages_xcm_extension :: XcmBlobMessageDispatchResult > > ,) , # [codec (index = 2)] MessagesDelivered { lane_id : runtime_types :: bp_messages :: LaneId , messages : runtime_types :: bp_messages :: DeliveredMessages , } , } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Event2 { + # [codec (index = 0)] MessageAccepted { lane_id : runtime_types :: bp_messages :: LaneId , nonce : :: core :: primitive :: u64 , } , # [codec (index = 1)] MessagesReceived (:: std :: vec :: Vec < runtime_types :: bp_messages :: ReceivedMessages < runtime_types :: bridge_runtime_common :: messages_xcm_extension :: XcmBlobMessageDispatchResult > > ,) , # [codec (index = 2)] MessagesDelivered { lane_id : runtime_types :: bp_messages :: LaneId , messages : runtime_types :: bp_messages :: DeliveredMessages , } , } } } pub mod pallet_bridge_parachains { @@ -1312,12 +1364,18 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { #[codec(index = 0)] - RewardPaid { + RewardRegistered { relayer: ::sp_core::crypto::AccountId32, rewards_account_params: runtime_types::bp_relayers::RewardsAccountParams, reward: ::core::primitive::u128, }, #[codec(index = 1)] + RewardPaid { + relayer: ::sp_core::crypto::AccountId32, + rewards_account_params: runtime_types::bp_relayers::RewardsAccountParams, + reward: ::core::primitive::u128, + }, + #[codec(index = 2)] RegistrationUpdated { relayer: ::sp_core::crypto::AccountId32, registration: runtime_types::bp_relayers::registration::Registration< @@ -1325,9 +1383,9 @@ pub mod api { ::core::primitive::u128, >, }, - #[codec(index = 2)] - Deregistered { relayer: ::sp_core::crypto::AccountId32 }, #[codec(index = 3)] + Deregistered { relayer: ::sp_core::crypto::AccountId32 }, + #[codec(index = 4)] SlashedAndDeregistered { relayer: ::sp_core::crypto::AccountId32, registration: runtime_types::bp_relayers::registration::Registration< @@ -1354,6 +1412,17 @@ pub mod api { register_as_candidate, #[codec(index = 4)] leave_intent, + #[codec(index = 5)] + add_invulnerable { who: ::sp_core::crypto::AccountId32 }, + #[codec(index = 6)] + remove_invulnerable { who: ::sp_core::crypto::AccountId32 }, + #[codec(index = 7)] + update_bond { new_deposit: ::core::primitive::u128 }, + #[codec(index = 8)] + take_candidate_slot { + deposit: ::core::primitive::u128, + target: ::sp_core::crypto::AccountId32, + }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct CandidateInfo<_0, _1> { @@ -1365,23 +1434,37 @@ pub mod api { #[codec(index = 0)] TooManyCandidates, #[codec(index = 1)] - TooFewCandidates, + TooFewEligibleCollators, #[codec(index = 2)] - Unknown, + AlreadyCandidate, #[codec(index = 3)] - Permission, + NotCandidate, #[codec(index = 4)] - AlreadyCandidate, + TooManyInvulnerables, #[codec(index = 5)] - NotCandidate, + AlreadyInvulnerable, #[codec(index = 6)] - TooManyInvulnerables, + NotInvulnerable, #[codec(index = 7)] - AlreadyInvulnerable, - #[codec(index = 8)] NoAssociatedValidatorId, - #[codec(index = 9)] + #[codec(index = 8)] ValidatorNotRegistered, + #[codec(index = 9)] + InsertToCandidateListFailed, + #[codec(index = 10)] + RemoveFromCandidateListFailed, + #[codec(index = 11)] + DepositTooLow, + #[codec(index = 12)] + UpdateCandidateListFailed, + #[codec(index = 13)] + InsufficientBond, + #[codec(index = 14)] + TargetIsNotCandidate, + #[codec(index = 15)] + IdenticalDeposit, + #[codec(index = 16)] + InvalidUnreserve, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { @@ -1390,18 +1473,131 @@ pub mod api { invulnerables: ::std::vec::Vec<::sp_core::crypto::AccountId32>, }, #[codec(index = 1)] - NewDesiredCandidates { desired_candidates: ::core::primitive::u32 }, + InvulnerableAdded { account_id: ::sp_core::crypto::AccountId32 }, #[codec(index = 2)] - NewCandidacyBond { bond_amount: ::core::primitive::u128 }, + InvulnerableRemoved { account_id: ::sp_core::crypto::AccountId32 }, #[codec(index = 3)] - CandidateAdded { - account_id: ::sp_core::crypto::AccountId32, - deposit: ::core::primitive::u128, - }, + NewDesiredCandidates { desired_candidates: ::core::primitive::u32 }, #[codec(index = 4)] + NewCandidacyBond { bond_amount: ::core::primitive::u128 }, + #[codec(index = 5)] + CandidateAdded { + account_id: ::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 6)] + CandidateBondUpdated { + account_id: ::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 7)] CandidateRemoved { account_id: ::sp_core::crypto::AccountId32 }, + #[codec(index = 8)] + CandidateReplaced { + old: ::sp_core::crypto::AccountId32, + new: ::sp_core::crypto::AccountId32, + deposit: ::core::primitive::u128, + }, + #[codec(index = 9)] + InvalidInvulnerableSkipped { account_id: ::sp_core::crypto::AccountId32 }, + } + } + } + pub mod pallet_message_queue { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Call { + #[codec(index = 0)] + reap_page { + message_origin: + runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + page_index: ::core::primitive::u32, + }, + #[codec(index = 1)] + execute_overweight { + message_origin: + runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + page: ::core::primitive::u32, + index: ::core::primitive::u32, + weight_limit: ::sp_weights::Weight, + }, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Error { + #[codec(index = 0)] + NotReapable, + #[codec(index = 1)] + NoPage, + #[codec(index = 2)] + NoMessage, + #[codec(index = 3)] + AlreadyProcessed, + #[codec(index = 4)] + Queued, + #[codec(index = 5)] + InsufficientWeight, + #[codec(index = 6)] + TemporarilyUnprocessable, + #[codec(index = 7)] + QueuePaused, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Event { + #[codec(index = 0)] + ProcessingFailed { + id: [::core::primitive::u8; 32usize], + origin: runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + error: runtime_types::frame_support::traits::messages::ProcessMessageError, + }, + #[codec(index = 1)] + Processed { + id: [::core::primitive::u8; 32usize], + origin: runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + weight_used: ::sp_weights::Weight, + success: ::core::primitive::bool, + }, + #[codec(index = 2)] + OverweightEnqueued { + id: [::core::primitive::u8; 32usize], + origin: runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + page_index: ::core::primitive::u32, + message_index: ::core::primitive::u32, + }, + #[codec(index = 3)] + PageReaped { + origin: runtime_types::cumulus_primitives_core::AggregateMessageOrigin, + index: ::core::primitive::u32, + }, } } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct BookState<_0> { + pub begin: ::core::primitive::u32, + pub end: ::core::primitive::u32, + pub count: ::core::primitive::u32, + pub ready_neighbours: + ::core::option::Option>, + pub message_count: ::core::primitive::u64, + pub size: ::core::primitive::u64, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Neighbours<_0> { + pub prev: _0, + pub next: _0, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Page<_0> { + pub remaining: _0, + pub remaining_size: _0, + pub first_index: _0, + pub first: _0, + pub last: _0, + pub heap: runtime_types::bounded_collections::bounded_vec::BoundedVec< + ::core::primitive::u8, + >, + } } pub mod pallet_multisig { use super::runtime_types; @@ -1524,7 +1720,7 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct Timepoint<_0> { pub height: _0, - pub index: _0, + pub index: ::core::primitive::u32, } } pub mod pallet_session { @@ -1699,14 +1895,15 @@ pub mod api { }, #[codec(index = 3)] execute { - message: ::std::boxed::Box, + message: ::std::boxed::Box, max_weight: ::sp_weights::Weight, }, #[codec(index = 4)] force_xcm_version { - location: - ::std::boxed::Box, - xcm_version: ::core::primitive::u32, + location: ::std::boxed::Box< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, + >, + version: ::core::primitive::u32, }, #[codec(index = 5)] force_default_xcm_version { @@ -1768,7 +1965,7 @@ pub mod api { #[codec(index = 12)] AlreadySubscribed, #[codec(index = 13)] - InvalidAsset, + CannotCheckOutTeleport, #[codec(index = 14)] LowBalance, #[codec(index = 15)] @@ -1781,136 +1978,201 @@ pub mod api { LockNotFound, #[codec(index = 19)] InUse, + #[codec(index = 20)] + InvalidAssetNotConcrete, + #[codec(index = 21)] + InvalidAssetUnknownReserve, + #[codec(index = 22)] + InvalidAssetUnsupportedReserve, + #[codec(index = 23)] + TooManyReserves, + #[codec(index = 24)] + LocalExecutionIncomplete, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { #[codec(index = 0)] - Attempted(runtime_types::xcm::v3::traits::Outcome), + Attempted { outcome: runtime_types::xcm::v3::traits::Outcome }, #[codec(index = 1)] - Sent( - runtime_types::xcm::v3::multilocation::MultiLocation, - runtime_types::xcm::v3::multilocation::MultiLocation, - runtime_types::xcm::v3::Xcm, - ), + Sent { + origin: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + destination: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + message: runtime_types::xcm::v3::Xcm, + message_id: [::core::primitive::u8; 32usize], + }, #[codec(index = 2)] - UnexpectedResponse( - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::primitive::u64, - ), + UnexpectedResponse { + origin: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + query_id: ::core::primitive::u64, + }, #[codec(index = 3)] - ResponseReady(::core::primitive::u64, runtime_types::xcm::v3::Response), + ResponseReady { + query_id: ::core::primitive::u64, + response: runtime_types::xcm::v3::Response, + }, #[codec(index = 4)] - Notified(::core::primitive::u64, ::core::primitive::u8, ::core::primitive::u8), + Notified { + query_id: ::core::primitive::u64, + pallet_index: ::core::primitive::u8, + call_index: ::core::primitive::u8, + }, #[codec(index = 5)] - NotifyOverweight( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ::sp_weights::Weight, - ::sp_weights::Weight, - ), + NotifyOverweight { + query_id: ::core::primitive::u64, + pallet_index: ::core::primitive::u8, + call_index: ::core::primitive::u8, + actual_weight: ::sp_weights::Weight, + max_budgeted_weight: ::sp_weights::Weight, + }, #[codec(index = 6)] - NotifyDispatchError( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), + NotifyDispatchError { + query_id: ::core::primitive::u64, + pallet_index: ::core::primitive::u8, + call_index: ::core::primitive::u8, + }, #[codec(index = 7)] - NotifyDecodeFailed( - ::core::primitive::u64, - ::core::primitive::u8, - ::core::primitive::u8, - ), + NotifyDecodeFailed { + query_id: ::core::primitive::u64, + pallet_index: ::core::primitive::u8, + call_index: ::core::primitive::u8, + }, #[codec(index = 8)] - InvalidResponder( - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::primitive::u64, - ::core::option::Option< - runtime_types::xcm::v3::multilocation::MultiLocation, + InvalidResponder { + origin: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + query_id: ::core::primitive::u64, + expected_location: ::core::option::Option< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, >, - ), + }, #[codec(index = 9)] - InvalidResponderVersion( - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::primitive::u64, - ), + InvalidResponderVersion { + origin: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + query_id: ::core::primitive::u64, + }, #[codec(index = 10)] - ResponseTaken(::core::primitive::u64), + ResponseTaken { query_id: ::core::primitive::u64 }, #[codec(index = 11)] - AssetsTrapped( - ::subxt::utils::H256, - runtime_types::xcm::v3::multilocation::MultiLocation, - runtime_types::xcm::VersionedMultiAssets, - ), + AssetsTrapped { + hash: ::subxt::utils::H256, + origin: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + assets: runtime_types::xcm::VersionedMultiAssets, + }, #[codec(index = 12)] - VersionChangeNotified( - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::primitive::u32, - runtime_types::xcm::v3::multiasset::MultiAssets, - ), + VersionChangeNotified { + destination: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + result: ::core::primitive::u32, + cost: runtime_types::xcm::v3::multiasset::MultiAssets, + message_id: [::core::primitive::u8; 32usize], + }, #[codec(index = 13)] - SupportedVersionChanged( - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::primitive::u32, - ), + SupportedVersionChanged { + location: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + version: ::core::primitive::u32, + }, #[codec(index = 14)] - NotifyTargetSendFail( - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::primitive::u64, - runtime_types::xcm::v3::traits::Error, - ), + NotifyTargetSendFail { + location: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + query_id: ::core::primitive::u64, + error: runtime_types::xcm::v3::traits::Error, + }, #[codec(index = 15)] - NotifyTargetMigrationFail( - runtime_types::xcm::VersionedMultiLocation, - ::core::primitive::u64, - ), + NotifyTargetMigrationFail { + location: runtime_types::xcm::VersionedMultiLocation, + query_id: ::core::primitive::u64, + }, #[codec(index = 16)] - InvalidQuerierVersion( - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::primitive::u64, - ), + InvalidQuerierVersion { + origin: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + query_id: ::core::primitive::u64, + }, #[codec(index = 17)] - InvalidQuerier( - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::primitive::u64, - runtime_types::xcm::v3::multilocation::MultiLocation, - ::core::option::Option< - runtime_types::xcm::v3::multilocation::MultiLocation, + InvalidQuerier { + origin: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + query_id: ::core::primitive::u64, + expected_querier: + runtime_types::staging_xcm::v3::multilocation::MultiLocation, + maybe_actual_querier: ::core::option::Option< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, >, - ), + }, #[codec(index = 18)] - VersionNotifyStarted( - runtime_types::xcm::v3::multilocation::MultiLocation, - runtime_types::xcm::v3::multiasset::MultiAssets, - ), + VersionNotifyStarted { + destination: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + cost: runtime_types::xcm::v3::multiasset::MultiAssets, + message_id: [::core::primitive::u8; 32usize], + }, #[codec(index = 19)] - VersionNotifyRequested( - runtime_types::xcm::v3::multilocation::MultiLocation, - runtime_types::xcm::v3::multiasset::MultiAssets, - ), + VersionNotifyRequested { + destination: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + cost: runtime_types::xcm::v3::multiasset::MultiAssets, + message_id: [::core::primitive::u8; 32usize], + }, #[codec(index = 20)] - VersionNotifyUnrequested( - runtime_types::xcm::v3::multilocation::MultiLocation, - runtime_types::xcm::v3::multiasset::MultiAssets, - ), + VersionNotifyUnrequested { + destination: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + cost: runtime_types::xcm::v3::multiasset::MultiAssets, + message_id: [::core::primitive::u8; 32usize], + }, #[codec(index = 21)] - FeesPaid( - runtime_types::xcm::v3::multilocation::MultiLocation, - runtime_types::xcm::v3::multiasset::MultiAssets, - ), + FeesPaid { + paying: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + fees: runtime_types::xcm::v3::multiasset::MultiAssets, + }, #[codec(index = 22)] - AssetsClaimed( - ::subxt::utils::H256, - runtime_types::xcm::v3::multilocation::MultiLocation, - runtime_types::xcm::VersionedMultiAssets, - ), + AssetsClaimed { + hash: ::subxt::utils::H256, + origin: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + assets: runtime_types::xcm::VersionedMultiAssets, + }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Origin { #[codec(index = 0)] - Xcm(runtime_types::xcm::v3::multilocation::MultiLocation), + Xcm(runtime_types::staging_xcm::v3::multilocation::MultiLocation), + #[codec(index = 1)] + Response(runtime_types::staging_xcm::v3::multilocation::MultiLocation), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum QueryStatus<_0> { + #[codec(index = 0)] + Pending { + responder: runtime_types::xcm::VersionedMultiLocation, + maybe_match_querier: + ::core::option::Option, + maybe_notify: + ::core::option::Option<(::core::primitive::u8, ::core::primitive::u8)>, + timeout: _0, + }, + #[codec(index = 1)] + VersionNotifier { + origin: runtime_types::xcm::VersionedMultiLocation, + is_active: ::core::primitive::bool, + }, + #[codec(index = 2)] + Ready { response: runtime_types::xcm::VersionedResponse, at: _0 }, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct RemoteLockedFungibleRecord<_0> { + pub amount: ::core::primitive::u128, + pub owner: runtime_types::xcm::VersionedMultiLocation, + pub locker: runtime_types::xcm::VersionedMultiLocation, + pub consumers: runtime_types::bounded_collections::bounded_vec::BoundedVec<( + _0, + ::core::primitive::u128, + )>, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum VersionMigrationStage { + #[codec(index = 0)] + MigrateSupportedVersion, #[codec(index = 1)] - Response(runtime_types::xcm::v3::multilocation::MultiLocation), + MigrateVersionNotifiers, + #[codec(index = 2)] + NotifyCurrentTargets( + ::core::option::Option<::std::vec::Vec<::core::primitive::u8>>, + ), + #[codec(index = 3)] + MigrateAndNotifyOldTargets, } } } @@ -1932,7 +2194,7 @@ pub mod api { pub data: ::std::vec::Vec<::core::primitive::u8>, } } - pub mod polkadot_parachain { + pub mod polkadot_parachain_primitives { use super::runtime_types; pub mod primitives { use super::runtime_types; @@ -1947,21 +2209,20 @@ pub mod api { PartialEq, )] pub struct Id(pub ::core::primitive::u32); - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum XcmpMessageFormat { - #[codec(index = 0)] - ConcatenatedVersionedXcm, - #[codec(index = 1)] - ConcatenatedEncodedBlob, - #[codec(index = 2)] - Signals, - } } } pub mod polkadot_primitives { use super::runtime_types; - pub mod v4 { + pub mod v6 { use super::runtime_types; + pub mod async_backing { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct AsyncBackingParams { + pub max_candidate_depth: ::core::primitive::u32, + pub allowed_ancestry_len: ::core::primitive::u32, + } + } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct AbridgedHostConfiguration { pub max_code_size: ::core::primitive::u32, @@ -1973,6 +2234,8 @@ pub mod api { pub hrmp_max_message_num_per_candidate: ::core::primitive::u32, pub validation_upgrade_cooldown: ::core::primitive::u32, pub validation_upgrade_delay: ::core::primitive::u32, + pub async_backing_params: + runtime_types::polkadot_primitives::v6::async_backing::AsyncBackingParams, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct AbridgedHrmpChannel { @@ -1985,10 +2248,18 @@ pub mod api { } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct PersistedValidationData<_0, _1> { - pub parent_head: runtime_types::polkadot_parachain::primitives::HeadData, + pub parent_head: + runtime_types::polkadot_parachain_primitives::primitives::HeadData, pub relay_parent_number: _1, pub relay_parent_storage_root: _0, - pub max_pov_size: _1, + pub max_pov_size: ::core::primitive::u32, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum UpgradeGoAhead { + #[codec(index = 0)] + Abort, + #[codec(index = 1)] + GoAhead, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum UpgradeRestriction { @@ -2112,14 +2383,6 @@ pub mod api { RuntimeEnvironmentUpdated, } } - pub mod unchecked_extrinsic { - use super::runtime_types; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct UncheckedExtrinsic<_0, _1, _2, _3>( - pub ::std::vec::Vec<::core::primitive::u8>, - #[codec(skip)] pub ::core::marker::PhantomData<(_0, _1, _2, _3)>, - ); - } } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum DispatchError { @@ -2230,6 +2493,20 @@ pub mod api { pub write: ::core::primitive::u64, } } + pub mod staging_xcm { + use super::runtime_types; + pub mod v3 { + use super::runtime_types; + pub mod multilocation { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct MultiLocation { + pub parents: ::core::primitive::u8, + pub interior: runtime_types::xcm::v3::junctions::Junctions, + } + } + } + } pub mod xcm { use super::runtime_types; pub mod double_encoded { @@ -2238,6 +2515,10 @@ pub mod api { pub struct DoubleEncoded { pub encoded: ::std::vec::Vec<::core::primitive::u8>, } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct DoubleEncoded2 { + pub encoded: ::std::vec::Vec<::core::primitive::u8>, + } } pub mod v2 { use super::runtime_types; @@ -2677,59 +2958,201 @@ pub mod api { UnsubscribeVersion, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum NetworkId { - #[codec(index = 0)] - Any, - #[codec(index = 1)] - Named( - runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< - ::core::primitive::u8, - >, - ), - #[codec(index = 2)] - Polkadot, - #[codec(index = 3)] - Kusama, - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum OriginKind { - #[codec(index = 0)] - Native, - #[codec(index = 1)] - SovereignAccount, - #[codec(index = 2)] - Superuser, - #[codec(index = 3)] - Xcm, - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum Response { + pub enum Instruction2 { #[codec(index = 0)] - Null, + WithdrawAsset(runtime_types::xcm::v2::multiasset::MultiAssets), #[codec(index = 1)] - Assets(runtime_types::xcm::v2::multiasset::MultiAssets), + ReserveAssetDeposited(runtime_types::xcm::v2::multiasset::MultiAssets), #[codec(index = 2)] - ExecutionResult( - ::core::option::Option<( - ::core::primitive::u32, - runtime_types::xcm::v2::traits::Error, - )>, - ), + ReceiveTeleportedAsset(runtime_types::xcm::v2::multiasset::MultiAssets), #[codec(index = 3)] - Version(::core::primitive::u32), - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum WeightLimit { - #[codec(index = 0)] - Unlimited, - #[codec(index = 1)] - Limited(#[codec(compact)] ::core::primitive::u64), - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct Xcm(pub ::std::vec::Vec); - } - pub mod v3 { - use super::runtime_types; + QueryResponse { + #[codec(compact)] + query_id: ::core::primitive::u64, + response: runtime_types::xcm::v2::Response, + #[codec(compact)] + max_weight: ::core::primitive::u64, + }, + #[codec(index = 4)] + TransferAsset { + assets: runtime_types::xcm::v2::multiasset::MultiAssets, + beneficiary: runtime_types::xcm::v2::multilocation::MultiLocation, + }, + #[codec(index = 5)] + TransferReserveAsset { + assets: runtime_types::xcm::v2::multiasset::MultiAssets, + dest: runtime_types::xcm::v2::multilocation::MultiLocation, + xcm: runtime_types::xcm::v2::Xcm, + }, + #[codec(index = 6)] + Transact { + origin_type: runtime_types::xcm::v2::OriginKind, + #[codec(compact)] + require_weight_at_most: ::core::primitive::u64, + call: runtime_types::xcm::double_encoded::DoubleEncoded2, + }, + #[codec(index = 7)] + HrmpNewChannelOpenRequest { + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + max_message_size: ::core::primitive::u32, + #[codec(compact)] + max_capacity: ::core::primitive::u32, + }, + #[codec(index = 8)] + HrmpChannelAccepted { + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 9)] + HrmpChannelClosing { + #[codec(compact)] + initiator: ::core::primitive::u32, + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 10)] + ClearOrigin, + #[codec(index = 11)] + DescendOrigin(runtime_types::xcm::v2::multilocation::Junctions), + #[codec(index = 12)] + ReportError { + #[codec(compact)] + query_id: ::core::primitive::u64, + dest: runtime_types::xcm::v2::multilocation::MultiLocation, + #[codec(compact)] + max_response_weight: ::core::primitive::u64, + }, + #[codec(index = 13)] + DepositAsset { + assets: runtime_types::xcm::v2::multiasset::MultiAssetFilter, + #[codec(compact)] + max_assets: ::core::primitive::u32, + beneficiary: runtime_types::xcm::v2::multilocation::MultiLocation, + }, + #[codec(index = 14)] + DepositReserveAsset { + assets: runtime_types::xcm::v2::multiasset::MultiAssetFilter, + #[codec(compact)] + max_assets: ::core::primitive::u32, + dest: runtime_types::xcm::v2::multilocation::MultiLocation, + xcm: runtime_types::xcm::v2::Xcm, + }, + #[codec(index = 15)] + ExchangeAsset { + give: runtime_types::xcm::v2::multiasset::MultiAssetFilter, + receive: runtime_types::xcm::v2::multiasset::MultiAssets, + }, + #[codec(index = 16)] + InitiateReserveWithdraw { + assets: runtime_types::xcm::v2::multiasset::MultiAssetFilter, + reserve: runtime_types::xcm::v2::multilocation::MultiLocation, + xcm: runtime_types::xcm::v2::Xcm, + }, + #[codec(index = 17)] + InitiateTeleport { + assets: runtime_types::xcm::v2::multiasset::MultiAssetFilter, + dest: runtime_types::xcm::v2::multilocation::MultiLocation, + xcm: runtime_types::xcm::v2::Xcm, + }, + #[codec(index = 18)] + QueryHolding { + #[codec(compact)] + query_id: ::core::primitive::u64, + dest: runtime_types::xcm::v2::multilocation::MultiLocation, + assets: runtime_types::xcm::v2::multiasset::MultiAssetFilter, + #[codec(compact)] + max_response_weight: ::core::primitive::u64, + }, + #[codec(index = 19)] + BuyExecution { + fees: runtime_types::xcm::v2::multiasset::MultiAsset, + weight_limit: runtime_types::xcm::v2::WeightLimit, + }, + #[codec(index = 20)] + RefundSurplus, + #[codec(index = 21)] + SetErrorHandler(runtime_types::xcm::v2::Xcm2), + #[codec(index = 22)] + SetAppendix(runtime_types::xcm::v2::Xcm2), + #[codec(index = 23)] + ClearError, + #[codec(index = 24)] + ClaimAsset { + assets: runtime_types::xcm::v2::multiasset::MultiAssets, + ticket: runtime_types::xcm::v2::multilocation::MultiLocation, + }, + #[codec(index = 25)] + Trap(#[codec(compact)] ::core::primitive::u64), + #[codec(index = 26)] + SubscribeVersion { + #[codec(compact)] + query_id: ::core::primitive::u64, + #[codec(compact)] + max_response_weight: ::core::primitive::u64, + }, + #[codec(index = 27)] + UnsubscribeVersion, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum NetworkId { + #[codec(index = 0)] + Any, + #[codec(index = 1)] + Named( + runtime_types::bounded_collections::weak_bounded_vec::WeakBoundedVec< + ::core::primitive::u8, + >, + ), + #[codec(index = 2)] + Polkadot, + #[codec(index = 3)] + Kusama, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum OriginKind { + #[codec(index = 0)] + Native, + #[codec(index = 1)] + SovereignAccount, + #[codec(index = 2)] + Superuser, + #[codec(index = 3)] + Xcm, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Response { + #[codec(index = 0)] + Null, + #[codec(index = 1)] + Assets(runtime_types::xcm::v2::multiasset::MultiAssets), + #[codec(index = 2)] + ExecutionResult( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v2::traits::Error, + )>, + ), + #[codec(index = 3)] + Version(::core::primitive::u32), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum WeightLimit { + #[codec(index = 0)] + Unlimited, + #[codec(index = 1)] + Limited(#[codec(compact)] ::core::primitive::u64), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Xcm(pub ::std::vec::Vec); + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Xcm2(pub ::std::vec::Vec); + } + pub mod v3 { + use super::runtime_types; pub mod junction { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -2929,7 +3352,7 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum AssetId { #[codec(index = 0)] - Concrete(runtime_types::xcm::v3::multilocation::MultiLocation), + Concrete(runtime_types::staging_xcm::v3::multilocation::MultiLocation), #[codec(index = 1)] Abstract([::core::primitive::u8; 32usize]), } @@ -2998,14 +3421,6 @@ pub mod api { }, } } - pub mod multilocation { - use super::runtime_types; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct MultiLocation { - pub parents: ::core::primitive::u8, - pub interior: runtime_types::xcm::v3::junctions::Junctions, - } - } pub mod traits { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -3116,18 +3531,18 @@ pub mod api { response: runtime_types::xcm::v3::Response, max_weight: ::sp_weights::Weight, querier: ::core::option::Option< - runtime_types::xcm::v3::multilocation::MultiLocation, + runtime_types::staging_xcm::v3::multilocation::MultiLocation, >, }, #[codec(index = 4)] TransferAsset { assets: runtime_types::xcm::v3::multiasset::MultiAssets, - beneficiary: runtime_types::xcm::v3::multilocation::MultiLocation, + beneficiary: runtime_types::staging_xcm::v3::multilocation::MultiLocation, }, #[codec(index = 5)] TransferReserveAsset { assets: runtime_types::xcm::v3::multiasset::MultiAssets, - dest: runtime_types::xcm::v3::multilocation::MultiLocation, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, xcm: runtime_types::xcm::v3::Xcm, }, #[codec(index = 6)] @@ -3168,12 +3583,12 @@ pub mod api { #[codec(index = 13)] DepositAsset { assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, - beneficiary: runtime_types::xcm::v3::multilocation::MultiLocation, + beneficiary: runtime_types::staging_xcm::v3::multilocation::MultiLocation, }, #[codec(index = 14)] DepositReserveAsset { assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, - dest: runtime_types::xcm::v3::multilocation::MultiLocation, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, xcm: runtime_types::xcm::v3::Xcm, }, #[codec(index = 15)] @@ -3185,13 +3600,13 @@ pub mod api { #[codec(index = 16)] InitiateReserveWithdraw { assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, - reserve: runtime_types::xcm::v3::multilocation::MultiLocation, + reserve: runtime_types::staging_xcm::v3::multilocation::MultiLocation, xcm: runtime_types::xcm::v3::Xcm, }, #[codec(index = 17)] InitiateTeleport { assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, - dest: runtime_types::xcm::v3::multilocation::MultiLocation, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, xcm: runtime_types::xcm::v3::Xcm, }, #[codec(index = 18)] @@ -3215,7 +3630,7 @@ pub mod api { #[codec(index = 24)] ClaimAsset { assets: runtime_types::xcm::v3::multiasset::MultiAssets, - ticket: runtime_types::xcm::v3::multilocation::MultiLocation, + ticket: runtime_types::staging_xcm::v3::multilocation::MultiLocation, }, #[codec(index = 25)] Trap(#[codec(compact)] ::core::primitive::u64), @@ -3234,7 +3649,7 @@ pub mod api { #[codec(index = 30)] ExpectOrigin( ::core::option::Option< - runtime_types::xcm::v3::multilocation::MultiLocation, + runtime_types::staging_xcm::v3::multilocation::MultiLocation, >, ), #[codec(index = 31)] @@ -3277,22 +3692,22 @@ pub mod api { #[codec(index = 39)] LockAsset { asset: runtime_types::xcm::v3::multiasset::MultiAsset, - unlocker: runtime_types::xcm::v3::multilocation::MultiLocation, + unlocker: runtime_types::staging_xcm::v3::multilocation::MultiLocation, }, #[codec(index = 40)] UnlockAsset { asset: runtime_types::xcm::v3::multiasset::MultiAsset, - target: runtime_types::xcm::v3::multilocation::MultiLocation, + target: runtime_types::staging_xcm::v3::multilocation::MultiLocation, }, #[codec(index = 41)] NoteUnlockable { asset: runtime_types::xcm::v3::multiasset::MultiAsset, - owner: runtime_types::xcm::v3::multilocation::MultiLocation, + owner: runtime_types::staging_xcm::v3::multilocation::MultiLocation, }, #[codec(index = 42)] RequestUnlock { asset: runtime_types::xcm::v3::multiasset::MultiAsset, - locker: runtime_types::xcm::v3::multilocation::MultiLocation, + locker: runtime_types::staging_xcm::v3::multilocation::MultiLocation, }, #[codec(index = 43)] SetFeesMode { jit_withdraw: ::core::primitive::bool }, @@ -3301,12 +3716,221 @@ pub mod api { #[codec(index = 45)] ClearTopic, #[codec(index = 46)] - AliasOrigin(runtime_types::xcm::v3::multilocation::MultiLocation), + AliasOrigin(runtime_types::staging_xcm::v3::multilocation::MultiLocation), #[codec(index = 47)] UnpaidExecution { weight_limit: runtime_types::xcm::v3::WeightLimit, check_origin: ::core::option::Option< - runtime_types::xcm::v3::multilocation::MultiLocation, + runtime_types::staging_xcm::v3::multilocation::MultiLocation, + >, + }, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Instruction2 { + #[codec(index = 0)] + WithdrawAsset(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 1)] + ReserveAssetDeposited(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 2)] + ReceiveTeleportedAsset(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 3)] + QueryResponse { + #[codec(compact)] + query_id: ::core::primitive::u64, + response: runtime_types::xcm::v3::Response, + max_weight: ::sp_weights::Weight, + querier: ::core::option::Option< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, + >, + }, + #[codec(index = 4)] + TransferAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssets, + beneficiary: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 5)] + TransferReserveAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssets, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 6)] + Transact { + origin_kind: runtime_types::xcm::v2::OriginKind, + require_weight_at_most: ::sp_weights::Weight, + call: runtime_types::xcm::double_encoded::DoubleEncoded2, + }, + #[codec(index = 7)] + HrmpNewChannelOpenRequest { + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + max_message_size: ::core::primitive::u32, + #[codec(compact)] + max_capacity: ::core::primitive::u32, + }, + #[codec(index = 8)] + HrmpChannelAccepted { + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 9)] + HrmpChannelClosing { + #[codec(compact)] + initiator: ::core::primitive::u32, + #[codec(compact)] + sender: ::core::primitive::u32, + #[codec(compact)] + recipient: ::core::primitive::u32, + }, + #[codec(index = 10)] + ClearOrigin, + #[codec(index = 11)] + DescendOrigin(runtime_types::xcm::v3::junctions::Junctions), + #[codec(index = 12)] + ReportError(runtime_types::xcm::v3::QueryResponseInfo), + #[codec(index = 13)] + DepositAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + beneficiary: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 14)] + DepositReserveAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 15)] + ExchangeAsset { + give: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + want: runtime_types::xcm::v3::multiasset::MultiAssets, + maximal: ::core::primitive::bool, + }, + #[codec(index = 16)] + InitiateReserveWithdraw { + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + reserve: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 17)] + InitiateTeleport { + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + dest: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 18)] + ReportHolding { + response_info: runtime_types::xcm::v3::QueryResponseInfo, + assets: runtime_types::xcm::v3::multiasset::MultiAssetFilter, + }, + #[codec(index = 19)] + BuyExecution { + fees: runtime_types::xcm::v3::multiasset::MultiAsset, + weight_limit: runtime_types::xcm::v3::WeightLimit, + }, + #[codec(index = 20)] + RefundSurplus, + #[codec(index = 21)] + SetErrorHandler(runtime_types::xcm::v3::Xcm2), + #[codec(index = 22)] + SetAppendix(runtime_types::xcm::v3::Xcm2), + #[codec(index = 23)] + ClearError, + #[codec(index = 24)] + ClaimAsset { + assets: runtime_types::xcm::v3::multiasset::MultiAssets, + ticket: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 25)] + Trap(#[codec(compact)] ::core::primitive::u64), + #[codec(index = 26)] + SubscribeVersion { + #[codec(compact)] + query_id: ::core::primitive::u64, + max_response_weight: ::sp_weights::Weight, + }, + #[codec(index = 27)] + UnsubscribeVersion, + #[codec(index = 28)] + BurnAsset(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 29)] + ExpectAsset(runtime_types::xcm::v3::multiasset::MultiAssets), + #[codec(index = 30)] + ExpectOrigin( + ::core::option::Option< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, + >, + ), + #[codec(index = 31)] + ExpectError( + ::core::option::Option<( + ::core::primitive::u32, + runtime_types::xcm::v3::traits::Error, + )>, + ), + #[codec(index = 32)] + ExpectTransactStatus(runtime_types::xcm::v3::MaybeErrorCode), + #[codec(index = 33)] + QueryPallet { + module_name: ::std::vec::Vec<::core::primitive::u8>, + response_info: runtime_types::xcm::v3::QueryResponseInfo, + }, + #[codec(index = 34)] + ExpectPallet { + #[codec(compact)] + index: ::core::primitive::u32, + name: ::std::vec::Vec<::core::primitive::u8>, + module_name: ::std::vec::Vec<::core::primitive::u8>, + #[codec(compact)] + crate_major: ::core::primitive::u32, + #[codec(compact)] + min_crate_minor: ::core::primitive::u32, + }, + #[codec(index = 35)] + ReportTransactStatus(runtime_types::xcm::v3::QueryResponseInfo), + #[codec(index = 36)] + ClearTransactStatus, + #[codec(index = 37)] + UniversalOrigin(runtime_types::xcm::v3::junction::Junction), + #[codec(index = 38)] + ExportMessage { + network: runtime_types::xcm::v3::junction::NetworkId, + destination: runtime_types::xcm::v3::junctions::Junctions, + xcm: runtime_types::xcm::v3::Xcm, + }, + #[codec(index = 39)] + LockAsset { + asset: runtime_types::xcm::v3::multiasset::MultiAsset, + unlocker: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 40)] + UnlockAsset { + asset: runtime_types::xcm::v3::multiasset::MultiAsset, + target: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 41)] + NoteUnlockable { + asset: runtime_types::xcm::v3::multiasset::MultiAsset, + owner: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 42)] + RequestUnlock { + asset: runtime_types::xcm::v3::multiasset::MultiAsset, + locker: runtime_types::staging_xcm::v3::multilocation::MultiLocation, + }, + #[codec(index = 43)] + SetFeesMode { jit_withdraw: ::core::primitive::bool }, + #[codec(index = 44)] + SetTopic([::core::primitive::u8; 32usize]), + #[codec(index = 45)] + ClearTopic, + #[codec(index = 46)] + AliasOrigin(runtime_types::staging_xcm::v3::multilocation::MultiLocation), + #[codec(index = 47)] + UnpaidExecution { + weight_limit: runtime_types::xcm::v3::WeightLimit, + check_origin: ::core::option::Option< + runtime_types::staging_xcm::v3::multilocation::MultiLocation, >, }, } @@ -3346,7 +3970,7 @@ pub mod api { } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct QueryResponseInfo { - pub destination: runtime_types::xcm::v3::multilocation::MultiLocation, + pub destination: runtime_types::staging_xcm::v3::multilocation::MultiLocation, #[codec(compact)] pub query_id: ::core::primitive::u64, pub max_weight: ::sp_weights::Weight, @@ -3384,6 +4008,13 @@ pub mod api { } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct Xcm(pub ::std::vec::Vec); + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Xcm2(pub ::std::vec::Vec); + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum VersionedAssetId { + #[codec(index = 3)] + V3(runtime_types::xcm::v3::multiasset::AssetId), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum VersionedMultiAssets { @@ -3397,7 +4028,14 @@ pub mod api { #[codec(index = 1)] V2(runtime_types::xcm::v2::multilocation::MultiLocation), #[codec(index = 3)] - V3(runtime_types::xcm::v3::multilocation::MultiLocation), + V3(runtime_types::staging_xcm::v3::multilocation::MultiLocation), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum VersionedResponse { + #[codec(index = 2)] + V2(runtime_types::xcm::v2::Response), + #[codec(index = 3)] + V3(runtime_types::xcm::v3::Response), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum VersionedXcm { @@ -3406,6 +4044,13 @@ pub mod api { #[codec(index = 3)] V3(runtime_types::xcm::v3::Xcm), } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum VersionedXcm2 { + #[codec(index = 2)] + V2(runtime_types::xcm::v2::Xcm2), + #[codec(index = 3)] + V3(runtime_types::xcm::v3::Xcm2), + } } } } diff --git a/relays/client-bridge-hub-rococo/src/lib.rs b/relays/client-bridge-hub-rococo/src/lib.rs index 7e3a441f561e1..b92e0009f5b80 100644 --- a/relays/client-bridge-hub-rococo/src/lib.rs +++ b/relays/client-bridge-hub-rococo/src/lib.rs @@ -36,7 +36,9 @@ pub use codegen_runtime::api::runtime_types; pub type RuntimeCall = runtime_types::bridge_hub_rococo_runtime::RuntimeCall; pub type BridgeMessagesCall = runtime_types::pallet_bridge_messages::pallet::Call; +pub type BridgeBulletinMessagesCall = runtime_types::pallet_bridge_messages::pallet::Call2; pub type BridgeGrandpaCall = runtime_types::pallet_bridge_grandpa::pallet::Call; +pub type BridgeBulletinGrandpaCall = runtime_types::pallet_bridge_grandpa::pallet::Call2; pub type BridgeParachainCall = runtime_types::pallet_bridge_parachains::pallet::Call; type UncheckedExtrinsic = bp_bridge_hub_rococo::UncheckedExtrinsic; type UtilityCall = runtime_types::pallet_utility::pallet::Call; diff --git a/relays/client-polkadot-bulletin/src/codegen_runtime.rs b/relays/client-polkadot-bulletin/src/codegen_runtime.rs index 37af5b0b98e0b..601a2dd973cd6 100644 --- a/relays/client-polkadot-bulletin/src/codegen_runtime.rs +++ b/relays/client-polkadot-bulletin/src/codegen_runtime.rs @@ -16,12 +16,16 @@ //! Autogenerated runtime API //! THIS FILE WAS AUTOGENERATED USING parity-bridges-common::runtime-codegen -//! EXECUTED COMMAND: target/debug/runtime-codegen --from-node-url ws://127.0.0.1:9944 +//! EXECUTED COMMAND: target/debug/runtime-codegen --from-node-url ws://127.0.0.1:10000 #[allow(dead_code, unused_imports, non_camel_case_types)] #[allow(clippy::all)] +#[allow(rustdoc::broken_intra_doc_links)] pub mod api { - use super::api as root_mod; + #[allow(unused_imports)] + mod root_mod { + pub use super::*; + } pub mod runtime_types { use super::runtime_types; pub mod bounded_collections { @@ -78,6 +82,10 @@ pub mod api { pub last_confirmed_nonce: ::core::primitive::u64, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct InboundMessageDetails { + pub dispatch_weight: ::sp_weights::Weight, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct LaneId(pub [::core::primitive::u8; 4usize]); #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct MessageKey { @@ -98,6 +106,12 @@ pub mod api { pub latest_generated_nonce: ::core::primitive::u64, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct OutboundMessageDetails { + pub nonce: ::core::primitive::u64, + pub dispatch_weight: ::sp_weights::Weight, + pub size: ::core::primitive::u32, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum ReceivalResult<_0> { #[codec(index = 0)] Dispatched(runtime_types::bp_runtime::messages::MessageDispatchResult<_0>), @@ -205,6 +219,21 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct StrippableError; } + pub mod bridge_runtime_common { + use super::runtime_types; + pub mod messages_xcm_extension { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum XcmBlobMessageDispatchResult { + #[codec(index = 0)] + InvalidPayload, + #[codec(index = 1)] + Dispatched, + #[codec(index = 2)] + NotDispatched, + } + } + } pub mod finality_grandpa { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -405,9 +434,9 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct AccountInfo<_0, _1> { pub nonce: _0, - pub consumers: _0, - pub providers: _0, - pub sufficients: _0, + pub consumers: ::core::primitive::u32, + pub providers: ::core::primitive::u32, + pub sufficients: ::core::primitive::u32, pub data: _1, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -588,49 +617,13 @@ pub mod api { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Call { - #[codec(index = 0)] - set_owner { new_owner: ::core::option::Option<::sp_core::crypto::AccountId32> }, - #[codec(index = 1)] - set_operating_mode { - operating_mode: runtime_types::bp_messages::MessagesOperatingMode, - }, - #[codec(index = 2)] - receive_messages_proof { - relayer_id_at_bridged_chain: ::sp_core::crypto::AccountId32, - proof: bridge_runtime_common::messages::target::FromBridgedChainMessagesProof< - ::subxt::utils::H256, - >, - messages_count: ::core::primitive::u32, - dispatch_weight: ::sp_weights::Weight, - }, - #[codec(index = 3)] - receive_messages_delivery_proof { - proof: bridge_runtime_common::messages::source::FromBridgedChainMessagesDeliveryProof< - ::subxt::utils::H256, - >, - relayers_state: ::bp_messages::UnrewardedRelayersState, - }, - } + # [codec (index = 0)] set_owner { new_owner : :: core :: option :: Option < :: sp_core :: crypto :: AccountId32 > , } , # [codec (index = 1)] set_operating_mode { operating_mode : runtime_types :: bp_messages :: MessagesOperatingMode , } , # [codec (index = 2)] receive_messages_proof { relayer_id_at_bridged_chain : :: sp_core :: crypto :: AccountId32 , proof : :: bridge_runtime_common :: messages :: target :: FromBridgedChainMessagesProof < :: subxt :: utils :: H256 > , messages_count : :: core :: primitive :: u32 , dispatch_weight : :: sp_weights :: Weight , } , # [codec (index = 3)] receive_messages_delivery_proof { proof : :: bridge_runtime_common :: messages :: source :: FromBridgedChainMessagesDeliveryProof < :: subxt :: utils :: H256 > , relayers_state : :: bp_messages :: UnrewardedRelayersState , } , } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { # [codec (index = 0)] NotOperatingNormally , # [codec (index = 1)] InactiveOutboundLane , # [codec (index = 2)] MessageDispatchInactive , # [codec (index = 3)] MessageRejectedByChainVerifier (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 4)] MessageRejectedByLaneVerifier (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 5)] MessageRejectedByPallet (runtime_types :: bp_messages :: VerificationError ,) , # [codec (index = 6)] FailedToWithdrawMessageFee , # [codec (index = 7)] TooManyMessagesInTheProof , # [codec (index = 8)] InvalidMessagesProof , # [codec (index = 9)] InvalidMessagesDeliveryProof , # [codec (index = 10)] InvalidUnrewardedRelayersState , # [codec (index = 11)] InsufficientDispatchWeight , # [codec (index = 12)] MessageIsNotYetSent , # [codec (index = 13)] ReceivalConfirmation (runtime_types :: pallet_bridge_messages :: outbound_lane :: ReceivalConfirmationError ,) , # [codec (index = 14)] BridgeModule (runtime_types :: bp_runtime :: OwnedBridgeModuleError ,) , } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { - #[codec(index = 0)] - MessageAccepted { - lane_id: runtime_types::bp_messages::LaneId, - nonce: ::core::primitive::u64, - }, - #[codec(index = 1)] - MessagesReceived( - ::std::vec::Vec>, - ), - #[codec(index = 2)] - MessagesDelivered { - lane_id: runtime_types::bp_messages::LaneId, - messages: runtime_types::bp_messages::DeliveredMessages, - }, - } + # [codec (index = 0)] MessageAccepted { lane_id : runtime_types :: bp_messages :: LaneId , nonce : :: core :: primitive :: u64 , } , # [codec (index = 1)] MessagesReceived (:: std :: vec :: Vec < runtime_types :: bp_messages :: ReceivedMessages < runtime_types :: bridge_runtime_common :: messages_xcm_extension :: XcmBlobMessageDispatchResult > > ,) , # [codec (index = 2)] MessagesDelivered { lane_id : runtime_types :: bp_messages :: LaneId , messages : runtime_types :: bp_messages :: DeliveredMessages , } , } } } pub mod pallet_bridge_parachains { @@ -834,9 +827,9 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct Heartbeat<_0> { pub block_number: _0, - pub session_index: _0, - pub authority_index: _0, - pub validators_len: _0, + pub session_index: ::core::primitive::u32, + pub authority_index: ::core::primitive::u32, + pub validators_len: ::core::primitive::u32, } } pub mod pallet_offences { @@ -853,6 +846,30 @@ pub mod api { } } } + pub mod pallet_relayer_set { + use super::runtime_types; + pub mod pallet { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Error { + #[codec(index = 0)] + Duplicate, + #[codec(index = 1)] + NotARelayer, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum Event { + #[codec(index = 0)] + RelayerAdded(::sp_core::crypto::AccountId32), + #[codec(index = 1)] + RelayerRemoved(::sp_core::crypto::AccountId32), + } + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Relayer<_0> { + pub min_bridge_tx_block: _0, + } + } pub mod pallet_session { use super::runtime_types; pub mod pallet { @@ -1064,13 +1081,6 @@ pub mod api { pub mod pallet { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub enum Call { - #[codec(index = 0)] - add_validator { who: ::sp_core::crypto::AccountId32 }, - #[codec(index = 1)] - remove_validator { who: ::sp_core::crypto::AccountId32 }, - } - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { #[codec(index = 0)] Duplicate, @@ -1104,6 +1114,8 @@ pub mod api { } } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct BridgeRejectObsoleteHeadersAndMessages; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct Runtime; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum RuntimeCall { @@ -1113,53 +1125,76 @@ pub mod api { Babe(runtime_types::pallet_babe::pallet::Call), #[codec(index = 2)] Timestamp(runtime_types::pallet_timestamp::pallet::Call), - #[codec(index = 6)] - ValidatorSet(runtime_types::pallet_validator_set::pallet::Call), - #[codec(index = 7)] + #[codec(index = 14)] Session(runtime_types::pallet_session::pallet::Call), - #[codec(index = 8)] + #[codec(index = 15)] ImOnline(runtime_types::pallet_im_online::pallet::Call), - #[codec(index = 9)] + #[codec(index = 16)] Grandpa(runtime_types::pallet_grandpa::pallet::Call), - #[codec(index = 10)] - Sudo(runtime_types::pallet_sudo::pallet::Call), - #[codec(index = 11)] + #[codec(index = 40)] TransactionStorage(runtime_types::pallet_transaction_storage::pallet::Call), - #[codec(index = 12)] + #[codec(index = 51)] BridgePolkadotGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Call), - #[codec(index = 13)] + #[codec(index = 52)] BridgePolkadotParachains(runtime_types::pallet_bridge_parachains::pallet::Call), + #[codec(index = 53)] + BridgePolkadotMessages(runtime_types::pallet_bridge_messages::pallet::Call), + #[codec(index = 255)] + Sudo(runtime_types::pallet_sudo::pallet::Call), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum RuntimeError { + #[codec(index = 0)] + System(runtime_types::frame_system::pallet::Error), + #[codec(index = 1)] + Babe(runtime_types::pallet_babe::pallet::Error), + #[codec(index = 13)] + ValidatorSet(runtime_types::pallet_validator_set::pallet::Error), #[codec(index = 14)] - BridgePolkadotBridgeHubMessages( - runtime_types::pallet_bridge_messages::pallet::Call, - ), + Session(runtime_types::pallet_session::pallet::Error), + #[codec(index = 15)] + ImOnline(runtime_types::pallet_im_online::pallet::Error), + #[codec(index = 16)] + Grandpa(runtime_types::pallet_grandpa::pallet::Error), + #[codec(index = 40)] + TransactionStorage(runtime_types::pallet_transaction_storage::pallet::Error), + #[codec(index = 50)] + RelayerSet(runtime_types::pallet_relayer_set::pallet::Error), + #[codec(index = 51)] + BridgePolkadotGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Error), + #[codec(index = 52)] + BridgePolkadotParachains(runtime_types::pallet_bridge_parachains::pallet::Error), + #[codec(index = 53)] + BridgePolkadotMessages(runtime_types::pallet_bridge_messages::pallet::Error), + #[codec(index = 255)] + Sudo(runtime_types::pallet_sudo::pallet::Error), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum RuntimeEvent { #[codec(index = 0)] System(runtime_types::frame_system::pallet::Event), - #[codec(index = 4)] + #[codec(index = 11)] Offences(runtime_types::pallet_offences::pallet::Event), - #[codec(index = 6)] + #[codec(index = 13)] ValidatorSet(runtime_types::pallet_validator_set::pallet::Event), - #[codec(index = 7)] + #[codec(index = 14)] Session(runtime_types::pallet_session::pallet::Event), - #[codec(index = 8)] + #[codec(index = 15)] ImOnline(runtime_types::pallet_im_online::pallet::Event), - #[codec(index = 9)] + #[codec(index = 16)] Grandpa(runtime_types::pallet_grandpa::pallet::Event), - #[codec(index = 10)] - Sudo(runtime_types::pallet_sudo::pallet::Event), - #[codec(index = 11)] + #[codec(index = 40)] TransactionStorage(runtime_types::pallet_transaction_storage::pallet::Event), - #[codec(index = 12)] + #[codec(index = 50)] + RelayerSet(runtime_types::pallet_relayer_set::pallet::Event), + #[codec(index = 51)] BridgePolkadotGrandpa(runtime_types::pallet_bridge_grandpa::pallet::Event), - #[codec(index = 13)] + #[codec(index = 52)] BridgePolkadotParachains(runtime_types::pallet_bridge_parachains::pallet::Event), - #[codec(index = 14)] - BridgePolkadotBridgeHubMessages( - runtime_types::pallet_bridge_messages::pallet::Event, - ), + #[codec(index = 53)] + BridgePolkadotMessages(runtime_types::pallet_bridge_messages::pallet::Event), + #[codec(index = 255)] + Sudo(runtime_types::pallet_sudo::pallet::Event), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct ValidateSigned; @@ -1232,10 +1267,36 @@ pub mod api { PrimaryAndSecondaryVRFSlots, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct BabeConfiguration { + pub slot_duration: ::core::primitive::u64, + pub epoch_length: ::core::primitive::u64, + pub c: (::core::primitive::u64, ::core::primitive::u64), + pub authorities: ::std::vec::Vec<( + runtime_types::sp_consensus_babe::app::Public, + ::core::primitive::u64, + )>, + pub randomness: [::core::primitive::u8; 32usize], + pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct BabeEpochConfiguration { pub c: (::core::primitive::u64, ::core::primitive::u64), pub allowed_slots: runtime_types::sp_consensus_babe::AllowedSlots, } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Epoch { + pub epoch_index: ::core::primitive::u64, + pub start_slot: runtime_types::sp_consensus_slots::Slot, + pub duration: ::core::primitive::u64, + pub authorities: ::std::vec::Vec<( + runtime_types::sp_consensus_babe::app::Public, + ::core::primitive::u64, + )>, + pub randomness: [::core::primitive::u8; 32usize], + pub config: runtime_types::sp_consensus_babe::BabeEpochConfiguration, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct OpaqueKeyOwnershipProof(pub ::std::vec::Vec<::core::primitive::u8>); } pub mod sp_consensus_grandpa { use super::runtime_types; @@ -1265,6 +1326,8 @@ pub mod api { >, ), } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct OpaqueKeyOwnershipProof(pub ::std::vec::Vec<::core::primitive::u8>); } pub mod sp_consensus_slots { use super::runtime_types; @@ -1319,11 +1382,37 @@ pub mod api { #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub struct Signature(pub [::core::primitive::u8; 64usize]); } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct OpaqueMetadata(pub ::std::vec::Vec<::core::primitive::u8>); + } + pub mod sp_inherents { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct CheckInherentsResult { + pub okay: ::core::primitive::bool, + pub fatal_error: ::core::primitive::bool, + pub errors: runtime_types::sp_inherents::InherentData, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct InherentData { + pub data: ::subxt::utils::KeyedVec< + [::core::primitive::u8; 8usize], + ::std::vec::Vec<::core::primitive::u8>, + >, + } } pub mod sp_runtime { use super::runtime_types; pub mod generic { use super::runtime_types; + pub mod block { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct Block<_0, _1> { + pub header: _0, + pub extrinsics: ::std::vec::Vec<_1>, + } + } pub mod digest { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -1349,13 +1438,66 @@ pub mod api { RuntimeEnvironmentUpdated, } } - pub mod unchecked_extrinsic { - use super::runtime_types; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct UncheckedExtrinsic<_0, _1, _2, _3>( - pub ::std::vec::Vec<::core::primitive::u8>, - #[codec(skip)] pub ::core::marker::PhantomData<(_1, _0, _2, _3)>, - ); + } + pub mod transaction_validity { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum InvalidTransaction { + #[codec(index = 0)] + Call, + #[codec(index = 1)] + Payment, + #[codec(index = 2)] + Future, + #[codec(index = 3)] + Stale, + #[codec(index = 4)] + BadProof, + #[codec(index = 5)] + AncientBirthBlock, + #[codec(index = 6)] + ExhaustsResources, + #[codec(index = 7)] + Custom(::core::primitive::u8), + #[codec(index = 8)] + BadMandatory, + #[codec(index = 9)] + MandatoryValidation, + #[codec(index = 10)] + BadSigner, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum TransactionSource { + #[codec(index = 0)] + InBlock, + #[codec(index = 1)] + Local, + #[codec(index = 2)] + External, + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum TransactionValidityError { + #[codec(index = 0)] + Invalid(runtime_types::sp_runtime::transaction_validity::InvalidTransaction), + #[codec(index = 1)] + Unknown(runtime_types::sp_runtime::transaction_validity::UnknownTransaction), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub enum UnknownTransaction { + #[codec(index = 0)] + CannotLookup, + #[codec(index = 1)] + NoUnsignedValidator, + #[codec(index = 2)] + Custom(::core::primitive::u8), + } + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct ValidTransaction { + pub priority: ::core::primitive::u64, + pub requires: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + pub provides: ::std::vec::Vec<::std::vec::Vec<::core::primitive::u8>>, + pub longevity: ::core::primitive::u64, + pub propagate: ::core::primitive::bool, } } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] diff --git a/relays/client-polkadot-bulletin/src/lib.rs b/relays/client-polkadot-bulletin/src/lib.rs index 09fb7863a8b1c..56dd7b487f55f 100644 --- a/relays/client-polkadot-bulletin/src/lib.rs +++ b/relays/client-polkadot-bulletin/src/lib.rs @@ -44,7 +44,7 @@ pub type BridgePolkadotGrandpaCall = runtime_types::pallet_bridge_grandpa::palle /// Call of the with-PolkadotBridgeHub bridge parachains pallet. pub type BridgePolkadotParachainsCall = runtime_types::pallet_bridge_parachains::pallet::Call; /// Call of the with-PolkadotBridgeHub bridge messages pallet. -pub type BridgePolkadotBridgeHubMessagesCall = runtime_types::pallet_bridge_messages::pallet::Call; +pub type BridgePolkadotMessagesCall = runtime_types::pallet_bridge_messages::pallet::Call; /// Polkadot header id. pub type HeaderId = diff --git a/relays/client-substrate/src/chain.rs b/relays/client-substrate/src/chain.rs index 42d1c358c0a34..ced25fe8ddb26 100644 --- a/relays/client-substrate/src/chain.rs +++ b/relays/client-substrate/src/chain.rs @@ -169,6 +169,24 @@ impl UnsignedTransaction { Self { call, nonce, era: TransactionEra::Immortal, tip: Zero::zero() } } + /// Convert to the transaction of the other compatible chain. + pub fn switch_chain(self) -> UnsignedTransaction + where + Other: Chain< + Nonce = C::Nonce, + Balance = C::Balance, + BlockNumber = C::BlockNumber, + Hash = C::Hash, + >, + { + UnsignedTransaction { + call: EncodedOrDecodedCall::Encoded(self.call.into_encoded()), + nonce: self.nonce, + tip: self.tip, + era: self.era, + } + } + /// Set transaction tip. #[must_use] pub fn tip(mut self, tip: C::Balance) -> Self { diff --git a/tools/runtime-codegen/src/main.rs b/tools/runtime-codegen/src/main.rs index 4202cb2ae9292..d7a722b09c998 100644 --- a/tools/runtime-codegen/src/main.rs +++ b/tools/runtime-codegen/src/main.rs @@ -137,8 +137,12 @@ fn main() -> color_eyre::Result<()> { TypeSubstitute::simple("bp_header_chain::InitializationData"), TypeSubstitute::simple("bp_polkadot_core::parachains::ParaId"), TypeSubstitute::simple("bp_polkadot_core::parachains::ParaHeadsProof"), - TypeSubstitute::simple("bp_messages::target_chain::FromBridgedChainMessagesProof"), - TypeSubstitute::simple("bp_messages::source_chain::FromBridgedChainMessagesDeliveryProof"), + TypeSubstitute::simple( + "bridge_runtime_common::messages::target::FromBridgedChainMessagesProof", + ), + TypeSubstitute::simple( + "bridge_runtime_common::messages::source::FromBridgedChainMessagesDeliveryProof", + ), TypeSubstitute::simple("bp_messages::UnrewardedRelayersState"), TypeSubstitute::custom( "sp_runtime::generic::digest::Digest",