From 7962c7ab96078b08d7a5bf3021c88f0cf3d3f9e8 Mon Sep 17 00:00:00 2001 From: ron Date: Thu, 30 Nov 2023 08:48:55 +0800 Subject: [PATCH 1/5] Rename control to system --- contracts/README.md | 2 +- docs/architecture/components.md | 2 +- parachain/Cargo.lock | 86 +- parachain/Cargo.toml | 4 +- parachain/pallets/outbound-queue/src/lib.rs | 27 +- .../pallets/{control => system}/Cargo.toml | 13 +- .../pallets/{control => system}/README.md | 0 .../runtime-api/Cargo.toml | 2 +- .../runtime-api/src/lib.rs | 0 .../pallets/{control => system}/src/api.rs | 0 .../{control => system}/src/benchmarking.rs | 0 .../pallets/{control => system}/src/lib.rs | 0 .../pallets/{control => system}/src/mock.rs | 6 +- .../pallets/{control => system}/src/tests.rs | 96 +- .../{control => system}/src/weights.rs | 34 +- parachain/runtime/tests/Cargo.lock | 938 ++++++++++++++---- parachain/runtime/tests/Cargo.toml | 10 +- polkadot-sdk | 2 +- smoketest/src/helper.rs | 37 +- smoketest/tests/create_agent.rs | 2 +- smoketest/tests/create_channel.rs | 2 +- smoketest/tests/set_token_transfer_fees.rs | 6 +- smoketest/tests/transfer_native_from_agent.rs | 2 +- smoketest/tests/upgrade_gateway.rs | 8 +- 24 files changed, 890 insertions(+), 389 deletions(-) rename parachain/pallets/{control => system}/Cargo.toml (88%) rename parachain/pallets/{control => system}/README.md (100%) rename parachain/pallets/{control => system}/runtime-api/Cargo.toml (96%) rename parachain/pallets/{control => system}/runtime-api/src/lib.rs (100%) rename parachain/pallets/{control => system}/src/api.rs (100%) rename parachain/pallets/{control => system}/src/benchmarking.rs (100%) rename parachain/pallets/{control => system}/src/lib.rs (100%) rename parachain/pallets/{control => system}/src/mock.rs (98%) rename parachain/pallets/{control => system}/src/tests.rs (80%) rename parachain/pallets/{control => system}/src/weights.rs (90%) diff --git a/contracts/README.md b/contracts/README.md index 9174cb5b8b..aebdcaffd4 100644 --- a/contracts/README.md +++ b/contracts/README.md @@ -40,7 +40,7 @@ Agents are defined by the following contracts: * [Agent.sol](src/Agent.sol): Agent contract * [AgentExecutor.sol](src/AgentExecutor.sol): Code executed within an agent using `delegatecall` -The creation of new agents can be initiated by calling `EthereumControl::create_agent` extrinsic on the BridgeHub parachain. +The creation of new agents can be initiated by calling `EthereumSystem::create_agent` extrinsic on the BridgeHub parachain. ### BeefyClient diff --git a/docs/architecture/components.md b/docs/architecture/components.md index 88b1fbb383..699adb495a 100644 --- a/docs/architecture/components.md +++ b/docs/architecture/components.md @@ -53,7 +53,7 @@ More concretely, they have a number of purposes in the bridge design: * Users wanting to send outbound messages to Polkadot need to pay fees into the agent contract corresponding to the destination parachain * Relayers submitting messages to the Gateway are rewarded from the agent contract corresponding to the origin parachain. -The creation of new agents can be initiated permissionlessly by calling `EthereumControl::create_agent` extrinsic on the BridgeHub parachain. +The creation of new agents can be initiated permissionlessly by calling `EthereumSystem::create_agent` extrinsic on the BridgeHub parachain. ### BeefyClient diff --git a/parachain/Cargo.lock b/parachain/Cargo.lock index a6de042330..b028ad222f 100644 --- a/parachain/Cargo.lock +++ b/parachain/Cargo.lock @@ -729,6 +729,7 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", + "serde", "tap", "wyz", ] @@ -835,6 +836,7 @@ dependencies = [ "pallet-message-queue", "parity-scale-codec", "scale-info", + "snowbridge-core", "sp-runtime", "sp-std 8.0.0", "staging-xcm", @@ -1540,7 +1542,7 @@ dependencies = [ [[package]] name = "ethabi-decode" version = "1.3.3" -source = "git+https://github.com/Snowfork/ethabi-decode.git?branch=master#6f63405bb33ef4365a1c62b72d499fa0f448118e" +source = "git+https://github.com/snowfork/ethabi-decode.git?branch=master#6f63405bb33ef4365a1c62b72d499fa0f448118e" dependencies = [ "ethereum-types", "tiny-keccak 1.5.0", @@ -1794,6 +1796,7 @@ name = "frame-system" version = "4.0.0-dev" dependencies = [ "cfg-if", + "docify", "frame-support", "log", "parity-scale-codec", @@ -2706,6 +2709,7 @@ dependencies = [ name = "pallet-message-queue" version = "7.0.0-dev" dependencies = [ + "environmental", "frame-benchmarking", "frame-support", "frame-system", @@ -3718,46 +3722,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "snowbridge-control" -version = "4.0.0-dev" -dependencies = [ - "ethabi-decode", - "frame-benchmarking", - "frame-support", - "frame-system", - "hex", - "hex-literal", - "log", - "pallet-balances", - "pallet-message-queue", - "parity-scale-codec", - "polkadot-primitives", - "scale-info", - "snowbridge-core", - "snowbridge-outbound-queue", - "sp-core", - "sp-io", - "sp-keyring", - "sp-runtime", - "sp-std 8.0.0", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", -] - -[[package]] -name = "snowbridge-control-runtime-api" -version = "0.1.0" -dependencies = [ - "parity-scale-codec", - "snowbridge-core", - "sp-api", - "sp-core", - "sp-std 8.0.0", - "staging-xcm", -] - [[package]] name = "snowbridge-core" version = "0.1.1" @@ -3957,6 +3921,46 @@ dependencies = [ "staging-xcm-executor", ] +[[package]] +name = "snowbridge-system" +version = "0.1.1" +dependencies = [ + "ethabi-decode", + "frame-benchmarking", + "frame-support", + "frame-system", + "hex", + "hex-literal", + "log", + "pallet-balances", + "pallet-message-queue", + "parity-scale-codec", + "polkadot-primitives", + "scale-info", + "snowbridge-core", + "snowbridge-outbound-queue", + "sp-core", + "sp-io", + "sp-keyring", + "sp-runtime", + "sp-std 8.0.0", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "snowbridge-system-runtime-api" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "snowbridge-core", + "sp-api", + "sp-core", + "sp-std 8.0.0", + "staging-xcm", +] + [[package]] name = "sp-api" version = "4.0.0-dev" diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 4cef3fbebf..9858cd6324 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -10,7 +10,7 @@ members = [ "pallets/outbound-queue/runtime-api", "pallets/outbound-queue/merkle-tree", "pallets/ethereum-beacon-client", - "pallets/control", - "pallets/control/runtime-api", + "pallets/system", + "pallets/system/runtime-api", "runtime/runtime-common", ] diff --git a/parachain/pallets/outbound-queue/src/lib.rs b/parachain/pallets/outbound-queue/src/lib.rs index b4f30e7fdb..2188375965 100644 --- a/parachain/pallets/outbound-queue/src/lib.rs +++ b/parachain/pallets/outbound-queue/src/lib.rs @@ -5,29 +5,26 @@ //! # Overview //! //! Messages come either from sibling parachains via XCM, or BridgeHub itself -//! via the `snowbridge-control` pallet: +//! via the `snowbridge-system` pallet: //! //! 1. `snowbridge_router_primitives::outbound::EthereumBlobExporter::deliver` -//! 2. `snowbridge_control::Pallet::send` +//! 2. `snowbridge_system::Pallet::send` //! //! The message submission pipeline works like this: //! 1. The message is first validated via the implementation for //! [`snowbridge_core::outbound::SendMessage::validate`] -//! 2. The message is then enqueued for later processing via the implementation -//! for [`snowbridge_core::outbound::SendMessage::deliver`] +//! 2. The message is then enqueued for later processing via the implementation for +//! [`snowbridge_core::outbound::SendMessage::deliver`] //! 3. The underlying message queue is implemented by [`Config::MessageQueue`] -//! 4. The message queue delivers messages back to this pallet via -//! the implementation for [`frame_support::traits::ProcessMessage::process_message`] -//! 5. The message is processed in `Pallet::do_process_message`: -//! a. Assigned a nonce -//! b. ABI-encoded, hashed, and stored in the `MessageLeaves` vector -//! 6. At the end of the block, a merkle root is constructed from all the -//! leaves in `MessageLeaves`. +//! 4. The message queue delivers messages back to this pallet via the implementation for +//! [`frame_support::traits::ProcessMessage::process_message`] +//! 5. The message is processed in `Pallet::do_process_message`: a. Assigned a nonce b. ABI-encoded, +//! hashed, and stored in the `MessageLeaves` vector +//! 6. At the end of the block, a merkle root is constructed from all the leaves in `MessageLeaves`. //! 7. This merkle root is inserted into the parachain header as a digest item -//! 8. Offchain relayers are able to relay the message to Ethereum after: -//! a. Generating a merkle proof for the committed message using the `prove_message` -//! runtime API -//! b. Reading the actual message content from the `Messages` vector in storage +//! 8. Offchain relayers are able to relay the message to Ethereum after: a. Generating a merkle +//! proof for the committed message using the `prove_message` runtime API b. Reading the actual +//! message content from the `Messages` vector in storage //! //! On the Ethereum side, the message root is ultimately the thing being //! verified by the Polkadot light client. diff --git a/parachain/pallets/control/Cargo.toml b/parachain/pallets/system/Cargo.toml similarity index 88% rename from parachain/pallets/control/Cargo.toml rename to parachain/pallets/system/Cargo.toml index 8724a290a4..6a190e5e3e 100644 --- a/parachain/pallets/control/Cargo.toml +++ b/parachain/pallets/system/Cargo.toml @@ -1,13 +1,10 @@ [package] -name = "snowbridge-control" -version = "4.0.0-dev" -description = "FRAME pallet template for defining custom runtime logic." -authors = ["Substrate DevHub "] -homepage = "https://substrate.io" +name = "snowbridge-system" +version = "0.1.1" +description = "Snowbridge System" +authors = ["Snowfork "] edition = "2021" -license = "MIT-0" -publish = false -repository = "https://github.com/substrate-developer-hub/substrate-node-template/" +repository = "https://github.com/Snowfork/snowbridge" [package.metadata.docs.rs] targets = ["x86_64-unknown-linux-gnu"] diff --git a/parachain/pallets/control/README.md b/parachain/pallets/system/README.md similarity index 100% rename from parachain/pallets/control/README.md rename to parachain/pallets/system/README.md diff --git a/parachain/pallets/control/runtime-api/Cargo.toml b/parachain/pallets/system/runtime-api/Cargo.toml similarity index 96% rename from parachain/pallets/control/runtime-api/Cargo.toml rename to parachain/pallets/system/runtime-api/Cargo.toml index d2e34e36c3..9bd092209a 100644 --- a/parachain/pallets/control/runtime-api/Cargo.toml +++ b/parachain/pallets/system/runtime-api/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "snowbridge-control-runtime-api" +name = "snowbridge-system-runtime-api" version = "0.1.0" edition = "2021" authors = ["Snowfork "] diff --git a/parachain/pallets/control/runtime-api/src/lib.rs b/parachain/pallets/system/runtime-api/src/lib.rs similarity index 100% rename from parachain/pallets/control/runtime-api/src/lib.rs rename to parachain/pallets/system/runtime-api/src/lib.rs diff --git a/parachain/pallets/control/src/api.rs b/parachain/pallets/system/src/api.rs similarity index 100% rename from parachain/pallets/control/src/api.rs rename to parachain/pallets/system/src/api.rs diff --git a/parachain/pallets/control/src/benchmarking.rs b/parachain/pallets/system/src/benchmarking.rs similarity index 100% rename from parachain/pallets/control/src/benchmarking.rs rename to parachain/pallets/system/src/benchmarking.rs diff --git a/parachain/pallets/control/src/lib.rs b/parachain/pallets/system/src/lib.rs similarity index 100% rename from parachain/pallets/control/src/lib.rs rename to parachain/pallets/system/src/lib.rs diff --git a/parachain/pallets/control/src/mock.rs b/parachain/pallets/system/src/mock.rs similarity index 98% rename from parachain/pallets/control/src/mock.rs rename to parachain/pallets/system/src/mock.rs index 96a6f3cff4..0ba6757a8c 100644 --- a/parachain/pallets/control/src/mock.rs +++ b/parachain/pallets/system/src/mock.rs @@ -1,6 +1,6 @@ // SPDX-License-Identifier: Apache-2.0 // SPDX-FileCopyrightText: 2023 Snowfork -use crate as snowbridge_control; +use crate as snowbridge_system; use frame_support::{ parameter_types, traits::{tokens::fungible::Mutate, ConstU128, ConstU16, ConstU64, ConstU8}, @@ -91,7 +91,7 @@ frame_support::construct_runtime!( Balances: pallet_balances::{Pallet, Call, Storage, Config, Event}, XcmOrigin: pallet_xcm_origin::{Pallet, Origin}, OutboundQueue: snowbridge_outbound_queue::{Pallet, Call, Storage, Event}, - EthereumControl: snowbridge_control, + EthereumSystem: snowbridge_system, MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event} } ); @@ -251,6 +251,6 @@ pub fn make_xcm_origin(location: MultiLocation) -> RuntimeOrigin { } pub fn make_agent_id(location: MultiLocation) -> AgentId { - ::AgentIdOf::convert_location(&location) + ::AgentIdOf::convert_location(&location) .expect("convert location") } diff --git a/parachain/pallets/control/src/tests.rs b/parachain/pallets/system/src/tests.rs similarity index 80% rename from parachain/pallets/control/src/tests.rs rename to parachain/pallets/system/src/tests.rs index bfd7c5180c..c6f1533bb4 100644 --- a/parachain/pallets/control/src/tests.rs +++ b/parachain/pallets/system/src/tests.rs @@ -21,7 +21,7 @@ fn create_agent() { assert!(!Agents::::contains_key(agent_id)); let origin = make_xcm_origin(origin_location); - assert_ok!(EthereumControl::create_agent(origin)); + assert_ok!(EthereumSystem::create_agent(origin)); assert!(Agents::::contains_key(agent_id)); }); @@ -47,7 +47,7 @@ fn create_agent_fails_on_funds_unavailable() { // Reset balance of sovereign_account to zero so to trigger the FundsUnavailable error let sovereign_account = sibling_sovereign_account::(2000.into()); Balances::set_balance(&sovereign_account, 0); - assert_noop!(EthereumControl::create_agent(origin), TokenError::FundsUnavailable); + assert_noop!(EthereumSystem::create_agent(origin), TokenError::FundsUnavailable); }); } @@ -56,7 +56,7 @@ fn create_agent_bad_origin() { new_test_ext().execute_with(|| { // relay chain location not allowed assert_noop!( - EthereumControl::create_agent(make_xcm_origin(MultiLocation { + EthereumSystem::create_agent(make_xcm_origin(MultiLocation { parents: 1, interior: Here, })), @@ -65,7 +65,7 @@ fn create_agent_bad_origin() { // local account location not allowed assert_noop!( - EthereumControl::create_agent(make_xcm_origin(MultiLocation { + EthereumSystem::create_agent(make_xcm_origin(MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), })), @@ -74,12 +74,12 @@ fn create_agent_bad_origin() { // Signed origin not allowed assert_noop!( - EthereumControl::create_agent(RuntimeOrigin::signed([14; 32].into())), + EthereumSystem::create_agent(RuntimeOrigin::signed([14; 32].into())), BadOrigin ); // None origin not allowed - assert_noop!(EthereumControl::create_agent(RuntimeOrigin::none()), BadOrigin); + assert_noop!(EthereumSystem::create_agent(RuntimeOrigin::none()), BadOrigin); }); } @@ -90,9 +90,9 @@ fn upgrade_as_root() { let address: H160 = Default::default(); let code_hash: H256 = Default::default(); - assert_ok!(EthereumControl::upgrade(origin, address, code_hash, None)); + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, None)); - System::assert_last_event(RuntimeEvent::EthereumControl(crate::Event::Upgrade { + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::Upgrade { impl_address: address, impl_code_hash: code_hash, initializer_params_hash: None, @@ -107,7 +107,7 @@ fn upgrade_as_signed_fails() { let address: H160 = Default::default(); let code_hash: H256 = Default::default(); - assert_noop!(EthereumControl::upgrade(origin, address, code_hash, None), BadOrigin); + assert_noop!(EthereumSystem::upgrade(origin, address, code_hash, None), BadOrigin); }); } @@ -119,7 +119,7 @@ fn upgrade_with_params() { let code_hash: H256 = Default::default(); let initializer: Option = Some(Initializer { params: [0; 256].into(), maximum_required_gas: 10000 }); - assert_ok!(EthereumControl::upgrade(origin, address, code_hash, initializer)); + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, initializer)); }); } @@ -134,8 +134,8 @@ fn create_channel() { // fund sovereign account of origin let _ = Balances::mint_into(&sovereign_account, 10000); - assert_ok!(EthereumControl::create_agent(origin.clone())); - assert_ok!(EthereumControl::create_channel(origin, OperatingMode::Normal, 1)); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin, OperatingMode::Normal, 1)); }); } @@ -150,11 +150,11 @@ fn create_channel_fail_already_exists() { // fund sovereign account of origin let _ = Balances::mint_into(&sovereign_account, 10000); - assert_ok!(EthereumControl::create_agent(origin.clone())); - assert_ok!(EthereumControl::create_channel(origin.clone(), OperatingMode::Normal, 1)); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal, 1)); assert_noop!( - EthereumControl::create_channel(origin, OperatingMode::Normal, 1), + EthereumSystem::create_channel(origin, OperatingMode::Normal, 1), Error::::ChannelAlreadyCreated ); }); @@ -165,7 +165,7 @@ fn create_channel_bad_origin() { new_test_ext().execute_with(|| { // relay chain location not allowed assert_noop!( - EthereumControl::create_channel( + EthereumSystem::create_channel( make_xcm_origin(MultiLocation { parents: 1, interior: Here }), OperatingMode::Normal, 1 @@ -175,7 +175,7 @@ fn create_channel_bad_origin() { // child of sibling location not allowed assert_noop!( - EthereumControl::create_channel( + EthereumSystem::create_channel( make_xcm_origin(MultiLocation { parents: 1, interior: X2( @@ -191,7 +191,7 @@ fn create_channel_bad_origin() { // local account location not allowed assert_noop!( - EthereumControl::create_channel( + EthereumSystem::create_channel( make_xcm_origin(MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), @@ -204,7 +204,7 @@ fn create_channel_bad_origin() { // Signed origin not allowed assert_noop!( - EthereumControl::create_channel( + EthereumSystem::create_channel( RuntimeOrigin::signed([14; 32].into()), OperatingMode::Normal, 1 @@ -213,7 +213,7 @@ fn create_channel_bad_origin() { ); // None origin not allowed - assert_noop!(EthereumControl::create_agent(RuntimeOrigin::none()), BadOrigin); + assert_noop!(EthereumSystem::create_agent(RuntimeOrigin::none()), BadOrigin); }); } @@ -227,13 +227,13 @@ fn update_channel() { // First create the channel let _ = Balances::mint_into(&sovereign_account, 10000); - EthereumControl::create_agent(origin.clone()).unwrap(); - EthereumControl::create_channel(origin.clone(), OperatingMode::Normal, 1).unwrap(); + EthereumSystem::create_agent(origin.clone()).unwrap(); + EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal, 1).unwrap(); // Now try to update it - assert_ok!(EthereumControl::update_channel(origin, OperatingMode::Normal, 2004)); + assert_ok!(EthereumSystem::update_channel(origin, OperatingMode::Normal, 2004)); - System::assert_last_event(RuntimeEvent::EthereumControl(crate::Event::UpdateChannel { + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::UpdateChannel { channel_id: ParaId::from(2000).into(), mode: OperatingMode::Normal, outbound_fee: 2004, @@ -249,7 +249,7 @@ fn update_channel_bad_origin() { // relay chain location not allowed assert_noop!( - EthereumControl::update_channel( + EthereumSystem::update_channel( make_xcm_origin(MultiLocation { parents: 1, interior: Here }), mode, fee, @@ -259,7 +259,7 @@ fn update_channel_bad_origin() { // child of sibling location not allowed assert_noop!( - EthereumControl::update_channel( + EthereumSystem::update_channel( make_xcm_origin(MultiLocation { parents: 1, interior: X2( @@ -275,7 +275,7 @@ fn update_channel_bad_origin() { // local account location not allowed assert_noop!( - EthereumControl::update_channel( + EthereumSystem::update_channel( make_xcm_origin(MultiLocation { parents: 0, interior: X1(Junction::AccountId32 { network: None, id: [67u8; 32] }), @@ -288,12 +288,12 @@ fn update_channel_bad_origin() { // Signed origin not allowed assert_noop!( - EthereumControl::update_channel(RuntimeOrigin::signed([14; 32].into()), mode, fee), + EthereumSystem::update_channel(RuntimeOrigin::signed([14; 32].into()), mode, fee), BadOrigin ); // None origin not allowed - assert_noop!(EthereumControl::update_channel(RuntimeOrigin::none(), mode, fee), BadOrigin); + assert_noop!(EthereumSystem::update_channel(RuntimeOrigin::none(), mode, fee), BadOrigin); }); } @@ -305,7 +305,7 @@ fn update_channel_fails_not_exist() { // Now try to update it assert_noop!( - EthereumControl::update_channel(origin, OperatingMode::Normal, 2004), + EthereumSystem::update_channel(origin, OperatingMode::Normal, 2004), Error::::NoChannel ); }); @@ -323,19 +323,19 @@ fn force_update_channel() { // First create the channel let _ = Balances::mint_into(&sovereign_account, 10000); - EthereumControl::create_agent(origin.clone()).unwrap(); - EthereumControl::create_channel(origin.clone(), OperatingMode::Normal, 1).unwrap(); + EthereumSystem::create_agent(origin.clone()).unwrap(); + EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal, 1).unwrap(); // Now try to force update it let force_origin = RuntimeOrigin::root(); - assert_ok!(EthereumControl::force_update_channel( + assert_ok!(EthereumSystem::force_update_channel( force_origin, channel_id, OperatingMode::Normal, 2004 )); - System::assert_last_event(RuntimeEvent::EthereumControl(crate::Event::UpdateChannel { + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::UpdateChannel { channel_id: ParaId::from(2000).into(), mode: OperatingMode::Normal, outbound_fee: 2004, @@ -351,7 +351,7 @@ fn force_update_channel_bad_origin() { // signed origin not allowed assert_noop!( - EthereumControl::force_update_channel( + EthereumSystem::force_update_channel( RuntimeOrigin::signed([14; 32].into()), ParaId::from(1000).into(), mode, @@ -368,9 +368,9 @@ fn set_operating_mode_as_root() { let origin = RuntimeOrigin::root(); let mode = OperatingMode::RejectingOutboundMessages; - assert_ok!(EthereumControl::set_operating_mode(origin, mode)); + assert_ok!(EthereumSystem::set_operating_mode(origin, mode)); - System::assert_last_event(RuntimeEvent::EthereumControl(crate::Event::SetOperatingMode { + System::assert_last_event(RuntimeEvent::EthereumSystem(crate::Event::SetOperatingMode { mode, })); }); @@ -382,7 +382,7 @@ fn set_operating_mode_as_signed_fails() { let origin = RuntimeOrigin::signed([14; 32].into()); let mode = OperatingMode::RejectingOutboundMessages; - assert_noop!(EthereumControl::set_operating_mode(origin, mode), BadOrigin); + assert_noop!(EthereumSystem::set_operating_mode(origin, mode), BadOrigin); }); } @@ -397,9 +397,9 @@ fn transfer_native_from_agent() { Agents::::insert(make_agent_id(origin_location), ()); let origin = make_xcm_origin(origin_location); - assert_ok!(EthereumControl::transfer_native_from_agent(origin, recipient, amount),); + assert_ok!(EthereumSystem::transfer_native_from_agent(origin, recipient, amount),); - System::assert_last_event(RuntimeEvent::EthereumControl( + System::assert_last_event(RuntimeEvent::EthereumSystem( crate::Event::TransferNativeFromAgent { agent_id: make_agent_id(origin_location), recipient, @@ -421,14 +421,14 @@ fn force_transfer_native_from_agent() { // First create the agent Agents::::insert(make_agent_id(location), ()); - assert_ok!(EthereumControl::force_transfer_native_from_agent( + assert_ok!(EthereumSystem::force_transfer_native_from_agent( origin, versioned_location, recipient, amount ),); - System::assert_last_event(RuntimeEvent::EthereumControl( + System::assert_last_event(RuntimeEvent::EthereumSystem( crate::Event::TransferNativeFromAgent { agent_id: make_agent_id(location), recipient, @@ -446,7 +446,7 @@ fn force_transfer_native_from_agent_bad_origin() { // signed origin not allowed assert_noop!( - EthereumControl::force_transfer_native_from_agent( + EthereumSystem::force_transfer_native_from_agent( RuntimeOrigin::signed([14; 32].into()), Box::new( MultiLocation { @@ -495,7 +495,7 @@ fn charge_fee_for_create_agent() { let sovereign_account = sibling_sovereign_account::(para_id.into()); let (_, agent_id) = ensure_sibling::(&origin_location).unwrap(); - assert_ok!(EthereumControl::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_agent(origin.clone())); // assert sovereign_balance decreased by (fee.base_fee + fee.delivery_fee) let message = Message { id: None, @@ -528,12 +528,12 @@ fn charge_fee_for_transfer_native_from_agent() { let sovereign_account = sibling_sovereign_account::(para_id.into()); // create_agent & create_channel first - assert_ok!(EthereumControl::create_agent(origin.clone())); - assert_ok!(EthereumControl::create_channel(origin.clone(), OperatingMode::Normal, 1)); + assert_ok!(EthereumSystem::create_agent(origin.clone())); + assert_ok!(EthereumSystem::create_channel(origin.clone(), OperatingMode::Normal, 1)); // assert sovereign_balance decreased by only the base_fee let sovereign_balance_before = Balances::balance(&sovereign_account); - assert_ok!(EthereumControl::transfer_native_from_agent(origin.clone(), recipient, amount)); + assert_ok!(EthereumSystem::transfer_native_from_agent(origin.clone(), recipient, amount)); let message = Message { id: None, channel_id: ParaId::from(para_id).into(), @@ -554,7 +554,7 @@ fn charge_fee_for_upgrade() { let code_hash: H256 = Default::default(); let initializer: Option = Some(Initializer { params: [0; 256].into(), maximum_required_gas: 10000 }); - assert_ok!(EthereumControl::upgrade(origin, address, code_hash, initializer.clone())); + assert_ok!(EthereumSystem::upgrade(origin, address, code_hash, initializer.clone())); // assert sovereign_balance does not change as we do not charge for sudo operations let sovereign_account = sibling_sovereign_account::(para_id.into()); diff --git a/parachain/pallets/control/src/weights.rs b/parachain/pallets/system/src/weights.rs similarity index 90% rename from parachain/pallets/control/src/weights.rs rename to parachain/pallets/system/src/weights.rs index 70166ad06e..b774bbf172 100644 --- a/parachain/pallets/control/src/weights.rs +++ b/parachain/pallets/system/src/weights.rs @@ -1,5 +1,5 @@ -//! Autogenerated weights for `snowbridge_control` +//! Autogenerated weights for `snowbridge_system` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev //! DATE: 2023-10-09, STEPS: `2`, REPEAT: `1`, LOW RANGE: `[]`, HIGH RANGE: `[]` @@ -13,7 +13,7 @@ // pallet // --chain // bridge-hub-rococo-dev -// --pallet=snowbridge_control +// --pallet=snowbridge_system // --extrinsic=* // --execution=wasm // --wasm-execution=compiled @@ -30,7 +30,7 @@ use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; use core::marker::PhantomData; -/// Weight functions needed for `snowbridge_control`. +/// Weight functions needed for `snowbridge_system`. pub trait WeightInfo { fn upgrade() -> Weight; fn create_agent() -> Weight; @@ -64,8 +64,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: EthereumControl Agents (r:1 w:1) - /// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:1) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) /// Storage: ParachainInfo ParachainId (r:1 w:0) @@ -89,10 +89,10 @@ impl WeightInfo for () { } /// Storage: System Account (r:2 w:2) /// Proof: System Account (max_values: None, max_size: Some(128), added: 2603, mode: MaxEncodedLen) - /// Storage: EthereumControl Agents (r:1 w:0) - /// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) - /// Storage: EthereumControl Channels (r:1 w:1) - /// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Channels (r:1 w:1) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) /// Storage: ParachainInfo ParachainId (r:1 w:0) /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) @@ -110,8 +110,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(5_u64)) } - /// Storage: EthereumControl Channels (r:1 w:0) - /// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: EthereumSystem Channels (r:1 w:0) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: MessageQueue BookStateFor (r:2 w:2) @@ -129,8 +129,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: EthereumControl Channels (r:1 w:0) - /// Proof: EthereumControl Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) + /// Storage: EthereumSystem Channels (r:1 w:0) + /// Proof: EthereumSystem Channels (max_values: None, max_size: Some(12), added: 2487, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: MessageQueue BookStateFor (r:2 w:2) @@ -167,8 +167,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(4_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: EthereumControl Agents (r:1 w:0) - /// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: MessageQueue BookStateFor (r:2 w:2) @@ -186,8 +186,8 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(5_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } - /// Storage: EthereumControl Agents (r:1 w:0) - /// Proof: EthereumControl Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) + /// Storage: EthereumSystem Agents (r:1 w:0) + /// Proof: EthereumSystem Agents (max_values: None, max_size: Some(40), added: 2515, mode: MaxEncodedLen) /// Storage: EthereumOutboundQueue PalletOperatingMode (r:1 w:0) /// Proof: EthereumOutboundQueue PalletOperatingMode (max_values: Some(1), max_size: Some(1), added: 496, mode: MaxEncodedLen) /// Storage: MessageQueue BookStateFor (r:2 w:2) diff --git a/parachain/runtime/tests/Cargo.lock b/parachain/runtime/tests/Cargo.lock index 0227aa1339..8c15a38f85 100644 --- a/parachain/runtime/tests/Cargo.lock +++ b/parachain/runtime/tests/Cargo.lock @@ -385,6 +385,18 @@ dependencies = [ "ark-std 0.4.0", ] +[[package]] +name = "ark-bls12-377-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20c7021f180a0cbea0380eba97c2af3c57074cdaffe0eef7e840e1c9f2841e55" +dependencies = [ + "ark-bls12-377", + "ark-ec", + "ark-models-ext", + "ark-std 0.4.0", +] + [[package]] name = "ark-bls12-381" version = "0.4.0" @@ -397,6 +409,45 @@ dependencies = [ "ark-std 0.4.0", ] +[[package]] +name = "ark-bls12-381-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1dc4b3d08f19e8ec06e949712f95b8361e43f1391d94f65e4234df03480631c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff 0.4.2", + "ark-models-ext", + "ark-serialize 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bw6-761" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e0605daf0cc5aa2034b78d008aaf159f56901d92a52ee4f6ecdfdac4f426700" +dependencies = [ + "ark-bls12-377", + "ark-ec", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-bw6-761-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccee5fba47266f460067588ee1bf070a9c760bf2050c1c509982c5719aadb4f2" +dependencies = [ + "ark-bw6-761", + "ark-ec", + "ark-ff 0.4.2", + "ark-models-ext", + "ark-std 0.4.0", +] + [[package]] name = "ark-ec" version = "0.4.2" @@ -411,9 +462,35 @@ dependencies = [ "hashbrown 0.13.2", "itertools 0.10.5", "num-traits", + "rayon", "zeroize", ] +[[package]] +name = "ark-ed-on-bls12-377" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b10d901b9ac4b38f9c32beacedfadcdd64e46f8d7f8e88c1ae1060022cf6f6c6" +dependencies = [ + "ark-bls12-377", + "ark-ec", + "ark-ff 0.4.2", + "ark-std 0.4.0", +] + +[[package]] +name = "ark-ed-on-bls12-377-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524a4fb7540df2e1a8c2e67a83ba1d1e6c3947f4f9342cc2359fc2e789ad731d" +dependencies = [ + "ark-ec", + "ark-ed-on-bls12-377", + "ark-ff 0.4.2", + "ark-models-ext", + "ark-std 0.4.0", +] + [[package]] name = "ark-ed-on-bls12-381-bandersnatch" version = "0.4.0" @@ -426,6 +503,19 @@ dependencies = [ "ark-std 0.4.0", ] +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15185f1acb49a07ff8cbe5f11a1adc5a93b19e211e325d826ae98e98e124346" +dependencies = [ + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff 0.4.2", + "ark-models-ext", + "ark-std 0.4.0", +] + [[package]] name = "ark-ff" version = "0.3.0" @@ -509,6 +599,19 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ark-models-ext" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e9eab5d4b5ff2f228b763d38442adc9b084b0a465409b059fac5c2308835ec2" +dependencies = [ + "ark-ec", + "ark-ff 0.4.2", + "ark-serialize 0.4.2", + "ark-std 0.4.0", + "derivative", +] + [[package]] name = "ark-poly" version = "0.4.2" @@ -539,7 +642,7 @@ dependencies = [ [[package]] name = "ark-secret-scalar" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +source = "git+https://github.com/w3f/ring-vrf?rev=cbc342e#cbc342e95d3cbcd3c5ba8d45af7200eb58e63502" dependencies = [ "ark-ec", "ark-ff 0.4.2", @@ -602,12 +705,13 @@ checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", "rand 0.8.5", + "rayon", ] [[package]] name = "ark-transcript" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +source = "git+https://github.com/w3f/ring-vrf?rev=cbc342e#cbc342e95d3cbcd3c5ba8d45af7200eb58e63502" dependencies = [ "ark-ff 0.4.2", "ark-serialize 0.4.2", @@ -714,12 +818,91 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "asset-hub-rococo-runtime" +version = "0.9.420" +dependencies = [ + "assets-common", + "bp-asset-hub-rococo", + "bp-asset-hub-westend", + "bp-bridge-hub-rococo", + "bp-bridge-hub-westend", + "cumulus-pallet-aura-ext", + "cumulus-pallet-dmp-queue", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", + "hex-literal", + "log", + "pallet-asset-conversion", + "pallet-asset-conversion-tx-payment", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-message-queue", + "pallet-multisig", + "pallet-nft-fractionalization", + "pallet-nfts", + "pallet-nfts-runtime-api", + "pallet-proxy", + "pallet-session", + "pallet-state-trie-migration", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-uniques", + "pallet-utility", + "pallet-xcm", + "pallet-xcm-benchmarks", + "pallet-xcm-bridge-hub-router", + "parachains-common", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "primitive-types", + "rococo-runtime-constants", + "scale-info", + "smallvec", + "snowbridge-router-primitives", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", + "sp-core", + "sp-genesis-builder", + "sp-inherents", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-std 8.0.0", + "sp-storage 13.0.0", + "sp-transaction-pool", + "sp-version", + "sp-weights", + "staging-parachain-info", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", +] + [[package]] name = "asset-test-utils" version = "1.0.0" dependencies = [ "assets-common", - "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", @@ -741,7 +924,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", @@ -765,7 +948,7 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -888,8 +1071,8 @@ dependencies = [ [[package]] name = "bandersnatch_vrfs" -version = "0.0.1" -source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +version = "0.0.3" +source = "git+https://github.com/w3f/ring-vrf?rev=cbc342e#cbc342e95d3cbcd3c5ba8d45af7200eb58e63502" dependencies = [ "ark-bls12-381", "ark-ec", @@ -904,6 +1087,8 @@ dependencies = [ "rand_core 0.6.4", "ring 0.1.0", "sha2 0.10.8", + "sp-ark-bls12-381", + "sp-ark-ed-on-bls12-381-bandersnatch", "zeroize", ] @@ -1036,6 +1221,7 @@ checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", "radium", + "serde", "tap", "wyz", ] @@ -1183,7 +1369,7 @@ dependencies = [ ] [[package]] -name = "bp-asset-hub-wococo" +name = "bp-asset-hub-westend" version = "0.1.0" dependencies = [ "bp-xcm-bridge-hub-router", @@ -1203,7 +1389,7 @@ dependencies = [ "frame-system", "polkadot-primitives", "sp-api", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1216,11 +1402,11 @@ dependencies = [ "frame-support", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] -name = "bp-bridge-hub-wococo" +name = "bp-bridge-hub-westend" version = "0.1.0" dependencies = [ "bp-bridge-hub-cumulus", @@ -1229,7 +1415,7 @@ dependencies = [ "frame-support", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1245,7 +1431,7 @@ dependencies = [ "sp-consensus-grandpa", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1259,7 +1445,7 @@ dependencies = [ "scale-info", "serde", "sp-core", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1275,7 +1461,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1292,7 +1478,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1305,7 +1491,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1317,7 +1503,7 @@ dependencies = [ "bp-runtime", "frame-support", "sp-api", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1337,7 +1523,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 8.0.0", "sp-trie", "trie-db", ] @@ -1357,21 +1543,20 @@ dependencies = [ "sp-consensus-grandpa", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-trie", ] [[package]] -name = "bp-wococo" +name = "bp-westend" version = "0.1.0" dependencies = [ "bp-header-chain", "bp-polkadot-core", - "bp-rococo", "bp-runtime", "frame-support", "sp-api", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -1384,14 +1569,29 @@ dependencies = [ "sp-runtime", ] +[[package]] +name = "bridge-hub-common" +version = "0.1.0" +dependencies = [ + "cumulus-primitives-core", + "frame-support", + "pallet-message-queue", + "parity-scale-codec", + "scale-info", + "snowbridge-core", + "sp-runtime", + "sp-std 8.0.0", + "staging-xcm", +] + [[package]] name = "bridge-hub-rococo-runtime" version = "0.1.0" dependencies = [ "bp-asset-hub-rococo", - "bp-asset-hub-wococo", + "bp-asset-hub-westend", "bp-bridge-hub-rococo", - "bp-bridge-hub-wococo", + "bp-bridge-hub-westend", "bp-header-chain", "bp-messages", "bp-parachains", @@ -1399,7 +1599,8 @@ dependencies = [ "bp-relayers", "bp-rococo", "bp-runtime", - "bp-wococo", + "bp-westend", + "bridge-hub-common", "bridge-runtime-common", "cumulus-pallet-aura-ext", "cumulus-pallet-dmp-queue", @@ -1445,8 +1646,6 @@ dependencies = [ "serde", "smallvec", "snowbridge-beacon-primitives", - "snowbridge-control", - "snowbridge-control-runtime-api", "snowbridge-core", "snowbridge-ethereum-beacon-client", "snowbridge-inbound-queue", @@ -1454,6 +1653,8 @@ dependencies = [ "snowbridge-outbound-queue-runtime-api", "snowbridge-router-primitives", "snowbridge-runtime-common", + "snowbridge-system", + "snowbridge-system-runtime-api", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -1464,8 +1665,8 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std", - "sp-storage", + "sp-std 8.0.0", + "sp-storage 13.0.0", "sp-transaction-pool", "sp-version", "staging-parachain-info", @@ -1480,8 +1681,6 @@ name = "bridge-hub-test-utils" version = "0.1.0" dependencies = [ "asset-test-utils", - "bp-bridge-hub-rococo", - "bp-bridge-hub-wococo", "bp-header-chain", "bp-messages", "bp-parachains", @@ -1490,7 +1689,6 @@ dependencies = [ "bp-runtime", "bp-test-utils", "bridge-runtime-common", - "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", "frame-benchmarking", @@ -1515,7 +1713,7 @@ dependencies = [ "sp-io", "sp-keyring", "sp-runtime", - "sp-tracing", + "sp-tracing 10.0.0", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", @@ -1549,7 +1747,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-trie", "staging-xcm", "staging-xcm-builder", @@ -2297,7 +2495,7 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -2305,6 +2503,7 @@ name = "cumulus-pallet-dmp-queue" version = "0.1.0" dependencies = [ "cumulus-primitives-core", + "frame-benchmarking", "frame-support", "frame-system", "log", @@ -2312,7 +2511,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", ] @@ -2325,21 +2524,23 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "environmental", + "frame-benchmarking", "frame-support", "frame-system", "impl-trait-for-tuples", "log", + "pallet-message-queue", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-runtime-parachains", "scale-info", "sp-core", - "sp-externalities", + "sp-externalities 0.19.0", "sp-inherents", "sp-io", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 8.0.0", "sp-trie", "sp-version", "staging-xcm", @@ -2366,7 +2567,7 @@ dependencies = [ "pallet-session", "parity-scale-codec", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -2380,7 +2581,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", ] @@ -2388,21 +2589,22 @@ dependencies = [ name = "cumulus-pallet-xcmp-queue" version = "0.1.0" dependencies = [ + "bounded-collections", "bp-xcm-bridge-hub-router", "cumulus-primitives-core", "frame-benchmarking", "frame-support", "frame-system", "log", + "pallet-message-queue", "parity-scale-codec", "polkadot-runtime-common", "polkadot-runtime-parachains", - "rand_chacha 0.3.1", "scale-info", "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-executor", ] @@ -2418,7 +2620,7 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-trie", "staging-xcm", ] @@ -2439,8 +2641,8 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-storage", + "sp-std 8.0.0", + "sp-storage 13.0.0", "sp-trie", "tracing", ] @@ -2458,7 +2660,7 @@ dependencies = [ "polkadot-runtime-parachains", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -2490,7 +2692,7 @@ dependencies = [ "polkadot-primitives", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 8.0.0", "sp-trie", ] @@ -2869,7 +3071,7 @@ dependencies = [ [[package]] name = "dleq_vrf" version = "0.0.2" -source = "git+https://github.com/w3f/ring-vrf?rev=4b09416#4b09416fd23383ec436ddac127d58c7b7cd392c6" +source = "git+https://github.com/w3f/ring-vrf?rev=cbc342e#cbc342e95d3cbcd3c5ba8d45af7200eb58e63502" dependencies = [ "ark-ec", "ark-ff 0.4.2", @@ -3078,6 +3280,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "enumflags2" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5998b4f30320c9d93aed72f63af821bfdac50465b75428fce77b48ec482c3939" +dependencies = [ + "enumflags2_derive", +] + +[[package]] +name = "enumflags2_derive" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "enumn" version = "0.1.12" @@ -3437,9 +3659,9 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-runtime-interface 17.0.0", + "sp-std 8.0.0", + "sp-storage 13.0.0", "static_assertions", ] @@ -3466,7 +3688,7 @@ dependencies = [ "sp-core", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -3482,8 +3704,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 8.0.0", + "sp-tracing 10.0.0", ] [[package]] @@ -3503,6 +3725,7 @@ name = "frame-support" version = "4.0.0-dev" dependencies = [ "aquamarine", + "array-bytes 6.2.0", "bitflags 1.3.2", "docify", "environmental", @@ -3522,7 +3745,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-core-hashing-proc-macro", - "sp-debug-derive", + "sp-debug-derive 8.0.0", "sp-genesis-builder", "sp-inherents", "sp-io", @@ -3530,8 +3753,8 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-std 8.0.0", + "sp-tracing 10.0.0", "sp-weights", "static_assertions", "tt-call", @@ -3580,6 +3803,7 @@ name = "frame-system" version = "4.0.0-dev" dependencies = [ "cfg-if", + "docify", "frame-support", "log", "parity-scale-codec", @@ -3588,7 +3812,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-version", "sp-weights", ] @@ -3604,7 +3828,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -3623,7 +3847,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -4233,6 +4457,17 @@ dependencies = [ "parity-scale-codec", ] +[[package]] +name = "impl-num-traits" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "951641f13f873bff03d4bf19ae8bec531935ac0ac2cc775f84d7edfdcfed3f17" +dependencies = [ + "integer-sqrt", + "num-traits", + "uint", +] + [[package]] name = "impl-rlp" version = "0.3.0" @@ -5972,7 +6207,21 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", +] + +[[package]] +name = "pallet-asset-conversion-tx-payment" +version = "4.0.0-dev" +dependencies = [ + "frame-support", + "frame-system", + "pallet-asset-conversion", + "pallet-transaction-payment", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std 8.0.0", ] [[package]] @@ -5986,7 +6235,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6003,7 +6252,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6018,7 +6267,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6034,7 +6283,7 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6049,7 +6298,7 @@ dependencies = [ "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6062,7 +6311,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6085,7 +6334,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6099,7 +6348,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6118,7 +6367,7 @@ dependencies = [ "scale-info", "sp-consensus-grandpa", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-trie", ] @@ -6135,9 +6384,8 @@ dependencies = [ "num-traits", "parity-scale-codec", "scale-info", - "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6156,7 +6404,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-trie", ] @@ -6176,7 +6424,7 @@ dependencies = [ "scale-info", "sp-arithmetic", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6194,7 +6442,7 @@ dependencies = [ "scale-info", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6215,7 +6463,7 @@ dependencies = [ "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "strum", ] @@ -6229,7 +6477,7 @@ dependencies = [ "parity-scale-codec", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6247,13 +6495,29 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0", +] + +[[package]] +name = "pallet-identity" +version = "4.0.0-dev" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std 8.0.0", ] [[package]] name = "pallet-message-queue" version = "7.0.0-dev" dependencies = [ + "environmental", "frame-benchmarking", "frame-support", "frame-system", @@ -6264,7 +6528,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-weights", ] @@ -6280,7 +6544,63 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", +] + +[[package]] +name = "pallet-nft-fractionalization" +version = "4.0.0-dev" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-assets", + "pallet-nfts", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std 8.0.0", +] + +[[package]] +name = "pallet-nfts" +version = "4.0.0-dev" +dependencies = [ + "enumflags2", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 8.0.0", +] + +[[package]] +name = "pallet-nfts-runtime-api" +version = "4.0.0-dev" +dependencies = [ + "pallet-nfts", + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "pallet-proxy" +version = "4.0.0-dev" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", + "sp-std 8.0.0", ] [[package]] @@ -6300,7 +6620,7 @@ dependencies = [ "sp-session", "sp-staking", "sp-state-machine", - "sp-std", + "sp-std 8.0.0", "sp-trie", ] @@ -6323,7 +6643,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6334,6 +6654,22 @@ dependencies = [ "sp-arithmetic", ] +[[package]] +name = "pallet-state-trie-migration" +version = "4.0.0-dev" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 8.0.0", +] + [[package]] name = "pallet-timestamp" version = "4.0.0-dev" @@ -6348,8 +6684,8 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", - "sp-std", - "sp-storage", + "sp-std 8.0.0", + "sp-storage 13.0.0", "sp-timestamp", ] @@ -6365,7 +6701,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6394,7 +6730,21 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", +] + +[[package]] +name = "pallet-uniques" +version = "4.0.0-dev" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std 8.0.0", ] [[package]] @@ -6409,7 +6759,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6423,7 +6773,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6442,8 +6792,9 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", + "staging-xcm-builder", "staging-xcm-executor", ] @@ -6459,7 +6810,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -6478,7 +6829,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-builder", ] @@ -6498,6 +6849,7 @@ dependencies = [ "pallet-authorship", "pallet-balances", "pallet-collator-selection", + "pallet-message-queue", "parity-scale-codec", "polkadot-core-primitives", "polkadot-primitives", @@ -6508,7 +6860,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", @@ -6521,7 +6873,6 @@ name = "parachains-runtimes-test-utils" version = "1.0.0" dependencies = [ "assets-common", - "cumulus-pallet-dmp-queue", "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", "cumulus-primitives-core", @@ -6541,8 +6892,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 8.0.0", + "sp-tracing 10.0.0", "staging-parachain-info", "staging-xcm", "staging-xcm-executor", @@ -6847,7 +7198,7 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -6912,6 +7263,7 @@ dependencies = [ name = "polkadot-node-primitives" version = "1.0.0" dependencies = [ + "bitvec", "bounded-vec", "futures", "parity-scale-codec", @@ -6934,6 +7286,7 @@ name = "polkadot-node-subsystem-types" version = "1.0.0" dependencies = [ "async-trait", + "bitvec", "derive_more", "futures", "orchestra", @@ -6986,7 +7339,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-weights", ] @@ -7012,7 +7365,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -7033,6 +7386,7 @@ dependencies = [ "pallet-balances", "pallet-election-provider-multi-phase", "pallet-fast-unstake", + "pallet-identity", "pallet-session", "pallet-staking", "pallet-staking-reward-fn", @@ -7057,7 +7411,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -7072,8 +7426,8 @@ dependencies = [ "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", - "sp-std", - "sp-tracing", + "sp-std 8.0.0", + "sp-tracing 10.0.0", ] [[package]] @@ -7116,7 +7470,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-executor", "static_assertions", @@ -7252,6 +7606,7 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec", + "impl-num-traits", "impl-rlp", "impl-serde", "scale-info", @@ -8155,7 +8510,7 @@ version = "4.1.0-dev" dependencies = [ "log", "sp-core", - "sp-wasm-interface", + "sp-wasm-interface 14.0.0", "thiserror", ] @@ -8191,7 +8546,6 @@ name = "sc-block-builder" version = "0.10.0-dev" dependencies = [ "parity-scale-codec", - "sc-client-api", "sp-api", "sp-block-builder", "sp-blockchain", @@ -8204,7 +8558,11 @@ dependencies = [ name = "sc-chain-spec" version = "4.0.0-dev" dependencies = [ + "array-bytes 6.2.0", + "docify", + "log", "memmap2", + "parity-scale-codec", "sc-chain-spec-derive", "sc-client-api", "sc-executor", @@ -8214,6 +8572,8 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core", + "sp-genesis-builder", + "sp-io", "sp-runtime", "sp-state-machine", ] @@ -8285,11 +8645,11 @@ dependencies = [ "sp-consensus", "sp-core", "sp-database", - "sp-externalities", + "sp-externalities 0.19.0", "sp-runtime", "sp-state-machine", "sp-statement-store", - "sp-storage", + "sp-storage 13.0.0", "sp-trie", "substrate-prometheus-endpoint", ] @@ -8354,13 +8714,13 @@ dependencies = [ "schnellru", "sp-api", "sp-core", - "sp-externalities", + "sp-externalities 0.19.0", "sp-io", "sp-panic-handler", - "sp-runtime-interface", + "sp-runtime-interface 17.0.0", "sp-trie", "sp-version", - "sp-wasm-interface", + "sp-wasm-interface 14.0.0", "tracing", ] @@ -8370,7 +8730,7 @@ version = "0.10.0-dev" dependencies = [ "sc-allocator", "sp-maybe-compressed-blob", - "sp-wasm-interface", + "sp-wasm-interface 14.0.0", "thiserror", "wasm-instrument", ] @@ -8387,8 +8747,8 @@ dependencies = [ "rustix 0.36.17", "sc-allocator", "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-runtime-interface 17.0.0", + "sp-wasm-interface 14.0.0", "wasmtime", ] @@ -8574,6 +8934,7 @@ dependencies = [ "sp-runtime", "substrate-prometheus-endpoint", "thiserror", + "tokio", "tokio-stream", ] @@ -8679,6 +9040,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-core", + "sp-rpc", "sp-runtime", "sp-version", "thiserror", @@ -8701,7 +9063,6 @@ dependencies = [ "parking_lot 0.12.1", "pin-project", "rand 0.8.5", - "sc-block-builder", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -8730,12 +9091,12 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-core", - "sp-externalities", + "sp-externalities 0.19.0", "sp-keystore", "sp-runtime", "sp-session", "sp-state-machine", - "sp-storage", + "sp-storage 13.0.0", "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie", @@ -8763,6 +9124,7 @@ dependencies = [ name = "sc-sysinfo" version = "6.0.0-dev" dependencies = [ + "derive_more", "futures", "libc", "log", @@ -8774,7 +9136,7 @@ dependencies = [ "serde_json", "sp-core", "sp-io", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -8816,7 +9178,7 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", - "sp-tracing", + "sp-tracing 10.0.0", "thiserror", "tracing", "tracing-log", @@ -8852,7 +9214,7 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-runtime", - "sp-tracing", + "sp-tracing 10.0.0", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -9288,7 +9650,7 @@ dependencies = [ "parity-scale-codec", "paste", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -9346,45 +9708,12 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "ssz_rs", "ssz_rs_derive", "static_assertions", ] -[[package]] -name = "snowbridge-control" -version = "4.0.0-dev" -dependencies = [ - "ethabi-decode", - "frame-benchmarking", - "frame-support", - "frame-system", - "log", - "parity-scale-codec", - "scale-info", - "snowbridge-core", - "sp-core", - "sp-io", - "sp-runtime", - "sp-std", - "staging-xcm", - "staging-xcm-builder", - "staging-xcm-executor", -] - -[[package]] -name = "snowbridge-control-runtime-api" -version = "0.1.0" -dependencies = [ - "parity-scale-codec", - "snowbridge-core", - "sp-api", - "sp-core", - "sp-std", - "staging-xcm", -] - [[package]] name = "snowbridge-core" version = "0.1.1" @@ -9392,6 +9721,7 @@ dependencies = [ "ethabi-decode", "frame-support", "frame-system", + "hex-literal", "parity-scale-codec", "polkadot-parachain-primitives", "scale-info", @@ -9399,9 +9729,11 @@ dependencies = [ "snowbridge-beacon-primitives", "sp-arithmetic", "sp-core", + "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", + "staging-xcm-builder", ] [[package]] @@ -9422,7 +9754,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -9447,7 +9779,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "ssz_rs", "ssz_rs_derive", "static_assertions", @@ -9477,7 +9809,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-builder", ] @@ -9486,6 +9818,7 @@ dependencies = [ name = "snowbridge-outbound-queue" version = "0.1.1" dependencies = [ + "bridge-hub-common", "ethabi-decode", "frame-benchmarking", "frame-support", @@ -9500,7 +9833,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", ] @@ -9524,7 +9857,7 @@ dependencies = [ "snowbridge-outbound-queue-merkle-tree", "sp-api", "sp-core", - "sp-std", + "sp-std 8.0.0", "staging-xcm", ] @@ -9544,7 +9877,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -9568,6 +9901,7 @@ dependencies = [ name = "snowbridge-runtime-tests" version = "0.1.0" dependencies = [ + "asset-hub-rococo-runtime", "assets-common", "bridge-hub-rococo-runtime", "bridge-hub-test-utils", @@ -9613,14 +9947,14 @@ dependencies = [ "serde", "smallvec", "snowbridge-beacon-primitives", - "snowbridge-control", - "snowbridge-control-runtime-api", "snowbridge-core", "snowbridge-ethereum-beacon-client", "snowbridge-inbound-queue", "snowbridge-outbound-queue", "snowbridge-outbound-queue-runtime-api", "snowbridge-router-primitives", + "snowbridge-system", + "snowbridge-system-runtime-api", "sp-api", "sp-block-builder", "sp-consensus-aura", @@ -9632,8 +9966,8 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std", - "sp-storage", + "sp-std 8.0.0", + "sp-storage 13.0.0", "sp-transaction-pool", "sp-version", "staging-parachain-info", @@ -9643,6 +9977,39 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "snowbridge-system" +version = "0.1.1" +dependencies = [ + "ethabi-decode", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "snowbridge-core", + "sp-core", + "sp-io", + "sp-runtime", + "sp-std 8.0.0", + "staging-xcm", + "staging-xcm-builder", + "staging-xcm-executor", +] + +[[package]] +name = "snowbridge-system-runtime-api" +version = "0.1.0" +dependencies = [ + "parity-scale-codec", + "snowbridge-core", + "sp-api", + "sp-core", + "sp-std 8.0.0", + "staging-xcm", +] + [[package]] name = "socket2" version = "0.4.10" @@ -9690,11 +10057,11 @@ dependencies = [ "scale-info", "sp-api-proc-macro", "sp-core", - "sp-externalities", + "sp-externalities 0.19.0", "sp-metadata-ir", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 8.0.0", "sp-trie", "sp-version", "thiserror", @@ -9722,7 +10089,7 @@ dependencies = [ "serde", "sp-core", "sp-io", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -9734,10 +10101,28 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 8.0.0", "static_assertions", ] +[[package]] +name = "sp-ark-bls12-381" +version = "0.4.2" +source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" +dependencies = [ + "ark-bls12-381-ext", + "sp-crypto-ec-utils", +] + +[[package]] +name = "sp-ark-ed-on-bls12-381-bandersnatch" +version = "0.4.2" +source = "git+https://github.com/paritytech/arkworks-substrate#caa2eed74beb885dd07c7db5f916f2281dad818f" +dependencies = [ + "ark-ed-on-bls12-381-bandersnatch-ext", + "sp-crypto-ec-utils", +] + [[package]] name = "sp-authority-discovery" version = "4.0.0-dev" @@ -9747,7 +10132,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -9757,7 +10142,7 @@ dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -9803,7 +10188,7 @@ dependencies = [ "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-timestamp", ] @@ -9821,7 +10206,7 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-timestamp", ] @@ -9839,7 +10224,7 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -9849,7 +10234,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 8.0.0", "sp-timestamp", ] @@ -9887,11 +10272,11 @@ dependencies = [ "secrecy", "serde", "sp-core-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-debug-derive 8.0.0", + "sp-externalities 0.19.0", + "sp-runtime-interface 17.0.0", + "sp-std 8.0.0", + "sp-storage 13.0.0", "ss58-registry", "substrate-bip39", "thiserror", @@ -9921,6 +10306,27 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "sp-crypto-ec-utils" +version = "0.4.1" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" +dependencies = [ + "ark-bls12-377", + "ark-bls12-377-ext", + "ark-bls12-381", + "ark-bls12-381-ext", + "ark-bw6-761", + "ark-bw6-761-ext", + "ark-ec", + "ark-ed-on-bls12-377", + "ark-ed-on-bls12-377-ext", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ed-on-bls12-381-bandersnatch-ext", + "ark-scale", + "sp-runtime-interface 17.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk)", +] + [[package]] name = "sp-database" version = "4.0.0-dev" @@ -9938,14 +10344,35 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "sp-debug-derive" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "sp-externalities" version = "0.19.0" dependencies = [ "environmental", "parity-scale-codec", - "sp-std", - "sp-storage", + "sp-std 8.0.0", + "sp-storage 13.0.0", +] + +[[package]] +name = "sp-externalities" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-storage 13.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] @@ -9955,7 +10382,7 @@ dependencies = [ "serde_json", "sp-api", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -9967,7 +10394,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "thiserror", ] @@ -9983,12 +10410,12 @@ dependencies = [ "rustversion", "secp256k1", "sp-core", - "sp-externalities", + "sp-externalities 0.19.0", "sp-keystore", - "sp-runtime-interface", + "sp-runtime-interface 17.0.0", "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-std 8.0.0", + "sp-tracing 10.0.0", "sp-trie", "tracing", "tracing-core", @@ -10011,7 +10438,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "sp-core", - "sp-externalities", + "sp-externalities 0.19.0", "thiserror", ] @@ -10030,7 +10457,7 @@ dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -10041,7 +10468,7 @@ dependencies = [ "scale-info", "sp-api", "sp-application-crypto", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -10054,7 +10481,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -10101,7 +10528,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std", + "sp-std 8.0.0", "sp-weights", ] @@ -10113,12 +10540,30 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-externalities 0.19.0", + "sp-runtime-interface-proc-macro 11.0.0", + "sp-std 8.0.0", + "sp-storage 13.0.0", + "sp-tracing 10.0.0", + "sp-wasm-interface 14.0.0", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "primitive-types", + "sp-externalities 0.19.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-runtime-interface-proc-macro 11.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-storage 13.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-tracing 10.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-wasm-interface 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", "static_assertions", ] @@ -10133,6 +10578,18 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" +dependencies = [ + "Inflector", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.39", +] + [[package]] name = "sp-session" version = "4.0.0-dev" @@ -10144,7 +10601,7 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -10157,7 +10614,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -10171,9 +10628,9 @@ dependencies = [ "rand 0.8.5", "smallvec", "sp-core", - "sp-externalities", + "sp-externalities 0.19.0", "sp-panic-handler", - "sp-std", + "sp-std 8.0.0", "sp-trie", "thiserror", "tracing", @@ -10195,10 +10652,10 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-core", - "sp-externalities", + "sp-externalities 0.19.0", "sp-runtime", - "sp-runtime-interface", - "sp-std", + "sp-runtime-interface 17.0.0", + "sp-std 8.0.0", "thiserror", "x25519-dalek 2.0.0", ] @@ -10207,16 +10664,34 @@ dependencies = [ name = "sp-std" version = "8.0.0" +[[package]] +name = "sp-std" +version = "8.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" + +[[package]] +name = "sp-storage" +version = "13.0.0" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 8.0.0", + "sp-std 8.0.0", +] + [[package]] name = "sp-storage" version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 8.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] @@ -10227,7 +10702,7 @@ dependencies = [ "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "thiserror", ] @@ -10236,7 +10711,19 @@ name = "sp-tracing" version = "10.0.0" dependencies = [ "parity-scale-codec", - "sp-std", + "sp-std 8.0.0", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-tracing" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" +dependencies = [ + "parity-scale-codec", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk)", "tracing", "tracing-core", "tracing-subscriber", @@ -10260,7 +10747,7 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-trie", ] @@ -10280,7 +10767,7 @@ dependencies = [ "scale-info", "schnellru", "sp-core", - "sp-std", + "sp-std 8.0.0", "thiserror", "tracing", "trie-db", @@ -10298,7 +10785,7 @@ dependencies = [ "serde", "sp-core-hashing-proc-macro", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-version-proc-macro", "thiserror", ] @@ -10321,7 +10808,20 @@ dependencies = [ "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std", + "sp-std 8.0.0", + "wasmtime", +] + +[[package]] +name = "sp-wasm-interface" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#19f665f27902bfea62d24cd06723cdab40f060ab" +dependencies = [ + "anyhow", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "sp-std 8.0.0 (git+https://github.com/paritytech/polkadot-sdk)", "wasmtime", ] @@ -10335,8 +10835,8 @@ dependencies = [ "smallvec", "sp-arithmetic", "sp-core", - "sp-debug-derive", - "sp-std", + "sp-debug-derive 8.0.0", + "sp-std 8.0.0", ] [[package]] @@ -10425,7 +10925,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 8.0.0", ] [[package]] @@ -10459,7 +10959,7 @@ dependencies = [ "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-weights", "staging-xcm", "staging-xcm-executor", @@ -10480,7 +10980,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 8.0.0", "sp-weights", "staging-xcm", ] diff --git a/parachain/runtime/tests/Cargo.toml b/parachain/runtime/tests/Cargo.toml index 1615cb30dd..65626b3f35 100644 --- a/parachain/runtime/tests/Cargo.toml +++ b/parachain/runtime/tests/Cargo.toml @@ -83,8 +83,8 @@ snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-clie snowbridge-inbound-queue = { path = "../../pallets/inbound-queue", default-features = false } snowbridge-outbound-queue = { path = "../../pallets/outbound-queue", default-features = false } snowbridge-outbound-queue-runtime-api = { path = "../../pallets/outbound-queue/runtime-api", default-features = false } -snowbridge-control = { path = "../../pallets/control", default-features = false } -snowbridge-control-runtime-api = { path = "../../pallets/control/runtime-api", default-features = false } +snowbridge-system = { path = "../../pallets/system", default-features = false } +snowbridge-system-runtime-api = { path = "../../pallets/system/runtime-api", default-features = false } [dev-dependencies] static_assertions = "1.1" @@ -161,8 +161,8 @@ std = [ "snowbridge-inbound-queue/std", "snowbridge-outbound-queue/std", "snowbridge-outbound-queue-runtime-api/std", - "snowbridge-control/std", - "snowbridge-control-runtime-api/std", + "snowbridge-system/std", + "snowbridge-system-runtime-api/std", ] runtime-benchmarks = [ @@ -191,7 +191,7 @@ runtime-benchmarks = [ "xcm-builder/runtime-benchmarks", "xcm-executor/runtime-benchmarks", "snowbridge-core/runtime-benchmarks", - "snowbridge-control/runtime-benchmarks", + "snowbridge-system/runtime-benchmarks", "snowbridge-inbound-queue/runtime-benchmarks", "snowbridge-outbound-queue/runtime-benchmarks", "snowbridge-ethereum-beacon-client/runtime-benchmarks", diff --git a/polkadot-sdk b/polkadot-sdk index 42537e8239..01acc2a72a 160000 --- a/polkadot-sdk +++ b/polkadot-sdk @@ -1 +1 @@ -Subproject commit 42537e8239fbfc06be1511c211d9c0393fbd6d27 +Subproject commit 01acc2a72aff289232b63d3e29b574328ea96dda diff --git a/smoketest/src/helper.rs b/smoketest/src/helper.rs index 15abb1fa37..c17988cae3 100644 --- a/smoketest/src/helper.rs +++ b/smoketest/src/helper.rs @@ -12,6 +12,10 @@ use crate::{ utility, }, }, + penpal::{ + api::runtime_types as penpalTypes, + {self}, + }, relaychain, relaychain::api::runtime_types::{ pallet_xcm::pallet::Call as RelaychainPalletXcmCall, @@ -31,10 +35,6 @@ use crate::{ VersionedXcm as RelaychainVersionedXcm, }, }, - penpal::{ - api::runtime_types as penpalTypes, - {self}, - }, }, }; use ethers::{ @@ -45,6 +45,15 @@ use ethers::{ providers::Http, }; use futures::StreamExt; +use penpalTypes::{ + pallet_xcm::pallet::Call, + penpal_runtime::RuntimeCall, + staging_xcm::v3::multilocation::MultiLocation, + xcm::{ + v3::{junction::Junction, junctions::Junctions}, + VersionedMultiLocation, VersionedXcm, + }, +}; use sp_core::{sr25519::Pair, Pair as PairT, H160}; use std::{ops::Deref, sync::Arc, time::Duration}; use subxt::{ @@ -53,15 +62,6 @@ use subxt::{ tx::{PairSigner, TxPayload}, Config, OnlineClient, PolkadotConfig, SubstrateConfig, }; -use penpalTypes::{ - staging_xcm::v3::multilocation::MultiLocation, - xcm::{ - v3::{junction::Junction, junctions::Junctions}, - VersionedMultiLocation, VersionedXcm, - }, - pallet_xcm::pallet::Call, - penpal_runtime::RuntimeCall -}; /// Custom config that works with Penpal pub enum PenpalConfig {} @@ -197,7 +197,10 @@ pub async fn send_sudo_xcm_transact( interior: Junctions::X1(Junction::Parachain(BRIDGE_HUB_PARA_ID)), })); - let sudo_call = penpal::api::sudo::calls::TransactionApi::sudo(&penpal::api::sudo::calls::TransactionApi,RuntimeCall::PolkadotXcm(Call::send { dest, message })); + let sudo_call = penpal::api::sudo::calls::TransactionApi::sudo( + &penpal::api::sudo::calls::TransactionApi, + RuntimeCall::PolkadotXcm(Call::send { dest, message }), + ); let owner: Pair = Pair::from_string("//Alice", None).expect("cannot create keypair"); @@ -253,7 +256,7 @@ pub async fn fund_account( pub async fn construct_create_agent_call( bridge_hub_client: &Box>, ) -> Result, Box> { - let call = bridgehub::api::ethereum_control::calls::TransactionApi + let call = bridgehub::api::ethereum_system::calls::TransactionApi .create_agent() .encode_call_data(&bridge_hub_client.metadata())?; @@ -263,7 +266,7 @@ pub async fn construct_create_agent_call( pub async fn construct_create_channel_call( bridge_hub_client: &Box>, ) -> Result, Box> { - let call = bridgehub::api::ethereum_control::calls::TransactionApi + let call = bridgehub::api::ethereum_system::calls::TransactionApi .create_channel(OperatingMode::Normal, 1) .encode_call_data(&bridge_hub_client.metadata())?; @@ -275,7 +278,7 @@ pub async fn construct_transfer_native_from_agent_call( recipient: H160, amount: u128, ) -> Result, Box> { - let call = bridgehub::api::ethereum_control::calls::TransactionApi + let call = bridgehub::api::ethereum_system::calls::TransactionApi .transfer_native_from_agent(recipient, amount) .encode_call_data(&bridge_hub_client.metadata())?; diff --git a/smoketest/tests/create_agent.rs b/smoketest/tests/create_agent.rs index ffefd28fff..5f15dd2a07 100644 --- a/smoketest/tests/create_agent.rs +++ b/smoketest/tests/create_agent.rs @@ -1,6 +1,6 @@ use snowbridge_smoketest::{ contracts::i_gateway::AgentCreatedFilter, helper::*, - parachains::bridgehub::api::ethereum_control::events::CreateAgent, + parachains::bridgehub::api::ethereum_system::events::CreateAgent, xcm::construct_xcm_message_with_fee, }; diff --git a/smoketest/tests/create_channel.rs b/smoketest/tests/create_channel.rs index 6689950969..bf611f807a 100644 --- a/smoketest/tests/create_channel.rs +++ b/smoketest/tests/create_channel.rs @@ -1,6 +1,6 @@ use snowbridge_smoketest::{ contracts::i_gateway::ChannelCreatedFilter, helper::*, - parachains::bridgehub::api::ethereum_control::events::CreateChannel, + parachains::bridgehub::api::ethereum_system::events::CreateChannel, xcm::construct_xcm_message_with_fee, }; diff --git a/smoketest/tests/set_token_transfer_fees.rs b/smoketest/tests/set_token_transfer_fees.rs index b1bc694ea0..0f160ea138 100644 --- a/smoketest/tests/set_token_transfer_fees.rs +++ b/smoketest/tests/set_token_transfer_fees.rs @@ -4,7 +4,7 @@ use snowbridge_smoketest::{ contracts::{i_gateway, i_gateway::TokenTransferFeesChangedFilter}, helper::*, parachains::bridgehub::api::{ - ethereum_control::events::SetTokenTransferFees, + ethereum_system::events::SetTokenTransferFees, runtime_types::{self, bridge_hub_rococo_runtime::RuntimeCall as BHRuntimeCall}, }, }; @@ -19,8 +19,8 @@ async fn set_token_transfer_fees() { let fees = gateway.token_transfer_fees().await.expect("get fees"); println!("asset fees {:?}", fees); - let set_token_fees_call = BHRuntimeCall::EthereumControl( - runtime_types::snowbridge_control::pallet::Call::set_token_transfer_fees { + let set_token_fees_call = BHRuntimeCall::EthereumSystem( + runtime_types::snowbridge_system::pallet::Call::set_token_transfer_fees { register: 10_000_000_000_000, send: 20_000_000_000, }, diff --git a/smoketest/tests/transfer_native_from_agent.rs b/smoketest/tests/transfer_native_from_agent.rs index 8c78cc4c32..82aff09132 100644 --- a/smoketest/tests/transfer_native_from_agent.rs +++ b/smoketest/tests/transfer_native_from_agent.rs @@ -3,7 +3,7 @@ use snowbridge_smoketest::{ constants::*, contracts::{i_gateway, i_gateway::InboundMessageDispatchedFilter}, helper::*, - parachains::bridgehub::api::ethereum_control::events::TransferNativeFromAgent, + parachains::bridgehub::api::ethereum_system::events::TransferNativeFromAgent, xcm::construct_xcm_message_with_fee, }; diff --git a/smoketest/tests/upgrade_gateway.rs b/smoketest/tests/upgrade_gateway.rs index 2eeceee720..726785a16e 100644 --- a/smoketest/tests/upgrade_gateway.rs +++ b/smoketest/tests/upgrade_gateway.rs @@ -17,7 +17,7 @@ use snowbridge_smoketest::{ parachains::{ bridgehub::{ self, - api::{ethereum_control, runtime_types::snowbridge_core::outbound::v1::Initializer}, + api::{ethereum_system, runtime_types::snowbridge_core::outbound::v1::Initializer}, }, relaychain, relaychain::api::runtime_types::{ @@ -67,7 +67,7 @@ async fn upgrade_gateway() { let signer: PairSigner = PairSigner::new(sudo); - let ethereum_control_api = bridgehub::api::ethereum_control::calls::TransactionApi; + let ethereum_system_api = bridgehub::api::ethereum_system::calls::TransactionApi; let d_0 = 99; let d_1 = 66; @@ -81,7 +81,7 @@ async fn upgrade_gateway() { let gateway_upgrade_mock_code_hash = keccak256(code); // The upgrade call - let upgrade_call = ethereum_control_api + let upgrade_call = ethereum_system_api .upgrade( GATETWAY_UPGRADE_MOCK_CONTRACT.into(), gateway_upgrade_mock_code_hash.into(), @@ -132,7 +132,7 @@ async fn upgrade_gateway() { while let Some(Ok(block)) = blocks.next().await { println!("Polling bridgehub block {} for upgrade event.", block.number()); let upgrades = block.events().await.expect("read block events"); - for upgrade in upgrades.find::() { + for upgrade in upgrades.find::() { let _upgrade = upgrade.expect("expect upgrade"); println!("Event found at bridgehub block {}.", block.number()); upgrade_event_found = true; From d8478e38b0c79d8830e188d3454a3d38d916a53f Mon Sep 17 00:00:00 2001 From: ron Date: Thu, 30 Nov 2023 21:04:57 +0800 Subject: [PATCH 2/5] Fix breaking tests --- smoketest/src/constants.rs | 4 ++-- smoketest/src/helper.rs | 2 +- smoketest/tests/set_pricing_params.rs | 6 +++--- smoketest/tests/set_token_transfer_fees.rs | 14 ++++++++------ 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/smoketest/src/constants.rs b/smoketest/src/constants.rs index d695f6891a..ed388c2e3f 100644 --- a/smoketest/src/constants.rs +++ b/smoketest/src/constants.rs @@ -47,8 +47,8 @@ pub const FERDIE: [u8; 32] = hex!("1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c"); lazy_static! { - pub static ref REGISTER_TOKEN_FEE: u128 = env::var("REGISTER_TOKEN_FEE") - .unwrap_or("100000000000000000".to_string()) + pub static ref REGISTER_TOKEN_FEE: u64 = env::var("REGISTER_TOKEN_FEE") + .unwrap_or("1000000000000000".to_string()) .parse() .unwrap(); pub static ref CREATE_ASSET_FEE: u128 = env::var("CREATE_ASSET_FEE") diff --git a/smoketest/src/helper.rs b/smoketest/src/helper.rs index 7f489acf5e..c29a78d2f0 100644 --- a/smoketest/src/helper.rs +++ b/smoketest/src/helper.rs @@ -267,7 +267,7 @@ pub async fn construct_create_agent_call( pub async fn construct_create_channel_call( bridge_hub_client: &Box>, ) -> Result, Box> { - let call = bridgehub::api::ethereum_control::calls::TransactionApi + let call = bridgehub::api::ethereum_system::calls::TransactionApi .create_channel(OperatingMode::Normal) .encode_call_data(&bridge_hub_client.metadata())?; diff --git a/smoketest/tests/set_pricing_params.rs b/smoketest/tests/set_pricing_params.rs index 91d3d0b480..152d867fae 100644 --- a/smoketest/tests/set_pricing_params.rs +++ b/smoketest/tests/set_pricing_params.rs @@ -4,7 +4,7 @@ use snowbridge_smoketest::{ contracts::{i_gateway, i_gateway::PricingParametersChangedFilter}, helper::*, parachains::bridgehub::api::{ - ethereum_control::events::PricingParametersChanged, + ethereum_system::events::PricingParametersChanged, runtime_types::{ self, bridge_hub_rococo_runtime::RuntimeCall as BHRuntimeCall, @@ -22,7 +22,7 @@ async fn set_pricing_params() { let gateway_addr: Address = GATEWAY_PROXY_CONTRACT.into(); let ethereum_client = *(test_clients.ethereum_client.clone()); let gateway = i_gateway::IGateway::new(gateway_addr, ethereum_client.clone()); - let params = gateway.get_pricing_parameters().await.expect("get fees"); + let params = gateway.pricing_parameters().await.expect("get fees"); println!("pricing params {:?}", params); let set_pricing_params_call = BHRuntimeCall::EthereumSystem( @@ -43,6 +43,6 @@ async fn set_pricing_params() { wait_for_ethereum_event::(&test_clients.ethereum_client).await; - let params = gateway.get_pricing_parameters().await.expect("get fees"); + let params = gateway.pricing_parameters().await.expect("get fees"); println!("pricing params {:?}", params); } diff --git a/smoketest/tests/set_token_transfer_fees.rs b/smoketest/tests/set_token_transfer_fees.rs index 4dfceefc77..e73cac6e60 100644 --- a/smoketest/tests/set_token_transfer_fees.rs +++ b/smoketest/tests/set_token_transfer_fees.rs @@ -5,7 +5,9 @@ use snowbridge_smoketest::{ helper::*, parachains::bridgehub::api::{ ethereum_system::events::SetTokenTransferFees, - runtime_types::{self, bridge_hub_rococo_runtime::RuntimeCall as BHRuntimeCall}, + runtime_types::{ + self, bridge_hub_rococo_runtime::RuntimeCall as BHRuntimeCall, primitive_types::U256, + }, }, }; @@ -16,14 +18,14 @@ async fn set_token_transfer_fees() { let gateway_addr: Address = GATEWAY_PROXY_CONTRACT.into(); let ethereum_client = *(test_clients.ethereum_client.clone()); let gateway = i_gateway::IGateway::new(gateway_addr, ethereum_client.clone()); - let fees = gateway.register_token_fee().await.expect("get fees"); + let fees = gateway.quote_register_token_fee().await.expect("get fees"); println!("register fees {:?}", fees); let set_token_fees_call = BHRuntimeCall::EthereumSystem( runtime_types::snowbridge_system::pallet::Call::set_token_transfer_fees { - create: *CREATE_ASSET_FEE, - transfer: *RESERVE_TRANSFER_FEE, - register: *REGISTER_TOKEN_FEE, + create_asset_xcm: *CREATE_ASSET_FEE, + transfer_asset_xcm: *RESERVE_TRANSFER_FEE, + register_token: U256([*REGISTER_TOKEN_FEE, 0, 0, 0]), }, ); @@ -35,6 +37,6 @@ async fn set_token_transfer_fees() { wait_for_ethereum_event::(&test_clients.ethereum_client).await; - let fees = gateway.register_token_fee().await.expect("get fees"); + let fees = gateway.quote_register_token_fee().await.expect("get fees"); println!("asset fees {:?}", fees); } From cc89d90409c0a573944c027b2834a4b491ad5f2d Mon Sep 17 00:00:00 2001 From: ron Date: Thu, 30 Nov 2023 22:05:09 +0800 Subject: [PATCH 3/5] Increase REGISTER_TOKEN_FEE to enough --- smoketest/src/constants.rs | 2 +- web/packages/test/scripts/set-env.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/smoketest/src/constants.rs b/smoketest/src/constants.rs index ed388c2e3f..1030441d56 100644 --- a/smoketest/src/constants.rs +++ b/smoketest/src/constants.rs @@ -48,7 +48,7 @@ pub const FERDIE: [u8; 32] = lazy_static! { pub static ref REGISTER_TOKEN_FEE: u64 = env::var("REGISTER_TOKEN_FEE") - .unwrap_or("1000000000000000".to_string()) + .unwrap_or("200000000000000000".to_string()) .parse() .unwrap(); pub static ref CREATE_ASSET_FEE: u128 = env::var("CREATE_ASSET_FEE") diff --git a/web/packages/test/scripts/set-env.sh b/web/packages/test/scripts/set-env.sh index f3a7c95ffe..3adeeef3dc 100755 --- a/web/packages/test/scripts/set-env.sh +++ b/web/packages/test/scripts/set-env.sh @@ -85,7 +85,7 @@ export MINIMUM_REQUIRED_SIGNATURES="${MINIMUM_REQUIRED_SIGNATURES:-16}" export REJECT_OUTBOUND_MESSAGES=false ## Fee -export REGISTER_TOKEN_FEE="${REGISTER_TOKEN_FEE:-100000000000000000}" +export REGISTER_TOKEN_FEE="${REGISTER_TOKEN_FEE:-200000000000000000}" export DELIVERY_COST="${DELIVERY_COST:-10000000000}" export CREATE_ASSET_FEE="${CREATE_ASSET_FEE:-10000000000}" export RESERVE_TRANSFER_FEE="${RESERVE_TRANSFER_FEE:-10000000000}" From 67e20a72d7eb222b170c6ef100174432cb8fa6e3 Mon Sep 17 00:00:00 2001 From: ron Date: Thu, 30 Nov 2023 22:44:17 +0800 Subject: [PATCH 4/5] Update sdk --- parachain/Cargo.toml | 12 ++++++++++++ parachain/runtime/tests/Cargo.toml | 12 ++++++++++++ polkadot-sdk | 2 +- 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/parachain/Cargo.toml b/parachain/Cargo.toml index 9858cd6324..5398aff35f 100644 --- a/parachain/Cargo.toml +++ b/parachain/Cargo.toml @@ -14,3 +14,15 @@ members = [ "pallets/system/runtime-api", "runtime/runtime-common", ] + +[patch.'https://github.com/snowfork/snowbridge'] +snowbridge-beacon-primitives = { path = "./primitives/beacon" } +snowbridge-system = { path = "./pallets/system" } +snowbridge-system-runtime-api = { path = "./pallets/system/runtime-api" } +snowbridge-core = { path = "./primitives/core" } +snowbridge-ethereum-beacon-client = { path = "./pallets/ethereum-beacon-client" } +snowbridge-inbound-queue = { path = "./pallets/inbound-queue" } +snowbridge-outbound-queue = { path = "./pallets/outbound-queue" } +snowbridge-outbound-queue-runtime-api = { path = "./pallets/outbound-queue/runtime-api" } +snowbridge-router-primitives = { path = "./primitives/router" } +snowbridge-runtime-common = { path = "./runtime/runtime-common" } diff --git a/parachain/runtime/tests/Cargo.toml b/parachain/runtime/tests/Cargo.toml index 65626b3f35..db8ec0c0d6 100644 --- a/parachain/runtime/tests/Cargo.toml +++ b/parachain/runtime/tests/Cargo.toml @@ -230,3 +230,15 @@ experimental = ["pallet-aura/experimental"] # deployment. This will disable stuff that shouldn't be part of the on-chain wasm # to make it smaller like logging for example. on-chain-release-build = ["sp-api/disable-logging"] + +[patch.'https://github.com/snowfork/snowbridge'] +snowbridge-beacon-primitives = { path = "../../primitives/beacon" } +snowbridge-system = { path = "../../pallets/system" } +snowbridge-system-runtime-api = { path = "../../pallets/system/runtime-api" } +snowbridge-core = { path = "../../primitives/core" } +snowbridge-ethereum-beacon-client = { path = "../../pallets/ethereum-beacon-client" } +snowbridge-inbound-queue = { path = "../../pallets/inbound-queue" } +snowbridge-outbound-queue = { path = "../../pallets/outbound-queue" } +snowbridge-outbound-queue-runtime-api = { path = "../../pallets/outbound-queue/runtime-api" } +snowbridge-router-primitives = { path = "../../primitives/router" } +snowbridge-runtime-common = { path = "../../runtime/runtime-common" } diff --git a/polkadot-sdk b/polkadot-sdk index 42367d69f5..3e0b4bb6a0 160000 --- a/polkadot-sdk +++ b/polkadot-sdk @@ -1 +1 @@ -Subproject commit 42367d69f5fe769b921c4b9dd812f048c2333ccb +Subproject commit 3e0b4bb6a067c5ec1be026e7876129b9191f6ae2 From 25777c15d42b73f193f49157ec9a3457f2fa0ab3 Mon Sep 17 00:00:00 2001 From: ron Date: Fri, 1 Dec 2023 09:35:25 +0800 Subject: [PATCH 5/5] Update sdk --- polkadot-sdk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/polkadot-sdk b/polkadot-sdk index 3e0b4bb6a0..545c5e8544 160000 --- a/polkadot-sdk +++ b/polkadot-sdk @@ -1 +1 @@ -Subproject commit 3e0b4bb6a067c5ec1be026e7876129b9191f6ae2 +Subproject commit 545c5e8544170844d914c85232c05a32c309f548