diff --git a/Cargo.lock b/Cargo.lock index 567c8b164e..2fcced629d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7950,9 +7950,9 @@ checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" [[package]] name = "serde" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a" dependencies = [ "serde_derive", ] @@ -7968,9 +7968,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.199" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc" dependencies = [ "proc-macro2 1.0.81", "quote 1.0.36", @@ -9329,7 +9329,7 @@ dependencies = [ [[package]] name = "substrate-relay" -version = "1.4.0" +version = "1.5.0" dependencies = [ "anyhow", "async-std", diff --git a/Cargo.toml b/Cargo.toml index 2fe9952f99..6111650666 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,6 @@ complexity = { level = "deny", priority = 1 } [workspace.dependencies] log = { version = "0.4.20", default-features = false } quote = { version = "1.0.36" } -serde = { version = "1.0.197", default-features = false } +serde = { version = "1.0.199", default-features = false } serde_json = { version = "1.0.115", default-features = false } thiserror = { version = "1.0.59" } diff --git a/relay-clients/client-bridge-hub-kusama/src/lib.rs b/relay-clients/client-bridge-hub-kusama/src/lib.rs index e3bb199389..e16188044d 100644 --- a/relay-clients/client-bridge-hub-kusama/src/lib.rs +++ b/relay-clients/client-bridge-hub-kusama/src/lib.rs @@ -54,6 +54,8 @@ impl Chain for BridgeHubKusama { bp_bridge_hub_kusama::BEST_FINALIZED_BRIDGE_HUB_KUSAMA_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_bridge_hub_kusama::BRIDGE_HUB_KUSAMA_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_bridge_hub_kusama::FREE_HEADERS_INTERVAL_FOR_BRIDGE_HUB_KUSAMA_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = AVERAGE_BLOCK_INTERVAL; type SignedBlock = bp_bridge_hub_kusama::SignedBlock; diff --git a/relay-clients/client-bridge-hub-polkadot/src/lib.rs b/relay-clients/client-bridge-hub-polkadot/src/lib.rs index 5d9c9aeabc..fb02deb5a7 100644 --- a/relay-clients/client-bridge-hub-polkadot/src/lib.rs +++ b/relay-clients/client-bridge-hub-polkadot/src/lib.rs @@ -58,6 +58,8 @@ impl Chain for BridgeHubPolkadot { bp_bridge_hub_polkadot::BEST_FINALIZED_BRIDGE_HUB_POLKADOT_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_bridge_hub_polkadot::BRIDGE_HUB_POLKADOT_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_bridge_hub_polkadot::FREE_HEADERS_INTERVAL_FOR_BRIDGE_HUB_POLKADOT_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = AVERAGE_BLOCK_INTERVAL; type SignedBlock = bp_bridge_hub_polkadot::SignedBlock; diff --git a/relay-clients/client-bridge-hub-rococo/src/codegen_runtime.rs b/relay-clients/client-bridge-hub-rococo/src/codegen_runtime.rs index e5c7c8b3e7..5b49b79c39 100644 --- a/relay-clients/client-bridge-hub-rococo/src/codegen_runtime.rs +++ b/relay-clients/client-bridge-hub-rococo/src/codegen_runtime.rs @@ -330,7 +330,7 @@ pub mod api { ), #[codec(index = 83)] EthereumSystem(runtime_types::snowbridge_pallet_system::pallet::Call), - #[codec(index = 250)] + #[codec(index = 175)] MessageQueue(runtime_types::pallet_message_queue::pallet::Call), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -379,7 +379,7 @@ pub mod api { ), #[codec(index = 83)] EthereumSystem(runtime_types::snowbridge_pallet_system::pallet::Error), - #[codec(index = 250)] + #[codec(index = 175)] MessageQueue(runtime_types::pallet_message_queue::pallet::Error), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -432,7 +432,7 @@ pub mod api { ), #[codec(index = 83)] EthereumSystem(runtime_types::snowbridge_pallet_system::pallet::Event), - #[codec(index = 250)] + #[codec(index = 175)] MessageQueue(runtime_types::pallet_message_queue::pallet::Event), } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -444,6 +444,18 @@ pub mod api { } pub mod bridge_runtime_common { use super::runtime_types; + pub mod extensions { + use super::runtime_types; + pub mod refund_relayer_extension { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct RefundBridgedGrandpaMessages; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct RefundBridgedMessages; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct RefundTransactionExtensionAdapter<_0>(pub _0); + } + } pub mod messages_xcm_extension { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -456,15 +468,6 @@ pub mod api { NotDispatched, } } - pub mod refund_relayer_extension { - use super::runtime_types; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct RefundBridgedGrandpaMessages; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct RefundBridgedParachainMessages; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct RefundTransactionExtensionAdapter<_0>(pub _0); - } } pub mod cumulus_pallet_parachain_system { use super::runtime_types; @@ -859,8 +862,10 @@ pub mod api { #[codec(index = 5)] CallFiltered, #[codec(index = 6)] - NothingAuthorized, + MultiBlockMigrationsOngoing, #[codec(index = 7)] + NothingAuthorized, + #[codec(index = 8)] Unauthorized, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -1192,6 +1197,7 @@ pub mod api { >, >, current_set_id: ::core::primitive::u64, + is_free_execution_expected: ::core::primitive::bool, }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -1241,6 +1247,7 @@ pub mod api { >, >, current_set_id: ::core::primitive::u64, + is_free_execution_expected: ::core::primitive::bool, }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -1263,6 +1270,10 @@ pub mod api { BridgeModule(runtime_types::bp_runtime::OwnedBridgeModuleError), #[codec(index = 8)] InvalidAuthoritySetId, + #[codec(index = 9)] + FreeHeadersLimitExceded, + #[codec(index = 10)] + BelowFreeHeaderInterval, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error2 { @@ -1284,6 +1295,10 @@ pub mod api { BridgeModule(runtime_types::bp_runtime::OwnedBridgeModuleError), #[codec(index = 8)] InvalidAuthoritySetId, + #[codec(index = 9)] + FreeHeadersLimitExceded, + #[codec(index = 10)] + BelowFreeHeaderInterval, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { @@ -1399,6 +1414,16 @@ pub mod api { set_operating_mode { operating_mode: runtime_types::bp_runtime::BasicOperatingMode, }, + #[codec(index = 3)] + submit_parachain_heads_ex { + at_relay_block: (::core::primitive::u32, ::subxt::utils::H256), + parachains: ::std::vec::Vec<( + ::bp_polkadot_core::parachains::ParaId, + ::subxt::utils::H256, + )>, + parachain_heads_proof: ::bp_polkadot_core::parachains::ParaHeadsProof, + is_free_execution_expected: ::core::primitive::bool, + }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { @@ -2063,6 +2088,11 @@ pub mod api { fee_asset_item: ::core::primitive::u32, weight_limit: runtime_types::xcm::v3::WeightLimit, }, + #[codec(index = 12)] + claim_assets { + assets: ::std::boxed::Box, + beneficiary: ::std::boxed::Box, + }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { @@ -2251,6 +2281,8 @@ pub mod api { origin: runtime_types::staging_xcm::v4::location::Location, assets: runtime_types::xcm::VersionedAssets, }, + #[codec(index = 23)] + VersionMigrationFinished { version: ::core::primitive::u32 }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Origin { diff --git a/relay-clients/client-bridge-hub-rococo/src/lib.rs b/relay-clients/client-bridge-hub-rococo/src/lib.rs index b93dff3c3a..895188a1a7 100644 --- a/relay-clients/client-bridge-hub-rococo/src/lib.rs +++ b/relay-clients/client-bridge-hub-rococo/src/lib.rs @@ -56,6 +56,8 @@ impl Chain for BridgeHubRococo { bp_bridge_hub_rococo::BEST_FINALIZED_BRIDGE_HUB_ROCOCO_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_bridge_hub_rococo::BRIDGE_HUB_ROCOCO_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_bridge_hub_rococo::FREE_HEADERS_INTERVAL_FOR_BRIDGE_HUB_ROCOCO_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = AVERAGE_BLOCK_INTERVAL; type SignedBlock = bp_bridge_hub_rococo::SignedBlock; @@ -129,5 +131,5 @@ impl ChainWithMessages for BridgeHubRococo { impl ChainWithRuntimeVersion for BridgeHubRococo { const RUNTIME_VERSION: Option = - Some(SimpleRuntimeVersion { spec_version: 1_009_000, transaction_version: 4 }); + Some(SimpleRuntimeVersion { spec_version: 1_010_000, transaction_version: 4 }); } diff --git a/relay-clients/client-bridge-hub-westend/src/codegen_runtime.rs b/relay-clients/client-bridge-hub-westend/src/codegen_runtime.rs index 51d0b7f8c4..1bab176062 100644 --- a/relay-clients/client-bridge-hub-westend/src/codegen_runtime.rs +++ b/relay-clients/client-bridge-hub-westend/src/codegen_runtime.rs @@ -390,6 +390,16 @@ pub mod api { } pub mod bridge_runtime_common { use super::runtime_types; + pub mod extensions { + use super::runtime_types; + pub mod refund_relayer_extension { + use super::runtime_types; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct RefundBridgedMessages; + #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] + pub struct RefundTransactionExtensionAdapter<_0>(pub _0); + } + } pub mod messages_xcm_extension { use super::runtime_types; #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -402,13 +412,6 @@ pub mod api { NotDispatched, } } - pub mod refund_relayer_extension { - use super::runtime_types; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct RefundBridgedParachainMessages; - #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] - pub struct RefundTransactionExtensionAdapter<_0>(pub _0); - } } pub mod cumulus_pallet_parachain_system { use super::runtime_types; @@ -803,8 +806,10 @@ pub mod api { #[codec(index = 5)] CallFiltered, #[codec(index = 6)] - NothingAuthorized, + MultiBlockMigrationsOngoing, #[codec(index = 7)] + NothingAuthorized, + #[codec(index = 8)] Unauthorized, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -1136,6 +1141,7 @@ pub mod api { >, >, current_set_id: ::core::primitive::u64, + is_free_execution_expected: ::core::primitive::bool, }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] @@ -1158,6 +1164,10 @@ pub mod api { BridgeModule(runtime_types::bp_runtime::OwnedBridgeModuleError), #[codec(index = 8)] InvalidAuthoritySetId, + #[codec(index = 9)] + FreeHeadersLimitExceded, + #[codec(index = 10)] + BelowFreeHeaderInterval, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Event { @@ -1239,6 +1249,16 @@ pub mod api { set_operating_mode { operating_mode: runtime_types::bp_runtime::BasicOperatingMode, }, + #[codec(index = 3)] + submit_parachain_heads_ex { + at_relay_block: (::core::primitive::u32, ::subxt::utils::H256), + parachains: ::std::vec::Vec<( + ::bp_polkadot_core::parachains::ParaId, + ::subxt::utils::H256, + )>, + parachain_heads_proof: ::bp_polkadot_core::parachains::ParaHeadsProof, + is_free_execution_expected: ::core::primitive::bool, + }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { @@ -1903,6 +1923,11 @@ pub mod api { fee_asset_item: ::core::primitive::u32, weight_limit: runtime_types::xcm::v3::WeightLimit, }, + #[codec(index = 12)] + claim_assets { + assets: ::std::boxed::Box, + beneficiary: ::std::boxed::Box, + }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Error { @@ -2091,6 +2116,8 @@ pub mod api { origin: runtime_types::staging_xcm::v4::location::Location, assets: runtime_types::xcm::VersionedAssets, }, + #[codec(index = 23)] + VersionMigrationFinished { version: ::core::primitive::u32 }, } #[derive(:: codec :: Decode, :: codec :: Encode, Clone, Debug, PartialEq)] pub enum Origin { diff --git a/relay-clients/client-bridge-hub-westend/src/lib.rs b/relay-clients/client-bridge-hub-westend/src/lib.rs index dfa288901d..27f2917826 100644 --- a/relay-clients/client-bridge-hub-westend/src/lib.rs +++ b/relay-clients/client-bridge-hub-westend/src/lib.rs @@ -54,6 +54,8 @@ impl Chain for BridgeHubWestend { bp_bridge_hub_westend::BEST_FINALIZED_BRIDGE_HUB_WESTEND_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_bridge_hub_westend::BRIDGE_HUB_WESTEND_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_bridge_hub_westend::FREE_HEADERS_INTERVAL_FOR_BRIDGE_HUB_WESTEND_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = AVERAGE_BLOCK_INTERVAL; type SignedBlock = bp_bridge_hub_westend::SignedBlock; @@ -127,5 +129,5 @@ impl ChainWithMessages for BridgeHubWestend { impl ChainWithRuntimeVersion for BridgeHubWestend { const RUNTIME_VERSION: Option = - Some(SimpleRuntimeVersion { spec_version: 1_009_000, transaction_version: 4 }); + Some(SimpleRuntimeVersion { spec_version: 1_010_000, transaction_version: 4 }); } diff --git a/relay-clients/client-kusama/src/lib.rs b/relay-clients/client-kusama/src/lib.rs index e46801062e..483d1dbfb5 100644 --- a/relay-clients/client-kusama/src/lib.rs +++ b/relay-clients/client-kusama/src/lib.rs @@ -60,6 +60,8 @@ impl Chain for Kusama { bp_kusama::BEST_FINALIZED_KUSAMA_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_kusama::KUSAMA_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_kusama::FREE_HEADERS_INTERVAL_FOR_KUSAMA_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6); type SignedBlock = bp_kusama::SignedBlock; @@ -81,6 +83,8 @@ impl ChainWithBalances for Kusama { impl RelayChain for Kusama { const PARAS_PALLET_NAME: &'static str = bp_kusama::PARAS_PALLET_NAME; + const WITH_CHAIN_BRIDGE_PARACHAINS_PALLET_NAME: &'static str = + bp_kusama::WITH_KUSAMA_BRIDGE_PARACHAINS_PALLET_NAME; } impl ChainWithTransactions for Kusama { diff --git a/relay-clients/client-polkadot-bulletin/src/lib.rs b/relay-clients/client-polkadot-bulletin/src/lib.rs index 777ba26819..d16132d4a4 100644 --- a/relay-clients/client-polkadot-bulletin/src/lib.rs +++ b/relay-clients/client-polkadot-bulletin/src/lib.rs @@ -69,6 +69,8 @@ impl Chain for PolkadotBulletin { bp_polkadot_bulletin::BEST_FINALIZED_POLKADOT_BULLETIN_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_polkadot_bulletin::POLKADOT_BULLETIN_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_polkadot_bulletin::FREE_HEADERS_INTERVAL_FOR_POLKADOT_BULLETIN_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6); type SignedBlock = bp_polkadot_bulletin::SignedBlock; diff --git a/relay-clients/client-polkadot/src/lib.rs b/relay-clients/client-polkadot/src/lib.rs index 433d39d56e..9e396e2651 100644 --- a/relay-clients/client-polkadot/src/lib.rs +++ b/relay-clients/client-polkadot/src/lib.rs @@ -60,6 +60,8 @@ impl Chain for Polkadot { bp_polkadot::BEST_FINALIZED_POLKADOT_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_polkadot::POLKADOT_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_polkadot::FREE_HEADERS_INTERVAL_FOR_POLKADOT_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6); type SignedBlock = bp_polkadot::SignedBlock; @@ -81,6 +83,8 @@ impl ChainWithBalances for Polkadot { impl RelayChain for Polkadot { const PARAS_PALLET_NAME: &'static str = bp_polkadot::PARAS_PALLET_NAME; + const WITH_CHAIN_BRIDGE_PARACHAINS_PALLET_NAME: &'static str = + bp_polkadot::WITH_POLKADOT_BRIDGE_PARACHAINS_PALLET_NAME; } impl ChainWithTransactions for Polkadot { diff --git a/relay-clients/client-rococo/src/lib.rs b/relay-clients/client-rococo/src/lib.rs index 1e3c414865..14523ca66e 100644 --- a/relay-clients/client-rococo/src/lib.rs +++ b/relay-clients/client-rococo/src/lib.rs @@ -60,6 +60,8 @@ impl Chain for Rococo { bp_rococo::BEST_FINALIZED_ROCOCO_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_rococo::ROCOCO_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_rococo::FREE_HEADERS_INTERVAL_FOR_ROCOCO_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6); type SignedBlock = bp_rococo::SignedBlock; @@ -81,6 +83,8 @@ impl ChainWithBalances for Rococo { impl RelayChain for Rococo { const PARAS_PALLET_NAME: &'static str = bp_rococo::PARAS_PALLET_NAME; + const WITH_CHAIN_BRIDGE_PARACHAINS_PALLET_NAME: &'static str = + bp_rococo::WITH_ROCOCO_BRIDGE_PARACHAINS_PALLET_NAME; } impl ChainWithTransactions for Rococo { @@ -120,5 +124,5 @@ impl ChainWithTransactions for Rococo { impl ChainWithRuntimeVersion for Rococo { const RUNTIME_VERSION: Option = - Some(SimpleRuntimeVersion { spec_version: 1_009_000, transaction_version: 24 }); + Some(SimpleRuntimeVersion { spec_version: 1_010_000, transaction_version: 24 }); } diff --git a/relay-clients/client-westend/src/lib.rs b/relay-clients/client-westend/src/lib.rs index 557016c1bb..e4c99b4bb9 100644 --- a/relay-clients/client-westend/src/lib.rs +++ b/relay-clients/client-westend/src/lib.rs @@ -60,6 +60,8 @@ impl Chain for Westend { bp_westend::BEST_FINALIZED_WESTEND_HEADER_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = bp_westend::WESTEND_FINALITY_COMPATIBLE_RELAYER_VERSION; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + bp_westend::FREE_HEADERS_INTERVAL_FOR_WESTEND_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = Duration::from_secs(6); type SignedBlock = bp_westend::SignedBlock; @@ -75,6 +77,8 @@ impl ChainWithGrandpa for Westend { impl RelayChain for Westend { const PARAS_PALLET_NAME: &'static str = bp_westend::PARAS_PALLET_NAME; + const WITH_CHAIN_BRIDGE_PARACHAINS_PALLET_NAME: &'static str = + bp_westend::WITH_WESTEND_BRIDGE_PARACHAINS_PALLET_NAME; } impl ChainWithBalances for Westend { @@ -120,5 +124,5 @@ impl ChainWithTransactions for Westend { impl ChainWithRuntimeVersion for Westend { const RUNTIME_VERSION: Option = - Some(SimpleRuntimeVersion { spec_version: 1_009_000, transaction_version: 24 }); + Some(SimpleRuntimeVersion { spec_version: 1_010_000, transaction_version: 24 }); } diff --git a/substrate-relay/Cargo.toml b/substrate-relay/Cargo.toml index 03c33ae3c7..0cb4a13ddc 100644 --- a/substrate-relay/Cargo.toml +++ b/substrate-relay/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "substrate-relay" -version = "1.4.0" +version = "1.5.0" authors.workspace = true edition.workspace = true license = "GPL-3.0-or-later WITH Classpath-exception-2.0" diff --git a/substrate-relay/src/bridges/kusama_polkadot/kusama_parachains_to_bridge_hub_polkadot.rs b/substrate-relay/src/bridges/kusama_polkadot/kusama_parachains_to_bridge_hub_polkadot.rs index b2b75da7ec..ff0c27344e 100644 --- a/substrate-relay/src/bridges/kusama_polkadot/kusama_parachains_to_bridge_hub_polkadot.rs +++ b/substrate-relay/src/bridges/kusama_polkadot/kusama_parachains_to_bridge_hub_polkadot.rs @@ -46,6 +46,7 @@ impl SubmitParachainHeadsCallBuilder at_relay_block: HeaderIdOf, parachains: Vec<(ParaId, ParaHash)>, parachain_heads_proof: ParaHeadsProof, + _is_free_execution_expected: bool, ) -> CallOf { relay_bridge_hub_polkadot_client::RuntimeCall::BridgeKusamaParachains( relay_bridge_hub_polkadot_client::BridgeParachainCall::submit_parachain_heads { diff --git a/substrate-relay/src/bridges/kusama_polkadot/polkadot_parachains_to_bridge_hub_kusama.rs b/substrate-relay/src/bridges/kusama_polkadot/polkadot_parachains_to_bridge_hub_kusama.rs index 707aa77f95..d44bf96ab6 100644 --- a/substrate-relay/src/bridges/kusama_polkadot/polkadot_parachains_to_bridge_hub_kusama.rs +++ b/substrate-relay/src/bridges/kusama_polkadot/polkadot_parachains_to_bridge_hub_kusama.rs @@ -46,6 +46,7 @@ impl SubmitParachainHeadsCallBuilder at_relay_block: HeaderIdOf, parachains: Vec<(ParaId, ParaHash)>, parachain_heads_proof: ParaHeadsProof, + _is_free_execution_expected: bool, ) -> CallOf { relay_bridge_hub_kusama_client::RuntimeCall::BridgePolkadotParachains( relay_bridge_hub_kusama_client::BridgeParachainCall::submit_parachain_heads { diff --git a/substrate-relay/src/bridges/polkadot_bulletin/polkadot_parachains_to_polkadot_bulletin.rs b/substrate-relay/src/bridges/polkadot_bulletin/polkadot_parachains_to_polkadot_bulletin.rs index 330012b6aa..f0161ac4ef 100644 --- a/substrate-relay/src/bridges/polkadot_bulletin/polkadot_parachains_to_polkadot_bulletin.rs +++ b/substrate-relay/src/bridges/polkadot_bulletin/polkadot_parachains_to_polkadot_bulletin.rs @@ -50,6 +50,7 @@ impl SubmitParachainHeadsCallBuilder at_relay_block: HeaderIdOf, parachains: Vec<(ParaId, ParaHash)>, parachain_heads_proof: ParaHeadsProof, + _is_free_execution_expected: bool, ) -> CallOf { relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotParachains( relay_polkadot_bulletin_client::BridgePolkadotParachainsCall::submit_parachain_heads { diff --git a/substrate-relay/src/bridges/rococo_bulletin/mod.rs b/substrate-relay/src/bridges/rococo_bulletin/mod.rs index a1c11a189f..887e7b6693 100644 --- a/substrate-relay/src/bridges/rococo_bulletin/mod.rs +++ b/substrate-relay/src/bridges/rococo_bulletin/mod.rs @@ -84,6 +84,8 @@ impl relay_substrate_client::Chain for RococoAsPolkadot { relay_polkadot_client::Polkadot::BEST_FINALIZED_HEADER_ID_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = relay_polkadot_client::Polkadot::WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + relay_polkadot_client::Polkadot::FREE_HEADERS_INTERVAL_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = relay_rococo_client::Rococo::AVERAGE_BLOCK_INTERVAL; type SignedBlock = ::SignedBlock; @@ -106,6 +108,8 @@ impl relay_substrate_client::ChainWithBalances for RococoAsPolkadot { impl relay_substrate_client::RelayChain for RococoAsPolkadot { const PARAS_PALLET_NAME: &'static str = relay_rococo_client::Rococo::PARAS_PALLET_NAME; + const WITH_CHAIN_BRIDGE_PARACHAINS_PALLET_NAME: &'static str = + relay_rococo_client::Rococo::WITH_CHAIN_BRIDGE_PARACHAINS_PALLET_NAME; } impl relay_substrate_client::ChainWithTransactions for RococoAsPolkadot { @@ -159,6 +163,7 @@ impl bp_runtime::Chain for BaseBridgeHubRococoAsBridgeHubPolkadot { impl bp_runtime::Parachain for BaseBridgeHubRococoAsBridgeHubPolkadot { const PARACHAIN_ID: u32 = bp_bridge_hub_rococo::BridgeHubRococo::PARACHAIN_ID; + const MAX_HEADER_SIZE: u32 = bp_bridge_hub_rococo::BridgeHubRococo::MAX_HEADER_SIZE; } impl bp_messages::ChainWithMessages for BaseBridgeHubRococoAsBridgeHubPolkadot { @@ -185,6 +190,8 @@ impl relay_substrate_client::Chain for BridgeHubRococoAsBridgeHubPolkadot { relay_bridge_hub_polkadot_client::BridgeHubPolkadot::BEST_FINALIZED_HEADER_ID_METHOD; const WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD: &'static str = relay_bridge_hub_rococo_client::BridgeHubRococo::WITH_CHAIN_COMPATIBLE_FINALITY_RELAYER_VERSION_METHOD; + const FREE_HEADERS_INTERVAL_METHOD: &'static str = + relay_bridge_hub_polkadot_client::BridgeHubPolkadot::FREE_HEADERS_INTERVAL_METHOD; const AVERAGE_BLOCK_INTERVAL: Duration = relay_bridge_hub_rococo_client::BridgeHubRococo::AVERAGE_BLOCK_INTERVAL; diff --git a/substrate-relay/src/bridges/rococo_bulletin/rococo_parachains_to_rococo_bulletin.rs b/substrate-relay/src/bridges/rococo_bulletin/rococo_parachains_to_rococo_bulletin.rs index 82b944ec74..ce858746cf 100644 --- a/substrate-relay/src/bridges/rococo_bulletin/rococo_parachains_to_rococo_bulletin.rs +++ b/substrate-relay/src/bridges/rococo_bulletin/rococo_parachains_to_rococo_bulletin.rs @@ -47,6 +47,7 @@ impl SubmitParachainHeadsCallBuilder for RococoToRococoB at_relay_block: HeaderIdOf, parachains: Vec<(ParaId, ParaHash)>, parachain_heads_proof: ParaHeadsProof, + _is_free_execution_expected: bool, ) -> CallOf { relay_polkadot_bulletin_client::RuntimeCall::BridgePolkadotParachains( relay_polkadot_bulletin_client::BridgePolkadotParachainsCall::submit_parachain_heads { diff --git a/substrate-relay/src/bridges/rococo_westend/bridge_hub_rococo_messages_to_bridge_hub_westend.rs b/substrate-relay/src/bridges/rococo_westend/bridge_hub_rococo_messages_to_bridge_hub_westend.rs index 37b15f9883..ce98591728 100644 --- a/substrate-relay/src/bridges/rococo_westend/bridge_hub_rococo_messages_to_bridge_hub_westend.rs +++ b/substrate-relay/src/bridges/rococo_westend/bridge_hub_rococo_messages_to_bridge_hub_westend.rs @@ -17,10 +17,8 @@ //! BridgeHubRococo-to-BridgeHubWestend messages sync entrypoint. use bp_runtime::RelayerVersion; -use hex_literal::hex; use relay_bridge_hub_rococo_client::BridgeHubRococo; use relay_bridge_hub_westend_client::BridgeHubWestend; -use sp_core::H256; use substrate_relay_helper::{ cli::bridge::{CliBridgeBase, MessagesCliBridge}, messages_lane::SubstrateMessageLane, diff --git a/substrate-relay/src/bridges/rococo_westend/bridge_hub_westend_messages_to_bridge_hub_rococo.rs b/substrate-relay/src/bridges/rococo_westend/bridge_hub_westend_messages_to_bridge_hub_rococo.rs index 273f443fab..a7ec72a592 100644 --- a/substrate-relay/src/bridges/rococo_westend/bridge_hub_westend_messages_to_bridge_hub_rococo.rs +++ b/substrate-relay/src/bridges/rococo_westend/bridge_hub_westend_messages_to_bridge_hub_rococo.rs @@ -17,10 +17,8 @@ //! BridgeHubWestend-to-BridgeHubRococo messages sync entrypoint. use bp_runtime::RelayerVersion; -use hex_literal::hex; use relay_bridge_hub_rococo_client::BridgeHubRococo; use relay_bridge_hub_westend_client::BridgeHubWestend; -use sp_core::H256; use substrate_relay_helper::{ cli::bridge::{CliBridgeBase, MessagesCliBridge}, messages_lane::SubstrateMessageLane, diff --git a/substrate-relay/src/bridges/rococo_westend/rococo_headers_to_bridge_hub_westend.rs b/substrate-relay/src/bridges/rococo_westend/rococo_headers_to_bridge_hub_westend.rs index 2350b10af5..7054bec392 100644 --- a/substrate-relay/src/bridges/rococo_westend/rococo_headers_to_bridge_hub_westend.rs +++ b/substrate-relay/src/bridges/rococo_westend/rococo_headers_to_bridge_hub_westend.rs @@ -18,8 +18,6 @@ use async_trait::async_trait; use bp_runtime::RelayerVersion; -use hex_literal::hex; -use sp_core::H256; use substrate_relay_helper::{ equivocation::SubstrateEquivocationDetectionPipeline, finality::SubstrateFinalitySyncPipeline, diff --git a/substrate-relay/src/bridges/rococo_westend/rococo_parachains_to_bridge_hub_westend.rs b/substrate-relay/src/bridges/rococo_westend/rococo_parachains_to_bridge_hub_westend.rs index 7e199ffdf6..e0f27b7c3e 100644 --- a/substrate-relay/src/bridges/rococo_westend/rococo_parachains_to_bridge_hub_westend.rs +++ b/substrate-relay/src/bridges/rococo_westend/rococo_parachains_to_bridge_hub_westend.rs @@ -18,9 +18,7 @@ use bp_polkadot_core::parachains::{ParaHash, ParaHeadsProof, ParaId}; use bp_runtime::RelayerVersion; -use hex_literal::hex; use relay_substrate_client::{CallOf, HeaderIdOf}; -use sp_core::H256; use substrate_relay_helper::{ cli::bridge::{CliBridgeBase, MessagesCliBridge, ParachainToRelayHeadersCliBridge}, parachains::{SubmitParachainHeadsCallBuilder, SubstrateParachainsPipeline}, @@ -48,12 +46,14 @@ impl SubmitParachainHeadsCallBuilder at_relay_block: HeaderIdOf, parachains: Vec<(ParaId, ParaHash)>, parachain_heads_proof: ParaHeadsProof, + is_free_execution_expected: bool, ) -> CallOf { relay_bridge_hub_westend_client::RuntimeCall::BridgeRococoParachains( - relay_bridge_hub_westend_client::BridgeParachainCall::submit_parachain_heads { + relay_bridge_hub_westend_client::BridgeParachainCall::submit_parachain_heads_ex { at_relay_block: (at_relay_block.0, at_relay_block.1), parachains, parachain_heads_proof, + is_free_execution_expected, }, ) } diff --git a/substrate-relay/src/bridges/rococo_westend/westend_headers_to_bridge_hub_rococo.rs b/substrate-relay/src/bridges/rococo_westend/westend_headers_to_bridge_hub_rococo.rs index fea650f9b1..4748d2b6a7 100644 --- a/substrate-relay/src/bridges/rococo_westend/westend_headers_to_bridge_hub_rococo.rs +++ b/substrate-relay/src/bridges/rococo_westend/westend_headers_to_bridge_hub_rococo.rs @@ -18,8 +18,6 @@ use async_trait::async_trait; use bp_runtime::RelayerVersion; -use hex_literal::hex; -use sp_core::H256; use substrate_relay_helper::{ equivocation::SubstrateEquivocationDetectionPipeline, finality::SubstrateFinalitySyncPipeline, diff --git a/substrate-relay/src/bridges/rococo_westend/westend_parachains_to_bridge_hub_rococo.rs b/substrate-relay/src/bridges/rococo_westend/westend_parachains_to_bridge_hub_rococo.rs index 79508ea420..8785eeeb77 100644 --- a/substrate-relay/src/bridges/rococo_westend/westend_parachains_to_bridge_hub_rococo.rs +++ b/substrate-relay/src/bridges/rococo_westend/westend_parachains_to_bridge_hub_rococo.rs @@ -18,9 +18,7 @@ use bp_polkadot_core::parachains::{ParaHash, ParaHeadsProof, ParaId}; use bp_runtime::RelayerVersion; -use hex_literal::hex; use relay_substrate_client::{CallOf, HeaderIdOf}; -use sp_core::H256; use substrate_relay_helper::{ cli::bridge::{CliBridgeBase, MessagesCliBridge, ParachainToRelayHeadersCliBridge}, parachains::{SubmitParachainHeadsCallBuilder, SubstrateParachainsPipeline}, @@ -48,12 +46,14 @@ impl SubmitParachainHeadsCallBuilder at_relay_block: HeaderIdOf, parachains: Vec<(ParaId, ParaHash)>, parachain_heads_proof: ParaHeadsProof, + is_free_execution_expected: bool, ) -> CallOf { relay_bridge_hub_rococo_client::RuntimeCall::BridgeWestendParachains( - relay_bridge_hub_rococo_client::BridgeParachainCall::submit_parachain_heads { + relay_bridge_hub_rococo_client::BridgeParachainCall::submit_parachain_heads_ex { at_relay_block: (at_relay_block.0, at_relay_block.1), parachains, parachain_heads_proof, + is_free_execution_expected, }, ) } diff --git a/substrate-relay/src/cli/mod.rs b/substrate-relay/src/cli/mod.rs index 504058894c..9eff263ebf 100644 --- a/substrate-relay/src/cli/mod.rs +++ b/substrate-relay/src/cli/mod.rs @@ -51,6 +51,8 @@ pub enum Command { /// The on-chain bridge component should have been already initialized with /// `init-bridge` sub-command. RelayHeaders(relay_headers::RelayHeaders), + /// Relay single header. + RelayHeader(relay_headers::RelayHeader), /// Relay parachain heads. RelayParachains(relay_parachains::RelayParachains), /// Start messages relay between two chains. @@ -95,6 +97,7 @@ impl Command { match self { Self::InitBridge(arg) => arg.run().await?, Self::RelayHeaders(arg) => arg.run().await?, + Self::RelayHeader(arg) => arg.run().await?, Self::RelayParachains(arg) => arg.run().await?, Self::RelayMessages(arg) => arg.run().await?, Self::RelayHeadersAndMessages(arg) => arg.run().await?, diff --git a/substrate-relay/src/cli/relay_headers.rs b/substrate-relay/src/cli/relay_headers.rs index e244d0e9a2..4a3c36dd55 100644 --- a/substrate-relay/src/cli/relay_headers.rs +++ b/substrate-relay/src/cli/relay_headers.rs @@ -30,9 +30,15 @@ use crate::bridges::{ 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, + }, }; -use substrate_relay_helper::cli::relay_headers::{HeadersRelayer, RelayHeadersParams}; +use substrate_relay_helper::cli::relay_headers::{ + HeadersRelayer, RelayHeaderParams, RelayHeadersParams, +}; /// Start headers relayer process. #[derive(StructOpt)] @@ -44,10 +50,22 @@ pub struct RelayHeaders { params: RelayHeadersParams, } +/// Relay single header. +#[derive(StructOpt)] +pub struct RelayHeader { + /// A bridge instance to relay headers for. + #[structopt(possible_values = RelayHeadersBridge::VARIANTS, case_insensitive = true)] + bridge: RelayHeadersBridge, + #[structopt(flatten)] + params: RelayHeaderParams, +} + #[derive(Debug, EnumString, VariantNames)] #[strum(serialize_all = "kebab_case")] /// Headers relay bridge. pub enum RelayHeadersBridge { + RococoToBridgeHubWestend, + WestendToBridgeHubRococo, KusamaToBridgeHubPolkadot, PolkadotToBridgeHubKusama, PolkadotToPolkadotBulletin, @@ -56,6 +74,8 @@ pub enum RelayHeadersBridge { RococoBulletinToBridgeHubRococo, } +impl HeadersRelayer for RococoToBridgeHubWestendCliBridge {} +impl HeadersRelayer for WestendToBridgeHubRococoCliBridge {} impl HeadersRelayer for KusamaToBridgeHubPolkadotCliBridge {} impl HeadersRelayer for PolkadotToBridgeHubKusamaCliBridge {} impl HeadersRelayer for PolkadotToPolkadotBulletinCliBridge {} @@ -67,6 +87,10 @@ impl RelayHeaders { /// Run the command. pub async fn run(self) -> anyhow::Result<()> { match self.bridge { + RelayHeadersBridge::RococoToBridgeHubWestend => + RococoToBridgeHubWestendCliBridge::relay_headers(self.params), + RelayHeadersBridge::WestendToBridgeHubRococo => + WestendToBridgeHubRococoCliBridge::relay_headers(self.params), RelayHeadersBridge::KusamaToBridgeHubPolkadot => KusamaToBridgeHubPolkadotCliBridge::relay_headers(self.params), RelayHeadersBridge::PolkadotToBridgeHubKusama => @@ -83,3 +107,28 @@ impl RelayHeaders { .await } } + +impl RelayHeader { + /// Run the command. + pub async fn run(self) -> anyhow::Result<()> { + match self.bridge { + RelayHeadersBridge::RococoToBridgeHubWestend => + RococoToBridgeHubWestendCliBridge::relay_header(self.params), + RelayHeadersBridge::WestendToBridgeHubRococo => + WestendToBridgeHubRococoCliBridge::relay_header(self.params), + RelayHeadersBridge::KusamaToBridgeHubPolkadot => + KusamaToBridgeHubPolkadotCliBridge::relay_header(self.params), + RelayHeadersBridge::PolkadotToBridgeHubKusama => + PolkadotToBridgeHubKusamaCliBridge::relay_header(self.params), + RelayHeadersBridge::PolkadotToPolkadotBulletin => + PolkadotToPolkadotBulletinCliBridge::relay_header(self.params), + RelayHeadersBridge::PolkadotBulletinToBridgeHubPolkadot => + PolkadotBulletinToBridgeHubPolkadotCliBridge::relay_header(self.params), + RelayHeadersBridge::RococoToRococoBulletin => + RococoToRococoBulletinCliBridge::relay_header(self.params), + RelayHeadersBridge::RococoBulletinToBridgeHubRococo => + RococoBulletinToBridgeHubRococoCliBridge::relay_header(self.params), + } + .await + } +} diff --git a/substrate-relay/src/cli/relay_headers_and_messages.rs b/substrate-relay/src/cli/relay_headers_and_messages.rs index dfd5e8caf5..3987765788 100644 --- a/substrate-relay/src/cli/relay_headers_and_messages.rs +++ b/substrate-relay/src/cli/relay_headers_and_messages.rs @@ -309,6 +309,7 @@ mod tests { shared: HeadersAndMessagesSharedParams { lane: vec![HexLaneId([0x00, 0x00, 0x00, 0x00])], only_mandatory_headers: false, + only_free_headers: false, prometheus_params: PrometheusParams { no_prometheus: false, prometheus_host: "0.0.0.0".into(),