From cd8b06692975637e02fb53a9d8966ce8a5bcc9f2 Mon Sep 17 00:00:00 2001 From: SunTiebing <1045060705@qq.com> Date: Mon, 1 Jul 2024 22:37:39 +0800 Subject: [PATCH 01/22] Bifrost v0.12.0 --- Cargo.lock | 2 +- node/cli/Cargo.toml | 2 +- runtime/bifrost-kusama/src/lib.rs | 2 +- runtime/bifrost-polkadot/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 200283235..9ba7f5d67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -778,7 +778,7 @@ dependencies = [ [[package]] name = "bifrost-cli" -version = "0.11.0" +version = "0.12.0" dependencies = [ "bifrost-primitives", "bifrost-service", diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index 73f754bfa..bcb5d41b7 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bifrost-cli" -version = "0.11.0" +version = "0.12.0" authors = ["Liebi Technologies "] description = "Bifrost Parachain Node" build = "build.rs" diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index a93e1549a..e287e4f5b 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -143,7 +143,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bifrost"), impl_name: create_runtime_str!("bifrost"), authoring_version: 1, - spec_version: 11000, + spec_version: 12000, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 2dce7de4a..5c7803d30 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -141,7 +141,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("bifrost_polkadot"), impl_name: create_runtime_str!("bifrost_polkadot"), authoring_version: 0, - spec_version: 11000, + spec_version: 12000, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From c5a41097cb1b32a51857c27a974368974dcf8695 Mon Sep 17 00:00:00 2001 From: SunTiebing <1045060705@qq.com> Date: Tue, 2 Jul 2024 21:05:55 +0800 Subject: [PATCH 02/22] remove old migrations --- runtime/bifrost-kusama/src/lib.rs | 9 +-------- runtime/bifrost-polkadot/src/lib.rs | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index e287e4f5b..b0346cf55 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -2045,14 +2045,7 @@ pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = ( - bifrost_slpx::migration::v1::MigrateToV1, - frame_support::migrations::RemovePallet< - DmpQueuePalletName, - ::DbWeight, - >, - pallet_xcm::migration::MigrateToLatestXcmVersion, - ); + pub type Unreleased = (); } /// Executive: handles dispatch to the various modules. diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 5c7803d30..37ac3111f 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -1879,14 +1879,7 @@ pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = ( - bifrost_slpx::migration::v1::MigrateToV1, - frame_support::migrations::RemovePallet< - DmpQueuePalletName, - ::DbWeight, - >, - pallet_xcm::migration::MigrateToLatestXcmVersion, - ); + pub type Unreleased = (); } /// Executive: handles dispatch to the various modules. From 21a0270c3085550b815d64882261d71ba6527057 Mon Sep 17 00:00:00 2001 From: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:17:07 +0800 Subject: [PATCH 03/22] Fix vtokenVoting.removeDelegatorVote (#1288) * add PollClass type * add the calss parameter to the remove_delegator_vote method --- pallets/vtoken-voting/src/benchmarking.rs | 3 +- pallets/vtoken-voting/src/call.rs | 10 ++--- pallets/vtoken-voting/src/lib.rs | 4 +- pallets/vtoken-voting/src/tests.rs | 4 ++ pallets/vtoken-voting/src/weights.rs | 44 +++++++++---------- .../src/weights/bifrost_vtoken_voting.rs | 44 +++++++++---------- .../src/weights/bifrost_vtoken_voting.rs | 44 +++++++++---------- 7 files changed, 80 insertions(+), 73 deletions(-) diff --git a/pallets/vtoken-voting/src/benchmarking.rs b/pallets/vtoken-voting/src/benchmarking.rs index 72159e0e5..1e397ec57 100644 --- a/pallets/vtoken-voting/src/benchmarking.rs +++ b/pallets/vtoken-voting/src/benchmarking.rs @@ -180,6 +180,7 @@ mod benchmarks { whitelist_account!(caller); let origin = RawOrigin::Signed(caller); let vtoken = VKSM; + let class = 0u16; let poll_index = 0u32; let vote = account_vote::(100u32.into()); let derivative_index = 0u16; @@ -208,7 +209,7 @@ mod benchmarks { )?; #[extrinsic_call] - _(origin, vtoken, poll_index, derivative_index); + _(origin, vtoken, class, poll_index, derivative_index); Ok(()) } diff --git a/pallets/vtoken-voting/src/call.rs b/pallets/vtoken-voting/src/call.rs index 2ab5093bc..956d2a15a 100644 --- a/pallets/vtoken-voting/src/call.rs +++ b/pallets/vtoken-voting/src/call.rs @@ -19,7 +19,7 @@ #![allow(ambiguous_glob_reexports)] #![allow(unused_imports)] -use crate::{AccountVote, BalanceOf, Config, DerivativeIndex, PollIndex}; +use crate::{AccountVote, BalanceOf, Config, DerivativeIndex, PollClass, PollIndex}; use parity_scale_codec::{Decode, Encode}; use sp_runtime::{traits::StaticLookup, RuntimeDebug}; use sp_std::prelude::*; @@ -61,15 +61,15 @@ pub enum ConvictionVoting { #[codec(index = 0)] Vote(#[codec(compact)] PollIndex, AccountVote>), #[codec(index = 3)] - Unlock(u16, ::Source), + Unlock(PollClass, ::Source), #[codec(index = 4)] - RemoveVote(Option, PollIndex), + RemoveVote(Option, PollIndex), } pub trait ConvictionVotingCall { fn vote(poll_index: PollIndex, vote: AccountVote>) -> Self; - fn remove_vote(class: Option, poll_index: PollIndex) -> Self; + fn remove_vote(class: Option, poll_index: PollIndex) -> Self; } impl ConvictionVotingCall for RelayCall { @@ -77,7 +77,7 @@ impl ConvictionVotingCall for RelayCall { Self::ConvictionVoting(ConvictionVoting::Vote(poll_index, vote)) } - fn remove_vote(class: Option, poll_index: PollIndex) -> Self { + fn remove_vote(class: Option, poll_index: PollIndex) -> Self { Self::ConvictionVoting(ConvictionVoting::RemoveVote(class, poll_index)) } } diff --git a/pallets/vtoken-voting/src/lib.rs b/pallets/vtoken-voting/src/lib.rs index 3cd4ea416..5d99397b8 100644 --- a/pallets/vtoken-voting/src/lib.rs +++ b/pallets/vtoken-voting/src/lib.rs @@ -66,6 +66,7 @@ use xcm::v4::{prelude::*, Weight as XcmWeight}; const CONVICTION_VOTING_ID: LockIdentifier = *b"vtvoting"; type PollIndex = u32; +type PollClass = u16; pub type AccountIdOf = ::AccountId; @@ -557,6 +558,7 @@ pub mod pallet { pub fn remove_delegator_vote( origin: OriginFor, vtoken: CurrencyIdOf, + #[pallet::compact] class: PollClass, #[pallet::compact] poll_index: PollIndex, #[pallet::compact] derivative_index: DerivativeIndex, ) -> DispatchResult { @@ -570,7 +572,7 @@ pub mod pallet { response: Default::default(), }; let remove_vote_call = - as ConvictionVotingCall>::remove_vote(None, poll_index); + as ConvictionVotingCall>::remove_vote(Some(class), poll_index); let (weight, extra_fee) = T::XcmDestWeightAndFee::get_operation_weight_and_fee( CurrencyId::to_token(&vtoken).map_err(|_| Error::::NoData)?, XcmOperationType::RemoveVote, diff --git a/pallets/vtoken-voting/src/tests.rs b/pallets/vtoken-voting/src/tests.rs index 48f204fa2..de56e74e0 100644 --- a/pallets/vtoken-voting/src/tests.rs +++ b/pallets/vtoken-voting/src/tests.rs @@ -892,6 +892,7 @@ fn notify_vote_with_no_data_works() { #[test] fn notify_remove_delegator_vote_success_works() { new_test_ext().execute_with(|| { + let class = 0; let poll_index = 3; let vtoken = VKSM; let mut query_id = 0; @@ -939,6 +940,7 @@ fn notify_remove_delegator_vote_success_works() { assert_ok!(VtokenVoting::remove_delegator_vote( RuntimeOrigin::signed(ALICE), vtoken, + class, poll_index, derivative_index, )); @@ -967,6 +969,7 @@ fn notify_remove_delegator_vote_success_works() { #[test] fn notify_remove_delegator_vote_fail_works() { new_test_ext().execute_with(|| { + let class = 0; let poll_index = 3; let vtoken = VKSM; let mut query_id = 0; @@ -1014,6 +1017,7 @@ fn notify_remove_delegator_vote_fail_works() { assert_ok!(VtokenVoting::remove_delegator_vote( RuntimeOrigin::signed(ALICE), vtoken, + class, poll_index, derivative_index, )); diff --git a/pallets/vtoken-voting/src/weights.rs b/pallets/vtoken-voting/src/weights.rs index 8005536f1..d67897e71 100644 --- a/pallets/vtoken-voting/src/weights.rs +++ b/pallets/vtoken-voting/src/weights.rs @@ -174,30 +174,30 @@ impl WeightInfo for () { .saturating_add(RocksDbWeight::get().reads(8_u64)) .saturating_add(RocksDbWeight::get().writes(4_u64)) } - /// Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) - /// Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - /// Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) - /// Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - /// Storage: ParachainSystem ValidationData (r:1 w:0) - /// Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: VtokenVoting DelegatorVote (r:1 w:0) - /// Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - /// Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - /// Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - /// Storage: PolkadotXcm QueryCounter (r:1 w:1) - /// Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - /// Storage: ParachainInfo ParachainId (r:1 w:0) - /// Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - /// Storage: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) - /// Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - /// Storage: PolkadotXcm Queries (r:0 w:1) - /// Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + /// Storage: `VtokenVoting::DelegatorVotes` (r:1 w:0) + /// Proof: `VtokenVoting::DelegatorVotes` (`max_values`: None, `max_size`: Some(5136), added: 7611, mode: `MaxEncodedLen`) + /// Storage: `VtokenVoting::ReferendumInfoFor` (r:1 w:0) + /// Proof: `VtokenVoting::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) + /// Storage: `ParachainSystem::ValidationData` (r:1 w:0) + /// Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + /// Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `XcmInterface::XcmWeightAndFee` (r:1 w:0) + /// Proof: `XcmInterface::XcmWeightAndFee` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `VtokenVoting::PendingRemoveDelegatorVote` (r:0 w:1) + /// Proof: `VtokenVoting::PendingRemoveDelegatorVote` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_delegator_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `965` - // Estimated: `4430` - // Minimum execution time: 86_949_000 picoseconds. - Weight::from_parts(112_996_000, 4430) + // Measured: `1048` + // Estimated: `8601` + // Minimum execution time: 35_000_000 picoseconds. + Weight::from_parts(36_000_000, 8601) .saturating_add(RocksDbWeight::get().reads(7_u64)) .saturating_add(RocksDbWeight::get().writes(3_u64)) } diff --git a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs index 361ddb923..8939443b4 100644 --- a/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs +++ b/runtime/bifrost-kusama/src/weights/bifrost_vtoken_voting.rs @@ -159,30 +159,30 @@ impl bifrost_vtoken_voting::WeightInfo for BifrostWeigh .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } - // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) - // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) - // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - // Storage: VtokenVoting DelegatorVote (r:1 w:0) - // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm QueryCounter (r:1 w:1) - // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) - // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - // Storage: PolkadotXcm Queries (r:0 w:1) - // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + // Storage: `VtokenVoting::DelegatorVotes` (r:1 w:0) + // Proof: `VtokenVoting::DelegatorVotes` (`max_values`: None, `max_size`: Some(5136), added: 7611, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::ReferendumInfoFor` (r:1 w:0) + // Proof: `VtokenVoting::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::ValidationData` (r:1 w:0) + // Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + // Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmInterface::XcmWeightAndFee` (r:1 w:0) + // Proof: `XcmInterface::XcmWeightAndFee` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + // Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainInfo::ParachainId` (r:1 w:0) + // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::PendingRemoveDelegatorVote` (r:0 w:1) + // Proof: `VtokenVoting::PendingRemoveDelegatorVote` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + // Storage: `PolkadotXcm::Queries` (r:0 w:1) + // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_delegator_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `965` - // Estimated: `4430` - // Minimum execution time: 94_053 nanoseconds. - Weight::from_parts(105_489_000, 4430) + // Measured: `1048` + // Estimated: `8601` + // Minimum execution time: 34_000 nanoseconds. + Weight::from_parts(35_000_000, 8601) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs index 361ddb923..8939443b4 100644 --- a/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs +++ b/runtime/bifrost-polkadot/src/weights/bifrost_vtoken_voting.rs @@ -159,30 +159,30 @@ impl bifrost_vtoken_voting::WeightInfo for BifrostWeigh .saturating_add(T::DbWeight::get().reads(8)) .saturating_add(T::DbWeight::get().writes(4)) } - // Storage: VtokenVoting ReferendumInfoFor (r:1 w:0) - // Proof: VtokenVoting ReferendumInfoFor (max_values: None, max_size: Some(88), added: 2563, mode: MaxEncodedLen) - // Storage: VtokenVoting VoteLockingPeriod (r:1 w:0) - // Proof: VtokenVoting VoteLockingPeriod (max_values: None, max_size: Some(26), added: 2501, mode: MaxEncodedLen) - // Storage: ParachainSystem ValidationData (r:1 w:0) - // Proof Skipped: ParachainSystem ValidationData (max_values: Some(1), max_size: None, mode: Measured) - // Storage: VtokenVoting DelegatorVote (r:1 w:0) - // Proof: VtokenVoting DelegatorVote (max_values: None, max_size: Some(81), added: 2556, mode: MaxEncodedLen) - // Storage: XcmInterface XcmWeightAndFee (r:1 w:0) - // Proof Skipped: XcmInterface XcmWeightAndFee (max_values: None, max_size: None, mode: Measured) - // Storage: PolkadotXcm QueryCounter (r:1 w:1) - // Proof Skipped: PolkadotXcm QueryCounter (max_values: Some(1), max_size: None, mode: Measured) - // Storage: ParachainInfo ParachainId (r:1 w:0) - // Proof: ParachainInfo ParachainId (max_values: Some(1), max_size: Some(4), added: 499, mode: MaxEncodedLen) - // Storage: VtokenVoting PendingRemoveDelegatorVote (r:0 w:1) - // Proof: VtokenVoting PendingRemoveDelegatorVote (max_values: None, max_size: Some(36), added: 2511, mode: MaxEncodedLen) - // Storage: PolkadotXcm Queries (r:0 w:1) - // Proof Skipped: PolkadotXcm Queries (max_values: None, max_size: None, mode: Measured) + // Storage: `VtokenVoting::DelegatorVotes` (r:1 w:0) + // Proof: `VtokenVoting::DelegatorVotes` (`max_values`: None, `max_size`: Some(5136), added: 7611, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::ReferendumInfoFor` (r:1 w:0) + // Proof: `VtokenVoting::ReferendumInfoFor` (`max_values`: None, `max_size`: Some(88), added: 2563, mode: `MaxEncodedLen`) + // Storage: `ParachainSystem::ValidationData` (r:1 w:0) + // Proof: `ParachainSystem::ValidationData` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainSystem::LastRelayChainBlockNumber` (r:1 w:0) + // Proof: `ParachainSystem::LastRelayChainBlockNumber` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `XcmInterface::XcmWeightAndFee` (r:1 w:0) + // Proof: `XcmInterface::XcmWeightAndFee` (`max_values`: None, `max_size`: None, mode: `Measured`) + // Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + // Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + // Storage: `ParachainInfo::ParachainId` (r:1 w:0) + // Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + // Storage: `VtokenVoting::PendingRemoveDelegatorVote` (r:0 w:1) + // Proof: `VtokenVoting::PendingRemoveDelegatorVote` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + // Storage: `PolkadotXcm::Queries` (r:0 w:1) + // Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) fn remove_delegator_vote() -> Weight { // Proof Size summary in bytes: - // Measured: `965` - // Estimated: `4430` - // Minimum execution time: 94_053 nanoseconds. - Weight::from_parts(105_489_000, 4430) + // Measured: `1048` + // Estimated: `8601` + // Minimum execution time: 34_000 nanoseconds. + Weight::from_parts(35_000_000, 8601) .saturating_add(T::DbWeight::get().reads(7)) .saturating_add(T::DbWeight::get().writes(3)) } From 55ecaec79f47e4b4062f394e3fba6fb3ca471248 Mon Sep 17 00:00:00 2001 From: yooml Date: Wed, 10 Jul 2024 15:17:59 +0800 Subject: [PATCH 04/22] Add metadata hash (#1299) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * Fix compile * feat: 🎸 add metadata-hash-extension (#1265) * feat: 🎸 add metadata-hash-extension * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Feat/add vtoken exchange rate rpc (#1277) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * supplement omissions: adjust the RPC exchange rate precision to three decimal places * Remove dmp queue (#1279) * fix: 🐛 CheckMetadataHash to false * fix: 🐛 update sp-api * refactor: 💡 fmt * fix: 🐛 add metadata-hash * fix: 🐛 add feature metadata-hash * fix: 🐛 rm metadata-hash feature --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: NingBo Wang <2536935847@qq.com> Co-authored-by: Edwin Wang --- Cargo.lock | 95 +++++++++++++++++++++++------ Cargo.toml | 5 +- node/cli/Cargo.toml | 2 +- node/service/Cargo.toml | 1 - runtime/bifrost-kusama/Cargo.toml | 6 +- runtime/bifrost-kusama/build.rs | 13 ++-- runtime/bifrost-kusama/src/lib.rs | 2 + runtime/bifrost-polkadot/Cargo.toml | 6 +- runtime/bifrost-polkadot/build.rs | 13 ++-- runtime/bifrost-polkadot/src/lib.rs | 1 + 10 files changed, 111 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 40cae66ac..2d074a0cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1111,6 +1111,7 @@ dependencies = [ "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -1264,6 +1265,7 @@ dependencies = [ "cumulus-primitives-utility", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -4590,6 +4592,22 @@ dependencies = [ "serde", ] +[[package]] +name = "frame-metadata-hash-extension" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bb1eec9eb46d3e016c95b2fa875118c04609f2150013c56a894cae00581e265" +dependencies = [ + "array-bytes 6.2.2", + "docify", + "frame-support", + "frame-system", + "log", + "parity-scale-codec", + "scale-info", + "sp-runtime", +] + [[package]] name = "frame-remote-externalities" version = "0.36.0" @@ -5345,7 +5363,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -6742,6 +6760,20 @@ dependencies = [ "sp-std", ] +[[package]] +name = "merkleized-metadata" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f313fcff1d2a4bcaa2deeaa00bf7530d77d5f7bd0467a117dde2e29a75a7a17a" +dependencies = [ + "array-bytes 6.2.2", + "blake3", + "frame-metadata", + "parity-scale-codec", + "scale-decode", + "scale-info", +] + [[package]] name = "merlin" version = "3.0.0" @@ -12502,6 +12534,29 @@ dependencies = [ "sp-arithmetic", ] +[[package]] +name = "scale-bits" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" +dependencies = [ + "parity-scale-codec", + "scale-type-resolver", +] + +[[package]] +name = "scale-decode" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" +dependencies = [ + "derive_more", + "parity-scale-codec", + "scale-bits", + "scale-type-resolver", + "smallvec", +] + [[package]] name = "scale-info" version = "2.11.3" @@ -12528,6 +12583,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "scale-type-resolver" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0cded6518aa0bd6c1be2b88ac81bf7044992f0f154bfbabd5ad34f43512abcb" + [[package]] name = "schannel" version = "0.1.23" @@ -13100,9 +13161,9 @@ dependencies = [ [[package]] name = "sp-api" -version = "27.0.0" +version = "27.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef42aa652381ade883c14ffbbb5c0fec36d382d2217b5bace01b8a0e8634778" +checksum = "2e4f8702afd77f14a32733e2b589c02694bf79d0b3a641963c508016208724d0" dependencies = [ "hash-db 0.16.0", "log", @@ -13122,9 +13183,9 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "15.0.0" +version = "15.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0694be2891593450916d6b53a274d234bccbc86bcbada36ba23fc356989070c7" +checksum = "0301e2f77afb450fbf2b093f8b324c7ad88cc82e5e69bd5dc8658a1f068b2a96" dependencies = [ "Inflector", "blake2 0.10.6", @@ -14250,16 +14311,25 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "18.0.0" +version = "18.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "511bbc2df035f5fe2556d855369a1bbb45df620360391a1f6e3fa1a1d64af79a" +checksum = "4a39a20e17c24ede36b5bd5e7543a4cef8d8a0daf6e1a046dc31832b837a54a0" dependencies = [ + "array-bytes 6.2.2", "build-helper", "cargo_metadata", "console", "filetime", + "frame-metadata", + "merkleized-metadata", + "parity-scale-codec", "parity-wasm", + "sc-executor", + "sp-core", + "sp-io", "sp-maybe-compressed-blob", + "sp-tracing", + "sp-version", "strum 0.24.1", "tempfile", "toml 0.8.12", @@ -15783,7 +15853,7 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core 0.51.1", + "windows-core", "windows-targets 0.48.5", ] @@ -15796,15 +15866,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.5", -] - [[package]] name = "windows-sys" version = "0.45.0" diff --git a/Cargo.toml b/Cargo.toml index 7985cd2db..7f9b60fe8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -134,6 +134,7 @@ cumulus-primitives-utility = { version = "0.8.0", default-featur cumulus-test-relay-sproof-builder = { version = "0.8.0", default-features = false } frame-benchmarking = { version = "29.0.0", default-features = false } frame-executive = { version = "29.0.0", default-features = false } +frame-metadata-hash-extension = { version = "0.1.0", default-features = false } frame-support = { version = "29.0.0", default-features = false } frame-system = { version = "29.0.0", default-features = false } frame-system-benchmarking = { version = "29.0.0", default-features = false } @@ -181,7 +182,7 @@ polkadot-parachain-primitives = { version = "7.0.0", default-featur polkadot-primitives = { version = "8.0.0", default-features = false } polkadot-runtime-common = { version = "8.0.0", default-features = false } polkadot-runtime-parachains = { version = "8.0.0", default-features = false } -sp-api = { version = "27.0.0", default-features = false } +sp-api = { version = "27.0.1", default-features = false } sp-application-crypto = { version = "31.0.0", default-features = false } sp-arithmetic = { version = "24.0.0", default-features = false } sp-authority-discovery = { version = "27.0.0", default-features = false } @@ -266,7 +267,7 @@ sp-rpc = { version = "27.0.0" } substrate-build-script-utils = { version = "11.0.0" } substrate-frame-rpc-system = { version = "29.0.0" } substrate-prometheus-endpoint = { version = "0.17.0" } -substrate-wasm-builder = { version = "18.0.0" } +substrate-wasm-builder = { version = "18.0.1" } try-runtime-cli = { version = "0.39.0" } xcm-emulator = { version = "0.6.0" } xcm-simulator = { version = "8.0.0" } diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index bcb5d41b7..c165010b1 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -77,4 +77,4 @@ with-bifrost-kusama-runtime = ["bifrost-service/with-bifrost-kusama-runtime"] with-bifrost-polkadot-runtime = ["bifrost-service/with-bifrost-polkadot-runtime"] with-all-runtime = ["with-bifrost-runtime"] try-runtime = ["bifrost-service/try-runtime", "try-runtime-cli/try-runtime"] -fast-runtime = ["bifrost-service/fast-runtime"] +fast-runtime = ["bifrost-service/fast-runtime"] \ No newline at end of file diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index da5e8ae5b..5d0572e79 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -138,4 +138,3 @@ fast-runtime = [ "bifrost-kusama-runtime/fast-runtime", "bifrost-polkadot-runtime/fast-runtime", ] - diff --git a/runtime/bifrost-kusama/Cargo.toml b/runtime/bifrost-kusama/Cargo.toml index 3df0cc57f..a07343319 100644 --- a/runtime/bifrost-kusama/Cargo.toml +++ b/runtime/bifrost-kusama/Cargo.toml @@ -21,6 +21,7 @@ serde_json = { workspace = true } # frame dependencies frame-benchmarking = { workspace = true, optional = true } frame-executive = { workspace = true } +frame-metadata-hash-extension = { workspace = true } frame-support = { workspace = true, features = ["tuples-96"] } frame-system = { workspace = true } frame-system-benchmarking = { workspace = true, optional = true } @@ -158,6 +159,7 @@ std = [ "frame-benchmarking?/std", "frame-executive/std", + "frame-metadata-hash-extension/std", "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", @@ -394,6 +396,8 @@ try-runtime = [ "bifrost-channel-commission/try-runtime", ] +# Enable the metadata hash generation in the wasm builder. +metadata-hash = ["substrate-wasm-builder?/metadata-hash"] # When enabled, the runtime API will not be build. # # This is required by Cumulus to access certain types of the @@ -404,7 +408,7 @@ disable-runtime-api = [] # A feature that should be enabled when the runtime should be build for on-chain # 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"] +on-chain-release-build = ["sp-api/disable-logging", "metadata-hash"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/runtime/bifrost-kusama/build.rs b/runtime/bifrost-kusama/build.rs index a6d8f457d..2cacbff1a 100644 --- a/runtime/bifrost-kusama/build.rs +++ b/runtime/bifrost-kusama/build.rs @@ -16,14 +16,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#[cfg(feature = "std")] +#[cfg(all(feature = "std", feature = "metadata-hash"))] fn main() { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() + substrate_wasm_builder::WasmBuilder::init_with_defaults() + .enable_metadata_hash("BNC", 12) .build() } +#[cfg(all(feature = "std", not(feature = "metadata-hash")))] +fn main() { + substrate_wasm_builder::WasmBuilder::build_using_defaults() +} + #[cfg(not(feature = "std"))] fn main() {} diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index b0346cf55..2dadb3a48 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -923,6 +923,7 @@ where frame_system::CheckNonce::::from(nonce), frame_system::CheckWeight::::new(), pallet_transaction_payment::ChargeTransactionPayment::::from(tip), + frame_metadata_hash_extension::CheckMetadataHash::::new(false), ); let raw_payload = SignedPayload::new(call, extra) .map_err(|e| { @@ -2020,6 +2021,7 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, + frame_metadata_hash_extension::CheckMetadataHash, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index c152356c3..f8f4715a3 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -21,6 +21,7 @@ serde_json = { workspace = true } # frame dependencies frame-benchmarking = { workspace = true, optional = true } frame-executive = { workspace = true } +frame-metadata-hash-extension = { workspace = true } frame-support = { workspace = true, features = ["tuples-96"] } frame-system = { workspace = true } frame-system-benchmarking = { workspace = true, optional = true } @@ -155,6 +156,7 @@ std = [ "strum/std", "frame-executive/std", + "frame-metadata-hash-extension/std", "frame-support/std", "frame-system-rpc-runtime-api/std", "frame-system/std", @@ -369,6 +371,8 @@ try-runtime = [ "zenlink-protocol/try-runtime", ] +# Enable the metadata hash generation in the wasm builder. +metadata-hash = ["substrate-wasm-builder?/metadata-hash"] # When enabled, the runtime API will not be build. # # This is required by Cumulus to access certain types of the @@ -379,7 +383,7 @@ disable-runtime-api = [] # A feature that should be enabled when the runtime should be build for on-chain # 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"] +on-chain-release-build = ["sp-api/disable-logging", "metadata-hash"] # Set timing constants (e.g. session period) to faster versions to speed up testing. fast-runtime = [] diff --git a/runtime/bifrost-polkadot/build.rs b/runtime/bifrost-polkadot/build.rs index 8b3550ecf..32ac6de12 100644 --- a/runtime/bifrost-polkadot/build.rs +++ b/runtime/bifrost-polkadot/build.rs @@ -15,14 +15,17 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -#[cfg(feature = "std")] +#[cfg(all(feature = "std", feature = "metadata-hash"))] fn main() { - substrate_wasm_builder::WasmBuilder::new() - .with_current_project() - .export_heap_base() - .import_memory() + substrate_wasm_builder::WasmBuilder::init_with_defaults() + .enable_metadata_hash("BNC", 12) .build() } +#[cfg(all(feature = "std", not(feature = "metadata-hash")))] +fn main() { + substrate_wasm_builder::WasmBuilder::build_using_defaults() +} + #[cfg(not(feature = "std"))] fn main() {} diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 37ac3111f..add1e7f42 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -1854,6 +1854,7 @@ pub type SignedExtra = ( frame_system::CheckNonce, frame_system::CheckWeight, pallet_transaction_payment::ChargeTransactionPayment, + frame_metadata_hash_extension::CheckMetadataHash, ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = From 01e0a8e273605914b8d0758b3632dace94e01343 Mon Sep 17 00:00:00 2001 From: yooml Date: Fri, 12 Jul 2024 10:37:37 +0800 Subject: [PATCH 05/22] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20update=20MaxTu?= =?UTF-8?q?rnout=20and=20whitelisted=5Fcaller=20track=20(#1304)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/bifrost-kusama/src/governance/referenda.rs | 2 +- runtime/bifrost-kusama/src/governance/tracks.rs | 8 ++++---- runtime/bifrost-polkadot/src/governance/referenda.rs | 2 +- runtime/bifrost-polkadot/src/governance/tracks.rs | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/runtime/bifrost-kusama/src/governance/referenda.rs b/runtime/bifrost-kusama/src/governance/referenda.rs index 907a1b3f9..f566b2b7e 100644 --- a/runtime/bifrost-kusama/src/governance/referenda.rs +++ b/runtime/bifrost-kusama/src/governance/referenda.rs @@ -35,7 +35,7 @@ impl pallet_conviction_voting::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type Polls = Referenda; - type MaxTurnout = frame_support::traits::TotalIssuanceOf; + type MaxTurnout = frame_support::traits::ActiveIssuanceOf; // Maximum number of concurrent votes an account may have type MaxVotes = ConstU32<512>; // Minimum period of vote locking diff --git a/runtime/bifrost-kusama/src/governance/tracks.rs b/runtime/bifrost-kusama/src/governance/tracks.rs index fac57bfc7..613fc32fc 100644 --- a/runtime/bifrost-kusama/src/governance/tracks.rs +++ b/runtime/bifrost-kusama/src/governance/tracks.rs @@ -62,10 +62,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] name: "whitelisted_caller", max_deciding: 100, decision_deposit: 5_000 * BNCS, - prepare_period: 15 * MINUTES, + prepare_period: 5 * MINUTES, decision_period: 14 * DAYS, - confirm_period: 10 * MINUTES, - min_enactment_period: 10 * MINUTES, + confirm_period: 5 * MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: Curve::make_reciprocal( 16, 28 * 24, @@ -73,7 +73,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] percent(50), percent(100), ), - min_support: Curve::make_reciprocal(1, 28, percent(8), percent(2), percent(50)), + min_support: Curve::make_reciprocal(1, 1792, percent(3), percent(2), percent(50)), }, ), ( diff --git a/runtime/bifrost-polkadot/src/governance/referenda.rs b/runtime/bifrost-polkadot/src/governance/referenda.rs index 907a1b3f9..f566b2b7e 100644 --- a/runtime/bifrost-polkadot/src/governance/referenda.rs +++ b/runtime/bifrost-polkadot/src/governance/referenda.rs @@ -35,7 +35,7 @@ impl pallet_conviction_voting::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; type Polls = Referenda; - type MaxTurnout = frame_support::traits::TotalIssuanceOf; + type MaxTurnout = frame_support::traits::ActiveIssuanceOf; // Maximum number of concurrent votes an account may have type MaxVotes = ConstU32<512>; // Minimum period of vote locking diff --git a/runtime/bifrost-polkadot/src/governance/tracks.rs b/runtime/bifrost-polkadot/src/governance/tracks.rs index fac57bfc7..613fc32fc 100644 --- a/runtime/bifrost-polkadot/src/governance/tracks.rs +++ b/runtime/bifrost-polkadot/src/governance/tracks.rs @@ -62,10 +62,10 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] name: "whitelisted_caller", max_deciding: 100, decision_deposit: 5_000 * BNCS, - prepare_period: 15 * MINUTES, + prepare_period: 5 * MINUTES, decision_period: 14 * DAYS, - confirm_period: 10 * MINUTES, - min_enactment_period: 10 * MINUTES, + confirm_period: 5 * MINUTES, + min_enactment_period: 5 * MINUTES, min_approval: Curve::make_reciprocal( 16, 28 * 24, @@ -73,7 +73,7 @@ const TRACKS_DATA: [(u16, pallet_referenda::TrackInfo); 8] percent(50), percent(100), ), - min_support: Curve::make_reciprocal(1, 28, percent(8), percent(2), percent(50)), + min_support: Curve::make_reciprocal(1, 1792, percent(3), percent(2), percent(50)), }, ), ( From 8e45b7fa76b573441db079602dd946c85311c76b Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Fri, 12 Jul 2024 16:37:57 +0800 Subject: [PATCH 06/22] Allow to receive and send Ethereum assets (#1305) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: 🎸 add buy-back * Bifrost v0.10.001 * feat: 🎸 benchmark * SLPx mint support commission id (#1261) * Add vtoken exchange rate rpc (#1260) * fix: 🐛 add event (#1263) * add update_currency_metadata function (#1259) * add update_currency_metadata function * fix: 🐛 correct update_currency_metadata weight * add the use of Vec (#1264) * Add vtoken exchange rate rpc * add the use of Vec * Upgrade to Polkadot-SDK v1.7.0 (#1262) * Bifrost v0.10.0 * fix: 🐛 clippy * Fix chain spec (#1243) * Upgrade to polkadot-v1.7.0 --------- Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: Edwin Wang * feat: 🎸 add metadata-hash-extension (#1265) * Fix compile (#1266) * Fix/fix vtoken voting unlock (#1267) * update the exchange rate of vtokenminting of vtokenvoting test * Resolve the frozen anomaly when unlocking * Revert "feat: 🎸 add metadata-hash-extension (#1265)" (#1268) This reverts commit 489fc9c6adeae44d23edf449e74fde3d6aa40bc3. * rename the version number to 0.11.0 * Slp supports XCMv4 and reconstruct integration tests (#1272) * Fix compile * Reconstruct integration tests and slp supports XCMv4 * Fix slp construct_xcm_message * Feat/slpx mint add commission (#1273) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * Feat/add vtoken exchange rate rpc (#1274) * Add vtoken exchange rate rpc * add the use of Vec * supplement the RPC logic && fix bugs * adjust the RPC exchange rate precision to three decimal places * fix clippy * fix bug: storage migration anomaly (#1276) * SLPx mint support commission id * remove the channel_id parameter from the mint method * add mint_with_channel_id method * perform data migration for OrderQueue storage * slpx: set the default value of channel_id to 0 * resolve conflicts * change the location of the old data structure during storage migration * fix bug: storage migration anomaly * Slp removes refund (#1275) * Slp removes refund * Fix clippy * Allow to receive and send Ethereum assets * Add constants --------- Co-authored-by: yooml Co-authored-by: SunTiebing <1045060705@qq.com> Co-authored-by: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Co-authored-by: Edwin Wang --- Cargo.lock | 2 +- pallets/xcm-interface/src/calls.rs | 38 ++++++----- pallets/xcm-interface/src/lib.rs | 79 ++++++++++++++++++++-- primitives/src/lib.rs | 1 + runtime/bifrost-kusama/src/xcm_config.rs | 38 ++++++++++- runtime/bifrost-polkadot/src/xcm_config.rs | 38 ++++++++++- 6 files changed, 173 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d074a0cc..0257b1ddf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -16434,4 +16434,4 @@ checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", -] +] \ No newline at end of file diff --git a/pallets/xcm-interface/src/calls.rs b/pallets/xcm-interface/src/calls.rs index 99e816841..39dc37a5f 100644 --- a/pallets/xcm-interface/src/calls.rs +++ b/pallets/xcm-interface/src/calls.rs @@ -20,7 +20,7 @@ use frame_support::sp_runtime::MultiSignature; use parity_scale_codec::{Decode, Encode}; use sp_runtime::RuntimeDebug; use sp_std::{boxed::Box, vec::Vec}; -use xcm::{VersionedAssets, VersionedLocation}; +use xcm::{v4::WeightLimit, VersionedAssets, VersionedLocation}; use crate::ChainId; @@ -39,7 +39,7 @@ pub enum StakingCall { } #[derive(Encode, Decode, RuntimeDebug, Clone)] -pub enum PolkadotXcm { +pub enum PolkadotXcmCall { #[codec(index = 2)] ReserveTransferAssets( Box, @@ -47,6 +47,14 @@ pub enum PolkadotXcm { Box, u32, ), + #[codec(index = 8)] + LimitedReserveTransferAssets( + Box, + Box, + Box, + u32, + WeightLimit, + ), } #[derive(Encode, Decode, RuntimeDebug, Clone)] @@ -55,19 +63,6 @@ pub enum SystemCall { RemarkWithEvent(Vec), } -pub mod rococo { - - pub use crate::calls::*; - - #[derive(Encode, Decode, RuntimeDebug)] - pub enum RelaychainCall { - #[codec(index = 28)] - Crowdloan(ContributeCall), - #[codec(index = 91)] - Proxy(ProxyCall), - } -} - pub mod kusama { pub use crate::calls::*; @@ -79,10 +74,15 @@ pub mod kusama { #[codec(index = 30)] Proxy(ProxyCall), } + + #[derive(Encode, Decode, RuntimeDebug)] + pub enum AssetHubCall { + #[codec(index = 31)] + PolkadotXcm(PolkadotXcmCall), + } } pub mod polkadot { - pub use crate::calls::*; #[derive(Encode, Decode, RuntimeDebug)] @@ -92,6 +92,12 @@ pub mod polkadot { #[codec(index = 29)] Proxy(ProxyCall), } + + #[derive(Encode, Decode, RuntimeDebug)] + pub enum AssetHubCall { + #[codec(index = 31)] + PolkadotXcm(PolkadotXcmCall), + } } #[derive(Encode, Decode, RuntimeDebug)] diff --git a/pallets/xcm-interface/src/lib.rs b/pallets/xcm-interface/src/lib.rs index e7ea013fc..f56f617ee 100644 --- a/pallets/xcm-interface/src/lib.rs +++ b/pallets/xcm-interface/src/lib.rs @@ -17,6 +17,7 @@ // along with this program. If not, see . #![cfg_attr(not(feature = "std"), no_std)] +#![allow(unused_imports)] pub mod calls; pub mod traits; @@ -25,20 +26,19 @@ use bifrost_primitives::{traits::XcmDestWeightAndFeeHandler, CurrencyIdMapping, pub use calls::*; use orml_traits::MultiCurrency; pub use pallet::*; +use sp_runtime::traits::UniqueSaturatedInto; pub use traits::{ChainId, MessageId, Nonce, SalpHelper}; macro_rules! use_relay { ({ $( $code:tt )* }) => { if T::RelayNetwork::get() == NetworkId::Polkadot { use polkadot::RelaychainCall; + use polkadot::AssetHubCall; $( $code )* } else if T::RelayNetwork::get() == NetworkId::Kusama { use kusama::RelaychainCall; - - $( $code )* - } else if T::RelayNetwork::get() == NetworkId::Rococo { - use rococo::RelaychainCall; + use kusama::AssetHubCall; $( $code )* } else { @@ -135,6 +135,7 @@ pub mod pallet { pub enum Event { XcmDestWeightAndFeeUpdated(XcmOperationType, CurrencyIdOf, Weight, BalanceOf), TransferredStatemineMultiAsset(AccountIdOf, BalanceOf), + TransferredEthereumAssets(AccountIdOf, sp_core::H160, BalanceOf), } /// The current storage version, we set to 2 our new version(after migrate stroage @@ -278,6 +279,76 @@ pub mod pallet { Ok(()) } + + #[pallet::call_index(2)] + #[pallet::weight({2_000_000_000})] + pub fn transfer_ethereum_assets( + origin: OriginFor, + currency_id: CurrencyIdOf, + amount: BalanceOf, + to: sp_core::H160, + ) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + let asset_location = + T::CurrencyIdConvert::get_location(currency_id).ok_or(Error::::FailToConvert)?; + + let asset: Asset = Asset { + id: AssetId(asset_location), + fun: Fungible(UniqueSaturatedInto::::unique_saturated_into(amount)), + }; + + let (require_weight_at_most, xcm_fee) = + Self::xcm_dest_weight_and_fee(currency_id, XcmOperationType::EthereumTransfer) + .ok_or(Error::::OperationWeightAndFeeNotExist)?; + + let fee: Asset = Asset { + id: AssetId(Location::parent()), + fun: Fungible(UniqueSaturatedInto::::unique_saturated_into(xcm_fee)), + }; + + T::MultiCurrency::withdraw(currency_id, &who, amount)?; + + let remote_call: DoubleEncoded<()> = use_relay!({ + AssetHubCall::PolkadotXcm(PolkadotXcmCall::LimitedReserveTransferAssets( + Box::new(Location::new(2, [GlobalConsensus(Ethereum { chain_id: 1 })]).into()), + Box::new( + Location::new( + 0, + [AccountKey20 { network: None, key: to.to_fixed_bytes() }], + ) + .into(), + ), + Box::new(asset.into()), + 0, + Unlimited, + )) + .encode() + .into() + }); + + let remote_xcm = Xcm(vec![ + WithdrawAsset(fee.clone().into()), + BuyExecution { fees: fee.clone(), weight_limit: Unlimited }, + Transact { + origin_kind: OriginKind::SovereignAccount, + require_weight_at_most, + call: remote_call, + }, + DepositAsset { + assets: All.into(), + beneficiary: Location::new(1, [Parachain(T::ParachainId::get().into())]), + }, + ]); + let (ticket, _) = ::XcmRouter::validate( + &mut Some(Location::new(1, [Parachain(parachains::Statemine::ID)])), + &mut Some(remote_xcm), + ) + .map_err(|_| Error::::UnweighableMessage)?; + ::XcmRouter::deliver(ticket) + .map_err(|_| Error::::XcmExecutionFailed)?; + Self::deposit_event(Event::::TransferredEthereumAssets(who, to, amount)); + Ok(()) + } } impl XcmHelper, BalanceOf> for Pallet { diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 9e675a505..be5155042 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -329,6 +329,7 @@ pub enum XcmOperationType { RemoveVote, Any, SupplementaryFee, + EthereumTransfer, } pub struct ExtraFeeInfo { diff --git a/runtime/bifrost-kusama/src/xcm_config.rs b/runtime/bifrost-kusama/src/xcm_config.rs index edecccb34..bf9e45f8d 100644 --- a/runtime/bifrost-kusama/src/xcm_config.rs +++ b/runtime/bifrost-kusama/src/xcm_config.rs @@ -629,6 +629,38 @@ impl Contains for SafeCallFilter { } } +/// Asset filter that allows all assets from a certain location matching asset id. +pub struct AssetPrefixFrom(PhantomData<(Prefix, Origin)>); +impl ContainsPair for AssetPrefixFrom +where + Prefix: Get, + Origin: Get, +{ + fn contains(asset: &Asset, origin: &Location) -> bool { + let loc = Origin::get(); + &loc == origin && + matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) } + if asset_loc.starts_with(&Prefix::get())) + } +} + +/// Asset filter that allows native/relay asset if coming from a certain location. +pub struct NativeAssetFrom(PhantomData); +impl> ContainsPair for NativeAssetFrom { + fn contains(asset: &Asset, origin: &Location) -> bool { + let loc = T::get(); + &loc == origin && + matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) } + if *asset_loc == Location::from(Parent)) + } +} + +parameter_types! { + /// Location of Asset Hub + pub AssetHubLocation: Location = (Parent, Parachain(1000)).into(); + pub EthereumLocation: Location = Location::new(2, [GlobalConsensus(Ethereum { chain_id: 1 })]); +} + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type AssetClaims = PolkadotXcm; @@ -636,7 +668,11 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = BifrostDropAssets; type Barrier = Barrier; type RuntimeCall = RuntimeCall; - type IsReserve = MultiNativeAsset; + type IsReserve = ( + NativeAssetFrom, + AssetPrefixFrom, + MultiNativeAsset, + ); type IsTeleporter = (); type UniversalLocation = UniversalLocation; type OriginConverter = XcmOriginToTransactDispatchOrigin; diff --git a/runtime/bifrost-polkadot/src/xcm_config.rs b/runtime/bifrost-polkadot/src/xcm_config.rs index 22d7e397e..dd0ee5eb2 100644 --- a/runtime/bifrost-polkadot/src/xcm_config.rs +++ b/runtime/bifrost-polkadot/src/xcm_config.rs @@ -483,6 +483,38 @@ impl Contains for SafeCallFilter { } } +/// Asset filter that allows all assets from a certain location matching asset id. +pub struct AssetPrefixFrom(PhantomData<(Prefix, Origin)>); +impl ContainsPair for AssetPrefixFrom +where + Prefix: Get, + Origin: Get, +{ + fn contains(asset: &Asset, origin: &Location) -> bool { + let loc = Origin::get(); + &loc == origin && + matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) } + if asset_loc.starts_with(&Prefix::get())) + } +} + +/// Asset filter that allows native/relay asset if coming from a certain location. +pub struct NativeAssetFrom(PhantomData); +impl> ContainsPair for NativeAssetFrom { + fn contains(asset: &Asset, origin: &Location) -> bool { + let loc = T::get(); + &loc == origin && + matches!(asset, Asset { id: AssetId(asset_loc), fun: Fungible(_a) } + if *asset_loc == Location::from(Parent)) + } +} + +parameter_types! { + /// Location of Asset Hub + pub AssetHubLocation: Location = (Parent, Parachain(1000)).into(); + pub EthereumLocation: Location = Location::new(2, [GlobalConsensus(Ethereum { chain_id: 1 })]); +} + pub struct XcmConfig; impl xcm_executor::Config for XcmConfig { type AssetClaims = PolkadotXcm; @@ -490,7 +522,11 @@ impl xcm_executor::Config for XcmConfig { type AssetTrap = BifrostDropAssets; type Barrier = Barrier; type RuntimeCall = RuntimeCall; - type IsReserve = MultiNativeAsset; + type IsReserve = ( + NativeAssetFrom, + AssetPrefixFrom, + MultiNativeAsset, + ); type IsTeleporter = (); type UniversalLocation = UniversalLocation; type OriginConverter = XcmOriginToTransactDispatchOrigin; From 5ec620108beb3d5385c7a4d7a3eb841f60d6c43a Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Mon, 15 Jul 2024 10:40:00 +0800 Subject: [PATCH 07/22] Disable supplement_fee_reserve (#1306) --- pallets/slp/src/agents/astar_agent/agent.rs | 13 -- .../slp/src/agents/filecoin_agent/agent.rs | 11 -- .../agents/parachain_staking_agent/agent.rs | 21 ---- pallets/slp/src/agents/phala_agent/agent.rs | 13 -- .../slp/src/agents/polkadot_agent/agent.rs | 13 -- pallets/slp/src/benchmarking.rs | 25 ---- pallets/slp/src/lib.rs | 79 +----------- pallets/slp/src/mocks/mock_kusama.rs | 11 +- pallets/slp/src/tests/kusama_tests.rs | 45 +------ pallets/slp/src/tests/manta_tests.rs | 115 ----------------- pallets/slp/src/tests/moonriver_tests.rs | 118 ------------------ .../slp/src/tests/parachain_staking_tests.rs | 91 -------------- pallets/slp/src/tests/phala_tests.rs | 117 ----------------- pallets/slp/src/traits.rs | 9 -- 14 files changed, 8 insertions(+), 673 deletions(-) diff --git a/pallets/slp/src/agents/astar_agent/agent.rs b/pallets/slp/src/agents/astar_agent/agent.rs index ea0a27692..e53639d4e 100644 --- a/pallets/slp/src/agents/astar_agent/agent.rs +++ b/pallets/slp/src/agents/astar_agent/agent.rs @@ -594,19 +594,6 @@ impl Pallet::::inner_charge_hosting_fee(charge_amount, to, vtoken) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: BalanceOf, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error> { - Pallet::::do_transfer_to(from, to, amount, currency_id)?; - - Ok(()) - } - fn check_delegator_ledger_query_response( &self, query_id: QueryId, diff --git a/pallets/slp/src/agents/filecoin_agent/agent.rs b/pallets/slp/src/agents/filecoin_agent/agent.rs index f1a69b595..c3c9b3ff6 100644 --- a/pallets/slp/src/agents/filecoin_agent/agent.rs +++ b/pallets/slp/src/agents/filecoin_agent/agent.rs @@ -498,17 +498,6 @@ impl Pallet::::inner_charge_hosting_fee(amount, to, currency_id) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - _amount: BalanceOf, - _from: &MultiLocation, - _to: &MultiLocation, - _currency_id: CurrencyId, - ) -> Result<(), Error> { - Err(Error::::Unsupported) - } - fn check_delegator_ledger_query_response( &self, _query_id: QueryId, diff --git a/pallets/slp/src/agents/parachain_staking_agent/agent.rs b/pallets/slp/src/agents/parachain_staking_agent/agent.rs index 54c265c3e..f88245f27 100644 --- a/pallets/slp/src/agents/parachain_staking_agent/agent.rs +++ b/pallets/slp/src/agents/parachain_staking_agent/agent.rs @@ -1532,27 +1532,6 @@ impl Pallet::::inner_charge_hosting_fee(charge_amount, to, vtoken) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: BalanceOf, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error> { - if currency_id == BNC { - ensure!(!amount.is_zero(), Error::::AmountZero); - let from_account_id = Pallet::::multilocation_to_account(from)?; - let to_account_id = Pallet::::multilocation_to_account(to)?; - T::MultiCurrency::transfer(currency_id, &from_account_id, &to_account_id, amount) - .map_err(|_e| Error::::MultiCurrencyError)?; - } else { - Pallet::::do_transfer_to(from, to, amount, currency_id)?; - } - - Ok(()) - } - fn check_delegator_ledger_query_response( &self, query_id: QueryId, diff --git a/pallets/slp/src/agents/phala_agent/agent.rs b/pallets/slp/src/agents/phala_agent/agent.rs index f6494fa41..bc633fa7e 100644 --- a/pallets/slp/src/agents/phala_agent/agent.rs +++ b/pallets/slp/src/agents/phala_agent/agent.rs @@ -762,19 +762,6 @@ impl Pallet::::inner_charge_hosting_fee(charge_amount, to, vtoken) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: BalanceOf, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error> { - Pallet::::do_transfer_to(from, to, amount, currency_id)?; - - Ok(()) - } - fn check_delegator_ledger_query_response( &self, query_id: QueryId, diff --git a/pallets/slp/src/agents/polkadot_agent/agent.rs b/pallets/slp/src/agents/polkadot_agent/agent.rs index 3b6eff0e1..96f4a2882 100644 --- a/pallets/slp/src/agents/polkadot_agent/agent.rs +++ b/pallets/slp/src/agents/polkadot_agent/agent.rs @@ -981,19 +981,6 @@ impl Pallet::::inner_charge_hosting_fee(charge_amount, to, vtoken) } - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: BalanceOf, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error> { - Pallet::::do_transfer_to(from, to, amount, currency_id)?; - - Ok(()) - } - fn check_delegator_ledger_query_response( &self, query_id: QueryId, diff --git a/pallets/slp/src/benchmarking.rs b/pallets/slp/src/benchmarking.rs index f5dce590c..7f8041fda 100644 --- a/pallets/slp/src/benchmarking.rs +++ b/pallets/slp/src/benchmarking.rs @@ -710,31 +710,6 @@ mod benchmarks { Ok(()) } - #[benchmark] - fn supplement_fee_reserve() -> Result<(), BenchmarkError> { - let origin = ::ControlOrigin::try_successful_origin() - .map_err(|_| BenchmarkError::Weightless)?; - set_mins_and_maxs::(origin.clone()); - - let (entrance_account, _) = ::VtokenMinting::get_entrance_and_exit_accounts(); - let entrance_account_32 = Pallet::::account_id_to_account_32(entrance_account).unwrap(); - let from = Pallet::::account_32_to_local_location(entrance_account_32).unwrap(); - - DelegatorsMultilocation2Index::::insert(KSM, DELEGATOR1, 0); - - FeeSources::::insert(KSM, (from, BalanceOf::::from(4100000000u32))); - - T::XcmWeightAndFeeHandler::set_xcm_dest_weight_and_fee( - KSM, - XcmOperationType::TransferTo, - Some((Weight::from_parts(4000000000, 100000), 0u32.into())), - )?; - - #[extrinsic_call] - _(origin as ::RuntimeOrigin, KSM, Box::new(DELEGATOR1)); - Ok(()) - } - #[benchmark] fn charge_host_fee_and_tune_vtoken_exchange_rate() -> Result<(), BenchmarkError> { let origin = ::ControlOrigin::try_successful_origin() diff --git a/pallets/slp/src/lib.rs b/pallets/slp/src/lib.rs index 2e9f3fa92..260ee7850 100644 --- a/pallets/slp/src/lib.rs +++ b/pallets/slp/src/lib.rs @@ -36,7 +36,7 @@ use bifrost_parachain_staking::ParachainStakingInterface; use bifrost_primitives::{ currency::{BNC, KSM, MANTA, MOVR, PHA}, traits::XcmDestWeightAndFeeHandler, - CurrencyId, CurrencyIdExt, CurrencyIdMapping, DerivativeAccountHandler, DerivativeIndex, + CurrencyId, CurrencyIdMapping, DerivativeAccountHandler, DerivativeIndex, SlpHostingFeeProvider, SlpOperator, TimeUnit, VtokenMintingOperator, XcmOperationType, ASTR, DOT, FIL, GLMR, }; @@ -1246,80 +1246,11 @@ pub mod pallet { #[pallet::call_index(19)] #[pallet::weight(::WeightInfo::supplement_fee_reserve())] pub fn supplement_fee_reserve( - origin: OriginFor, - currency_id: CurrencyId, - dest: Box, + _origin: OriginFor, + _currency_id: CurrencyId, + _dest: Box, ) -> DispatchResult { - // Ensure origin - Self::ensure_authorized(origin, currency_id)?; - - // Ensure dest is one of delegators accounts, or operators account, or in - // SupplementFeeAccountWhitelist. - let mut valid_account = false; - - if DelegatorsMultilocation2Index::::contains_key(currency_id, dest.clone()) { - valid_account = true; - } - - if !valid_account { - let dest_account_id = Self::multilocation_to_account(&dest)?; - let operate_account_op = OperateOrigins::::get(currency_id); - - if let Some(operate_account) = operate_account_op { - if dest_account_id == operate_account { - valid_account = true; - } - } - } - - if !valid_account { - let white_list_op = SupplementFeeAccountWhitelist::::get(currency_id); - - if let Some(white_list) = white_list_op { - let multi_hash = T::Hashing::hash(&dest.encode()); - white_list - .binary_search_by_key(&multi_hash, |(_multi, hash)| *hash) - .map_err(|_| Error::::DestAccountNotValid)?; - - valid_account = true; - } - } - - ensure!(valid_account, Error::::DestAccountNotValid); - - // Get the fee source account and reserve amount from the FeeSources storage. - let (source_location, reserved_fee) = - FeeSources::::get(currency_id).ok_or(Error::::FeeSourceNotExist)?; - - // If currency is BNC, transfer directly. - // Otherwise, call supplement_fee_reserve of StakingFeeManager trait. - if currency_id.is_native() { - let source_account = Self::native_multilocation_to_account(&source_location)?; - let dest_account = Self::native_multilocation_to_account(&dest)?; - T::MultiCurrency::transfer( - currency_id, - &source_account, - &dest_account, - reserved_fee, - )?; - } else { - let staking_agent = Self::get_currency_staking_agent(currency_id)?; - staking_agent.supplement_fee_reserve( - reserved_fee, - &source_location, - &dest, - currency_id, - )?; - } - - // Deposit event. - Pallet::::deposit_event(Event::FeeSupplemented { - currency_id, - amount: reserved_fee, - from: source_location, - to: *dest, - }); - + ensure!(false, Error::::Unsupported); Ok(()) } diff --git a/pallets/slp/src/mocks/mock_kusama.rs b/pallets/slp/src/mocks/mock_kusama.rs index 794c3b67b..9704ed757 100644 --- a/pallets/slp/src/mocks/mock_kusama.rs +++ b/pallets/slp/src/mocks/mock_kusama.rs @@ -24,7 +24,7 @@ use crate as bifrost_slp; use crate::{Config, DispatchResult, QueryResponseManager}; use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ - currency::{BNC, KSM, MANTA, VKSM}, + currency::{BNC, KSM, MANTA}, Amount, Balance, CurrencyId, DoNothingExecuteXcm, DoNothingRouter, SlpxOperator, TokenSymbol, XcmDestWeightAndFeeHandler, XcmOperationType, }; @@ -660,15 +660,6 @@ impl Default for ExtBuilder { } impl ExtBuilder { - pub fn balances(mut self, endowed_accounts: Vec<(AccountId, CurrencyId, Balance)>) -> Self { - self.endowed_accounts = endowed_accounts; - self - } - - pub fn one_hundred_for_alice(self) -> Self { - self.balances(vec![(ALICE, BNC, 100), (ALICE, KSM, 100), (ALICE, VKSM, 100)]) - } - pub fn build(self) -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); diff --git a/pallets/slp/src/tests/kusama_tests.rs b/pallets/slp/src/tests/kusama_tests.rs index a7e8766c7..20731999f 100644 --- a/pallets/slp/src/tests/kusama_tests.rs +++ b/pallets/slp/src/tests/kusama_tests.rs @@ -19,8 +19,8 @@ #![cfg(test)] use crate::{mocks::mock_kusama::*, *}; -use bifrost_primitives::currency::{BNC, KSM, VKSM}; -use frame_support::{assert_noop, assert_ok, PalletId}; +use bifrost_primitives::currency::{KSM, VKSM}; +use frame_support::{assert_ok, PalletId}; use orml_traits::MultiCurrency; use sp_runtime::traits::AccountIdConversion; use xcm::v3::prelude::*; @@ -74,47 +74,6 @@ fn set_fee_source_works() { }); } -// test native token fee supplement. Non-native will be tested in the integration tests. -#[test] -fn supplement_fee_reserve_works() { - ExtBuilder::default().one_hundred_for_alice().build().execute_with(|| { - // set fee source - let alice_32 = Pallet::::account_id_to_account_32(ALICE).unwrap(); - let alice_location = Pallet::::account_32_to_local_location(alice_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - BNC, - Some((alice_location, 10)) - )); - - // supplement fee - let bob_32 = Pallet::::account_id_to_account_32(BOB).unwrap(); - let bob_location = Pallet::::account_32_to_local_location(bob_32).unwrap(); - assert_eq!(Balances::free_balance(&ALICE), 100); - assert_eq!(Balances::free_balance(&BOB), 0); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(alice_location) - ), - Error::::DestAccountNotValid - ); - - assert_ok!(Slp::set_operate_origin(RuntimeOrigin::signed(ALICE), BNC, Some(BOB))); - - assert_ok!(Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(bob_location) - )); - - assert_eq!(Balances::free_balance(&ALICE), 90); - assert_eq!(Balances::free_balance(&BOB), 10); - }); -} - #[test] fn remove_delegator_works() { ExtBuilder::default().build().execute_with(|| { diff --git a/pallets/slp/src/tests/manta_tests.rs b/pallets/slp/src/tests/manta_tests.rs index 886195541..3e3d1fd1c 100644 --- a/pallets/slp/src/tests/manta_tests.rs +++ b/pallets/slp/src/tests/manta_tests.rs @@ -1468,121 +1468,6 @@ fn manta_transfer_to_works() { }); } -#[test] -fn supplement_fee_account_whitelist_works() { - let bifrost_parachain_account_id_32 = Sibling::from(2030).into_account_truncating(); - - let subaccount_0_account_id_32 = - Utility::derivative_account_id(bifrost_parachain_account_id_32, 0).into(); - - let subaccount_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2104), - Junction::AccountId32 { network: None, id: subaccount_0_account_id_32 }, - ), - }; - - ExtBuilder::default().build().execute_with(|| { - // environment setup - manta_setup(); - let entrance_account_id_32: [u8; 32] = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_id: AccountId = entrance_account_id_32.into(); - - let entrance_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: entrance_account_id_32 }), - }; - - let exit_account_id_32 = PalletId(*b"bf/vtout").into_account_truncating(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: exit_account_id_32 }), - }; - - let source_account_id_32 = ALICE.into(); - let source_location = Slp::account_32_to_local_location(source_account_id_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - MANTA, - Some((source_location, 1_000_000_000_000_000_000)) - )); - - // Dest should be one of delegators, operateOrigins or accounts in the whitelist. - assert_ok!(Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(subaccount_0_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(entrance_account_location), - ), - Error::::DestAccountNotValid - ); - - // register entrance_account_location as operateOrigin - assert_ok!(Slp::set_operate_origin( - RuntimeOrigin::signed(ALICE), - MANTA, - Some(entrance_account_id) - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(entrance_account_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - - // register exit_account_location into whitelist - assert_ok!(Slp::add_supplement_fee_account_to_whitelist( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - ), - Error::::TransferToError - ); - - // remove exit_account_location from whitelist - assert_ok!(Slp::remove_supplement_fee_account_from_whitelist( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MANTA, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - }); -} - #[test] fn charge_host_fee_and_tune_vtoken_exchange_rate_works() { let bifrost_parachain_account_id_32 = Sibling::from(2030).into_account_truncating(); diff --git a/pallets/slp/src/tests/moonriver_tests.rs b/pallets/slp/src/tests/moonriver_tests.rs index 36503b513..64f523732 100644 --- a/pallets/slp/src/tests/moonriver_tests.rs +++ b/pallets/slp/src/tests/moonriver_tests.rs @@ -1490,124 +1490,6 @@ fn moonriver_transfer_to_works() { }); } -#[test] -fn supplement_fee_account_whitelist_works() { - let bifrost_parachain_account_id_20: [u8; 20] = Sibling::from(2001).into_account_truncating(); - - let subaccount_0_account_id_20: [u8; 20] = - Slp::derivative_account_id_20(bifrost_parachain_account_id_20, 0).into(); - - let subaccount_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2023), - Junction::AccountKey20 { network: None, key: subaccount_0_account_id_20 }, - ), - }; - - ExtBuilder::default().build().execute_with(|| { - // environment setup - moonriver_setup(); - let entrance_account_id_32: [u8; 32] = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_id: AccountId = entrance_account_id_32.into(); - - let entrance_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: entrance_account_id_32 }), - }; - - let exit_account_id_32: [u8; 32] = PalletId(*b"bf/vtout").into_account_truncating(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(Junction::AccountId32 { network: None, id: exit_account_id_32 }), - }; - - let source_account_id_32: [u8; 32] = ALICE.into(); - let source_location = Slp::account_32_to_local_location(source_account_id_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - MOVR, - Some((source_location, 1_000_000_000_000_000_000)) - )); - - // Dest should be one of delegators, operateOrigins or accounts in the whitelist. - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(subaccount_0_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(entrance_account_location), - ), - Error::::DestAccountNotValid - ); - - // register entrance_account_location as operateOrigin - assert_ok!(Slp::set_operate_origin( - RuntimeOrigin::signed(ALICE), - MOVR, - Some(entrance_account_id) - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(entrance_account_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - - // register exit_account_location into whitelist - assert_ok!(Slp::add_supplement_fee_account_to_whitelist( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - ), - Error::::TransferToError - ); - - // remove exit_account_location from whitelist - assert_ok!(Slp::remove_supplement_fee_account_from_whitelist( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - MOVR, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - }); -} - #[test] fn charge_host_fee_and_tune_vtoken_exchange_rate_works() { let bifrost_parachain_account_id_20: [u8; 20] = Sibling::from(2001).into_account_truncating(); diff --git a/pallets/slp/src/tests/parachain_staking_tests.rs b/pallets/slp/src/tests/parachain_staking_tests.rs index 2f92c9225..69a8758c5 100644 --- a/pallets/slp/src/tests/parachain_staking_tests.rs +++ b/pallets/slp/src/tests/parachain_staking_tests.rs @@ -845,97 +845,6 @@ fn parachain_staking_transfer_to_works() { }); } -#[test] -fn supplement_fee_account_whitelist_works() { - let subaccount_0_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: CHARLIE.into() }), - }; - - ExtBuilder::default().build().execute_with(|| { - // environment setup - parachain_staking_setup(); - let entrance_account_id: AccountId = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_id_32: [u8; 32] = PalletId(*b"bf/vtkin").into_account_truncating(); - - let entrance_account_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: entrance_account_id_32 }), - }; - let exit_account_id_32: [u8; 32] = PalletId(*b"bf/vtout").into_account_truncating(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: exit_account_id_32 }), - }; - - let source_account_id_32: [u8; 32] = ALICE.into(); - let source_location = Slp::account_32_to_local_location(source_account_id_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - BNC, - Some((source_location, 1_000_000_000_000)) - )); - - // Dest should be one of delegators, operateRuntimeOrigins or accounts in the whitelist. - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(subaccount_0_location), - ), - Error::::DestAccountNotValid - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(entrance_account_location), - ), - Error::::DestAccountNotValid - ); - - // register entrance_account_location as operateRuntimeOrigin - assert_ok!(Slp::set_operate_origin( - RuntimeOrigin::signed(ALICE), - BNC, - Some(entrance_account_id) - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - - // register exit_account_location into whitelist - assert_ok!(Slp::add_supplement_fee_account_to_whitelist( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(exit_account_location), - )); - - // remove exit_account_location from whitelist - assert_ok!(Slp::remove_supplement_fee_account_from_whitelist( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - BNC, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - }); -} - #[test] fn add_validator_and_remove_validator_works() { let validator_0_location = diff --git a/pallets/slp/src/tests/phala_tests.rs b/pallets/slp/src/tests/phala_tests.rs index 54d8c054b..c81be3d3a 100644 --- a/pallets/slp/src/tests/phala_tests.rs +++ b/pallets/slp/src/tests/phala_tests.rs @@ -1289,123 +1289,6 @@ fn phala_transfer_to_works() { }); } -#[test] -fn supplement_fee_account_whitelist_works() { - let bifrost_parachain_account_id: AccountId = Sibling::from(2001).into_account_truncating(); - // subaccount_id_0: 41YcGwBLwxbFV7VfbF6zYGgUnYbt96dHcA2DWruRJkWtANFD - let subaccount_0_account_id_32: [u8; 32] = - Utility::derivative_account_id(bifrost_parachain_account_id, 0).into(); - - let subaccount_0_location = MultiLocation { - parents: 1, - interior: X2( - Parachain(2004), - AccountId32 { network: None, id: subaccount_0_account_id_32.into() }, - ), - }; - - ExtBuilder::default().build().execute_with(|| { - // environment setup - phala_setup(); - let entrance_account_id: AccountId = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_id_32: [u8; 32] = PalletId(*b"bf/vtkin").into_account_truncating(); - let entrance_account_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: entrance_account_id_32 }), - }; - - let exit_account_id_32: [u8; 32] = PalletId(*b"bf/vtout").into_account_truncating(); - let exit_account_location = MultiLocation { - parents: 0, - interior: X1(AccountId32 { network: None, id: exit_account_id_32 }), - }; - - let source_account_id_32: [u8; 32] = ALICE.into(); - let source_location = Slp::account_32_to_local_location(source_account_id_32).unwrap(); - assert_ok!(Slp::set_fee_source( - RuntimeOrigin::signed(ALICE), - PHA, - Some((source_location, 1_000_000_000_000_000_000)) - )); - - // Dest should be one of delegators, operateOrigins or accounts in the whitelist. - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(subaccount_0_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(entrance_account_location), - ), - Error::::DestAccountNotValid - ); - - // register entrance_account_location as operateOrigin - assert_ok!(Slp::set_operate_origin( - RuntimeOrigin::signed(ALICE), - PHA, - Some(entrance_account_id) - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(entrance_account_location), - ), - Error::::TransferToError - ); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - - // register exit_account_location into whitelist - assert_ok!(Slp::add_supplement_fee_account_to_whitelist( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - ), - Error::::TransferToError - ); - - // remove exit_account_location from whitelist - assert_ok!(Slp::remove_supplement_fee_account_from_whitelist( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - )); - - assert_noop!( - Slp::supplement_fee_reserve( - RuntimeOrigin::signed(ALICE), - PHA, - Box::new(exit_account_location), - ), - Error::::DestAccountNotValid - ); - }); -} - #[test] fn charge_host_fee_and_tune_vtoken_exchange_rate_works() { let bifrost_parachain_account_id: AccountId = Sibling::from(2001).into_account_truncating(); diff --git a/pallets/slp/src/traits.rs b/pallets/slp/src/traits.rs index 8b1c0f426..2e2d1e22c 100644 --- a/pallets/slp/src/traits.rs +++ b/pallets/slp/src/traits.rs @@ -193,15 +193,6 @@ pub trait StakingAgent< currency_id: CurrencyId, ) -> DispatchResult; - /// Deposit some amount as fee to nominator accounts. - fn supplement_fee_reserve( - &self, - amount: Balance, - from: &MultiLocation, - to: &MultiLocation, - currency_id: CurrencyId, - ) -> Result<(), Error>; - /// Remove an existing serving delegator for a particular currency. fn remove_delegator(&self, who: &MultiLocation, currency_id: CurrencyId) -> DispatchResult; From e4d88b9a04078ae5ff11ae57e97c89b0db0c3ecf Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Mon, 15 Jul 2024 18:58:16 +0800 Subject: [PATCH 08/22] Remove call_switchgear and add tx_pause (#1308) * Remove call_switchgear and add tx_pause * Fix clippy --- Cargo.lock | 25 ++- Cargo.toml | 2 +- runtime/bifrost-kusama/Cargo.toml | 6 +- runtime/bifrost-kusama/src/lib.rs | 155 ++++-------------- .../src/weights/bifrost_call_switchgear.rs | 101 ------------ runtime/bifrost-kusama/src/weights/mod.rs | 1 - runtime/bifrost-polkadot/Cargo.toml | 5 +- runtime/bifrost-polkadot/src/lib.rs | 145 ++++------------ .../src/weights/bifrost_call_switchgear.rs | 101 ------------ runtime/bifrost-polkadot/src/weights/mod.rs | 1 - 10 files changed, 86 insertions(+), 456 deletions(-) delete mode 100644 runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs delete mode 100644 runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs diff --git a/Cargo.lock b/Cargo.lock index 0257b1ddf..bf9e6a75e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1073,7 +1073,6 @@ name = "bifrost-kusama-runtime" version = "0.8.0" dependencies = [ "bifrost-asset-registry", - "bifrost-call-switchgear", "bifrost-channel-commission", "bifrost-cross-in-out", "bifrost-currencies", @@ -1156,6 +1155,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", + "pallet-tx-pause", "pallet-utility", "pallet-whitelist", "pallet-xcm", @@ -1227,7 +1227,6 @@ version = "0.8.0" dependencies = [ "bifrost-asset-registry", "bifrost-buy-back", - "bifrost-call-switchgear", "bifrost-channel-commission", "bifrost-clouds-convert", "bifrost-cross-in-out", @@ -1311,6 +1310,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", + "pallet-tx-pause", "pallet-utility", "pallet-whitelist", "pallet-xcm", @@ -8691,6 +8691,25 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-tx-pause" +version = "10.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26ee3c04e718d399c43effb666c82ced0fc0303f3c57e930571035b59722021e" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", + "pallet-proxy", + "pallet-utility", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-utility" version = "29.0.0" @@ -16434,4 +16453,4 @@ checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", -] \ No newline at end of file +] diff --git a/Cargo.toml b/Cargo.toml index 7f9b60fe8..90fdcc80a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,6 @@ bifrost-polkadot-runtime = { path = "runtime/bifrost-polkadot" } # Bifrost Wasm bifrost-asset-registry = { path = "pallets/asset-registry", default-features = false } bifrost-buy-back = { path = "pallets/buy-back", default-features = false } -bifrost-call-switchgear = { path = "pallets/call-switchgear", default-features = false } bifrost-cross-in-out = { path = "pallets/cross-in-out", default-features = false } bifrost-currencies = { path = "pallets/currencies", default-features = false } bifrost-farming = { path = "pallets/farming", default-features = false } @@ -169,6 +168,7 @@ pallet-staking = { version = "29.0.0", default-featu pallet-sudo = { version = "29.0.0", default-features = false } pallet-timestamp = { version = "28.0.0", default-features = false } pallet-tips = { version = "28.0.0", default-features = false } +pallet-tx-pause = { version = "10.0.0", default-features = false } pallet-transaction-payment = { version = "29.0.0", default-features = false } pallet-transaction-payment-rpc-runtime-api = { version = "29.0.0", default-features = false } pallet-treasury = { version = "28.0.0", default-features = false } diff --git a/runtime/bifrost-kusama/Cargo.toml b/runtime/bifrost-kusama/Cargo.toml index a07343319..66fd6df29 100644 --- a/runtime/bifrost-kusama/Cargo.toml +++ b/runtime/bifrost-kusama/Cargo.toml @@ -49,6 +49,7 @@ pallet-scheduler = { workspace = true } pallet-session = { workspace = true } pallet-timestamp = { workspace = true } pallet-tips = { workspace = true } +pallet-tx-pause = { workspace = true } pallet-transaction-payment = { workspace = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } pallet-treasury = { workspace = true } @@ -113,7 +114,6 @@ bifrost-stable-asset = { workspace = true } # Bifrost bifrost-asset-registry = { workspace = true } -bifrost-call-switchgear = { workspace = true } bifrost-cross-in-out = { workspace = true } bifrost-currencies = { workspace = true } bifrost-farming = { workspace = true } @@ -185,6 +185,7 @@ std = [ "pallet-session/std", "pallet-timestamp/std", "pallet-tips/std", + "pallet-tx-pause/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-treasury/std", @@ -239,7 +240,6 @@ std = [ "bifrost-primitives/std", "bifrost-asset-registry/std", - "bifrost-call-switchgear/std", "bifrost-cross-in-out/std", "bifrost-currencies/std", "bifrost-farming-rpc-runtime-api/std", @@ -304,7 +304,6 @@ runtime-benchmarks = [ "bifrost-salp/runtime-benchmarks", "bifrost-vsbond-auction/runtime-benchmarks", "bifrost-token-issuer/runtime-benchmarks", - "bifrost-call-switchgear/runtime-benchmarks", "bifrost-vtoken-minting/runtime-benchmarks", "bifrost-farming/runtime-benchmarks", "bifrost-system-staking/runtime-benchmarks", @@ -374,7 +373,6 @@ try-runtime = [ "bifrost-flexible-fee/try-runtime", "bifrost-salp/try-runtime", "bifrost-token-issuer/try-runtime", - "bifrost-call-switchgear/try-runtime", "bifrost-vsbond-auction/try-runtime", "bifrost-asset-registry/try-runtime", "bifrost-vtoken-minting/try-runtime", diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 2dadb3a48..d7699ce22 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -94,8 +94,8 @@ use frame_support::{ traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - Currency, EitherOf, EitherOfDiverse, Get, Imbalance, LinearStoragePrice, LockIdentifier, - OnUnbalanced, + Currency, EitherOf, EitherOfDiverse, Get, Imbalance, InsideBoth, LinearStoragePrice, + LockIdentifier, OnUnbalanced, }, }; use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; @@ -194,118 +194,6 @@ parameter_types! { pub const SS58Prefix: u8 = 6; } -pub struct CallFilter; -impl Contains for CallFilter { - fn contains(call: &RuntimeCall) -> bool { - let is_core_call = matches!( - call, - RuntimeCall::System(_) | RuntimeCall::Timestamp(_) | RuntimeCall::ParachainSystem(_) - ); - if is_core_call { - // always allow core call - return true; - } - - if bifrost_call_switchgear::OverallToggleFilter::::get_overall_toggle_status() { - return false; - } - - // temporarily ban PhragmenElection - let is_temporarily_banned = matches!(call, RuntimeCall::PhragmenElection(_)); - - if is_temporarily_banned { - return false; - } - - let is_switched_off = - bifrost_call_switchgear::SwitchOffTransactionFilter::::contains(call); - if is_switched_off { - // no switched off call - return false; - } - - // disable transfer - let is_transfer = matches!( - call, - RuntimeCall::Currencies(_) | RuntimeCall::Tokens(_) | RuntimeCall::Balances(_) - ); - if is_transfer { - let is_disabled = match *call { - // bifrost-currencies module - RuntimeCall::Currencies(bifrost_currencies::Call::transfer { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Currencies(bifrost_currencies::Call::transfer_native_currency { - dest: _, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - // orml-tokens module - RuntimeCall::Tokens(orml_tokens::Call::transfer { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Tokens(orml_tokens::Call::transfer_all { - dest: _, - currency_id, - keep_alive: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Tokens(orml_tokens::Call::transfer_keep_alive { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - // Balances module - RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { - dest: _, - value: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive { - dest: _, - value: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - RuntimeCall::Balances(pallet_balances::Call::transfer_all { - dest: _, - keep_alive: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - _ => false, - }; - - if is_disabled { - // no switched off call - return false; - } - } - - true - } -} - -pub struct BaseFilter; -impl Contains for BaseFilter { - fn contains(_c: &RuntimeCall) -> bool { - true - } -} - parameter_types! { pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); pub const RelayCurrencyId: CurrencyId = CurrencyId::Token(TokenSymbol::KSM); @@ -348,7 +236,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - type BaseCallFilter = CallFilter; + type BaseCallFilter = InsideBoth; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; @@ -892,6 +780,25 @@ impl pallet_transaction_payment::Config for Runtime { type RuntimeEvent = RuntimeEvent; } +/// Calls that can bypass the tx-pause pallet. +/// We always allow system calls and timestamp since it is required for block production +pub struct TxPauseWhitelistedCalls; +impl Contains> for TxPauseWhitelistedCalls { + fn contains(full_name: &pallet_tx_pause::RuntimeCallNameOf) -> bool { + matches!(full_name.0.as_slice(), b"System" | b"Timestamp" | b"TxPause") + } +} + +impl pallet_tx_pause::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PauseOrigin = TechAdminOrCouncil; + type UnpauseOrigin = TechAdminOrCouncil; + type WhitelistedCalls = TxPauseWhitelistedCalls; + type MaxNameLen = ConstU32<256>; + type WeightInfo = pallet_tx_pause::weights::SubstrateWeight; +} + impl frame_system::offchain::CreateSignedTransaction for Runtime where RuntimeCall: From, @@ -1312,12 +1219,6 @@ impl bifrost_token_issuer::Config for Runtime { type MaxLengthLimit = MaxLengthLimit; } -impl bifrost_call_switchgear::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type UpdateOrigin = CoreAdminOrCouncil; - type WeightInfo = weights::bifrost_call_switchgear::BifrostWeight; -} - impl bifrost_asset_registry::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -1907,6 +1808,7 @@ construct_runtime! { Indices: pallet_indices = 2, ParachainSystem: cumulus_pallet_parachain_system = 5, ParachainInfo: parachain_info = 6, + TxPause: pallet_tx_pause = 7, // Monetary stuff Balances: pallet_balances = 10, @@ -1966,7 +1868,6 @@ construct_runtime! { FlexibleFee: bifrost_flexible_fee = 100, Salp: bifrost_salp = 105, TokenIssuer: bifrost_token_issuer = 109, - CallSwitchgear: bifrost_call_switchgear = 112, VSBondAuction: bifrost_vsbond_auction = 113, AssetRegistry: bifrost_asset_registry = 114, VtokenMinting: bifrost_vtoken_minting = 115, @@ -2032,7 +1933,7 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic; parameter_types! { - pub const DmpQueuePalletName: &'static str = "DmpQueue"; + pub const CallSwitchgearPalletName: &'static str = "CallSwitchgear"; } /// All migrations that will run on the next runtime upgrade. @@ -2047,7 +1948,12 @@ pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = (); + pub type Unreleased = ( + frame_support::migrations::RemovePallet< + CallSwitchgearPalletName, + ::DbWeight, + >, + ); } /// Executive: handles dispatch to the various modules. @@ -2068,7 +1974,6 @@ extern crate frame_benchmarking; mod benches { define_benchmarks!( [bifrost_asset_registry, AssetRegistry] - [bifrost_call_switchgear, CallSwitchgear] [bifrost_cross_in_out, CrossInOut] [bifrost_farming, Farming] [bifrost_fee_share, FeeShare] diff --git a/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs b/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs deleted file mode 100644 index 439245f52..000000000 --- a/runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs +++ /dev/null @@ -1,101 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) Liebi Technologies PTE. LTD. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for bifrost_call_switchgear -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 - -// Executed Command: -// target/release/bifrost -// benchmark -// pallet -// --chain=bifrost-kusama-local -// --steps=50 -// --repeat=20 -// --pallet=bifrost_call_switchgear -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs -// --template=./weight-template/runtime-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions for bifrost_call_switchgear. -pub struct BifrostWeight(PhantomData); -impl bifrost_call_switchgear::WeightInfo for BifrostWeight { - // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchoff_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3469` - // Minimum execution time: 29_214 nanoseconds. - Weight::from_parts(30_398_000, 3469) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchon_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `55` - // Estimated: `3520` - // Minimum execution time: 31_720 nanoseconds. - Weight::from_parts(32_717_000, 3520) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn disable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3469` - // Minimum execution time: 26_079 nanoseconds. - Weight::from_parts(26_977_000, 3469) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn enable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 27_719 nanoseconds. - Weight::from_parts(28_319_000, 3503) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/runtime/bifrost-kusama/src/weights/mod.rs b/runtime/bifrost-kusama/src/weights/mod.rs index b5ccb51c5..9782e1bcc 100644 --- a/runtime/bifrost-kusama/src/weights/mod.rs +++ b/runtime/bifrost-kusama/src/weights/mod.rs @@ -21,7 +21,6 @@ //! A list of the different weight modules for our runtime. pub mod bifrost_asset_registry; -pub mod bifrost_call_switchgear; pub mod bifrost_channel_commission; pub mod bifrost_cross_in_out; pub mod bifrost_currencies; diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index f8f4715a3..07ccf634c 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -49,6 +49,7 @@ pallet-scheduler = { workspace = true } pallet-session = { workspace = true } pallet-timestamp = { workspace = true } pallet-tips = { workspace = true } +pallet-tx-pause = { workspace = true } pallet-transaction-payment = { workspace = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } pallet-treasury = { workspace = true } @@ -111,7 +112,6 @@ bifrost-stable-asset = { workspace = true } # Bifrost bifrost-asset-registry = { workspace = true } bifrost-buy-back = { workspace = true } -bifrost-call-switchgear = { workspace = true } bifrost-cross-in-out = { workspace = true } bifrost-currencies = { workspace = true } bifrost-farming = { workspace = true } @@ -181,6 +181,7 @@ std = [ "pallet-session/std", "pallet-timestamp/std", "pallet-tips/std", + "pallet-tx-pause/std", "pallet-transaction-payment-rpc-runtime-api/std", "pallet-transaction-payment/std", "pallet-treasury/std", @@ -284,7 +285,6 @@ runtime-benchmarks = [ "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", "xcm-builder/runtime-benchmarks", - "bifrost-call-switchgear/runtime-benchmarks", "bifrost-slp/runtime-benchmarks", "bifrost-salp/runtime-benchmarks", "bifrost-vtoken-minting/runtime-benchmarks", @@ -303,7 +303,6 @@ runtime-benchmarks = [ try-runtime = [ "bifrost-asset-registry/try-runtime", "bifrost-buy-back/try-runtime", - "bifrost-call-switchgear/try-runtime", "bifrost-channel-commission/try-runtime", "bifrost-clouds-convert/try-runtime", "bifrost-cross-in-out/try-runtime", diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index add1e7f42..8801aa644 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -94,7 +94,7 @@ use frame_support::{ traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - Currency, EitherOf, EitherOfDiverse, Get, LinearStoragePrice, + Currency, EitherOf, EitherOfDiverse, Get, InsideBoth, LinearStoragePrice, }, }; use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; @@ -192,111 +192,6 @@ parameter_types! { pub const SS58Prefix: u8 = 6; } -pub struct CallFilter; -impl Contains for CallFilter { - fn contains(call: &RuntimeCall) -> bool { - let is_core_call = matches!( - call, - RuntimeCall::System(_) | RuntimeCall::Timestamp(_) | RuntimeCall::ParachainSystem(_) - ); - if is_core_call { - // always allow core call - return true; - } - - if bifrost_call_switchgear::OverallToggleFilter::::get_overall_toggle_status() { - return false; - } - - // temporarily ban PhragmenElection - let is_temporarily_banned = matches!(call, RuntimeCall::PhragmenElection(_)); - - if is_temporarily_banned { - return false; - } - - let is_switched_off = - bifrost_call_switchgear::SwitchOffTransactionFilter::::contains(call); - if is_switched_off { - // no switched off call - return false; - } - - // disable transfer - let is_transfer = matches!( - call, - RuntimeCall::Currencies(_) | RuntimeCall::Tokens(_) | RuntimeCall::Balances(_) - ); - if is_transfer { - let is_disabled = match *call { - // bifrost-currencies module - RuntimeCall::Currencies(bifrost_currencies::Call::transfer { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Currencies(bifrost_currencies::Call::transfer_native_currency { - dest: _, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - // orml-tokens module - RuntimeCall::Tokens(orml_tokens::Call::transfer { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Tokens(orml_tokens::Call::transfer_all { - dest: _, - currency_id, - keep_alive: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - RuntimeCall::Tokens(orml_tokens::Call::transfer_keep_alive { - dest: _, - currency_id, - amount: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - ¤cy_id, - ), - // Balances module - RuntimeCall::Balances(pallet_balances::Call::transfer_allow_death { - dest: _, - value: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - RuntimeCall::Balances(pallet_balances::Call::transfer_keep_alive { - dest: _, - value: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - RuntimeCall::Balances(pallet_balances::Call::transfer_all { - dest: _, - keep_alive: _, - }) => bifrost_call_switchgear::DisableTransfersFilter::::contains( - &NativeCurrencyId::get(), - ), - _ => false, - }; - - if is_disabled { - // no switched off call - return false; - } - } - - true - } -} - parameter_types! { pub const NativeCurrencyId: CurrencyId = CurrencyId::Native(TokenSymbol::BNC); pub const RelayCurrencyId: CurrencyId = CurrencyId::Token2(DOT_TOKEN_ID); @@ -335,7 +230,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - type BaseCallFilter = CallFilter; + type BaseCallFilter = InsideBoth; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; @@ -861,6 +756,25 @@ impl pallet_transaction_payment::Config for Runtime { type WeightToFee = WeightToFee; } +/// Calls that can bypass the tx-pause pallet. +/// We always allow system calls and timestamp since it is required for block production +pub struct TxPauseWhitelistedCalls; +impl Contains> for TxPauseWhitelistedCalls { + fn contains(full_name: &pallet_tx_pause::RuntimeCallNameOf) -> bool { + matches!(full_name.0.as_slice(), b"System" | b"Timestamp" | b"TxPause") + } +} + +impl pallet_tx_pause::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type RuntimeCall = RuntimeCall; + type PauseOrigin = TechAdminOrCouncil; + type UnpauseOrigin = TechAdminOrCouncil; + type WhitelistedCalls = TxPauseWhitelistedCalls; + type MaxNameLen = ConstU32<256>; + type WeightInfo = pallet_tx_pause::weights::SubstrateWeight; +} + // culumus runtime start parameter_types! { pub const ReservedXcmpWeight: Weight = MAXIMUM_BLOCK_WEIGHT.saturating_div(4); @@ -1139,12 +1053,6 @@ impl bifrost_salp::Config for Runtime { type BatchLimit = BatchLimit; } -impl bifrost_call_switchgear::Config for Runtime { - type RuntimeEvent = RuntimeEvent; - type UpdateOrigin = CoreAdminOrCouncil; - type WeightInfo = weights::bifrost_call_switchgear::BifrostWeight; -} - impl bifrost_asset_registry::Config for Runtime { type RuntimeEvent = RuntimeEvent; type Currency = Balances; @@ -1741,6 +1649,7 @@ construct_runtime! { Indices: pallet_indices = 2, ParachainSystem: cumulus_pallet_parachain_system = 5, ParachainInfo: parachain_info = 6, + TxPause: pallet_tx_pause = 7, // Monetary stuff Balances: pallet_balances = 10, @@ -1797,7 +1706,6 @@ construct_runtime! { // Bifrost modules FlexibleFee: bifrost_flexible_fee = 100, Salp: bifrost_salp = 105, - CallSwitchgear: bifrost_call_switchgear = 112, AssetRegistry: bifrost_asset_registry = 114, VtokenMinting: bifrost_vtoken_minting = 115, Slp: bifrost_slp = 116, @@ -1865,7 +1773,7 @@ pub type CheckedExtrinsic = generic::CheckedExtrinsic; parameter_types! { - pub const DmpQueuePalletName: &'static str = "DmpQueue"; + pub const CallSwitchgearPalletName: &'static str = "CallSwitchgear"; } /// All migrations that will run on the next runtime upgrade. @@ -1880,7 +1788,12 @@ pub mod migrations { use super::*; /// Unreleased migrations. Add new ones here: - pub type Unreleased = (); + pub type Unreleased = ( + frame_support::migrations::RemovePallet< + CallSwitchgearPalletName, + ::DbWeight, + >, + ); } /// Executive: handles dispatch to the various modules. diff --git a/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs b/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs deleted file mode 100644 index 439245f52..000000000 --- a/runtime/bifrost-polkadot/src/weights/bifrost_call_switchgear.rs +++ /dev/null @@ -1,101 +0,0 @@ -// This file is part of Bifrost. - -// Copyright (C) Liebi Technologies PTE. LTD. -// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 - -// This program is free software: you can redistribute it and/or modify -// it under the terms of the GNU General Public License as published by -// the Free Software Foundation, either version 3 of the License, or -// (at your option) any later version. - -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. - -// You should have received a copy of the GNU General Public License -// along with this program. If not, see . -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//! Autogenerated weights for bifrost_call_switchgear -//! -//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev -//! DATE: 2023-09-14, STEPS: `50`, REPEAT: 20, LOW RANGE: `[]`, HIGH RANGE: `[]` -//! HOSTNAME: `bifrost-jenkins`, CPU: `Intel(R) Xeon(R) CPU E5-26xx v4` -//! WASM-EXECUTION: Compiled, CHAIN: Some("bifrost-kusama-local"), DB CACHE: 1024 - -// Executed Command: -// target/release/bifrost -// benchmark -// pallet -// --chain=bifrost-kusama-local -// --steps=50 -// --repeat=20 -// --pallet=bifrost_call_switchgear -// --extrinsic=* -// --execution=wasm -// --wasm-execution=compiled -// --heap-pages=4096 -// --output=./runtime/bifrost-kusama/src/weights/bifrost_call_switchgear.rs -// --template=./weight-template/runtime-weight-template.hbs - -#![cfg_attr(rustfmt, rustfmt_skip)] -#![allow(unused_parens)] -#![allow(unused_imports)] - -use frame_support::{traits::Get, weights::{Weight, constants::RocksDbWeight}}; -use sp_std::marker::PhantomData; - -/// Weight functions for bifrost_call_switchgear. -pub struct BifrostWeight(PhantomData); -impl bifrost_call_switchgear::WeightInfo for BifrostWeight { - // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchoff_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3469` - // Minimum execution time: 29_214 nanoseconds. - Weight::from_parts(30_398_000, 3469) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear SwitchedOffTransactions (r:1 w:1) - // Proof Skipped: CallSwitchgear SwitchedOffTransactions (max_values: None, max_size: None, mode: Measured) - fn switchon_transaction() -> Weight { - // Proof Size summary in bytes: - // Measured: `55` - // Estimated: `3520` - // Minimum execution time: 31_720 nanoseconds. - Weight::from_parts(32_717_000, 3520) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn disable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `4` - // Estimated: `3469` - // Minimum execution time: 26_079 nanoseconds. - Weight::from_parts(26_977_000, 3469) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } - // Storage: CallSwitchgear DisabledTransfers (r:1 w:1) - // Proof Skipped: CallSwitchgear DisabledTransfers (max_values: None, max_size: None, mode: Measured) - fn enable_transfers() -> Weight { - // Proof Size summary in bytes: - // Measured: `38` - // Estimated: `3503` - // Minimum execution time: 27_719 nanoseconds. - Weight::from_parts(28_319_000, 3503) - .saturating_add(T::DbWeight::get().reads(1)) - .saturating_add(T::DbWeight::get().writes(1)) - } -} diff --git a/runtime/bifrost-polkadot/src/weights/mod.rs b/runtime/bifrost-polkadot/src/weights/mod.rs index 6ea6b29d5..2dfce402e 100644 --- a/runtime/bifrost-polkadot/src/weights/mod.rs +++ b/runtime/bifrost-polkadot/src/weights/mod.rs @@ -22,7 +22,6 @@ pub mod bifrost_asset_registry; pub mod bifrost_buy_back; -pub mod bifrost_call_switchgear; pub mod bifrost_channel_commission; pub mod bifrost_clouds_convert; pub mod bifrost_cross_in_out; From 5307f58d4bba69dc58df86f9f41afd649579e0bf Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Tue, 16 Jul 2024 19:27:02 +0800 Subject: [PATCH 09/22] Optimize flexible fee (#1307) * Optimize flexible fee * Fix bug * Fix bug * Add PalletId * Add error handle --- Cargo.lock | 1 + pallets/flexible-fee/Cargo.toml | 6 +- pallets/flexible-fee/src/lib.rs | 364 +++++++++++++++++++++------- pallets/flexible-fee/src/mock.rs | 12 +- pallets/xcm-interface/src/calls.rs | 10 + primitives/src/lib.rs | 1 + runtime/bifrost-kusama/src/lib.rs | 6 + runtime/bifrost-polkadot/src/lib.rs | 6 + 8 files changed, 310 insertions(+), 96 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf9e6a75e..9987d4bea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -982,6 +982,7 @@ dependencies = [ "pallet-transaction-payment", "pallet-xcm", "parity-scale-codec", + "polkadot-parachain-primitives", "scale-info", "sp-arithmetic", "sp-core", diff --git a/pallets/flexible-fee/Cargo.toml b/pallets/flexible-fee/Cargo.toml index dc0ac1552..6e4285a9e 100644 --- a/pallets/flexible-fee/Cargo.toml +++ b/pallets/flexible-fee/Cargo.toml @@ -11,20 +11,23 @@ frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } pallet-transaction-payment = { workspace = true } +pallet-balances = { workspace = true } sp-arithmetic = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } bifrost-primitives = { workspace = true } +bifrost-xcm-interface = { workspace = true } zenlink-protocol = { workspace = true } orml-traits = { workspace = true } cumulus-primitives-core = { workspace = true } bifrost-asset-registry = { workspace = true } +polkadot-parachain-primitives = { workspace = true } log = { workspace = true } +xcm = { workspace = true } [dev-dependencies] orml-tokens = { workspace = true } bifrost-currencies = { workspace = true } -pallet-balances = { workspace = true } sp-core = { workspace = true } sp-io = { workspace = true } cumulus-primitives-core = { workspace = true } @@ -33,7 +36,6 @@ bifrost-asset-registry = { workspace = true } bifrost-xcm-interface = { workspace = true } xcm-executor = { workspace = true } xcm-builder = { workspace = true } -xcm = { workspace = true } pallet-xcm = { workspace = true } bifrost-vtoken-voting = { workspace = true, features = ["kusama"] } diff --git a/pallets/flexible-fee/src/lib.rs b/pallets/flexible-fee/src/lib.rs index 71ac0b428..764d2e1b6 100644 --- a/pallets/flexible-fee/src/lib.rs +++ b/pallets/flexible-fee/src/lib.rs @@ -18,10 +18,12 @@ #![cfg_attr(not(feature = "std"), no_std)] +pub use crate::pallet::*; use bifrost_primitives::{ traits::{FeeGetter, XcmDestWeightAndFeeHandler}, CurrencyId, ExtraFeeName, TryConvertFrom, XcmOperationType, BNC, }; +use bifrost_xcm_interface::{polkadot::RelaychainCall, traits::parachains, PolkadotXcmCall}; use core::convert::Into; use cumulus_primitives_core::ParaId; use frame_support::{ @@ -30,19 +32,23 @@ use frame_support::{ Currency, ExistenceRequirement, Get, Imbalance, OnUnbalanced, ReservableCurrency, WithdrawReasons, }, + transactional, + weights::WeightMeter, + PalletId, }; use frame_system::pallet_prelude::*; use orml_traits::MultiCurrency; -pub use pallet::*; use pallet_transaction_payment::OnChargeTransaction; -use sp_arithmetic::traits::{CheckedAdd, SaturatedConversion}; +use polkadot_parachain_primitives::primitives::Sibling; +use sp_arithmetic::traits::{CheckedAdd, SaturatedConversion, UniqueSaturatedInto}; use sp_runtime::{ - traits::{DispatchInfoOf, PostDispatchInfoOf, Saturating, Zero}, + traits::{AccountIdConversion, DispatchInfoOf, PostDispatchInfoOf, Saturating, Zero}, transaction_validity::TransactionValidityError, BoundedVec, }; -use sp_std::{vec, vec::Vec}; +use sp_std::{boxed::Box, vec, vec::Vec}; pub use weights::WeightInfo; +use xcm::{prelude::Unlimited, v4::prelude::*}; use zenlink_protocol::{AssetBalance, AssetId, ExportZenlink}; #[cfg(feature = "runtime-benchmarks")] @@ -52,10 +58,19 @@ mod mock; mod tests; pub mod weights; +pub type AccountIdOf = ::AccountId; +pub type CurrencyIdOf = + <::MultiCurrency as MultiCurrency>>::CurrencyId; +pub type BalanceOf = <::MultiCurrency as MultiCurrency>>::Balance; +pub type PalletBalanceOf = <::Currency as Currency>>::Balance; +pub type NegativeImbalanceOf = + <::Currency as Currency>>::NegativeImbalance; +pub type PositiveImbalanceOf = + <::Currency as Currency>>::PositiveImbalance; +pub type CallOf = ::RuntimeCall; + #[frame_support::pallet] pub mod pallet { - use bifrost_primitives::XcmDestWeightAndFeeHandler; - use super::*; #[pallet::config] @@ -74,6 +89,9 @@ pub mod pallet { type Currency: Currency + ReservableCurrency; /// Handler for the unbalanced decrease type OnUnbalanced: OnUnbalanced>; + /// xcm transfer interface + type XcmRouter: SendXcm; + type DexOperator: ExportZenlink; /// Filter if this transaction needs to be deducted extra fee besides basic transaction fee, /// and get the name of the fee @@ -85,35 +103,71 @@ pub mod pallet { #[pallet::constant] type MaxFeeCurrencyOrderListLen: Get; + #[pallet::constant] + type MinAssetHubExecutionFee: Get>; + + #[pallet::constant] + type MinRelaychainExecutionFee: Get>; + + /// The currency id of the RelayChain + #[pallet::constant] + type RelaychainCurrencyId: Get>; + type ParachainId: Get; /// The only origin that can set universal fee currency order list type ControlOrigin: EnsureOrigin; type XcmWeightAndFeeHandler: XcmDestWeightAndFeeHandler>; + + #[pallet::constant] + type PalletId: Get; } - pub type AccountIdOf = ::AccountId; - pub type CurrencyIdOf = - <::MultiCurrency as MultiCurrency>>::CurrencyId; - pub type PalletBalanceOf = <::Currency as Currency>>::Balance; - pub type NegativeImbalanceOf = - <::Currency as Currency>>::NegativeImbalance; - pub type PositiveImbalanceOf = - <::Currency as Currency>>::PositiveImbalance; + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_idle(_n: BlockNumberFor, limit: Weight) -> Weight { + let mut weight = Weight::default(); + + if WeightMeter::with_limit(limit) + .try_consume(T::DbWeight::get().reads_writes(4, 2)) + .is_err() + { + return weight; + } - pub type CallOf = ::RuntimeCall; + weight += T::DbWeight::get().reads_writes(4, 2); - #[pallet::hooks] - impl Hooks> for Pallet {} + if Self::handle_fee().is_err() { + return weight; + } + + weight += T::DbWeight::get().reads_writes(1, 2); + weight + } + } #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] pub enum Event { - FlexibleFeeExchanged(CurrencyIdOf, PalletBalanceOf), // token and amount + TransferTo { + from: T::AccountId, + amount: BalanceOf, + dest_location: Location, + }, + FlexibleFeeExchanged { + transaction_fee_currency: CurrencyIdOf, + transaction_fee_amount: PalletBalanceOf, + }, // token and amount FixedRateFeeExchanged(CurrencyIdOf, PalletBalanceOf), // [extra_fee_name, currency_id, amount_in, BNC_amount_out] - ExtraFeeDeducted(ExtraFeeName, CurrencyIdOf, PalletBalanceOf, PalletBalanceOf), + ExtraFeeDeducted { + operation: ExtraFeeName, + transaction_extra_fee_currency: CurrencyIdOf, + transaction_extra_fee_amount: PalletBalanceOf, + transaction_extra_fee_bnc_amount: PalletBalanceOf, + transaction_extra_fee_receiver: T::AccountId, + }, } /// The current storage version, we set to 2 our new version(after migrate stroage from vec t @@ -147,6 +201,8 @@ pub mod pallet { WrongListLength, WeightAndFeeNotExist, DexFailedToGetAmountInByPath, + UnweighableMessage, + XcmExecutionFailed, } #[pallet::call] @@ -188,6 +244,134 @@ pub mod pallet { } impl Pallet { + #[transactional] + fn handle_fee() -> DispatchResult { + let pending_transfer_to_assethub_account = + Self::get_fee_receiver(ExtraFeeName::StatemineTransfer); + let pending_transfer_to_assethub_amount = T::MultiCurrency::free_balance( + T::RelaychainCurrencyId::get(), + &pending_transfer_to_assethub_account, + ); + if pending_transfer_to_assethub_amount >= T::MinAssetHubExecutionFee::get() { + let dest_location = Location::new( + 1, + [ + Parachain(parachains::Statemine::ID), + AccountId32 { + network: None, + id: Sibling::from(T::ParachainId::get()).into_account_truncating(), + }, + ], + ); + + let asset: Asset = Asset { + id: AssetId(Location::here()), + fun: Fungible(UniqueSaturatedInto::::unique_saturated_into( + pending_transfer_to_assethub_amount, + )), + }; + + let remote_call = + RelaychainCall::, AccountIdOf, BlockNumberFor>::XcmPallet( + PolkadotXcmCall::LimitedTeleportAssets( + Box::new(Location::new(0, [Parachain(parachains::Statemine::ID)]).into()), + Box::new( + Location::new( + 0, + [AccountId32 { + network: None, + id: Sibling::from(T::ParachainId::get()) + .into_account_truncating(), + }], + ) + .into(), + ), + Box::new(asset.into()), + 0, + Unlimited, + ), + ) + .encode() + .into(); + + let (require_weight_at_most, xcm_fee) = + T::XcmWeightAndFeeHandler::get_operation_weight_and_fee( + T::RelaychainCurrencyId::get(), + XcmOperationType::TeleportAssets, + ) + .ok_or(Error::::WeightAndFeeNotExist)?; + + let fee: Asset = Asset { + id: AssetId(Location::here()), + fun: Fungible(UniqueSaturatedInto::::unique_saturated_into(xcm_fee)), + }; + + let remote_xcm = Xcm(vec![ + WithdrawAsset(fee.clone().into()), + BuyExecution { fees: fee.clone(), weight_limit: Unlimited }, + Transact { + origin_kind: OriginKind::SovereignAccount, + require_weight_at_most, + call: remote_call, + }, + DepositAsset { + assets: All.into(), + beneficiary: Location::new(0, [Parachain(T::ParachainId::get().into())]), + }, + ]); + let (ticket, _) = + T::XcmRouter::validate(&mut Some(Location::parent()), &mut Some(remote_xcm)) + .map_err(|_| Error::::UnweighableMessage)?; + T::XcmRouter::deliver(ticket).map_err(|_| Error::::XcmExecutionFailed)?; + + Self::deposit_event(Event::TransferTo { + from: pending_transfer_to_assethub_account, + amount: pending_transfer_to_assethub_amount, + dest_location, + }); + } + + let pending_transfer_to_relaychain_account = + Self::get_fee_receiver(ExtraFeeName::VoteVtoken); + let pending_transfer_to_relaychain_amount = T::MultiCurrency::free_balance( + T::RelaychainCurrencyId::get(), + &pending_transfer_to_relaychain_account, + ); + if pending_transfer_to_relaychain_amount >= T::MinRelaychainExecutionFee::get() { + let dest_location = Location::new( + 1, + [AccountId32 { + network: None, + id: ParaId::from(T::ParachainId::get()).into_account_truncating(), + }], + ); + let result = T::MultiCurrency::withdraw( + T::RelaychainCurrencyId::get(), + &pending_transfer_to_relaychain_account, + pending_transfer_to_relaychain_amount, + ); + if result.is_ok() { + Self::deposit_event(Event::TransferTo { + from: pending_transfer_to_relaychain_account, + amount: pending_transfer_to_relaychain_amount, + dest_location, + }); + } + } + + Ok(()) + } + + fn get_fee_receiver(extra_fee_name: ExtraFeeName) -> T::AccountId { + match extra_fee_name { + ExtraFeeName::SalpContribute | + ExtraFeeName::VoteVtoken | + ExtraFeeName::VoteRemoveDelegatorVote => T::PalletId::get().into_sub_account_truncating(0u64), + ExtraFeeName::StatemineTransfer => T::PalletId::get().into_sub_account_truncating(1u64), + ExtraFeeName::NoExtraFee => T::TreasuryAccount::get(), + } + } + /// Get user fee charge assets order fn inner_get_user_fee_charge_order_list(account_id: &T::AccountId) -> Vec> { let mut order_list: Vec> = Vec::new(); @@ -206,6 +390,54 @@ impl Pallet { order_list } + fn find_out_fee_currency_and_amount( + who: &T::AccountId, + fee: PalletBalanceOf, + ) -> Result, PalletBalanceOf, PalletBalanceOf)>, Error> { + // get the user defined fee charge order list. + let user_fee_charge_order_list = Self::inner_get_user_fee_charge_order_list(who); + + // charge the fee by the order of the above order list. + // first to check whether the user has the asset. If no, pass it. If yes, try to make + // transaction in the DEX in exchange for BNC + for currency_id in user_fee_charge_order_list { + // If it is mainnet currency + if currency_id == BNC { + // check native balance if is enough + if T::MultiCurrency::ensure_can_withdraw(currency_id, who, fee).is_ok() { + // currency, amount_in, amount_out + return Ok(Some((currency_id, fee, fee))); + } + } else { + // If it is other assets, go to exchange fee amount. + let native_asset_id = + Self::get_currency_asset_id(BNC).map_err(|_| Error::::ConversionError)?; + + let amount_out: AssetBalance = fee.saturated_into(); + + let asset_id = Self::get_currency_asset_id(currency_id) + .map_err(|_| Error::::ConversionError)?; + + let path = vec![asset_id, native_asset_id]; + // see if path exists, if not, continue. + // query for amount in + if let Ok(amounts) = T::DexOperator::get_amount_in_by_path(amount_out, &path) { + // make sure the user has enough free token balance that can be charged. + let amount_in = PalletBalanceOf::::saturated_from(amounts[0]); + if T::MultiCurrency::ensure_can_withdraw(currency_id, who, amount_in).is_ok() { + // currency, amount_in, amount_out + return Ok(Some(( + currency_id, + amount_in, + PalletBalanceOf::::saturated_from(amount_out), + ))); + } + } + } + } + Ok(None) + } + /// Make sure there are enough BNC to be deducted if the user has assets in other form of tokens /// rather than BNC. fn ensure_can_charge_fee( @@ -230,10 +462,10 @@ impl Pallet { who, )?; - Self::deposit_event(Event::FlexibleFeeExchanged( - currency_id, - PalletBalanceOf::::saturated_from(amount_in), - )); + Self::deposit_event(Event::FlexibleFeeExchanged { + transaction_fee_currency: currency_id, + transaction_fee_amount: PalletBalanceOf::::saturated_from(amount_in), + }); } } @@ -362,31 +594,31 @@ where ) .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Custom(44)))?; - // burn fee_currency - T::MultiCurrency::withdraw(fee_info.extra_fee_currency, who, fee_value) - .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Payment))?; + let transaction_extra_fee_receiver = Self::get_fee_receiver(fee_info.extra_fee_name); - // deposit extra fee deducted event - Self::deposit_event(Event::ExtraFeeDeducted( - fee_info.extra_fee_name, + T::MultiCurrency::transfer( fee_info.extra_fee_currency, + who, + &transaction_extra_fee_receiver, fee_value, - extra_bnc_fee, - )); + ) + .map_err(|_| TransactionValidityError::Invalid(InvalidTransaction::Payment))?; + + // deposit extra fee deducted event + Self::deposit_event(Event::ExtraFeeDeducted { + operation: fee_info.extra_fee_name, + transaction_extra_fee_currency: fee_info.extra_fee_currency, + transaction_extra_fee_amount: fee_value, + transaction_extra_fee_bnc_amount: extra_bnc_fee, + transaction_extra_fee_receiver, + }); } // withdraw normal extrinsic fee - let rs = match T::Currency::withdraw( - who, - fee, - withdraw_reason, - ExistenceRequirement::AllowDeath, - ) { + match T::Currency::withdraw(who, fee, withdraw_reason, ExistenceRequirement::AllowDeath) { Ok(imbalance) => Ok(Some(imbalance)), - Err(_msg) => Err(InvalidTransaction::Payment.into()), - }; - - rs + Err(_) => Err(InvalidTransaction::Payment.into()), + } } /// Hand the fee and the tip over to the `[OnUnbalanced]` implementation. @@ -425,53 +657,3 @@ where Ok(()) } } - -impl Pallet { - fn find_out_fee_currency_and_amount( - who: &T::AccountId, - fee: PalletBalanceOf, - ) -> Result, PalletBalanceOf, PalletBalanceOf)>, Error> { - // get the user defined fee charge order list. - let user_fee_charge_order_list = Self::inner_get_user_fee_charge_order_list(who); - - // charge the fee by the order of the above order list. - // first to check whether the user has the asset. If no, pass it. If yes, try to make - // transaction in the DEX in exchange for BNC - for currency_id in user_fee_charge_order_list { - // If it is mainnet currency - if currency_id == BNC { - // check native balance if is enough - if T::MultiCurrency::ensure_can_withdraw(currency_id, who, fee).is_ok() { - // currency, amount_in, amount_out - return Ok(Some((currency_id, fee, fee))); - } - } else { - // If it is other assets, go to exchange fee amount. - let native_asset_id = - Self::get_currency_asset_id(BNC).map_err(|_| Error::::ConversionError)?; - - let amount_out: AssetBalance = fee.saturated_into(); - - let asset_id = Self::get_currency_asset_id(currency_id) - .map_err(|_| Error::::ConversionError)?; - - let path = vec![asset_id, native_asset_id]; - // see if path exists, if not, continue. - // query for amount in - if let Ok(amounts) = T::DexOperator::get_amount_in_by_path(amount_out, &path) { - // make sure the user has enough free token balance that can be charged. - let amount_in = PalletBalanceOf::::saturated_from(amounts[0]); - if T::MultiCurrency::ensure_can_withdraw(currency_id, who, amount_in).is_ok() { - // currency, amount_in, amount_out - return Ok(Some(( - currency_id, - amount_in, - PalletBalanceOf::::saturated_from(amount_out), - ))); - } - } - } - } - Ok(None) - } -} diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mock.rs index 5d7948e7d..1e53f875e 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mock.rs @@ -31,7 +31,7 @@ use cumulus_primitives_core::ParaId as Pid; use frame_support::{ derive_impl, ord_parameter_types, parameter_types, sp_runtime::{DispatchError, DispatchResult}, - traits::{Everything, Get, LockIdentifier, Nothing}, + traits::{ConstU128, Everything, Get, LockIdentifier, Nothing}, weights::{ConstantMultiplier, IdentityFee}, PalletId, }; @@ -48,7 +48,7 @@ use sp_runtime::{ }; use sp_std::marker::PhantomData; use std::convert::TryInto; -use xcm::{prelude::*, v3::MultiLocation}; +use xcm::v3::MultiLocation; use xcm_builder::{FixedWeightBounds, FrameTransactionalProcessor}; use xcm_executor::XcmExecutor; use zenlink_protocol::{ @@ -175,6 +175,7 @@ impl orml_tokens::Config for Test { parameter_types! { pub const TreasuryAccount: AccountId32 = TREASURY_ACCOUNT; pub const MaxFeeCurrencyOrderListLen: u32 = 50; + pub const FlexibleFeePalletId: PalletId = PalletId(*b"bf/flexi"); } ord_parameter_types! { @@ -194,6 +195,11 @@ impl crate::Config for Test { type ParachainId = ParaInfo; type ControlOrigin = EnsureRoot; type XcmWeightAndFeeHandler = XcmDestWeightAndFee; + type MinAssetHubExecutionFee = ConstU128<3>; + type MinRelaychainExecutionFee = ConstU128<3>; + type RelaychainCurrencyId = RelayCurrencyId; + type XcmRouter = (); + type PalletId = FlexibleFeePalletId; } pub struct XcmDestWeightAndFee; @@ -346,7 +352,7 @@ pub type AccountIdOf = ::AccountId; // Mock XcmExecutor pub struct MockXcmExecutor; -impl XcmHelper, crate::pallet::PalletBalanceOf> for MockXcmExecutor { +impl XcmHelper, PalletBalanceOf> for MockXcmExecutor { fn contribute( _contributer: AccountId, _index: ParaId, diff --git a/pallets/xcm-interface/src/calls.rs b/pallets/xcm-interface/src/calls.rs index 39dc37a5f..8c1cbf002 100644 --- a/pallets/xcm-interface/src/calls.rs +++ b/pallets/xcm-interface/src/calls.rs @@ -55,6 +55,14 @@ pub enum PolkadotXcmCall { u32, WeightLimit, ), + #[codec(index = 9)] + LimitedTeleportAssets( + Box, + Box, + Box, + u32, + WeightLimit, + ), } #[derive(Encode, Decode, RuntimeDebug, Clone)] @@ -91,6 +99,8 @@ pub mod polkadot { Crowdloan(ContributeCall), #[codec(index = 29)] Proxy(ProxyCall), + #[codec(index = 99)] + XcmPallet(PolkadotXcmCall), } #[derive(Encode, Decode, RuntimeDebug)] diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index be5155042..3bb427b98 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -330,6 +330,7 @@ pub enum XcmOperationType { Any, SupplementaryFee, EthereumTransfer, + TeleportAssets, } pub struct ExtraFeeInfo { diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index d7699ce22..69c49b6aa 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -230,6 +230,7 @@ parameter_types! { pub const CommissionPalletId: PalletId = PalletId(*b"bf/comms"); pub IncentivePoolAccount: PalletId = PalletId(*b"bf/inpoo"); pub const FarmingGaugeRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmgar"); + pub const FlexibleFeePalletId: PalletId = PalletId(*b"bf/flexi"); } impl frame_system::Config for Runtime { @@ -1059,6 +1060,11 @@ impl bifrost_flexible_fee::Config for Runtime { type ParachainId = ParachainInfo; type ControlOrigin = TechAdminOrCouncil; type XcmWeightAndFeeHandler = XcmInterface; + type MinAssetHubExecutionFee = ConstU128<{ 3 * DOLLARS }>; + type MinRelaychainExecutionFee = ConstU128<{ 3 * DOLLARS }>; + type RelaychainCurrencyId = RelayCurrencyId; + type XcmRouter = XcmRouter; + type PalletId = FlexibleFeePalletId; } parameter_types! { diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 8801aa644..e7d43e2fa 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -224,6 +224,7 @@ parameter_types! { pub const FarmingGaugeRewardIssuerPalletId: PalletId = PalletId(*b"bf/fmgar"); pub const BuyBackAccount: PalletId = PalletId(*b"bf/bybck"); pub const LiquidityAccount: PalletId = PalletId(*b"bf/liqdt"); + pub const FlexibleFeePalletId: PalletId = PalletId(*b"bf/flexi"); } impl frame_system::Config for Runtime { @@ -919,6 +920,11 @@ impl bifrost_flexible_fee::Config for Runtime { type ParachainId = ParachainInfo; type ControlOrigin = TechAdminOrCouncil; type XcmWeightAndFeeHandler = XcmInterface; + type MinAssetHubExecutionFee = ConstU128<{ 20 * CENTS }>; + type MinRelaychainExecutionFee = ConstU128<{ 20 * CENTS }>; + type RelaychainCurrencyId = RelayCurrencyId; + type XcmRouter = XcmRouter; + type PalletId = FlexibleFeePalletId; } parameter_types! { From 9728d3d87e04c971835dadf66c61ad3ad9d611ac Mon Sep 17 00:00:00 2001 From: yooml Date: Wed, 17 Jul 2024 11:50:07 +0800 Subject: [PATCH 10/22] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20add=20market-bond?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pallets/lend-market/src/lib.rs | 69 +++ pallets/lend-market/src/tests.rs | 575 ++++++++++++++++++ pallets/lend-market/src/tests/edge_cases.rs | 2 + .../lend-market/src/tests/interest_rate.rs | 166 ++++- pallets/lend-market/src/tests/lend_tokens.rs | 68 ++- .../lend-market/src/tests/liquidate_borrow.rs | 39 +- 6 files changed, 911 insertions(+), 8 deletions(-) diff --git a/pallets/lend-market/src/lib.rs b/pallets/lend-market/src/lib.rs index 6ae64323e..f31bfab89 100644 --- a/pallets/lend-market/src/lib.rs +++ b/pallets/lend-market/src/lib.rs @@ -194,6 +194,8 @@ pub mod pallet { CodecError, /// Collateral is reserved and cannot be liquidated CollateralReserved, + /// Market bond does not exist + MarketBondDoesNotExist, } #[pallet::event] @@ -260,6 +262,10 @@ pub mod pallet { IncentiveReservesReduced(T::AccountId, AssetIdOf, BalanceOf), /// Liquidation free collaterals has been updated LiquidationFreeCollateralsUpdated(Vec>), + MarketBonded { + asset_id: AssetIdOf, + market_bond: Vec>, + }, } /// The timestamp of the last calculation of accrued interest @@ -446,6 +452,10 @@ pub mod pallet { pub type RewardAccrued = StorageMap<_, Blake2_128Concat, T::AccountId, BalanceOf, ValueQuery>; + #[pallet::storage] + pub type MarketBond = + StorageMap<_, Blake2_128Concat, AssetIdOf, Vec>>; + /// DefaultVersion is using for initialize the StorageVersion #[pallet::type_value] pub(super) fn DefaultVersion() -> Versions { @@ -1126,6 +1136,21 @@ pub mod pallet { Self::deposit_event(Event::::LiquidationFreeCollateralsUpdated(collaterals)); Ok(().into()) } + + #[pallet::call_index(22)] + #[pallet::weight(T::WeightInfo::add_market())] + #[transactional] + pub fn add_market_bond( + origin: OriginFor, + asset_id: AssetIdOf, + market_bond: Vec>, + ) -> DispatchResultWithPostInfo { + T::UpdateOrigin::ensure_origin(origin)?; + MarketBond::::insert(asset_id, market_bond.clone()); + + Self::deposit_event(Event::::MarketBonded { asset_id, market_bond }); + Ok(().into()) + } } } @@ -1460,6 +1485,20 @@ impl Pallet { Ok(()) } + /// Borrower shouldn't borrow more than his bonded collateral value + fn borrow_allowed_for_market_bond( + borrow_asset_id: AssetIdOf, + borrower: &T::AccountId, + borrow_amount: BalanceOf, + ) -> DispatchResult { + Self::ensure_under_borrow_cap(borrow_asset_id, borrow_amount)?; + Self::ensure_enough_cash(borrow_asset_id, borrow_amount)?; + let borrow_value = Self::get_asset_value(borrow_asset_id, borrow_amount)?; + Self::ensure_liquidity_for_market_bond(borrow_asset_id, borrower, borrow_value)?; + + Ok(()) + } + #[require_transactional] fn do_repay_borrow_with_amount( borrower: &T::AccountId, @@ -1877,6 +1916,35 @@ impl Pallet { Err(Error::::InsufficientLiquidity.into()) } + fn ensure_liquidity_for_market_bond( + borrow_asset_id: AssetIdOf, + account: &T::AccountId, + reduce_amount: FixedU128, + ) -> DispatchResult { + let collateral_asset_ids = MarketBond::::try_get(borrow_asset_id) + .map_err(|_err| Error::::MarketBondDoesNotExist)?; + + let currency_borrow_amount = Self::current_borrow_balance(account, borrow_asset_id)?; + let total_borrow_value = Self::get_asset_value(borrow_asset_id, currency_borrow_amount)?; + + let mut total_collateral_value: FixedU128 = FixedU128::zero(); + for asset_id in collateral_asset_ids { + total_collateral_value = total_collateral_value + .checked_add(&Self::collateral_asset_value(account, asset_id)?) + .ok_or(ArithmeticError::Overflow)?; + } + + let total_liquidity = total_collateral_value + .checked_sub(&total_borrow_value) + .ok_or(ArithmeticError::Underflow)?; + + if total_liquidity >= reduce_amount { + return Ok(()); + } + + Err(Error::::InsufficientLiquidity.into()) + } + pub fn calc_underlying_amount( voucher_amount: BalanceOf, exchange_rate: Rate, @@ -2064,6 +2132,7 @@ impl LendMarketTrait, AccountIdOf, BalanceOf> for Self::ensure_active_market(asset_id)?; Self::accrue_interest(asset_id)?; + Self::borrow_allowed_for_market_bond(asset_id, borrower, amount)?; Self::borrow_allowed(asset_id, borrower, amount)?; // update borrow index after accrue interest. diff --git a/pallets/lend-market/src/tests.rs b/pallets/lend-market/src/tests.rs index b4d871049..d23eff689 100644 --- a/pallets/lend-market/src/tests.rs +++ b/pallets/lend-market/src/tests.rs @@ -28,6 +28,21 @@ use sp_runtime::{ #[test] fn init_minting_ok() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(Assets::balance(KSM, ALICE), unit(1000)); assert_eq!(Assets::balance(DOT, ALICE), unit(1000)); assert_eq!(Assets::balance(DOT_U, ALICE), unit(1000)); @@ -39,6 +54,21 @@ fn init_minting_ok() { #[test] fn init_markets_ok() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(LendMarket::market(KSM).unwrap().state, MarketState::Active); assert_eq!(LendMarket::market(DOT).unwrap().state, MarketState::Active); assert_eq!(LendMarket::market(DOT_U).unwrap().state, MarketState::Active); @@ -56,6 +86,21 @@ fn init_markets_ok() { #[test] fn lend_market_native_token_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(::Assets::balance(BNC, &DAVE), unit(1000)); assert_eq!(LendMarket::market(BNC).unwrap().state, MarketState::Active); assert_eq!(BorrowIndex::::get(BNC), Rate::one()); @@ -95,6 +140,21 @@ fn lend_market_native_token_works() { #[test] fn mint_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 100 DOT assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); @@ -113,6 +173,21 @@ fn mint_works() { #[test] fn mint_must_return_err_when_overflows_occur() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); LendMarket::force_update_market( RuntimeOrigin::root(), DOT, @@ -155,6 +230,21 @@ fn mint_must_return_err_when_overflows_occur() { #[test] fn redeem_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Prepare: Bob Deposit 200 DOT assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, 200)); @@ -189,6 +279,26 @@ fn redeem_allowed_works() { #[test] fn lf_redeem_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT_U, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Set CDOT as lf collateral LendMarket::update_liquidation_free_collateral(RuntimeOrigin::root(), vec![PHA]).unwrap(); LendMarket::mint(RuntimeOrigin::signed(ALICE), PHA, unit(200)).unwrap(); @@ -225,6 +335,21 @@ fn lf_redeem_allowed_works() { #[test] fn redeem_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); assert_ok!(LendMarket::redeem(RuntimeOrigin::signed(ALICE), DOT, unit(20))); @@ -242,6 +367,21 @@ fn redeem_works() { #[test] fn redeem_fails() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_noop!( LendMarket::redeem(RuntimeOrigin::signed(ALICE), DOT, unit(0)), Error::::InvalidAmount @@ -252,6 +392,21 @@ fn redeem_fails() { #[test] fn redeem_fails_when_insufficient_liquidity() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Prepare: Bob Deposit 200 DOT assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, 200)); @@ -272,6 +427,21 @@ fn redeem_fails_when_insufficient_liquidity() { #[test] fn redeem_fails_when_would_use_reserved_balanace() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Prepare: Bob Deposit 200 DOT assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, 200)); @@ -293,6 +463,21 @@ fn redeem_fails_when_would_use_reserved_balanace() { #[test] fn redeem_must_return_err_when_overflows_occur() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Amount is too large, max_value / 0.0X == Overflow // Underflow is used here redeem could also be 0 assert_noop!( @@ -305,6 +490,21 @@ fn redeem_must_return_err_when_overflows_occur() { #[test] fn redeem_all_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); assert_ok!(LendMarket::redeem_all(RuntimeOrigin::signed(ALICE), DOT)); @@ -323,6 +523,21 @@ fn redeem_all_works() { #[test] fn borrow_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 200 DOT as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, 200)); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, 200)); @@ -354,6 +569,21 @@ fn borrow_allowed_works() { #[test] fn update_liquidation_free_collateral_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::update_liquidation_free_collateral( RuntimeOrigin::root(), vec![PHA] @@ -365,6 +595,21 @@ fn update_liquidation_free_collateral_works() { #[test] fn get_account_liquidity_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); LendMarket::mint(RuntimeOrigin::signed(ALICE), PHA, unit(200)).unwrap(); LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), PHA, true).unwrap(); @@ -378,6 +623,21 @@ fn get_account_liquidity_works() { #[test] fn get_account_liquidation_threshold_liquidity_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(200)).unwrap(); LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200)).unwrap(); @@ -409,6 +669,21 @@ fn get_account_liquidation_threshold_liquidity_works() { #[test] fn lf_borrow_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); LendMarket::mint(RuntimeOrigin::signed(ALICE), PHA, unit(200)).unwrap(); LendMarket::mint(RuntimeOrigin::signed(DAVE), DOT_U, unit(200)).unwrap(); LendMarket::mint(RuntimeOrigin::signed(DAVE), DOT, unit(200)).unwrap(); @@ -431,6 +706,21 @@ fn lf_borrow_allowed_works() { #[test] fn borrow_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 200 DOT as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -455,6 +745,21 @@ fn borrow_works() { #[test] fn lf_borrow_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 200 DOT as collateral LendMarket::mint(RuntimeOrigin::signed(ALICE), PHA, unit(200)).unwrap(); LendMarket::mint(RuntimeOrigin::signed(DAVE), DOT, unit(200)).unwrap(); @@ -481,6 +786,21 @@ fn lf_borrow_works() { #[test] fn repay_borrow_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Deposit 200 DOT as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -507,6 +827,21 @@ fn repay_borrow_works() { #[test] fn repay_borrow_all_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Bob deposits 200 KSM assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200))); // Alice deposit 200 DOT as collateral @@ -537,6 +872,21 @@ fn repay_borrow_all_works() { #[test] fn collateral_asset_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // No collateral assets assert_noop!( LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true), @@ -570,6 +920,21 @@ fn collateral_asset_works() { #[test] fn total_collateral_value_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Mock the price for DOT = 1, KSM = 1 let collateral_factor = Rate::saturating_from_rational(50, 100); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); @@ -587,6 +952,21 @@ fn total_collateral_value_works() { #[test] fn add_reserves_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Add 100 DOT reserves assert_ok!(LendMarket::add_reserves(RuntimeOrigin::root(), ALICE, DOT, unit(100))); @@ -599,6 +979,21 @@ fn add_reserves_works() { #[test] fn reduce_reserves_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Add 100 DOT reserves assert_ok!(LendMarket::add_reserves(RuntimeOrigin::root(), ALICE, DOT, unit(100))); @@ -614,6 +1009,21 @@ fn reduce_reserves_works() { #[test] fn reduce_reserve_reduce_amount_must_be_less_than_total_reserves() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::add_reserves(RuntimeOrigin::root(), ALICE, DOT, unit(100))); assert_noop!( LendMarket::reduce_reserves(RuntimeOrigin::root(), ALICE, DOT, unit(200)), @@ -625,6 +1035,21 @@ fn reduce_reserve_reduce_amount_must_be_less_than_total_reserves() { #[test] fn ratio_and_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Permill to FixedU128 let ratio = Permill::from_percent(50); let rate: FixedU128 = ratio.into(); @@ -717,6 +1142,21 @@ fn ratio_and_rate_works() { #[test] fn update_exchange_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Initialize value of exchange rate is 0.02 assert_eq!(LendMarket::exchange_rate(DOT), Rate::saturating_from_rational(2, 100)); @@ -745,6 +1185,21 @@ fn update_exchange_rate_works() { #[test] fn current_borrow_balance_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // snapshot.principal = 0 AccountBorrows::::insert( DOT, @@ -789,6 +1244,21 @@ fn calc_collateral_amount_works() { #[test] fn get_price_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); MockPriceFeeder::set_price(DOT, 0.into()); assert_noop!(LendMarket::get_price(DOT), Error::::PriceIsZero); @@ -800,6 +1270,21 @@ fn get_price_works() { #[test] fn ensure_enough_cash_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // assert_ok!(Assets::mint( // RuntimeOrigin::signed(ALICE), // KSM.into(), @@ -826,6 +1311,21 @@ fn ensure_enough_cash_works() { #[test] fn ensure_valid_exchange_rate_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_noop!( LendMarket::ensure_valid_exchange_rate(FixedU128::saturating_from_rational(1, 100)), Error::::InvalidExchangeRate @@ -853,6 +1353,21 @@ fn ensure_valid_exchange_rate_works() { #[test] fn withdraw_missing_reward_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(::Assets::balance(BNC, &DAVE), unit(1000)); assert_ok!(LendMarket::add_reward(RuntimeOrigin::signed(DAVE), unit(100))); @@ -873,6 +1388,21 @@ fn withdraw_missing_reward_works() { #[test] fn update_market_reward_speed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(LendMarket::reward_supply_speed(DOT), 0); assert_eq!(LendMarket::reward_borrow_speed(DOT), 0); @@ -908,6 +1438,21 @@ fn update_market_reward_speed_works() { #[test] fn reward_calculation_one_palyer_in_multi_markets_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(100))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, unit(100))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -1102,6 +1647,21 @@ fn reward_calculation_one_palyer_in_multi_markets_works() { #[test] fn reward_calculation_multi_player_in_one_market_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(10))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(10))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -1199,6 +1759,21 @@ fn reward_calculation_multi_player_in_one_market_works() { #[test] fn reward_calculation_after_liquidate_borrow_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(500))); diff --git a/pallets/lend-market/src/tests/edge_cases.rs b/pallets/lend-market/src/tests/edge_cases.rs index c223b2c1f..5d64d5390 100644 --- a/pallets/lend-market/src/tests/edge_cases.rs +++ b/pallets/lend-market/src/tests/edge_cases.rs @@ -23,6 +23,7 @@ fn exceeded_supply_cap() { #[test] fn repay_borrow_all_no_underflow() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![KSM])); // Alice deposits 200 KSM as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), KSM, true)); @@ -69,6 +70,7 @@ fn ensure_capacity_fails_when_market_not_existed() { #[test] fn redeem_all_should_be_accurate() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![KSM])); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), KSM, true)); assert_ok!(LendMarket::borrow(RuntimeOrigin::signed(ALICE), KSM, unit(50))); diff --git a/pallets/lend-market/src/tests/interest_rate.rs b/pallets/lend-market/src/tests/interest_rate.rs index 62c5bd776..e3859755d 100644 --- a/pallets/lend-market/src/tests/interest_rate.rs +++ b/pallets/lend-market/src/tests/interest_rate.rs @@ -20,6 +20,21 @@ fn utilization_rate_works() { #[test] fn interest_rate_model_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); let rate_decimal: u128 = 1_000_000_000_000_000_000; assert_ok!(Tokens::set_balance( RuntimeOrigin::root(), @@ -113,6 +128,21 @@ fn interest_rate_model_works() { #[test] fn last_accrued_interest_time_should_be_update_correctly() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_eq!(LendMarket::borrow_index(DOT), Rate::one()); assert_eq!(LendMarket::last_accrued_interest_time(DOT), 0); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); @@ -129,6 +159,21 @@ fn last_accrued_interest_time_should_be_update_correctly() { #[test] fn accrue_interest_works_after_mint() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::borrow(RuntimeOrigin::signed(ALICE), DOT, unit(100))); @@ -142,6 +187,21 @@ fn accrue_interest_works_after_mint() { #[test] fn accrue_interest_works_after_borrow() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_eq!(LendMarket::borrow_index(DOT), Rate::one()); @@ -154,6 +214,21 @@ fn accrue_interest_works_after_borrow() { #[test] fn accrue_interest_works_after_redeem() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::borrow(RuntimeOrigin::signed(ALICE), DOT, unit(10))); @@ -173,6 +248,21 @@ fn accrue_interest_works_after_redeem() { #[test] fn accrue_interest_works_after_redeem_all() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(20))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -194,6 +284,21 @@ fn accrue_interest_works_after_redeem_all() { #[test] fn accrue_interest_works_after_repay() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::borrow(RuntimeOrigin::signed(ALICE), DOT, unit(20))); @@ -207,6 +312,21 @@ fn accrue_interest_works_after_repay() { #[test] fn accrue_interest_works_after_repay_all() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); @@ -225,7 +345,21 @@ fn accrue_interest_works_after_repay_all() { #[test] fn accrue_interest_works_after_liquidate_borrow() { new_test_ext().execute_with(|| { - // Bob deposits 200 KSM + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // Bob deposits 200 KSM assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200))); // Alice deposits 300 DOT as collateral assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(300))); @@ -254,6 +388,21 @@ fn accrue_interest_works_after_liquidate_borrow() { #[test] fn different_markets_can_accrue_interest_in_one_block() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), KSM, unit(200))); @@ -271,6 +420,21 @@ fn different_markets_can_accrue_interest_in_one_block() { #[test] fn a_market_can_only_accrue_interest_once_in_a_block() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(ALICE), DOT, unit(200))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(ALICE), DOT, true)); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(200))); diff --git a/pallets/lend-market/src/tests/lend_tokens.rs b/pallets/lend-market/src/tests/lend_tokens.rs index d9ac37a54..036df3b79 100644 --- a/pallets/lend-market/src/tests/lend_tokens.rs +++ b/pallets/lend-market/src/tests/lend_tokens.rs @@ -1,7 +1,7 @@ use crate::{ mock::{ - market_mock, new_test_ext, LendMarket, RuntimeOrigin, Test, ALICE, BNC, DAVE, DOT_U, KSM, - LKSM, LUSDT, VBNC, + market_mock, new_test_ext, LendMarket, RuntimeOrigin, Test, ALICE, BNC, DAVE, DOT, DOT_U, + KSM, LKSM, LUSDT, PHA, VBNC, }, tests::unit, Error, *, @@ -15,7 +15,21 @@ use sp_runtime::{FixedPointNumber, TokenError}; #[test] fn trait_inspect_methods_works() { new_test_ext().execute_with(|| { - // No Deposits can't not withdraw + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // No Deposits can't not withdraw assert_err!( LendMarket::can_withdraw(VBNC, &DAVE, 100).into_result(false), TokenError::FundsUnavailable @@ -91,7 +105,21 @@ fn trait_inspect_methods_works() { #[test] fn lend_token_unique_works() { new_test_ext().execute_with(|| { - // lend_token_id already exists in `UnderlyingAssetId` + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // lend_token_id already exists in `UnderlyingAssetId` assert_noop!( LendMarket::add_market(RuntimeOrigin::root(), LKSM, market_mock(VBNC)), Error::::InvalidLendTokenId @@ -108,7 +136,21 @@ fn lend_token_unique_works() { #[test] fn transfer_lend_token_works() { new_test_ext().execute_with(|| { - // DAVE Deposit 100 BNC + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // DAVE Deposit 100 BNC assert_ok!(LendMarket::mint(RuntimeOrigin::signed(DAVE), BNC, unit(100))); // DAVE BNC collateral: deposit = 100 @@ -155,7 +197,21 @@ fn transfer_lend_token_works() { #[test] fn transfer_lend_tokens_under_collateral_works() { new_test_ext().execute_with(|| { - // DAVE Deposit 100 BNC + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + BNC, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); // DAVE Deposit 100 BNC assert_ok!(LendMarket::mint(RuntimeOrigin::signed(DAVE), BNC, unit(100))); assert_ok!(LendMarket::collateral_asset(RuntimeOrigin::signed(DAVE), BNC, true)); diff --git a/pallets/lend-market/src/tests/liquidate_borrow.rs b/pallets/lend-market/src/tests/liquidate_borrow.rs index 27262d056..13a87c561 100644 --- a/pallets/lend-market/src/tests/liquidate_borrow.rs +++ b/pallets/lend-market/src/tests/liquidate_borrow.rs @@ -12,7 +12,9 @@ use sp_runtime::FixedPointNumber; #[test] fn liquidate_borrow_allowed_works() { new_test_ext().execute_with(|| { - // Borrower should have a positive shortfall + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); // Borrower should have a positive shortfall let dot_market = LendMarket::market(DOT).unwrap(); assert_noop!( LendMarket::liquidate_borrow_allowed(&ALICE, DOT, 100, &dot_market), @@ -38,6 +40,9 @@ fn liquidate_borrow_allowed_works() { #[test] fn lf_liquidate_borrow_fails_due_to_lf_collateral() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); LendMarket::update_liquidation_free_collateral(RuntimeOrigin::root(), vec![PHA]).unwrap(); assert_err!( @@ -54,6 +59,13 @@ fn lf_liquidate_borrow_fails_due_to_lf_collateral() { #[test] fn lf_liquidate_borrow_allowed_works() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + DOT, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); LendMarket::update_liquidation_free_collateral(RuntimeOrigin::root(), vec![PHA]).unwrap(); // Bob deposits $200 DOT LendMarket::mint(RuntimeOrigin::signed(BOB), DOT, unit(200)).unwrap(); @@ -95,6 +107,9 @@ fn lf_liquidate_borrow_allowed_works() { #[test] fn deposit_of_borrower_must_be_collateral() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); // Adjust KSM price to make shortfall @@ -114,6 +129,9 @@ fn deposit_of_borrower_must_be_collateral() { #[test] fn collateral_value_must_be_greater_than_liquidation_value() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); MockPriceFeeder::set_price(KSM, Rate::from_float(2000.0)); @@ -132,6 +150,9 @@ fn collateral_value_must_be_greater_than_liquidation_value() { #[test] fn full_workflow_works_as_expected() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); // adjust KSM price to make ALICE generate shortfall @@ -200,6 +221,9 @@ fn full_workflow_works_as_expected() { #[test] fn liquidator_cannot_take_inactive_market_currency() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); // Adjust KSM price to make shortfall @@ -218,6 +242,9 @@ fn liquidator_cannot_take_inactive_market_currency() { #[test] fn liquidator_can_not_repay_more_than_the_close_factor_pct_multiplier() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); alice_borrows_100_ksm(); MockPriceFeeder::set_price(KSM, 20.into()); @@ -231,6 +258,9 @@ fn liquidator_can_not_repay_more_than_the_close_factor_pct_multiplier() { #[test] fn liquidator_must_not_be_borrower() { new_test_ext().execute_with(|| { + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), KSM, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, KSM])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, KSM])); initial_setup(); assert_noop!( LendMarket::liquidate_borrow(RuntimeOrigin::signed(ALICE), ALICE, KSM, 0, DOT), @@ -244,6 +274,13 @@ fn alice_borrows_100_ksm() { } fn initial_setup() { + assert_ok!(LendMarket::add_market_bond( + RuntimeOrigin::root(), + KSM, + vec![DOT, BNC, KSM, DOT_U, PHA] + )); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, DOT_U, PHA])); + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), BNC, vec![DOT, BNC, DOT_U, PHA])); // Bob deposits 200 KSM assert_ok!(LendMarket::mint(RuntimeOrigin::signed(BOB), KSM, unit(200))); // Alice deposits 200 DOT as collateral From ae7b0595bde49f6bea18a0b4e2508628ba86ae72 Mon Sep 17 00:00:00 2001 From: yooml Date: Wed, 17 Jul 2024 17:57:41 +0800 Subject: [PATCH 11/22] =?UTF-8?q?fix:=20=F0=9F=90=9B=20test-all?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pallets/lend-market/src/benchmarking.rs | 15 +++++++++++++++ pallets/leverage-staking/src/benchmarking.rs | 5 +++++ pallets/leverage-staking/src/tests.rs | 2 ++ 3 files changed, 22 insertions(+) diff --git a/pallets/lend-market/src/benchmarking.rs b/pallets/lend-market/src/benchmarking.rs index dfdff93b9..5bcf94219 100644 --- a/pallets/lend-market/src/benchmarking.rs +++ b/pallets/lend-market/src/benchmarking.rs @@ -227,6 +227,11 @@ benchmarks! { transfer_initial_balance::(caller.clone()); let deposit_amount: u32 = 200_000_000; let borrowed_amount: u32 = 100_000_000; + assert_ok!(LendMarket::::add_market_bond( + SystemOrigin::Root.into(), + DOT_U, + vec![DOT_U] + )); assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); @@ -267,6 +272,11 @@ benchmarks! { let deposit_amount: u32 = 200_000_000; let borrowed_amount: u32 = 100_000_000; let repay_amount: u32 = 100; + assert_ok!(LendMarket::::add_market_bond( + SystemOrigin::Root.into(), + DOT_U, + vec![DOT_U] + )); assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); @@ -283,6 +293,11 @@ benchmarks! { let deposit_amount: u32 = 200_000_000; let borrowed_amount: u32 = 100_000_000; assert_ok!(LendMarket::::add_market(SystemOrigin::Root.into(), DOT_U, pending_market_mock::(LUSDT))); + assert_ok!(LendMarket::::add_market_bond( + SystemOrigin::Root.into(), + DOT_U, + vec![DOT_U] + )); assert_ok!(LendMarket::::activate_market(SystemOrigin::Root.into(), DOT_U)); assert_ok!(LendMarket::::mint(SystemOrigin::Signed(caller.clone()).into(), DOT_U, deposit_amount.into())); assert_ok!(LendMarket::::collateral_asset(SystemOrigin::Signed(caller.clone()).into(), DOT_U, true)); diff --git a/pallets/leverage-staking/src/benchmarking.rs b/pallets/leverage-staking/src/benchmarking.rs index bfed18abb..a4e055a54 100644 --- a/pallets/leverage-staking/src/benchmarking.rs +++ b/pallets/leverage-staking/src/benchmarking.rs @@ -157,6 +157,11 @@ fn init< VKSM, lend_market::BalanceOf::::unique_saturated_from(unit(1u128)) )); + assert_ok!(lend_market::Pallet::::add_market_bond( + SystemOrigin::Root.into(), + KSM, + vec![VKSM] + )); Ok(()) } diff --git a/pallets/leverage-staking/src/tests.rs b/pallets/leverage-staking/src/tests.rs index 124cf4d95..0cbc7adca 100644 --- a/pallets/leverage-staking/src/tests.rs +++ b/pallets/leverage-staking/src/tests.rs @@ -62,6 +62,8 @@ fn init() { assert_ok!(LendMarket::mint(RuntimeOrigin::signed(0), DOT, unit(100))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(0), VDOT, unit(100))); assert_ok!(LendMarket::mint(RuntimeOrigin::signed(1), VDOT, 100_000)); + + assert_ok!(LendMarket::add_market_bond(RuntimeOrigin::root(), DOT, vec![DOT, BNC, VDOT])); } #[test] From 86b608f5cf8f8d1c65a8cf72f95f229711b422ea Mon Sep 17 00:00:00 2001 From: yooml Date: Fri, 19 Jul 2024 16:41:19 +0800 Subject: [PATCH 12/22] =?UTF-8?q?fix:=20=F0=9F=90=9B=20try-runtime?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- runtime/bifrost-kusama/Cargo.toml | 1 + runtime/bifrost-polkadot/Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/runtime/bifrost-kusama/Cargo.toml b/runtime/bifrost-kusama/Cargo.toml index 66fd6df29..3e93f2e4d 100644 --- a/runtime/bifrost-kusama/Cargo.toml +++ b/runtime/bifrost-kusama/Cargo.toml @@ -358,6 +358,7 @@ try-runtime = [ "pallet-treasury/try-runtime", "pallet-bounties/try-runtime", "pallet-tips/try-runtime", + "pallet-tx-pause/try-runtime", "pallet-preimage/try-runtime", "pallet-whitelist/try-runtime", "orml-xtokens/try-runtime", diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index 07ccf634c..7f00cb5a5 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -362,6 +362,7 @@ try-runtime = [ "pallet-session/try-runtime", "pallet-timestamp/try-runtime", "pallet-tips/try-runtime", + "pallet-tx-pause/try-runtime", "pallet-transaction-payment/try-runtime", "pallet-treasury/try-runtime", "pallet-utility/try-runtime", From 74888e7176105075e087983fcb829df35e52fa89 Mon Sep 17 00:00:00 2001 From: SunTiebing <1045060705@qq.com> Date: Fri, 19 Jul 2024 18:05:52 +0800 Subject: [PATCH 13/22] Add the channel_id field to the Minted event --- pallets/vtoken-minting/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pallets/vtoken-minting/src/lib.rs b/pallets/vtoken-minting/src/lib.rs index 24836a404..599ea45f5 100644 --- a/pallets/vtoken-minting/src/lib.rs +++ b/pallets/vtoken-minting/src/lib.rs @@ -187,6 +187,7 @@ pub mod pallet { vtoken_amount: BalanceOf, fee: BalanceOf, remark: BoundedVec>, + channel_id: Option, }, Redeemed { address: AccountIdOf, @@ -1597,6 +1598,7 @@ pub mod pallet { vtoken_amount, fee, remark, + channel_id, }); Ok(vtoken_amount.into()) } From c56611a80bee814511adebd615a0c5af525abeda Mon Sep 17 00:00:00 2001 From: SunTiebing <87381708+SunTiebing@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:18:21 +0800 Subject: [PATCH 14/22] Upgrade to polkadot-v1.13.0 (#1312) * Upgrade to polkadot-v1.13.0 * remove the warning * Fix dep issues * Upgrade to polkadot-v1.13.0 * supplement and upgrade the code * Upgrade the new parts from v0.12.0 * Fix dep issues * format Cargo.toml * Modify the AddOrigin type of the fellowship in bifrost-polkadot * Cancel the cross-in-out migration. * fix clippy --------- Co-authored-by: hqwangningbo <2536935847@qq.com> --- .github/workflows/benchmark.yml | 2 +- .github/workflows/ci-build.yml | 2 +- .github/workflows/release.yml | 2 +- Cargo.lock | 3954 ++++++++++------- Cargo.toml | 324 +- Dockerfile | 4 +- integration-tests/Cargo.toml | 1 + integration-tests/src/mock/bifrost.rs | 4 + integration-tests/src/mock/relaychain.rs | 45 + integration-tests/src/tests/slp.rs | 3 +- node/cli/Cargo.toml | 5 +- node/cli/src/command.rs | 23 +- node/rpc/Cargo.toml | 6 +- node/rpc/src/lib.rs | 2 +- node/service/Cargo.toml | 3 +- node/service/src/chain_spec/bifrost_kusama.rs | 4 +- .../src/chain_spec/bifrost_polkadot.rs | 4 +- node/service/src/collator_kusama.rs | 21 +- node/service/src/collator_polkadot.rs | 21 +- pallets/buy-back/src/mock.rs | 4 + pallets/clouds-convert/src/mock.rs | 5 + pallets/cross-in-out/src/lib.rs | 2 + pallets/cross-in-out/src/tests.rs | 4 + pallets/currencies/src/lib.rs | 23 +- pallets/farming/src/lib.rs | 14 +- pallets/fee-share/src/mock.rs | 4 + pallets/flexible-fee/src/mock.rs | 4 + pallets/lend-market/src/benchmarking.rs | 11 +- pallets/leverage-staking/src/lib.rs | 4 +- pallets/leverage-staking/src/mock.rs | 4 + pallets/parachain-staking/src/benchmarks.rs | 1 - pallets/parachain-staking/src/tests.rs | 5 +- pallets/salp/src/benchmarking.rs | 1 - pallets/salp/src/mock.rs | 4 + pallets/slp/src/benchmarking.rs | 1 - pallets/slp/src/mocks/mock.rs | 4 + pallets/slp/src/mocks/mock_kusama.rs | 4 + pallets/slpx/src/benchmarking.rs | 1 - pallets/slpx/src/mock.rs | 4 + pallets/stable-pool/src/mock.rs | 4 + pallets/system-maker/src/mock.rs | 4 + pallets/system-staking/src/mock.rs | 4 + pallets/ve-minting/src/lib.rs | 1 - pallets/ve-minting/src/mock.rs | 4 + pallets/vtoken-minting/src/mock.rs | 4 + pallets/vtoken-voting/src/mock.rs | 4 + .../src/governance/fellowship.rs | 5 +- runtime/bifrost-kusama/src/lib.rs | 24 +- runtime/bifrost-kusama/src/xcm_config.rs | 8 + .../src/governance/fellowship.rs | 8 +- runtime/bifrost-polkadot/src/lib.rs | 24 +- runtime/bifrost-polkadot/src/xcm_config.rs | 8 + runtime/common/src/lib.rs | 4 +- rust-toolchain.toml | 2 +- scripts/init.sh | 4 +- 55 files changed, 2825 insertions(+), 1821 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index da101b6d0..4eb3909b3 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -20,7 +20,7 @@ jobs: with: components: rustfmt target: wasm32-unknown-unknown - toolchain: 1.74.0 + toolchain: 1.77.0 - name: Generate WeightInfo Files run: make generate-bifrost-weights - name: Commit Automatically diff --git a/.github/workflows/ci-build.yml b/.github/workflows/ci-build.yml index 08d034534..c3cb51fb3 100644 --- a/.github/workflows/ci-build.yml +++ b/.github/workflows/ci-build.yml @@ -25,7 +25,7 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@master with: - toolchain: 1.74.0 + toolchain: 1.77.0 components: rustfmt, clippy target: wasm32-unknown-unknown - name: Cargo clippy diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7bb04416..5e3de645a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: with: components: rustfmt target: wasm32-unknown-unknown - toolchain: 1.74.0 + toolchain: 1.77.0 - name: Download kusama strool result uses: actions/download-artifact@v4 diff --git a/Cargo.lock b/Cargo.lock index 9987d4bea..f3c3ad7b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -23,11 +23,11 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ - "gimli 0.28.1", + "gimli 0.29.0", ] [[package]] @@ -68,18 +68,7 @@ dependencies = [ "cipher 0.4.4", "ctr", "ghash", - "subtle 2.5.0", -] - -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.14", - "once_cell", - "version_check", + "subtle 2.6.1", ] [[package]] @@ -89,7 +78,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "version_check", "zerocopy", @@ -142,47 +131,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -190,9 +180,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "approx" @@ -214,7 +204,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -343,20 +333,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] name = "array-bytes" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6" - -[[package]] -name = "array-bytes" -version = "6.2.2" +version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f840fb7195bcfc5e17ea40c26e5ce6d5b9ce5d584466e17703209657e459ae0" +checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" [[package]] name = "arrayref" @@ -404,7 +388,7 @@ dependencies = [ "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -437,22 +421,21 @@ dependencies = [ [[package]] name = "async-channel" -version = "2.2.1" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136d4d23bcc79e27423727b36823d86233aad06dfea531837b038394d11e9928" +checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener 5.3.0", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite 0.2.14", ] [[package]] name = "async-executor" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" dependencies = [ "async-task", "concurrent-queue", @@ -495,17 +478,17 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.0", + "polling 3.7.2", "rustix 0.38.34", "slab", "tracing", @@ -523,12 +506,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.3.1", + "event-listener-strategy", "pin-project-lite 0.2.14", ] @@ -562,12 +545,12 @@ dependencies = [ [[package]] name = "async-signal" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" dependencies = [ - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", @@ -586,13 +569,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -622,22 +605,22 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ - "addr2line 0.21.0", + "addr2line 0.22.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object 0.32.2", + "object 0.36.1", "rustc-demangle", ] @@ -665,6 +648,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "base64ct" version = "1.6.0" @@ -795,6 +784,7 @@ dependencies = [ "polkadot-primitives", "sc-cli", "sc-executor", + "sc-network", "sc-offchain", "sc-service", "sc-sysinfo", @@ -805,7 +795,6 @@ dependencies = [ "sp-runtime", "staging-node-inspect", "substrate-build-script-utils", - "try-runtime-cli", ] [[package]] @@ -1032,6 +1021,7 @@ dependencies = [ "bifrost-slp", "bifrost-vtoken-voting", "bifrost-xcm-interface", + "cumulus-pallet-parachain-system", "cumulus-primitives-core", "env_logger", "frame-support", @@ -1600,7 +1590,6 @@ dependencies = [ "staging-xcm", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", - "try-runtime-cli", "zenlink-protocol", "zenlink-protocol-runtime-api", "zenlink-stable-amm-runtime-api", @@ -2095,9 +2084,9 @@ dependencies = [ [[package]] name = "binary-merkle-tree" -version = "14.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf857f8f411164ce1af14a778626af96251de7a77837711efbc440807e7053f" +checksum = "4b5c0fd4282c30c05647e1052d71bf1a0c8067ab1e9a8fc6d0c292dce0ecb237" dependencies = [ "hash-db 0.16.0", "log", @@ -2124,13 +2113,13 @@ dependencies = [ "lazy_static", "lazycell", "peeking_take_while", - "prettyplease 0.2.19", + "prettyplease 0.2.20", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -2139,19 +2128,31 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93f2635620bf0b9d4576eb7bb9a38a55df78bd1205d26fa994b25911a69f212f" dependencies = [ - "bitcoin_hashes", - "rand", - "rand_core 0.6.4", - "serde", - "unicode-normalization", + "bitcoin_hashes 0.11.0", ] +[[package]] +name = "bitcoin-internals" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9425c3bf7089c983facbae04de54513cce73b41c7f9ff8c845b54e7bc64ebbfb" + [[package]] name = "bitcoin_hashes" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90064b8dee6815a6470d60bad07bbbaee885c0e12d04177138fa3291a01b7bc4" +[[package]] +name = "bitcoin_hashes" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1930a4dabfebb8d7d9992db18ebe3ae2876f0a305fab206fd168df931ede293b" +dependencies = [ + "bitcoin-internals", + "hex-conservative", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -2160,9 +2161,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitvec" @@ -2232,9 +2233,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.1" +version = "1.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +checksum = "e9ec96fe9a81b5e365f9db71fe00edc4fe4ca2cc7dcb7861f0603012a7caa210" dependencies = [ "arrayref", "arrayvec 0.7.4", @@ -2263,12 +2264,11 @@ dependencies = [ [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ - "async-channel 2.2.1", - "async-lock 3.3.0", + "async-channel 2.3.1", "async-task", "futures-io", "futures-lite 2.3.0", @@ -2298,9 +2298,9 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" -version = "0.7.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ff4abe93be7bc1663adc41817b1aa3476fbec953ce361537419924310d5dd4" +checksum = "b7dae4d1ec894ee920195dd39070b279ef3c1d4d078c3fcf7336c93a1d502a9d" dependencies = [ "parity-scale-codec", "scale-info", @@ -2369,9 +2369,9 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "bytemuck" -version = "1.15.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6d68c57235a3a081186990eca2867354726650f42f7516ca50c28d6281fd15" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" @@ -2381,9 +2381,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "bzip2-sys" @@ -2408,9 +2408,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] @@ -2432,7 +2432,7 @@ checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ "camino", "cargo-platform", - "semver 1.0.22", + "semver 1.0.23", "serde", "serde_json", "thiserror", @@ -2440,13 +2440,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" dependencies = [ "jobserver", "libc", - "once_cell", ] [[package]] @@ -2524,7 +2523,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -2540,6 +2539,19 @@ dependencies = [ "unsigned-varint", ] +[[package]] +name = "cid" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd94671561e36e4e7de75f753f577edafb0e7c05d6e4547229fdf7938fbcd2c3" +dependencies = [ + "core2", + "multibase", + "multihash 0.18.1", + "serde", + "unsigned-varint", +] + [[package]] name = "cipher" version = "0.2.5" @@ -2560,20 +2572,11 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ckb-merkle-mountain-range" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ccb671c5921be8a84686e6212ca184cb1d7c51cadcdbfcbd1cc3f042f5dfb8" -dependencies = [ - "cfg-if", -] - [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -2582,9 +2585,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", "clap_derive", @@ -2592,9 +2595,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", @@ -2612,14 +2615,14 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "coarsetime" @@ -2644,9 +2647,19 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + +[[package]] +name = "combine" +version = "4.6.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" +dependencies = [ + "bytes", + "memchr", +] [[package]] name = "comfy-table" @@ -2708,7 +2721,7 @@ version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d839f2a20b0aee515dc581a6172f2321f96cab76c1a38a4c584a194955390e" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "once_cell", "tiny-keccak", ] @@ -2814,7 +2827,7 @@ dependencies = [ "gimli 0.27.3", "hashbrown 0.13.2", "log", - "regalloc2", + "regalloc2 0.6.1", "smallvec", "target-lexicon", ] @@ -2888,11 +2901,26 @@ dependencies = [ "wasmtime-types", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -2927,9 +2955,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crunchy" @@ -2945,7 +2973,7 @@ checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array 0.14.7", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -2977,17 +3005,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ "generic-array 0.14.7", - "subtle 2.5.0", -] - -[[package]] -name = "crypto-mac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" -dependencies = [ - "generic-array 0.14.7", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -3001,9 +3019,9 @@ dependencies = [ [[package]] name = "cumulus-client-cli" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70d2597fe3235d263457aaff65d0fb5bed506698b81530e2e6afecd6d6c9af32" +checksum = "7980387e86a9447caa3c3aa2a0c908e6dc94d81e5494c12e56146a6271204b31" dependencies = [ "clap", "parity-scale-codec", @@ -3019,16 +3037,16 @@ dependencies = [ [[package]] name = "cumulus-client-collator" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c06ae72a125d056da3b722f00f87881a2afbb2af8fe9fa9a91587f139b9667e" +checksum = "1291bce46c865d627075f7f1d980e22b011dbe670cacea6b0b9c95f83eb4ebdd" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-primitives-core", "futures 0.3.30", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", @@ -3043,9 +3061,9 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18f4977f6a88af39c46832d571ac0d95e8322bf22eab42550fec34f72da9f034" +checksum = "fe170ff77c66f15afe0ce18940f51f78920d80215165c919469516be57108e59" dependencies = [ "async-trait", "cumulus-client-collator", @@ -3086,9 +3104,9 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350db1fc8841a44f344474b791d2ebe61b79bf6061043a7d826b3d02d1935a56" +checksum = "cca21fecfbeedaabf25c421573dfe3e3392d376e2b4acd4a281062ad142ce1b9" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -3116,9 +3134,9 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38028f75597a34d447f059d6a7fd9c1c91bce0b8c48b08b1cbd19eb3def9c376" +checksum = "56e980b3e5c05415eaa4ac07f398bc8e74666811f3112f19a654ccb3a948018e" dependencies = [ "anyhow", "async-trait", @@ -3132,16 +3150,16 @@ dependencies = [ [[package]] name = "cumulus-client-network" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ac095ef439c595ccb998be5a9d40778d8963c5a8ebbaed838fed6293232915b" +checksum = "7d9d520c245f0df156dc50a86dfec79efcda7733a99eeb2224e315a26eab4650" dependencies = [ "async-trait", "cumulus-relay-chain-interface", "futures 0.3.30", "futures-timer", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-parachain-primitives", "polkadot-primitives", @@ -3156,9 +3174,9 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" -version = "0.2.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b516290cd4a6efc117824135761f3642dc57685e13da00727c460053ce978fe" +checksum = "9ff5587b8a306617db8f6528f9244c6ee4344745eeb252b3c7b20ea6c2496b3c" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3181,9 +3199,9 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4d55e96004ca9aa9d9b96a28ab2d97b1ca8d303c9d2405ea34cdf1462d4c4f0" +checksum = "ca43387c87d4b6fb2f8ff5ac70e46b7bea0ff686b6445e8bd4b6e44691d6616e" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3195,7 +3213,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-overseer", "polkadot-primitives", - "rand", + "rand 0.8.5", "sc-client-api", "sc-consensus", "sp-consensus", @@ -3206,9 +3224,9 @@ dependencies = [ [[package]] name = "cumulus-client-service" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "657f57c56159bb6cb74d9221de8f11c9e09962666381357896562662d3019799" +checksum = "5c6b433d3036a30f2aaacd4249988084f55ca3291c9388fa7e78e4b6222f74ef" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -3237,15 +3255,16 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-core", + "sp-io", "sp-runtime", "sp-transaction-pool", ] [[package]] name = "cumulus-pallet-aura-ext" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8e78b18548ae3454bc8a46e2bc2e3f521ea547844cbaecc9344d4741f4b1ef" +checksum = "52088d88534bd04ea251c030af1fef69845d29ed4fc9be399c1fbd5a311bea61" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -3262,9 +3281,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" -version = "0.8.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a215fe4d66d23e8f3956bd21b9d80d2b33239f3b150b36d56fa238cfc9421a5" +checksum = "95f75a9e4dfebf1850c7c946a49cdb8b5e82a143155a40337ea083f412e13071" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -3293,6 +3312,7 @@ dependencies = [ "sp-trie", "sp-version", "staging-xcm", + "staging-xcm-builder", "trie-db", ] @@ -3305,14 +3325,14 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "cumulus-pallet-xcm" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e802291060763f8d1176bf808da97aafe5afe7351f62bb093c317c1d35c5cee" +checksum = "dccf061aecc7c4b393c6586a0d95900bc0dfc8ac9298313a608d2389bf7f8de2" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3327,9 +3347,9 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa22d6e479a4d3a2790bab291269ba0917a1ac384255a54a2ebc3f7c37e505e" +checksum = "437a52fc63387f1aa2211bc219e1283a935ed36d9ccbb3373faee0398125c466" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -3348,14 +3368,15 @@ dependencies = [ "sp-runtime", "sp-std", "staging-xcm", + "staging-xcm-builder", "staging-xcm-executor", ] [[package]] name = "cumulus-primitives-aura" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f07d6177692154043d7ddcc0b87ca5365ae8e4d94b90d9931f6b2f76e162f09" +checksum = "3e7977947ad43a4cbc532ca33abcde136ae3deffdc7168b2ae253d73ccd371e4" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3368,9 +3389,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9df07f6825fd50ea30aae335e43dc1a615a05de7465f5f329b9e414f2c886a12" +checksum = "751e64b89a839d5cfabebc1c797936e5eee791d0fa2322d91e86f8440a743ddb" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3386,9 +3407,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ad140a065a6b8001fb26ec42b91391e90fde120f5b4e57986698249a9b98c8" +checksum = "df521e13b48278b86d02c61d6e44036d6d263deb5aaec4838b1751da8988d3d2" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3396,15 +3417,17 @@ dependencies = [ "scale-info", "sp-core", "sp-inherents", + "sp-runtime", + "sp-state-machine", "sp-std", "sp-trie", ] [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.3.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b74f9141190b9f4bf96a947ade46da64097b77f1ebfa8d611c81724250e119" +checksum = "9f973d2a7262c90e48dcd42062bcb1e0fbf48bbcdac4ea6df3d85212d8d8be5d" dependencies = [ "sp-externalities", "sp-runtime-interface", @@ -3413,9 +3436,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-timestamp" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34584abda4aeac69abe08ba3146d0ca059cd5636a8c4ccf680f2b9f99fc5f8ee" +checksum = "e08ad90f55963672079811170bc3899066b6b73aea7db17f6db5220541a0aa7b" dependencies = [ "cumulus-primitives-core", "futures 0.3.30", @@ -3427,9 +3450,9 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" -version = "0.8.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e65466e56d642f979b556d098a03755ae51972fff5fa0f9b1cdcfdb3df062ea3" +checksum = "192d7917d70fdb0998311df31430bd28408af9abce79a2245efbf511a8fa4671" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3448,9 +3471,9 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff27dec2eab6cd1d854756d62bd7053721ccd115f36f9e8b0976b1e46b70ef7" +checksum = "14d271cbd47783a94e4cb9db3ef34c4e4e05773e16bb6ec766f2ea9939d84644" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3473,9 +3496,9 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40c736f39b50eecf194707e15d0359677bb8fe8138b01f6493ab9b7e10d2d1ae" +checksum = "6f324e573f19f7d4478f19f8e58dd922024712fd9c656e8a3112ee7d7ff3f414" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3492,17 +3515,17 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7718fe298d567adc44fae3dd7024418d6eff08264041e4b0544d1892861cd6" +checksum = "17aeea632dad3e8251c85ea6a2e5c8deed7f69b6465671347106de27bfcdc70a" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-trait", "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", "futures 0.3.30", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-availability-recovery", "polkadot-collator-protocol", "polkadot-core-primitives", @@ -3515,6 +3538,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", + "polkadot-service", "sc-authority-discovery", "sc-client-api", "sc-network", @@ -3534,9 +3558,9 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8e2269d4c1f37593257b3d7b90f8b56adab0793d9b9f5c1b5334c9ca7e3b10b" +checksum = "7f292767910d0e65aa52b350b606a8a8d0990c6a780abad5d8358f25b0280405" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3548,7 +3572,7 @@ dependencies = [ "parity-scale-codec", "pin-project", "polkadot-overseer", - "rand", + "rand 0.8.5", "sc-client-api", "sc-rpc-api", "sc-service", @@ -3574,9 +3598,9 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfff604ad01c5c0c397f9a971c8cec6443aea3658813778875b4f64de07847d5" +checksum = "e1f4ab9d64a581d4a5431f2554f4602a4208c5e28b30be01af386e24d8447599" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -3596,24 +3620,23 @@ dependencies = [ "byteorder", "digest 0.9.0", "rand_core 0.5.1", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] [[package]] name = "curve25519-dalek" -version = "4.1.2" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a677b8922c94e01bdbb12126b0bc852f00447528dee1782229af9c720c3f348" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", "cpufeatures", "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "platforms", "rustc_version", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -3625,7 +3648,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -3643,9 +3666,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.121" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21db378d04296a84d8b7d047c36bb3954f0b46529db725d7e62fb02f9ba53ccc" +checksum = "273dcfd3acd4e1e276af13ed2a43eea7001318823e7a726a6b3ed39b4acc0b82" dependencies = [ "cc", "cxxbridge-flags", @@ -3655,9 +3678,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.121" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5262a7fa3f0bae2a55b767c223ba98032d7c328f5c13fa5cdc980b77fc0658" +checksum = "d8b2766fbd92be34e9ed143898fce6c572dc009de39506ed6903e5a05b68914e" dependencies = [ "cc", "codespan-reporting", @@ -3665,24 +3688,37 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "cxxbridge-flags" -version = "1.0.121" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8dcadd2e2fb4a501e1d9e93d6e88e6ea494306d8272069c92d5a9edf8855c0" +checksum = "839fcd5e43464614ffaa989eaf1c139ef1f0c51672a1ed08023307fa1b909ccd" [[package]] name = "cxxbridge-macro" -version = "1.0.121" +version = "1.0.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad08a837629ad949b73d032c637653d069e909cffe4ee7870b02301939ce39cc" +checksum = "4b2c1c1776b986979be68bb2285da855f8d8a35851a769fca8740df7c3d07877" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", +] + +[[package]] +name = "dashmap" +version = "5.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978747c1d849a7d2ee5e8adc0159961c48fb7e5db2f06af6723b80123bb53856" +dependencies = [ + "cfg-if", + "hashbrown 0.14.5", + "lock_api", + "once_cell", + "parking_lot_core 0.9.10", ] [[package]] @@ -3755,17 +3791,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "derive-syn-parse" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79116f119dd1dba1abf1f3405f03b9b0e79a27a3883864bfebded8a3dc768cd" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "derive-syn-parse" version = "0.2.0" @@ -3774,20 +3799,20 @@ checksum = "d65d7ce8132b7c0e54497a4d9a55a1c2a0912a0d786cf894472ba818fba45762" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] @@ -3823,7 +3848,7 @@ dependencies = [ "block-buffer 0.10.4", "const-oid", "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -3870,13 +3895,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -3895,14 +3920,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a081e51fb188742f5a7a1164ad752121abcb22874b21e2c3b0dd040c515fdad" dependencies = [ "common-path", - "derive-syn-parse 0.2.0", + "derive-syn-parse", "once_cell", "proc-macro2", "quote", "regex", - "syn 2.0.60", + "syn 2.0.71", "termcolor", - "toml 0.8.12", + "toml 0.8.14", "walkdir", ] @@ -3961,10 +3986,20 @@ dependencies = [ "digest 0.10.7", "elliptic-curve", "rfc6979", - "signature", + "serdect", + "signature 2.2.0", "spki", ] +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature 1.6.4", +] + [[package]] name = "ed25519" version = "2.2.3" @@ -3972,35 +4007,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ "pkcs8", - "signature", + "signature 2.2.0", ] [[package]] name = "ed25519-dalek" -version = "2.1.1" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" dependencies = [ - "curve25519-dalek 4.1.2", - "ed25519", - "rand_core 0.6.4", + "curve25519-dalek 3.2.0", + "ed25519 1.5.3", + "rand 0.7.3", "serde", - "sha2 0.10.8", - "subtle 2.5.0", + "sha2 0.9.9", "zeroize", ] [[package]] -name = "ed25519-zebra" -version = "3.1.0" +name = "ed25519-dalek" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", - "hex", + "curve25519-dalek 4.1.3", + "ed25519 2.2.3", "rand_core 0.6.4", - "sha2 0.9.9", + "serde", + "sha2 0.10.8", + "subtle 2.6.1", "zeroize", ] @@ -4010,9 +4045,9 @@ version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" dependencies = [ - "curve25519-dalek 4.1.2", - "ed25519", - "hashbrown 0.14.3", + "curve25519-dalek 4.1.3", + "ed25519 2.2.3", + "hashbrown 0.14.5", "hex", "rand_core 0.6.4", "sha2 0.10.8", @@ -4021,9 +4056,9 @@ dependencies = [ [[package]] name = "either" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "elliptic-curve" @@ -4040,7 +4075,8 @@ dependencies = [ "pkcs8", "rand_core 0.6.4", "sec1", - "subtle 2.5.0", + "serdect", + "subtle 2.6.1", "zeroize", ] @@ -4062,24 +4098,36 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", ] [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -4090,7 +4138,7 @@ checksum = "6fd000fd6988e73bbe993ea3db9b1aa64906ab88766d654973924340c8cddb42" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -4120,9 +4168,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4204,43 +4252,22 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite 0.2.14", -] - -[[package]] -name = "event-listener" -version = "5.3.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d9944b8ca13534cdfb2800775f8dd4902ff3fc75a50101466decadfdf322a24" +checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" dependencies = [ "concurrent-queue", "parking", "pin-project-lite 0.2.14", ] -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite 0.2.14", -] - [[package]] name = "event-listener-strategy" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f214dc438f977e6d4e3500aaa277f5ad94ca83fbbd9b1a15713ce2344ccc5a1" dependencies = [ - "event-listener 5.3.0", + "event-listener 5.3.1", "pin-project-lite 0.2.14", ] @@ -4255,35 +4282,30 @@ dependencies = [ [[package]] name = "expander" -version = "0.0.4" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a718c0675c555c5f976fff4ea9e2c150fa06cefa201cadef87cfbf9324075881" +checksum = "e2c470c71d91ecbd179935b24170459e926382eaaa86b590b78814e180d8a8e2" dependencies = [ - "blake3", + "blake2 0.10.6", + "file-guard", "fs-err", + "prettyplease 0.2.20", "proc-macro2", "quote", + "syn 2.0.71", ] [[package]] -name = "expander" -version = "2.1.0" +name = "fallible-iterator" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e83c02035136f1592a47964ea60c05a50e4ed8b5892cfac197063850898d4d" -dependencies = [ - "blake2 0.10.6", - "fs-err", - "prettier-please", - "proc-macro2", - "quote", - "syn 2.0.60", -] +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" [[package]] name = "fallible-iterator" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" [[package]] name = "fastrand" @@ -4302,9 +4324,9 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "fatality" -version = "0.0.6" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad875162843b0d046276327afe0136e9ed3a23d5a754210fb6f1f33610d39ab" +checksum = "ec6f82451ff7f0568c6181287189126d492b5654e30a788add08027b6363d019" dependencies = [ "fatality-proc-macro", "thiserror", @@ -4312,17 +4334,16 @@ dependencies = [ [[package]] name = "fatality-proc-macro" -version = "0.0.6" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5aa1e3ae159e592ad222dc90c5acbad632b527779ba88486abe92782ab268bd" +checksum = "eb42427514b063d97ce21d5199f36c0c307d981434a6be32582bc79fe5bd2303" dependencies = [ - "expander 0.0.4", - "indexmap 1.9.3", - "proc-macro-crate 1.3.1", + "expander", + "indexmap 2.2.6", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 1.0.109", - "thiserror", + "syn 2.0.71", ] [[package]] @@ -4342,14 +4363,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] name = "fiat-crypto" -version = "0.2.8" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "file-guard" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38793c55593b33412e3ae40c2c9781ffaa6f438f6f8c10f24e71846fbd7ae01e" +checksum = "21ef72acf95ec3d7dbf61275be556299490a245f017cf084bd23b4f68cf9407c" +dependencies = [ + "libc", + "winapi", +] [[package]] name = "file-per-thread-logger" @@ -4385,7 +4416,7 @@ dependencies = [ "log", "num-traits", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "scale-info", ] @@ -4396,7 +4427,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] @@ -4409,9 +4440,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4556222738635b7a3417ae6130d8f52201e45a0c4d1a907f0826383adb5f85e7" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "libz-sys", @@ -4433,11 +4464,26 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "fork-tree" -version = "12.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e93d3f0315c2eccf23453609e0ab92fe7c6ad1ca8129bcaf80b9a08c8d7fc52b" +checksum = "ad4cc2314d3be8b49c555f6a7e550f5559e73ffd6ef9690ffbd9a706774452e0" dependencies = [ "parity-scale-codec", ] @@ -4451,6 +4497,16 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "forwarded-header-value" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8835f84f38484cc86f110a805655697908257fb9a7af005234060891557198e9" +dependencies = [ + "nonempty", + "thiserror", +] + [[package]] name = "fragile" version = "2.0.0" @@ -4459,9 +4515,9 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4090659c6aaa3c4d5b6c6ec909b4b0a25dec10ad92aad5f729efa8d5bd4d806a" +checksum = "ad6366773db71a556710652c0560300dc938252e009d4d2c1eb9d6e5b38e0860" dependencies = [ "frame-support", "frame-support-procedural", @@ -4485,12 +4541,12 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" -version = "33.0.0" +version = "39.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efe02c96362e3c7308cdea7545859f767194a1f3f00928f0e1357f4b8a0b3b2c" +checksum = "9bff993810ef24391487012e6b8e42ee0909e51e95954046849f0eb56236e4d5" dependencies = [ "Inflector", - "array-bytes 6.2.2", + "array-bytes", "chrono", "clap", "comfy-table", @@ -4499,14 +4555,15 @@ dependencies = [ "frame-system", "gethostname", "handlebars", - "itertools 0.10.5", + "itertools 0.11.0", "lazy_static", "linked-hash-map", "log", "parity-scale-codec", - "rand", + "rand 0.8.5", "rand_pcg", "sc-block-builder", + "sc-chain-spec", "sc-cli", "sc-client-api", "sc-client-db", @@ -4520,6 +4577,7 @@ dependencies = [ "sp-core", "sp-database", "sp-externalities", + "sp-genesis-builder", "sp-inherents", "sp-io", "sp-keystore", @@ -4534,21 +4592,21 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5c3bff645e46577c69c272733c53fa3a77d1ee6e40dfb66157bc94b0740b8fc" +checksum = "1388eb632484a1208a5b51d7d822a7df995f37bb10878b2a88f4ec89cbe5e6b2" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "frame-election-provider-support" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87da19ee99e6473cd057ead84337d20011fe5e299c6750e88e43b8b7963b8852" +checksum = "b3c089c16a066dfb5042cadc27c01738d93258e8f5f7ef7a83b4c8661616d1ac" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4564,10 +4622,11 @@ dependencies = [ [[package]] name = "frame-executive" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09bff9574ee2dcc349f646e1d2faadf76afd688c2ea1bbac5e4a0e19a0c19c59" +checksum = "9287dd6070c0ca90b42c9b4fc44f2bc91adf08b73c11c74484c416f0cc9abe04" dependencies = [ + "aquamarine", "frame-support", "frame-system", "frame-try-runtime", @@ -4595,11 +4654,11 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" -version = "0.1.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb1eec9eb46d3e016c95b2fa875118c04609f2150013c56a894cae00581e265" +checksum = "ba1fa15dc90efe948898c06a3be111628230db100ffa2907e662062e9c9d1abd" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "docify", "frame-support", "frame-system", @@ -4609,37 +4668,14 @@ dependencies = [ "sp-runtime", ] -[[package]] -name = "frame-remote-externalities" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360bfdb6821372164a65933d9a6d5998f38c722360b59b69d2bf78a87ef58b2a" -dependencies = [ - "futures 0.3.30", - "indicatif", - "jsonrpsee", - "log", - "parity-scale-codec", - "serde", - "sp-core", - "sp-crypto-hashing", - "sp-io", - "sp-runtime", - "sp-state-machine", - "spinners", - "substrate-rpc-client", - "tokio", - "tokio-retry", -] - [[package]] name = "frame-support" -version = "29.0.2" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e52c84b611d2049d9253f83a62ab0f093e4be5c42a7ef42ea5bb16d6611e32" +checksum = "ab6d7780b7f337c8a072f0a7480cbc7b580f9bf871c434fae65e8935053ee5ef" dependencies = [ "aquamarine", - "array-bytes 6.2.2", + "array-bytes", "bitflags 1.3.2", "docify", "environmental", @@ -4676,53 +4712,53 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "24.0.0" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bf1d648c4007d421b9677b3c893256913498fff159dc2d85022cdd9cc432f3c" +checksum = "fd94af68373e179c32c360b3c280497a9cf0f45a4f47f0ee6539a6c6c9cf2343" dependencies = [ "Inflector", "cfg-expr", - "derive-syn-parse 0.1.5", - "expander 2.1.0", + "derive-syn-parse", + "expander", "frame-support-procedural-tools", - "itertools 0.10.5", + "itertools 0.11.0", "macro_magic", "proc-macro-warning", "proc-macro2", "quote", "sp-crypto-hashing", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "frame-support-procedural-tools" -version = "10.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3363df38464c47a73eb521a4f648bfcc7537a82d70347ef8af3f73b6d019e910" +checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "frame-support-procedural-tools-derive" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68672b9ec6fe72d259d3879dc212c5e42e977588cdac830c76f54d9f492aeb58" +checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "frame-system" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc20a793c3cec0b11165c1075fe11a255b2491f3eef8230bb3073cb296e7383" +checksum = "6baa2218d90c5a23db08dd0188cfe6aa0af7d36fb9b0fc2f73bc5c4abe4dd812" dependencies = [ "cfg-if", "docify", @@ -4741,9 +4777,9 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac47ee48fee3a0b49c9ab9ee68997dee3733776a355f780cf2858449cf495d69" +checksum = "be45f57aefef5fa97fce1482dc1ede197620d8b0bb588b3cec8d84f32557cf8b" dependencies = [ "frame-benchmarking", "frame-support", @@ -4757,9 +4793,9 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c1b20433c3c76b56ce905ed971631ec8c34fa64cf6c20e590afe46455fc0cc8" +checksum = "c9e9e2b7b85e451e367f4fb85ff3295bd039e17f64de1906154d3976e2638ee8" dependencies = [ "parity-scale-codec", "sp-api", @@ -4767,9 +4803,9 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eab87d07bc2f9a2160b818d1b7506c303b3b28b6a8a5f01dc5e2641390450b5" +checksum = "8f2b9c95e0b38d713a46bb71bc395d4ed067c7a0f5370e13282c07c91fd1ec0d" dependencies = [ "frame-support", "parity-scale-codec", @@ -4904,7 +4940,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -5007,9 +5043,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -5022,7 +5058,7 @@ version = "0.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ea1015b5a70616b688dc230cfe50c8af89d972cb132d5a622814d29773b10b9" dependencies = [ - "rand", + "rand 0.8.5", "rand_core 0.6.4", ] @@ -5042,7 +5078,7 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" dependencies = [ - "fallible-iterator", + "fallible-iterator 0.2.0", "indexmap 1.9.3", "stable_deref_trait", ] @@ -5052,6 +5088,16 @@ name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +dependencies = [ + "fallible-iterator 0.3.0", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -5059,6 +5105,26 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +[[package]] +name = "governor" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68a7f542ee6b35af73b06abc0dad1c1bae89964e4e253bc4b587b91c9637867b" +dependencies = [ + "cfg-if", + "dashmap", + "futures 0.3.30", + "futures-timer", + "no-std-compat", + "nonzero_ext", + "parking_lot 0.12.3", + "portable-atomic", + "quanta", + "rand 0.8.5", + "smallvec", + "spinning_top", +] + [[package]] name = "group" version = "0.13.0" @@ -5067,7 +5133,7 @@ checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", "rand_core 0.6.4", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -5091,9 +5157,9 @@ dependencies = [ [[package]] name = "handlebars" -version = "4.5.0" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +checksum = "d08485b96a0e6393e9e4d1b8d48cf74ad6c063cd905eb33f42c1ce3f0377539b" dependencies = [ "log", "pest", @@ -5129,9 +5195,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.8", -] [[package]] name = "hashbrown" @@ -5139,16 +5202,16 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", "serde", ] @@ -5159,7 +5222,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" dependencies = [ - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -5180,12 +5243,24 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hex-conservative" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212ab92002354b4819390025006c897e8140934349e8635c9b077f47b4dcbd20" + [[package]] name = "hex-literal" version = "0.3.4" @@ -5217,16 +5292,6 @@ dependencies = [ "digest 0.9.0", ] -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac 0.11.0", - "digest 0.9.0", -] - [[package]] name = "hmac" version = "0.12.1" @@ -5297,9 +5362,9 @@ checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -5315,9 +5380,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.28" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -5330,7 +5395,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite 0.2.14", - "socket2 0.5.6", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -5348,9 +5413,9 @@ dependencies = [ "hyper", "log", "rustls 0.21.12", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -5387,6 +5452,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "idna" version = "0.5.0" @@ -5413,7 +5488,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6b0422c86d7ce0e97169cc42e04ae643caf278874a7a3c87b8150a220dc7e1e" dependencies = [ - "async-io 2.3.2", + "async-io 2.3.3", "core-foundation", "fnv", "futures 0.3.30", @@ -5466,18 +5541,18 @@ dependencies = [ [[package]] name = "include_dir" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18762faeff7122e89e0857b02f7ce6fcc0d101d5e9ad2ad7846cc01d61b7f19e" +checksum = "923d117408f1e49d914f1a379a309cffe4f18c05cf4e3d12e613a15fc81bd0dd" dependencies = [ "include_dir_macros", ] [[package]] name = "include_dir_macros" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b139284b5cf57ecfa712bcc66950bb635b31aff41c188e8a4cfc758eca374a3f" +checksum = "7cab85a7ed0bd5f0e76d93846e0147172bed2e2d3f859bcc33a8d9699cad1a75" dependencies = [ "proc-macro2", "quote", @@ -5501,7 +5576,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", ] [[package]] @@ -5510,19 +5585,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" -[[package]] -name = "indicatif" -version = "0.17.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763a5a8f45087d6bcea4222e7b72c291a054edf80e4ef6efd2a4979878c7bea3" -dependencies = [ - "console", - "instant", - "number_prefix", - "portable-atomic", - "unicode-width", -] - [[package]] name = "inout" version = "0.1.3" @@ -5534,9 +5596,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -5562,7 +5624,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -5579,7 +5641,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.6", + "socket2 0.5.7", "widestring", "windows-sys 0.48.0", "winreg", @@ -5597,7 +5659,7 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.52.0", ] @@ -5611,6 +5673,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -5629,6 +5697,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.11" @@ -5655,12 +5732,11 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "affdc52f7596ccb2d7645231fc6163bb314630c989b64998f3699a28b4d5d4dc" +checksum = "cfdb12a2381ea5b2e68c3469ec604a007b367778cdb14d09612c8069ebd616ad" dependencies = [ "jsonrpsee-core", - "jsonrpsee-http-client", "jsonrpsee-proc-macros", "jsonrpsee-server", "jsonrpsee-types", @@ -5671,19 +5747,20 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b005c793122d03217da09af68ba9383363caa950b90d3436106df8cabce935" +checksum = "4978087a58c3ab02efc5b07c5e5e2803024536106fd5506f558db172c889b3aa" dependencies = [ "futures-util", "http", "jsonrpsee-core", "pin-project", - "rustls-native-certs", + "rustls-native-certs 0.7.1", + "rustls-pki-types", "soketto", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.25.0", "tokio-util", "tracing", "url", @@ -5691,73 +5768,54 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2327ba8df2fdbd5e897e2b5ed25ce7f299d345b9736b6828814c3dbd1fd47b" +checksum = "b4b257e1ec385e07b0255dde0b933f948b5c8b8c28d42afda9587c3a967b896d" dependencies = [ "anyhow", - "async-lock 2.8.0", "async-trait", "beef", "futures-timer", "futures-util", "hyper", "jsonrpsee-types", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "pin-project", + "rand 0.8.5", "rustc-hash", "serde", "serde_json", - "soketto", - "thiserror", - "tokio", - "tracing", -] - -[[package]] -name = "jsonrpsee-http-client" -version = "0.20.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f80c17f62c7653ce767e3d7288b793dfec920f97067ceb189ebdd3570f2bc20" -dependencies = [ - "async-trait", - "hyper", - "hyper-rustls", - "jsonrpsee-core", - "jsonrpsee-types", - "serde", - "serde_json", "thiserror", "tokio", - "tower", + "tokio-stream", "tracing", - "url", ] [[package]] name = "jsonrpsee-proc-macros" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29110019693a4fa2dbda04876499d098fa16d70eba06b1e6e2b3f1b251419515" +checksum = "7d0bb047e79a143b32ea03974a6bf59b62c2a4c5f5d42a381c907a8bbb3f75c0" dependencies = [ "heck 0.4.1", - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] name = "jsonrpsee-server" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c39a00449c9ef3f50b84fc00fc4acba20ef8f559f07902244abf4c15c5ab9c" +checksum = "12d8b6a9674422a8572e0b0abb12feeb3f2aeda86528c80d0350c2bd0923ab41" dependencies = [ "futures-util", "http", "hyper", "jsonrpsee-core", "jsonrpsee-types", + "pin-project", "route-recognizer", "serde", "serde_json", @@ -5772,23 +5830,22 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be0be325642e850ed0bdff426674d2e66b2b7117c9be23a7caef68a2902b7d9" +checksum = "150d6168405890a7a3231a3c74843f58b8959471f6df76078db2619ddee1d07d" dependencies = [ "anyhow", "beef", "serde", "serde_json", "thiserror", - "tracing", ] [[package]] name = "jsonrpsee-ws-client" -version = "0.20.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca9cb3933ccae417eb6b08c3448eb1cb46e39834e5b503e395e5e5bd08546c0" +checksum = "58b9db2dfd5bb1194b0ce921504df9ceae210a345bc2f6c5a61432089bbab070" dependencies = [ "http", "jsonrpsee-client-transport", @@ -5807,6 +5864,7 @@ dependencies = [ "ecdsa", "elliptic-curve", "once_cell", + "serdect", "sha2 0.10.8", ] @@ -5841,7 +5899,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7a85fe66f9ff9cd74e169fdd2c94c6e1e74c412c99a73b4df3200b5d3760b2" dependencies = [ "kvdb", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -5852,7 +5910,7 @@ checksum = "b644c70b92285f66bfc2032922a79000ea30af7bc2ab31902992a5dcb9b434f6" dependencies = [ "kvdb", "num_cpus", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "regex", "rocksdb", "smallvec", @@ -5871,9 +5929,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -5977,18 +6035,18 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -6006,7 +6064,7 @@ dependencies = [ "bytes", "futures 0.3.30", "futures-timer", - "getrandom 0.2.14", + "getrandom 0.2.15", "instant", "libp2p-allow-block-list", "libp2p-connection-limits", @@ -6071,10 +6129,10 @@ dependencies = [ "multihash 0.17.0", "multistream-select", "once_cell", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", "quick-protobuf", - "rand", + "rand 0.8.5", "rw-stream-sink", "smallvec", "thiserror", @@ -6091,9 +6149,9 @@ dependencies = [ "futures 0.3.30", "libp2p-core", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "smallvec", - "trust-dns-resolver", + "trust-dns-resolver 0.22.0", ] [[package]] @@ -6125,12 +6183,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "276bb57e7af15d8f100d3c11cbdd32c6752b7eef4ba7a18ecf464972c07abcce" dependencies = [ "bs58 0.4.0", - "ed25519-dalek", + "ed25519-dalek 2.1.1", "log", "multiaddr", "multihash 0.17.0", "quick-protobuf", - "rand", + "rand 0.8.5", "sha2 0.10.8", "thiserror", "zeroize", @@ -6155,7 +6213,7 @@ dependencies = [ "libp2p-swarm", "log", "quick-protobuf", - "rand", + "rand 0.8.5", "sha2 0.10.8", "smallvec", "thiserror", @@ -6177,11 +6235,11 @@ dependencies = [ "libp2p-identity", "libp2p-swarm", "log", - "rand", + "rand 0.8.5", "smallvec", "socket2 0.4.10", "tokio", - "trust-dns-proto", + "trust-dns-proto 0.22.0", "void", ] @@ -6213,7 +6271,7 @@ dependencies = [ "log", "once_cell", "quick-protobuf", - "rand", + "rand 0.8.5", "sha2 0.10.8", "snow", "static_assertions", @@ -6235,7 +6293,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log", - "rand", + "rand 0.8.5", "void", ] @@ -6253,9 +6311,9 @@ dependencies = [ "libp2p-identity", "libp2p-tls", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "quinn-proto", - "rand", + "rand 0.8.5", "rustls 0.20.9", "thiserror", "tokio", @@ -6273,7 +6331,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "libp2p-swarm", - "rand", + "rand 0.8.5", "smallvec", ] @@ -6292,7 +6350,7 @@ dependencies = [ "libp2p-identity", "libp2p-swarm-derive", "log", - "rand", + "rand 0.8.5", "smallvec", "tokio", "void", @@ -6340,7 +6398,7 @@ dependencies = [ "rustls 0.20.9", "thiserror", "webpki", - "x509-parser", + "x509-parser 0.14.0", "yasna", ] @@ -6369,7 +6427,7 @@ dependencies = [ "futures-rustls", "libp2p-core", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "quicksink", "rw-stream-sink", "soketto", @@ -6396,7 +6454,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -6428,7 +6486,7 @@ dependencies = [ "libsecp256k1-core", "libsecp256k1-gen-ecmult", "libsecp256k1-gen-genmult", - "rand", + "rand 0.8.5", "serde", "sha2 0.9.9", "typenum", @@ -6442,7 +6500,7 @@ checksum = "5be9b9bb642d8522a44d533eab56c16c738301965504753b03ad1de3425d5451" dependencies = [ "crunchy", "digest 0.9.0", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -6465,9 +6523,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.16" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e143b5e666b2695d28f6bca6497720813f699c9602dd7f5cac91008b8ada7f9" +checksum = "c15da26e5af7e25c90b37a2d75cdbf940cf4a55316de9d84c679c9b8bfabf82e" dependencies = [ "cc", "pkg-config", @@ -6521,9 +6579,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lioness" @@ -6537,6 +6595,61 @@ dependencies = [ "keystream", ] +[[package]] +name = "litep2p" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f02542ae3a94b4c4ffa37dc56388c923e286afa3bf65452e3984b50b2a2f316" +dependencies = [ + "async-trait", + "bs58 0.4.0", + "bytes", + "cid 0.10.1", + "ed25519-dalek 1.0.1", + "futures 0.3.30", + "futures-timer", + "hex-literal 0.4.1", + "indexmap 2.2.6", + "libc", + "mockall 0.12.1", + "multiaddr", + "multihash 0.17.0", + "network-interface", + "nohash-hasher", + "parking_lot 0.12.3", + "pin-project", + "prost 0.11.9", + "prost-build 0.11.9", + "quinn", + "rand 0.8.5", + "rcgen", + "ring 0.16.20", + "rustls 0.20.9", + "serde", + "sha2 0.10.8", + "simple-dns", + "smallvec", + "snow", + "socket2 0.5.7", + "static_assertions", + "str0m", + "thiserror", + "tokio", + "tokio-stream", + "tokio-tungstenite", + "tokio-util", + "tracing", + "trust-dns-resolver 0.23.2", + "uint", + "unsigned-varint", + "url", + "webpki", + "x25519-dalek 2.0.1", + "x509-parser 0.15.1", + "yasna", + "zeroize", +] + [[package]] name = "lock_api" version = "0.4.12" @@ -6579,9 +6692,9 @@ dependencies = [ [[package]] name = "lz4" -version = "1.24.0" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e9e2dd86df36ce760a60f6ff6ad526f7ba1f14ba0356f8254fb6905e6494df1" +checksum = "d6eab492fe7f8651add23237ea56dbf11b3c4ff762ab83d40a47f11433421f91" dependencies = [ "libc", "lz4-sys", @@ -6589,9 +6702,9 @@ dependencies = [ [[package]] name = "lz4-sys" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d27b317e207b10f69f5e75494119e391a96f48861ae870d1da6edac98ca900" +checksum = "e9764018d143cc854c9f17f0b907de70f14393b1f502da6375dce70f00514eb3" dependencies = [ "cc", "libc", @@ -6608,58 +6721,52 @@ dependencies = [ [[package]] name = "macro_magic" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03844fc635e92f3a0067e25fa4bf3e3dbf3f2927bf3aa01bb7bc8f1c428949d" +checksum = "cc33f9f0351468d26fbc53d9ce00a096c8522ecb42f19b50f34f2c422f76d21d" dependencies = [ "macro_magic_core", "macro_magic_macros", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "macro_magic_core" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468155613a44cfd825f1fb0ffa532b018253920d404e6fca1e8d43155198a46d" +checksum = "1687dc887e42f352865a393acae7cf79d98fab6351cde1f58e9e057da89bf150" dependencies = [ "const-random", - "derive-syn-parse 0.1.5", + "derive-syn-parse", "macro_magic_core_macros", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "macro_magic_core_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea73aa640dc01d62a590d48c0c3521ed739d53b27f919b25c3551e233481654" +checksum = "b02abfe41815b5bd98dbd4260173db2c116dda171dc0fe7838cb206333b83308" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "macro_magic_macros" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef9d79ae96aaba821963320eb2b6e34d17df1e5a83d8a1985c29cc5be59577b3" +checksum = "73ea28ee64b88876bf45277ed9a5817c1817df061a74f2b988971a12570e5869" dependencies = [ "macro_magic_core", "quote", - "syn 2.0.60", + "syn 2.0.71", ] -[[package]] -name = "maplit" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" - [[package]] name = "match_cfg" version = "0.1.0" @@ -6675,6 +6782,15 @@ dependencies = [ "regex-automata 0.1.10", ] +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "matches" version = "0.1.10" @@ -6693,9 +6809,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memfd" @@ -6745,7 +6861,7 @@ dependencies = [ [[package]] name = "merkle-distributor" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" dependencies = [ "frame-support", "frame-system", @@ -6767,7 +6883,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f313fcff1d2a4bcaa2deeaa00bf7530d77d5f7bd0467a117dde2e29a75a7a17a" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "blake3", "frame-metadata", "parity-scale-codec", @@ -6794,7 +6910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69672161530e8aeca1d1400fbf3f1a1747ff60ea604265a4e906c2442df20532" dependencies = [ "futures 0.3.30", - "rand", + "rand 0.8.5", "thrift", ] @@ -6806,9 +6922,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -6835,25 +6951,25 @@ dependencies = [ "bitflags 1.3.2", "blake2 0.10.6", "c2-chacha", - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.3", "either", "hashlink", "lioness", "log", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "rand_chacha 0.3.1", "rand_distr", - "subtle 2.5.0", + "subtle 2.6.1", "thiserror", "zeroize", ] [[package]] name = "mmr-gadget" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f62cddc29c17965ab16a051a745520d41c28d8b4c2b6188aaf661db056d67c9" +checksum = "0110fde66cc10e924e66aae0f85ac8a23e7eef2f2deea3c46b04c483ddf8e4e0" dependencies = [ "futures 0.3.30", "log", @@ -6871,9 +6987,9 @@ dependencies = [ [[package]] name = "mmr-rpc" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2634b45039e064c343a0a77ed45e03ca027c84e1b250b2f3988af7cde9b7e79e" +checksum = "a2ea4f2bdf0784e901b9c7999c0e2c903bb2a6e10ca9f63214a1a6de8bdc8e21" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -6895,13 +7011,28 @@ dependencies = [ "downcast", "fragile", "lazy_static", - "mockall_derive", - "predicates", + "mockall_derive 0.11.4", + "predicates 2.1.5", "predicates-tree", ] [[package]] -name = "mockall_derive" +name = "mockall" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43766c2b5203b10de348ffe19f7e54564b64f3d6018ff7648d1e2d6d3a0f0a48" +dependencies = [ + "cfg-if", + "downcast", + "fragile", + "lazy_static", + "mockall_derive 0.12.1", + "predicates 3.1.0", + "predicates-tree", +] + +[[package]] +name = "mockall_derive" version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22ce75669015c4f47b289fd4d4f56e894e4c96003ffdf3ac51313126f94c6cbb" @@ -6912,6 +7043,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "mockall_derive" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2" +dependencies = [ + "cfg-if", + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "multiaddr" version = "0.17.1" @@ -6953,7 +7096,7 @@ dependencies = [ "blake3", "core2", "digest 0.10.7", - "multihash-derive 0.8.0", + "multihash-derive 0.8.1", "sha2 0.10.8", "sha3", "unsigned-varint", @@ -6965,10 +7108,14 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfd8a792c1694c6da4f68db0a9d707c72bd260994da179e6030a5dcee00bb815" dependencies = [ + "blake2b_simd", + "blake2s_simd", + "blake3", "core2", "digest 0.10.7", - "multihash-derive 0.8.0", + "multihash-derive 0.8.1", "sha2 0.10.8", + "sha3", "unsigned-varint", ] @@ -7004,16 +7151,16 @@ dependencies = [ [[package]] name = "multihash-derive" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc076939022111618a5026d3be019fd8b366e76314538ff9a1b59ffbcbf98bcd" +checksum = "1d6d4752e6230d8ef7adf7bd5d8c4b1f6561c1014c5ba9a37445ccefe18aa1db" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 1.1.3", "proc-macro-error", "proc-macro2", "quote", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -7029,16 +7176,16 @@ dependencies = [ [[package]] name = "multihash-derive-impl" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d38685e08adb338659871ecfc6ee47ba9b22dcc8abcf6975d379cc49145c3040" +checksum = "3958713ce794e12f7c6326fac9aa274c68d74c4881dd37b3e2662b8a2046bb19" dependencies = [ - "proc-macro-crate 1.3.1", + "proc-macro-crate 2.0.0", "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", - "synstructure", + "syn 2.0.71", + "synstructure 0.13.1", ] [[package]] @@ -7047,6 +7194,12 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multimap" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" + [[package]] name = "multistream-select" version = "0.12.1" @@ -7063,9 +7216,9 @@ dependencies = [ [[package]] name = "nalgebra" -version = "0.32.5" +version = "0.32.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea4908d4f23254adda3daa60ffef0f1ac7b8c3e9a864cf3cc154b251908a2ef" +checksum = "7b5c17de023a86f59ed79891b2e5d5a94c705dbe904a5b5c9c952ea6221b03e4" dependencies = [ "approx", "matrixmultiply", @@ -7079,13 +7232,13 @@ dependencies = [ [[package]] name = "nalgebra-macros" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91761aed67d03ad966ef783ae962ef9bbaca728d2dd7ceb7939ec110fffad998" +checksum = "254a5372af8fc138e36684761d3c0cdb758a4410e938babcff1c860ce14ddbfc" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] @@ -7094,7 +7247,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7bddcd3bf5144b6392de80e04c347cd7fab2508f6df16a85fc496ecd5cec39bc" dependencies = [ - "rand", + "rand 0.8.5", ] [[package]] @@ -7169,6 +7322,18 @@ dependencies = [ "tokio", ] +[[package]] +name = "network-interface" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a43439bf756eed340bdf8feba761e2d50c7d47175d87545cd5cbe4a137c4d1" +dependencies = [ + "cc", + "libc", + "thiserror", + "winapi", +] + [[package]] name = "nix" version = "0.24.3" @@ -7182,15 +7347,22 @@ dependencies = [ [[package]] name = "nix" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", + "cfg_aliases", "libc", ] +[[package]] +name = "no-std-compat" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b93853da6d84c2e3c7d730d6473e8817692dd89be387eb01b94d7f108ecb5b8c" + [[package]] name = "no-std-net" version = "0.6.0" @@ -7219,12 +7391,34 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "nonempty" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9e591e719385e6ebaeb5ce5d3887f7d5676fceca6411d1925ccc95745f3d6f7" + +[[package]] +name = "nonzero_ext" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38bf9645c8b145698bb0b18a4637dcacbc421ea49bef2317e4fd8065a387cf21" + [[package]] name = "normalize-line-endings" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be" +[[package]] +name = "nu-ansi-term" +version = "0.46.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -7237,9 +7431,9 @@ dependencies = [ [[package]] name = "num-complex" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c6602fda94a57c990fe0df199a035d83576b496aa29f4e634a8ac6004e68a6" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" dependencies = [ "num-traits", ] @@ -7271,11 +7465,10 @@ dependencies = [ [[package]] name = "num-rational" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" dependencies = [ - "autocfg", "num-bigint", "num-integer", "num-traits", @@ -7297,16 +7490,10 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] -[[package]] -name = "number_prefix" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" - [[package]] name = "object" version = "0.30.4" @@ -7328,6 +7515,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "object" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +dependencies = [ + "memchr", +] + [[package]] name = "oid-registry" version = "0.6.1" @@ -7355,12 +7551,60 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" +[[package]] +name = "openssl" +version = "0.10.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "openssl-probe" version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.3.1+3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +dependencies = [ + "cc", +] + +[[package]] +name = "openssl-sys" +version = "0.9.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +dependencies = [ + "cc", + "libc", + "openssl-src", + "pkg-config", + "vcpkg", +] + [[package]] name = "option-ext" version = "0.2.0" @@ -7369,9 +7613,9 @@ checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" [[package]] name = "orchestra" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2356622ffdfe72362a45a1e5e87bb113b8327e596e39b91f11f0ef4395c8da79" +checksum = "92829eef0328a3d1cd22a02c0e51deb92a5362df3e7d21a4e9bdc38934694e66" dependencies = [ "async-trait", "dyn-clonable", @@ -7386,15 +7630,15 @@ dependencies = [ [[package]] name = "orchestra-proc-macro" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eedb646674596266dc9bb2b5c7eea7c36b32ecc7777eba0d510196972d72c4fd" +checksum = "1344346d5af32c95bbddea91b18a88cc83eac394192d20ef2fc4c40a74332355" dependencies = [ - "expander 2.1.0", + "expander", "indexmap 2.2.6", "itertools 0.11.0", "petgraph", - "proc-macro-crate 1.3.1", + "proc-macro-crate 3.1.0", "proc-macro2", "quote", "syn 1.0.109", @@ -7411,9 +7655,10 @@ dependencies = [ [[package]] name = "orml-oracle" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" dependencies = [ + "frame-benchmarking", "frame-support", "frame-system", "orml-traits", @@ -7429,8 +7674,8 @@ dependencies = [ [[package]] name = "orml-tokens" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" dependencies = [ "frame-support", "frame-system", @@ -7446,8 +7691,8 @@ dependencies = [ [[package]] name = "orml-traits" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -7466,8 +7711,8 @@ dependencies = [ [[package]] name = "orml-unknown-tokens" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" dependencies = [ "frame-support", "frame-system", @@ -7481,8 +7726,8 @@ dependencies = [ [[package]] name = "orml-utilities" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" dependencies = [ "frame-support", "parity-scale-codec", @@ -7496,8 +7741,8 @@ dependencies = [ [[package]] name = "orml-xcm" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" dependencies = [ "frame-support", "frame-system", @@ -7510,8 +7755,8 @@ dependencies = [ [[package]] name = "orml-xcm-support" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" dependencies = [ "frame-support", "orml-traits", @@ -7524,8 +7769,8 @@ dependencies = [ [[package]] name = "orml-xtokens" -version = "0.8.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.7.0#fe62103da8f1dcce5c188f528571d7f629abf4d0" +version = "0.13.0" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" dependencies = [ "frame-support", "frame-system", @@ -7543,15 +7788,22 @@ dependencies = [ "staging-xcm-executor", ] +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "pallet-asset-conversion" -version = "11.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4079f12db3cf98daa717337ab5b7e5ef15aa3bec3b497f501dc715d129b500da" +checksum = "0e9f1c4496f1c366a3ee01b38ba968589db41f5d44c41331111ff5a07964dbde" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", "sp-api", @@ -7564,9 +7816,9 @@ dependencies = [ [[package]] name = "pallet-asset-rate" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571ce57fd846911041749832b46a8c2b01f0b79ffebcd7585e3973865607036d" +checksum = "e83f523d209396ba42743008b64fe021eb6411a8d5ac868978636f0341feacc4" dependencies = [ "frame-benchmarking", "frame-support", @@ -7580,9 +7832,9 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed783679921ad8b96807d683d320c314e305753b230d5c04dc713bab7aca64c" +checksum = "7686ab6ba85afc432794a9dbc3e7399cb1a3b1bcfdd487ce0eb2aa81c11c2497" dependencies = [ "frame-benchmarking", "frame-support", @@ -7599,9 +7851,9 @@ dependencies = [ [[package]] name = "pallet-assets" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46728a98a910af13f6a77033dd053456650773bb7adc71e0ba845bff7e31b33e" +checksum = "5a58bb6d37a23df83b861e148129dc0130a4b80291f2c9dda3491989ec4c3662" dependencies = [ "frame-benchmarking", "frame-support", @@ -7616,9 +7868,9 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a611bef3c8cf281e41a43f32a4153260bdc8b7b61b901e65c7a4442529224e11" +checksum = "638e3cbb539540e45503f5ae756b6bbb4e6085269d025afa273e684782f514ac" dependencies = [ "frame-support", "frame-system", @@ -7634,9 +7886,9 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" -version = "29.0.1" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd9a381c613e6538638391fb51f353fd13b16f849d0d1ac66a388326bd456f1" +checksum = "3a5fafb21222ab509f0d9d4bda52730eb342574a0733321e1105e14d5454d6d5" dependencies = [ "frame-support", "frame-system", @@ -7651,9 +7903,9 @@ dependencies = [ [[package]] name = "pallet-authorship" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d83773e731a1760f99684b09961ed7b92acafe335f36f08ebb8313d3b9c72e2" +checksum = "b134d987dfc6f2ddc3b4470672318fd59e740868485a25ec15ba909c42e6a622" dependencies = [ "frame-support", "frame-system", @@ -7666,9 +7918,9 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3f2020c52667a650d64e84a4bbb63388e25bc1c9bc872a8243d03bfcb285049" +checksum = "84fa5a4406cd9f43babb90ce6e8f1598d36695c86c8e35094ec4cbf3224086fd" dependencies = [ "frame-benchmarking", "frame-support", @@ -7691,9 +7943,9 @@ dependencies = [ [[package]] name = "pallet-bags-list" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd27bfa4bfa5751652842b81241c7eff3e68f2806d9dacc17b03d2cb20a39756" +checksum = "381526d7d765b4c895efa9da7c7f7b1965f251de6fe30757a63f535a021f2b69" dependencies = [ "aquamarine", "docify", @@ -7714,9 +7966,9 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "29.0.2" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a54b5d0c7c4c3731883d6b1ac18aff44db20c3d0a3470c8861001a17afdc85" +checksum = "8dfe056082a1d857b0731572d7f9a96d98356b8610b258814cf75a55cd43c435" dependencies = [ "docify", "frame-benchmarking", @@ -7731,9 +7983,9 @@ dependencies = [ [[package]] name = "pallet-beefy" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bedd80e9d8b196f31ea134efd271fdc1b8380ca3aa2d8af6ea8b5a0dc4fa460" +checksum = "6005abf441b2c6fc21505f0d3e00a66e40759ddff0311834f3f8ae2c5874b0e5" dependencies = [ "frame-support", "frame-system", @@ -7752,11 +8004,11 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d334f24d3c0c016d16aa87d069485847d622e8ebebace18ec5cf56609ca3a67" +checksum = "effb0467f4d9b43be918a6e0ad419c539cd55dceef4c70000cb373701dc3d029" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "binary-merkle-tree", "frame-support", "frame-system", @@ -7778,9 +8030,9 @@ dependencies = [ [[package]] name = "pallet-bounties" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4765879e96676c13cdbed746d66fd59dcde1e9e65fda1f064fa2fffa3bc5d597" +checksum = "84e118557f0d4e863a243f2c91ffd4fce624c5afc42b6bd0e04e6f7cc767afd7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7797,16 +8049,18 @@ dependencies = [ [[package]] name = "pallet-broker" -version = "0.7.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3626d7e8e49b153b84c74594e1fb4b6d64720b5a9588297d3ba3c049c3b3b9e3" +checksum = "4f369dabb59f4ec26bedb86f294f71b257e4d2e998a53693e45e711bc573627d" dependencies = [ "bitvec", "frame-benchmarking", "frame-support", "frame-system", + "log", "parity-scale-codec", "scale-info", + "sp-api", "sp-arithmetic", "sp-core", "sp-runtime", @@ -7815,9 +8069,9 @@ dependencies = [ [[package]] name = "pallet-child-bounties" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00fd06f2d719f5bb16ab3e836c6b053bbd92631ba694f8c2bf810013b2548167" +checksum = "b2eefafbc018dc5a69cec5b1a9bbbc02fd3191464825e0bd5f899d407dfd03b9" dependencies = [ "frame-benchmarking", "frame-support", @@ -7835,9 +8089,9 @@ dependencies = [ [[package]] name = "pallet-collator-selection" -version = "10.0.2" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49d1157d9a4b7966040158a7b4f1fb29f0cefa8deb6eb9b3452df7ce4161a31c" +checksum = "4b78dc5ba93d88d019eecb4d77f1ec95d8c288d9e9c4e039ab8a2dea039deea4" dependencies = [ "frame-benchmarking", "frame-support", @@ -7847,7 +8101,7 @@ dependencies = [ "pallet-balances", "pallet-session", "parity-scale-codec", - "rand", + "rand 0.8.5", "scale-info", "sp-runtime", "sp-staking", @@ -7856,9 +8110,9 @@ dependencies = [ [[package]] name = "pallet-collective" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c362a0b8f30895c15ecc7d8c24b0d94bb586c4b9bbd37ac8053b4629d9cc80b" +checksum = "64984961a8667e8a16d2445fc98ac3229f9d01def0c1ae1e6f9ce859ec0fedbb" dependencies = [ "frame-benchmarking", "frame-support", @@ -7874,9 +8128,9 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aee3a8b6fcde893f862993f9d45eb0fcd492dde0967fd56ef78d79fc7b53dc0" +checksum = "242927ab508e5f1cb63aa851b7f5662f6886adb688c57458e05449c8ad0376dd" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7890,11 +8144,26 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-delegated-staking" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72cfda2549b70198f2cdee30f8d72cae469a692f83b3072015062bc2dd6f473b" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-runtime", + "sp-staking", + "sp-std", +] + [[package]] name = "pallet-democracy" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa781d632063087bcd3ff46eb1a668f15647ab116f1c8a7c573b7168f62d72c3" +checksum = "517babb26eb2d61c21b13730fd8f48d5024233278581cc342e017f3436260aff" dependencies = [ "frame-benchmarking", "frame-support", @@ -7911,9 +8180,9 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b54d1d3fe9ae61a144d581147e699b7c3009169de0019a0f87cca0bed82681e7" +checksum = "f9cae34d714e3410bcdd932ce0dc927997125e1eaa083dacdeb700439f22b67b" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7922,7 +8191,7 @@ dependencies = [ "log", "pallet-election-provider-support-benchmarking", "parity-scale-codec", - "rand", + "rand 0.8.5", "scale-info", "sp-arithmetic", "sp-core", @@ -7930,14 +8199,14 @@ dependencies = [ "sp-npos-elections", "sp-runtime", "sp-std", - "strum 0.24.1", + "strum 0.26.3", ] [[package]] name = "pallet-election-provider-support-benchmarking" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46ec87816a1e32a1ab6deececa99e21e6684b111efe87b11b8298328dbbefd01" +checksum = "a5153f459dd839fceb81e1d1df9413cc55f83b55fa110485fdb05f442015fb57" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7950,9 +8219,9 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10cb0158cc7461fda5db04c5791d0df34635bec37181763aca449bade677d12d" +checksum = "b3aa78c1c9f42026482ce7f3c051e89ba26a7a9b52246af6e58ee2ce51eb29e3" dependencies = [ "frame-benchmarking", "frame-support", @@ -7970,9 +8239,9 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2222607a0dba10a9d57cab5360a6549b5fda925181c3c7af481246c0964998df" +checksum = "aad27a480c5d4a4705808b8267d38540d5dfeee50d1e7d5a1684d7bbf98a4aa2" dependencies = [ "docify", "frame-benchmarking", @@ -7990,9 +8259,9 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5b20be8592eed7ebca2ee661fc43450088552ebe0bd483d7b101cf5968ab12d" +checksum = "9cc1bf0bd43c8434b46af7de18f8863bfbbf56efcf8d340b238b511a52cfa03c" dependencies = [ "frame-benchmarking", "frame-support", @@ -8014,9 +8283,9 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9e1cae19e30e7dc822c419988b30bb1318d79a8d5da92733822d0e84fe760ca" +checksum = "0ad181bf900fcea894911421496e05c4b2bc2dadea8c7d744af091a525af3a48" dependencies = [ "enumflags2", "frame-benchmarking", @@ -8032,9 +8301,9 @@ dependencies = [ [[package]] name = "pallet-im-online" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598ea5c87351edc953d1f455f32ff456cf2f1daf7bbada1f1e03be8e384852ab" +checksum = "41a23e720204fde0302206016aaf1e095ff808ff1a434ec6507d87a40258bfe1" dependencies = [ "frame-benchmarking", "frame-support", @@ -8053,9 +8322,9 @@ dependencies = [ [[package]] name = "pallet-indices" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e880ebdb429ca76fb400b1b361ed7fce018a5ea2fc2da4764de5156fffdfa73" +checksum = "639b5e46336d35cb888325da0294e54e558d26be45f767ff26ddfca42b709801" dependencies = [ "frame-benchmarking", "frame-support", @@ -8071,9 +8340,9 @@ dependencies = [ [[package]] name = "pallet-membership" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad901cdf3de23daf23ff8b092ab318b13faebfc1aa4d84263f2fdc84feaf3e9b" +checksum = "4d48c79ce463ee54a9c6bf4ea82405499abc24999fa64f4a4e8b6336829d68c7" dependencies = [ "frame-benchmarking", "frame-support", @@ -8089,9 +8358,9 @@ dependencies = [ [[package]] name = "pallet-message-queue" -version = "32.0.0" +version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccb23dee70b184a214d729db550117a0965a69107d466d35181d60a6feede38" +checksum = "8913838f2059495cd9f0c3f9a402346b2f00287b077f344a1b84f850a164d084" dependencies = [ "environmental", "frame-benchmarking", @@ -8110,9 +8379,9 @@ dependencies = [ [[package]] name = "pallet-mmr" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f1f23a70764dad2b4094d8be12ebbb82df210f2e80dd36fa941a5ac191c6cd" +checksum = "e836e2f38af303d9ae4c3b8ca512afe81279f2d6922223a8f571478740d09fb3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8129,9 +8398,9 @@ dependencies = [ [[package]] name = "pallet-multisig" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176f6a5c170185f892a047c0ae189bc52eb390f2c0b94d4261ed0ebc7f82a548" +checksum = "2acdab77a60e7fbf76239ad530d00029fa7f9bc2194155c3356221aa76d19868" dependencies = [ "frame-benchmarking", "frame-support", @@ -8146,9 +8415,9 @@ dependencies = [ [[package]] name = "pallet-nis" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a64a0e80dec2c60d5962dd249061a47dc4356db440f26cdec50b8acaded1d3" +checksum = "6955efc279e63f4463ea29b45c81de013faa243e45a0155b0519df07d5e0a1fb" dependencies = [ "frame-benchmarking", "frame-support", @@ -8163,9 +8432,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "26.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f14519c1c613d2f8c95c27015864c11a37969a23deeba9f6dbaff4276e1b81c" +checksum = "7faf96228372dcaf4c01e53ba59248b59a4a9ec994f30bee373110900f34c7bc" dependencies = [ "frame-support", "frame-system", @@ -8183,15 +8452,16 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a1eba3078e2492cad15e4695f90eb3fc570386d9f71f8b81f709c7123fc6b5" +checksum = "91b308c436d36e4159ec617e9e03e20a54aa4c2cd99729a411b969c1d9062392" dependencies = [ "frame-benchmarking", "frame-election-provider-support", "frame-support", "frame-system", "pallet-bags-list", + "pallet-delegated-staking", "pallet-nomination-pools", "pallet-staking", "parity-scale-codec", @@ -8204,9 +8474,9 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" -version = "24.0.0" +version = "30.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5b35e6c471a669437b987ff02e11e2283412c9ebaeec5334dec3f73bcea652" +checksum = "57e14836c36af92c218a801d6dbd84460210f8af7820df400c5ffed6ae15006c" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -8216,9 +8486,9 @@ dependencies = [ [[package]] name = "pallet-offences" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b5bcfdc4f6032d7570929094fd459de12d840c440c395fb4d365d679e13eda" +checksum = "d2edc30910e938ef9df027aad650ea03644d0a33a604cec2267fce28951c0530" dependencies = [ "frame-support", "frame-system", @@ -8234,9 +8504,9 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbc33e3086c19235cb903cbbbde1bc1c4f428519ad4c23446dc84c75d0061582" +checksum = "c605b2a3cf4eab08293ceb8f16a9352fcd71a27f0ab0dbdd8380946ab5800db6" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8257,11 +8527,30 @@ dependencies = [ "sp-std", ] +[[package]] +name = "pallet-parameters" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ca55799e0693fafb28342892d5f71a52f95e2ca279f940faf8a7bbb4c8b835" +dependencies = [ + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "parity-scale-codec", + "paste", + "scale-info", + "serde", + "sp-core", + "sp-runtime", + "sp-std", +] + [[package]] name = "pallet-preimage" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7344a30c304771beb90aec34604100185e47cdc0366e268ad18922de602a0c7e" +checksum = "e17c6fa28b38ef4cf33203709e3610c89aa8299900c7d0096bdec7b9e90ab2d3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8304,9 +8593,9 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7aa31a0b91e8060b808c3e3407e4578a5e94503b174b9e99769147b24fb2c56" +checksum = "279b23df802b3edb41d04836cc2f97d59c358b3bd43d39b98fd1fe2e03204b87" dependencies = [ "frame-benchmarking", "frame-support", @@ -8320,9 +8609,9 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3733dbfc44d8f5e1a08287a9064e5794e9d0e92b1bd68cdad2e22202b1964528" +checksum = "aac3413b3e5620c0b83bc32855ea16f0c9381fea96b85ffbe9490cb648815c96" dependencies = [ "frame-benchmarking", "frame-support", @@ -8340,9 +8629,9 @@ dependencies = [ [[package]] name = "pallet-recovery" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "797b554ddc87082c18223440d61a81cf35ccab6573321ce473a099e7a709a760" +checksum = "9fe5112bc7fe0282330e01a9c4fb58e42ed9030575eaf8479d54e3d6bd36f889" dependencies = [ "frame-benchmarking", "frame-support", @@ -8356,9 +8645,9 @@ dependencies = [ [[package]] name = "pallet-referenda" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da850889e7101b63cadb980b7f39df67feb6d63bc6092769b9b708e9eb596db1" +checksum = "7c969360bab41c9d50cd99755408690f23241424c3cc15935dd6c47206fc9c23" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8376,9 +8665,9 @@ dependencies = [ [[package]] name = "pallet-root-testing" -version = "5.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59171cbf2b823c13685b1b80dd3e1e84425680ff4e006d8016f8c14d2ec44974" +checksum = "059d0d7994b582126219f45410a9ef0c1db9655167ab4b84a9a16aafdb92ef1a" dependencies = [ "frame-support", "frame-system", @@ -8392,9 +8681,9 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45e2a4ebe6a5f98b14a26deed8d7a1ea28bb2c2d3ad4d6dc129a725523a2042d" +checksum = "05840a0a1c517438d21873ad2279fea914eec836e1d76d15f29548a8ace6c707" dependencies = [ "docify", "frame-benchmarking", @@ -8411,9 +8700,9 @@ dependencies = [ [[package]] name = "pallet-session" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7412ac59247b300feee53709f7009a23d1c6f8c70528599f48f44e102d896d03" +checksum = "7c77e7b0716fdf3cf8ecfcc872d583c972c4c9706842709a1112f26c51f701ae" dependencies = [ "frame-support", "frame-system", @@ -8434,9 +8723,9 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9c2731415381020db1e78db8b40207f8423a16099e78f2fde599cbcb57ea8db" +checksum = "42b450a525ea08dcdf4b3f33dce8796b2161c5c7917b99fba720d2fcd09b421b" dependencies = [ "frame-benchmarking", "frame-support", @@ -8444,7 +8733,7 @@ dependencies = [ "pallet-session", "pallet-staking", "parity-scale-codec", - "rand", + "rand 0.8.5", "sp-runtime", "sp-session", "sp-std", @@ -8452,16 +8741,16 @@ dependencies = [ [[package]] name = "pallet-society" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dba64f96619c25ae7a0b41f4a5111c2d3102e8b8c6cbce80ece6955e825f9de2" +checksum = "236344aaf3ab6d088364aab2f284de04628bf1b7a187686347dbec7ecd0b8cc9" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "parity-scale-codec", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", "scale-info", "sp-arithmetic", "sp-io", @@ -8471,9 +8760,9 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "29.0.2" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668b7d28c499f0d9f295fad26cf6c342472e21842e3b13bcaaac8536358b2d6c" +checksum = "e8f63dce0732789c9222056a3292576b7843aa1c7eb5e7e0fcb158dbab8f4455" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8483,7 +8772,7 @@ dependencies = [ "pallet-authorship", "pallet-session", "parity-scale-codec", - "rand_chacha 0.2.2", + "rand_chacha 0.3.1", "scale-info", "serde", "sp-application-crypto", @@ -8495,21 +8784,21 @@ dependencies = [ [[package]] name = "pallet-staking-reward-curve" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efca5a4a423427d2c83af5fe07ab648c16b91e3782c3cc23316fe0bd96b4c794" +checksum = "db5e6b1d8ee9d3f6894c5abd8c3e17737ed738c9854f87bfd16239741b7f4d5d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "pallet-staking-reward-fn" -version = "20.0.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "505d45e08bad052f55fb51f00a6b6244d23ee46ffdc8091f6cddf4e3a880319d" +checksum = "988a7ebeacc84d4bdb0b12409681e956ffe35438447d8f8bc78db547cffb6ebc" dependencies = [ "log", "sp-arithmetic", @@ -8517,9 +8806,9 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" -version = "15.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237d7b5a10cb6cba727c3e957fb241776302aa3cce589e6759ba53f50129c1a5" +checksum = "3350ef1795b832f4adc464e88fb6d44827bd3f98701b0b0bbee495267b444a92" dependencies = [ "parity-scale-codec", "sp-api", @@ -8528,9 +8817,9 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e52dedc146b7a9c3b7c5a6ff4c4c442a8ab8cc58ec30e90e1e98cdc51ad34" +checksum = "2fdd28b85f5c5beb7659a0dee158155b6114dcc747c139f247df944cca132df2" dependencies = [ "frame-benchmarking", "frame-support", @@ -8546,9 +8835,9 @@ dependencies = [ [[package]] name = "pallet-sudo" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d02f7855d411913e77e57126f4a8b8a32d90d9bf47d0b747e367a1301729c3" +checksum = "d15062b0caa6194e3ab13a10a500b2ed4b9d5915bf30dda18833e1c3bbbf6e85" dependencies = [ "docify", "frame-benchmarking", @@ -8563,9 +8852,9 @@ dependencies = [ [[package]] name = "pallet-timestamp" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b8810ddfb254c7fb8cd7698229cce513d309a43ff117b38798dae6120f477b" +checksum = "34a42af51e32d3ea442e9aaabb935976e4154f89f3604bfb892a316e8d77c0d4" dependencies = [ "docify", "frame-benchmarking", @@ -8584,9 +8873,9 @@ dependencies = [ [[package]] name = "pallet-tips" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ca4b9921c9e9b59e8eeb64677ba6ec49743ef5fe98e0b63f77411b2b9f6cc99" +checksum = "9dae4a7f481f37cb839477dc1a2a8ce62ff962c25c48fbbad93631aa1c9fe0fa" dependencies = [ "frame-benchmarking", "frame-support", @@ -8627,9 +8916,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f690f5c287ad34b28ca951ef7fae80b08cc9218d970723b7a70e4d29396872" +checksum = "349e56fa9f8c4093d912f0654e37b57ae628ad4b4fea67d9f3373e5dfcab2bcc" dependencies = [ "frame-support", "frame-system", @@ -8644,9 +8933,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" -version = "31.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08ef209d2d5d077e325bf49b024fd2eff109a5c2ca0d84ce0d50a65839e6b026" +checksum = "0e53aea571916432782288ba28ba2724a9564428c5b75a5b46dc13f633092708" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8661,9 +8950,9 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c78bcba80c7c61712b98a6b5640975ebd25ceb688c18e975af78a0fac81785b0" +checksum = "331b2011bdf0ede2b607431360a94b7c3198f706bff63cd727c259e815f62389" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8674,9 +8963,9 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1605eb5083a2cd172544f33c6e59eca2e23ac49f02f13d1562b1b8a409df9c60" +checksum = "1317444c1dd38d7281db919b88331a9a76b483450a78f800d1cb76e21ce33563" dependencies = [ "docify", "frame-benchmarking", @@ -8694,9 +8983,9 @@ dependencies = [ [[package]] name = "pallet-tx-pause" -version = "10.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26ee3c04e718d399c43effb666c82ced0fc0303f3c57e930571035b59722021e" +checksum = "48a5a31cf8e954d9067cfede9cfac4a395a41460d6877025fe084c90af863574" dependencies = [ "docify", "frame-benchmarking", @@ -8713,9 +9002,9 @@ dependencies = [ [[package]] name = "pallet-utility" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "954f15b98c3fdebb763bb5cea4ec6803fd180d540ec5b07a9fcb2c118251d52c" +checksum = "489431d3b751d07853119fd250145273ea050e84565b3435b5b19c6d3f622b56" dependencies = [ "frame-benchmarking", "frame-support", @@ -8730,9 +9019,9 @@ dependencies = [ [[package]] name = "pallet-vesting" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4525f3038cdf078fea39d913c563ca626f09a615e7724f0c9eac97743c75ff44" +checksum = "79641f9c6720a5f1705a0b7464c13a6cf4c0a3d3c9db523ed73c345130bcaadd" dependencies = [ "frame-benchmarking", "frame-support", @@ -8746,9 +9035,9 @@ dependencies = [ [[package]] name = "pallet-whitelist" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0ad4ce05688bdddcdb682cbed2f3edff0ee5349f0b745ebacc27d179582432" +checksum = "7a8196f8403117eab3042f49bec96b80290e9bef678017073f62b409e5311476" dependencies = [ "frame-benchmarking", "frame-support", @@ -8762,9 +9051,9 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "8.0.4" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13f5c598737e84294880333170d1df3868a11ad7ee79d0b1d1af37365e1c277" +checksum = "870c71f937c78c722fc91a8f8fdf7bc0c74590eb01413eb17c5a72c405c9f134" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8782,13 +9071,14 @@ dependencies = [ "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", + "xcm-fee-payment-runtime-api", ] [[package]] name = "pallet-xcm-benchmarks" -version = "8.0.2" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c10e1c92086ce2069a3d2387d9431f48660b6ec92054c4d0a4e30a9f54e7ad3" +checksum = "19da3779debfcbaecda285e8d240d0415cc7df7ff0b75bcaa227dbc2fa0cdb5c" dependencies = [ "frame-benchmarking", "frame-support", @@ -8806,9 +9096,9 @@ dependencies = [ [[package]] name = "parachains-common" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34aa00981a24a2b772afaa49e258f9bcd6bb372db060a05614becc1c74d4456" +checksum = "41525e5ddae2ae87949323fce5ba5e039ac5ceea2a76bcf34c6e794c111134f7" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -8837,12 +9127,25 @@ dependencies = [ ] [[package]] -name = "parity-db" -version = "0.4.13" +name = "parity-bip39" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" +checksum = "4e69bf016dc406eff7d53a7d3f7cf1c2e72c82b9088aac1118591e36dd2cd3e9" dependencies = [ - "blake2 0.10.6", + "bitcoin_hashes 0.13.0", + "rand 0.8.5", + "rand_core 0.6.4", + "serde", + "unicode-normalization", +] + +[[package]] +name = "parity-db" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "592a28a24b09c9dc20ac8afaa6839abc417c720afe42c12e1e4a9d6aa2508d2e" +dependencies = [ + "blake2 0.10.6", "crc32fast", "fs2", "hex", @@ -8850,8 +9153,8 @@ dependencies = [ "log", "lz4", "memmap2 0.5.10", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "siphasher", "snap", "winapi", @@ -8915,9 +9218,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core 0.9.10", @@ -8945,9 +9248,9 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.3", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -8957,19 +9260,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" [[package]] -name = "paste" -version = "1.0.15" +name = "password-hash" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle 2.6.1", +] [[package]] -name = "pbkdf2" -version = "0.8.0" +name = "paste" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" -dependencies = [ - "crypto-mac 0.11.0", -] +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pbkdf2" @@ -8978,6 +9283,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", + "password-hash", ] [[package]] @@ -9003,9 +9309,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fb059dee1a7b802f036316d790138c613a4e8b180c822e3925a662e9f0c95" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -9014,9 +9320,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73541b156d32197eecda1a4014d7f868fd2bcb3c550d5386087cfba442bf69c" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -9024,22 +9330,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c35eeed0a3fab112f75165fdc026b3913f4183133f19b49be773ac9ea966e8bd" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "pest_meta" -version = "2.7.9" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2adbf29bb9776f28caece835398781ab24435585fe0d4dc1374a61db5accedca" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -9048,9 +9354,9 @@ dependencies = [ [[package]] name = "petgraph" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d3afd2628e69da2be385eb6f2fd57c8ac7977ceeff6dc166ff1657b0e386a9" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", "indexmap 2.2.6", @@ -9073,7 +9379,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -9096,9 +9402,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668d31b1c4eba19242f2088b2bf3316b82ca31082a8335764db4e083db7485d4" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -9121,22 +9427,16 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" -[[package]] -name = "platforms" -version = "3.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db23d408679286588f4d4644f965003d056e3dd5abcaaa938116871d7ce2fee7" - [[package]] name = "polkadot-approval-distribution" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdfa52beecc446ccf733dede1a0089e6396d3df13401004d27c0ce2530816bc" +checksum = "cd2f7de61c3e30845822cf071fced5302ce8d8dd9127c8cadb1aac1d6a431d50" dependencies = [ "bitvec", "futures 0.3.30", "futures-timer", - "itertools 0.10.5", + "itertools 0.11.0", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", @@ -9144,15 +9444,15 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", "tracing-gum", ] [[package]] name = "polkadot-availability-bitfield-distribution" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80ffc856dfbdb31178625760824ae320ddb7dd5694b217f489bd2832b8de15a5" +checksum = "9ddd8c20cba24cc94df433357e90f542cfdd1d1835d6a3859dc379b7eeb7cb43" dependencies = [ "always-assert", "futures 0.3.30", @@ -9161,15 +9461,15 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", "tracing-gum", ] [[package]] name = "polkadot-availability-distribution" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d05c26cc8d6fa0f5f432d9de880f20ad0d24ca51a618834ea6612d1bd96ab1" +checksum = "4eca33cf1901a090ac35ffc991e6394cb8ba5020234d6e32a800f5051ce629b9" dependencies = [ "derive_more", "fatality", @@ -9181,7 +9481,8 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", + "sc-network", "schnellru", "sp-core", "sp-keystore", @@ -9191,9 +9492,9 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d77e0b979f43861ab4c78c216c2729644bb12812f9bc859858bd3b8fc56b4d6" +checksum = "1817e10f78d6c8dafc63f25cc5e15e93cad4a1b861f8b8634fa6244441624582" dependencies = [ "async-trait", "fatality", @@ -9205,7 +9506,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", "sc-network", "schnellru", "thiserror", @@ -9213,11 +9514,21 @@ dependencies = [ "tracing-gum", ] +[[package]] +name = "polkadot-ckb-merkle-mountain-range" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b44320e5f7ce2c18227537a3032ae5b2c476a7e8eddba45333e1011fc31b92" +dependencies = [ + "cfg-if", + "itertools 0.10.5", +] + [[package]] name = "polkadot-cli" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef362c44280e3883a39ca452acc4a4fb61a18250d634d68578b22df7edd8290c" +checksum = "ecebd0f0e2dc1bcb521245c2ff2b76854407691cf782586eadd4a868f526aab9" dependencies = [ "cfg-if", "clap", @@ -9237,16 +9548,16 @@ dependencies = [ "sp-io", "sp-keyring", "sp-maybe-compressed-blob", + "sp-runtime", "substrate-build-script-utils", "thiserror", - "try-runtime-cli", ] [[package]] name = "polkadot-collator-protocol" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "507391f1be9f9b9a8fbf28ca13b0ab3f04947a54a1115d423d115aacf8889bf4" +checksum = "4440aad91c57574efb4a04e095570111d31c3a24d0fceb203973585243d74ae8" dependencies = [ "bitvec", "fatality", @@ -9267,9 +9578,9 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a08e4e014c853b252ecbbe3ccd67b2d33d78e46988d309b8cccf4ac06e25ef" +checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" dependencies = [ "parity-scale-codec", "scale-info", @@ -9280,9 +9591,9 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae32e83ef6bc0ec2874c76c19dff8f3795832ccc27f0abc587a7137994c42d26" +checksum = "afeea4e15a232d97e73be9acddded88df0749e583b6bc80ba5400e6f9a8ea912" dependencies = [ "derive_more", "fatality", @@ -9306,9 +9617,9 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b10514ace3272d38b602e1795a5a340b265285c4af875473d682a5c9d6c831c" +checksum = "6a39a54a269817e09d602b4e9c527905f9e367ff7c6337b1b3e1e048515f6b59" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9321,9 +9632,9 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01f05f7f60022d4beb30414f1f7c7e4ae728fea02086a4a0f8ff0a73e73ea4aa" +checksum = "45a5a4f4ef27ac178251ab064a2545e9e303e8fd1b1264b6df461e425b054065" dependencies = [ "futures 0.3.30", "futures-timer", @@ -9331,7 +9642,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "sc-network", "sc-network-common", @@ -9344,9 +9655,9 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "049ec1298ac6e96bcf4d980cd5864aceeee73b3298ab5d6dd7a3193d47578abc" +checksum = "ebc32407362fa5f8444067bf6b7942ae5f10dfc1a4bde056181a085381d9d60c" dependencies = [ "always-assert", "async-trait", @@ -9354,7 +9665,7 @@ dependencies = [ "fatality", "futures 0.3.30", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-subsystem", @@ -9368,9 +9679,9 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f1211ab8b154c2e2b4b89c64f57f96056c881e4fcfa2ce29b6e5cbc978e74f1" +checksum = "c9d84116b4220e2f8f8c5c3933dc4a21c3c8751079b3d89c605121b44fd201e8" dependencies = [ "futures 0.3.30", "parity-scale-codec", @@ -9387,15 +9698,15 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61a17b7e4edd3b73afbe0c6e8b5369bf3b721361a232baf11fb1698077067a4" +checksum = "a9e37706970e30cd57d2aa9d0ab57a6c25474c8bae0a2ef7b7dc4dc262ccd146" dependencies = [ "bitvec", "derive_more", "futures 0.3.30", "futures-timer", - "itertools 0.10.5", + "itertools 0.11.0", "kvdb", "merlin", "parity-scale-codec", @@ -9405,7 +9716,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", "sc-keystore", @@ -9421,9 +9732,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b334f06423ff701e4b807d6832741ec24e0e97ebc13b560fc99bc0652926c0" +checksum = "503d0c01f6b0f2ed31bd531ef9763719df4355b63d19e489a796912743afd423" dependencies = [ "bitvec", "futures 0.3.30", @@ -9444,9 +9755,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07f8840f3f2f0bee6264c18ce471c99c925f9afb65952e1d584b6d773cf4115" +checksum = "01e5505fabfb2b9dcebc05f596c249b57a2b4dcb9d65d5655406fb1693f3f5db" dependencies = [ "bitvec", "fatality", @@ -9465,9 +9776,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0687006f843d6da8687eb24da735a04cbdcf4c3a98d82055b9b3a9047537e17e" +checksum = "2af24edddafe308811f73dbd5a97b26a8ceb9a4ee1da5a6ae8487250b1930b0a" dependencies = [ "futures 0.3.30", "polkadot-node-subsystem", @@ -9481,9 +9792,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3035acf9069801e980b91b5178591f8a7052b4409de13824db7a6c798b36b98" +checksum = "9d16611223b95f59b3b3395b97807035114b7b3f4fc91cdea893981534e3a0bb" dependencies = [ "async-trait", "futures 0.3.30", @@ -9503,9 +9814,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c990b9ffdde6725fe79f55e3b7c4c32ce2134a06103708476fa595a4ac652e95" +checksum = "09318b543a6e7a1a7309e1841331e8a2d9f0c7ef2a2929efb75f296492cff36b" dependencies = [ "futures 0.3.30", "polkadot-node-metrics", @@ -9518,9 +9829,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451965f3ace786d392c407872d61324765061b87027890b02ffd625554531f97" +checksum = "358fd0d04fa636c94b1fdead690d2049e580843cfd623a913297d791d0d9db23" dependencies = [ "futures 0.3.30", "futures-timer", @@ -9536,9 +9847,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c13ea9d5b4aa43b5b1f718c3ec951adff0b0d74909cb1fe28206f5d88492247d" +checksum = "ef762a62e1c3894b01c7103710bb17fb8b4bb65444011d5e9e62a78933874d47" dependencies = [ "fatality", "futures 0.3.30", @@ -9556,9 +9867,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6574c0bda4e10d722f761d4b8ab5d1708f0f963e5840370aa9cee8f559c90a23" +checksum = "0ad8e655826a7a7f437e53331c6e1959930307c0ec9c174f100cb1a28f95267d" dependencies = [ "async-trait", "futures 0.3.30", @@ -9574,9 +9885,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" -version = "7.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "160f80a11b9d2b8e36e510ea54ce5b06e77179c0c502f7e19e5a5809bc1523ee" +checksum = "3899b61909cc0578ee72f73d67fca81865a2c8459df0a440df07a7203757f587" dependencies = [ "bitvec", "fatality", @@ -9592,9 +9903,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0d0a64371700537c3dc15b3956536e4541f093b7c38ac21737ea9fea3562a83" +checksum = "16da0e6b5778ac22802fb30c83e6a4e861f8386c8104a63ae0ed15cc959497c4" dependencies = [ "bitvec", "fatality", @@ -9604,24 +9915,23 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", + "schnellru", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-core-pvf" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bbb1b5f4b966f21a0336e94c0a0222958d2f3cba451da1157af271d07f9748" +checksum = "147d797f376100bfb83dfff60cd86805e1ccbd5a6d3db76bc2adc73ce95c1818" dependencies = [ "always-assert", - "array-bytes 6.2.2", + "array-bytes", "blake3", "cfg-if", "futures 0.3.30", "futures-timer", - "is_executable", - "libc", "parity-scale-codec", "pin-project", "polkadot-core-primitives", @@ -9631,11 +9941,9 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-parachain-primitives", "polkadot-primitives", - "rand", + "rand 0.8.5", "slotmap", "sp-core", - "sp-maybe-compressed-blob", - "sp-wasm-interface", "tempfile", "thiserror", "tokio", @@ -9644,9 +9952,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ab4a91e62a9f7e67cf400931578f2505417cc43a32ac29458163604f2b277b" +checksum = "39152f2c3b313cd901f3c9554a1622b4a2deacd539af3a7bfae6fbb94839ad9c" dependencies = [ "futures 0.3.30", "polkadot-node-primitives", @@ -9661,16 +9969,15 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003981d3b63e4f527ef7f03cbe280e41ec649d9be365668887f0b107610640f4" +checksum = "d8ab48ae1d313a9053153ad66cd9f80f26731feb54a7f03208d60076f1b3e188" dependencies = [ - "cfg-if", "cpu-time", "futures 0.3.30", "landlock", "libc", - "nix 0.27.1", + "nix 0.28.0", "parity-scale-codec", "polkadot-parachain-primitives", "polkadot-primitives", @@ -9689,9 +9996,9 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ba6ea6a03f297b7387fc59c41c3c32285803971cb27e81d7e9ca696824d6773" +checksum = "9c19882aa444012ea6c610b473131b0f15ef12e3dd2f897125ef57b38fdc8acc" dependencies = [ "futures 0.3.30", "polkadot-node-metrics", @@ -9705,18 +10012,19 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d113b48e7b6126964c3a790b101d99e17fd3cb75a92e94d54587ce1340df21" +checksum = "fd5e646fedc21914c77e682e8ec93f6d3440887fb076cd6b7b267f9bc193c025" dependencies = [ "lazy_static", "log", "mick-jaeger", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-primitives", "sc-network", + "sc-network-types", "sp-core", "thiserror", "tokio", @@ -9724,9 +10032,9 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef2e2a934f0d0d606fcfc53fc26f4cacd8b9f18fb2118829203fa813af2cdae" +checksum = "32a808897db8b9c36f89f148febcbdb0a02b06f8938752113d8972f3a836d518" dependencies = [ "bs58 0.5.1", "futures 0.3.30", @@ -9744,9 +10052,9 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07f9e67b0f25d695947a15b6fe8ee6f8e83f3dfcbca124a13281c0edd0dc4703" +checksum = "9e745a85464f42b58fc645c020cbd78baa083e0ebf1af2b4f499eb466e19e405" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -9759,19 +10067,21 @@ dependencies = [ "polkadot-node-jaeger", "polkadot-node-primitives", "polkadot-primitives", - "rand", + "rand 0.8.5", "sc-authority-discovery", "sc-network", - "strum 0.24.1", + "sc-network-types", + "sp-runtime", + "strum 0.26.3", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-primitives" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375744eee7a53576387e14856e1c65be8ecef8b449567bb2cff85706266c8912" +checksum = "779833f70a1563ed042d3c6b831a45c5ea0f80caa8f4ede487f7bee3130168fb" dependencies = [ "bitvec", "bounded-vec", @@ -9793,9 +10103,9 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24d6c226cdbcd48ab1e506d8512f0fb01839f9a72eec2fc0cf7771f6d3352171" +checksum = "1496f6759e964605b18d744babe6b4c430f4c0f4580663179f85976deffc5e39" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -9804,13 +10114,14 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1404525da0ab9d44bac1041449bf0c5576240f9031b305dc41654567e98b6021" +checksum = "a3ec11aa0eec2adede73aa14f0ebeb2794180f1b5322f0e75bfd1215d3f29b68" dependencies = [ "async-trait", "bitvec", "derive_more", + "fatality", "futures 0.3.30", "orchestra", "polkadot-node-jaeger", @@ -9820,6 +10131,7 @@ dependencies = [ "polkadot-statement-table", "sc-client-api", "sc-network", + "sc-network-types", "sc-transaction-pool-api", "smallvec", "sp-api", @@ -9833,21 +10145,22 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65a7d101f28bf718d15f01a060ed8cf7a7e2d8d5705c494b49ece696cada0adf" +checksum = "aaedb65dccd2fa8dc6c060fc93d11c73794f0b3ed3cbae20bd27159e16345785" dependencies = [ "async-trait", "derive_more", "fatality", "futures 0.3.30", "futures-channel", - "itertools 0.10.5", + "itertools 0.11.0", "kvdb", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", + "polkadot-erasure-coding", "polkadot-node-jaeger", "polkadot-node-metrics", "polkadot-node-network-protocol", @@ -9857,7 +10170,7 @@ dependencies = [ "polkadot-overseer", "polkadot-primitives", "prioritized-metered-channel", - "rand", + "rand 0.8.5", "sc-client-api", "schnellru", "sp-application-crypto", @@ -9869,15 +10182,15 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5ed988deffeddf440473586f62efc5dd498f6016e6650881db09dd60b3b24f" +checksum = "4004808b1cdfac76b38d4af1331f63a1ea4dabc64ce95526d2d2db2a637017cf" dependencies = [ "async-trait", "futures 0.3.30", "futures-timer", "orchestra", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-node-metrics", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -9892,9 +10205,9 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "7.0.0" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248ab090959a92e61493277e33b7e85104280a4beb4cb0815137d3c8c50a07f4" +checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" dependencies = [ "bounded-collections", "derive_more", @@ -9910,9 +10223,9 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d5f9930210cab0233d81204415c9ef4a8889cdf3e60de1435250481a2773ca" +checksum = "5a4879609f4340138930c3c7313256941104a3ff6f7ecb2569d15223da9b35b2" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -9938,9 +10251,9 @@ dependencies = [ [[package]] name = "polkadot-rpc" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb4747cb8faa532e8446b38b74266fd626d6b660fe6b00776dd6c4543cc0457f" +checksum = "a9e0ff61f56a02a50d5d894b966e2224c67b9d2b7e38043832480089a7ca11fd" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -9960,10 +10273,12 @@ dependencies = [ "sc-sync-state-rpc", "sc-transaction-pool-api", "sp-api", + "sp-application-crypto", "sp-block-builder", "sp-blockchain", "sp-consensus", "sp-consensus-babe", + "sp-consensus-beefy", "sp-keystore", "sp-runtime", "substrate-frame-rpc-system", @@ -9972,9 +10287,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06afbb3bd10245ad1907242a98ddffc3c0c1e209738b8382bc5bcfc1f28c0429" +checksum = "929499dd53b664110a787bd700030c0d5aa55ff5732556007e052711920933e8" dependencies = [ "bitvec", "frame-benchmarking", @@ -10024,9 +10339,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3566c6fd0c21b5dd555309427c984cf506f875ee90f710acea295b478fecbe0" +checksum = "17496ddf5f7bc75db80d8b5c8183a1fbc64d984c39238055c67bd45469d97e37" dependencies = [ "bs58 0.5.1", "frame-benchmarking", @@ -10038,9 +10353,9 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bcfd672be236fd1c38c702e7e99fe3f3e54df0ddb8127e542423221d1f50669" +checksum = "2502de64c7fea2a931712c3e0eb0830ed0af753115472c7ccb2b74c4eba61c65" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -10065,7 +10380,7 @@ dependencies = [ "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-metrics", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "rustc-hex", "scale-info", @@ -10088,9 +10403,9 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2fd665185877bec296588c7cf1ec0ef75e0545050b5e1d42d94240a284149da" +checksum = "2d0a5439b90eedd716501595b789435d677e7f0aae24ee4c20081572bd4fa56a" dependencies = [ "async-trait", "frame-benchmarking", @@ -10106,13 +10421,12 @@ dependencies = [ "log", "mmr-gadget", "pallet-babe", - "pallet-im-online", "pallet-staking", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "polkadot-approval-distribution", "polkadot-availability-bitfield-distribution", "polkadot-availability-distribution", @@ -10198,17 +10512,19 @@ dependencies = [ "sp-transaction-pool", "sp-version", "sp-weights", + "staging-xcm", "substrate-prometheus-endpoint", "thiserror", "tracing-gum", "westend-runtime", + "xcm-fee-payment-runtime-api", ] [[package]] name = "polkadot-statement-distribution" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff6d16cbd994987f48a9f107f12e4c7fff26cdd71df6288e9521adc7cff3427" +checksum = "4a14f12405ecfc8feab17a38756e3668619cd0df4613211c23e0258c24009c91" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -10230,9 +10546,9 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5e010da3c6a65d8f263d0f825a04d995ffc8a37f886f674fcbbc73bf158d01" +checksum = "947e9e3c8f71b9678f39a01f371a808b574823967dd9da187e6f886f5f08691c" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -10240,6 +10556,89 @@ dependencies = [ "tracing-gum", ] +[[package]] +name = "polkavm" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a3693e5efdb2bf74e449cd25fd777a28bd7ed87e41f5d5da75eb31b4de48b94" +dependencies = [ + "libc", + "log", + "polkavm-assembler", + "polkavm-common", + "polkavm-linux-raw", +] + +[[package]] +name = "polkavm-assembler" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fa96d6d868243acc12de813dd48e756cbadcc8e13964c70d272753266deadc1" +dependencies = [ + "log", +] + +[[package]] +name = "polkavm-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d9428a5cfcc85c5d7b9fc4b6a18c4b802d0173d768182a51cc7751640f08b92" +dependencies = [ + "log", +] + +[[package]] +name = "polkavm-derive" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae8c4bea6f3e11cd89bb18bcdddac10bd9a24015399bd1c485ad68a985a19606" +dependencies = [ + "polkavm-derive-impl-macro", +] + +[[package]] +name = "polkavm-derive-impl" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fdfc49717fb9a196e74a5d28e0bc764eb394a2c803eb11133a31ac996c60c" +dependencies = [ + "polkavm-common", + "proc-macro2", + "quote", + "syn 2.0.71", +] + +[[package]] +name = "polkavm-derive-impl-macro" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ba81f7b5faac81e528eb6158a6f3c9e0bb1008e0ffa19653bc8dea925ecb429" +dependencies = [ + "polkavm-derive-impl", + "syn 2.0.71", +] + +[[package]] +name = "polkavm-linker" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c7be503e60cf56c0eb785f90aaba4b583b36bff00e93997d93fef97f9553c39" +dependencies = [ + "gimli 0.28.1", + "hashbrown 0.14.5", + "log", + "object 0.32.2", + "polkavm-common", + "regalloc2 0.9.3", + "rustc-demangle", +] + +[[package]] +name = "polkavm-linux-raw" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26e85d3456948e650dff0cfc85603915847faf893ed1e66b020bb82ef4557120" + [[package]] name = "polling" version = "2.8.0" @@ -10258,13 +10657,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi", + "hermit-abi 0.4.0", "pin-project-lite 0.2.14", "rustix 0.38.34", "tracing", @@ -10326,6 +10725,16 @@ dependencies = [ "regex", ] +[[package]] +name = "predicates" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" +dependencies = [ + "anstyle", + "predicates-core", +] + [[package]] name = "predicates-core" version = "1.0.6" @@ -10342,21 +10751,11 @@ dependencies = [ "termtree", ] -[[package]] -name = "prettier-please" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22020dfcf177fcc7bf5deaf7440af371400c67c0de14c399938d8ed4fb4645d3" -dependencies = [ - "proc-macro2", - "syn 2.0.60", -] - [[package]] name = "prettyplease" -version = "0.1.11" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28f53e8b192565862cf99343194579a022eb9c7dd3a8d03134734803c7b3125" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", "syn 1.0.109", @@ -10364,12 +10763,12 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ac2cf0f2e4f42b49f5ffd07dae8d746508ef7526c13940e5f524012ae6c6550" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" dependencies = [ "proc-macro2", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -10404,12 +10803,21 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "1.3.1" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" dependencies = [ - "once_cell", - "toml_edit 0.19.15", + "thiserror", + "toml 0.5.11", +] + +[[package]] +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", ] [[package]] @@ -10453,29 +10861,29 @@ checksum = "834da187cfe638ae8abb0203f0b33e5ccdb02a28e7199f2f47b3e2754f50edca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "prometheus" -version = "0.13.3" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "449811d15fbdf5ceb5c1144416066429cf82316e2ec8ce0c1f6f8a02e7bbcf8c" +checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" dependencies = [ "cfg-if", "fnv", "lazy_static", "memchr", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "thiserror", ] @@ -10487,7 +10895,7 @@ checksum = "5d6fa99d535dd930d1249e6c79cb3c2915f9172a540fe2b02a4c8f9ca954721e" dependencies = [ "dtoa", "itoa", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus-client-derive-encode", ] @@ -10499,7 +10907,7 @@ checksum = "440f724eba9f6996b75d63681b0a92b06947f1457076d503a4d2e2c8f56442b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -10514,12 +10922,12 @@ dependencies = [ [[package]] name = "prost" -version = "0.12.4" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0f5d036824e4761737860779c906171497f6d55681139d8312388f8fe398922" +checksum = "deb1435c188b76130da55f17a466d252ff7b1418b2ad3e037d127b94e3411f29" dependencies = [ "bytes", - "prost-derive 0.12.5", + "prost-derive 0.12.6", ] [[package]] @@ -10533,17 +10941,38 @@ dependencies = [ "itertools 0.10.5", "lazy_static", "log", - "multimap", + "multimap 0.8.3", "petgraph", - "prettyplease 0.1.11", + "prettyplease 0.1.25", "prost 0.11.9", - "prost-types", + "prost-types 0.11.9", "regex", "syn 1.0.109", "tempfile", "which", ] +[[package]] +name = "prost-build" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22505a5c94da8e3b7c2996394d1c933236c4d743e81a410bcca4e6989fc066a4" +dependencies = [ + "bytes", + "heck 0.5.0", + "itertools 0.12.1", + "log", + "multimap 0.10.0", + "once_cell", + "petgraph", + "prettyplease 0.2.20", + "prost 0.12.6", + "prost-types 0.12.6", + "regex", + "syn 2.0.71", + "tempfile", +] + [[package]] name = "prost-derive" version = "0.11.9" @@ -10559,15 +10988,15 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9554e3ab233f0a932403704f1a1d08c30d5ccd931adfdfa1e8b5a19b52c1d55a" +checksum = "81bddcdb20abf9501610992b6759a4c888aef7d1a7247ef75e2404275ac24af1" dependencies = [ "anyhow", - "itertools 0.11.0", + "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -10579,6 +11008,15 @@ dependencies = [ "prost 0.11.9", ] +[[package]] +name = "prost-types" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9091c90b0a32608e984ff2fa4091273cbdd755d54935c51d520887f4a1dbd5b0" +dependencies = [ + "prost 0.12.6", +] + [[package]] name = "psm" version = "0.1.21" @@ -10588,6 +11026,21 @@ dependencies = [ "cc", ] +[[package]] +name = "quanta" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi 0.11.0+wasi-snapshot-preview1", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -10627,6 +11080,24 @@ dependencies = [ "pin-project-lite 0.1.12", ] +[[package]] +name = "quinn" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e8b432585672228923edbbf64b8b12c14e1112f62e88737655b4a083dbcd78e" +dependencies = [ + "bytes", + "pin-project-lite 0.2.14", + "quinn-proto", + "quinn-udp", + "rustc-hash", + "rustls 0.20.9", + "thiserror", + "tokio", + "tracing", + "webpki", +] + [[package]] name = "quinn-proto" version = "0.9.6" @@ -10634,7 +11105,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94b0b33c13a79f669c85defaf4c275dc86a0c0372807d0ca3d78e0bb87274863" dependencies = [ "bytes", - "rand", + "rand 0.8.5", "ring 0.16.20", "rustc-hash", "rustls 0.20.9", @@ -10645,6 +11116,19 @@ dependencies = [ "webpki", ] +[[package]] +name = "quinn-udp" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "641538578b21f5e5c8ea733b736895576d0fe329bb883b937db6f4d163dbaaf4" +dependencies = [ + "libc", + "quinn-proto", + "socket2 0.4.10", + "tracing", + "windows-sys 0.42.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -10660,6 +11144,19 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -10706,7 +11203,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", ] [[package]] @@ -10716,7 +11213,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", ] [[package]] @@ -10728,6 +11234,15 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "raw-cpuid" +version = "11.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb9ee317cfe3fbd54b36a511efc1edd42e216903c9cd575e686dd68a2ba90d8d" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "rawpointer" version = "0.2.1" @@ -10786,11 +11301,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -10799,7 +11314,7 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ - "getrandom 0.2.14", + "getrandom 0.2.15", "libredox", "thiserror", ] @@ -10818,22 +11333,22 @@ dependencies = [ [[package]] name = "ref-cast" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4846d4c50d1721b1a3bef8af76924eef20d5e723647333798c1b519b3a9473f" +checksum = "ccf0a6f84d5f1d581da8b41b47ec8600871962f2a528115b542b362d4b744931" dependencies = [ "ref-cast-impl", ] [[package]] name = "ref-cast-impl" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fddb4f8d99b0a2ebafc65a87a69a7b9875e4b1ae1f00db265d300ef7f28bccc" +checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -10848,16 +11363,29 @@ dependencies = [ "smallvec", ] +[[package]] +name = "regalloc2" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad156d539c879b7a24a363a2016d77961786e71f48f2e2fc8302a92abd2429a6" +dependencies = [ + "hashbrown 0.13.2", + "log", + "rustc-hash", + "slice-group-by", + "smallvec", +] + [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -10871,13 +11399,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -10888,9 +11416,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "resolv-conf" @@ -10909,7 +11437,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ "hmac 0.12.1", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -10935,7 +11463,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.14", + "getrandom 0.2.15", "libc", "spin 0.9.8", "untrusted 0.9.0", @@ -10985,13 +11513,15 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089e93be2b8b76dd0d4b794a6a995ca3a1d6cb0ea3dd1cd42462f048bcfc926" +checksum = "79fc69d149aa86315ff2338311308a6ae31734f179ca0f859cddd5df263422f2" dependencies = [ "binary-merkle-tree", + "bitvec", "frame-benchmarking", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -11014,7 +11544,6 @@ dependencies = [ "pallet-elections-phragmen", "pallet-grandpa", "pallet-identity", - "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-message-queue", @@ -11022,6 +11551,7 @@ dependencies = [ "pallet-multisig", "pallet-nis", "pallet-offences", + "pallet-parameters", "pallet-preimage", "pallet-proxy", "pallet-ranked-collective", @@ -11053,6 +11583,7 @@ dependencies = [ "scale-info", "serde", "serde_derive", + "serde_json", "smallvec", "sp-api", "sp-arithmetic", @@ -11060,6 +11591,7 @@ dependencies = [ "sp-block-builder", "sp-consensus-babe", "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core", "sp-genesis-builder", "sp-inherents", @@ -11078,13 +11610,14 @@ dependencies = [ "staging-xcm-executor", "static_assertions", "substrate-wasm-builder", + "xcm-fee-payment-runtime-api", ] [[package]] name = "rococo-runtime-constants" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b45c21ccb0f8777512a65510c106aeee4b59682944b9a5cb31cd7b8ed4ccb47" +checksum = "22bd236a3170000b05950c1bf5e91ae99d4f99b1186553a21756f0edacc721a9" dependencies = [ "frame-support", "polkadot-primitives", @@ -11141,9 +11674,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -11163,7 +11696,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.22", + "semver 1.0.23", ] [[package]] @@ -11209,10 +11742,10 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", - "linux-raw-sys 0.4.13", + "linux-raw-sys 0.4.14", "windows-sys 0.52.0", ] @@ -11236,10 +11769,24 @@ checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] +[[package]] +name = "rustls" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.5", + "subtle 2.6.1", + "zeroize", +] + [[package]] name = "rustls-native-certs" version = "0.6.3" @@ -11247,7 +11794,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 1.0.4", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +dependencies = [ + "openssl-probe", + "rustls-pemfile 2.1.2", + "rustls-pki-types", "schannel", "security-framework", ] @@ -11261,6 +11821,22 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -11271,11 +11847,22 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ruzstd" @@ -11301,15 +11888,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "safe_arch" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" dependencies = [ "bytemuck", ] @@ -11325,9 +11912,9 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "24.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "357127c91373ed6d1ae582f6e3300ab5b13bcde43bbf270a891f44194ef48b70" +checksum = "b975ee3a95eaacb611e7b415737a7fa2db4d8ad7b880cc1b97371b04e95c7903" dependencies = [ "log", "sp-core", @@ -11337,24 +11924,26 @@ dependencies = [ [[package]] name = "sc-authority-discovery" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb3c14cb8022844835a6f7209196b8c6544d389fe5d2972d8df2ae4ca75afbe" +checksum = "e9aed092c3af161b8e5000e3152a560f8ddec740c7827084a201c8346e85d79d" dependencies = [ "async-trait", "futures 0.3.30", "futures-timer", "ip_network", "libp2p", + "linked_hash_set", "log", - "multihash 0.18.1", + "multihash 0.17.0", "multihash-codetable", "parity-scale-codec", - "prost 0.12.4", - "prost-build", - "rand", + "prost 0.12.6", + "prost-build 0.12.6", + "rand 0.8.5", "sc-client-api", "sc-network", + "sc-network-types", "sp-api", "sp-authority-discovery", "sp-blockchain", @@ -11367,9 +11956,9 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "724c3a6eee5f0829a1b79a15e12d63ed81b33281b14004a6331a8883b2fd8fd1" +checksum = "cdeb3ce0b4f25daa0d3026c2d9f6a21654a798bc5d4dc931272b9b39533b9b09" dependencies = [ "futures 0.3.30", "futures-timer", @@ -11390,9 +11979,9 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8b0640994965c6ff3afa13242d95a61611b83da21fd86ac2b1ebd03e241a02" +checksum = "d6345fb862e10aaa7d88d6689a7c247448c40ae465253c83566dc76a17ec1426" dependencies = [ "parity-scale-codec", "sp-api", @@ -11406,11 +11995,11 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f73880050f8b04fed7f6301279ef3899df13a3891bd06156d56f9a1c50fefba" +checksum = "ae230af4bbf2f518da9fd2c710e2b1945011d993017ede3e0f816c6d825bb225" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "docify", "log", "memmap2 0.9.4", @@ -11429,38 +12018,39 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", + "sp-tracing", ] [[package]] name = "sc-chain-spec-derive" -version = "11.0.0" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2e80fbdaea194762d4b4b0eec389037c25ad102676203b42d684774ae3019b8" +checksum = "b18cef11d2c69703e0d7c3528202ef4ed1cd2b47a6f063e9e17cad8255b1fa94" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sc-cli" -version = "0.37.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a284c10ea92b1fe789b9f0e5815d393f3a1e3bf6a4adaa884f24e36143b83b" +checksum = "f9a727a3ea99b22dd275fa49b05bcf2db195d444f9c3ca1c4388fd2334425f70" dependencies = [ - "array-bytes 6.2.2", - "bip39", + "array-bytes", "chrono", "clap", "fdlimit", "futures 0.3.30", - "itertools 0.10.5", + "itertools 0.11.0", "libp2p-identity", "log", "names", + "parity-bip39", "parity-scale-codec", - "rand", + "rand 0.8.5", "regex", "rpassword", "sc-client-api", @@ -11487,15 +12077,15 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "29.0.0" +version = "35.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e914dfadaaf384d8869ae47f3ec783bf6a1ac24e7827f5fec2e0e649a450a91" +checksum = "1bb517f4418644aeefd7c29bbe34bfc56ba8b5ea56e0b661a48a4d4d6afef40b" dependencies = [ "fnv", "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-executor", "sc-transaction-pool-api", "sc-utils", @@ -11515,9 +12105,9 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.36.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f08c4f29e6d2b8915bab6435b8817fa39ef7708c04a7cf6226f803e133b017c" +checksum = "2e3c685871877f39df000ec446f65fc8d502a7cecfc437cdac59866349642dc3" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -11527,7 +12117,7 @@ dependencies = [ "log", "parity-db", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-state-db", "schnellru", @@ -11542,18 +12132,18 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e1ac2c698b828073982b6f5b1a466fcc345a452983356af74254ade8e9987d" +checksum = "5d7149e17ec363316391119f614ffb0da96284f4ed3aa1d67560687f627605b6" dependencies = [ "async-trait", "futures 0.3.30", "futures-timer", - "libp2p-identity", "log", - "mockall", - "parking_lot 0.12.2", + "mockall 0.11.4", + "parking_lot 0.12.3", "sc-client-api", + "sc-network-types", "sc-utils", "serde", "sp-api", @@ -11568,9 +12158,9 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a16fd09794291795ad43ea1df7190083f9a47fc0a73e9b8ec0ae98fbe53a2b34" +checksum = "ebdedb86c3939254d7b6a01352f1aef450aaab17b2886a8d233f79e753d77fda" dependencies = [ "async-trait", "futures 0.3.30", @@ -11598,9 +12188,9 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ec3dc31f8fd024684d1306488836680558b680a8ec38219e19f20854811f02" +checksum = "da9ef4db80306f8dca3ec37e05d4b7ab5bf4c5fe5a9cdc6a12ec7b95f01710d0" dependencies = [ "async-trait", "fork-tree", @@ -11610,7 +12200,7 @@ dependencies = [ "num-rational", "num-traits", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-consensus", "sc-consensus-epochs", @@ -11635,9 +12225,9 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf2b3004672f9eea0d9af6c9b944fa3ef0bc72fd88cea9075cdf6dc96d1439ac" +checksum = "4336200d7a52573c7e4722b808763ee27db46353807b32300f59fe8114fa43c2" dependencies = [ "futures 0.3.30", "jsonrpsee", @@ -11658,23 +12248,24 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" -version = "14.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9ce3ee15eff7fa642791966d427f185184df3c7f4e58893705f3e7781da8ef5" +checksum = "893b263b88ffa7c92e23bf14132c132b932fb028fe411eacf43f69025f563417" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "async-trait", "fnv", "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-consensus", "sc-network", "sc-network-gossip", "sc-network-sync", + "sc-network-types", "sc-utils", "sp-api", "sp-application-crypto", @@ -11685,7 +12276,6 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-keystore", - "sp-mmr-primitives", "sp-runtime", "substrate-prometheus-endpoint", "thiserror", @@ -11695,18 +12285,19 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" -version = "14.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1ed5e8ac2cb53c6a248c8f469353f55bd23c72f23fe371ac19c1d46618de1a" +checksum = "72636eba4c9565a1f1ccd9f18750c15d58122d972aec10c0559e157b9ab9ace6" dependencies = [ "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-consensus-beefy", "sc-rpc", "serde", + "sp-application-crypto", "sp-consensus-beefy", "sp-core", "sp-runtime", @@ -11715,9 +12306,9 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f68ddb91626f901578515eed93c7919f739660161f4e9f7b9407e2d0ede981" +checksum = "d977b172eb79c6ae78179ef157032a899da449a2cfa093019c03a5e04f8f48a6" dependencies = [ "fork-tree", "parity-scale-codec", @@ -11729,12 +12320,12 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" -version = "0.20.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae91e5b5a120be4d13a59eaf94fd85d7c7af528482b8e21d861fa1167df3083" +checksum = "3380570b0c27d2c26dd16a3c73ea99e8b87c0a91b4d7e1e7332dd501d0250d95" dependencies = [ - "ahash 0.8.11", - "array-bytes 6.2.2", + "ahash", + "array-bytes", "async-trait", "dyn-clone", "finality-grandpa", @@ -11743,8 +12334,8 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -11753,6 +12344,7 @@ dependencies = [ "sc-network-common", "sc-network-gossip", "sc-network-sync", + "sc-network-types", "sc-telemetry", "sc-transaction-pool-api", "sc-utils", @@ -11773,9 +12365,9 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.20.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "697cbd528516561dbc818a8990d5477169e86d9335a0b29207cf6f6a90269e7c" +checksum = "9d7b01772a9d98bc263561fe89b87a2461dedd0d3aa38f05847039ff256020f3" dependencies = [ "finality-grandpa", "futures 0.3.30", @@ -11794,9 +12386,9 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" -version = "0.36.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c26241f1846c897626b141e2568dbf9088036a1b18b241de23fcebc7a8f5e2e" +checksum = "cfef28e1339f7763efe699acec6051f69b4c55e348b66e69e4ae07850d32e5ed" dependencies = [ "assert_matches", "async-trait", @@ -11830,9 +12422,9 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567bddd65d52951fb9bc7a7e05d1dfdfc47ff2c594ec5ca9756d27e7226635bb" +checksum = "75e3bfe4d5d4c031e747436291356b7c8bb8a5885a0e3b3a4916aa7eb359d8b2" dependencies = [ "async-trait", "futures 0.3.30", @@ -11854,13 +12446,14 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2ac6c356538d67987bbb867e11a12a84ba87250c70fd50005b6d74f570a4f7" +checksum = "39f5767bf6a6bad29365d6d08fcf940ee453d31457ed034cf14f0392877daafd" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-executor-common", + "sc-executor-polkavm", "sc-executor-wasmtime", "schnellru", "sp-api", @@ -11877,10 +12470,11 @@ dependencies = [ [[package]] name = "sc-executor-common" -version = "0.30.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07498138dee3ddf2c71299ca372d8449880bb3a8a8a299a483094e9c26b0823e" +checksum = "0c3b703a33dcb7cddf19176fdf12294b9a6408125836b0f4afee3e6969e7f190" dependencies = [ + "polkavm", "sc-allocator", "sp-maybe-compressed-blob", "sp-wasm-interface", @@ -11888,17 +12482,29 @@ dependencies = [ "wasm-instrument", ] +[[package]] +name = "sc-executor-polkavm" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26fe58d9cacfab73e5595fa84b80f7bd03efebe54a0574daaeb221a1d1f7ab80" +dependencies = [ + "log", + "polkavm", + "sc-executor-common", + "sp-wasm-interface", +] + [[package]] name = "sc-executor-wasmtime" -version = "0.30.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a387779ab54ec1ffce0bf3a6631faada079459d42796c1895683767918a642" +checksum = "8cd498f2f77ec1f861c30804f5bfd796d4afcc8ce44ea1f11bfbe2847551d161" dependencies = [ "anyhow", "cfg-if", "libc", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "rustix 0.36.17", "sc-allocator", "sc-executor-common", @@ -11909,9 +12515,9 @@ dependencies = [ [[package]] name = "sc-informant" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb603a0a703f1bc10a4e6462bec1036d8fb8b3e3eff5513a9c07f98ccb8d662d" +checksum = "ec34fec99cdbc434918f9135c996af1f55e4c65d4247b7ecfeae47e957285588" dependencies = [ "ansi_term", "futures 0.3.30", @@ -11927,12 +12533,12 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "26.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cc4f6a558dd23e3bae2e9f195da822465258b9aaf211c34360d7f6efb944e54" +checksum = "267c8cfaceaeecb25484bad8668c17036016e46053a23509d44486474dbf44d3" dependencies = [ - "array-bytes 6.2.2", - "parking_lot 0.12.2", + "array-bytes", + "parking_lot 0.12.3", "serde_json", "sp-application-crypto", "sp-core", @@ -11942,24 +12548,24 @@ dependencies = [ [[package]] name = "sc-mixnet" -version = "0.5.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45fb213c15679fe5b87c383815d7fb758c70d3e7c573948bd7fe26ff344d2272" +checksum = "f7f295f4c06dfad60e8a5755a3866bb756bcd8208fa2f4d370c92fe2ec0de07c" dependencies = [ - "array-bytes 4.2.0", + "array-bytes", "arrayvec 0.7.4", "blake2 0.10.6", "bytes", "futures 0.3.30", "futures-timer", - "libp2p-identity", "log", "mixnet", "multiaddr", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-network", + "sc-network-types", "sc-transaction-pool-api", "sp-api", "sp-consensus", @@ -11972,15 +12578,16 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f231c7d5e749ec428b4cfa669d759ae76cd3da4f50d7352a2d711acdc7532891" +checksum = "6dc1b9eea5954cd4cec2a13a264f5c54d2f43e155b4f1065eaf285fa602fce1c" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "async-trait", "asynchronous-codec", "bytes", + "cid 0.9.0", "either", "fnv", "futures 0.3.30", @@ -11988,16 +12595,22 @@ dependencies = [ "ip_network", "libp2p", "linked_hash_set", + "litep2p", "log", - "mockall", + "mockall 0.11.4", + "once_cell", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "partial_sort", "pin-project", - "rand", + "prost 0.12.6", + "prost-build 0.12.6", + "rand 0.8.5", "sc-client-api", "sc-network-common", + "sc-network-types", "sc-utils", + "schnellru", "serde", "serde_json", "smallvec", @@ -12010,44 +12623,25 @@ dependencies = [ "tokio", "tokio-stream", "unsigned-varint", + "void", "wasm-timer", "zeroize", ] -[[package]] -name = "sc-network-bitswap" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2f89b0134738cb3d982b6e625ca93ae8dbe83ce2a06e4b6a396e4df09ed3499" -dependencies = [ - "async-channel 1.9.0", - "cid", - "futures 0.3.30", - "libp2p-identity", - "log", - "prost 0.12.4", - "prost-build", - "sc-client-api", - "sc-network", - "sp-blockchain", - "sp-runtime", - "thiserror", - "unsigned-varint", -] - [[package]] name = "sc-network-common" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3504bbff5ab016948dbab0f21a8be26324810b76eff3627ce744adb5bfc1b3ce" +checksum = "8a86e8a1a517986fd00fd2c963347f5f459241c2ae4e84083ca34b2078f79651" dependencies = [ "async-trait", "bitflags 1.3.2", "futures 0.3.30", "libp2p-identity", "parity-scale-codec", - "prost-build", + "prost-build 0.12.6", "sc-consensus", + "sc-network-types", "sp-consensus", "sp-consensus-grandpa", "sp-runtime", @@ -12055,11 +12649,11 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad02cf809c34b53614fa61377e3289064edf6c78eb11df071d11fbf7546d7e9" +checksum = "17d8d4b7cc4eb58e9f1e73eb6ba84de8bb0101f14d5c688ae7bd5ff0535ed282" dependencies = [ - "ahash 0.8.11", + "ahash", "futures 0.3.30", "futures-timer", "libp2p", @@ -12067,6 +12661,7 @@ dependencies = [ "sc-network", "sc-network-common", "sc-network-sync", + "sc-network-types", "schnellru", "sp-runtime", "substrate-prometheus-endpoint", @@ -12075,20 +12670,20 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84ef0b212c775f58e0304ec09166089f6b09afddf559b7c2b5702933b3be4" +checksum = "404aeef08ca7be7c0980cec7e633b3fbc8e325fb6ec7817b38d1b4fa9f2636d2" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "futures 0.3.30", - "libp2p-identity", "log", "parity-scale-codec", - "prost 0.12.4", - "prost-build", + "prost 0.12.6", + "prost-build 0.12.6", "sc-client-api", "sc-network", + "sc-network-types", "sp-blockchain", "sp-core", "sp-runtime", @@ -12097,11 +12692,11 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa9377059deece4e7d419d9ec456f657268c0c603e1cf98df4a920f6da83461" +checksum = "4599c3b68457fd150491074de9a3999030953bdc84a79780cb32e6a74c875be8" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "async-channel 1.9.0", "async-trait", "fork-tree", @@ -12109,14 +12704,15 @@ dependencies = [ "futures-timer", "libp2p", "log", - "mockall", + "mockall 0.11.4", "parity-scale-codec", - "prost 0.12.4", - "prost-build", + "prost 0.12.6", + "prost-build 0.12.6", "sc-client-api", "sc-consensus", "sc-network", "sc-network-common", + "sc-network-types", "sc-utils", "schnellru", "smallvec", @@ -12134,11 +12730,11 @@ dependencies = [ [[package]] name = "sc-network-transactions" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16c9cad4baf348725bd82eadcd1747fc112ec49c76b863755ce79c588fa73fe4" +checksum = "e14f67c5914e801e660a6aca7e0055723530f694b98ef8b30df142c918fcb5a1" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "futures 0.3.30", "libp2p", "log", @@ -12146,19 +12742,37 @@ dependencies = [ "sc-network", "sc-network-common", "sc-network-sync", + "sc-network-types", "sc-utils", "sp-consensus", "sp-runtime", "substrate-prometheus-endpoint", ] +[[package]] +name = "sc-network-types" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efe67b8d4050c438331b82969d40e4a1e665d0dfd9eb0a5e949c02b925b5484d" +dependencies = [ + "bs58 0.5.1", + "ed25519-dalek 2.1.1", + "libp2p-identity", + "litep2p", + "multiaddr", + "multihash 0.17.0", + "rand 0.8.5", + "thiserror", + "zeroize", +] + [[package]] name = "sc-offchain" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aee89f2abd406356bfd688bd7a51155dc963259e4b752bb85d1f8a061a194fd" +checksum = "aa5e3ad7b5bebfa1a48f77cf6bb415bac4c7642d645d69ab4bd4b5da85c74ddb" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "bytes", "fnv", "futures 0.3.30", @@ -12170,11 +12784,12 @@ dependencies = [ "num_cpus", "once_cell", "parity-scale-codec", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "sc-client-api", "sc-network", "sc-network-common", + "sc-network-types", "sc-transaction-pool-api", "sc-utils", "sp-api", @@ -12189,9 +12804,9 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb8dadb2ae5a316e4d08cad6aacd5de1dec792f3bd94e3960795ff7ffd07211c" +checksum = "f680a0bed67dab19898624246376ba85d5f70a89859ba030830aacd079c28d3c" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -12199,15 +12814,15 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a5acf6d89f062d1334a0c5b67e9dea97666cd47a49acb2696eab55ff1a1bf74" +checksum = "6cbee238062a62d441cd98694a0a9135c17bad13d8ccb3f54eba917cf14482e3" dependencies = [ "futures 0.3.30", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-block-builder", "sc-chain-spec", "sc-client-api", @@ -12232,9 +12847,9 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.34.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9db6aaabfa7e0c27ec15d0f0a11b994cd4bcf86e362f0d9732b4a414d793f0f" +checksum = "5e383ce9ec80c14694256a55a4e70b9929d4559d9b1fc5decf2d344c39d94208" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12253,11 +12868,16 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "12.0.0" +version = "16.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "691440bbaddd3bc2675309c965cc75f8bf694f51e0a28039bfc9658299fbc394" +checksum = "5afa7a60f1f6349e61764c21f644c3d4549a7a45c097123746c68e84c0fb8738" dependencies = [ + "forwarded-header-value", + "futures 0.3.30", + "governor", "http", + "hyper", + "ip_network", "jsonrpsee", "log", "serde_json", @@ -12269,23 +12889,25 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f10275c62296a785f6e2ac716521e3b6e0fae470416fdf86491cbbfcc2e23d" +checksum = "7f6e14f8562b86f9e1a54fa287b2d26164c1b84871d51719a78976ec747e3e49" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "futures 0.3.30", "futures-util", "hex", "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", + "rand 0.8.5", "sc-chain-spec", "sc-client-api", "sc-rpc", "sc-transaction-pool-api", "sc-utils", + "schnellru", "serde", "sp-api", "sp-blockchain", @@ -12300,9 +12922,9 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.36.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ea779b8c5bdb0d0199c8beebcf1fdc5641e468c480e1c4684be660c8c90af" +checksum = "5e6b4822a49f75485f8d95c34818eef4ddd8a62e0c131f72fd7a680bf1ec2ef5" dependencies = [ "async-trait", "directories", @@ -12312,9 +12934,9 @@ dependencies = [ "jsonrpsee", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", - "rand", + "rand 0.8.5", "sc-chain-spec", "sc-client-api", "sc-client-db", @@ -12323,11 +12945,11 @@ dependencies = [ "sc-informant", "sc-keystore", "sc-network", - "sc-network-bitswap", "sc-network-common", "sc-network-light", "sc-network-sync", "sc-network-transactions", + "sc-network-types", "sc-rpc", "sc-rpc-server", "sc-rpc-spec-v2", @@ -12337,6 +12959,7 @@ dependencies = [ "sc-transaction-pool", "sc-transaction-pool-api", "sc-utils", + "schnellru", "serde", "serde_json", "sp-api", @@ -12364,21 +12987,21 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.31.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa842052c41ad379eaecdfddc0d5c953d57e311ae688233f68f461b91d38da0a" +checksum = "f689d0b97c1bbdb2ca31b5f202bda195947f85c7fef990651cad202b99de896b" dependencies = [ "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sp-core", ] [[package]] name = "sc-storage-monitor" -version = "0.17.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26cb401aad6732700c8d866cbbef1175b9aeb8230908aff27059ef14bd058ef3" +checksum = "1d117c3945c524b9c0e30966359895f5ad551c2cd4ccbb677b53917fbad5039a" dependencies = [ "clap", "fs4", @@ -12390,9 +13013,9 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" -version = "0.35.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bc382c7d997f4531eee5e5d57f970eaf2761d722298d7747385a4ad69fa6b12" +checksum = "b92099c0a7713f3de81fcf353f0fa0cff8382c1fc7aa122b90df317d276cb113" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12410,15 +13033,15 @@ dependencies = [ [[package]] name = "sc-sysinfo" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25d2ab8f15021916a07cfbe7a08be484c5dc7d57f07bc0e2aa03260b55a5632f" +checksum = "04295dc630eddd421eef0e4148b00b66cd85fdfba900916af140bc84dcbcfeaa" dependencies = [ "derive_more", "futures 0.3.30", "libc", "log", - "rand", + "rand 0.8.5", "rand_pcg", "regex", "sc-telemetry", @@ -12432,17 +13055,18 @@ dependencies = [ [[package]] name = "sc-telemetry" -version = "16.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0673a93aa0684b606abfc5fce6c882ada7bb5fad8a2ddc66a09a42bcc9664d91" +checksum = "85ee91de6648ca949b8080fe8a787c1bf2d66311fec78fba52136959e0b9719c" dependencies = [ "chrono", "futures 0.3.30", "libp2p", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", - "rand", + "rand 0.8.5", + "sc-network", "sc-utils", "serde", "serde_json", @@ -12452,9 +13076,9 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e77b4fdb4f359f19c395ba862430f3ca0efb50b0310b09753caaa06997edd606" +checksum = "61151f2d6b7ce3d7174484414dbc4e2f64b05a144c8f0a59ea02284e6c748a19" dependencies = [ "ansi_term", "chrono", @@ -12463,7 +13087,7 @@ dependencies = [ "libc", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "regex", "rustc-hash", "sc-client-api", @@ -12477,8 +13101,8 @@ dependencies = [ "sp-tracing", "thiserror", "tracing", - "tracing-log", - "tracing-subscriber", + "tracing-log 0.2.0", + "tracing-subscriber 0.3.18", ] [[package]] @@ -12490,14 +13114,14 @@ dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sc-transaction-pool" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "326dc8ea417c53b6787bd1bb27431d44768504451f5ce4efdde0c15877c7c121" +checksum = "800e35d0d2f2b8e17170ec961d58756fe7891026b19d889be388b9585cb12f90" dependencies = [ "async-trait", "futures 0.3.30", @@ -12505,7 +13129,7 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sc-client-api", "sc-transaction-pool-api", "sc-utils", @@ -12523,9 +13147,9 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ae888ce3491acb1b489c3dba930d0c46c7ef9f9893ba0ab8af9125362f3d14" +checksum = "b3de6f60df6706970061e225e87d77aab9a764b258fe151b896a700419bc6b9d" dependencies = [ "async-trait", "futures 0.3.30", @@ -12540,16 +13164,16 @@ dependencies = [ [[package]] name = "sc-utils" -version = "15.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b1a238f5baa56405db4e440e2d2f697583736fa2e2f1aac345c438a42975f1" +checksum = "acf1bad736c230f16beb1cf48af9e69564df23b13aca9e5751a61266340b4bb5" dependencies = [ "async-channel 1.9.0", "futures 0.3.30", "futures-timer", "lazy_static", "log", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "prometheus", "sp-arithmetic", ] @@ -12620,11 +13244,11 @@ dependencies = [ [[package]] name = "schnellru" -version = "0.2.1" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772575a524feeb803e5b0fcbc6dd9f367e579488197c94c6e4023aad2305774d" +checksum = "c9a8ef13a93c54d20580de1e5c413e624e53121d42fc7e2c11d10ef7f8b02367" dependencies = [ - "ahash 0.8.11", + "ahash", "cfg-if", "hashbrown 0.13.2", ] @@ -12654,13 +13278,13 @@ dependencies = [ "aead", "arrayref", "arrayvec 0.7.4", - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.3", "getrandom_or_panic", "merlin", "rand_core 0.6.4", "serde_bytes", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -12686,6 +13310,21 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "sctp-proto" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6220f78bb44c15f326b0596113305f6101097a18755d53727a575c97e09fb24" +dependencies = [ + "bytes", + "crc", + "fxhash", + "log", + "rand 0.8.5", + "slab", + "thiserror", +] + [[package]] name = "sec1" version = "0.7.3" @@ -12696,7 +13335,8 @@ dependencies = [ "der", "generic-array 0.14.7", "pkcs8", - "subtle 2.5.0", + "serdect", + "subtle 2.6.1", "zeroize", ] @@ -12738,11 +13378,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -12751,9 +13391,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -12770,9 +13410,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] @@ -12785,31 +13425,31 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_bytes" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" +checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -12825,10 +13465,20 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serdect" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" dependencies = [ + "base16ct", "serde", ] @@ -12845,6 +13495,18 @@ dependencies = [ "opaque-debug 0.3.1", ] +[[package]] +name = "sha-1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", + "sha1-asm", +] + [[package]] name = "sha1" version = "0.10.6" @@ -12856,6 +13518,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha1-asm" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "286acebaf8b67c1130aedffad26f594eff0c1292389158135327d2e23aed582b" +dependencies = [ + "cc", +] + [[package]] name = "sha2" version = "0.9.9" @@ -12914,6 +13585,12 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" + [[package]] name = "signature" version = "2.2.0" @@ -12957,6 +13634,15 @@ dependencies = [ "similar", ] +[[package]] +name = "simple-dns" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cae9a3fcdadafb6d97f4c0e007e4247b114ee0f119f650c3cbf3a8b3a1479694" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "simple-mermaid" version = "0.1.1" @@ -12986,9 +13672,9 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40fa5e14772407fd2ccffdd5971bf055bbf46a40727c0ea96d2bb6563d17e1c" +checksum = "a4d67aa9b1ccfd746c8529754c4ce06445b1d48e189567402ef856340a3a6b14" dependencies = [ "enumn", "parity-scale-codec", @@ -13045,13 +13731,13 @@ dependencies = [ "chacha20", "crossbeam-queue", "derive_more", - "ed25519-zebra 4.0.3", + "ed25519-zebra", "either", "event-listener 2.5.3", "fnv", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "hmac 0.12.1", "itertools 0.11.0", @@ -13062,10 +13748,10 @@ dependencies = [ "num-bigint", "num-rational", "num-traits", - "pbkdf2 0.12.2", + "pbkdf2", "pin-project", "poly1305", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "ruzstd", "schnorrkel 0.10.2", @@ -13100,15 +13786,15 @@ dependencies = [ "futures-channel", "futures-lite 1.13.0", "futures-util", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "hex", "itertools 0.11.0", "log", "lru 0.11.1", "no-std-net", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "serde", "serde_json", @@ -13134,12 +13820,12 @@ dependencies = [ "aes-gcm", "blake2 0.10.6", "chacha20poly1305", - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", "ring 0.17.8", "rustc_version", "sha2 0.10.8", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -13154,9 +13840,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -13175,15 +13861,15 @@ dependencies = [ "http", "httparse", "log", - "rand", - "sha-1", + "rand 0.8.5", + "sha-1 0.9.8", ] [[package]] name = "sp-api" -version = "27.0.1" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e4f8702afd77f14a32733e2b589c02694bf79d0b3a641963c508016208724d0" +checksum = "b7e43fbf034e9dbaa8ffc6a238a22808777eb38c580f66fc6736d8511631789e" dependencies = [ "hash-db 0.16.0", "log", @@ -13194,6 +13880,7 @@ dependencies = [ "sp-externalities", "sp-metadata-ir", "sp-runtime", + "sp-runtime-interface", "sp-state-machine", "sp-std", "sp-trie", @@ -13203,24 +13890,24 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "15.0.1" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0301e2f77afb450fbf2b093f8b324c7ad88cc82e5e69bd5dc8658a1f068b2a96" +checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" dependencies = [ "Inflector", "blake2 0.10.6", - "expander 2.1.0", + "expander", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-application-crypto" -version = "31.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547cad7a6eabb52c639ec117b3db9c6b43cf1b29a9393b18feb19e101a91833f" +checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" dependencies = [ "parity-scale-codec", "scale-info", @@ -13232,10 +13919,11 @@ dependencies = [ [[package]] name = "sp-arithmetic" -version = "24.0.0" +version = "26.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa823ca5adc490d47dccb41d69ad482bc57a317bd341de275868378f48f131c" +checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" dependencies = [ + "docify", "integer-sqrt", "num-traits", "parity-scale-codec", @@ -13247,40 +13935,38 @@ dependencies = [ [[package]] name = "sp-authority-discovery" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92b177c72b5d2973c36d60f6ef942d791d9fd91eae8b08c71882e4118d4fbfc" +checksum = "6a4a1e45abc3277f18484ee0b0f9808e4206eb696ad38500c892c72f33480d69" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", "sp-runtime", - "sp-std", ] [[package]] name = "sp-block-builder" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b36ce171caa7eb2bbe682c089f755fdefa71d3702e4fb1ba30d10146aef99d5" +checksum = "2cf199dc4f9f77abd3fd91c409759118159ce6ffcd8bc90b229b684ccc8c981f" dependencies = [ "sp-api", "sp-inherents", "sp-runtime", - "sp-std", ] [[package]] name = "sp-blockchain" -version = "29.0.0" +version = "35.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31303e766d2e53812641bbc1f1cec03a85793fc9e627e55f0a6854b28708758" +checksum = "f27eb18b6ddf7d663f4886f7edba3eb73bd102d68cf10802c1f862e3b3db32ab" dependencies = [ "futures 0.3.30", "log", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "schnellru", "sp-api", "sp-consensus", @@ -13292,9 +13978,9 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.33.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6e512b862c4ff7a26cdcd364898cc42e181ff5cb35fbb226ff27d88c81569a" +checksum = "ab094e8a7e9e5c7f05f8d90592aa1d1cf9b3f547d0dd401daff7ed98af942e12" dependencies = [ "async-trait", "futures 0.3.30", @@ -13308,9 +13994,9 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bf13c293685319751f72fa5216c7fb5f25f3e8e8fe29b4503296ed5f5466b3d" +checksum = "05ebb90bf00f331b898eb729a1f707251846c1d5582d7467f083884799a69b89" dependencies = [ "async-trait", "parity-scale-codec", @@ -13320,15 +14006,14 @@ dependencies = [ "sp-consensus-slots", "sp-inherents", "sp-runtime", - "sp-std", "sp-timestamp", ] [[package]] name = "sp-consensus-babe" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9be2f86a2f0ce2a78b455feb547aa27604fd76a7f7a691995cbad44e0b1b9dd" +checksum = "3aa2de4c7100a3279658d8dd4affd8f92487528deae5cb4b40322717b9175ed5" dependencies = [ "async-trait", "parity-scale-codec", @@ -13340,15 +14025,14 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std", "sp-timestamp", ] [[package]] name = "sp-consensus-beefy" -version = "14.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ff890a84ef57628b010df0e1d75b3a78fb7f575e4ceeba7215c276902c403e" +checksum = "b277bc109da8e1c3768d3a046e1cd1ab687aabac821c976c5f510deb6f0bc8d3" dependencies = [ "lazy_static", "parity-scale-codec", @@ -13359,17 +14043,17 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-io", + "sp-keystore", "sp-mmr-primitives", "sp-runtime", - "sp-std", - "strum 0.24.1", + "strum 0.26.3", ] [[package]] name = "sp-consensus-grandpa" -version = "14.0.0" +version = "20.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b606164600db36e596db7abf32b4533dc9a74526d9444c4c45035427b2199b" +checksum = "21dd06bf366c60f69411668b26d6ab3c55120aa6d423e6af0373ec23d8957300" dependencies = [ "finality-grandpa", "log", @@ -13381,49 +14065,48 @@ dependencies = [ "sp-core", "sp-keystore", "sp-runtime", - "sp-std", ] [[package]] name = "sp-consensus-slots" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73a5bd1fcd84bbdc7255528c7cdb92f9357fd555f06ee553af7e340cbdab517c" +checksum = "c8ca60d713f8ddb03bbebcc755d5e6463fdc0b6259fabfc4221b20a5f1e428fd" dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", "sp-timestamp", ] [[package]] name = "sp-core" -version = "29.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c33c7a1568175250628567d50c4e1c54a6ac5bc1190413b9be29a9e810cbe73" +checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" dependencies = [ - "array-bytes 6.2.2", - "bip39", + "array-bytes", "bitflags 1.3.2", "blake2 0.10.6", "bounded-collections", "bs58 0.5.1", "dyn-clonable", - "ed25519-zebra 3.1.0", + "ed25519-zebra", "futures 0.3.30", "hash-db 0.16.0", "hash256-std-hasher", "impl-serde", - "itertools 0.10.5", + "itertools 0.11.0", + "k256", "libsecp256k1", "log", "merlin", + "parity-bip39", "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "paste", "primitive-types", - "rand", + "rand 0.8.5", "scale-info", "schnorrkel 0.11.4", "secp256k1", @@ -13465,7 +14148,7 @@ checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" dependencies = [ "quote", "sp-crypto-hashing", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -13475,7 +14158,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" dependencies = [ "kvdb", - "parking_lot 0.12.2", + "parking_lot 0.12.3", ] [[package]] @@ -13486,59 +14169,59 @@ checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-externalities" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7096ed024cec397804864898b093b51e14c7299f1d00c67dd5800330e02bb82" +checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" dependencies = [ "environmental", "parity-scale-codec", - "sp-std", "sp-storage", ] [[package]] name = "sp-genesis-builder" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd865540ec19479c7349b584ccd78cc34c3f3a628a2a69dbb6365ceec36295ee" +checksum = "fcd065854d96fd81521c103d0aaa287d4f08b9b15c9fae2a3bfb208b0812bf44" dependencies = [ + "parity-scale-codec", + "scale-info", "serde_json", "sp-api", "sp-runtime", - "sp-std", ] [[package]] name = "sp-inherents" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "607c9e35e96966645ff180a9e9f976433b96e905d0a91d8d5315e605a21f4bc0" +checksum = "53407ba38ec22ca4a16381722c4bd0b559a0428bc1713079b0d5163ada63186a" dependencies = [ "async-trait", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", "thiserror", ] [[package]] name = "sp-io" -version = "31.0.0" +version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec43aa073eab35fcb920d7592474d5427ea3be2bf938706a3ad955d7ba54fd8d" +checksum = "5036cad2e48d41f5caf6785226c8be1a7db15bec14a9fd7aa6cca84f34cf689f" dependencies = [ "bytes", - "ed25519-dalek", + "ed25519-dalek 2.1.1", "libsecp256k1", "log", "parity-scale-codec", + "polkavm-derive", "rustversion", "secp256k1", "sp-core", @@ -13556,26 +14239,25 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "32.0.0" +version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cf0a2f881958466fc92bc9b39bbc2c0d815ded4a21f8f953372b0ac2e11b02" +checksum = "b03536e1ff3ec2bd8181eeaa26c0d682ebdcbd01548a055cf591077188b8c3f0" dependencies = [ "sp-core", "sp-runtime", - "strum 0.24.1", + "strum 0.26.3", ] [[package]] name = "sp-keystore" -version = "0.35.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444f2d53968b1ce5e908882710ff1f3873fcf3e95f59d57432daf685bbacb959" +checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" dependencies = [ "parity-scale-codec", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "sp-core", "sp-externalities", - "thiserror", ] [[package]] @@ -13590,53 +14272,50 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0b5e87e56c1bb26d9524d48dd127121d630f895bd5914a34f0b017489f7c1d" +checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" dependencies = [ "frame-metadata", "parity-scale-codec", "scale-info", - "sp-std", ] [[package]] name = "sp-mixnet" -version = "0.5.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bebd44b915c65aeb7e7eeaea466aba3b27cdd915c83ea83d4643c54f21ffbbf" +checksum = "2f65a570519da820ce3dc35053497a65f9fbd3f5a7dc81fa03078ca263e9311e" dependencies = [ "parity-scale-codec", "scale-info", "sp-api", "sp-application-crypto", - "sp-std", ] [[package]] name = "sp-mmr-primitives" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891b7263b7c44a569173ee1078f68fb1a01991a44914607c0100aa5ae41f6562" +checksum = "47412a2d2e988430d5f59d7fec1473f229e1ef5ce24c1ea4f601b4b3679cac52" dependencies = [ - "ckb-merkle-mountain-range", "log", "parity-scale-codec", + "polkadot-ckb-merkle-mountain-range", "scale-info", "serde", "sp-api", "sp-core", "sp-debug-derive", "sp-runtime", - "sp-std", "thiserror", ] [[package]] name = "sp-npos-elections" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195d7e1154c91cce5c3abc8c778689c3e5799da6411328dd32ac7a974c68e526" +checksum = "0b0c51a7b60cd663f2661e6949069eb316b092f22c239691d5272a4d0cfca0fb" dependencies = [ "parity-scale-codec", "scale-info", @@ -13644,14 +14323,13 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", ] [[package]] name = "sp-offchain" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d83b955dce0b6d143bec3f60571311168f362b1c16cf044da7037a407b66c19" +checksum = "cbe721c367760bddf10fcfa24fb48edd64c442f71db971f043c8ac73f51aa6e9" dependencies = [ "sp-api", "sp-core", @@ -13671,9 +14349,9 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "27.0.0" +version = "32.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9af4b73fe7ddd88b1641cca90048c4e525e721763199e6fd29c4f590884f4d16" +checksum = "45458f0955870a92b3969098d4f1f4e9b55b4282d9f1dc112a51bb5bb6584900" dependencies = [ "rustc-hash", "serde", @@ -13682,18 +14360,19 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "32.0.0" +version = "38.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a95e71603a6281e91b0f1fd3d68057644be16d75a4602013187b8137db8abee" +checksum = "89ef409c414546b655ec1e94aaea178e4a97e21284a91b24c762aebf836d3b49" dependencies = [ "docify", "either", "hash256-std-hasher", "impl-trait-for-tuples", "log", + "num-traits", "parity-scale-codec", "paste", - "rand", + "rand 0.8.5", "scale-info", "serde", "simple-mermaid", @@ -13707,13 +14386,14 @@ dependencies = [ [[package]] name = "sp-runtime-interface" -version = "25.0.0" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2321ab29d4bcc31f1ba1b4f076a81fb2a666465231e5c981c72320d74dbe63" +checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", + "polkavm-derive", "primitive-types", "sp-externalities", "sp-runtime-interface-proc-macro", @@ -13726,23 +14406,23 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" -version = "17.0.0" +version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfaf6e85b2ec12a4b99cd6d8d57d083e30c94b7f1b0d8f93547121495aae6f0c" +checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" dependencies = [ "Inflector", - "expander 2.1.0", + "expander", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-session" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b86531090cc04d2ab3535df07146258e2fb3ab6257b0a77ef14aa08282c3d4a" +checksum = "4daf2e40ffc7e7e8de08efb860eb9534faf614a49c53dc282f430faedb4aed13" dependencies = [ "parity-scale-codec", "scale-info", @@ -13751,14 +14431,13 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std", ] [[package]] name = "sp-staking" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e14d003ecf0b610bf1305a92bdab875289b39d514c073f30e75e78c2763a788" +checksum = "0a0b7abfe66c07a3b6eb99e1286dfa9b6f3b057b0e986e7da2ccbf707f6c781a" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -13766,25 +14445,23 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", ] [[package]] name = "sp-state-machine" -version = "0.36.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67297e702aa32027d7766803f362a420d6d3ec9e2f84961f3c64e2e52b5aaf9" +checksum = "211e528aa6e902261a343f7b40840aa3d66fe4ad3aadbd04a035f10baf96dbc5" dependencies = [ "hash-db 0.16.0", "log", "parity-scale-codec", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "smallvec", "sp-core", "sp-externalities", "sp-panic-handler", - "sp-std", "sp-trie", "thiserror", "tracing", @@ -13793,16 +14470,16 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "11.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "309a9ae4e8134bbed8ffc510cf4d461a4a651f9250b556de782cedd876abe1ff" +checksum = "b03aa86b1b46549889d32348bc85a8135c725665115567507231a6d85712aaac" dependencies = [ "aes-gcm", - "curve25519-dalek 4.1.2", - "ed25519-dalek", + "curve25519-dalek 4.1.3", + "ed25519-dalek 2.1.1", "hkdf", "parity-scale-codec", - "rand", + "rand 0.8.5", "scale-info", "sha2 0.10.8", "sp-api", @@ -13812,7 +14489,6 @@ dependencies = [ "sp-externalities", "sp-runtime", "sp-runtime-interface", - "sp-std", "thiserror", "x25519-dalek 2.0.1", ] @@ -13825,50 +14501,47 @@ checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" [[package]] name = "sp-storage" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dba5791cb3978e95daf99dad919ecb3ec35565604e88cd38d805d9d4981e8bd" +checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", "sp-debug-derive", - "sp-std", ] [[package]] name = "sp-timestamp" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "249cd06624f2edb53b25af528ab216a508dc9d0870e158b43caac3a97e86699f" +checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" dependencies = [ "async-trait", "parity-scale-codec", "sp-inherents", "sp-runtime", - "sp-std", "thiserror", ] [[package]] name = "sp-tracing" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0351810b9d074df71c4514c5228ed05c250607cba131c1c9d1526760ab69c05c" +checksum = "90b3decf116db9f1dfaf1f1597096b043d0e12c952d3bcdc018c6d6b77deec7e" dependencies = [ "parity-scale-codec", - "sp-std", "tracing", "tracing-core", - "tracing-subscriber", + "tracing-subscriber 0.2.25", ] [[package]] name = "sp-transaction-pool" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9742861c5330bdcb42856a6eed3d3745b58ee1c92ca4c9260032ff4e6c387165" +checksum = "a3c9d1604aadc15b70e95f4388d0b1aa380215520b7ddfd372531a6d8262269c" dependencies = [ "sp-api", "sp-runtime", @@ -13876,9 +14549,9 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "27.0.0" +version = "33.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece8e22a5419c7a336a2544654e1389fec8cac19b93081a30912842b44e8167f" +checksum = "5b5a891cb913015bb99401e372255193cc3848c6fe5c2f6fe2383ef9588cb190" dependencies = [ "async-trait", "parity-scale-codec", @@ -13886,29 +14559,27 @@ dependencies = [ "sp-core", "sp-inherents", "sp-runtime", - "sp-std", "sp-trie", ] [[package]] name = "sp-trie" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eed48dfd05081e8b36741b10ce4eb686c135a2952227a11fe71caec89890ddbb" +checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" dependencies = [ - "ahash 0.8.11", + "ahash", "hash-db 0.16.0", "lazy_static", "memory-db", "nohash-hasher", "parity-scale-codec", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "scale-info", "schnellru", "sp-core", "sp-externalities", - "sp-std", "thiserror", "tracing", "trie-db", @@ -13917,9 +14588,9 @@ dependencies = [ [[package]] name = "sp-version" -version = "30.0.0" +version = "36.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4a660c68995663d6778df324f4e2b4efc48d55a8e9c92c22a5fb7dae7899cd" +checksum = "bccf96fefae339dee7c4453f91be64eb28cce4c2fe82130445cf096b18b2c081" dependencies = [ "impl-serde", "parity-scale-codec", @@ -13935,35 +14606,34 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" -version = "13.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9bc3fed32d6dacbbbfb28dd1fe0224affbb737cb6cbfca1d9149351c2b69a7d" +checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" dependencies = [ "parity-scale-codec", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "sp-wasm-interface" -version = "20.0.0" +version = "21.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ef97172c42eb4c6c26506f325f48463e9bc29b2034a587f1b9e48c751229bee" +checksum = "3b04b919e150b4736d85089d49327eab65507deb1485eec929af69daa2278eb3" dependencies = [ "anyhow", "impl-trait-for-tuples", "log", "parity-scale-codec", - "sp-std", "wasmtime", ] [[package]] name = "sp-weights" -version = "28.0.0" +version = "31.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3be30aec904994451dcacf841a9168cfbbaf817de6b24b6a1c1418cbf1af2fe" +checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -13972,7 +14642,6 @@ dependencies = [ "smallvec", "sp-arithmetic", "sp-debug-derive", - "sp-std", ] [[package]] @@ -13988,14 +14657,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" [[package]] -name = "spinners" -version = "4.1.1" +name = "spinning_top" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ef947f358b9c238923f764c72a4a9d42f2d637c46e059dbd319d6e7cfb4f82" +checksum = "d96d2d1d716fb500937168cc09353ffdc7a012be8475ac7308e1bdf0e3923300" dependencies = [ - "lazy_static", - "maplit", - "strum 0.24.1", + "lock_api", ] [[package]] @@ -14031,9 +14698,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-node-inspect" -version = "0.13.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "394fb14c6e056213bfc3a97a246492604a6c6a0813b786f87cc2d585270c0a0b" +checksum = "1fc0f95e4420cf39863c53ce5c05ee5c1fbd83d1c78c47bd16145193a621336c" dependencies = [ "clap", "parity-scale-codec", @@ -14050,9 +14717,9 @@ dependencies = [ [[package]] name = "staging-parachain-info" -version = "0.8.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da7dc139d104f676a18c13380a09c3f72d59450a7471116387cbf8cb5f845a0e" +checksum = "7eab4e71683cd8ceb50c1c77badc49772148699ffe33a3e4dbbdb5ea34d90e19" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -14065,11 +14732,11 @@ dependencies = [ [[package]] name = "staging-xcm" -version = "8.0.1" +version = "14.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fa328b87de3466bc38cc9a07244c42c647b7755b81115e1dfeb47cc13fc6e6" +checksum = "536c5c8f8f25589e714a3be6b068d174debcc882e648dc9b0c3bd6ce45434de3" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "bounded-collections", "derivative", "environmental", @@ -14084,9 +14751,9 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f6cfc27c1d45f9a67e20ed3f7e60296299688825350291606add10bf3bbff2" +checksum = "b0517f2de0dd59ecc2693c0cb707ac30cee3d6576978b7287a4c3c9791b7792f" dependencies = [ "frame-support", "frame-system", @@ -14107,9 +14774,9 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "8.0.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a638f4c8735cc04b5c93920a1f59e679f48b131315a07d146798e0decebf7720" +checksum = "7a5b83ea34a2ba2083c6f5bfec468fb00535d0e0788a78237d06da32dba76be9" dependencies = [ "environmental", "frame-benchmarking", @@ -14161,6 +14828,26 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "str0m" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6706347e49b13373f7ddfafad47df7583ed52083d6fc8a594eb2c80497ef959d" +dependencies = [ + "combine", + "crc", + "fastrand 2.1.0", + "hmac 0.12.1", + "once_cell", + "openssl", + "openssl-sys", + "sctp-proto", + "serde", + "sha-1 0.10.1", + "thiserror", + "tracing", +] + [[package]] name = "strobe-rs" version = "0.8.1" @@ -14170,7 +14857,7 @@ dependencies = [ "bitflags 1.3.2", "byteorder", "keccak", - "subtle 2.5.0", + "subtle 2.6.1", "zeroize", ] @@ -14185,9 +14872,6 @@ name = "strum" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros 0.24.3", -] [[package]] name = "strum" @@ -14221,19 +14905,19 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "substrate-bip39" -version = "0.4.6" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a7590dc041b9bc2825e52ce5af8416c73dbe9d0654402bfd4b4941938b94d8f" +checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" dependencies = [ - "hmac 0.11.0", - "pbkdf2 0.8.0", + "hmac 0.12.1", + "pbkdf2", "schnorrkel 0.11.4", - "sha2 0.9.9", + "sha2 0.10.8", "zeroize", ] @@ -14256,9 +14940,9 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" -version = "29.0.0" +version = "35.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "332f903d2f34703204f0003136c9abbc569d691028279996a1daf8f248a7369f" +checksum = "8d077968f7a3352f4cd8791f9fc3553cca050fd3499f9ba602fe956813e8730d" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.30", @@ -14287,25 +14971,11 @@ dependencies = [ "tokio", ] -[[package]] -name = "substrate-rpc-client" -version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40e5235d8460ec81e9a382345aa80d75e2943f224a332559847344bb62fa13b3" -dependencies = [ - "async-trait", - "jsonrpsee", - "log", - "sc-rpc-api", - "serde", - "sp-runtime", -] - [[package]] name = "substrate-state-trie-migration-rpc" -version = "28.0.0" +version = "34.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5768a5d3c76eebfdf94c23a3fde6c832243a043d60561e5ac1a2b475b9ad09f3" +checksum = "6abf207b8db70d0ed674fac384e616a4613a93cd7f91ec7e6103c075be4b23cc" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -14331,11 +15001,11 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "18.0.1" +version = "23.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a39a20e17c24ede36b5bd5e7543a4cef8d8a0daf6e1a046dc31832b837a54a0" +checksum = "7dc993ad871b63fbba60362f3ea86583f5e7e1256e8fdcb3b5b249c9ead354bf" dependencies = [ - "array-bytes 6.2.2", + "array-bytes", "build-helper", "cargo_metadata", "console", @@ -14344,15 +15014,16 @@ dependencies = [ "merkleized-metadata", "parity-scale-codec", "parity-wasm", + "polkavm-linker", "sc-executor", "sp-core", "sp-io", "sp-maybe-compressed-blob", "sp-tracing", "sp-version", - "strum 0.24.1", + "strum 0.26.3", "tempfile", - "toml 0.8.12", + "toml 0.8.14", "walkdir", "wasm-opt", ] @@ -14365,9 +15036,9 @@ checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "subtle-ng" @@ -14388,9 +15059,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.60" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -14409,6 +15080,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -14438,9 +15120,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" [[package]] name = "tempfile" @@ -14481,9 +15163,9 @@ checksum = "3369f5ac52d5eb6ab48c6b4ffdc8efbcad6b89c765749064ba298f2c68a16a76" [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] @@ -14505,18 +15187,18 @@ checksum = "e4c60d69f36615a077cc7663b9cb8e42275722d23e58a7fa3d2c7f2915d09d04" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -14620,9 +15302,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -14635,52 +15317,52 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "pin-project-lite 0.2.14", "signal-hook-registry", - "socket2 0.5.6", + "socket2 0.5.7", "tokio-macros", "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] -name = "tokio-retry" -version = "0.3.0" +name = "tokio-rustls" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "pin-project", - "rand", + "rustls 0.21.12", "tokio", ] [[package]] name = "tokio-rustls" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.21.12", + "rustls 0.22.4", + "rustls-pki-types", "tokio", ] @@ -14696,11 +15378,26 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "tokio-tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "212d5dcb2a1ce06d81107c3d0ffa3121fe974b73f068c8282cb1c32328113b6c" +dependencies = [ + "futures-util", + "log", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", + "tokio", + "tokio-rustls 0.24.1", + "tungstenite", +] + [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -14708,7 +15405,6 @@ dependencies = [ "futures-sink", "pin-project-lite 0.2.14", "tokio", - "tracing", ] [[package]] @@ -14722,30 +15418,30 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.12", + "toml_edit 0.22.15", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.15" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap 2.2.6", "toml_datetime", @@ -14765,15 +15461,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.7", + "winnow 0.6.13", ] [[package]] @@ -14797,7 +15493,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "61c5bb1d698276a2443e5ecfabc1008bf15a36c12e6a7176e7bf089ea9131140" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bytes", "futures-core", "futures-util", @@ -14841,7 +15537,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -14866,9 +15562,9 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9690af7fe11d125786fa1b5ca802192f631b61a4411277865c8e0581c887e286" +checksum = "d07f52b2b1a1c1c21094bd0b6fdcf1b7dbe785b937b30e82dba688d55d988efb" dependencies = [ "coarsetime", "polkadot-primitives", @@ -14882,11 +15578,11 @@ version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f074568687ffdfd0adb6005aa8d1d96840197f2c159f80471285f08694cf0ce" dependencies = [ - "expander 2.1.0", + "expander", "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -14900,6 +15596,17 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + [[package]] name = "tracing-serde" version = "0.1.3" @@ -14919,8 +15626,7 @@ dependencies = [ "ansi_term", "chrono", "lazy_static", - "matchers", - "parking_lot 0.11.2", + "matchers 0.0.1", "regex", "serde", "serde_json", @@ -14929,18 +15635,36 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log", + "tracing-log 0.1.4", "tracing-serde", ] +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers 0.1.0", + "nu-ansi-term", + "once_cell", + "parking_lot 0.12.3", + "regex", + "sharded-slab", + "smallvec", + "thread_local", + "tracing", + "tracing-core", + "tracing-log 0.2.0", +] + [[package]] name = "trie-db" -version = "0.28.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" +checksum = "0c992b4f40c234a074d48a757efeabb1a6be88af84c0c23f7ca158950cb0ae7f" dependencies = [ "hash-db 0.16.0", - "hashbrown 0.13.2", "log", "rustc-hex", "smallvec", @@ -14974,14 +15698,14 @@ dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.5.1", "futures-channel", "futures-io", "futures-util", "idna 0.2.3", "ipnet", "lazy_static", - "rand", + "rand 0.8.5", "smallvec", "socket2 0.4.10", "thiserror", @@ -14991,6 +15715,31 @@ dependencies = [ "url", ] +[[package]] +name = "trust-dns-proto" +version = "0.23.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.6.0", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.4.0", + "ipnet", + "once_cell", + "rand 0.8.5", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + [[package]] name = "trust-dns-resolver" version = "0.22.0" @@ -15002,57 +15751,41 @@ dependencies = [ "ipconfig", "lazy_static", "lru-cache", - "parking_lot 0.12.2", + "parking_lot 0.12.3", "resolv-conf", "smallvec", "thiserror", "tokio", "tracing", - "trust-dns-proto", + "trust-dns-proto 0.22.0", ] [[package]] -name = "try-lock" -version = "0.2.5" +name = "trust-dns-resolver" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot 0.12.3", + "rand 0.8.5", + "resolv-conf", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto 0.23.2", +] [[package]] -name = "try-runtime-cli" -version = "0.39.0" +name = "try-lock" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9454e1af0a0be675f837d63080ef8f43510c05df8c059570622386a0cf40b548" -dependencies = [ - "async-trait", - "clap", - "frame-remote-externalities", - "frame-try-runtime", - "hex", - "log", - "parity-scale-codec", - "sc-cli", - "sc-executor", - "serde", - "serde_json", - "sp-api", - "sp-consensus-aura", - "sp-consensus-babe", - "sp-core", - "sp-debug-derive", - "sp-externalities", - "sp-inherents", - "sp-io", - "sp-keystore", - "sp-rpc", - "sp-runtime", - "sp-state-machine", - "sp-timestamp", - "sp-transaction-storage-proof", - "sp-version", - "sp-weights", - "substrate-rpc-client", - "zstd 0.12.4", -] +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tt-call" @@ -15060,6 +15793,26 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4f195fd851901624eee5a58c4bb2b4f06399148fcd0ed336e6f1cb60a9881df" +[[package]] +name = "tungstenite" +version = "0.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e3dac10fd62eaf6617d3a904ae222845979aec67c615d1c842b4002c7666fb9" +dependencies = [ + "byteorder", + "bytes", + "data-encoding", + "http", + "httparse", + "log", + "rand 0.8.5", + "rustls 0.21.12", + "sha1", + "thiserror", + "url", + "utf-8", +] + [[package]] name = "twox-hash" version = "1.6.3" @@ -15068,7 +15821,7 @@ checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" dependencies = [ "cfg-if", "digest 0.10.7", - "rand", + "rand 0.8.5", "static_assertions", ] @@ -15125,9 +15878,9 @@ checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -15142,7 +15895,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ "crypto-common", - "subtle 2.5.0", + "subtle 2.6.1", ] [[package]] @@ -15155,6 +15908,7 @@ dependencies = [ "bytes", "futures-io", "futures-util", + "tokio-util", ] [[package]] @@ -15171,20 +15925,26 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", "percent-encoding", ] +[[package]] +name = "utf-8" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" + [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "valuable" @@ -15212,9 +15972,9 @@ checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" [[package]] name = "w3f-bls" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7335e4c132c28cc43caef6adb339789e599e39adbe78da0c4d547fad48cbc331" +checksum = "9c5da5fa2c6afa2c9158eaa7cd9aee249765eb32b5fb0c63ad8b9e79336a47ec" dependencies = [ "ark-bls12-377", "ark-bls12-381", @@ -15225,7 +15985,7 @@ dependencies = [ "arrayref", "constcat", "digest 0.10.7", - "rand", + "rand 0.8.5", "rand_chacha 0.3.1", "rand_core 0.6.4", "sha2 0.10.8", @@ -15236,9 +15996,9 @@ dependencies = [ [[package]] name = "waker-fn" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3c4517f54858c779bbcbf228f4fca63d121bf85fbecb2dc578cdf4a39395690" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" [[package]] name = "walkdir" @@ -15301,7 +16061,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", "wasm-bindgen-shared", ] @@ -15335,7 +16095,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -15635,7 +16395,7 @@ dependencies = [ "memfd", "memoffset", "paste", - "rand", + "rand 0.8.5", "rustix 0.36.17", "wasmtime-asm-macros", "wasmtime-environ", @@ -15686,15 +16446,16 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2a5cebb4c678a0d1291bb21f9d44ddebceae044b0fb5200fa3bed108a31595" +checksum = "c0623e48f65c5e5368c7044cbd09c79bfc6418b258ad31892936a203b8b5509a" dependencies = [ "binary-merkle-tree", "bitvec", "frame-benchmarking", "frame-election-provider-support", "frame-executive", + "frame-metadata-hash-extension", "frame-support", "frame-system", "frame-system-benchmarking", @@ -15712,6 +16473,7 @@ dependencies = [ "pallet-beefy-mmr", "pallet-collective", "pallet-conviction-voting", + "pallet-delegated-staking", "pallet-democracy", "pallet-election-provider-multi-phase", "pallet-election-provider-support-benchmarking", @@ -15719,7 +16481,6 @@ dependencies = [ "pallet-fast-unstake", "pallet-grandpa", "pallet-identity", - "pallet-im-online", "pallet-indices", "pallet-membership", "pallet-message-queue", @@ -15789,13 +16550,14 @@ dependencies = [ "staging-xcm-executor", "substrate-wasm-builder", "westend-runtime-constants", + "xcm-fee-payment-runtime-api", ] [[package]] name = "westend-runtime-constants" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b080c193714605ce1033311d85035247adca170181cd68a3ad7e3ca87755a14" +checksum = "c68089302095f1bf7fada4ab0a42aeee1d9b56280bcab18cf6359c35cae761b7" dependencies = [ "frame-support", "polkadot-primitives", @@ -15822,9 +16584,9 @@ dependencies = [ [[package]] name = "wide" -version = "0.7.16" +version = "0.7.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a1851a719f11d1d2fea40e15c72f6c00de8c142d7ac47c1441cc7e4d0d5bc6" +checksum = "2caba658a80831539b30698ae9862a72db6697dfdd7151e46920f5f2755c3ce2" dependencies = [ "bytemuck", "safe_arch", @@ -15886,6 +16648,21 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows-sys" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -15910,7 +16687,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -15945,18 +16722,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -15973,9 +16750,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -15991,9 +16768,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -16009,15 +16786,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -16033,9 +16810,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -16051,9 +16828,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -16069,9 +16846,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -16087,9 +16864,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -16102,9 +16879,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.7" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -16145,7 +16922,7 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7e468321c81fb07fa7f4c636c3972b9100f0346e5b6a9f2bd0603a52f7ed277" dependencies = [ - "curve25519-dalek 4.1.2", + "curve25519-dalek 4.1.3", "rand_core 0.6.4", "serde", "zeroize", @@ -16169,11 +16946,28 @@ dependencies = [ "time", ] +[[package]] +name = "x509-parser" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7069fba5b66b9193bd2c5d3d4ff12b839118f6bcbef5328efafafb5395cf63da" +dependencies = [ + "asn1-rs", + "data-encoding", + "der-parser", + "lazy_static", + "nom", + "oid-registry", + "rusticata-macros", + "thiserror", + "time", +] + [[package]] name = "xcm-emulator" -version = "0.6.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b49681988880dd6d08a4d5f6b7cb612a0f12172270349655c1e2f870b3526fd" +checksum = "4fec574213c6c373641128fdea17886fb8a9ae5e3a5f25f80371ffd304dfa080" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", @@ -16204,31 +16998,51 @@ dependencies = [ "staging-xcm-executor", ] +[[package]] +name = "xcm-fee-payment-runtime-api" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d4261279994b1cb0d16a77cc12734fca18b88b56b65b8740de543af6d6a17dc" +dependencies = [ + "frame-support", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-runtime", + "sp-std", + "sp-weights", + "staging-xcm", +] + [[package]] name = "xcm-procedural" -version = "8.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" +checksum = "e0fd01495dfeb643167557631b34b54d312c1e70cf7eb64249ab687d84fd6045" dependencies = [ "Inflector", "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "xcm-simulator" -version = "8.0.0" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c65d85900081973f0c2cf0aad76e61f2d2560ea57ee2c7c886a68a0e4cf81c8a" +checksum = "39573710887ad79cec060cbb87bb6ea10cf79089b6aa733fc2b6e51762ae9397" dependencies = [ "frame-support", + "frame-system", "parity-scale-codec", "paste", "polkadot-core-primitives", "polkadot-parachain-primitives", + "polkadot-primitives", "polkadot-runtime-parachains", + "scale-info", "sp-io", + "sp-runtime", "sp-std", "staging-xcm", "staging-xcm-builder", @@ -16244,8 +17058,8 @@ dependencies = [ "futures 0.3.30", "log", "nohash-hasher", - "parking_lot 0.12.2", - "rand", + "parking_lot 0.12.3", + "rand 0.8.5", "static_assertions", ] @@ -16261,7 +17075,7 @@ dependencies = [ [[package]] name = "zenlink-protocol" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -16283,7 +17097,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-rpc" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16299,7 +17113,7 @@ dependencies = [ [[package]] name = "zenlink-protocol-runtime-api" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" dependencies = [ "parity-scale-codec", "sp-api", @@ -16310,7 +17124,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" dependencies = [ "frame-support", "frame-system", @@ -16327,7 +17141,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm-rpc" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -16341,7 +17155,7 @@ dependencies = [ [[package]] name = "zenlink-stable-amm-runtime-api" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" dependencies = [ "parity-scale-codec", "sp-api", @@ -16352,7 +17166,7 @@ dependencies = [ [[package]] name = "zenlink-swap-router" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.7.0#c9528ec121fe1c19dd6a790d7ad24abad7fd95fa" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" dependencies = [ "frame-support", "frame-system", @@ -16370,29 +17184,29 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" dependencies = [ "zeroize_derive", ] @@ -16405,7 +17219,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.60", + "syn 2.0.71", ] [[package]] @@ -16448,9 +17262,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.12+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index 90fdcc80a..21a49140d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -95,182 +95,182 @@ lend-market-rpc-runtime-api = { path = "pallets/lend-market/rpc/runtime pallet-prices = { path = "pallets/prices", default-features = false } pallet-traits = { path = "pallets/traits", default-features = false } leverage-staking = { path = "pallets/leverage-staking", default-features = false } -bifrost-channel-commission = { path = "pallets/channel-commission", default-features = false } -bifrost-clouds-convert = { path = "pallets/clouds-convert", default-features = false } +bifrost-channel-commission = { path = "pallets/channel-commission", default-features = false } +bifrost-clouds-convert = { path = "pallets/clouds-convert", default-features = false } bifrost-vtoken-minting-rpc-runtime-api = { path = "pallets/vtoken-minting/rpc/runtime-api", default-features = false } # Zenlink -merkle-distributor = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-protocol = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-protocol-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0" } -zenlink-protocol-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-stable-amm = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-stable-amm-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0" } -zenlink-stable-amm-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } -zenlink-swap-router = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.7.0", default-features = false } +merkle-distributor = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-protocol = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-protocol-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0" } +zenlink-protocol-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-stable-amm = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-stable-amm-rpc = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0" } +zenlink-stable-amm-runtime-api = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } +zenlink-swap-router = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } # Orml -orml-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-traits = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-unknown-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-utilities = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-xcm = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-xcm-support = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-xtokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } -orml-oracle = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.7.0", default-features = false } +orml-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-traits = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-unknown-tokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-utilities = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-xcm = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-xcm-support = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-xtokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +orml-oracle = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } # polkadot-sdk (wasm) -cumulus-client-collator = { version = "0.8.0", default-features = false } -cumulus-client-consensus-proposer = { version = "0.8.0", default-features = false } -cumulus-pallet-aura-ext = { version = "0.8.0", default-features = false } -cumulus-pallet-parachain-system = { version = "0.8.0", default-features = false, features = ["parameterized-consensus-hook"] } -cumulus-pallet-xcm = { version = "0.8.0", default-features = false } -cumulus-pallet-xcmp-queue = { version = "0.8.0", default-features = false } -cumulus-primitives-core = { version = "0.8.0", default-features = false } -cumulus-primitives-parachain-inherent = { version = "0.8.0", default-features = false } -cumulus-primitives-timestamp = { version = "0.8.0", default-features = false } -cumulus-primitives-utility = { version = "0.8.0", default-features = false } -cumulus-test-relay-sproof-builder = { version = "0.8.0", default-features = false } -frame-benchmarking = { version = "29.0.0", default-features = false } -frame-executive = { version = "29.0.0", default-features = false } -frame-metadata-hash-extension = { version = "0.1.0", default-features = false } -frame-support = { version = "29.0.0", default-features = false } -frame-system = { version = "29.0.0", default-features = false } -frame-system-benchmarking = { version = "29.0.0", default-features = false } -frame-system-rpc-runtime-api = { version = "27.0.0", default-features = false } -frame-try-runtime = { version = "0.35.0", default-features = false } -pallet-assets = { version = "30.0.0", default-features = false } -pallet-asset-rate = { version = "8.0.0", default-features = false } -pallet-aura = { version = "28.0.0", default-features = false } -pallet-authority-discovery = { version = "29.0.0", default-features = false } -pallet-authorship = { version = "29.0.0", default-features = false } -pallet-balances = { version = "29.0.0", default-features = false } -pallet-bounties = { version = "28.0.0", default-features = false } -pallet-collator-selection = { version = "10.0.0", default-features = false } -pallet-collective = { version = "29.0.0", default-features = false } -pallet-conviction-voting = { version = "29.0.0", default-features = false } -pallet-democracy = { version = "29.0.0", default-features = false } -pallet-elections-phragmen = { version = "30.0.0", default-features = false } -pallet-identity = { version = "29.0.0", default-features = false } -pallet-im-online = { version = "28.0.0", default-features = false } -pallet-indices = { version = "29.0.0", default-features = false } -pallet-membership = { version = "29.0.0", default-features = false } -pallet-message-queue = { version = "32.0.0", default-features = false } -pallet-multisig = { version = "29.0.0", default-features = false } -pallet-preimage = { version = "29.0.0", default-features = false } -pallet-proxy = { version = "29.0.0", default-features = false } -pallet-ranked-collective = { version = "29.0.0", default-features = false } -pallet-recovery = { version = "29.0.0", default-features = false } -pallet-referenda = { version = "29.0.0", default-features = false } -pallet-scheduler = { version = "30.0.0", default-features = false } -pallet-session = { version = "29.0.0", default-features = false } -pallet-staking = { version = "29.0.0", default-features = false } -pallet-sudo = { version = "29.0.0", default-features = false } -pallet-timestamp = { version = "28.0.0", default-features = false } -pallet-tips = { version = "28.0.0", default-features = false } -pallet-tx-pause = { version = "10.0.0", default-features = false } -pallet-transaction-payment = { version = "29.0.0", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { version = "29.0.0", default-features = false } -pallet-treasury = { version = "28.0.0", default-features = false } -pallet-utility = { version = "29.0.0", default-features = false } -pallet-whitelist = { version = "28.0.0", default-features = false } -pallet-xcm = { version = "8.0.0", default-features = false } -parachains-common = { version = "8.0.0", default-features = false } -parachain-info = { version = "0.8.0", package = "staging-parachain-info", default-features = false } -polkadot-core-primitives = { version = "8.0.0", default-features = false } -polkadot-parachain-primitives = { version = "7.0.0", default-features = false } -polkadot-primitives = { version = "8.0.0", default-features = false } -polkadot-runtime-common = { version = "8.0.0", default-features = false } -polkadot-runtime-parachains = { version = "8.0.0", default-features = false } -sp-api = { version = "27.0.1", default-features = false } -sp-application-crypto = { version = "31.0.0", default-features = false } -sp-arithmetic = { version = "24.0.0", default-features = false } -sp-authority-discovery = { version = "27.0.0", default-features = false } -sp-block-builder = { version = "27.0.0", default-features = false } -sp-blockchain = { version = "29.0.0", default-features = false } -sp-consensus = { version = "0.33.0", default-features = false } -sp-consensus-aura = { version = "0.33.0", default-features = false } -sp-consensus-slots = { version = "0.33.0", default-features = false } -sp-core = { version = "29.0.0", default-features = false } +cumulus-client-collator = { version = "0.14.0", default-features = false } +cumulus-client-consensus-proposer = { version = "0.14.0", default-features = false } +cumulus-pallet-aura-ext = { version = "0.14.0", default-features = false } +cumulus-pallet-parachain-system = { version = "0.14.0", default-features = false } +cumulus-pallet-xcm = { version = "0.14.0", default-features = false } +cumulus-pallet-xcmp-queue = { version = "0.14.0", default-features = false } +cumulus-primitives-core = { version = "0.14.0", default-features = false } +cumulus-primitives-parachain-inherent = { version = "0.14.0", default-features = false } +cumulus-primitives-timestamp = { version = "0.14.0", default-features = false } +cumulus-primitives-utility = { version = "0.14.0", default-features = false } +cumulus-test-relay-sproof-builder = { version = "0.14.0", default-features = false } +frame-benchmarking = { version = "35.0.0", default-features = false } +frame-executive = { version = "35.0.0", default-features = false } +frame-metadata-hash-extension = { version = "0.3.0", default-features = false } +frame-support = { version = "35.0.0", default-features = false } +frame-system = { version = "35.0.0", default-features = false } +frame-system-benchmarking = { version = "35.0.0", default-features = false } +frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false } +frame-try-runtime = { version = "0.41.0", default-features = false } +pallet-assets = { version = "36.0.0", default-features = false } +pallet-asset-rate = { version = "14.0.0", default-features = false } +pallet-aura = { version = "34.0.0", default-features = false } +pallet-authority-discovery = { version = "35.0.0", default-features = false } +pallet-authorship = { version = "35.0.0", default-features = false } +pallet-balances = { version = "36.0.0", default-features = false } +pallet-bounties = { version = "34.0.0", default-features = false } +pallet-collator-selection = { version = "16.0.0", default-features = false } +pallet-collective = { version = "35.0.0", default-features = false } +pallet-conviction-voting = { version = "35.0.0", default-features = false } +pallet-democracy = { version = "35.0.0", default-features = false } +pallet-elections-phragmen = { version = "36.0.0", default-features = false } +pallet-identity = { version = "35.0.0", default-features = false } +pallet-im-online = { version = "34.0.0", default-features = false } +pallet-indices = { version = "35.0.0", default-features = false } +pallet-membership = { version = "35.0.0", default-features = false } +pallet-message-queue = { version = "38.0.0", default-features = false } +pallet-multisig = { version = "35.0.0", default-features = false } +pallet-preimage = { version = "35.0.0", default-features = false } +pallet-proxy = { version = "35.0.0", default-features = false } +pallet-ranked-collective = { version = "35.0.0", default-features = false } +pallet-recovery = { version = "35.0.0", default-features = false } +pallet-referenda = { version = "35.0.0", default-features = false } +pallet-scheduler = { version = "36.0.0", default-features = false } +pallet-session = { version = "35.0.0", default-features = false } +pallet-staking = { version = "35.0.0", default-features = false } +pallet-sudo = { version = "35.0.0", default-features = false } +pallet-timestamp = { version = "34.0.0", default-features = false } +pallet-tips = { version = "34.0.0", default-features = false } +pallet-tx-pause = { version = "16.0.0", default-features = false } +pallet-transaction-payment = { version = "35.0.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { version = "35.0.0", default-features = false } +pallet-treasury = { version = "34.0.0", default-features = false } +pallet-utility = { version = "35.0.0", default-features = false } +pallet-whitelist = { version = "34.0.0", default-features = false } +pallet-xcm = { version = "14.0.0", default-features = false } +parachains-common = { version = "14.0.0", default-features = false } +parachain-info = { version = "0.14.0", package = "staging-parachain-info", default-features = false } +polkadot-core-primitives = { version = "14.0.0", default-features = false } +polkadot-parachain-primitives = { version = "13.0.0", default-features = false } +polkadot-primitives = { version = "14.0.0", default-features = false } +polkadot-runtime-common = { version = "14.0.0", default-features = false } +polkadot-runtime-parachains = { version = "14.0.0", default-features = false } +sp-api = { version = "33.0.0", default-features = false } +sp-application-crypto = { version = "37.0.0", default-features = false } +sp-arithmetic = { version = "26.0.0", default-features = false } +sp-authority-discovery = { version = "33.0.0", default-features = false } +sp-block-builder = { version = "33.0.0", default-features = false } +sp-blockchain = { version = "35.0.0", default-features = false } +sp-consensus = { version = "0.39.0", default-features = false } +sp-consensus-aura = { version = "0.39.0", default-features = false } +sp-consensus-slots = { version = "0.39.0", default-features = false } +sp-core = { version = "34.0.0", default-features = false } sp-debug-derive = { version = "14.0.0", default-features = false } -sp-externalities = { version = "0.26.0", default-features = false } -sp-genesis-builder = { version = "0.8.0", default-features = false } -sp-inherents = { version = "27.0.0", default-features = false } -sp-io = { version = "31.0.0", default-features = false } -sp-keyring = { version = "32.0.0", default-features = false } -sp-keystore = { version = "0.35.0", default-features = false } +sp-externalities = { version = "0.29.0", default-features = false } +sp-genesis-builder = { version = "0.14.0", default-features = false } +sp-inherents = { version = "33.0.0", default-features = false } +sp-io = { version = "37.0.0", default-features = false } +sp-keyring = { version = "38.0.0", default-features = false } +sp-keystore = { version = "0.40.0", default-features = false } sp-maybe-compressed-blob = { version = "11.0.0", default-features = false } -sp-npos-elections = { version = "27.0.0", default-features = false } -sp-offchain = { version = "27.0.0", default-features = false } -sp-runtime = { version = "32.0.0", default-features = false } -sp-runtime-interface = { version = "25.0.0", default-features = false } -sp-session = { version = "28.0.0", default-features = false } -sp-staking = { version = "27.0.0", default-features = false } -sp-state-machine = { version = "0.36.0", default-features = false } +sp-npos-elections = { version = "33.0.0", default-features = false } +sp-offchain = { version = "33.0.0", default-features = false } +sp-runtime = { version = "38.0.0", default-features = false } +sp-runtime-interface = { version = "28.0.0", default-features = false } +sp-session = { version = "34.0.0", default-features = false } +sp-staking = { version = "33.0.0", default-features = false } +sp-state-machine = { version = "0.42.0", default-features = false } sp-std = { version = "14.0.0", default-features = false } -sp-storage = { version = "20.0.0", default-features = false } -sp-timestamp = { version = "27.0.0", default-features = false } -sp-tracing = { version = "16.0.0", default-features = false } -sp-transaction-pool = { version = "27.0.0", default-features = false } -sp-trie = { version = "30.0.0", default-features = false } -sp-version = { version = "30.0.0", default-features = false } -sp-wasm-interface = { version = "20.0.0", default-features = false } -sp-weights = { version = "28.0.0", default-features = false } -substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } -xcm = { version = "8.0.0", package = "staging-xcm", default-features = false } -xcm-builder = { version = "8.0.0", package = "staging-xcm-builder", default-features = false } -xcm-executor = { version = "8.0.1", package = "staging-xcm-executor", default-features = false } +sp-storage = { version = "21.0.0", default-features = false } +sp-timestamp = { version = "33.0.0", default-features = false } +sp-tracing = { version = "17.0.0", default-features = false } +sp-transaction-pool = { version = "33.0.0", default-features = false } +sp-trie = { version = "36.0.0", default-features = false } +sp-version = { version = "36.0.0", default-features = false } +sp-wasm-interface = { version = "21.0.0", default-features = false } +sp-weights = { version = "31.0.0", default-features = false } +substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } +xcm = { version = "14.0.0", package = "staging-xcm", default-features = false } +xcm-builder = { version = "14.0.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { version = "14.0.0", package = "staging-xcm-executor", default-features = false } # polkadot-sdk (client) -cumulus-client-cli = { version = "0.8.0" } -cumulus-client-consensus-aura = { version = "0.8.0" } -cumulus-client-consensus-common = { version = "0.8.0" } -cumulus-client-consensus-relay-chain = { version = "0.8.0" } -cumulus-client-network = { version = "0.8.0" } -cumulus-client-pov-recovery = { version = "0.8.0" } -cumulus-client-service = { version = "0.8.0" } -cumulus-relay-chain-inprocess-interface = { version = "0.8.0" } -cumulus-relay-chain-interface = { version = "0.8.0" } -cumulus-relay-chain-minimal-node = { version = "0.8.0" } -cumulus-relay-chain-rpc-interface = { version = "0.8.0" } -frame-benchmarking-cli = { version = "33.0.0" } -node-inspect = { version = "0.13.0", package = "staging-node-inspect" } -pallet-transaction-payment-rpc = { version = "31.0.0" } -polkadot-cli = { version = "8.0.0" } -polkadot-service = { version = "8.0.0" } -sc-basic-authorship = { version = "0.35.0" } -sc-chain-spec = { version = "28.0.0" } -sc-cli = { version = "0.37.0" } -sc-client-api = { version = "29.0.0" } -sc-consensus = { version = "0.34.0" } -sc-consensus-aura = { version = "0.35.0" } -sc-consensus-grandpa = { version = "0.20.0" } -sc-consensus-manual-seal = { version = "0.36.0" } -sc-consensus-slots = { version = "0.34.0" } -sc-executor = { version = "0.33.0" } -sc-keystore = { version = "26.0.0" } -sc-network = { version = "0.35.0" } -sc-network-common = { version = "0.34.0" } -sc-network-sync = { version = "0.34.0" } -sc-offchain = { version = "30.0.0" } -sc-rpc = { version = "30.0.0" } -sc-rpc-api = { version = "0.34.0" } -sc-rpc-server = { version = "12.0.0" } -sc-service = { version = "0.36.0" } -sc-sysinfo = { version = "28.0.0" } -sc-telemetry = { version = "16.0.0" } -sc-tracing = { version = "29.0.0" } -sc-transaction-pool = { version = "29.0.0" } -sc-transaction-pool-api = { version = "29.0.0" } -sp-consensus-babe = { version = "0.33.0" } -sp-rpc = { version = "27.0.0" } +cumulus-client-cli = { version = "0.14.0" } +cumulus-client-consensus-aura = { version = "0.14.0" } +cumulus-client-consensus-common = { version = "0.14.0" } +cumulus-client-consensus-relay-chain = { version = "0.14.0" } +cumulus-client-network = { version = "0.14.0" } +cumulus-client-pov-recovery = { version = "0.14.0" } +cumulus-client-service = { version = "0.14.0" } +cumulus-relay-chain-inprocess-interface = { version = "0.14.0" } +cumulus-relay-chain-interface = { version = "0.14.0" } +cumulus-relay-chain-minimal-node = { version = "0.14.0" } +cumulus-relay-chain-rpc-interface = { version = "0.14.0" } +frame-benchmarking-cli = { version = "39.0.0" } +node-inspect = { version = "0.19.0", package = "staging-node-inspect" } +pallet-transaction-payment-rpc = { version = "37.0.0" } +polkadot-cli = { version = "14.0.0" } +polkadot-service = { version = "14.0.0" } +sc-basic-authorship = { version = "0.41.0" } +sc-chain-spec = { version = "34.0.0" } +sc-cli = { version = "0.43.0" } +sc-client-api = { version = "35.0.0" } +sc-consensus = { version = "0.40.0" } +sc-consensus-aura = { version = "0.41.0" } +sc-consensus-grandpa = { version = "0.26.0" } +sc-consensus-manual-seal = { version = "0.42.0" } +sc-consensus-slots = { version = "0.40.0" } +sc-executor = { version = "0.39.0" } +sc-keystore = { version = "32.0.0" } +sc-network = { version = "0.41.0" } +sc-network-common = { version = "0.40.0" } +sc-network-sync = { version = "0.40.0" } +sc-offchain = { version = "36.0.0" } +sc-rpc = { version = "36.0.0" } +sc-rpc-api = { version = "0.40.0" } +sc-rpc-server = { version = "16.0.1" } +sc-service = { version = "0.42.0" } +sc-sysinfo = { version = "34.0.0" } +sc-telemetry = { version = "21.0.0" } +sc-tracing = { version = "35.0.0" } +sc-transaction-pool = { version = "35.0.0" } +sc-transaction-pool-api = { version = "35.0.0" } +sp-consensus-babe = { version = "0.39.0" } +sp-rpc = { version = "32.0.0" } substrate-build-script-utils = { version = "11.0.0" } -substrate-frame-rpc-system = { version = "29.0.0" } +substrate-frame-rpc-system = { version = "35.0.0" } substrate-prometheus-endpoint = { version = "0.17.0" } -substrate-wasm-builder = { version = "18.0.1" } +substrate-wasm-builder = { version = "23.0.0" } try-runtime-cli = { version = "0.39.0" } -xcm-emulator = { version = "0.6.0" } -xcm-simulator = { version = "8.0.0" } +xcm-emulator = { version = "0.12.0" } +xcm-simulator = { version = "14.0.0" } # Other async-trait = { version = "0.1.76" } @@ -283,7 +283,7 @@ futures = { version = "0.3.30" } hex = { version = "0.4.3", default-features = false } hex-literal = { version = "0.4.1" } impl-trait-for-tuples = { version = "0.2.2" } -jsonrpsee = { version = "0.20.3" } +jsonrpsee = { version = "0.22.5" } log = { version = "0.4.22", default-features = false } num-bigint = { version = "0.4.6", default-features = false } num-traits = { version = "0.2.19", default-features = false } diff --git a/Dockerfile b/Dockerfile index 23737c9f9..bed52bf54 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,8 @@ FROM rust:buster as builder RUN apt-get update && apt-get install time cmake clang libclang-dev llvm protobuf-compiler -y -RUN rustup toolchain install 1.74.0 -RUN rustup target add wasm32-unknown-unknown --toolchain 1.74.0 +RUN rustup toolchain install 1.77.0 +RUN rustup target add wasm32-unknown-unknown --toolchain 1.77.0 WORKDIR /app COPY . /app diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 4f1942630..334332f4b 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -13,6 +13,7 @@ bifrost-runtime-common = { workspace = true } bifrost-slp = { workspace = true } bifrost-vtoken-voting = { workspace = true } bifrost-xcm-interface = { workspace = true } +cumulus-pallet-parachain-system = { workspace = true } cumulus-primitives-core = { workspace = true } env_logger = { workspace = true } frame-support = { workspace = true } diff --git a/integration-tests/src/mock/bifrost.rs b/integration-tests/src/mock/bifrost.rs index b76157e29..5a116eba1 100644 --- a/integration-tests/src/mock/bifrost.rs +++ b/integration-tests/src/mock/bifrost.rs @@ -192,6 +192,10 @@ impl Config for XcmConfig { type SafeCallFilter = Everything; type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } impl mock_message_queue::Config for Runtime { diff --git a/integration-tests/src/mock/relaychain.rs b/integration-tests/src/mock/relaychain.rs index 6772a2580..7ae78ad3f 100644 --- a/integration-tests/src/mock/relaychain.rs +++ b/integration-tests/src/mock/relaychain.rs @@ -16,6 +16,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . +use bifrost_polkadot_runtime::{ + xcm_config, BlockHashCount, Hash, Nonce, ReservedDmpWeight, ReservedXcmpWeight, + RuntimeBlockLength, RuntimeBlockWeights, SS58Prefix, Version, XcmpQueue, +}; +use cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases; use cumulus_primitives_core::ParaId; use frame_support::{ construct_runtime, derive_impl, parameter_types, @@ -47,6 +52,39 @@ impl frame_system::Config for Runtime { type Lookup = IdentityLookup; type Block = Block; type AccountData = pallet_balances::AccountData; + + /// The index type for storing how many extrinsics an account has signed. + type Nonce = Nonce; + /// The type for hashing blocks and tries. + type Hash = Hash; + /// Maximum number of block number to block hash mappings to keep (oldest pruned first). + type BlockHashCount = BlockHashCount; + /// Runtime version. + type Version = Version; + type BlockWeights = RuntimeBlockWeights; + type BlockLength = RuntimeBlockLength; + type SS58Prefix = SS58Prefix; + type OnSetCode = cumulus_pallet_parachain_system::ParachainSetCode; + type MaxConsumers = frame_support::traits::ConstU32<16>; +} + +impl cumulus_pallet_parachain_system::Config for Runtime { + type DmpQueue = frame_support::traits::EnqueueWithOrigin< + bifrost_polkadot_runtime::MessageQueue, + xcm_config::RelayOrigin, + >; + type RuntimeEvent = RuntimeEvent; + type OnSystemEvent = (); + type OutboundXcmpMessageSource = XcmpQueue; + type ReservedDmpWeight = ReservedDmpWeight; + type ReservedXcmpWeight = ReservedXcmpWeight; + type SelfParaId = parachain_info::Pallet; + type XcmpMessageHandler = XcmpQueue; + type CheckAssociatedRelayNumber = RelayNumberStrictlyIncreases; + type ConsensusHook = cumulus_pallet_parachain_system::ExpectParentIncluded; + type WeightInfo = cumulus_pallet_parachain_system::weights::SubstrateWeight< + bifrost_polkadot_runtime::Runtime, + >; } impl pallet_balances::Config for Runtime { @@ -136,6 +174,10 @@ impl Config for XcmConfig { type SafeCallFilter = Everything; type Aliasers = (); type TransactionalProcessor = (); + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } pub type LocalOriginToLocation = SignedToAccountId32; @@ -173,6 +215,7 @@ type Block = frame_system::mocking::MockBlock; parameter_types! { pub MessageQueueServiceWeight: Weight = Weight::from_parts(1_000_000_000, 1_000_000); + pub MessageQueueIdleServiceWeight: Weight = Weight::from_parts(1_000_000_000, 1_000_000); pub const MessageQueueHeapSize: u32 = 65_536; pub const MessageQueueMaxStale: u32 = 16; } @@ -209,6 +252,7 @@ impl pallet_message_queue::Config for Runtime { type QueueChangeHandler = (); type QueuePausedQuery = (); type WeightInfo = (); + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } construct_runtime!( @@ -218,5 +262,6 @@ construct_runtime!( ParasOrigin: origin, MessageQueue: pallet_message_queue, XcmPallet: pallet_xcm, + ParachainSystem: cumulus_pallet_parachain_system, } ); diff --git a/integration-tests/src/tests/slp.rs b/integration-tests/src/tests/slp.rs index 433a18dea..799aa9e7d 100644 --- a/integration-tests/src/tests/slp.rs +++ b/integration-tests/src/tests/slp.rs @@ -59,7 +59,7 @@ fn cross_dot_to_bifrost(to: AccountId32, amount: u128) { 100_000_000_000, ); let _ = RelayBalances::deposit_creating(&to, amount); - assert_ok!(RelayXcmPallet::reserve_transfer_assets( + assert_ok!(RelayXcmPallet::limited_reserve_transfer_assets( Some(to.clone()).into(), Box::new(VersionedLocation::V4(Parachain(2030).into())), Box::new(VersionedLocation::V4( @@ -67,6 +67,7 @@ fn cross_dot_to_bifrost(to: AccountId32, amount: u128) { )), Box::new(VersionedAssets::V4((Here, amount / 10).into())), 0, + Unlimited )); }); } diff --git a/node/cli/Cargo.toml b/node/cli/Cargo.toml index c165010b1..299baeac0 100644 --- a/node/cli/Cargo.toml +++ b/node/cli/Cargo.toml @@ -33,6 +33,7 @@ sc-sysinfo = { workspace = true } sc-telemetry = { workspace = true } sc-tracing = { workspace = true } sc-offchain = { workspace = true } +sc-network = { workspace = true } # node-specific dependencies bifrost-service = { workspace = true } @@ -40,7 +41,6 @@ bifrost-primitives = { workspace = true } # CLI-specific dependencies sc-cli = { workspace = true, optional = true } -try-runtime-cli = { workspace = true, optional = true } frame-try-runtime = { workspace = true, optional = true } frame-benchmarking-cli = { workspace = true, optional = true } node-inspect = { workspace = true, optional = true } @@ -64,7 +64,6 @@ cli = [ "node-inspect", "sc-cli", "frame-benchmarking-cli", - 'try-runtime-cli', "sc-service", "substrate-build-script-utils", ] @@ -76,5 +75,5 @@ with-bifrost-runtime = [ with-bifrost-kusama-runtime = ["bifrost-service/with-bifrost-kusama-runtime"] with-bifrost-polkadot-runtime = ["bifrost-service/with-bifrost-polkadot-runtime"] with-all-runtime = ["with-bifrost-runtime"] -try-runtime = ["bifrost-service/try-runtime", "try-runtime-cli/try-runtime"] +try-runtime = ["bifrost-service/try-runtime"] fast-runtime = ["bifrost-service/fast-runtime"] \ No newline at end of file diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index 2eefaf7aa..ae6d07d2a 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -17,6 +17,7 @@ // along with this program. If not, see . use bifrost_service::{self as service, IdentifyVariant}; +use cumulus_client_service::storage_proof_size::HostFunctions as ReclaimHostFunctions; use cumulus_primitives_core::ParaId; use frame_benchmarking_cli::{BenchmarkCmd, SUBSTRATE_REFERENCE_HARDWARE}; use log::info; @@ -25,7 +26,7 @@ use sc_cli::{ NetworkParams, Result, SharedParams, SubstrateCli, }; use sc_service::config::{BasePath, PrometheusConfig}; -use sp_runtime::traits::AccountIdConversion; +use sp_runtime::traits::{AccountIdConversion, HashingFor}; use crate::{Cli, RelayChainCli, Subcommand}; @@ -362,7 +363,11 @@ pub fn run() -> Result<()> { BenchmarkCmd::Pallet(cmd) => if cfg!(feature = "runtime-benchmarks") { with_runtime_or_err!(chain_spec, { - return runner.sync_run(|config| cmd.run::(config)); + return runner.sync_run(|config| { + cmd.run_with_spec::, ReclaimHostFunctions>(Some( + config.chain_spec, + )) + }); }) } else { Err("Benchmarking wasn't enabled when building the node. \ @@ -447,10 +452,16 @@ pub fn run() -> Result<()> { with_runtime_or_err!(config.chain_spec, { { - start_node(config, polkadot_config, collator_options, id, hwbench) - .await - .map(|r| r.0) - .map_err(Into::into) + start_node::>( + config, + polkadot_config, + collator_options, + id, + hwbench, + ) + .await + .map(|r| r.0) + .map_err(Into::into) } }) }) diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index bf69260c2..737a6cdaa 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -34,9 +34,9 @@ lend-market-rpc = { workspace = true } lend-market-rpc-runtime-api = { workspace = true } zenlink-protocol = { workspace = true } zenlink-protocol-rpc = { workspace = true } -zenlink-protocol-runtime-api = { workspace = true } +zenlink-protocol-runtime-api = { workspace = true, features = ["std"] } zenlink-stable-amm-rpc = { workspace = true } -zenlink-stable-amm-runtime-api = { workspace = true } +zenlink-stable-amm-runtime-api = { workspace = true, features = ["std"] } bifrost-vtoken-minting-rpc = { workspace = true } -bifrost-vtoken-minting-rpc-runtime-api = { workspace = true } +bifrost-vtoken-minting-rpc-runtime-api = { workspace = true, features = ["std"] } diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 0fef634c8..33d0d17df 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -26,7 +26,7 @@ //! //! The RPCs available in this crate however can make some assumptions //! about how the runtime is constructed and what FRAME pallets -//! are part of it. Therefore all node-runtime-specific RPCs can +//! are part of it. Therefore, all node-runtime-specific RPCs can //! be placed here or imported from corresponding FRAME RPC definitions. #![warn(missing_docs)] diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index 5d0572e79..ab3999ade 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -57,7 +57,6 @@ pallet-transaction-payment-rpc = { workspace = true } frame-system-rpc-runtime-api = { workspace = true } substrate-prometheus-endpoint = { workspace = true } substrate-frame-rpc-system = { workspace = true } -try-runtime-cli = { workspace = true, optional = true } pallet-transaction-payment-rpc-runtime-api = { workspace = true } # Cumulus dependencies @@ -137,4 +136,4 @@ try-runtime = [ fast-runtime = [ "bifrost-kusama-runtime/fast-runtime", "bifrost-polkadot-runtime/fast-runtime", -] +] \ No newline at end of file diff --git a/node/service/src/chain_spec/bifrost_kusama.rs b/node/service/src/chain_spec/bifrost_kusama.rs index a0561d014..5f79fa2c2 100644 --- a/node/service/src/chain_spec/bifrost_kusama.rs +++ b/node/service/src/chain_spec/bifrost_kusama.rs @@ -18,7 +18,7 @@ use bifrost_kusama_runtime::{ constants::currency::DOLLARS, AccountId, Balance, BalancesConfig, BlockNumber, - DefaultBlocksPerRound, InflationInfo, Range, RuntimeGenesisConfig, SS58Prefix, VestingConfig, + DefaultBlocksPerRound, InflationInfo, Range, SS58Prefix, VestingConfig, }; use bifrost_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol::*}; use bifrost_runtime_common::AuraId; @@ -42,7 +42,7 @@ use crate::chain_spec::{get_account_id_from_seed, get_from_seed, RelayExtensions const DEFAULT_PROTOCOL_ID: &str = "bifrost"; /// Specialized `ChainSpec` for the bifrost runtime. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; #[allow(non_snake_case)] pub fn ENDOWMENT() -> u128 { diff --git a/node/service/src/chain_spec/bifrost_polkadot.rs b/node/service/src/chain_spec/bifrost_polkadot.rs index b500f9f54..2f7ec46a2 100644 --- a/node/service/src/chain_spec/bifrost_polkadot.rs +++ b/node/service/src/chain_spec/bifrost_polkadot.rs @@ -18,7 +18,7 @@ use crate::chain_spec::{get_account_id_from_seed, get_from_seed, RelayExtensions}; use bifrost_polkadot_runtime::{ - constants::currency::DOLLARS, AccountId, Balance, BlockNumber, RuntimeGenesisConfig, SS58Prefix, + constants::currency::DOLLARS, AccountId, Balance, BlockNumber, SS58Prefix, }; use bifrost_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol, DOT_TOKEN_ID}; use bifrost_runtime_common::AuraId; @@ -32,7 +32,7 @@ use sp_core::{crypto::UncheckedInto, sr25519}; const DEFAULT_PROTOCOL_ID: &str = "bifrost_polkadot"; /// Specialized `ChainSpec` for the bifrost-polkadot runtime. -pub type ChainSpec = sc_service::GenericChainSpec; +pub type ChainSpec = sc_service::GenericChainSpec; #[allow(non_snake_case)] pub fn ENDOWMENT() -> u128 { diff --git a/node/service/src/collator_kusama.rs b/node/service/src/collator_kusama.rs index 106cbae10..46013eb56 100644 --- a/node/service/src/collator_kusama.rs +++ b/node/service/src/collator_kusama.rs @@ -42,7 +42,7 @@ use polkadot_primitives::CollatorPair; use sc_client_api::backend::Backend; use sc_consensus::{ImportQueue, LongestChain}; use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; -use sc_network::NetworkBlock; +use sc_network::{service::traits::NetworkBackend, NetworkBlock}; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; @@ -210,8 +210,6 @@ fn start_consensus( overseer_handle: OverseerHandle, announce_block: Arc>) + Send + Sync>, ) -> Result<(), sc_service::Error> { - let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; - let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), @@ -239,7 +237,6 @@ fn start_consensus( collator_key, para_id, overseer_handle, - slot_duration, relay_chain_slot_duration, proposer, collator_service, @@ -263,14 +260,17 @@ fn start_consensus( /// This is the actual implementation that is abstract over the executor and the /// runtime api. #[sc_tracing::logging::prefix_logs_with("Parachain🌈")] -async fn start_node_impl( +async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, sybil_resistance_level: CollatorSybilResistance, para_id: ParaId, hwbench: Option, -) -> sc_service::error::Result<(TaskManager, Arc)> { +) -> sc_service::error::Result<(TaskManager, Arc)> +where + Net: NetworkBackend, +{ let parachain_config = prepare_node_config(parachain_config); let params = new_partial(¶chain_config, false)?; @@ -295,7 +295,8 @@ async fn start_node_impl( let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue_service = params.import_queue.service(); - let net_config = sc_network::config::FullNetworkConfiguration::new(¶chain_config.network); + let net_config = + sc_network::config::FullNetworkConfiguration::<_, _, Net>::new(¶chain_config.network); let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = build_network(BuildNetworkParams { parachain_config: ¶chain_config, @@ -323,7 +324,7 @@ async fn start_node_impl( transaction_pool: Some(OffchainTransactionPoolFactory::new( transaction_pool.clone(), )), - network_provider: network.clone(), + network_provider: Arc::new(network.clone()), is_validator: parachain_config.role.is_authority(), enable_http_requests: false, custom_extensions: move |_| vec![], @@ -428,14 +429,14 @@ async fn start_node_impl( } /// Start a normal parachain node. -pub async fn start_node( +pub async fn start_node>( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, para_id: ParaId, hwbench: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { - start_node_impl( + start_node_impl::( parachain_config, polkadot_config, collator_options, diff --git a/node/service/src/collator_polkadot.rs b/node/service/src/collator_polkadot.rs index d1255f0bb..92c180cc7 100644 --- a/node/service/src/collator_polkadot.rs +++ b/node/service/src/collator_polkadot.rs @@ -42,7 +42,7 @@ use polkadot_primitives::CollatorPair; use sc_client_api::backend::Backend; use sc_consensus::{ImportQueue, LongestChain}; use sc_executor::{HeapAllocStrategy, WasmExecutor, DEFAULT_HEAP_ALLOC_STRATEGY}; -use sc_network::NetworkBlock; +use sc_network::{service::traits::NetworkBackend, NetworkBlock}; use sc_network_sync::SyncingService; use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager}; use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle}; @@ -210,8 +210,6 @@ fn start_consensus( overseer_handle: OverseerHandle, announce_block: Arc>) + Send + Sync>, ) -> Result<(), sc_service::Error> { - let slot_duration = cumulus_client_consensus_aura::slot_duration(&*client)?; - let proposer_factory = sc_basic_authorship::ProposerFactory::with_proof_recording( task_manager.spawn_handle(), client.clone(), @@ -239,7 +237,6 @@ fn start_consensus( collator_key, para_id, overseer_handle, - slot_duration, relay_chain_slot_duration, proposer, collator_service, @@ -263,14 +260,17 @@ fn start_consensus( /// This is the actual implementation that is abstract over the executor and the /// runtime api. #[sc_tracing::logging::prefix_logs_with("Parachain🌈")] -async fn start_node_impl( +async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, sybil_resistance_level: CollatorSybilResistance, para_id: ParaId, hwbench: Option, -) -> sc_service::error::Result<(TaskManager, Arc)> { +) -> sc_service::error::Result<(TaskManager, Arc)> +where + Net: NetworkBackend, +{ let parachain_config = prepare_node_config(parachain_config); let params = new_partial(¶chain_config, false)?; @@ -295,7 +295,8 @@ async fn start_node_impl( let prometheus_registry = parachain_config.prometheus_registry().cloned(); let transaction_pool = params.transaction_pool.clone(); let import_queue_service = params.import_queue.service(); - let net_config = sc_network::config::FullNetworkConfiguration::new(¶chain_config.network); + let net_config = + sc_network::config::FullNetworkConfiguration::<_, _, Net>::new(¶chain_config.network); let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = build_network(BuildNetworkParams { parachain_config: ¶chain_config, @@ -323,7 +324,7 @@ async fn start_node_impl( transaction_pool: Some(OffchainTransactionPoolFactory::new( transaction_pool.clone(), )), - network_provider: network.clone(), + network_provider: Arc::new(network.clone()), is_validator: parachain_config.role.is_authority(), enable_http_requests: false, custom_extensions: move |_| vec![], @@ -428,14 +429,14 @@ async fn start_node_impl( } /// Start a normal parachain node. -pub async fn start_node( +pub async fn start_node>( parachain_config: Configuration, polkadot_config: Configuration, collator_options: CollatorOptions, para_id: ParaId, hwbench: Option, ) -> sc_service::error::Result<(TaskManager, Arc)> { - start_node_impl( + start_node_impl::( parachain_config, polkadot_config, collator_options, diff --git a/pallets/buy-back/src/mock.rs b/pallets/buy-back/src/mock.rs index 61a75824e..77b9ee1dd 100644 --- a/pallets/buy-back/src/mock.rs +++ b/pallets/buy-back/src/mock.rs @@ -433,6 +433,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/clouds-convert/src/mock.rs b/pallets/clouds-convert/src/mock.rs index cf44d4be6..ad5914f29 100644 --- a/pallets/clouds-convert/src/mock.rs +++ b/pallets/clouds-convert/src/mock.rs @@ -87,6 +87,11 @@ impl frame_system::Config for Runtime { type Version = (); type MaxConsumers = frame_support::traits::ConstU32<16>; type RuntimeTask = (); + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); } parameter_types! { diff --git a/pallets/cross-in-out/src/lib.rs b/pallets/cross-in-out/src/lib.rs index 1a14206b0..5f1841e6c 100644 --- a/pallets/cross-in-out/src/lib.rs +++ b/pallets/cross-in-out/src/lib.rs @@ -29,6 +29,7 @@ use frame_system::pallet_prelude::*; use orml_traits::MultiCurrency; use sp_std::boxed::Box; pub use weights::WeightInfo; +#[allow(deprecated)] use xcm::{ opaque::v2::{Junction::AccountId32, Junctions::X1, NetworkId::Any}, v2::MultiLocation, @@ -48,6 +49,7 @@ type BalanceOf = <::MultiCurrency as MultiCurrency< >>::Balance; type AccountIdOf = ::AccountId; +#[allow(deprecated)] #[frame_support::pallet] pub mod pallet { use super::*; diff --git a/pallets/cross-in-out/src/tests.rs b/pallets/cross-in-out/src/tests.rs index 2a7e8b836..77ee7d706 100644 --- a/pallets/cross-in-out/src/tests.rs +++ b/pallets/cross-in-out/src/tests.rs @@ -22,8 +22,10 @@ use crate::{mock::*, *}; use bifrost_primitives::currency::KSM; use frame_support::{assert_noop, assert_ok, WeakBoundedVec}; use sp_runtime::DispatchError::BadOrigin; +#[allow(deprecated)] use xcm::opaque::v2::{Junction, Junctions::X1}; +#[allow(deprecated)] #[test] fn cross_in_and_cross_out_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -160,6 +162,7 @@ fn add_to_and_remove_from_register_whitelist_should_work() { }); } +#[allow(deprecated)] #[test] fn register_linked_account_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -235,6 +238,7 @@ fn register_and_deregister_currency_for_cross_in_out_should_work() { }); } +#[allow(deprecated)] #[test] fn change_outer_linked_account_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { diff --git a/pallets/currencies/src/lib.rs b/pallets/currencies/src/lib.rs index 4d0304868..c72f04d65 100644 --- a/pallets/currencies/src/lib.rs +++ b/pallets/currencies/src/lib.rs @@ -668,16 +668,26 @@ impl fungibles::Mutate for Pallet { asset_id: Self::AssetId, who: &T::AccountId, amount: Self::Balance, + preservation: Preservation, precision: Precision, fortitude: Fortitude, ) -> Result { match asset_id { id if id == T::GetNativeCurrencyId::get() => >::burn_from( - who, amount, precision, fortitude, + who, + amount, + preservation, + precision, + fortitude, ), _ => >::burn_from( - asset_id, who, amount, precision, fortitude, + asset_id, + who, + amount, + preservation, + precision, + fortitude, ), } } @@ -1246,10 +1256,17 @@ where fn burn_from( who: &T::AccountId, amount: Self::Balance, + preservation: Preservation, precision: Precision, fortitude: Fortitude, ) -> Result { - >::burn_from(who, amount, precision, fortitude) + >::burn_from( + who, + amount, + preservation, + precision, + fortitude, + ) } fn transfer( diff --git a/pallets/farming/src/lib.rs b/pallets/farming/src/lib.rs index 3f4d1a706..f518fe5e9 100644 --- a/pallets/farming/src/lib.rs +++ b/pallets/farming/src/lib.rs @@ -404,9 +404,9 @@ pub mod pallet { let reward_issuer = T::RewardIssuer::get().into_sub_account_truncating(pid); let basic_token = *tokens_proportion.get(0).ok_or(Error::::NotNullable)?; let tokens_proportion_map: BTreeMap, Perbill> = - tokens_proportion.into_iter().map(|(k, v)| (k, v)).collect(); + tokens_proportion.into_iter().collect(); let basic_rewards_map: BTreeMap, BalanceOf> = - basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + basic_rewards.into_iter().collect(); let mut pool_info = PoolInfo::new( keeper, @@ -424,7 +424,7 @@ pub mod pallet { if let Some((max_block, gauge_basic_rewards)) = gauge_init { let gauge_basic_rewards_map: BTreeMap, BalanceOf> = - gauge_basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + gauge_basic_rewards.into_iter().collect(); Self::create_gauge_pool(pid, &mut pool_info, gauge_basic_rewards_map, max_block)?; }; @@ -689,7 +689,7 @@ pub mod pallet { ensure!(pool_info.state == PoolState::Retired, Error::::InvalidPoolState); if let Some(basic_rewards) = basic_rewards { let basic_rewards_map: BTreeMap, BalanceOf> = - basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + basic_rewards.into_iter().collect(); pool_info.basic_rewards = basic_rewards_map; }; if let Some(min_deposit_to_start) = min_deposit_to_start { @@ -709,7 +709,7 @@ pub mod pallet { }; if let Some((max_block, gauge_basic_rewards)) = gauge_init { let gauge_basic_rewards_map: BTreeMap, BalanceOf> = - gauge_basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + gauge_basic_rewards.into_iter().collect(); Self::create_gauge_pool(pid, &mut pool_info, gauge_basic_rewards_map, max_block)?; }; @@ -764,7 +764,7 @@ pub mod pallet { ); if let Some(basic_rewards) = basic_rewards { let basic_rewards_map: BTreeMap, BalanceOf> = - basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + basic_rewards.into_iter().collect(); pool_info.basic_rewards = basic_rewards_map; }; if let Some(withdraw_limit_time) = withdraw_limit_time { @@ -778,7 +778,7 @@ pub mod pallet { }; if let Some(gauge_basic_rewards) = gauge_basic_rewards { let gauge_basic_rewards_map: BTreeMap, BalanceOf> = - gauge_basic_rewards.into_iter().map(|(k, v)| (k, v)).collect(); + gauge_basic_rewards.into_iter().collect(); GaugePoolInfos::::mutate( pool_info.gauge.ok_or(Error::::GaugePoolNotExist)?, |gauge_pool_info_old| { diff --git a/pallets/fee-share/src/mock.rs b/pallets/fee-share/src/mock.rs index f60adbbde..ece282274 100644 --- a/pallets/fee-share/src/mock.rs +++ b/pallets/fee-share/src/mock.rs @@ -422,6 +422,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mock.rs index 1e53f875e..6ed57ad38 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mock.rs @@ -449,6 +449,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/lend-market/src/benchmarking.rs b/pallets/lend-market/src/benchmarking.rs index 5bcf94219..dbbc991a4 100644 --- a/pallets/lend-market/src/benchmarking.rs +++ b/pallets/lend-market/src/benchmarking.rs @@ -88,8 +88,15 @@ fn set_account_borrows( BorrowSnapshot { principal: borrow_balance, borrow_index: Rate::one() }, ); TotalBorrows::::insert(asset_id, borrow_balance); - T::Assets::burn_from(asset_id, &who, borrow_balance, Precision::Exact, Fortitude::Force) - .unwrap(); + T::Assets::burn_from( + asset_id, + &who, + borrow_balance, + Preservation::Protect, + Precision::Exact, + Fortitude::Force, + ) + .unwrap(); } fn assert_last_event(generic_event: ::RuntimeEvent) { diff --git a/pallets/leverage-staking/src/lib.rs b/pallets/leverage-staking/src/lib.rs index 65ae0f67b..7bff552a3 100644 --- a/pallets/leverage-staking/src/lib.rs +++ b/pallets/leverage-staking/src/lib.rs @@ -33,7 +33,7 @@ use frame_support::{ pallet_prelude::*, traits::{ fungibles::Mutate, - tokens::{Fortitude, Precision}, + tokens::{Fortitude, Precision, Preservation}, }, transactional, BoundedVec, }; @@ -208,6 +208,7 @@ impl Pallet { asset_id, &who, reduce_amount, + Preservation::Protect, Precision::Exact, Fortitude::Force, )?; @@ -234,6 +235,7 @@ impl Pallet { asset_id, &who, increase_amount, + Preservation::Protect, Precision::Exact, Fortitude::Force, )?; diff --git a/pallets/leverage-staking/src/mock.rs b/pallets/leverage-staking/src/mock.rs index c909670c6..df9c51dca 100644 --- a/pallets/leverage-staking/src/mock.rs +++ b/pallets/leverage-staking/src/mock.rs @@ -160,6 +160,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } parameter_type_with_key! { diff --git a/pallets/parachain-staking/src/benchmarks.rs b/pallets/parachain-staking/src/benchmarks.rs index a28b9bf64..cffff55a1 100644 --- a/pallets/parachain-staking/src/benchmarks.rs +++ b/pallets/parachain-staking/src/benchmarks.rs @@ -51,7 +51,6 @@ fn create_funded_user( let min_candidate_stk = min_candidate_stk::(); let total = min_candidate_stk + extra; T::Currency::make_free_balance_be(&user, total); - T::Currency::issue(total); (user, total) } diff --git a/pallets/parachain-staking/src/tests.rs b/pallets/parachain-staking/src/tests.rs index 4866a8172..0fdb75254 100644 --- a/pallets/parachain-staking/src/tests.rs +++ b/pallets/parachain-staking/src/tests.rs @@ -5146,10 +5146,9 @@ fn deferred_payment_steady_state_event_flow() { let reset_issuance = || { let new_issuance = Balances::total_issuance(); let diff = new_issuance - initial_issuance; - let burned = Balances::burn(diff); - Balances::settle( + let _ = Balances::withdraw( &111, - burned, + diff, WithdrawReasons::FEE, ExistenceRequirement::AllowDeath, ) diff --git a/pallets/salp/src/benchmarking.rs b/pallets/salp/src/benchmarking.rs index ee8d173a9..136f5d2b6 100644 --- a/pallets/salp/src/benchmarking.rs +++ b/pallets/salp/src/benchmarking.rs @@ -81,7 +81,6 @@ where T: Config + bifrost_stable_pool::Config + bifrost_stable_asset::Config + o )] mod benchmarks { use super::*; - use frame_benchmarking::impl_benchmark_test_suite; #[benchmark] fn contribute() { diff --git a/pallets/salp/src/mock.rs b/pallets/salp/src/mock.rs index 628dd72e9..193e905ab 100644 --- a/pallets/salp/src/mock.rs +++ b/pallets/salp/src/mock.rs @@ -513,6 +513,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/slp/src/benchmarking.rs b/pallets/slp/src/benchmarking.rs index 7f8041fda..68cd64d01 100644 --- a/pallets/slp/src/benchmarking.rs +++ b/pallets/slp/src/benchmarking.rs @@ -201,7 +201,6 @@ mod benchmarks { use super::*; use crate::primitives::{PhalaLedger, SubstrateValidatorsByDelegatorUpdateEntry}; use bifrost_primitives::VKSM; - use frame_benchmarking::impl_benchmark_test_suite; use sp_arithmetic::traits::SaturatedConversion; #[benchmark] diff --git a/pallets/slp/src/mocks/mock.rs b/pallets/slp/src/mocks/mock.rs index 7229247f2..5d4836d0d 100644 --- a/pallets/slp/src/mocks/mock.rs +++ b/pallets/slp/src/mocks/mock.rs @@ -532,6 +532,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/slp/src/mocks/mock_kusama.rs b/pallets/slp/src/mocks/mock_kusama.rs index 9704ed757..8c54946b3 100644 --- a/pallets/slp/src/mocks/mock_kusama.rs +++ b/pallets/slp/src/mocks/mock_kusama.rs @@ -616,6 +616,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/slpx/src/benchmarking.rs b/pallets/slpx/src/benchmarking.rs index d0c07e15d..1b914af4d 100644 --- a/pallets/slpx/src/benchmarking.rs +++ b/pallets/slpx/src/benchmarking.rs @@ -55,7 +55,6 @@ fn init_whitelist() -> (T::AccountId #[benchmarks(where T: Config + bifrost_asset_registry::Config + bifrost_stable_pool::Config + bifrost_stable_asset::Config + orml_tokens::Config)] mod benchmarks { use super::*; - use frame_benchmarking::impl_benchmark_test_suite; #[benchmark] fn add_whitelist() { diff --git a/pallets/slpx/src/mock.rs b/pallets/slpx/src/mock.rs index d0ef639e6..951b740f7 100644 --- a/pallets/slpx/src/mock.rs +++ b/pallets/slpx/src/mock.rs @@ -327,6 +327,10 @@ impl xcm_executor::Config for XcmConfig { type Aliasers = Nothing; type AssetExchanger = (); type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } parameter_type_with_key! { diff --git a/pallets/stable-pool/src/mock.rs b/pallets/stable-pool/src/mock.rs index b5f3e9c6e..0eb1ce4ad 100644 --- a/pallets/stable-pool/src/mock.rs +++ b/pallets/stable-pool/src/mock.rs @@ -146,6 +146,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } parameter_type_with_key! { diff --git a/pallets/system-maker/src/mock.rs b/pallets/system-maker/src/mock.rs index bcd18d750..48323d9f3 100644 --- a/pallets/system-maker/src/mock.rs +++ b/pallets/system-maker/src/mock.rs @@ -429,6 +429,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/system-staking/src/mock.rs b/pallets/system-staking/src/mock.rs index f55394832..32c2cfd58 100644 --- a/pallets/system-staking/src/mock.rs +++ b/pallets/system-staking/src/mock.rs @@ -363,6 +363,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/ve-minting/src/lib.rs b/pallets/ve-minting/src/lib.rs index a01b06665..03ce9a825 100644 --- a/pallets/ve-minting/src/lib.rs +++ b/pallets/ve-minting/src/lib.rs @@ -47,7 +47,6 @@ use frame_support::{ use frame_system::pallet_prelude::*; pub use incentive::*; use orml_traits::{LockIdentifier, MultiCurrency, MultiLockableCurrency}; -pub use pallet::*; use sp_core::{U256, U512}; use sp_std::{borrow::ToOwned, cmp::Ordering, collections::btree_map::BTreeMap, vec, vec::Vec}; pub use traits::{ diff --git a/pallets/ve-minting/src/mock.rs b/pallets/ve-minting/src/mock.rs index 9c59dd190..f6f459eb6 100644 --- a/pallets/ve-minting/src/mock.rs +++ b/pallets/ve-minting/src/mock.rs @@ -370,6 +370,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/vtoken-minting/src/mock.rs b/pallets/vtoken-minting/src/mock.rs index e33677c9d..24d469e92 100644 --- a/pallets/vtoken-minting/src/mock.rs +++ b/pallets/vtoken-minting/src/mock.rs @@ -346,6 +346,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/pallets/vtoken-voting/src/mock.rs b/pallets/vtoken-voting/src/mock.rs index 686900e18..ffb1dee22 100644 --- a/pallets/vtoken-voting/src/mock.rs +++ b/pallets/vtoken-voting/src/mock.rs @@ -171,6 +171,10 @@ impl xcm_executor::Config for XcmConfig { type AssetExchanger = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } #[cfg(feature = "runtime-benchmarks")] diff --git a/runtime/bifrost-kusama/src/governance/fellowship.rs b/runtime/bifrost-kusama/src/governance/fellowship.rs index bd9844ff7..b4453594d 100644 --- a/runtime/bifrost-kusama/src/governance/fellowship.rs +++ b/runtime/bifrost-kusama/src/governance/fellowship.rs @@ -26,7 +26,7 @@ use frame_support::traits::{EitherOf, MapSuccess, TryMapSuccess}; use sp_arithmetic::traits::CheckedSub; use sp_runtime::{ morph_types, - traits::{ConstU16, Replace, TypedGet}, + traits::{ConstU16, Replace, ReplaceWithDefault, TypedGet}, }; parameter_types! { @@ -352,6 +352,9 @@ impl pallet_ranked_collective::Config for Runtime TryMapSuccess>>, >, >; + + type AddOrigin = MapSuccess>; + type RemoveOrigin = Self::DemoteOrigin; type Polls = FellowshipReferenda; type MinRankOfClass = sp_runtime::traits::Identity; type VoteWeight = pallet_ranked_collective::Geometric; diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 69c49b6aa..bc8e30c08 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -89,7 +89,7 @@ use constants::currency::*; use cumulus_pallet_parachain_system::{RelayNumberStrictlyIncreases, RelaychainDataProvider}; use frame_support::{ dispatch::DispatchClass, - genesis_builder_helper::{build_config, create_default_config}, + genesis_builder_helper::{build_state, get_preset}, sp_runtime::traits::{Convert, ConvertInto}, traits::{ fungible::HoldConsideration, @@ -269,6 +269,11 @@ impl frame_system::Config for Runtime { type Version = Version; type MaxConsumers = ConstU32<16>; type RuntimeTask = (); + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); } impl pallet_timestamp::Config for Runtime { @@ -992,6 +997,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; + type SlotDuration = ConstU64; } // culumus runtime end @@ -2021,7 +2027,7 @@ impl_runtime_apis! { Executive::execute_block(block); } - fn initialize_block(header: &::Header) { + fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { Executive::initialize_block(header) } } @@ -2118,7 +2124,7 @@ impl_runtime_apis! { } fn authorities() -> Vec { - Aura::authorities().into_inner() + pallet_aura::Authorities::::get().into_inner() } } @@ -2378,12 +2384,16 @@ impl_runtime_apis! { } impl sp_genesis_builder::GenesisBuilder for Runtime { - fn create_default_config() -> Vec { - create_default_config::() + fn build_state(config: Vec) -> sp_genesis_builder::Result { + build_state::(config) } - fn build_config(config: Vec) -> sp_genesis_builder::Result { - build_config::(config) + fn get_preset(id: &Option) -> Option> { + get_preset::(id, |_| None) + } + + fn preset_names() -> Vec { + vec![] } } } diff --git a/runtime/bifrost-kusama/src/xcm_config.rs b/runtime/bifrost-kusama/src/xcm_config.rs index bf9e45f8d..dbfec5ce6 100644 --- a/runtime/bifrost-kusama/src/xcm_config.rs +++ b/runtime/bifrost-kusama/src/xcm_config.rs @@ -692,6 +692,10 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type XcmRecorder = (); + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -762,10 +766,13 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; type PriceForSiblingDelivery = NoPriceForMessageDelivery; + type MaxActiveOutboundChannels = ConstU32<128>; + type MaxPageSize = ConstU32<{ 103 * 1024 }>; } parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -786,6 +793,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = ConstU32<{ 64 * 1024 }>; type MaxStale = ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } // orml runtime start diff --git a/runtime/bifrost-polkadot/src/governance/fellowship.rs b/runtime/bifrost-polkadot/src/governance/fellowship.rs index 4d520a042..bbcec0fdc 100644 --- a/runtime/bifrost-polkadot/src/governance/fellowship.rs +++ b/runtime/bifrost-polkadot/src/governance/fellowship.rs @@ -26,7 +26,7 @@ use frame_support::traits::{EitherOf, MapSuccess, TryMapSuccess}; use sp_arithmetic::traits::CheckedSub; use sp_runtime::{ morph_types, - traits::{ConstU16, Replace, TypedGet}, + traits::{ConstU16, Replace, ReplaceWithDefault, TypedGet}, }; parameter_types! { @@ -355,8 +355,10 @@ impl pallet_ranked_collective::Config for Runtime type Polls = FellowshipReferenda; type MinRankOfClass = sp_runtime::traits::Identity; type VoteWeight = pallet_ranked_collective::Geometric; - #[cfg(feature = "runtime-benchmarks")] - type BenchmarkSetup = (); type MemberSwappedHandler = (); type ExchangeOrigin = EitherOfDiverse; + type AddOrigin = MapSuccess>; + type RemoveOrigin = Self::DemoteOrigin; + #[cfg(feature = "runtime-benchmarks")] + type BenchmarkSetup = (); } diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index e7d43e2fa..c015b9b11 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -89,7 +89,7 @@ use constants::currency::*; use cumulus_primitives_core::ParaId as CumulusParaId; use frame_support::{ dispatch::DispatchClass, - genesis_builder_helper::{build_config, create_default_config}, + genesis_builder_helper::{build_state, get_preset}, sp_runtime::traits::{Convert, ConvertInto}, traits::{ fungible::HoldConsideration, @@ -263,6 +263,11 @@ impl frame_system::Config for Runtime { type Version = Version; type MaxConsumers = ConstU32<16>; type RuntimeTask = (); + type SingleBlockMigrations = (); + type MultiBlockMigrator = (); + type PreInherents = (); + type PostInherents = (); + type PostTransactions = (); } impl pallet_timestamp::Config for Runtime { @@ -829,6 +834,7 @@ impl pallet_aura::Config for Runtime { type DisabledValidators = (); type MaxAuthorities = ConstU32<100_000>; type AllowMultipleBlocksPerSlot = ConstBool; + type SlotDuration = ConstU64; } parameter_types! { @@ -1844,7 +1850,7 @@ impl_runtime_apis! { Executive::execute_block(block); } - fn initialize_block(header: &::Header) { + fn initialize_block(header: &::Header) -> sp_runtime::ExtrinsicInclusionMode { Executive::initialize_block(header) } } @@ -1941,7 +1947,7 @@ impl_runtime_apis! { } fn authorities() -> Vec { - Aura::authorities().into_inner() + pallet_aura::Authorities::::get().into_inner() } } @@ -2155,12 +2161,16 @@ impl_runtime_apis! { } impl sp_genesis_builder::GenesisBuilder for Runtime { - fn create_default_config() -> Vec { - create_default_config::() + fn build_state(config: Vec) -> sp_genesis_builder::Result { + build_state::(config) } - fn build_config(config: Vec) -> sp_genesis_builder::Result { - build_config::(config) + fn get_preset(id: &Option) -> Option> { + get_preset::(id, |_| None) + } + + fn preset_names() -> Vec { + vec![] } } } diff --git a/runtime/bifrost-polkadot/src/xcm_config.rs b/runtime/bifrost-polkadot/src/xcm_config.rs index dd0ee5eb2..49513b263 100644 --- a/runtime/bifrost-polkadot/src/xcm_config.rs +++ b/runtime/bifrost-polkadot/src/xcm_config.rs @@ -546,6 +546,10 @@ impl xcm_executor::Config for XcmConfig { type MessageExporter = (); type Aliasers = Nothing; type TransactionalProcessor = FrameTransactionalProcessor; + type HrmpNewChannelOpenRequestHandler = (); + type HrmpChannelAcceptedHandler = (); + type HrmpChannelClosingHandler = (); + type XcmRecorder = (); } /// Local origins on this chain are allowed to dispatch XCM sends/executions. @@ -613,10 +617,13 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime { type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin; type WeightInfo = cumulus_pallet_xcmp_queue::weights::SubstrateWeight; type PriceForSiblingDelivery = NoPriceForMessageDelivery; + type MaxActiveOutboundChannels = ConstU32<128>; + type MaxPageSize = ConstU32<{ 103 * 1024 }>; } parameter_types! { pub MessageQueueServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; + pub MessageQueueIdleServiceWeight: Weight = Perbill::from_percent(35) * RuntimeBlockWeights::get().max_block; } impl pallet_message_queue::Config for Runtime { @@ -637,6 +644,7 @@ impl pallet_message_queue::Config for Runtime { type HeapSize = ConstU32<{ 64 * 1024 }>; type MaxStale = ConstU32<8>; type ServiceWeight = MessageQueueServiceWeight; + type IdleMaxServiceWeight = MessageQueueIdleServiceWeight; } // orml runtime start diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 3d5ed2397..6de8cf11c 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -43,7 +43,7 @@ impl BlockNumberProvider type BlockNumber = BlockNumber; fn current_block_number() -> Self::BlockNumber { - cumulus_pallet_parachain_system::Pallet::::validation_data() + cumulus_pallet_parachain_system::ValidationData::::get() .map(|d| d.relay_parent_number) .unwrap_or_default() } @@ -127,7 +127,7 @@ impl BlockNumberProvider type BlockNumber = BlockNumber; fn current_block_number() -> Self::BlockNumber { - cumulus_pallet_parachain_system::Pallet::::validation_data() + cumulus_pallet_parachain_system::ValidationData::::get() .map(|d| d.relay_parent_number) .unwrap_or_default() } diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 9c6ff81de..b365e13a8 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,4 +1,4 @@ [toolchain] -channel = "1.74.0" +channel = "1.77.0" components = ["rust-src", "rustfmt", "clippy"] targets = ["wasm32-unknown-unknown"] diff --git a/scripts/init.sh b/scripts/init.sh index 94ef2963e..3f6ed0ed1 100755 --- a/scripts/init.sh +++ b/scripts/init.sh @@ -4,6 +4,6 @@ set -e echo "*** Initializing WASM build environment" -rustup default 1.74.0 +rustup default 1.77.0 -rustup target add wasm32-unknown-unknown --toolchain 1.74.0 +rustup target add wasm32-unknown-unknown --toolchain 1.77.0 From 8b6d4d42232ec1e0919fb14b46b47c656f0a145b Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Wed, 24 Jul 2024 22:03:20 +0800 Subject: [PATCH 15/22] Use github dependencies (#1314) --- Cargo.lock | 2283 ++++++++++++++++++++++++++-------------------------- Cargo.toml | 296 +++---- 2 files changed, 1310 insertions(+), 1269 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3c3ad7b4..59ff69c81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,6 +218,18 @@ dependencies = [ "ark-std", ] +[[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", +] + [[package]] name = "ark-bls12-381" version = "0.4.0" @@ -230,6 +242,45 @@ dependencies = [ "ark-std", ] +[[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", + "ark-models-ext", + "ark-serialize", + "ark-std", +] + +[[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", + "ark-std", +] + +[[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", + "ark-models-ext", + "ark-std", +] + [[package]] name = "ark-ec" version = "0.4.2" @@ -244,9 +295,60 @@ 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", + "ark-std", +] + +[[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", + "ark-models-ext", + "ark-std", +] + +[[package]] +name = "ark-ed-on-bls12-381-bandersnatch" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cde0f2aa063a2a5c28d39b47761aa102bda7c13c84fc118a61b87c7b2f785c" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-std", +] + +[[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", + "ark-models-ext", + "ark-std", +] + [[package]] name = "ark-ff" version = "0.4.2" @@ -290,6 +392,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", + "ark-serialize", + "ark-std", + "derivative", +] + [[package]] name = "ark-poly" version = "0.4.2" @@ -303,6 +418,35 @@ dependencies = [ "hashbrown 0.13.2", ] +[[package]] +name = "ark-scale" +version = "0.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f69c00b3b529be29528a6f2fd5fa7b1790f8bed81b9cdca17e326538545a179" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "ark-secret-scalar" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "ark-transcript", + "digest 0.10.7", + "getrandom_or_panic", + "zeroize", +] + [[package]] name = "ark-serialize" version = "0.4.2" @@ -334,6 +478,20 @@ 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=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "digest 0.10.7", + "rand_core 0.6.4", + "sha3", ] [[package]] @@ -624,6 +782,29 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "bandersnatch_vrfs" +version = "0.0.4" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ed-on-bls12-381-bandersnatch", + "ark-ff", + "ark-serialize", + "ark-std", + "dleq_vrf", + "fflonk", + "merlin", + "rand_chacha 0.3.1", + "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", +] + [[package]] name = "base-x" version = "0.2.11" @@ -684,7 +865,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -718,7 +899,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -741,7 +922,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -762,7 +943,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -816,7 +997,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -837,7 +1018,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] @@ -857,7 +1038,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -887,7 +1068,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm-builder", ] @@ -914,7 +1095,7 @@ dependencies = [ "bifrost-primitives", "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -943,7 +1124,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -977,7 +1158,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1050,7 +1231,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", @@ -1171,7 +1352,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-parachain-info", @@ -1208,7 +1389,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "substrate-fixed", ] @@ -1326,7 +1507,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-parachain-info", @@ -1353,7 +1534,7 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", "zenlink-protocol", @@ -1439,7 +1620,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-parachain-info", @@ -1480,7 +1661,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1583,7 +1764,7 @@ dependencies = [ "sp-offchain", "sp-runtime", "sp-session", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-timestamp", "sp-transaction-pool", "sp-trie", @@ -1629,7 +1810,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1671,7 +1852,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-parachain-info", "staging-xcm", "staging-xcm-builder", @@ -1699,7 +1880,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1727,7 +1908,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1756,7 +1937,7 @@ dependencies = [ "bifrost-primitives", "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1785,7 +1966,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1820,7 +2001,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1845,7 +2026,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1876,7 +2057,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -1906,7 +2087,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-core", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1923,7 +2104,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1943,7 +2124,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -1966,7 +2147,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm-builder", ] @@ -1998,7 +2179,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -2028,7 +2209,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-core", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -2053,7 +2234,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -2077,16 +2258,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", ] [[package]] name = "binary-merkle-tree" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b5c0fd4282c30c05647e1052d71bf1a0c8067ab1e9a8fc6d0c292dce0ecb237" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hash-db 0.16.0", "log", @@ -2298,9 +2478,8 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7dae4d1ec894ee920195dd39070b279ef3c1d4d078c3fcf7336c93a1d502a9d" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -2672,6 +2851,22 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "common" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof#665f5f51af5734c7b6d90b985dd6861d4c5b4752" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "fflonk", + "getrandom_or_panic", + "merlin", + "rand_chacha 0.3.1", +] + [[package]] name = "common-path" version = "1.0.0" @@ -3019,9 +3214,8 @@ dependencies = [ [[package]] name = "cumulus-client-cli" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7980387e86a9447caa3c3aa2a0c908e6dc94d81e5494c12e56146a6271204b31" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "clap", "parity-scale-codec", @@ -3037,9 +3231,8 @@ dependencies = [ [[package]] name = "cumulus-client-collator" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1291bce46c865d627075f7f1d980e22b011dbe670cacea6b0b9c95f83eb4ebdd" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -3061,9 +3254,8 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe170ff77c66f15afe0ce18940f51f78920d80215165c919469516be57108e59" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-client-collator", @@ -3104,9 +3296,8 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cca21fecfbeedaabf25c421573dfe3e3392d376e2b4acd4a281062ad142ce1b9" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -3134,9 +3325,8 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e980b3e5c05415eaa4ac07f398bc8e74666811f3112f19a654ccb3a948018e" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "anyhow", "async-trait", @@ -3150,9 +3340,8 @@ dependencies = [ [[package]] name = "cumulus-client-network" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9d520c245f0df156dc50a86dfec79efcda7733a99eeb2224e315a26eab4650" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -3174,9 +3363,8 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff5587b8a306617db8f6528f9244c6ee4344745eeb252b3c7b20ea6c2496b3c" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3191,17 +3379,16 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", - "sp-storage", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "tracing", ] [[package]] name = "cumulus-client-pov-recovery" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca43387c87d4b6fb2f8ff5ac70e46b7bea0ff686b6445e8bd4b6e44691d6616e" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3224,9 +3411,8 @@ dependencies = [ [[package]] name = "cumulus-client-service" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6b433d3036a30f2aaacd4249988084f55ca3291c9388fa7e78e4b6222f74ef" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -3262,9 +3448,8 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52088d88534bd04ea251c030af1fef69845d29ed4fc9be399c1fbd5a311bea61" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -3276,14 +3461,13 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "cumulus-pallet-parachain-system" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95f75a9e4dfebf1850c7c946a49cdb8b5e82a143155a40337ea083f412e13071" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -3303,12 +3487,12 @@ dependencies = [ "polkadot-runtime-parachains", "scale-info", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-inherents", "sp-io", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "sp-version", "staging-xcm", @@ -3319,8 +3503,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "befbaf3a1ce23ac8476481484fef5f4d500cbd15b4dad6380ce1d28134b0c1f7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", @@ -3330,9 +3513,8 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dccf061aecc7c4b393c6586a0d95900bc0dfc8ac9298313a608d2389bf7f8de2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3341,15 +3523,14 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437a52fc63387f1aa2211bc219e1283a935ed36d9ccbb3373faee0398125c466" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -3366,7 +3547,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -3374,9 +3555,8 @@ dependencies = [ [[package]] name = "cumulus-primitives-aura" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e7977947ad43a4cbc532ca33abcde136ae3deffdc7168b2ae253d73ccd371e4" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3384,14 +3564,13 @@ dependencies = [ "sp-api", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "cumulus-primitives-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "751e64b89a839d5cfabebc1c797936e5eee791d0fa2322d91e86f8440a743ddb" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -3400,16 +3579,15 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "staging-xcm", ] [[package]] name = "cumulus-primitives-parachain-inherent" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df521e13b48278b86d02c61d6e44036d6d263deb5aaec4838b1751da8988d3d2" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3419,40 +3597,37 @@ dependencies = [ "sp-inherents", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", ] [[package]] name = "cumulus-primitives-proof-size-hostfunction" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f973d2a7262c90e48dcd42062bcb1e0fbf48bbcdac4ea6df3d85212d8d8be5d" +version = "0.2.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ - "sp-externalities", - "sp-runtime-interface", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", ] [[package]] name = "cumulus-primitives-timestamp" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08ad90f55963672079811170bc3899066b6b73aea7db17f6db5220541a0aa7b" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "futures 0.3.30", "parity-scale-codec", "sp-inherents", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-timestamp", ] [[package]] name = "cumulus-primitives-utility" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "192d7917d70fdb0998311df31430bd28408af9abce79a2245efbf511a8fa4671" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -3463,7 +3638,7 @@ dependencies = [ "polkadot-runtime-parachains", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -3471,9 +3646,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d271cbd47783a94e4cb9db3ef34c4e4e05773e16bb6ec766f2ea9939d84644" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3496,9 +3670,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f324e573f19f7d4478f19f8e58dd922024712fd9c656e8a3112ee7d7ff3f414" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3515,9 +3688,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17aeea632dad3e8251c85ea6a2e5c8deed7f69b6465671347106de27bfcdc70a" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "async-trait", @@ -3558,9 +3730,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f292767910d0e65aa52b350b606a8a8d0990c6a780abad5d8358f25b0280405" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -3587,7 +3758,7 @@ dependencies = [ "sp-core", "sp-runtime", "sp-state-machine", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-version", "thiserror", "tokio", @@ -3598,16 +3769,15 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1f4ab9d64a581d4a5431f2554f4602a4208c5e28b30be01af386e24d8447599" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", "polkadot-primitives", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", ] @@ -3904,6 +4074,22 @@ dependencies = [ "syn 2.0.71", ] +[[package]] +name = "dleq_vrf" +version = "0.0.2" +source = "git+https://github.com/w3f/ring-vrf?rev=e9782f9#e9782f938629c90f3adb3fff2358bc8d1386af3e" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-scale", + "ark-secret-scalar", + "ark-serialize", + "ark-std", + "ark-transcript", + "arrayvec 0.7.4", + "zeroize", +] + [[package]] name = "docify" version = "0.2.8" @@ -4366,6 +4552,19 @@ dependencies = [ "subtle 2.6.1", ] +[[package]] +name = "fflonk" +version = "0.1.0" +source = "git+https://github.com/w3f/fflonk#1e854f35e9a65d08b11a86291405cdc95baa0a35" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "merlin", +] + [[package]] name = "fiat-crypto" version = "0.2.9" @@ -4481,9 +4680,8 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "fork-tree" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad4cc2314d3be8b49c555f6a7e550f5559e73ffd6ef9690ffbd9a706774452e0" +version = "12.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", ] @@ -4515,9 +4713,8 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" [[package]] name = "frame-benchmarking" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6366773db71a556710652c0560300dc938252e009d4d2c1eb9d6e5b38e0860" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-support-procedural", @@ -4533,17 +4730,16 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "static_assertions", ] [[package]] name = "frame-benchmarking-cli" -version = "39.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bff993810ef24391487012e6b8e42ee0909e51e95954046849f0eb56236e4d5" +version = "32.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "Inflector", "array-bytes", @@ -4576,25 +4772,24 @@ dependencies = [ "sp-blockchain", "sp-core", "sp-database", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-genesis-builder", "sp-inherents", "sp-io", "sp-keystore", "sp-runtime", "sp-state-machine", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "thousands", ] [[package]] name = "frame-election-provider-solution-type" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1388eb632484a1208a5b51d7d822a7df995f37bb10878b2a88f4ec89cbe5e6b2" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", @@ -4604,9 +4799,8 @@ dependencies = [ [[package]] name = "frame-election-provider-support" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c089c16a066dfb5042cadc27c01738d93258e8f5f7ef7a83b4c8661616d1ac" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -4617,14 +4811,13 @@ dependencies = [ "sp-core", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "frame-executive" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9287dd6070c0ca90b42c9b4fc44f2bc91adf08b73c11c74484c416f0cc9abe04" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "aquamarine", "frame-support", @@ -4636,8 +4829,8 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -4654,9 +4847,8 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1fa15dc90efe948898c06a3be111628230db100ffa2907e662062e9c9d1abd" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "docify", @@ -4670,9 +4862,8 @@ dependencies = [ [[package]] name = "frame-support" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab6d7780b7f337c8a072f0a7480cbc7b580f9bf871c434fae65e8935053ee5ef" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "aquamarine", "array-bytes", @@ -4695,7 +4886,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-crypto-hashing-proc-macro", - "sp-debug-derive", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-genesis-builder", "sp-inherents", "sp-io", @@ -4703,8 +4894,8 @@ dependencies = [ "sp-runtime", "sp-staking", "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", "static_assertions", "tt-call", @@ -4712,9 +4903,8 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "30.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd94af68373e179c32c360b3c280497a9cf0f45a4f47f0ee6539a6c6c9cf2343" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "Inflector", "cfg-expr", @@ -4732,9 +4922,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bead15a320be1764cdd50458c4cfacb23e0cee65f64f500f8e34136a94c7eeca" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.1.0", @@ -4745,9 +4934,8 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro2", "quote", @@ -4756,9 +4944,8 @@ dependencies = [ [[package]] name = "frame-system" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6baa2218d90c5a23db08dd0188cfe6aa0af7d36fb9b0fc2f73bc5c4abe4dd812" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cfg-if", "docify", @@ -4770,16 +4957,15 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-version", "sp-weights", ] [[package]] name = "frame-system-benchmarking" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be45f57aefef5fa97fce1482dc1ede197620d8b0bb588b3cec8d84f32557cf8b" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -4788,14 +4974,13 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "frame-system-rpc-runtime-api" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9e2b7b85e451e367f4fb85ff3295bd039e17f64de1906154d3976e2638ee8" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "sp-api", @@ -4803,15 +4988,14 @@ dependencies = [ [[package]] name = "frame-try-runtime" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f2b9c95e0b38d713a46bb71bc395d4ed067c7a0f5370e13282c07c91fd1ec0d" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "parity-scale-codec", "sp-api", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -5965,7 +6149,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm-builder", ] @@ -6027,7 +6211,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -6773,15 +6957,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata 0.1.10", -] - [[package]] name = "matchers" version = "0.1.0" @@ -6861,7 +7036,7 @@ dependencies = [ [[package]] name = "merkle-distributor" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "frame-support", "frame-system", @@ -6874,7 +7049,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -6967,9 +7142,8 @@ dependencies = [ [[package]] name = "mmr-gadget" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0110fde66cc10e924e66aae0f85ac8a23e7eef2f2deea3c46b04c483ddf8e4e0" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "log", @@ -6987,9 +7161,8 @@ dependencies = [ [[package]] name = "mmr-rpc" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ea4f2bdf0784e901b9c7999c0e2c903bb2a6e10ca9f63214a1a6de8bdc8e21" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -7656,7 +7829,7 @@ dependencies = [ [[package]] name = "orml-oracle" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" dependencies = [ "frame-benchmarking", "frame-support", @@ -7669,13 +7842,13 @@ dependencies = [ "sp-application-crypto", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "orml-tokens" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" dependencies = [ "frame-support", "frame-system", @@ -7686,13 +7859,13 @@ dependencies = [ "serde", "sp-arithmetic", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "orml-traits" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -7705,14 +7878,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "orml-unknown-tokens" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" dependencies = [ "frame-support", "frame-system", @@ -7720,14 +7893,14 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "orml-utilities" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" dependencies = [ "frame-support", "parity-scale-codec", @@ -7736,33 +7909,33 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "orml-xcm" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" dependencies = [ "frame-support", "frame-system", "pallet-xcm", "parity-scale-codec", "scale-info", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "orml-xcm-support" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" dependencies = [ "frame-support", "orml-traits", "parity-scale-codec", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", ] @@ -7770,7 +7943,7 @@ dependencies = [ [[package]] name = "orml-xtokens" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#51e0980fa31809107da6f5205d272a9a4a405a25" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" dependencies = [ "frame-support", "frame-system", @@ -7783,7 +7956,7 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", ] @@ -7796,9 +7969,8 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pallet-asset-conversion" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9f1c4496f1c366a3ee01b38ba968589db41f5d44c41331111ff5a07964dbde" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7811,14 +7983,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-asset-rate" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83f523d209396ba42743008b64fe021eb6411a8d5ac868978636f0341feacc4" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7827,14 +7998,13 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-asset-tx-payment" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7686ab6ba85afc432794a9dbc3e7399cb1a3b1bcfdd487ce0eb2aa81c11c2497" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7846,14 +8016,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-assets" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a58bb6d37a23df83b861e148129dc0130a4b80291f2c9dda3491989ec4c3662" +version = "29.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7863,14 +8032,13 @@ dependencies = [ "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-aura" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "638e3cbb539540e45503f5ae756b6bbb4e6085269d025afa273e684782f514ac" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -7881,14 +8049,13 @@ dependencies = [ "sp-application-crypto", "sp-consensus-aura", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-authority-discovery" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a5fafb21222ab509f0d9d4bda52730eb342574a0733321e1105e14d5454d6d5" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -7898,14 +8065,13 @@ dependencies = [ "sp-application-crypto", "sp-authority-discovery", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-authorship" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b134d987dfc6f2ddc3b4470672318fd59e740868485a25ec15ba909c42e6a622" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -7913,14 +8079,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-babe" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84fa5a4406cd9f43babb90ce6e8f1598d36695c86c8e35094ec4cbf3224086fd" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -7938,14 +8103,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-bags-list" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "381526d7d765b4c895efa9da7c7f7b1965f251de6fe30757a63f535a021f2b69" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "aquamarine", "docify", @@ -7960,15 +8124,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-balances" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dfe056082a1d857b0731572d7f9a96d98356b8610b258814cf75a55cd43c435" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -7978,14 +8141,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-beefy" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6005abf441b2c6fc21505f0d3e00a66e40759ddff0311834f3f8ae2c5874b0e5" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -7999,14 +8161,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-beefy-mmr" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effb0467f4d9b43be918a6e0ad419c539cd55dceef4c70000cb373701dc3d029" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -8025,14 +8186,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-bounties" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e118557f0d4e863a243f2c91ffd4fce624c5afc42b6bd0e04e6f7cc767afd7" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8044,14 +8204,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-broker" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f369dabb59f4ec26bedb86f294f71b257e4d2e998a53693e45e711bc573627d" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "frame-benchmarking", @@ -8064,14 +8223,13 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-child-bounties" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eefafbc018dc5a69cec5b1a9bbbc02fd3191464825e0bd5f899d407dfd03b9" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8084,14 +8242,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-collator-selection" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b78dc5ba93d88d019eecb4d77f1ec95d8c288d9e9c4e039ab8a2dea039deea4" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8105,14 +8262,13 @@ dependencies = [ "scale-info", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-collective" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64984961a8667e8a16d2445fc98ac3229f9d01def0c1ae1e6f9ce859ec0fedbb" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8123,14 +8279,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-conviction-voting" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "242927ab508e5f1cb63aa851b7f5662f6886adb688c57458e05449c8ad0376dd" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8141,14 +8296,13 @@ dependencies = [ "serde", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-delegated-staking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72cfda2549b70198f2cdee30f8d72cae469a692f83b3072015062bc2dd6f473b" +version = "1.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8156,14 +8310,13 @@ dependencies = [ "scale-info", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-democracy" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "517babb26eb2d61c21b13730fd8f48d5024233278581cc342e017f3436260aff" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8175,14 +8328,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-election-provider-multi-phase" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cae34d714e3410bcdd932ce0dc927997125e1eaa083dacdeb700439f22b67b" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8198,15 +8350,14 @@ dependencies = [ "sp-io", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "strum 0.26.3", ] [[package]] name = "pallet-election-provider-support-benchmarking" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5153f459dd839fceb81e1d1df9413cc55f83b55fa110485fdb05f442015fb57" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8214,14 +8365,13 @@ dependencies = [ "parity-scale-codec", "sp-npos-elections", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-elections-phragmen" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3aa78c1c9f42026482ce7f3c051e89ba26a7a9b52246af6e58ee2ce51eb29e3" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8234,14 +8384,13 @@ dependencies = [ "sp-npos-elections", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-fast-unstake" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aad27a480c5d4a4705808b8267d38540d5dfeee50d1e7d5a1684d7bbf98a4aa2" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8254,14 +8403,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-grandpa" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cc1bf0bd43c8434b46af7de18f8863bfbbf56efcf8d340b238b511a52cfa03c" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8278,14 +8426,13 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-identity" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad181bf900fcea894911421496e05c4b2bc2dadea8c7d744af091a525af3a48" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "enumflags2", "frame-benchmarking", @@ -8296,14 +8443,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-im-online" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a23e720204fde0302206016aaf1e095ff808ff1a434ec6507d87a40258bfe1" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8317,14 +8463,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-indices" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "639b5e46336d35cb888325da0294e54e558d26be45f767ff26ddfca42b709801" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8335,14 +8480,13 @@ dependencies = [ "sp-io", "sp-keyring", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-membership" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d48c79ce463ee54a9c6bf4ea82405499abc24999fa64f4a4e8b6336829d68c7" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8353,14 +8497,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-message-queue" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8913838f2059495cd9f0c3f9a402346b2f00287b077f344a1b84f850a164d084" +version = "31.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "environmental", "frame-benchmarking", @@ -8373,15 +8516,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", ] [[package]] name = "pallet-mmr" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e836e2f38af303d9ae4c3b8ca512afe81279f2d6922223a8f571478740d09fb3" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8393,14 +8535,13 @@ dependencies = [ "sp-io", "sp-mmr-primitives", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-multisig" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acdab77a60e7fbf76239ad530d00029fa7f9bc2194155c3356221aa76d19868" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8410,14 +8551,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-nis" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6955efc279e63f4463ea29b45c81de013faa243e45a0155b0519df07d5e0a1fb" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8427,14 +8567,13 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-nomination-pools" -version = "32.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7faf96228372dcaf4c01e53ba59248b59a4a9ec994f30bee373110900f34c7bc" +version = "25.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8446,15 +8585,14 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-nomination-pools-benchmarking" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91b308c436d36e4159ec617e9e03e20a54aa4c2cd99729a411b969c1d9062392" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8467,28 +8605,26 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-runtime-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-nomination-pools-runtime-api" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e14836c36af92c218a801d6dbd84460210f8af7820df400c5ffed6ae15006c" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-offences" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2edc30910e938ef9df027aad650ea03644d0a33a604cec2267fce28951c0530" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8499,14 +8635,13 @@ dependencies = [ "serde", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-offences-benchmarking" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c605b2a3cf4eab08293ceb8f16a9352fcd71a27f0ab0dbdd8380946ab5800db6" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8524,14 +8659,13 @@ dependencies = [ "scale-info", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-parameters" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ca55799e0693fafb28342892d5f71a52f95e2ca279f940faf8a7bbb4c8b835" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8543,14 +8677,13 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-preimage" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17c6fa28b38ef4cf33203709e3610c89aa8299900c7d0096bdec7b9e90ab2d3" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8561,7 +8694,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -8587,15 +8720,14 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "pallet-proxy" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279b23df802b3edb41d04836cc2f97d59c358b3bd43d39b98fd1fe2e03204b87" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8604,14 +8736,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-ranked-collective" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aac3413b3e5620c0b83bc32855ea16f0c9381fea96b85ffbe9490cb648815c96" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8624,14 +8755,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-recovery" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fe5112bc7fe0282330e01a9c4fb58e42ed9030575eaf8479d54e3d6bd36f889" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8640,14 +8770,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-referenda" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c969360bab41c9d50cd99755408690f23241424c3cc15935dd6c47206fc9c23" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8660,14 +8789,13 @@ dependencies = [ "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-root-testing" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "059d0d7994b582126219f45410a9ef0c1db9655167ab4b84a9a16aafdb92ef1a" +version = "4.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8676,14 +8804,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-scheduler" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05840a0a1c517438d21873ad2279fea914eec836e1d76d15f29548a8ace6c707" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8694,15 +8821,14 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", ] [[package]] name = "pallet-session" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c77e7b0716fdf3cf8ecfcc872d583c972c4c9706842709a1112f26c51f701ae" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8717,15 +8843,14 @@ dependencies = [ "sp-session", "sp-staking", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", ] [[package]] name = "pallet-session-benchmarking" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42b450a525ea08dcdf4b3f33dce8796b2161c5c7917b99fba720d2fcd09b421b" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8736,14 +8861,13 @@ dependencies = [ "rand 0.8.5", "sp-runtime", "sp-session", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-society" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "236344aaf3ab6d088364aab2f284de04628bf1b7a187686347dbec7ecd0b8cc9" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8755,14 +8879,13 @@ dependencies = [ "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-staking" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f63dce0732789c9222056a3292576b7843aa1c7eb5e7e0fcb158dbab8f4455" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8779,14 +8902,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-staking-reward-curve" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5e6b1d8ee9d3f6894c5abd8c3e17737ed738c9854f87bfd16239741b7f4d5d" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", @@ -8796,9 +8918,8 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "988a7ebeacc84d4bdb0b12409681e956ffe35438447d8f8bc78db547cffb6ebc" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "sp-arithmetic", @@ -8806,9 +8927,8 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3350ef1795b832f4adc464e88fb6d44827bd3f98701b0b0bbee495267b444a92" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "sp-api", @@ -8817,9 +8937,8 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fdd28b85f5c5beb7659a0dee158155b6114dcc747c139f247df944cca132df2" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8830,14 +8949,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-sudo" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15062b0caa6194e3ab13a10a500b2ed4b9d5915bf30dda18833e1c3bbbf6e85" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8847,14 +8965,13 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-timestamp" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a42af51e32d3ea442e9aaabb935976e4154f89f3604bfb892a316e8d77c0d4" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8866,16 +8983,15 @@ dependencies = [ "sp-inherents", "sp-io", "sp-runtime", - "sp-std", - "sp-storage", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-timestamp", ] [[package]] name = "pallet-tips" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dae4a7f481f37cb839477dc1a2a8ce62ff962c25c48fbbad93631aa1c9fe0fa" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -8888,7 +9004,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -8908,7 +9024,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -8916,9 +9032,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349e56fa9f8c4093d912f0654e37b57ae628ad4b4fea67d9f3373e5dfcab2bcc" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -8928,14 +9043,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-transaction-payment-rpc" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e53aea571916432782288ba28ba2724a9564428c5b75a5b46dc13f633092708" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "pallet-transaction-payment-rpc-runtime-api", @@ -8950,9 +9064,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "331b2011bdf0ede2b607431360a94b7c3198f706bff63cd727c259e815f62389" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8963,9 +9076,8 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1317444c1dd38d7281db919b88331a9a76b483450a78f800d1cb76e21ce33563" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8978,14 +9090,13 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-tx-pause" -version = "16.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48a5a31cf8e954d9067cfede9cfac4a395a41460d6877025fe084c90af863574" +version = "9.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "frame-benchmarking", @@ -8997,14 +9108,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-utility" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489431d3b751d07853119fd250145273ea050e84565b3435b5b19c6d3f622b56" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -9014,14 +9124,13 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-vesting" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79641f9c6720a5f1705a0b7464c13a6cf4c0a3d3c9db523ed73c345130bcaadd" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -9030,14 +9139,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-whitelist" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8196f8403117eab3042f49bec96b80290e9bef678017073f62b409e5311476" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -9046,14 +9154,13 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "pallet-xcm" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870c71f937c78c722fc91a8f8fdf7bc0c74590eb01413eb17c5a72c405c9f134" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -9067,7 +9174,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -9076,9 +9183,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19da3779debfcbaecda285e8d240d0415cc7df7ff0b75bcaa227dbc2fa0cdb5c" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-benchmarking", "frame-support", @@ -9088,7 +9194,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -9096,9 +9202,8 @@ dependencies = [ [[package]] name = "parachains-common" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41525e5ddae2ae87949323fce5ba5e039ac5ceea2a76bcf34c6e794c111134f7" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -9119,7 +9224,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-parachain-info", "staging-xcm", "staging-xcm-executor", @@ -9429,9 +9534,8 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "polkadot-approval-distribution" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd2f7de61c3e30845822cf071fced5302ce8d8dd9127c8cadb1aac1d6a431d50" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "futures 0.3.30", @@ -9450,9 +9554,8 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ddd8c20cba24cc94df433357e90f542cfdd1d1835d6a3859dc379b7eeb7cb43" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "always-assert", "futures 0.3.30", @@ -9467,9 +9570,8 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca33cf1901a090ac35ffc991e6394cb8ba5020234d6e32a800f5051ce629b9" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "derive_more", "fatality", @@ -9492,9 +9594,8 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1817e10f78d6c8dafc63f25cc5e15e93cad4a1b861f8b8634fa6244441624582" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "fatality", @@ -9526,9 +9627,8 @@ dependencies = [ [[package]] name = "polkadot-cli" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecebd0f0e2dc1bcb521245c2ff2b76854407691cf782586eadd4a868f526aab9" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cfg-if", "clap", @@ -9555,9 +9655,8 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4440aad91c57574efb4a04e095570111d31c3a24d0fceb203973585243d74ae8" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "fatality", @@ -9578,22 +9677,20 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "polkadot-dispute-distribution" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afeea4e15a232d97e73be9acddded88df0749e583b6bc80ba5400e6f9a8ea912" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "derive_more", "fatality", @@ -9617,9 +9714,8 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a39a54a269817e09d602b4e9c527905f9e367ff7c6337b1b3e1e048515f6b59" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9632,9 +9728,8 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a5a4f4ef27ac178251ab064a2545e9e303e8fd1b1264b6df461e425b054065" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "futures-timer", @@ -9655,9 +9750,8 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc32407362fa5f8444067bf6b7942ae5f10dfc1a4bde056181a085381d9d60c" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "always-assert", "async-trait", @@ -9679,9 +9773,8 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d84116b4220e2f8f8c5c3933dc4a21c3c8751079b3d89c605121b44fd201e8" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "parity-scale-codec", @@ -9698,9 +9791,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e37706970e30cd57d2aa9d0ab57a6c25474c8bae0a2ef7b7dc4dc262ccd146" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "derive_more", @@ -9732,9 +9824,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "503d0c01f6b0f2ed31bd531ef9763719df4355b63d19e489a796912743afd423" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "futures 0.3.30", @@ -9755,9 +9846,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e5505fabfb2b9dcebc05f596c249b57a2b4dcb9d65d5655406fb1693f3f5db" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "fatality", @@ -9776,9 +9866,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af24edddafe308811f73dbd5a97b26a8ceb9a4ee1da5a6ae8487250b1930b0a" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "polkadot-node-subsystem", @@ -9792,9 +9881,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d16611223b95f59b3b3395b97807035114b7b3f4fc91cdea893981534e3a0bb" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -9814,9 +9902,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09318b543a6e7a1a7309e1841331e8a2d9f0c7ef2a2929efb75f296492cff36b" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "polkadot-node-metrics", @@ -9829,9 +9916,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "358fd0d04fa636c94b1fdead690d2049e580843cfd623a913297d791d0d9db23" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "futures-timer", @@ -9847,9 +9933,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef762a62e1c3894b01c7103710bb17fb8b4bb65444011d5e9e62a78933874d47" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "fatality", "futures 0.3.30", @@ -9867,9 +9952,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad8e655826a7a7f437e53331c6e1959930307c0ec9c174f100cb1a28f95267d" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -9885,9 +9969,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3899b61909cc0578ee72f73d67fca81865a2c8459df0a440df07a7203757f587" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "fatality", @@ -9903,9 +9986,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16da0e6b5778ac22802fb30c83e6a4e861f8386c8104a63ae0ed15cc959497c4" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "fatality", @@ -9922,9 +10004,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "147d797f376100bfb83dfff60cd86805e1ccbd5a6d3db76bc2adc73ce95c1818" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "always-assert", "array-bytes", @@ -9952,9 +10033,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39152f2c3b313cd901f3c9554a1622b4a2deacd539af3a7bfae6fbb94839ad9c" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "polkadot-node-primitives", @@ -9969,9 +10049,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8ab48ae1d313a9053153ad66cd9f80f26731feb54a7f03208d60076f1b3e188" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cpu-time", "futures 0.3.30", @@ -9987,18 +10066,17 @@ dependencies = [ "seccompiler", "sp-core", "sp-crypto-hashing", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-io", - "sp-tracing", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "tracing-gum", ] [[package]] name = "polkadot-node-core-runtime-api" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c19882aa444012ea6c610b473131b0f15ef12e3dd2f897125ef57b38fdc8acc" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "polkadot-node-metrics", @@ -10012,9 +10090,8 @@ dependencies = [ [[package]] name = "polkadot-node-jaeger" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd5e646fedc21914c77e682e8ec93f6d3440887fb076cd6b7b267f9bc193c025" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "lazy_static", "log", @@ -10032,9 +10109,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a808897db8b9c36f89f148febcbdb0a02b06f8938752113d8972f3a836d518" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bs58 0.5.1", "futures 0.3.30", @@ -10052,9 +10128,8 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745a85464f42b58fc645c020cbd78baa083e0ebf1af2b4f499eb466e19e405" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -10079,9 +10154,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "779833f70a1563ed042d3c6b831a45c5ea0f80caa8f4ede487f7bee3130168fb" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "bounded-vec", @@ -10103,9 +10177,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1496f6759e964605b18d744babe6b4c430f4c0f4580663179f85976deffc5e39" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "polkadot-node-jaeger", "polkadot-node-subsystem-types", @@ -10114,9 +10187,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ec11aa0eec2adede73aa14f0ebeb2794180f1b5322f0e75bfd1215d3f29b68" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "bitvec", @@ -10145,9 +10217,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaedb65dccd2fa8dc6c060fc93d11c73794f0b3ed3cbae20bd27159e16345785" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "derive_more", @@ -10182,9 +10253,8 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4004808b1cdfac76b38d4af1331f63a1ea4dabc64ce95526d2d2db2a637017cf" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -10205,9 +10275,8 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" +version = "6.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bounded-collections", "derive_more", @@ -10217,15 +10286,14 @@ dependencies = [ "serde", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", ] [[package]] name = "polkadot-primitives" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a4879609f4340138930c3c7313256941104a3ff6f7ecb2569d15223da9b35b2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "hex-literal 0.4.1", @@ -10246,14 +10314,13 @@ dependencies = [ "sp-keystore", "sp-runtime", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "polkadot-rpc" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e0ff61f56a02a50d5d894b966e2224c67b9d2b7e38043832480089a7ca11fd" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "mmr-rpc", @@ -10287,9 +10354,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "929499dd53b664110a787bd700030c0d5aa55ff5732556007e052711920933e8" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitvec", "frame-benchmarking", @@ -10330,7 +10396,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -10339,23 +10405,21 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17496ddf5f7bc75db80d8b5c8183a1fbc64d984c39238055c67bd45469d97e37" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bs58 0.5.1", "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "polkadot-runtime-parachains" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2502de64c7fea2a931712c3e0eb0830ed0af753115472c7ccb2b74c4eba61c65" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -10395,7 +10459,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", "static_assertions", @@ -10403,9 +10467,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a5439b90eedd716501595b789435d677e7f0aae24ee4c20081572bd4fa56a" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "frame-benchmarking", @@ -10507,7 +10570,7 @@ dependencies = [ "sp-runtime", "sp-session", "sp-state-machine", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-timestamp", "sp-transaction-pool", "sp-version", @@ -10522,9 +10585,8 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a14f12405ecfc8feab17a38756e3668619cd0df4613211c23e0258c24009c91" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "arrayvec 0.7.4", "bitvec", @@ -10546,9 +10608,8 @@ dependencies = [ [[package]] name = "polkadot-statement-table" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "947e9e3c8f71b9678f39a01f371a808b574823967dd9da187e6f886f5f08691c" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -11440,6 +11501,23 @@ dependencies = [ "subtle 2.6.1", ] +[[package]] +name = "ring" +version = "0.1.0" +source = "git+https://github.com/w3f/ring-proof#665f5f51af5734c7b6d90b985dd6861d4c5b4752" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "arrayvec 0.7.4", + "blake2 0.10.6", + "common", + "fflonk", + "merlin", +] + [[package]] name = "ring" version = "0.16.20" @@ -11513,9 +11591,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79fc69d149aa86315ff2338311308a6ae31734f179ca0f859cddd5df263422f2" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "binary-merkle-tree", "bitvec", @@ -11601,8 +11678,8 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", - "sp-storage", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-xcm", @@ -11615,9 +11692,8 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22bd236a3170000b05950c1bf5e91ae99d4f99b1186553a21756f0edacc721a9" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "polkadot-primitives", @@ -11912,21 +11988,19 @@ dependencies = [ [[package]] name = "sc-allocator" -version = "29.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b975ee3a95eaacb611e7b415737a7fa2db4d8ad7b880cc1b97371b04e95c7903" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "sp-core", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", ] [[package]] name = "sc-authority-discovery" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aed092c3af161b8e5000e3152a560f8ddec740c7827084a201c8346e85d79d" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -11956,9 +12030,8 @@ dependencies = [ [[package]] name = "sc-basic-authorship" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdeb3ce0b4f25daa0d3026c2d9f6a21654a798bc5d4dc931272b9b39533b9b09" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "futures-timer", @@ -11979,9 +12052,8 @@ dependencies = [ [[package]] name = "sc-block-builder" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6345fb862e10aaa7d88d6689a7c247448c40ae465253c83566dc76a17ec1426" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "sp-api", @@ -11995,9 +12067,8 @@ dependencies = [ [[package]] name = "sc-chain-spec" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae230af4bbf2f518da9fd2c710e2b1945011d993017ede3e0f816c6d825bb225" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "docify", @@ -12018,14 +12089,13 @@ dependencies = [ "sp-io", "sp-runtime", "sp-state-machine", - "sp-tracing", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sc-chain-spec-derive" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b18cef11d2c69703e0d7c3528202ef4ed1cd2b47a6f063e9e17cad8255b1fa94" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", @@ -12035,9 +12105,8 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a727a3ea99b22dd275fa49b05bcf2db195d444f9c3ca1c4388fd2334425f70" +version = "0.36.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "chrono", @@ -12077,9 +12146,8 @@ dependencies = [ [[package]] name = "sc-client-api" -version = "35.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bb517f4418644aeefd7c29bbe34bfc56ba8b5ea56e0b661a48a4d4d6afef40b" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "fnv", "futures 0.3.30", @@ -12094,20 +12162,19 @@ dependencies = [ "sp-consensus", "sp-core", "sp-database", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-runtime", "sp-state-machine", "sp-statement-store", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "substrate-prometheus-endpoint", ] [[package]] name = "sc-client-db" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e3c685871877f39df000ec446f65fc8d502a7cecfc437cdac59866349642dc3" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hash-db 0.16.0", "kvdb", @@ -12132,9 +12199,8 @@ dependencies = [ [[package]] name = "sc-consensus" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d7149e17ec363316391119f614ffb0da96284f4ed3aa1d67560687f627605b6" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -12158,9 +12224,8 @@ dependencies = [ [[package]] name = "sc-consensus-aura" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebdedb86c3939254d7b6a01352f1aef450aaab17b2886a8d233f79e753d77fda" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -12188,9 +12253,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9ef4db80306f8dca3ec37e05d4b7ab5bf4c5fe5a9cdc6a12ec7b95f01710d0" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "fork-tree", @@ -12225,9 +12289,8 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4336200d7a52573c7e4722b808763ee27db46353807b32300f59fe8114fa43c2" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "jsonrpsee", @@ -12248,9 +12311,8 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "893b263b88ffa7c92e23bf14132c132b932fb028fe411eacf43f69025f563417" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12285,9 +12347,8 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72636eba4c9565a1f1ccd9f18750c15d58122d972aec10c0559e157b9ab9ace6" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "jsonrpsee", @@ -12306,9 +12367,8 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d977b172eb79c6ae78179ef157032a899da449a2cfa093019c03a5e04f8f48a6" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "fork-tree", "parity-scale-codec", @@ -12320,9 +12380,8 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3380570b0c27d2c26dd16a3c73ea99e8b87c0a91b4d7e1e7332dd501d0250d95" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "ahash", "array-bytes", @@ -12365,9 +12424,8 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d7b01772a9d98bc263561fe89b87a2461dedd0d3aa38f05847039ff256020f3" +version = "0.19.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "finality-grandpa", "futures 0.3.30", @@ -12386,9 +12444,8 @@ dependencies = [ [[package]] name = "sc-consensus-manual-seal" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfef28e1339f7763efe699acec6051f69b4c55e348b66e69e4ae07850d32e5ed" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "assert_matches", "async-trait", @@ -12422,9 +12479,8 @@ dependencies = [ [[package]] name = "sc-consensus-slots" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75e3bfe4d5d4c031e747436291356b7c8bb8a5885a0e3b3a4916aa7eb359d8b2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -12446,9 +12502,8 @@ dependencies = [ [[package]] name = "sc-executor" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f5767bf6a6bad29365d6d08fcf940ee453d31457ed034cf14f0392877daafd" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -12458,47 +12513,44 @@ dependencies = [ "schnellru", "sp-api", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-io", "sp-panic-handler", - "sp-runtime-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "sp-version", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "tracing", ] [[package]] name = "sc-executor-common" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3b703a33dcb7cddf19176fdf12294b9a6408125836b0f4afee3e6969e7f190" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "polkavm", "sc-allocator", "sp-maybe-compressed-blob", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "wasm-instrument", ] [[package]] name = "sc-executor-polkavm" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fe58d9cacfab73e5595fa84b80f7bd03efebe54a0574daaeb221a1d1f7ab80" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "polkavm", "sc-executor-common", - "sp-wasm-interface", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sc-executor-wasmtime" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd498f2f77ec1f861c30804f5bfd796d4afcc8ce44ea1f11bfbe2847551d161" +version = "0.29.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "anyhow", "cfg-if", @@ -12508,16 +12560,15 @@ dependencies = [ "rustix 0.36.17", "sc-allocator", "sc-executor-common", - "sp-runtime-interface", - "sp-wasm-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "wasmtime", ] [[package]] name = "sc-informant" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec34fec99cdbc434918f9135c996af1f55e4c65d4247b7ecfeae47e957285588" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "ansi_term", "futures 0.3.30", @@ -12533,9 +12584,8 @@ dependencies = [ [[package]] name = "sc-keystore" -version = "32.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267c8cfaceaeecb25484bad8668c17036016e46053a23509d44486474dbf44d3" +version = "25.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "parking_lot 0.12.3", @@ -12548,9 +12598,8 @@ dependencies = [ [[package]] name = "sc-mixnet" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f295f4c06dfad60e8a5755a3866bb756bcd8208fa2f4d370c92fe2ec0de07c" +version = "0.4.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "arrayvec 0.7.4", @@ -12578,9 +12627,8 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dc1b9eea5954cd4cec2a13a264f5c54d2f43e155b4f1065eaf285fa602fce1c" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12630,9 +12678,8 @@ dependencies = [ [[package]] name = "sc-network-common" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a86e8a1a517986fd00fd2c963347f5f459241c2ae4e84083ca34b2078f79651" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -12649,9 +12696,8 @@ dependencies = [ [[package]] name = "sc-network-gossip" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17d8d4b7cc4eb58e9f1e73eb6ba84de8bb0101f14d5c688ae7bd5ff0535ed282" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "ahash", "futures 0.3.30", @@ -12670,9 +12716,8 @@ dependencies = [ [[package]] name = "sc-network-light" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404aeef08ca7be7c0980cec7e633b3fbc8e325fb6ec7817b38d1b4fa9f2636d2" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12692,9 +12737,8 @@ dependencies = [ [[package]] name = "sc-network-sync" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4599c3b68457fd150491074de9a3999030953bdc84a79780cb32e6a74c875be8" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12730,9 +12774,8 @@ dependencies = [ [[package]] name = "sc-network-transactions" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14f67c5914e801e660a6aca7e0055723530f694b98ef8b30df142c918fcb5a1" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "futures 0.3.30", @@ -12751,9 +12794,8 @@ dependencies = [ [[package]] name = "sc-network-types" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efe67b8d4050c438331b82969d40e4a1e665d0dfd9eb0a5e949c02b925b5484d" +version = "0.10.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bs58 0.5.1", "ed25519-dalek 2.1.1", @@ -12768,9 +12810,8 @@ dependencies = [ [[package]] name = "sc-offchain" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa5e3ad7b5bebfa1a48f77cf6bb415bac4c7642d645d69ab4bd4b5da85c74ddb" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "bytes", @@ -12794,7 +12835,7 @@ dependencies = [ "sc-utils", "sp-api", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-keystore", "sp-offchain", "sp-runtime", @@ -12804,9 +12845,8 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f680a0bed67dab19898624246376ba85d5f70a89859ba030830aacd079c28d3c" +version = "0.17.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -12814,9 +12854,8 @@ dependencies = [ [[package]] name = "sc-rpc" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cbee238062a62d441cd98694a0a9135c17bad13d8ccb3f54eba917cf14482e3" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "jsonrpsee", @@ -12847,9 +12886,8 @@ dependencies = [ [[package]] name = "sc-rpc-api" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383ce9ec80c14694256a55a4e70b9929d4559d9b1fc5decf2d344c39d94208" +version = "0.33.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -12868,9 +12906,8 @@ dependencies = [ [[package]] name = "sc-rpc-server" -version = "16.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5afa7a60f1f6349e61764c21f644c3d4549a7a45c097123746c68e84c0fb8738" +version = "11.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "forwarded-header-value", "futures 0.3.30", @@ -12889,9 +12926,8 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f6e14f8562b86f9e1a54fa287b2d26164c1b84871d51719a78976ec747e3e49" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "futures 0.3.30", @@ -12922,9 +12958,8 @@ dependencies = [ [[package]] name = "sc-service" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6b4822a49f75485f8d95c34818eef4ddd8a62e0c131f72fd7a680bf1ec2ef5" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "directories", @@ -12966,12 +13001,12 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-keystore", "sp-runtime", "sp-session", "sp-state-machine", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie", @@ -12987,9 +13022,8 @@ dependencies = [ [[package]] name = "sc-state-db" -version = "0.36.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f689d0b97c1bbdb2ca31b5f202bda195947f85c7fef990651cad202b99de896b" +version = "0.30.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "parity-scale-codec", @@ -12999,9 +13033,8 @@ dependencies = [ [[package]] name = "sc-storage-monitor" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d117c3945c524b9c0e30966359895f5ad551c2cd4ccbb677b53917fbad5039a" +version = "0.16.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "clap", "fs4", @@ -13013,9 +13046,8 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b92099c0a7713f3de81fcf353f0fa0cff8382c1fc7aa122b90df317d276cb113" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -13033,9 +13065,8 @@ dependencies = [ [[package]] name = "sc-sysinfo" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04295dc630eddd421eef0e4148b00b66cd85fdfba900916af140bc84dcbcfeaa" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "derive_more", "futures 0.3.30", @@ -13050,14 +13081,13 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-io", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sc-telemetry" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85ee91de6648ca949b8080fe8a787c1bf2d66311fec78fba52136959e0b9719c" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "chrono", "futures 0.3.30", @@ -13076,9 +13106,8 @@ dependencies = [ [[package]] name = "sc-tracing" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61151f2d6b7ce3d7174484414dbc4e2f64b05a144c8f0a59ea02284e6c748a19" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "ansi_term", "chrono", @@ -13098,18 +13127,17 @@ dependencies = [ "sp-core", "sp-rpc", "sp-runtime", - "sp-tracing", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "tracing", - "tracing-log 0.2.0", - "tracing-subscriber 0.3.18", + "tracing-log", + "tracing-subscriber", ] [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "151cdf86d79abf22cf2a240a7ca95041c908dbd96c2ae9a818073042aa210964" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", @@ -13119,9 +13147,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "800e35d0d2f2b8e17170ec961d58756fe7891026b19d889be388b9585cb12f90" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -13139,7 +13166,7 @@ dependencies = [ "sp-core", "sp-crypto-hashing", "sp-runtime", - "sp-tracing", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror", @@ -13147,9 +13174,8 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de6f60df6706970061e225e87d77aab9a764b258fe151b896a700419bc6b9d" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -13164,9 +13190,8 @@ dependencies = [ [[package]] name = "sc-utils" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf1bad736c230f16beb1cf48af9e69564df23b13aca9e5751a61266340b4bb5" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-channel 1.9.0", "futures 0.3.30", @@ -13672,15 +13697,14 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4d67aa9b1ccfd746c8529754c4ce06445b1d48e189567402ef856340a3a6b14" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "enumn", "parity-scale-codec", "paste", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -13867,9 +13891,8 @@ dependencies = [ [[package]] name = "sp-api" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e43fbf034e9dbaa8ffc6a238a22808777eb38c580f66fc6736d8511631789e" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hash-db 0.16.0", "log", @@ -13877,12 +13900,12 @@ dependencies = [ "scale-info", "sp-api-proc-macro", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-metadata-ir", "sp-runtime", - "sp-runtime-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-state-machine", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "sp-version", "thiserror", @@ -13890,9 +13913,8 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" +version = "15.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "Inflector", "blake2 0.10.6", @@ -13905,23 +13927,21 @@ dependencies = [ [[package]] name = "sp-application-crypto" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", "serde", "sp-core", "sp-io", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sp-arithmetic" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" +version = "23.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "integer-sqrt", @@ -13929,15 +13949,32 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.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 = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a4a1e45abc3277f18484ee0b0f9808e4206eb696ad38500c892c72f33480d69" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -13948,9 +13985,8 @@ dependencies = [ [[package]] name = "sp-block-builder" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf199dc4f9f77abd3fd91c409759118159ce6ffcd8bc90b229b684ccc8c981f" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "sp-api", "sp-inherents", @@ -13959,9 +13995,8 @@ dependencies = [ [[package]] name = "sp-blockchain" -version = "35.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f27eb18b6ddf7d663f4886f7edba3eb73bd102d68cf10802c1f862e3b3db32ab" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "futures 0.3.30", "log", @@ -13978,9 +14013,8 @@ dependencies = [ [[package]] name = "sp-consensus" -version = "0.39.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab094e8a7e9e5c7f05f8d90592aa1d1cf9b3f547d0dd401daff7ed98af942e12" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "futures 0.3.30", @@ -13994,9 +14028,8 @@ dependencies = [ [[package]] name = "sp-consensus-aura" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ebb90bf00f331b898eb729a1f707251846c1d5582d7467f083884799a69b89" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "parity-scale-codec", @@ -14011,9 +14044,8 @@ dependencies = [ [[package]] name = "sp-consensus-babe" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aa2de4c7100a3279658d8dd4affd8f92487528deae5cb4b40322717b9175ed5" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "parity-scale-codec", @@ -14030,9 +14062,8 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b277bc109da8e1c3768d3a046e1cd1ab687aabac821c976c5f510deb6f0bc8d3" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "lazy_static", "parity-scale-codec", @@ -14051,9 +14082,8 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dd06bf366c60f69411668b26d6ab3c55120aa6d423e6af0373ec23d8957300" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "finality-grandpa", "log", @@ -14069,9 +14099,8 @@ dependencies = [ [[package]] name = "sp-consensus-slots" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ca60d713f8ddb03bbebcc755d5e6463fdc0b6259fabfc4221b20a5f1e428fd" +version = "0.32.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -14081,11 +14110,11 @@ dependencies = [ [[package]] name = "sp-core" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", + "bandersnatch_vrfs", "bitflags 1.3.2", "blake2 0.10.6", "bounded-collections", @@ -14113,11 +14142,11 @@ dependencies = [ "secrecy", "serde", "sp-crypto-hashing", - "sp-debug-derive", - "sp-externalities", - "sp-runtime-interface", - "sp-std", - "sp-storage", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "ss58-registry", "substrate-bip39", "thiserror", @@ -14126,11 +14155,30 @@ dependencies = [ "zeroize", ] +[[package]] +name = "sp-crypto-ec-utils" +version = "0.10.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" +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 24.0.0 (git+https://github.com/paritytech/polkadot-sdk)", +] + [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9927a7f81334ed5b8a98a4a978c81324d12bd9713ec76b5c68fd410174c5eb" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "blake2b_simd", "byteorder", @@ -14143,8 +14191,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "quote", "sp-crypto-hashing", @@ -14154,8 +14201,7 @@ dependencies = [ [[package]] name = "sp-database" version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "722cbecdbf5b94578137dbd07feb51e95f7de221be0c1ff4dcfe0bb4cd986929" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -14164,8 +14210,17 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + +[[package]] +name = "sp-debug-derive" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "proc-macro2", "quote", @@ -14174,20 +14229,28 @@ dependencies = [ [[package]] name = "sp-externalities" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" +version = "0.25.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "environmental", "parity-scale-codec", - "sp-storage", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "sp-externalities" +version = "0.25.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" +dependencies = [ + "environmental", + "parity-scale-codec", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] name = "sp-genesis-builder" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcd065854d96fd81521c103d0aaa287d4f08b9b15c9fae2a3bfb208b0812bf44" +version = "0.8.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -14198,9 +14261,8 @@ dependencies = [ [[package]] name = "sp-inherents" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53407ba38ec22ca4a16381722c4bd0b559a0428bc1713079b0d5163ada63186a" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -14212,9 +14274,8 @@ dependencies = [ [[package]] name = "sp-io" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5036cad2e48d41f5caf6785226c8be1a7db15bec14a9fd7aa6cca84f34cf689f" +version = "30.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bytes", "ed25519-dalek 2.1.1", @@ -14226,12 +14287,12 @@ dependencies = [ "secp256k1", "sp-core", "sp-crypto-hashing", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-keystore", - "sp-runtime-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-state-machine", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-trie", "tracing", "tracing-core", @@ -14239,9 +14300,8 @@ dependencies = [ [[package]] name = "sp-keyring" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03536e1ff3ec2bd8181eeaa26c0d682ebdcbd01548a055cf591077188b8c3f0" +version = "31.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "sp-core", "sp-runtime", @@ -14250,21 +14310,19 @@ dependencies = [ [[package]] name = "sp-keystore" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" +version = "0.34.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c768c11afbe698a090386876911da4236af199cd38a5866748df4d8628aeff" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "thiserror", "zstd 0.12.4", @@ -14272,9 +14330,8 @@ dependencies = [ [[package]] name = "sp-metadata-ir" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" +version = "0.6.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-metadata", "parity-scale-codec", @@ -14283,9 +14340,8 @@ dependencies = [ [[package]] name = "sp-mixnet" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f65a570519da820ce3dc35053497a65f9fbd3f5a7dc81fa03078ca263e9311e" +version = "0.4.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -14295,9 +14351,8 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47412a2d2e988430d5f59d7fec1473f229e1ef5ce24c1ea4f601b4b3679cac52" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "log", "parity-scale-codec", @@ -14306,16 +14361,15 @@ dependencies = [ "serde", "sp-api", "sp-core", - "sp-debug-derive", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-runtime", "thiserror", ] [[package]] name = "sp-npos-elections" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0c51a7b60cd663f2661e6949069eb316b092f22c239691d5272a4d0cfca0fb" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -14327,9 +14381,8 @@ dependencies = [ [[package]] name = "sp-offchain" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbe721c367760bddf10fcfa24fb48edd64c442f71db971f043c8ac73f51aa6e9" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "sp-api", "sp-core", @@ -14339,8 +14392,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8f5a17a0a11de029a8b811cb6e8b32ce7e02183cc04a3e965c383246798c416" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "backtrace", "lazy_static", @@ -14349,9 +14401,8 @@ dependencies = [ [[package]] name = "sp-rpc" -version = "32.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45458f0955870a92b3969098d4f1f4e9b55b4282d9f1dc112a51bb5bb6584900" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "rustc-hash", "serde", @@ -14360,9 +14411,8 @@ dependencies = [ [[package]] name = "sp-runtime" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ef409c414546b655ec1e94aaea178e4a97e21284a91b24c762aebf836d3b49" +version = "31.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "docify", "either", @@ -14380,35 +14430,65 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-io", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", ] [[package]] name = "sp-runtime-interface" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bytes", "impl-trait-for-tuples", "parity-scale-codec", "polkavm-derive", "primitive-types", - "sp-externalities", - "sp-runtime-interface-proc-macro", - "sp-std", - "sp-storage", - "sp-tracing", - "sp-wasm-interface", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "static_assertions", +] + +[[package]] +name = "sp-runtime-interface" +version = "24.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" +dependencies = [ + "bytes", + "impl-trait-for-tuples", + "parity-scale-codec", + "polkavm-derive", + "primitive-types", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-runtime-interface-proc-macro 17.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk)", + "sp-wasm-interface 20.0.0 (git+https://github.com/paritytech/polkadot-sdk)", "static_assertions", ] [[package]] name = "sp-runtime-interface-proc-macro" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0195f32c628fee3ce1dfbbf2e7e52a30ea85f3589da9fe62a8b816d70fc06294" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.71", +] + +[[package]] +name = "sp-runtime-interface-proc-macro" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "Inflector", "expander", @@ -14420,9 +14500,8 @@ dependencies = [ [[package]] name = "sp-session" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4daf2e40ffc7e7e8de08efb860eb9534faf614a49c53dc282f430faedb4aed13" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "scale-info", @@ -14435,9 +14514,8 @@ dependencies = [ [[package]] name = "sp-staking" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0b7abfe66c07a3b6eb99e1286dfa9b6f3b057b0e986e7da2ccbf707f6c781a" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -14449,9 +14527,8 @@ dependencies = [ [[package]] name = "sp-state-machine" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "211e528aa6e902261a343f7b40840aa3d66fe4ad3aadbd04a035f10baf96dbc5" +version = "0.35.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hash-db 0.16.0", "log", @@ -14460,7 +14537,7 @@ dependencies = [ "rand 0.8.5", "smallvec", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-panic-handler", "sp-trie", "thiserror", @@ -14470,9 +14547,8 @@ dependencies = [ [[package]] name = "sp-statement-store" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03aa86b1b46549889d32348bc85a8135c725665115567507231a6d85712aaac" +version = "10.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "aes-gcm", "curve25519-dalek 4.1.3", @@ -14486,9 +14562,9 @@ dependencies = [ "sp-application-crypto", "sp-core", "sp-crypto-hashing", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-runtime", - "sp-runtime-interface", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "x25519-dalek 2.0.1", ] @@ -14496,27 +14572,41 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" + +[[package]] +name = "sp-std" +version = "14.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" [[package]] name = "sp-storage" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "impl-serde", + "parity-scale-codec", + "ref-cast", + "serde", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "sp-storage" +version = "19.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "impl-serde", "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk)", ] [[package]] name = "sp-timestamp" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "parity-scale-codec", @@ -14527,21 +14617,30 @@ dependencies = [ [[package]] name = "sp-tracing" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90b3decf116db9f1dfaf1f1597096b043d0e12c952d3bcdc018c6d6b77deec7e" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" +dependencies = [ + "parity-scale-codec", + "tracing", + "tracing-core", + "tracing-subscriber", +] + +[[package]] +name = "sp-tracing" +version = "16.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" dependencies = [ "parity-scale-codec", "tracing", "tracing-core", - "tracing-subscriber 0.2.25", + "tracing-subscriber", ] [[package]] name = "sp-transaction-pool" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c9d1604aadc15b70e95f4388d0b1aa380215520b7ddfd372531a6d8262269c" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "sp-api", "sp-runtime", @@ -14549,9 +14648,8 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b5a891cb913015bb99401e372255193cc3848c6fe5c2f6fe2383ef9588cb190" +version = "26.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "async-trait", "parity-scale-codec", @@ -14564,9 +14662,8 @@ dependencies = [ [[package]] name = "sp-trie" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "ahash", "hash-db 0.16.0", @@ -14579,7 +14676,7 @@ dependencies = [ "scale-info", "schnellru", "sp-core", - "sp-externalities", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "thiserror", "tracing", "trie-db", @@ -14588,9 +14685,8 @@ dependencies = [ [[package]] name = "sp-version" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bccf96fefae339dee7c4453f91be64eb28cce4c2fe82130445cf096b18b2c081" +version = "29.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "impl-serde", "parity-scale-codec", @@ -14599,16 +14695,15 @@ dependencies = [ "serde", "sp-crypto-hashing-proc-macro", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-version-proc-macro", "thiserror", ] [[package]] name = "sp-version-proc-macro" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" +version = "13.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "parity-scale-codec", "proc-macro2", @@ -14618,9 +14713,8 @@ dependencies = [ [[package]] name = "sp-wasm-interface" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b04b919e150b4736d85089d49327eab65507deb1485eec929af69daa2278eb3" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -14629,11 +14723,20 @@ dependencies = [ "wasmtime", ] +[[package]] +name = "sp-wasm-interface" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk#604f56f03db847a90aa4fdb13be6b80482a4dcd6" +dependencies = [ + "impl-trait-for-tuples", + "log", + "parity-scale-codec", +] + [[package]] name = "sp-weights" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -14641,7 +14744,7 @@ dependencies = [ "serde", "smallvec", "sp-arithmetic", - "sp-debug-derive", + "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] @@ -14698,9 +14801,8 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-node-inspect" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc0f95e4420cf39863c53ce5c05ee5c1fbd83d1c78c47bd16145193a621336c" +version = "0.12.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "clap", "parity-scale-codec", @@ -14717,9 +14819,8 @@ dependencies = [ [[package]] name = "staging-parachain-info" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eab4e71683cd8ceb50c1c77badc49772148699ffe33a3e4dbbdb5ea34d90e19" +version = "0.7.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -14727,14 +14828,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "staging-xcm" -version = "14.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "536c5c8f8f25589e714a3be6b068d174debcc882e648dc9b0c3bd6ce45434de3" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "bounded-collections", @@ -14751,9 +14851,8 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0517f2de0dd59ecc2693c0cb707ac30cee3d6576978b7287a4c3c9791b7792f" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -14766,7 +14865,7 @@ dependencies = [ "sp-arithmetic", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", "staging-xcm", "staging-xcm-executor", @@ -14774,9 +14873,8 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5b83ea34a2ba2083c6f5bfec468fb00535d0e0788a78237d06da32dba76be9" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "environmental", "frame-benchmarking", @@ -14789,7 +14887,7 @@ dependencies = [ "sp-core", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", "staging-xcm", ] @@ -14910,9 +15008,8 @@ dependencies = [ [[package]] name = "substrate-bip39" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" +version = "0.4.7" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -14924,8 +15021,7 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b285e7d183a32732fdc119f3d81b7915790191fad602b7c709ef247073c77a2e" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" [[package]] name = "substrate-fixed" @@ -14940,9 +15036,8 @@ dependencies = [ [[package]] name = "substrate-frame-rpc-system" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d077968f7a3352f4cd8791f9fc3553cca050fd3499f9ba602fe956813e8730d" +version = "28.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-system-rpc-runtime-api", "futures 0.3.30", @@ -14961,8 +15056,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8fe06b03b8a291c09507c42f92a2c2c10dd3d62975d02c7f64a92d87bfe09b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "hyper", "log", @@ -14973,9 +15067,8 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6abf207b8db70d0ed674fac384e616a4613a93cd7f91ec7e6103c075be4b23cc" +version = "27.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -15001,9 +15094,8 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" -version = "23.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dc993ad871b63fbba60362f3ea86583f5e7e1256e8fdcb3b5b249c9ead354bf" +version = "17.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "array-bytes", "build-helper", @@ -15019,7 +15111,7 @@ dependencies = [ "sp-core", "sp-io", "sp-maybe-compressed-blob", - "sp-tracing", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-version", "strum 0.26.3", "tempfile", @@ -15562,9 +15654,8 @@ dependencies = [ [[package]] name = "tracing-gum" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07f52b2b1a1c1c21094bd0b6fdcf1b7dbe785b937b30e82dba688d55d988efb" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "coarsetime", "polkadot-primitives", @@ -15575,8 +15666,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f074568687ffdfd0adb6005aa8d1d96840197f2c159f80471285f08694cf0ce" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "expander", "proc-macro-crate 3.1.0", @@ -15585,17 +15675,6 @@ dependencies = [ "syn 2.0.71", ] -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -15607,45 +15686,13 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" -dependencies = [ - "ansi_term", - "chrono", - "lazy_static", - "matchers 0.0.1", - "regex", - "serde", - "serde_json", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log 0.1.4", - "tracing-serde", -] - [[package]] name = "tracing-subscriber" version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ - "matchers 0.1.0", + "matchers", "nu-ansi-term", "once_cell", "parking_lot 0.12.3", @@ -15655,7 +15702,7 @@ dependencies = [ "thread_local", "tracing", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", ] [[package]] @@ -16446,9 +16493,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0623e48f65c5e5368c7044cbd09c79bfc6418b258ad31892936a203b8b5509a" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "binary-merkle-tree", "bitvec", @@ -16541,8 +16587,8 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-std", - "sp-storage", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-transaction-pool", "sp-version", "staging-xcm", @@ -16555,9 +16601,8 @@ dependencies = [ [[package]] name = "westend-runtime-constants" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c68089302095f1bf7fada4ab0a42aeee1d9b56280bcab18cf6359c35cae761b7" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "polkadot-primitives", @@ -16965,9 +17010,8 @@ dependencies = [ [[package]] name = "xcm-emulator" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fec574213c6c373641128fdea17886fb8a9ae5e3a5f25f80371ffd304dfa080" +version = "0.5.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-pallet-xcmp-queue", @@ -16992,33 +17036,31 @@ dependencies = [ "sp-crypto-hashing", "sp-io", "sp-runtime", - "sp-std", - "sp-tracing", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-tracing 16.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-executor", ] [[package]] name = "xcm-fee-payment-runtime-api" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d4261279994b1cb0d16a77cc12734fca18b88b56b65b8740de543af6d6a17dc" +version = "0.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "parity-scale-codec", "scale-info", "sp-api", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "sp-weights", "staging-xcm", ] [[package]] name = "xcm-procedural" -version = "10.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0fd01495dfeb643167557631b34b54d312c1e70cf7eb64249ab687d84fd6045" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "Inflector", "proc-macro2", @@ -17028,9 +17070,8 @@ dependencies = [ [[package]] name = "xcm-simulator" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39573710887ad79cec060cbb87bb6ea10cf79089b6aa733fc2b6e51762ae9397" +version = "7.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0#d5160c1d567cc73c7df6c816d41e21aa3adb188d" dependencies = [ "frame-support", "frame-system", @@ -17043,7 +17084,7 @@ dependencies = [ "scale-info", "sp-io", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", @@ -17075,7 +17116,7 @@ dependencies = [ [[package]] name = "zenlink-protocol" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "cumulus-primitives-core", "frame-benchmarking", @@ -17090,14 +17131,14 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "staging-xcm", ] [[package]] name = "zenlink-protocol-rpc" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -17113,18 +17154,18 @@ dependencies = [ [[package]] name = "zenlink-protocol-runtime-api" version = "0.4.4" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "zenlink-protocol", ] [[package]] name = "zenlink-stable-amm" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "frame-support", "frame-system", @@ -17135,13 +17176,13 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] [[package]] name = "zenlink-stable-amm-rpc" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "jsonrpsee", "parity-scale-codec", @@ -17155,18 +17196,18 @@ dependencies = [ [[package]] name = "zenlink-stable-amm-runtime-api" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "parity-scale-codec", "sp-api", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "zenlink-stable-amm", ] [[package]] name = "zenlink-swap-router" version = "0.1.0" -source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#c48976c0f8c18c1e724552978e2036710da0c145" +source = "git+https://github.com/bifrost-finance/Zenlink-DEX-Module?branch=release-polkadot-v1.13.0#64e75422be893afe8b5029ce831b7318748a99c6" dependencies = [ "frame-support", "frame-system", @@ -17177,7 +17218,7 @@ dependencies = [ "sp-arithmetic", "sp-core", "sp-runtime", - "sp-std", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", "zenlink-protocol", "zenlink-stable-amm", ] diff --git a/Cargo.toml b/Cargo.toml index 21a49140d..9166810dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -120,157 +120,157 @@ orml-xtokens = { git = "https://github.com/bifrost-finance/open-runtime-m orml-oracle = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } # polkadot-sdk (wasm) -cumulus-client-collator = { version = "0.14.0", default-features = false } -cumulus-client-consensus-proposer = { version = "0.14.0", default-features = false } -cumulus-pallet-aura-ext = { version = "0.14.0", default-features = false } -cumulus-pallet-parachain-system = { version = "0.14.0", default-features = false } -cumulus-pallet-xcm = { version = "0.14.0", default-features = false } -cumulus-pallet-xcmp-queue = { version = "0.14.0", default-features = false } -cumulus-primitives-core = { version = "0.14.0", default-features = false } -cumulus-primitives-parachain-inherent = { version = "0.14.0", default-features = false } -cumulus-primitives-timestamp = { version = "0.14.0", default-features = false } -cumulus-primitives-utility = { version = "0.14.0", default-features = false } -cumulus-test-relay-sproof-builder = { version = "0.14.0", default-features = false } -frame-benchmarking = { version = "35.0.0", default-features = false } -frame-executive = { version = "35.0.0", default-features = false } -frame-metadata-hash-extension = { version = "0.3.0", default-features = false } -frame-support = { version = "35.0.0", default-features = false } -frame-system = { version = "35.0.0", default-features = false } -frame-system-benchmarking = { version = "35.0.0", default-features = false } -frame-system-rpc-runtime-api = { version = "33.0.0", default-features = false } -frame-try-runtime = { version = "0.41.0", default-features = false } -pallet-assets = { version = "36.0.0", default-features = false } -pallet-asset-rate = { version = "14.0.0", default-features = false } -pallet-aura = { version = "34.0.0", default-features = false } -pallet-authority-discovery = { version = "35.0.0", default-features = false } -pallet-authorship = { version = "35.0.0", default-features = false } -pallet-balances = { version = "36.0.0", default-features = false } -pallet-bounties = { version = "34.0.0", default-features = false } -pallet-collator-selection = { version = "16.0.0", default-features = false } -pallet-collective = { version = "35.0.0", default-features = false } -pallet-conviction-voting = { version = "35.0.0", default-features = false } -pallet-democracy = { version = "35.0.0", default-features = false } -pallet-elections-phragmen = { version = "36.0.0", default-features = false } -pallet-identity = { version = "35.0.0", default-features = false } -pallet-im-online = { version = "34.0.0", default-features = false } -pallet-indices = { version = "35.0.0", default-features = false } -pallet-membership = { version = "35.0.0", default-features = false } -pallet-message-queue = { version = "38.0.0", default-features = false } -pallet-multisig = { version = "35.0.0", default-features = false } -pallet-preimage = { version = "35.0.0", default-features = false } -pallet-proxy = { version = "35.0.0", default-features = false } -pallet-ranked-collective = { version = "35.0.0", default-features = false } -pallet-recovery = { version = "35.0.0", default-features = false } -pallet-referenda = { version = "35.0.0", default-features = false } -pallet-scheduler = { version = "36.0.0", default-features = false } -pallet-session = { version = "35.0.0", default-features = false } -pallet-staking = { version = "35.0.0", default-features = false } -pallet-sudo = { version = "35.0.0", default-features = false } -pallet-timestamp = { version = "34.0.0", default-features = false } -pallet-tips = { version = "34.0.0", default-features = false } -pallet-tx-pause = { version = "16.0.0", default-features = false } -pallet-transaction-payment = { version = "35.0.0", default-features = false } -pallet-transaction-payment-rpc-runtime-api = { version = "35.0.0", default-features = false } -pallet-treasury = { version = "34.0.0", default-features = false } -pallet-utility = { version = "35.0.0", default-features = false } -pallet-whitelist = { version = "34.0.0", default-features = false } -pallet-xcm = { version = "14.0.0", default-features = false } -parachains-common = { version = "14.0.0", default-features = false } -parachain-info = { version = "0.14.0", package = "staging-parachain-info", default-features = false } -polkadot-core-primitives = { version = "14.0.0", default-features = false } -polkadot-parachain-primitives = { version = "13.0.0", default-features = false } -polkadot-primitives = { version = "14.0.0", default-features = false } -polkadot-runtime-common = { version = "14.0.0", default-features = false } -polkadot-runtime-parachains = { version = "14.0.0", default-features = false } -sp-api = { version = "33.0.0", default-features = false } -sp-application-crypto = { version = "37.0.0", default-features = false } -sp-arithmetic = { version = "26.0.0", default-features = false } -sp-authority-discovery = { version = "33.0.0", default-features = false } -sp-block-builder = { version = "33.0.0", default-features = false } -sp-blockchain = { version = "35.0.0", default-features = false } -sp-consensus = { version = "0.39.0", default-features = false } -sp-consensus-aura = { version = "0.39.0", default-features = false } -sp-consensus-slots = { version = "0.39.0", default-features = false } -sp-core = { version = "34.0.0", default-features = false } -sp-debug-derive = { version = "14.0.0", default-features = false } -sp-externalities = { version = "0.29.0", default-features = false } -sp-genesis-builder = { version = "0.14.0", default-features = false } -sp-inherents = { version = "33.0.0", default-features = false } -sp-io = { version = "37.0.0", default-features = false } -sp-keyring = { version = "38.0.0", default-features = false } -sp-keystore = { version = "0.40.0", default-features = false } -sp-maybe-compressed-blob = { version = "11.0.0", default-features = false } -sp-npos-elections = { version = "33.0.0", default-features = false } -sp-offchain = { version = "33.0.0", default-features = false } -sp-runtime = { version = "38.0.0", default-features = false } -sp-runtime-interface = { version = "28.0.0", default-features = false } -sp-session = { version = "34.0.0", default-features = false } -sp-staking = { version = "33.0.0", default-features = false } -sp-state-machine = { version = "0.42.0", default-features = false } -sp-std = { version = "14.0.0", default-features = false } -sp-storage = { version = "21.0.0", default-features = false } -sp-timestamp = { version = "33.0.0", default-features = false } -sp-tracing = { version = "17.0.0", default-features = false } -sp-transaction-pool = { version = "33.0.0", default-features = false } -sp-trie = { version = "36.0.0", default-features = false } -sp-version = { version = "36.0.0", default-features = false } -sp-wasm-interface = { version = "21.0.0", default-features = false } -sp-weights = { version = "31.0.0", default-features = false } +cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-pallet-aura-ext = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-pallet-parachain-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-pallet-xcmp-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-primitives-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-primitives-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-primitives-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-metadata-hash-extension = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +frame-try-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-assets = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-asset-rate = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-balances = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-bounties = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-conviction-voting = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-democracy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-elections-phragmen = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-identity = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-indices = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-membership = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-multisig = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-preimage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-proxy = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-ranked-collective = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-recovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-referenda = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-scheduler = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-sudo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-tips = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-tx-pause = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-transaction-payment = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-whitelist = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-parachain-info", default-features = false } +polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +polkadot-parachain-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-application-crypto = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-arithmetic = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-authority-discovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-block-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-blockchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-core = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-debug-derive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-externalities = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-genesis-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-inherents = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-io = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-keyring = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-maybe-compressed-blob = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-npos-elections = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-runtime-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-staking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-storage = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-wasm-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } +sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } substrate-fixed = { git = "https://github.com/encointer/substrate-fixed", default-features = false } -xcm = { version = "14.0.0", package = "staging-xcm", default-features = false } -xcm-builder = { version = "14.0.0", package = "staging-xcm-builder", default-features = false } -xcm-executor = { version = "14.0.0", package = "staging-xcm-executor", default-features = false } +xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-xcm", default-features = false } +xcm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-xcm-builder", default-features = false } +xcm-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-xcm-executor", default-features = false } # polkadot-sdk (client) -cumulus-client-cli = { version = "0.14.0" } -cumulus-client-consensus-aura = { version = "0.14.0" } -cumulus-client-consensus-common = { version = "0.14.0" } -cumulus-client-consensus-relay-chain = { version = "0.14.0" } -cumulus-client-network = { version = "0.14.0" } -cumulus-client-pov-recovery = { version = "0.14.0" } -cumulus-client-service = { version = "0.14.0" } -cumulus-relay-chain-inprocess-interface = { version = "0.14.0" } -cumulus-relay-chain-interface = { version = "0.14.0" } -cumulus-relay-chain-minimal-node = { version = "0.14.0" } -cumulus-relay-chain-rpc-interface = { version = "0.14.0" } -frame-benchmarking-cli = { version = "39.0.0" } -node-inspect = { version = "0.19.0", package = "staging-node-inspect" } -pallet-transaction-payment-rpc = { version = "37.0.0" } -polkadot-cli = { version = "14.0.0" } -polkadot-service = { version = "14.0.0" } -sc-basic-authorship = { version = "0.41.0" } -sc-chain-spec = { version = "34.0.0" } -sc-cli = { version = "0.43.0" } -sc-client-api = { version = "35.0.0" } -sc-consensus = { version = "0.40.0" } -sc-consensus-aura = { version = "0.41.0" } -sc-consensus-grandpa = { version = "0.26.0" } -sc-consensus-manual-seal = { version = "0.42.0" } -sc-consensus-slots = { version = "0.40.0" } -sc-executor = { version = "0.39.0" } -sc-keystore = { version = "32.0.0" } -sc-network = { version = "0.41.0" } -sc-network-common = { version = "0.40.0" } -sc-network-sync = { version = "0.40.0" } -sc-offchain = { version = "36.0.0" } -sc-rpc = { version = "36.0.0" } -sc-rpc-api = { version = "0.40.0" } -sc-rpc-server = { version = "16.0.1" } -sc-service = { version = "0.42.0" } -sc-sysinfo = { version = "34.0.0" } -sc-telemetry = { version = "21.0.0" } -sc-tracing = { version = "35.0.0" } -sc-transaction-pool = { version = "35.0.0" } -sc-transaction-pool-api = { version = "35.0.0" } -sp-consensus-babe = { version = "0.39.0" } -sp-rpc = { version = "32.0.0" } -substrate-build-script-utils = { version = "11.0.0" } -substrate-frame-rpc-system = { version = "35.0.0" } -substrate-prometheus-endpoint = { version = "0.17.0" } -substrate-wasm-builder = { version = "23.0.0" } -try-runtime-cli = { version = "0.39.0" } -xcm-emulator = { version = "0.12.0" } -xcm-simulator = { version = "14.0.0" } +cumulus-client-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-consensus-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-consensus-relay-chain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-pov-recovery = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-client-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-relay-chain-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-relay-chain-minimal-node = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +node-inspect = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", package = "staging-node-inspect" } +pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-chain-spec = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-client-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus-grandpa = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus-manual-seal = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-consensus-slots = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-executor = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-keystore = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-network = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-network-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-network-sync = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-offchain = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-rpc-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-rpc-server = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-telemetry = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-tracing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sp-consensus-babe = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +sp-rpc = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +substrate-prometheus-endpoint = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +substrate-wasm-builder = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +try-runtime-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } +xcm-simulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0" } # Other async-trait = { version = "0.1.76" } From 9e37e32b1c354737808f07f46d9338a39fffe6be Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Wed, 24 Jul 2024 22:20:48 +0800 Subject: [PATCH 16/22] Fix flexible_fee TransferTo (#1315) --- pallets/flexible-fee/src/lib.rs | 81 ++++++++++++++------------------- 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/pallets/flexible-fee/src/lib.rs b/pallets/flexible-fee/src/lib.rs index 764d2e1b6..421ea4274 100644 --- a/pallets/flexible-fee/src/lib.rs +++ b/pallets/flexible-fee/src/lib.rs @@ -69,6 +69,12 @@ pub type PositiveImbalanceOf = <::Currency as Currency>>::PositiveImbalance; pub type CallOf = ::RuntimeCall; +#[derive(Encode, Decode, Copy, Clone, Eq, PartialEq, RuntimeDebug, TypeInfo, MaxEncodedLen)] +pub enum TargetChain { + AssetHub, + RelayChain, +} + #[frame_support::pallet] pub mod pallet { use super::*; @@ -152,8 +158,8 @@ pub mod pallet { pub enum Event { TransferTo { from: T::AccountId, + target_chain: TargetChain, amount: BalanceOf, - dest_location: Location, }, FlexibleFeeExchanged { transaction_fee_currency: CurrencyIdOf, @@ -246,28 +252,20 @@ pub mod pallet { impl Pallet { #[transactional] fn handle_fee() -> DispatchResult { - let pending_transfer_to_assethub_account = - Self::get_fee_receiver(ExtraFeeName::StatemineTransfer); - let pending_transfer_to_assethub_amount = T::MultiCurrency::free_balance( - T::RelaychainCurrencyId::get(), - &pending_transfer_to_assethub_account, - ); - if pending_transfer_to_assethub_amount >= T::MinAssetHubExecutionFee::get() { - let dest_location = Location::new( - 1, - [ - Parachain(parachains::Statemine::ID), - AccountId32 { - network: None, - id: Sibling::from(T::ParachainId::get()).into_account_truncating(), - }, - ], - ); + let fee_receiver = Self::get_fee_receiver(ExtraFeeName::StatemineTransfer); + let fee_receiver_balance = + T::MultiCurrency::free_balance(T::RelaychainCurrencyId::get(), &fee_receiver); + if fee_receiver_balance >= T::MinAssetHubExecutionFee::get() { + T::MultiCurrency::withdraw( + T::RelaychainCurrencyId::get(), + &fee_receiver, + fee_receiver_balance, + )?; let asset: Asset = Asset { id: AssetId(Location::here()), fun: Fungible(UniqueSaturatedInto::::unique_saturated_into( - pending_transfer_to_assethub_amount, + fee_receiver_balance, )), }; @@ -325,38 +323,27 @@ impl Pallet { T::XcmRouter::deliver(ticket).map_err(|_| Error::::XcmExecutionFailed)?; Self::deposit_event(Event::TransferTo { - from: pending_transfer_to_assethub_account, - amount: pending_transfer_to_assethub_amount, - dest_location, + from: fee_receiver, + target_chain: TargetChain::AssetHub, + amount: fee_receiver_balance, }); } - let pending_transfer_to_relaychain_account = - Self::get_fee_receiver(ExtraFeeName::VoteVtoken); - let pending_transfer_to_relaychain_amount = T::MultiCurrency::free_balance( - T::RelaychainCurrencyId::get(), - &pending_transfer_to_relaychain_account, - ); - if pending_transfer_to_relaychain_amount >= T::MinRelaychainExecutionFee::get() { - let dest_location = Location::new( - 1, - [AccountId32 { - network: None, - id: ParaId::from(T::ParachainId::get()).into_account_truncating(), - }], - ); - let result = T::MultiCurrency::withdraw( + let fee_receiver = Self::get_fee_receiver(ExtraFeeName::VoteVtoken); + let fee_receiver_balance = + T::MultiCurrency::free_balance(T::RelaychainCurrencyId::get(), &fee_receiver); + if fee_receiver_balance >= T::MinRelaychainExecutionFee::get() { + T::MultiCurrency::withdraw( T::RelaychainCurrencyId::get(), - &pending_transfer_to_relaychain_account, - pending_transfer_to_relaychain_amount, - ); - if result.is_ok() { - Self::deposit_event(Event::TransferTo { - from: pending_transfer_to_relaychain_account, - amount: pending_transfer_to_relaychain_amount, - dest_location, - }); - } + &fee_receiver, + fee_receiver_balance, + )?; + + Self::deposit_event(Event::TransferTo { + from: fee_receiver, + target_chain: TargetChain::RelayChain, + amount: fee_receiver_balance, + }); } Ok(()) From 14da5c89340b5d78f82e8ef0148e528a3251604c Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Fri, 26 Jul 2024 18:28:48 +0800 Subject: [PATCH 17/22] Fix generate_genesis_state (#1317) --- node/service/src/collator_kusama.rs | 12 +++++++----- node/service/src/collator_polkadot.rs | 11 +++++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/node/service/src/collator_kusama.rs b/node/service/src/collator_kusama.rs index 46013eb56..4e55baad0 100644 --- a/node/service/src/collator_kusama.rs +++ b/node/service/src/collator_kusama.rs @@ -51,12 +51,13 @@ use sp_keystore::KeystorePtr; use substrate_prometheus_endpoint::Registry; #[cfg(not(feature = "runtime-benchmarks"))] -type HostFunctions = sp_io::SubstrateHostFunctions; +type HostFunctions = cumulus_client_service::ParachainHostFunctions; #[cfg(feature = "runtime-benchmarks")] -type HostFunctions = - (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions); - +type HostFunctions = ( + cumulus_client_service::ParachainHostFunctions, + frame_benchmarking::benchmarking::HostFunctions, +); pub type FullBackend = TFullBackend; pub type FullClient = TFullClient>; pub type MaybeFullSelectChain = Option>; @@ -100,10 +101,11 @@ pub fn new_partial( .build(); let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::( + sc_service::new_full_parts_record_import::( config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), executor, + true, )?; let client = Arc::new(client); diff --git a/node/service/src/collator_polkadot.rs b/node/service/src/collator_polkadot.rs index 92c180cc7..e74fadade 100644 --- a/node/service/src/collator_polkadot.rs +++ b/node/service/src/collator_polkadot.rs @@ -51,11 +51,13 @@ use sp_keystore::KeystorePtr; use substrate_prometheus_endpoint::Registry; #[cfg(not(feature = "runtime-benchmarks"))] -type HostFunctions = sp_io::SubstrateHostFunctions; +type HostFunctions = cumulus_client_service::ParachainHostFunctions; #[cfg(feature = "runtime-benchmarks")] -type HostFunctions = - (sp_io::SubstrateHostFunctions, frame_benchmarking::benchmarking::HostFunctions); +type HostFunctions = ( + cumulus_client_service::ParachainHostFunctions, + frame_benchmarking::benchmarking::HostFunctions, +); pub type FullBackend = TFullBackend; pub type FullClient = TFullClient>; @@ -100,10 +102,11 @@ pub fn new_partial( .build(); let (client, backend, keystore_container, task_manager) = - sc_service::new_full_parts::( + sc_service::new_full_parts_record_import::( config, telemetry.as_ref().map(|(_, telemetry)| telemetry.handle()), executor, + true, )?; let client = Arc::new(client); From 3d2b54096baec763eb291281170b0ff8e9066bd0 Mon Sep 17 00:00:00 2001 From: yooml Date: Mon, 29 Jul 2024 22:04:32 +0800 Subject: [PATCH 18/22] Optimize oracle (#1318) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * refactor: 💡 optimize orml-oracle * fix: 🐛 MinimumTimestampInterval * style: 💄 rename to MaximumValueInterval --- Cargo.lock | 16 ++++++++-------- pallets/prices/src/lib.rs | 2 +- runtime/bifrost-kusama/src/lib.rs | 15 ++++++++++++--- runtime/bifrost-polkadot/src/lib.rs | 15 ++++++++++++--- 4 files changed, 33 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59ff69c81..fabfe194f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7829,7 +7829,7 @@ dependencies = [ [[package]] name = "orml-oracle" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-benchmarking", "frame-support", @@ -7848,7 +7848,7 @@ dependencies = [ [[package]] name = "orml-tokens" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "frame-system", @@ -7865,7 +7865,7 @@ dependencies = [ [[package]] name = "orml-traits" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -7885,7 +7885,7 @@ dependencies = [ [[package]] name = "orml-unknown-tokens" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "frame-system", @@ -7900,7 +7900,7 @@ dependencies = [ [[package]] name = "orml-utilities" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "parity-scale-codec", @@ -7915,7 +7915,7 @@ dependencies = [ [[package]] name = "orml-xcm" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "frame-system", @@ -7929,7 +7929,7 @@ dependencies = [ [[package]] name = "orml-xcm-support" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "orml-traits", @@ -7943,7 +7943,7 @@ dependencies = [ [[package]] name = "orml-xtokens" version = "0.13.0" -source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#809507e5290453afde82e8954c502260e7e59bd7" +source = "git+https://github.com/bifrost-finance/open-runtime-module-library?branch=release-polkadot-v1.13.0#a7ea052e958275502022b25f1fc1e5b0e146fe51" dependencies = [ "frame-support", "frame-system", diff --git a/pallets/prices/src/lib.rs b/pallets/prices/src/lib.rs index 28339aa0b..3668e2b1e 100644 --- a/pallets/prices/src/lib.rs +++ b/pallets/prices/src/lib.rs @@ -27,7 +27,7 @@ use bifrost_primitives::*; use frame_support::{dispatch::DispatchClass, pallet_prelude::*, transactional}; use frame_system::pallet_prelude::*; use log; -use orml_traits::{DataFeeder, DataProvider, DataProviderExtended}; +use orml_oracle::{DataFeeder, DataProvider, DataProviderExtended}; pub use pallet::*; use pallet_traits::*; use sp_runtime::{traits::CheckedDiv, FixedU128}; diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index bc8e30c08..9118a5d5b 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -56,7 +56,7 @@ use sp_runtime::{ AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, StaticLookup, Zero, }, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, DispatchResult, Perbill, Permill, RuntimeDebug, + ApplyExtrinsicResult, DispatchError, DispatchResult, FixedU128, Perbill, Permill, RuntimeDebug, SaturatedConversion, }; use sp_std::{marker::PhantomData, prelude::*}; @@ -1608,14 +1608,22 @@ parameter_types! { pub const ExpiresIn: Moment = 1000 * 60 * 60; // 60 mins pub const MaxHasDispatchedSize: u32 = 100; pub OracleRootOperatorAccountId: AccountId = OraclePalletId::get().into_account_truncating(); + pub const MinimumTimestampInterval: Moment = 1000 * 60 * 10; // 10 mins + pub const MaximumValueInterval: Price = FixedU128::from_inner(3_000_000_000_000_000); // 0.3% } type BifrostDataProvider = orml_oracle::Instance1; impl orml_oracle::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnNewData = (); - type CombineData = - orml_oracle::DefaultCombineData; + type CombineData = orml_oracle::DefaultCombineData< + Runtime, + MinimumCount, + ExpiresIn, + MinimumTimestampInterval, + MaximumValueInterval, + BifrostDataProvider, + >; type Time = Timestamp; type OracleKey = CurrencyId; type OracleValue = Price; @@ -1624,6 +1632,7 @@ impl orml_oracle::Config for Runtime { type WeightInfo = weights::orml_oracle::WeightInfo; type Members = OracleMembership; type MaxFeedValues = ConstU32<100>; + type ControlOrigin = TechAdminOrCouncil; } pub type TimeStampedPrice = orml_oracle::TimestampedValue; diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index c015b9b11..771777e8c 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -56,7 +56,7 @@ use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, Zero}, transaction_validity::{TransactionSource, TransactionValidity}, - ApplyExtrinsicResult, DispatchError, DispatchResult, Perbill, Permill, RuntimeDebug, + ApplyExtrinsicResult, DispatchError, DispatchResult, FixedU128, Perbill, Permill, RuntimeDebug, }; use sp_std::{marker::PhantomData, prelude::*}; #[cfg(feature = "std")] @@ -1424,14 +1424,22 @@ parameter_types! { pub const ExpiresIn: Moment = 1000 * 60 * 60; // 60 mins pub const MaxHasDispatchedSize: u32 = 100; pub OracleRootOperatorAccountId: AccountId = OraclePalletId::get().into_account_truncating(); + pub const MinimumTimestampInterval: Moment = 1000 * 60 * 10; // 10 mins + pub const MaximumValueInterval: Price = FixedU128::from_inner(3_000_000_000_000_000); // 0.3% } type BifrostDataProvider = orml_oracle::Instance1; impl orml_oracle::Config for Runtime { type RuntimeEvent = RuntimeEvent; type OnNewData = (); - type CombineData = - orml_oracle::DefaultCombineData; + type CombineData = orml_oracle::DefaultCombineData< + Runtime, + MinimumCount, + ExpiresIn, + MinimumTimestampInterval, + MaximumValueInterval, + BifrostDataProvider, + >; type Time = Timestamp; type OracleKey = CurrencyId; type OracleValue = Price; @@ -1440,6 +1448,7 @@ impl orml_oracle::Config for Runtime { type WeightInfo = weights::orml_oracle::WeightInfo; type Members = OracleMembership; type MaxFeedValues = ConstU32<100>; + type ControlOrigin = TechAdminOrCouncil; } pub type TimeStampedPrice = orml_oracle::TimestampedValue; From 0888a543fe93d0a7bc2bf6bee96232062eab9d48 Mon Sep 17 00:00:00 2001 From: Gemma Date: Tue, 30 Jul 2024 09:47:11 +0800 Subject: [PATCH 19/22] Add some tests for ve-minting --- pallets/ve-minting/rpc/src/lib.rs | 7 +- pallets/ve-minting/src/incentive.rs | 12 +- pallets/ve-minting/src/tests.rs | 230 ++++++++++++++++++++++++++++ 3 files changed, 247 insertions(+), 2 deletions(-) diff --git a/pallets/ve-minting/rpc/src/lib.rs b/pallets/ve-minting/rpc/src/lib.rs index d55fe6b5d..b5f75dcde 100644 --- a/pallets/ve-minting/rpc/src/lib.rs +++ b/pallets/ve-minting/rpc/src/lib.rs @@ -41,10 +41,12 @@ pub trait VeMintingRpcApi { /// rpc method for getting user balance #[method(name = "ve_minting_balanceOf")] fn balance_of(&self, who: AccountId, at: Option) -> RpcResult; - + + /// RPC method to get total supply #[method(name = "ve_minting_totalSupply")] fn total_supply(&self, at: Option) -> RpcResult; + /// RPC method to find block epoch #[method(name = "ve_minting_findBlockEpoch")] fn find_block_epoch(&self, max_epoch: U256, at: Option) -> RpcResult; } @@ -75,6 +77,7 @@ where AccountId: Codec, // CallError: From<>::Error>, { + /// Get the balance of the user at a specific block hash fn balance_of( &self, who: AccountId, @@ -109,6 +112,7 @@ where } } + /// Get the total supply at a specific block hash fn total_supply(&self, at: Option<::Hash>) -> RpcResult { let lm_rpc_api = self.client.runtime_api(); let at = at.unwrap_or_else(|| self.client.info().best_hash); @@ -139,6 +143,7 @@ where } } + /// Find the block epoch given a max epoch and block hash fn find_block_epoch( &self, max_epoch: U256, diff --git a/pallets/ve-minting/src/incentive.rs b/pallets/ve-minting/src/incentive.rs index 5af370683..ad27061c9 100644 --- a/pallets/ve-minting/src/incentive.rs +++ b/pallets/ve-minting/src/incentive.rs @@ -53,6 +53,7 @@ where } impl Pallet { + /// Check if the current block number is within the end time of the reward pool pub fn last_time_reward_applicable(pool_id: PoolId) -> BlockNumberFor { let current_block_number: BlockNumberFor = frame_system::Pallet::::block_number(); if current_block_number < Self::incentive_configs(pool_id).period_finish { @@ -62,6 +63,7 @@ impl Pallet { } } + /// Calculate the reward per token for the given pool pub fn reward_per_token( pool_id: PoolId, ) -> Result, BalanceOf>, DispatchError> { @@ -71,6 +73,7 @@ impl Pallet { if total_supply == BalanceOf::::zero() { return Ok(conf.reward_per_token_stored); } + // Iterate over each currency and its associated reward rate conf.reward_rate.iter().try_for_each(|(currency, &reward)| -> DispatchResult { let increment: BalanceOf = U512::from( Self::last_time_reward_applicable(pool_id) @@ -97,6 +100,7 @@ impl Pallet { Ok(conf.reward_per_token_stored) } + /// Calculates the reward earned by an account from a specific reward pool pub fn earned( pool_id: PoolId, addr: &AccountIdOf, @@ -128,6 +132,7 @@ impl Pallet { // .map_err(|_| ArithmeticError::Overflow)? // .unique_saturated_into(); + // If share information is provided, calculate the reward based on the individual share and total share. match share_info { Some((share, total_share)) => { let reward = increment @@ -145,6 +150,7 @@ impl Pallet { }) .or_insert(reward); }, + // If no share information is provided, calculate the reward directly None => { let reward = u128::try_from(increment) .map_err(|_| ArithmeticError::Overflow)? @@ -175,8 +181,10 @@ impl Pallet { item.reward_per_token_stored = reward_per_token_stored.clone(); item.last_update_time = Self::last_time_reward_applicable(pool_id); }); + // If an account address is provided, update the rewards if let Some(address) = addr { let earned = Self::earned(pool_id, address, share_info)?; + // If the account has earned rewards, update the rewards storage if earned != BTreeMap::, BalanceOf>::default() { Rewards::::insert(address, earned); } @@ -185,12 +193,14 @@ impl Pallet { Ok(()) } + /// Update reward for all pools pub fn update_reward_all(addr: Option<&AccountIdOf>) -> DispatchResult { // TODO: pool_id Self::update_reward(0, addr, None)?; Ok(()) } + ///Transfer rewards into an account pub fn get_rewards_inner( pool_id: PoolId, addr: &AccountIdOf, @@ -199,7 +209,7 @@ impl Pallet { Self::update_reward(pool_id, Some(addr), share_info)?; if Self::balance_of_current_block(addr)? == BalanceOf::::zero() { return Ok(()); - } + } // Excit earlier if balance of token is zero if let Some(rewards) = Self::rewards(addr) { rewards.iter().try_for_each(|(currency, &reward)| -> DispatchResult { T::MultiCurrency::transfer( diff --git a/pallets/ve-minting/src/tests.rs b/pallets/ve-minting/src/tests.rs index ce606d4a2..1f545ad22 100644 --- a/pallets/ve-minting/src/tests.rs +++ b/pallets/ve-minting/src/tests.rs @@ -27,6 +27,7 @@ use bifrost_runtime_common::milli; use frame_support::{assert_noop, assert_ok}; const POSITIONID0: u128 = 0; +const POSITIONID1: u128 = 1; const POOLID0: PoolId = 0; #[test] @@ -50,6 +51,38 @@ fn create_lock_should_work() { }); } +#[test] +fn create_multi_locks_should_work() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + (4 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(1)), + Point { bias: 9972575751740, slope: 951293, block: 20, amount: 10000000000000 } + ); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(9972575751740)); + assert_eq!(VeMinting::total_supply(System::block_number()), Ok(9972575751740)); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 5_000_000_000_000, + System::block_number() + (2 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(1)), + Point { bias: 2493136560680, slope: 475646, block: 20, amount: 5000000000000 } + ); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(12465712312420)); + assert_eq!(VeMinting::total_supply(System::block_number()), Ok(12465712312420)); + }); +} + #[test] fn increase_unlock_time_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -86,6 +119,68 @@ fn increase_unlock_time_should_work() { }); } +#[test] +fn increase_unlock_time_should_work2() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 7 * 86400 / 12); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + (3 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!(Locked::::get(POSITIONID0).end, 7963200); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(7527391250400)); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 5_000_000_000_000, + System::block_number() + (3 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!(Locked::::get(POSITIONID1).end, 7963200); + assert_noop!( + VeMinting::increase_unlock_time( + RuntimeOrigin::signed(BOB), + POSITIONID0, + System::block_number() + 365 * 86400 / 12 + ), + Error::::ArgumentsError + ); + assert_noop!( + VeMinting::increase_unlock_time( + RuntimeOrigin::signed(BOB), + POSITIONID1, + System::block_number() + 365 * 86400 / 12 + ), + Error::::ArgumentsError + ); + assert_ok!(VeMinting::increase_unlock_time( + RuntimeOrigin::signed(BOB), + POSITIONID0, + (365 * 86400 - 5 * 86400) / 12 + )); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(13784231613600)); + assert_ok!(VeMinting::increase_unlock_time( + RuntimeOrigin::signed(BOB), + POSITIONID1, + (365 * 86400 - 5 * 86400) / 12 + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(1)), + Point { bias: 7527391250400, slope: 951293, block: 50400, amount: 10000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID0).end, 10584000); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(1)), + Point { bias: 3763691668800, slope: 475646, block: 50400, amount: 5000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID1).end, 10584000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(15030804650400)); + assert_eq!(VeMinting::total_supply(System::block_number()), Ok(15030804650400)); + }); +} + #[test] fn update_reward() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -315,6 +410,45 @@ fn deposit_markup_before_lock_should_work() { }); } +#[test] +fn deposit_markup_before_lock_should_work2() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VBNC, + FixedU128::from_inner(100_000_000_000_000_000), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000)); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::one()), + Point { bias: 2796030953200, slope: 1046740, block: 20, amount: 11003333333333 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::one()), + Point { bias: 4194046429800, slope: 1570110, block: 20, amount: 16504999999999 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(2796030953200 + 4194046429800)); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(2796030953200 + 4194046429800)); + }); +} + #[test] fn deposit_markup_after_lock_should_work2() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -476,6 +610,53 @@ fn redeem_unlock_should_work() { }); } +#[test] +fn withdraw_markup_after_lock_should_work3() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VBNC, + FixedU128::from_inner(100_000_000_000_000_000), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000)); + assert_ok!(VeMinting::withdraw_markup(RuntimeOrigin::signed(BOB), VBNC)); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(2)), + Point { bias: 2796030953200, slope: 1046740, block: 20, amount: 11003333333333 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(3)), + Point { bias: 2541074835740, slope: 951293, block: 20, amount: 10000000000000 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(2)), + Point { bias: 4194046429800, slope: 1570110, block: 20, amount: 16504999999999 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(3)), + Point { bias: 3811613589200, slope: 1426940, block: 20, amount: 15000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(6352688424940)); + }); +} + #[test] fn redeem_unlock_after_360_days_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { @@ -514,6 +695,55 @@ fn redeem_unlock_after_360_days_should_work() { }); } +#[test] +fn redeem_unlock_after_360_days_should_work2() { + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VKSM, + FixedU128::from_inner(FixedU128::DIV / 10), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VKSM, 10_000_000_000_000)); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(0)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 1000000000000000); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 1000000000000000).is_ok(), true); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::one()), + Point { bias: 5082152342660, slope: 1902587, block: 20, amount: 20000000000000 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::one()), + Point { bias: 7623229849580, slope: 2853881, block: 20, amount: 30000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(12705382192240)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 1_000_000_000_000_000); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 1_000_000_000_000_000).is_ok(), false); + System::set_block_number(System::block_number() + 360 * 86400 / 12); + assert_ok!(VeMinting::redeem_unlock(RuntimeOrigin::signed(BOB), POSITIONID0)); + assert_ok!(VeMinting::redeem_unlock(RuntimeOrigin::signed(BOB), POSITIONID1)); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(0)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 998341660825205); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 998341660825205).is_ok(), true); + }); +} + #[test] fn refresh_should_work() { ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { From ae833cb5f9f66c9c3d88d673f7901c1321a496d7 Mon Sep 17 00:00:00 2001 From: Gemma Date: Tue, 30 Jul 2024 09:54:09 +0800 Subject: [PATCH 20/22] Add some tests for ve-minting --- pallets/ve-minting/rpc/src/lib.rs | 2 +- pallets/ve-minting/src/incentive.rs | 5 +- pallets/ve-minting/src/tests.rs | 304 ++++++++++++++-------------- 3 files changed, 159 insertions(+), 152 deletions(-) diff --git a/pallets/ve-minting/rpc/src/lib.rs b/pallets/ve-minting/rpc/src/lib.rs index b5f75dcde..944d53838 100644 --- a/pallets/ve-minting/rpc/src/lib.rs +++ b/pallets/ve-minting/rpc/src/lib.rs @@ -41,7 +41,7 @@ pub trait VeMintingRpcApi { /// rpc method for getting user balance #[method(name = "ve_minting_balanceOf")] fn balance_of(&self, who: AccountId, at: Option) -> RpcResult; - + /// RPC method to get total supply #[method(name = "ve_minting_totalSupply")] fn total_supply(&self, at: Option) -> RpcResult; diff --git a/pallets/ve-minting/src/incentive.rs b/pallets/ve-minting/src/incentive.rs index ad27061c9..cbbbb7a77 100644 --- a/pallets/ve-minting/src/incentive.rs +++ b/pallets/ve-minting/src/incentive.rs @@ -132,7 +132,8 @@ impl Pallet { // .map_err(|_| ArithmeticError::Overflow)? // .unique_saturated_into(); - // If share information is provided, calculate the reward based on the individual share and total share. + // If share information is provided, calculate the reward based on the individual share + // and total share. match share_info { Some((share, total_share)) => { let reward = increment @@ -181,7 +182,7 @@ impl Pallet { item.reward_per_token_stored = reward_per_token_stored.clone(); item.last_update_time = Self::last_time_reward_applicable(pool_id); }); - // If an account address is provided, update the rewards + // If an account address is provided, update the rewards if let Some(address) = addr { let earned = Self::earned(pool_id, address, share_info)?; // If the account has earned rewards, update the rewards storage diff --git a/pallets/ve-minting/src/tests.rs b/pallets/ve-minting/src/tests.rs index 1f545ad22..78247e72e 100644 --- a/pallets/ve-minting/src/tests.rs +++ b/pallets/ve-minting/src/tests.rs @@ -53,34 +53,34 @@ fn create_lock_should_work() { #[test] fn create_multi_locks_should_work() { - ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { - asset_registry(); - System::set_block_number(System::block_number() + 20); - - assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); - assert_ok!(VeMinting::create_lock_inner( - &BOB, - 10_000_000_000_000, - System::block_number() + (4 * 365 * 86400 - 5 * 86400) / 12, - )); - assert_eq!( - UserPointHistory::::get(POSITIONID0, U256::from(1)), - Point { bias: 9972575751740, slope: 951293, block: 20, amount: 10000000000000 } - ); - assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(9972575751740)); - assert_eq!(VeMinting::total_supply(System::block_number()), Ok(9972575751740)); - assert_ok!(VeMinting::create_lock_inner( - &BOB, - 5_000_000_000_000, - System::block_number() + (2 * 365 * 86400 - 5 * 86400) / 12, - )); - assert_eq!( - UserPointHistory::::get(POSITIONID1, U256::from(1)), - Point { bias: 2493136560680, slope: 475646, block: 20, amount: 5000000000000 } - ); - assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(12465712312420)); - assert_eq!(VeMinting::total_supply(System::block_number()), Ok(12465712312420)); - }); + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + (4 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(1)), + Point { bias: 9972575751740, slope: 951293, block: 20, amount: 10000000000000 } + ); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(9972575751740)); + assert_eq!(VeMinting::total_supply(System::block_number()), Ok(9972575751740)); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 5_000_000_000_000, + System::block_number() + (2 * 365 * 86400 - 5 * 86400) / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(1)), + Point { bias: 2493136560680, slope: 475646, block: 20, amount: 5000000000000 } + ); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(12465712312420)); + assert_eq!(VeMinting::total_supply(System::block_number()), Ok(12465712312420)); + }); } #[test] @@ -412,41 +412,47 @@ fn deposit_markup_before_lock_should_work() { #[test] fn deposit_markup_before_lock_should_work2() { - ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { - asset_registry(); - System::set_block_number(System::block_number() + 20); - - assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); - assert_ok!(VeMinting::set_markup_coefficient( - RuntimeOrigin::root(), - VBNC, - FixedU128::from_inner(100_000_000_000_000_000), // 0.1 - FixedU128::saturating_from_integer(1), - )); - assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000)); - assert_ok!(VeMinting::create_lock_inner( - &BOB, - 10_000_000_000_000, - System::block_number() + 365 * 86400 / 12, - )); - assert_ok!(VeMinting::create_lock_inner( - &BOB, - 15_000_000_000_000, - System::block_number() + 365 * 86400 / 12, - )); - assert_eq!( - UserPointHistory::::get(POSITIONID0, U256::one()), - Point { bias: 2796030953200, slope: 1046740, block: 20, amount: 11003333333333 } - ); - assert_eq!( - UserPointHistory::::get(POSITIONID1, U256::one()), - Point { bias: 4194046429800, slope: 1570110, block: 20, amount: 16504999999999 } - ); - assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); - assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); - assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(2796030953200 + 4194046429800)); - assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(2796030953200 + 4194046429800)); - }); + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VBNC, + FixedU128::from_inner(100_000_000_000_000_000), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000)); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::one()), + Point { bias: 2796030953200, slope: 1046740, block: 20, amount: 11003333333333 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::one()), + Point { bias: 4194046429800, slope: 1570110, block: 20, amount: 16504999999999 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!( + VeMinting::balance_of(&BOB, Some(System::block_number())), + Ok(2796030953200 + 4194046429800) + ); + assert_eq!( + VeMinting::balance_of(&BOB, Some(System::block_number())), + Ok(2796030953200 + 4194046429800) + ); + }); } #[test] @@ -612,49 +618,49 @@ fn redeem_unlock_should_work() { #[test] fn withdraw_markup_after_lock_should_work3() { - ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { - asset_registry(); - System::set_block_number(System::block_number() + 20); - - assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); - assert_ok!(VeMinting::create_lock_inner( - &BOB, - 10_000_000_000_000, - System::block_number() + 365 * 86400 / 12, - )); - assert_ok!(VeMinting::create_lock_inner( - &BOB, - 15_000_000_000_000, - System::block_number() + 365 * 86400 / 12, - )); - assert_ok!(VeMinting::set_markup_coefficient( - RuntimeOrigin::root(), - VBNC, - FixedU128::from_inner(100_000_000_000_000_000), // 0.1 - FixedU128::saturating_from_integer(1), - )); - assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000)); - assert_ok!(VeMinting::withdraw_markup(RuntimeOrigin::signed(BOB), VBNC)); - assert_eq!( - UserPointHistory::::get(POSITIONID0, U256::from(2)), - Point { bias: 2796030953200, slope: 1046740, block: 20, amount: 11003333333333 } - ); - assert_eq!( - UserPointHistory::::get(POSITIONID0, U256::from(3)), - Point { bias: 2541074835740, slope: 951293, block: 20, amount: 10000000000000 } - ); - assert_eq!( - UserPointHistory::::get(POSITIONID1, U256::from(2)), - Point { bias: 4194046429800, slope: 1570110, block: 20, amount: 16504999999999 } - ); - assert_eq!( - UserPointHistory::::get(POSITIONID1, U256::from(3)), - Point { bias: 3811613589200, slope: 1426940, block: 20, amount: 15000000000000 } - ); - assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); - assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); - assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(6352688424940)); - }); + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); + + assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VBNC, + FixedU128::from_inner(100_000_000_000_000_000), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VBNC, 10_000_000_000_000)); + assert_ok!(VeMinting::withdraw_markup(RuntimeOrigin::signed(BOB), VBNC)); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(2)), + Point { bias: 2796030953200, slope: 1046740, block: 20, amount: 11003333333333 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::from(3)), + Point { bias: 2541074835740, slope: 951293, block: 20, amount: 10000000000000 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(2)), + Point { bias: 4194046429800, slope: 1570110, block: 20, amount: 16504999999999 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::from(3)), + Point { bias: 3811613589200, slope: 1426940, block: 20, amount: 15000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(6352688424940)); + }); } #[test] @@ -697,51 +703,51 @@ fn redeem_unlock_after_360_days_should_work() { #[test] fn redeem_unlock_after_360_days_should_work2() { - ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { - asset_registry(); - System::set_block_number(System::block_number() + 20); + ExtBuilder::default().one_hundred_for_alice_n_bob().build().execute_with(|| { + asset_registry(); + System::set_block_number(System::block_number() + 20); assert_ok!(VeMinting::set_config(RuntimeOrigin::root(), Some(0), Some(7 * 86400 / 12))); - assert_ok!(VeMinting::set_markup_coefficient( - RuntimeOrigin::root(), - VKSM, - FixedU128::from_inner(FixedU128::DIV / 10), // 0.1 - FixedU128::saturating_from_integer(1), - )); - assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VKSM, 10_000_000_000_000)); - assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(0)); - assert_eq!(Tokens::free_balance(VBNC, &BOB), 1000000000000000); - assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 1000000000000000).is_ok(), true); - assert_ok!(VeMinting::create_lock_inner( - &BOB, - 10_000_000_000_000, - System::block_number() + 365 * 86400 / 12, - )); - assert_ok!(VeMinting::create_lock_inner( - &BOB, - 15_000_000_000_000, - System::block_number() + 365 * 86400 / 12, - )); - assert_eq!( - UserPointHistory::::get(POSITIONID0, U256::one()), - Point { bias: 5082152342660, slope: 1902587, block: 20, amount: 20000000000000 } - ); - assert_eq!( - UserPointHistory::::get(POSITIONID1, U256::one()), - Point { bias: 7623229849580, slope: 2853881, block: 20, amount: 30000000000000 } - ); - assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); - assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); - assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(12705382192240)); - assert_eq!(Tokens::free_balance(VBNC, &BOB), 1_000_000_000_000_000); - assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 1_000_000_000_000_000).is_ok(), false); - System::set_block_number(System::block_number() + 360 * 86400 / 12); - assert_ok!(VeMinting::redeem_unlock(RuntimeOrigin::signed(BOB), POSITIONID0)); - assert_ok!(VeMinting::redeem_unlock(RuntimeOrigin::signed(BOB), POSITIONID1)); - assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(0)); - assert_eq!(Tokens::free_balance(VBNC, &BOB), 998341660825205); - assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 998341660825205).is_ok(), true); - }); + assert_ok!(VeMinting::set_markup_coefficient( + RuntimeOrigin::root(), + VKSM, + FixedU128::from_inner(FixedU128::DIV / 10), // 0.1 + FixedU128::saturating_from_integer(1), + )); + assert_ok!(VeMinting::deposit_markup(RuntimeOrigin::signed(BOB), VKSM, 10_000_000_000_000)); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(0)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 1000000000000000); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 1000000000000000).is_ok(), true); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 10_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_ok!(VeMinting::create_lock_inner( + &BOB, + 15_000_000_000_000, + System::block_number() + 365 * 86400 / 12, + )); + assert_eq!( + UserPointHistory::::get(POSITIONID0, U256::one()), + Point { bias: 5082152342660, slope: 1902587, block: 20, amount: 20000000000000 } + ); + assert_eq!( + UserPointHistory::::get(POSITIONID1, U256::one()), + Point { bias: 7623229849580, slope: 2853881, block: 20, amount: 30000000000000 } + ); + assert_eq!(Locked::::get(POSITIONID0).amount, 10_000_000_000_000); + assert_eq!(Locked::::get(POSITIONID1).amount, 15_000_000_000_000); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(12705382192240)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 1_000_000_000_000_000); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 1_000_000_000_000_000).is_ok(), false); + System::set_block_number(System::block_number() + 360 * 86400 / 12); + assert_ok!(VeMinting::redeem_unlock(RuntimeOrigin::signed(BOB), POSITIONID0)); + assert_ok!(VeMinting::redeem_unlock(RuntimeOrigin::signed(BOB), POSITIONID1)); + assert_eq!(VeMinting::balance_of(&BOB, Some(System::block_number())), Ok(0)); + assert_eq!(Tokens::free_balance(VBNC, &BOB), 998341660825205); + assert_eq!(Tokens::ensure_can_withdraw(VBNC, &BOB, 998341660825205).is_ok(), true); + }); } #[test] From e7810fd9e2d36e16a4cb282df22d91fa0cfe42bf Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Tue, 30 Jul 2024 21:34:08 +0800 Subject: [PATCH 21/22] Integrate evm (#1319) * Update dep * Ingrate EVM * Fix deps * Add precompiles.rs * Remove pallet-hotfix-sufficients * Add pallet-evm-accounts * Evm precompiles * EVM integration * Fix compile * Fix rpc * Fix `encode_evm_address` and `decode_evm_address` * Fix evm precompile multicurrency * Implementing Erc20Mapping using xc-20 standard * Compatible with BNC Decimal * Increase min_gas_price * feat: enable dev mode with manual seal & fix pending block problem * Add copyright and fix some bugs * Change native token to WETH * Support evm flexible fee * Add inner_swap_exact_assets_for_assets to evm withdraw fee * Remove swap * EVM migration from bifrost kusama to bifrost polkadot * Fix erc20 precompile * Use OraclePrice * Fix some errors * feat: add prices genesis config & optimize dev mode code * Fix conflicts * Fix some errors * Fix clippy * Format Cargo.toml * Remove unused code * Fix clippy * Fix some errors * Fix erc20 precompile --------- Co-authored-by: Edwin Wang Co-authored-by: Damian.lu --- Cargo.lock | 923 +++++++++++++++++- Cargo.toml | 116 ++- Makefile | 2 +- node/cli/src/cli.rs | 6 +- node/cli/src/command.rs | 5 +- node/rpc/Cargo.toml | 34 +- node/rpc/src/eth.rs | 242 +++++ node/rpc/src/lib.rs | 31 +- node/service/Cargo.toml | 20 +- node/service/src/chain_spec/bifrost_kusama.rs | 4 +- .../src/chain_spec/bifrost_polkadot.rs | 107 +- node/service/src/chain_spec/mod.rs | 6 +- node/service/src/collator_kusama.rs | 4 + node/service/src/collator_polkadot.rs | 145 ++- node/service/src/dev.rs | 384 ++++++-- node/service/src/eth.rs | 212 ++++ node/service/src/lib.rs | 2 + pallets/currencies/src/lib.rs | 19 +- pallets/evm-accounts/Cargo.toml | 56 ++ pallets/evm-accounts/README.md | 34 + .../evm-accounts/rpc/runtime-api/Cargo.toml | 24 + .../evm-accounts/rpc/runtime-api/README.md | 1 + .../evm-accounts/rpc/runtime-api/src/lib.rs | 38 + pallets/evm-accounts/src/benchmarking.rs | 78 ++ pallets/evm-accounts/src/lib.rs | 317 ++++++ pallets/evm-accounts/src/mock.rs | 128 +++ pallets/evm-accounts/src/tests.rs | 131 +++ pallets/evm-accounts/src/weights.rs | 164 ++++ pallets/flexible-fee/src/lib.rs | 10 +- pallets/lend-market/src/mock.rs | 4 + pallets/leverage-staking/src/mock.rs | 4 + pallets/prices/src/lib.rs | 30 + pallets/traits/src/evm.rs | 20 + pallets/traits/src/lib.rs | 3 + primitives/src/currency.rs | 16 + primitives/src/traits.rs | 21 +- runtime/bifrost-polkadot/Cargo.toml | 45 + .../src/evm/accounts_conversion.rs | 55 ++ .../src/evm/evm-utility/Cargo.toml | 18 + .../src/evm/evm-utility/macro/Cargo.toml | 14 + .../src/evm/evm-utility/macro/src/lib.rs | 70 ++ .../src/evm/evm-utility/macro/tests/test.rs | 51 + .../src/evm/evm-utility/src/lib.rs | 43 + runtime/bifrost-polkadot/src/evm/evm_fee.rs | 202 ++++ runtime/bifrost-polkadot/src/evm/mod.rs | 165 ++++ .../src/evm/precompiles/costs.rs | 43 + .../src/evm/precompiles/erc20_mapping.rs | 77 ++ .../src/evm/precompiles/handle.rs | 467 +++++++++ .../src/evm/precompiles/mod.rs | 225 +++++ .../src/evm/precompiles/multicurrency.rs | 244 +++++ .../src/evm/precompiles/substrate.rs | 43 + .../evm/precompiles/tests/erc20_mapping.rs | 113 +++ .../src/evm/precompiles/tests/mod.rs | 19 + runtime/bifrost-polkadot/src/evm/runner.rs | 263 +++++ runtime/bifrost-polkadot/src/lib.rs | 418 +++++++- runtime/bifrost-polkadot/src/xcm_config.rs | 8 +- runtime/common/Cargo.toml | 5 + runtime/common/src/lib.rs | 4 + runtime/common/src/price.rs | 107 ++ runtime/common/src/ratio.rs | 154 +++ 60 files changed, 5988 insertions(+), 206 deletions(-) create mode 100644 node/rpc/src/eth.rs create mode 100644 node/service/src/eth.rs create mode 100644 pallets/evm-accounts/Cargo.toml create mode 100644 pallets/evm-accounts/README.md create mode 100644 pallets/evm-accounts/rpc/runtime-api/Cargo.toml create mode 100644 pallets/evm-accounts/rpc/runtime-api/README.md create mode 100644 pallets/evm-accounts/rpc/runtime-api/src/lib.rs create mode 100644 pallets/evm-accounts/src/benchmarking.rs create mode 100644 pallets/evm-accounts/src/lib.rs create mode 100644 pallets/evm-accounts/src/mock.rs create mode 100644 pallets/evm-accounts/src/tests.rs create mode 100644 pallets/evm-accounts/src/weights.rs create mode 100644 pallets/traits/src/evm.rs create mode 100644 runtime/bifrost-polkadot/src/evm/accounts_conversion.rs create mode 100644 runtime/bifrost-polkadot/src/evm/evm-utility/Cargo.toml create mode 100644 runtime/bifrost-polkadot/src/evm/evm-utility/macro/Cargo.toml create mode 100644 runtime/bifrost-polkadot/src/evm/evm-utility/macro/src/lib.rs create mode 100644 runtime/bifrost-polkadot/src/evm/evm-utility/macro/tests/test.rs create mode 100644 runtime/bifrost-polkadot/src/evm/evm-utility/src/lib.rs create mode 100644 runtime/bifrost-polkadot/src/evm/evm_fee.rs create mode 100644 runtime/bifrost-polkadot/src/evm/mod.rs create mode 100644 runtime/bifrost-polkadot/src/evm/precompiles/costs.rs create mode 100644 runtime/bifrost-polkadot/src/evm/precompiles/erc20_mapping.rs create mode 100644 runtime/bifrost-polkadot/src/evm/precompiles/handle.rs create mode 100644 runtime/bifrost-polkadot/src/evm/precompiles/mod.rs create mode 100644 runtime/bifrost-polkadot/src/evm/precompiles/multicurrency.rs create mode 100644 runtime/bifrost-polkadot/src/evm/precompiles/substrate.rs create mode 100644 runtime/bifrost-polkadot/src/evm/precompiles/tests/erc20_mapping.rs create mode 100644 runtime/bifrost-polkadot/src/evm/precompiles/tests/mod.rs create mode 100644 runtime/bifrost-polkadot/src/evm/runner.rs create mode 100644 runtime/common/src/price.rs create mode 100644 runtime/common/src/ratio.rs diff --git a/Cargo.lock b/Cargo.lock index fabfe194f..df94459fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -749,6 +749,15 @@ dependencies = [ "pin-project-lite 0.2.14", ] +[[package]] +name = "atoi" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" +dependencies = [ + "num-traits", +] + [[package]] name = "atomic-take" version = "1.1.0" @@ -761,6 +770,17 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "auto_impl" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "autocfg" version = "1.3.0" @@ -1434,6 +1454,12 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-timestamp", "cumulus-primitives-utility", + "ethabi", + "evm", + "fp-account", + "fp-evm", + "fp-rpc", + "fp-self-contained", "frame-benchmarking", "frame-executive", "frame-metadata-hash-extension", @@ -1448,6 +1474,8 @@ dependencies = [ "leverage-staking", "log", "merkle-distributor", + "module-evm-utility-macro", + "num_enum 0.5.11", "orml-oracle", "orml-tokens", "orml-traits", @@ -1459,12 +1487,25 @@ dependencies = [ "pallet-aura", "pallet-authorship", "pallet-balances", + "pallet-base-fee", "pallet-bounties", "pallet-collator-selection", "pallet-collective", "pallet-conviction-voting", "pallet-democracy", + "pallet-dynamic-fee", "pallet-elections-phragmen", + "pallet-ethereum", + "pallet-evm", + "pallet-evm-accounts", + "pallet-evm-accounts-rpc-runtime-api", + "pallet-evm-chain-id", + "pallet-evm-precompile-blake2", + "pallet-evm-precompile-bn128", + "pallet-evm-precompile-dispatch", + "pallet-evm-precompile-modexp", + "pallet-evm-precompile-sha3fips", + "pallet-evm-precompile-simple", "pallet-identity", "pallet-indices", "pallet-membership", @@ -1479,6 +1520,7 @@ dependencies = [ "pallet-session", "pallet-timestamp", "pallet-tips", + "pallet-traits", "pallet-transaction-payment", "pallet-transaction-payment-rpc-runtime-api", "pallet-treasury", @@ -1491,6 +1533,7 @@ dependencies = [ "polkadot-parachain-primitives", "polkadot-primitives", "polkadot-runtime-common", + "primitive-types", "scale-info", "serde", "serde_json", @@ -1548,6 +1591,8 @@ dependencies = [ "bifrost-farming-rpc-runtime-api", "bifrost-flexible-fee-rpc", "bifrost-flexible-fee-rpc-runtime-api", + "bifrost-kusama-runtime", + "bifrost-polkadot-runtime", "bifrost-primitives", "bifrost-salp-rpc", "bifrost-salp-rpc-runtime-api", @@ -1557,18 +1602,40 @@ dependencies = [ "bifrost-ve-minting-rpc-runtime-api", "bifrost-vtoken-minting-rpc", "bifrost-vtoken-minting-rpc-runtime-api", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-test-relay-sproof-builder", + "fc-api", + "fc-db", + "fc-mapping-sync", + "fc-rpc", + "fc-rpc-core", + "fc-storage", + "fp-rpc", + "futures 0.3.30", + "hex-literal 0.4.1", "jsonrpsee", "lend-market-rpc", "lend-market-rpc-runtime-api", "pallet-transaction-payment-rpc", "sc-client-api", + "sc-consensus", + "sc-consensus-aura", + "sc-consensus-manual-seal", + "sc-network", + "sc-network-sync", "sc-rpc", "sc-rpc-api", + "sc-transaction-pool", "sc-transaction-pool-api", "sp-api", "sp-block-builder", "sp-blockchain", + "sp-consensus-aura", + "sp-core", + "sp-inherents", "sp-runtime", + "sp-timestamp", "substrate-frame-rpc-system", "zenlink-protocol", "zenlink-protocol-rpc", @@ -1595,6 +1662,7 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "log", + "num-traits", "orml-tokens", "orml-traits", "orml-xcm-support", @@ -1604,12 +1672,15 @@ dependencies = [ "pallet-membership", "pallet-multisig", "pallet-scheduler", + "pallet-traits", "pallet-transaction-payment", "pallet-treasury", "pallet-utility", "pallet-xcm", "parity-scale-codec", "polkadot-parachain-primitives", + "scale-info", + "serde", "sp-api", "sp-arithmetic", "sp-block-builder", @@ -1696,6 +1767,7 @@ dependencies = [ name = "bifrost-service" version = "0.8.0" dependencies = [ + "async-trait", "bifrost-farming-rpc-runtime-api", "bifrost-flexible-fee-rpc-runtime-api", "bifrost-kusama-runtime", @@ -1706,6 +1778,7 @@ dependencies = [ "bifrost-runtime-common", "bifrost-salp-rpc-runtime-api", "bifrost-ve-minting-rpc-runtime-api", + "clap", "cumulus-client-cli", "cumulus-client-collator", "cumulus-client-consensus-aura", @@ -1716,6 +1789,20 @@ dependencies = [ "cumulus-primitives-core", "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", + "cumulus-test-relay-sproof-builder", + "fc-consensus", + "fc-db", + "fc-mapping-sync", + "fc-rpc", + "fc-rpc-core", + "fc-storage", + "flume 0.10.14", + "fp-account", + "fp-consensus", + "fp-dynamic-fee", + "fp-evm", + "fp-rpc", + "fp-storage", "frame-benchmarking", "frame-benchmarking-cli", "frame-system-rpc-runtime-api", @@ -1832,7 +1919,7 @@ dependencies = [ "cumulus-pallet-xcm", "cumulus-primitives-core", "ethabi", - "ethereum", + "ethereum 0.14.0", "frame-benchmarking", "frame-support", "frame-system", @@ -4117,6 +4204,12 @@ dependencies = [ "walkdir", ] +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + [[package]] name = "downcast" version = "0.11.0" @@ -4245,6 +4338,9 @@ name = "either" version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +dependencies = [ + "serde", +] [[package]] name = "elliptic-curve" @@ -4383,6 +4479,7 @@ dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", + "impl-serde", "scale-info", "tiny-keccak", ] @@ -4400,10 +4497,29 @@ dependencies = [ "parity-scale-codec", "rlp", "scale-info", + "serde", "sha3", "triehash", ] +[[package]] +name = "ethereum" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e04d24d20b8ff2235cffbf242d5092de3aa45f77c5270ddbfadd2778ca13fea" +dependencies = [ + "bytes", + "ethereum-types", + "hash-db 0.16.0", + "hash256-std-hasher", + "parity-scale-codec", + "rlp", + "scale-info", + "serde", + "sha3", + "trie-root", +] + [[package]] name = "ethereum-types" version = "0.14.1" @@ -4414,6 +4530,7 @@ dependencies = [ "fixed-hash", "impl-codec", "impl-rlp", + "impl-serde", "primitive-types", "scale-info", "uint", @@ -4457,6 +4574,64 @@ dependencies = [ "pin-project-lite 0.2.14", ] +[[package]] +name = "evm" +version = "0.41.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "767f43e9630cc36cf8ff2777cbb0121b055f0d1fd6eaaa13b46a1808f0d0e7e9" +dependencies = [ + "auto_impl", + "environmental", + "ethereum 0.15.0", + "evm-core", + "evm-gasometer", + "evm-runtime", + "log", + "parity-scale-codec", + "primitive-types", + "rlp", + "scale-info", + "serde", + "sha3", +] + +[[package]] +name = "evm-core" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1da6cedc5cedb4208e59467106db0d1f50db01b920920589f8e672c02fdc04f" +dependencies = [ + "parity-scale-codec", + "primitive-types", + "scale-info", + "serde", +] + +[[package]] +name = "evm-gasometer" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dc0eb591abc5cd7b05bef6a036c2bb6c66ab6c5e0c5ce94bfe377ab670b1fd7" +dependencies = [ + "environmental", + "evm-core", + "evm-runtime", + "primitive-types", +] + +[[package]] +name = "evm-runtime" +version = "0.41.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84bbe09b64ae13a29514048c1bb6fda6374ac0b4f6a1f15a443348ab88ef42cd" +dependencies = [ + "auto_impl", + "environmental", + "evm-core", + "primitive-types", + "sha3", +] + [[package]] name = "exit-future" version = "0.2.0" @@ -4532,6 +4707,173 @@ dependencies = [ "syn 2.0.71", ] +[[package]] +name = "fc-api" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "async-trait", + "fp-storage", + "parity-scale-codec", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "fc-consensus" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "async-trait", + "fp-consensus", + "fp-rpc", + "sc-consensus", + "sp-api", + "sp-block-builder", + "sp-consensus", + "sp-runtime", + "thiserror", +] + +[[package]] +name = "fc-db" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "async-trait", + "ethereum 0.15.0", + "fc-api", + "fc-storage", + "fp-consensus", + "fp-rpc", + "fp-storage", + "futures 0.3.30", + "kvdb-rocksdb", + "log", + "parity-db", + "parity-scale-codec", + "parking_lot 0.12.3", + "sc-client-api", + "sc-client-db", + "smallvec", + "sp-api", + "sp-blockchain", + "sp-core", + "sp-database", + "sp-runtime", + "sqlx", + "tokio", +] + +[[package]] +name = "fc-mapping-sync" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fc-db", + "fc-storage", + "fp-consensus", + "fp-rpc", + "futures 0.3.30", + "futures-timer", + "log", + "parking_lot 0.12.3", + "sc-client-api", + "sc-utils", + "sp-api", + "sp-blockchain", + "sp-consensus", + "sp-core", + "sp-runtime", + "tokio", +] + +[[package]] +name = "fc-rpc" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "evm", + "fc-api", + "fc-mapping-sync", + "fc-rpc-core", + "fc-storage", + "fp-evm", + "fp-rpc", + "fp-storage", + "futures 0.3.30", + "hex", + "jsonrpsee", + "libsecp256k1", + "log", + "pallet-evm", + "parity-scale-codec", + "prometheus", + "rand 0.8.5", + "rlp", + "sc-client-api", + "sc-consensus-aura", + "sc-network", + "sc-network-sync", + "sc-rpc", + "sc-service", + "sc-transaction-pool", + "sc-transaction-pool-api", + "sc-utils", + "schnellru", + "serde", + "sp-api", + "sp-block-builder", + "sp-blockchain", + "sp-consensus", + "sp-consensus-aura", + "sp-core", + "sp-externalities 0.25.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-inherents", + "sp-io", + "sp-runtime", + "sp-state-machine", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", + "sp-timestamp", + "substrate-prometheus-endpoint", + "thiserror", + "tokio", +] + +[[package]] +name = "fc-rpc-core" +version = "1.1.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "jsonrpsee", + "rlp", + "rustc-hex", + "serde", + "serde_json", + "sp-crypto-hashing", +] + +[[package]] +name = "fc-storage" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "fp-rpc", + "fp-storage", + "parity-scale-codec", + "sc-client-api", + "sp-api", + "sp-io", + "sp-runtime", + "sp-storage 19.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + [[package]] name = "fdlimit" version = "0.3.0" @@ -4657,6 +4999,30 @@ dependencies = [ "num-traits", ] +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin 0.9.8", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" @@ -4705,6 +5071,109 @@ dependencies = [ "thiserror", ] +[[package]] +name = "fp-account" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "hex", + "impl-serde", + "libsecp256k1", + "log", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-io", + "sp-runtime", + "sp-runtime-interface 24.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "fp-consensus" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "parity-scale-codec", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "fp-dynamic-fee" +version = "1.0.0" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "async-trait", + "sp-core", + "sp-inherents", +] + +[[package]] +name = "fp-ethereum" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "fp-evm", + "frame-support", + "parity-scale-codec", +] + +[[package]] +name = "fp-evm" +version = "3.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "evm", + "frame-support", + "num_enum 0.7.2", + "parity-scale-codec", + "scale-info", + "serde", + "sp-core", + "sp-runtime", +] + +[[package]] +name = "fp-rpc" +version = "3.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "fp-evm", + "parity-scale-codec", + "scale-info", + "sp-api", + "sp-core", + "sp-runtime", + "sp-state-machine", +] + +[[package]] +name = "fp-self-contained" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "frame-support", + "parity-scale-codec", + "scale-info", + "serde", + "sp-runtime", +] + +[[package]] +name = "fp-storage" +version = "2.0.0" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "parity-scale-codec", + "serde", +] + [[package]] name = "fragile" version = "2.0.0" @@ -5082,6 +5551,17 @@ dependencies = [ "num_cpus", ] +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot 0.12.3", +] + [[package]] name = "futures-io" version = "0.3.30" @@ -5232,8 +5712,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -5414,6 +5896,9 @@ name = "heck" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +dependencies = [ + "unicode-segmentation", +] [[package]] name = "heck" @@ -6116,6 +6601,9 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin 0.9.8", +] [[package]] name = "lazycell" @@ -6705,6 +7193,17 @@ dependencies = [ "libsecp256k1-core", ] +[[package]] +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + [[package]] name = "libz-sys" version = "1.1.18" @@ -7228,6 +7727,25 @@ dependencies = [ "syn 2.0.71", ] +[[package]] +name = "module-evm-utility" +version = "2.21.0" +dependencies = [ + "ethereum 0.14.0", + "sha3", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "module-evm-utility-macro" +version = "2.21.0" +dependencies = [ + "module-evm-utility", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "multiaddr" version = "0.17.1" @@ -7428,6 +7946,26 @@ name = "nanorand" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom 0.2.15", +] + +[[package]] +name = "native-tls" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] [[package]] name = "netlink-packet-core" @@ -7592,6 +8130,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -7636,6 +8188,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-iter" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1429034a0490724d0075ebb2bc9e875d6503c3cf69e235a8941aa757d83ef5bf" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-rational" version = "0.4.2" @@ -7667,6 +8230,47 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" +dependencies = [ + "num_enum_derive 0.5.11", +] + +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive 0.7.2", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.71", +] + [[package]] name = "object" version = "0.30.4" @@ -8144,6 +8748,20 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] +[[package]] +name = "pallet-base-fee" +version = "1.0.0" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-runtime", +] + [[package]] name = "pallet-beefy" version = "28.0.0" @@ -8331,6 +8949,21 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] +[[package]] +name = "pallet-dynamic-fee" +version = "4.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-dynamic-fee", + "fp-evm", + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-inherents", +] + [[package]] name = "pallet-election-provider-multi-phase" version = "27.0.0" @@ -8387,6 +9020,146 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", ] +[[package]] +name = "pallet-ethereum" +version = "4.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "ethereum 0.15.0", + "ethereum-types", + "evm", + "fp-consensus", + "fp-ethereum", + "fp-evm", + "fp-rpc", + "fp-storage", + "frame-support", + "frame-system", + "pallet-evm", + "parity-scale-codec", + "scale-info", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-evm" +version = "6.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "environmental", + "evm", + "fp-account", + "fp-evm", + "frame-benchmarking", + "frame-support", + "frame-system", + "hash-db 0.16.0", + "hex-literal 0.4.1", + "impl-trait-for-tuples", + "log", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-runtime", +] + +[[package]] +name = "pallet-evm-accounts" +version = "1.1.1" +dependencies = [ + "frame-benchmarking", + "frame-support", + "frame-system", + "hex-literal 0.4.1", + "orml-tokens", + "orml-traits", + "pallet-traits", + "parity-scale-codec", + "scale-info", + "sp-core", + "sp-io", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.13.0)", +] + +[[package]] +name = "pallet-evm-accounts-rpc-runtime-api" +version = "1.0.0" +dependencies = [ + "parity-scale-codec", + "sp-api", +] + +[[package]] +name = "pallet-evm-chain-id" +version = "1.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "frame-support", + "frame-system", + "parity-scale-codec", + "scale-info", +] + +[[package]] +name = "pallet-evm-precompile-blake2" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", +] + +[[package]] +name = "pallet-evm-precompile-bn128" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "sp-core", + "substrate-bn", +] + +[[package]] +name = "pallet-evm-precompile-dispatch" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "frame-support", + "pallet-evm", + "parity-scale-codec", + "sp-runtime", +] + +[[package]] +name = "pallet-evm-precompile-modexp" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "num", +] + +[[package]] +name = "pallet-evm-precompile-sha3fips" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "tiny-keccak", +] + +[[package]] +name = "pallet-evm-precompile-simple" +version = "2.0.0-dev" +source = "git+https://github.com/bifrost-finance/frontier?branch=release-polkadot-v1.13.0#24a48ebc221399d129712eff41787ad800dc8a26" +dependencies = [ + "fp-evm", + "ripemd", + "sp-io", +] + [[package]] name = "pallet-fast-unstake" version = "27.0.0" @@ -14758,6 +15531,9 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] [[package]] name = "spinning_top" @@ -14778,6 +15554,126 @@ dependencies = [ "der", ] +[[package]] +name = "sqlformat" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f895e3734318cc55f1fe66258926c9b910c124d47520339efecbb6c59cec7c1f" +dependencies = [ + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9a2ccff1a000a5a59cd33da541d9f2fdcd9e6e8229cc200565942bff36d0aaa" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24ba59a9342a3d9bab6c56c118be528b27c9b60e490080e9711a04dccac83ef6" +dependencies = [ + "ahash", + "atoi", + "byteorder", + "bytes", + "crc", + "crossbeam-queue", + "either", + "event-listener 2.5.3", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashlink", + "hex", + "indexmap 2.2.6", + "log", + "memchr", + "native-tls", + "once_cell", + "paste", + "percent-encoding", + "serde", + "sha2 0.10.8", + "smallvec", + "sqlformat", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "url", +] + +[[package]] +name = "sqlx-macros" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea40e2345eb2faa9e1e5e326db8c34711317d2b5e08d0d5741619048a803127" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5833ef53aaa16d860e92123292f1f6a3d53c34ba8b1969f152ef1a7bb803f3c8" +dependencies = [ + "dotenvy", + "either", + "heck 0.4.1", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2 0.10.8", + "sqlx-core", + "sqlx-sqlite", + "syn 1.0.109", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b244ef0a8414da0bed4bb1910426e890b19e5e9bccc27ada6b797d05c55ae0aa" +dependencies = [ + "atoi", + "flume 0.11.0", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "tracing", + "url", + "urlencoding", +] + [[package]] name = "ss58-registry" version = "1.47.0" @@ -15018,6 +15914,19 @@ dependencies = [ "zeroize", ] +[[package]] +name = "substrate-bn" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand 0.8.5", + "rustc-hex", +] + [[package]] name = "substrate-build-script-utils" version = "11.0.0" @@ -15935,6 +16844,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + [[package]] name = "universal-hash" version = "0.5.1" @@ -15981,6 +16896,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + [[package]] name = "utf-8" version = "0.7.6" diff --git a/Cargo.toml b/Cargo.toml index 9166810dc..acf7a1ccf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,6 +17,7 @@ members = [ "pallets/vsbond-auction", "pallets/call-switchgear", "pallets/cross-in-out", + "pallets/evm-accounts", "pallets/xcm-interface", "pallets/slp", "pallets/vstoken-conversion", @@ -35,6 +36,7 @@ members = [ "pallets/clouds-convert", "runtime/bifrost-kusama", + "runtime/bifrost-polkadot/src/evm/evm-utility/macro", "runtime/bifrost-polkadot", "integration-tests" @@ -59,45 +61,48 @@ bifrost-kusama-runtime = { path = "runtime/bifrost-kusama" } bifrost-polkadot-runtime = { path = "runtime/bifrost-polkadot" } # Bifrost Wasm -bifrost-asset-registry = { path = "pallets/asset-registry", default-features = false } -bifrost-buy-back = { path = "pallets/buy-back", default-features = false } -bifrost-cross-in-out = { path = "pallets/cross-in-out", default-features = false } -bifrost-currencies = { path = "pallets/currencies", default-features = false } -bifrost-farming = { path = "pallets/farming", default-features = false } -bifrost-farming-rpc-runtime-api = { path = "pallets/farming/rpc/runtime-api", default-features = false } -bifrost-fee-share = { path = "pallets/fee-share", default-features = false } -bifrost-flexible-fee = { path = "pallets/flexible-fee", default-features = false } -bifrost-flexible-fee-rpc-runtime-api = { path = "pallets/flexible-fee/rpc/runtime-api", default-features = false } -bifrost-parachain-staking = { path = "pallets/parachain-staking", default-features = false } -bifrost-primitives = { path = "primitives" , default-features = false } -bifrost-runtime-common = { path = "runtime/common", default-features = false } -bifrost-salp = { path = "pallets/salp", default-features = false } -bifrost-salp-rpc-runtime-api = { path = "pallets/salp/rpc/runtime-api", default-features = false } -bifrost-service = { path = "node/service", default-features = false } -bifrost-slp = { path = "pallets/slp", default-features = false } -bifrost-slpx = { path = "pallets/slpx", default-features = false } -bifrost-stable-asset = { path = "pallets/stable-asset", default-features = false } -bifrost-stable-pool = { path = "pallets/stable-pool", default-features = false } -bifrost-stable-pool-rpc-runtime-api = { path = "pallets/stable-pool/rpc/runtime-api", default-features = false } -bifrost-system-maker = { path = "pallets/system-maker", default-features = false } -bifrost-system-staking = { path = "pallets/system-staking", default-features = false } -bifrost-token-issuer = { path = "pallets/token-issuer", default-features = false } -bifrost-ve-minting = { path = "pallets/ve-minting", default-features = false } -bifrost-ve-minting-rpc-runtime-api = { path = "pallets/ve-minting/rpc/runtime-api", default-features = false } -bifrost-vesting = { path = "pallets/vesting", default-features = false } -bifrost-vsbond-auction = { path = "pallets/vsbond-auction", default-features = false } -bifrost-vstoken-conversion = { path = "pallets/vstoken-conversion", default-features = false } -bifrost-vtoken-minting = { path = "pallets/vtoken-minting", default-features = false } -bifrost-vtoken-voting = { path = "pallets/vtoken-voting", default-features = false } -bifrost-xcm-interface = { path = "pallets/xcm-interface", default-features = false } -lend-market = { path = "pallets/lend-market", default-features = false } -lend-market-rpc-runtime-api = { path = "pallets/lend-market/rpc/runtime-api", default-features = false } -pallet-prices = { path = "pallets/prices", default-features = false } -pallet-traits = { path = "pallets/traits", default-features = false } -leverage-staking = { path = "pallets/leverage-staking", default-features = false } -bifrost-channel-commission = { path = "pallets/channel-commission", default-features = false } -bifrost-clouds-convert = { path = "pallets/clouds-convert", default-features = false } +bifrost-asset-registry = { path = "pallets/asset-registry", default-features = false } +bifrost-buy-back = { path = "pallets/buy-back", default-features = false } +bifrost-channel-commission = { path = "pallets/channel-commission", default-features = false } +bifrost-clouds-convert = { path = "pallets/clouds-convert", default-features = false } +bifrost-cross-in-out = { path = "pallets/cross-in-out", default-features = false } +bifrost-currencies = { path = "pallets/currencies", default-features = false } +bifrost-farming = { path = "pallets/farming", default-features = false } +bifrost-farming-rpc-runtime-api = { path = "pallets/farming/rpc/runtime-api", default-features = false } +bifrost-fee-share = { path = "pallets/fee-share", default-features = false } +bifrost-flexible-fee = { path = "pallets/flexible-fee", default-features = false } +bifrost-flexible-fee-rpc-runtime-api = { path = "pallets/flexible-fee/rpc/runtime-api", default-features = false } +bifrost-parachain-staking = { path = "pallets/parachain-staking", default-features = false } +bifrost-primitives = { path = "primitives" , default-features = false } +bifrost-runtime-common = { path = "runtime/common", default-features = false } +bifrost-salp = { path = "pallets/salp", default-features = false } +bifrost-salp-rpc-runtime-api = { path = "pallets/salp/rpc/runtime-api", default-features = false } +bifrost-service = { path = "node/service", default-features = false } +bifrost-slp = { path = "pallets/slp", default-features = false } +bifrost-slpx = { path = "pallets/slpx", default-features = false } +bifrost-stable-asset = { path = "pallets/stable-asset", default-features = false } +bifrost-stable-pool = { path = "pallets/stable-pool", default-features = false } +bifrost-stable-pool-rpc-runtime-api = { path = "pallets/stable-pool/rpc/runtime-api", default-features = false } +bifrost-system-maker = { path = "pallets/system-maker", default-features = false } +bifrost-system-staking = { path = "pallets/system-staking", default-features = false } +bifrost-token-issuer = { path = "pallets/token-issuer", default-features = false } +bifrost-ve-minting = { path = "pallets/ve-minting", default-features = false } +bifrost-ve-minting-rpc-runtime-api = { path = "pallets/ve-minting/rpc/runtime-api", default-features = false } +bifrost-vesting = { path = "pallets/vesting", default-features = false } +bifrost-vsbond-auction = { path = "pallets/vsbond-auction", default-features = false } +bifrost-vstoken-conversion = { path = "pallets/vstoken-conversion", default-features = false } +bifrost-vtoken-minting = { path = "pallets/vtoken-minting", default-features = false } bifrost-vtoken-minting-rpc-runtime-api = { path = "pallets/vtoken-minting/rpc/runtime-api", default-features = false } +bifrost-vtoken-voting = { path = "pallets/vtoken-voting", default-features = false } +bifrost-xcm-interface = { path = "pallets/xcm-interface", default-features = false } +lend-market = { path = "pallets/lend-market", default-features = false } +lend-market-rpc-runtime-api = { path = "pallets/lend-market/rpc/runtime-api", default-features = false } +leverage-staking = { path = "pallets/leverage-staking", default-features = false } +module-evm-utility-macro = { path = "runtime/bifrost-polkadot/src/evm/evm-utility/macro", default-features = false } +pallet-evm-accounts = { path = "pallets/evm-accounts", default-features = false } +pallet-evm-accounts-rpc-runtime-api = { path = "pallets/evm-accounts/rpc/runtime-api", default-features = false } +pallet-prices = { path = "pallets/prices", default-features = false } +pallet-traits = { path = "pallets/traits", default-features = false } # Zenlink merkle-distributor = { git = "https://github.com/bifrost-finance/Zenlink-DEX-Module", branch = "release-polkadot-v1.13.0", default-features = false } @@ -119,6 +124,33 @@ orml-xcm-support = { git = "https://github.com/bifrost-finance/open-runtime-m orml-xtokens = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } orml-oracle = { git = "https://github.com/bifrost-finance/open-runtime-module-library", branch = "release-polkadot-v1.13.0", default-features = false } +# Frontier +fc-api = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-consensus = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-db = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-mapping-sync = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-rpc = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-rpc-core = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fc-storage = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-account = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-consensus = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-dynamic-fee = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-evm = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-rpc = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-self-contained = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +fp-storage = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-base-fee = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-dynamic-fee = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-ethereum = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-chain-id = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-blake2 = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-bn128 = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-dispatch = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-modexp = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-sha3fips = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } +pallet-evm-precompile-simple = { git = "https://github.com/bifrost-finance/frontier", branch = "release-polkadot-v1.13.0", default-features = false } + # polkadot-sdk (wasm) cumulus-client-collator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } cumulus-client-consensus-proposer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.13.0", default-features = false } @@ -279,6 +311,8 @@ clap = { version = "4.5.8" } env_logger = { version = "0.10.2" } ethabi = { version = "18.0.0", default-features = false } ethereum = { version = "0.14.0", default-features = false, features = ["with-codec"] } +evm = { version = "0.41.1", default-features = false } +flume = { version = "0.10.9" } futures = { version = "0.3.30" } hex = { version = "0.4.3", default-features = false } hex-literal = { version = "0.4.1" } @@ -287,16 +321,22 @@ jsonrpsee = { version = "0.22.5" } log = { version = "0.4.22", default-features = false } num-bigint = { version = "0.4.6", default-features = false } num-traits = { version = "0.2.19", default-features = false } +num_enum = { version = "0.5.1", default-features = false } parity-scale-codec = { version = "3.6.12", default-features = false } paste = { version = "1.0.15" } +primitive-types = { version = "0.12.0", default-features = false } +proc-macro2 = { version = "1.0.40" } +quote = { version = "1.0.20" } scale-info = { version = "2.11.3", default-features = false } serde = { version = "1.0.203", default-features = false } serde_json = { version = "1.0.120", default-features = false } +sha3 = { version = "0.10.6", default-features = false } similar-asserts = { version = "1.1.0" } smallvec = { version = "1.13.1" } static_assertions = { version = "1.1.0" } strum = { version = "0.26.3", default-features = false, features = ["derive"] } strum_macros = { version = "0.26.2" } +syn = { version = "1.0.98", features = ["full", "fold", "extra-traits", "visit"] } tiny-keccak = { version = "2.0", features = ["fips202"] } [profile.dev] diff --git a/Makefile b/Makefile index f85585344..d34db9aa7 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ test-runtimes: .PHONY: test-benchmarks test-benchmarks: - SKIP_WASM_BUILD= cargo test benchmarking --features="runtime-benchmarks, polkadot" + SKIP_WASM_BUILD= cargo test benchmarking --features="with-bifrost-runtime, runtime-benchmarks, polkadot" .PHONY: clean # cargo clean clean: diff --git a/node/cli/src/cli.rs b/node/cli/src/cli.rs index 2724c9e95..364b66adc 100644 --- a/node/cli/src/cli.rs +++ b/node/cli/src/cli.rs @@ -18,6 +18,7 @@ use std::path::PathBuf; +use bifrost_service::eth::EthConfiguration; use clap::Parser; use sc_cli::{KeySubcommand, SignCmd, VanityCmd, VerifyCmd}; @@ -104,6 +105,9 @@ pub struct Cli { /// Relay chain arguments #[arg(raw = true)] pub relay_chain_args: Vec, + + #[command(flatten)] + pub eth_config: EthConfiguration, } #[derive(Debug)] @@ -125,7 +129,7 @@ impl RelayChainCli { relay_chain_args: impl Iterator, ) -> Self { let extension = - bifrost_service::chain_spec::RelayExtensions::try_get(&*para_config.chain_spec); + bifrost_service::chain_spec::RelayExtensions::try_get(¶_config.chain_spec); let chain_id = extension.map(|e| e.relay_chain.clone()); let base_path = para_config.base_path.path().join("polkadot"); Self { base_path: Some(base_path), chain_id, base: Parser::parse_from(relay_chain_args) } diff --git a/node/cli/src/command.rs b/node/cli/src/command.rs index ae6d07d2a..9a44cd960 100644 --- a/node/cli/src/command.rs +++ b/node/cli/src/command.rs @@ -183,7 +183,7 @@ impl SubstrateCli for RelayChainCli { macro_rules! with_runtime_or_err { ($chain_spec:expr, { $( $code:tt )* }) => { - if $chain_spec.is_bifrost_kusama() || $chain_spec.is_dev() { + if $chain_spec.is_bifrost_kusama() { #[cfg(any(feature = "with-bifrost-kusama-runtime",feature = "with-bifrost-runtime"))] #[allow(unused_imports)] use service::collator_kusama::{bifrost_kusama_runtime::{Block, RuntimeApi}, start_node,new_partial}; @@ -423,7 +423,7 @@ pub fn run() -> Result<()> { .flatten(); let para_id = - bifrost_service::chain_spec::RelayExtensions::try_get(&*config.chain_spec) + bifrost_service::chain_spec::RelayExtensions::try_get(&config.chain_spec) .map(|e| e.para_id) .ok_or("Could not find parachain ID in chain-spec.")?; @@ -455,6 +455,7 @@ pub fn run() -> Result<()> { start_node::>( config, polkadot_config, + cli.eth_config, collator_options, id, hwbench, diff --git a/node/rpc/Cargo.toml b/node/rpc/Cargo.toml index 737a6cdaa..1254c4fdd 100644 --- a/node/rpc/Cargo.toml +++ b/node/rpc/Cargo.toml @@ -8,18 +8,36 @@ edition = "2021" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -jsonrpsee = { workspace = true, features = [ "macros", "server" ] } -bifrost-primitives = { workspace = true } +futures = { workspace = true } +jsonrpsee = { workspace = true, features = ["macros", "server"] } sc-client-api = { workspace = true } +sc-consensus = { workspace = true } +sc-consensus-aura = { workspace = true } +sc-consensus-manual-seal = { workspace = true } +sc-network = { workspace = true } +sc-network-sync = { workspace = true } sc-rpc-api = { workspace = true } sc-rpc = { workspace = true } +sc-transaction-pool = { workspace = true } sc-transaction-pool-api = { workspace = true } -sp-api = { workspace = true } +sp-api = { workspace = true, features = ["default"] } sp-block-builder = { workspace = true } sp-blockchain = { workspace = true } +sp-timestamp = { workspace = true } +sp-core = { workspace = true, features = ["default"] } +sp-consensus-aura = { workspace = true, features = ["default"] } +sp-inherents = { workspace = true, features = ["default"] } sp-runtime = { workspace = true } pallet-transaction-payment-rpc = { workspace = true } substrate-frame-rpc-system = { workspace = true } +cumulus-test-relay-sproof-builder = { workspace = true } +cumulus-primitives-core = { workspace = true } +cumulus-primitives-parachain-inherent = { workspace = true } + +# Bifrost +bifrost-primitives = { workspace = true } +bifrost-kusama-runtime = { workspace = true } +bifrost-polkadot-runtime = { workspace = true } bifrost-flexible-fee-rpc = { workspace = true } bifrost-flexible-fee-rpc-runtime-api = { workspace = true } bifrost-salp-rpc = { workspace = true } @@ -40,3 +58,13 @@ zenlink-stable-amm-runtime-api = { workspace = true, features = ["std"] } bifrost-vtoken-minting-rpc = { workspace = true } bifrost-vtoken-minting-rpc-runtime-api = { workspace = true, features = ["std"] } +# Frontier +hex-literal = { workspace = true } +fc-api = { workspace = true } +fc-rpc = { workspace = true } +fc-db = { workspace = true } +fc-mapping-sync = { workspace = true, features = ["sql"] } +fc-rpc-core = { workspace = true } +fc-storage = { workspace = true } +fp-rpc = { workspace = true, features = ["default"] } + diff --git a/node/rpc/src/eth.rs b/node/rpc/src/eth.rs new file mode 100644 index 000000000..f9c31b83a --- /dev/null +++ b/node/rpc/src/eth.rs @@ -0,0 +1,242 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use std::sync::Arc; + +use jsonrpsee::RpcModule; +// Substrate +use bifrost_polkadot_runtime::opaque::Block; +use cumulus_primitives_core::PersistedValidationData; +use cumulus_primitives_parachain_inherent::ParachainInherentData; +use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; +use fc_db::kv::Backend as FrontierBackend; +pub use fc_rpc::{EthBlockDataCacheTask, StorageOverride}; +pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; +use fp_rpc::{ConvertTransaction, ConvertTransactionRuntimeApi, EthereumRuntimeRPCApi}; +use sc_client_api::{ + backend::{Backend, StorageProvider}, + client::BlockchainEvents, + StateBackend, +}; +use sc_network::service::traits::NetworkService; +use sc_network_sync::SyncingService; +use sc_rpc::SubscriptionTaskExecutor; +use sc_transaction_pool::{ChainApi, Pool}; +use sc_transaction_pool_api::TransactionPool; +use sp_api::{CallApiAt, ProvideRuntimeApi}; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_blockchain::{Error as BlockChainError, HeaderBackend, HeaderMetadata}; +use sp_runtime::traits::{BlakeTwo256, Block as BlockT}; + +pub struct BifrostEthConfig(std::marker::PhantomData<(C, BE)>); + +impl fc_rpc::EthConfig for BifrostEthConfig +where + C: sc_client_api::StorageProvider + Sync + Send + 'static, + BE: Backend + 'static, +{ + type EstimateGasAdapter = (); + type RuntimeStorageOverride = + fc_rpc::frontier_backend_client::SystemAccountId20StorageOverride; +} + +/// Extra dependencies for Ethereum compatibility. +pub struct EthDeps { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Graph pool instance. + pub graph: Arc>, + /// Ethereum transaction converter. + pub converter: Option, + /// The Node authority flag + pub is_authority: bool, + /// Whether to enable dev signer + pub enable_dev_signer: bool, + /// Network service + pub network: Arc, + /// Chain syncing service + pub sync_service: Arc>, + /// Frontier Backend. + pub frontier_backend: Arc>, + /// Ethereum data access overrides. + pub storage_override: Arc>, + /// Cache for Ethereum block data. + pub block_data_cache: Arc>, + /// EthFilterApi pool. + pub filter_pool: FilterPool, + /// Maximum number of logs in a query. + pub max_past_logs: u32, + /// Fee history cache. + pub fee_history_cache: FeeHistoryCache, + /// Maximum fee history cache size. + pub fee_history_cache_limit: FeeHistoryCacheLimit, + /// Maximum allowed gas limit will be ` block.gas_limit * execute_gas_limit_multiplier` when + /// using eth_call/eth_estimateGas. + pub execute_gas_limit_multiplier: u64, +} + +/// Instantiate Ethereum-compatible RPC extensions. +pub fn create_eth( + mut io: RpcModule<()>, + deps: EthDeps, + subscription_task_executor: SubscriptionTaskExecutor, + pubsub_notification_sinks: Arc< + fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + >, + >, +) -> Result, Box> +where + C: ProvideRuntimeApi, + C::Api: + BlockBuilderApi + EthereumRuntimeRPCApi + ConvertTransactionRuntimeApi, + C: BlockchainEvents + 'static, + C: HeaderBackend + + HeaderMetadata + + StorageProvider, + C: CallApiAt, + BE: Backend + 'static, + BE::State: StateBackend, + P: TransactionPool + 'static, + A: ChainApi + 'static, + CT: ConvertTransaction<::Extrinsic> + Send + Sync + 'static, +{ + use fc_rpc::{ + Debug, DebugApiServer, Eth, EthApiServer, EthDevSigner, EthFilter, EthFilterApiServer, + EthPubSub, EthPubSubApiServer, EthSigner, Net, NetApiServer, TxPool, TxPoolApiServer, Web3, + Web3ApiServer, + }; + + let EthDeps { + client, + pool, + graph, + converter, + is_authority, + enable_dev_signer, + network, + sync_service, + frontier_backend, + storage_override, + block_data_cache, + filter_pool, + max_past_logs, + fee_history_cache, + fee_history_cache_limit, + execute_gas_limit_multiplier, + } = deps; + + let mut signers = Vec::new(); + if enable_dev_signer { + signers.push(Box::new(EthDevSigner::new()) as Box); + } + + let pending_create_inherent_data_providers = move |_, _| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + // Create a dummy parachain inherent data provider which is required to pass + // the checks by the para chain system. We use dummy values because in the 'pending context' + // neither do we have access to the real values nor do we need them. + let (relay_parent_storage_root, relay_chain_state) = + RelayStateSproofBuilder::default().into_state_root_and_proof(); + let vfp = PersistedValidationData { + // This is a hack to make + // `cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases` happy. Relay parent + // number can't be bigger than u32::MAX. + relay_parent_number: u32::MAX, + relay_parent_storage_root, + ..Default::default() + }; + let parachain_inherent_data = ParachainInherentData { + validation_data: vfp, + relay_chain_state, + downward_messages: Default::default(), + horizontal_messages: Default::default(), + }; + Ok((timestamp, parachain_inherent_data)) + }; + + io.merge( + Eth::<_, _, _, _, _, _, _, BifrostEthConfig<_, _>>::new( + client.clone(), + pool.clone(), + graph.clone(), + converter, + sync_service.clone(), + signers, + storage_override.clone(), + frontier_backend.clone(), + is_authority, + block_data_cache.clone(), + fee_history_cache, + fee_history_cache_limit, + execute_gas_limit_multiplier, + None, + pending_create_inherent_data_providers, + None, + ) + .replace_config::>() + .into_rpc(), + )?; + + io.merge( + EthFilter::new( + client.clone(), + frontier_backend.clone(), + graph.clone(), + filter_pool, + 500_usize, // max stored filters + max_past_logs, + block_data_cache.clone(), + ) + .into_rpc(), + )?; + + io.merge( + EthPubSub::new( + pool, + client.clone(), + sync_service, + subscription_task_executor, + storage_override.clone(), + pubsub_notification_sinks, + ) + .into_rpc(), + )?; + + io.merge( + Net::new( + client.clone(), + network, + // Whether to format the `peer_count` response as Hex (default) or not. + true, + ) + .into_rpc(), + )?; + + io.merge(Web3::new(client.clone()).into_rpc())?; + + io.merge( + Debug::new(client.clone(), frontier_backend, storage_override, block_data_cache).into_rpc(), + )?; + + io.merge(TxPool::new(client, graph).into_rpc())?; + + Ok(io) +} diff --git a/node/rpc/src/lib.rs b/node/rpc/src/lib.rs index 33d0d17df..41dc9059b 100644 --- a/node/rpc/src/lib.rs +++ b/node/rpc/src/lib.rs @@ -37,6 +37,7 @@ use bifrost_farming_rpc::{FarmingRpc, FarmingRpcApiServer}; use bifrost_farming_rpc_runtime_api::FarmingRuntimeApi; use bifrost_flexible_fee_rpc::{FeeRpcApiServer, FlexibleFeeRpc}; use bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi as FeeRuntimeApi; +use bifrost_polkadot_runtime::Hash; use bifrost_primitives::{AccountId, Balance, Block, CurrencyId, Nonce, ParaId, PoolId}; use bifrost_salp_rpc::{SalpRpc, SalpRpcApiServer}; use bifrost_salp_rpc_runtime_api::SalpRuntimeApi; @@ -46,9 +47,11 @@ use bifrost_ve_minting_rpc::{VeMintingRpc, VeMintingRpcApiServer}; use bifrost_ve_minting_rpc_runtime_api::VeMintingRuntimeApi; use bifrost_vtoken_minting_rpc::{VtokenMintingRpc, VtokenMintingRpcApiServer}; use bifrost_vtoken_minting_rpc_runtime_api::VtokenMintingRuntimeApi; +use futures::channel::mpsc; use lend_market_rpc::{LendMarket, LendMarketApiServer}; use lend_market_rpc_runtime_api::LendMarketApi; use pallet_transaction_payment_rpc::{TransactionPayment, TransactionPaymentApiServer}; +use sc_consensus_manual_seal::rpc::{EngineCommand, ManualSeal, ManualSealApiServer}; use sc_rpc_api::DenyUnsafe; use sc_transaction_pool_api::TransactionPool; use sp_api::ProvideRuntimeApi; @@ -60,6 +63,10 @@ use zenlink_protocol::AssetId; use zenlink_protocol_rpc::{ZenlinkProtocol, ZenlinkProtocolApiServer}; use zenlink_protocol_runtime_api::ZenlinkProtocolApi as ZenlinkProtocolRuntimeApi; use zenlink_stable_amm_rpc::{StableAmm, StableAmmApiServer}; + +mod eth; +pub use self::eth::{create_eth, EthDeps}; + /// Full client dependencies. pub struct FullDeps { /// The client instance to use. @@ -70,6 +77,18 @@ pub struct FullDeps { pub deny_unsafe: DenyUnsafe, } +/// Full client dependencies. +pub struct FullDepsPolkadot { + /// The client instance to use. + pub client: Arc, + /// Transaction pool instance. + pub pool: Arc

, + /// Whether to deny unsafe calls + pub deny_unsafe: DenyUnsafe, + /// Manual seal command sink + pub command_sink: Option>>, +} + /// A IO handler that uses all Full RPC extensions. pub type RpcExtension = jsonrpsee::RpcModule<()>; @@ -118,7 +137,7 @@ where /// RPC of bifrost-polkadot runtime. pub fn create_full_polkadot( - deps: FullDeps, + deps: FullDepsPolkadot, ) -> Result> where C: ProvideRuntimeApi @@ -142,7 +161,7 @@ where P: TransactionPool + Sync + Send + 'static, { let mut module = RpcExtension::new(()); - let FullDeps { client, pool, deny_unsafe } = deps; + let FullDepsPolkadot { client, pool, deny_unsafe, command_sink } = deps; module.merge(System::new(client.clone(), pool.clone(), deny_unsafe).into_rpc())?; module.merge(TransactionPayment::new(client.clone()).into_rpc())?; @@ -156,5 +175,13 @@ where module.merge(LendMarket::new(client.clone()).into_rpc())?; module.merge(VtokenMintingRpc::new(client).into_rpc())?; + if let Some(command_sink) = command_sink { + module.merge( + // We provide the rpc handler with the sending end of the channel to allow the rpc + // send EngineCommands to the background block authorship task. + ManualSeal::new(command_sink).into_rpc(), + )?; + } + Ok(module) } diff --git a/node/service/Cargo.toml b/node/service/Cargo.toml index ab3999ade..e2470953b 100644 --- a/node/service/Cargo.toml +++ b/node/service/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] # Substrate Client +async-trait = { workspace = true } sc-basic-authorship = { workspace = true } sc-chain-spec = { workspace = true } sc-client-api = { workspace = true } @@ -70,6 +71,7 @@ cumulus-primitives-core = { workspace = true } cumulus-client-service = { workspace = true } cumulus-primitives-parachain-inherent = { workspace = true } cumulus-relay-chain-interface = { workspace = true } +cumulus-test-relay-sproof-builder = { workspace = true } # Polkadot dependencies polkadot-cli = { workspace = true } @@ -80,10 +82,12 @@ xcm = { workspace = true } bifrost-parachain-staking = { workspace = true } # External Crates +clap = { workspace = true, features = ["derive"] } hex-literal = { workspace = true } serde = { workspace = true, features = ["derive"] } serde_json = { workspace = true } log = { workspace = true } +flume = { workspace = true } futures = { workspace = true, features = ["compat"] } # Runtimes @@ -94,13 +98,27 @@ bifrost-primitives = { workspace = true } bifrost-rpc = { workspace = true } # RPC related dependencies -jsonrpsee = { workspace = true, features = [ "macros", "server" ] } +jsonrpsee = { workspace = true, features = ["macros", "server"] } # zenlink rpc zenlink-protocol = { workspace = true } zenlink-protocol-runtime-api = { workspace = true } zenlink-stable-amm-runtime-api = { workspace = true } +# Frontier +fc-consensus = { workspace = true } +fc-db = { workspace = true, features = ["default", "sql"] } +fc-mapping-sync = { workspace = true, features = ["sql"] } +fc-rpc = { workspace = true, features = ["txpool"] } +fc-rpc-core = { workspace = true } +fc-storage = { workspace = true } +fp-storage = { workspace = true } +fp-consensus = { workspace = true } +fp-account = { workspace = true } +fp-dynamic-fee = { workspace = true, features = ["default"] } +fp-evm = { workspace = true, features = ["default"] } +fp-rpc = { workspace = true, features = ["default"] } + # Bifrost rpc bifrost-flexible-fee-rpc-runtime-api = { workspace = true } bifrost-salp-rpc-runtime-api = { workspace = true } diff --git a/node/service/src/chain_spec/bifrost_kusama.rs b/node/service/src/chain_spec/bifrost_kusama.rs index 5f79fa2c2..bd7c17202 100644 --- a/node/service/src/chain_spec/bifrost_kusama.rs +++ b/node/service/src/chain_spec/bifrost_kusama.rs @@ -219,7 +219,7 @@ pub fn local_testnet_config() -> ChainSpec { ChainSpec::builder( bifrost_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "kusama-local".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "kusama-local".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost Local Testnet") .with_id("bifrost_local_testnet") @@ -325,7 +325,7 @@ pub fn chainspec_config() -> ChainSpec { ChainSpec::builder( bifrost_kusama_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "kusama".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "kusama".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost") .with_id("bifrost") diff --git a/node/service/src/chain_spec/bifrost_polkadot.rs b/node/service/src/chain_spec/bifrost_polkadot.rs index 2f7ec46a2..6618aa5b7 100644 --- a/node/service/src/chain_spec/bifrost_polkadot.rs +++ b/node/service/src/chain_spec/bifrost_polkadot.rs @@ -20,14 +20,22 @@ use crate::chain_spec::{get_account_id_from_seed, get_from_seed, RelayExtensions use bifrost_polkadot_runtime::{ constants::currency::DOLLARS, AccountId, Balance, BlockNumber, SS58Prefix, }; -use bifrost_primitives::{CurrencyId, CurrencyId::*, TokenInfo, TokenSymbol, DOT_TOKEN_ID}; +use bifrost_primitives::{ + currency::{BNCS, DED, IBTC, INTR, PEN, PINK, USDC, WETH}, + CurrencyId, + CurrencyId::*, + TokenInfo, TokenSymbol, ASTR, BNC, DOT, DOT_TOKEN_ID, DOT_U, FIL, GLMR, MANTA, +}; use bifrost_runtime_common::AuraId; use cumulus_primitives_core::ParaId; +use fp_evm::GenesisAccount; use frame_benchmarking::{account, whitelisted_caller}; use hex_literal::hex; use sc_chain_spec::Properties; use sc_service::ChainType; -use sp_core::{crypto::UncheckedInto, sr25519}; +use sp_core::{crypto::UncheckedInto, sr25519, H160, U256}; +use sp_runtime::FixedU128; +use std::{collections::BTreeMap, str::FromStr}; const DEFAULT_PROTOCOL_ID: &str = "bifrost_polkadot"; @@ -67,6 +75,7 @@ pub fn bifrost_polkadot_genesis( balances: Vec<(AccountId, Balance)>, vestings: Vec<(AccountId, BlockNumber, BlockNumber, Balance)>, id: ParaId, + tokens: Vec<(AccountId, CurrencyId, Balance)>, council_membership: Vec, technical_committee_membership: Vec, salp_multisig_key: AccountId, @@ -76,8 +85,9 @@ pub fn bifrost_polkadot_genesis( Vec<(CurrencyId, u32, u32, u32)>, ), oracle_membership: Vec, + evm_accounts: BTreeMap, ) -> serde_json::Value { - serde_json::json!( { + serde_json::json!({ "balances": { "balances": balances }, @@ -103,9 +113,9 @@ pub fn bifrost_polkadot_genesis( .cloned() .map(|(acc, aura)| { ( - acc.clone(), // account id - acc, // validator id - bifrost_polkadot_runtime::SessionKeys { aura }, // session keys + acc.clone(), // account id + acc, // validator id + bifrost_polkadot_runtime::opaque::SessionKeys { aura }, // session keys ) }) .collect::>(), @@ -121,7 +131,19 @@ pub fn bifrost_polkadot_genesis( "polkadotXcm": { "safeXcmVersion": 3 }, - "salp": { "initialMultisigAccount": Some(salp_multisig_key) } + "salp": { "initialMultisigAccount": Some(salp_multisig_key) }, + "tokens": { "balances": tokens }, + "prices": { + "emergencyPrice": vec![ + (DOT, FixedU128::from_inner(6_000_000_000_000_000_000u128)), + (WETH, FixedU128::from_inner(3000_000_000_000_000_000_000u128)), + (BNC, FixedU128::from_inner(250_000_000_000_000_000u128)), + ] + }, + // EVM compatibility + "evmChainId": { "chainId": 996u64 }, + "dynamicFee": { "minGasPrice": U256::from(560174200u64) }, + "evm": { "accounts": evm_accounts }, }) } @@ -137,24 +159,75 @@ pub fn local_testnet_config() -> ChainSpec { account("bechmarking_account_1", 0, 0), ]; let balances = endowed_accounts.iter().cloned().map(|x| (x, ENDOWMENT())).collect(); + let tokens = endowed_accounts + .iter() + .flat_map(|x| { + vec![ + (x.clone(), DOT, ENDOWMENT() * 4_000_000), + (x.clone(), WETH, ENDOWMENT() * 4_000_000), + ] + }) + .collect(); let council_membership = vec![get_account_id_from_seed::("Alice")]; let technical_committee_membership = vec![get_account_id_from_seed::("Alice")]; let oracle_membership = vec![get_account_id_from_seed::("Alice")]; let salp_multisig: AccountId = hex!["49daa32c7287890f38b7e1a8cd2961723d36d20baa0bf3b82e0c4bdda93b1c0a"].into(); let currency = vec![ - (Native(TokenSymbol::BNC), DOLLARS / 100, None), ( - Token2(DOT_TOKEN_ID), - DOLLARS / 1000_000, - Some((String::from("Polkadot DOT"), String::from("DOT"), 10u8)), + BNC, + 10_000_000_000, + Some((String::from("Bifrost Native Coin"), String::from("BNC"), 12u8)), + ), + (DOT, 1_000_000, Some((String::from("Polkadot DOT"), String::from("DOT"), 10u8))), + ( + GLMR, + 1_000_000_000_000, + Some((String::from("Moonbeam Native Token"), String::from("GLMR"), 18u8)), + ), + (DOT_U, 1_000, Some((String::from("Tether USD"), String::from("USDT"), 6u8))), + (ASTR, 10_000_000_000_000_000, Some((String::from("Astar"), String::from("ASTR"), 18u8))), + ( + FIL, + 1_000_000_000_000, + Some((String::from("Filecoin Network Token"), String::from("FIL"), 18u8)), + ), + (USDC, 1_000, Some((String::from("USD Coin"), String::from("USDC"), 6u8))), + (IBTC, 100, Some((String::from("interBTC"), String::from("IBTC"), 8u8))), + (INTR, 10_000_000, Some((String::from("Interlay"), String::from("INTR"), 10u8))), + ( + MANTA, + 10_000_000_000_000, + Some((String::from("Manta Network"), String::from("MANTA"), 18u8)), + ), + ( + BNCS, + 10_000_000_000, + Some((String::from("bncs-20 inscription token BNCS"), String::from("BNCS"), 12u8)), ), + (PINK, 100_000_000, Some((String::from("PINK"), String::from("PINK"), 10u8))), + (DED, 1, Some((String::from("DED"), String::from("DED"), 10u8))), + (PEN, 100_000_000, Some((String::from("Pendulum"), String::from("PEN"), 12u8))), + (WETH, 100_000_000, Some((String::from("SnowBridge WETH"), String::from("SWETH"), 18u8))), ]; let vcurrency = vec![VSToken2(DOT_TOKEN_ID), VToken(TokenSymbol::BNC), VToken2(DOT_TOKEN_ID)]; + let mut evm_accounts = BTreeMap::new(); + evm_accounts.insert( + // H160 address of CI test runner account + H160::from_str("6be02d1d3665660d22ff9624b7be0551ee1ac91b") + .expect("internal H160 is valid; qed"), + fp_evm::GenesisAccount { + balance: U256::from(1_000_000_000_000_000_000_000_000u128), + code: Default::default(), + nonce: Default::default(), + storage: Default::default(), + }, + ); + ChainSpec::builder( bifrost_polkadot_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "polkadot-local".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "polkadot-local".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost Polkadot Local Testnet") .with_id("bifrost_polkadot_local_testnet") @@ -170,11 +243,13 @@ pub fn local_testnet_config() -> ChainSpec { balances, vec![], PARA_ID.into(), + tokens, council_membership, technical_committee_membership, salp_multisig, (currency, vcurrency, vec![]), oracle_membership, + evm_accounts, )) .with_properties(bifrost_polkadot_properties()) .with_protocol_id(DEFAULT_PROTOCOL_ID) @@ -241,7 +316,7 @@ pub fn paseo_config() -> ChainSpec { ChainSpec::builder( bifrost_polkadot_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "paseo".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "paseo".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost Paseo") .with_id("bifrost_paseo") @@ -251,11 +326,13 @@ pub fn paseo_config() -> ChainSpec { balances, vec![], PARA_ID.into(), + vec![], council_membership, technical_committee_membership, salp_multisig, (vec![], vec![], vec![]), oracle_membership, + BTreeMap::new(), )) .with_properties(bifrost_polkadot_properties()) .with_protocol_id(DEFAULT_PROTOCOL_ID) @@ -294,7 +371,7 @@ pub fn chainspec_config() -> ChainSpec { ChainSpec::builder( bifrost_polkadot_runtime::WASM_BINARY.expect("WASM binary was not built, please build it!"), - RelayExtensions { relay_chain: "polkadot".into(), para_id: PARA_ID }, + RelayExtensions { relay_chain: "polkadot".into(), para_id: PARA_ID, evm_since: 1 }, ) .with_name("Bifrost Polkadot") .with_id("bifrost_polkadot") @@ -306,9 +383,11 @@ pub fn chainspec_config() -> ChainSpec { PARA_ID.into(), vec![], vec![], + vec![], salp_multisig, (vec![], vec![], vec![]), vec![], + BTreeMap::new(), )) .with_properties(bifrost_polkadot_properties()) .with_protocol_id(DEFAULT_PROTOCOL_ID) diff --git a/node/service/src/chain_spec/mod.rs b/node/service/src/chain_spec/mod.rs index b5a8e00f2..e1c180ce5 100644 --- a/node/service/src/chain_spec/mod.rs +++ b/node/service/src/chain_spec/mod.rs @@ -21,6 +21,7 @@ pub mod bifrost_kusama; #[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))] pub mod bifrost_polkadot; +use bifrost_primitives::BlockNumber; pub use bifrost_primitives::{AccountId, Block, Signature}; use sc_chain_spec::ChainSpecExtension; use serde::{Deserialize, Serialize}; @@ -42,11 +43,14 @@ pub struct RelayExtensions { pub relay_chain: String, /// The id of the Parachain. pub para_id: u32, + /// EVM compatible starting block number + pub evm_since: BlockNumber, } impl RelayExtensions { /// Try to get the extension from the given `ChainSpec`. - pub fn try_get(chain_spec: &dyn sc_service::ChainSpec) -> Option<&Self> { + #[allow(clippy::borrowed_box)] + pub fn try_get(chain_spec: &Box) -> Option<&Self> { sc_chain_spec::get_extension(chain_spec.extensions()) } } diff --git a/node/service/src/collator_kusama.rs b/node/service/src/collator_kusama.rs index 4e55baad0..2d2e41cb3 100644 --- a/node/service/src/collator_kusama.rs +++ b/node/service/src/collator_kusama.rs @@ -31,6 +31,7 @@ use cumulus_client_consensus_aura::collators::basic::{ use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport; use cumulus_client_consensus_proposer::Proposer; +use crate::eth::EthConfiguration; use bifrost_primitives::Block; use cumulus_client_service::{ build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, @@ -265,6 +266,7 @@ fn start_consensus( async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, + _eth_config: EthConfiguration, collator_options: CollatorOptions, sybil_resistance_level: CollatorSybilResistance, para_id: ParaId, @@ -434,6 +436,7 @@ where pub async fn start_node>( parachain_config: Configuration, polkadot_config: Configuration, + eth_config: EthConfiguration, collator_options: CollatorOptions, para_id: ParaId, hwbench: Option, @@ -441,6 +444,7 @@ pub async fn start_node>( start_node_impl::( parachain_config, polkadot_config, + eth_config, collator_options, CollatorSybilResistance::Resistant, para_id, diff --git a/node/service/src/collator_polkadot.rs b/node/service/src/collator_polkadot.rs index e74fadade..22db81766 100644 --- a/node/service/src/collator_polkadot.rs +++ b/node/service/src/collator_polkadot.rs @@ -17,11 +17,15 @@ // along with this program. If not, see . //! Service implementation. Specialized wrapper over substrate service. -use std::{sync::Arc, time::Duration}; +use std::{ + collections::BTreeMap, + sync::{Arc, Mutex}, + time::Duration, +}; #[cfg(any(feature = "with-bifrost-polkadot-runtime", feature = "with-bifrost-runtime"))] pub use bifrost_polkadot_runtime; -use bifrost_polkadot_runtime::RuntimeApi; +use bifrost_polkadot_runtime::{RuntimeApi, TransactionConverter}; use cumulus_client_cli::CollatorOptions; use cumulus_client_collator::service::CollatorService; use cumulus_client_consensus_aura::collators::basic::{ @@ -31,6 +35,7 @@ use cumulus_client_consensus_aura::collators::basic::{ use cumulus_client_consensus_common::ParachainBlockImport as TParachainBlockImport; use cumulus_client_consensus_proposer::Proposer; +use crate::{chain_spec, eth}; use bifrost_primitives::Block; use cumulus_client_service::{ build_network, build_relay_chain_interface, prepare_node_config, start_relay_chain_tasks, @@ -38,6 +43,8 @@ use cumulus_client_service::{ }; use cumulus_primitives_core::{relay_chain::Hash, ParaId}; use cumulus_relay_chain_interface::{OverseerHandle, RelayChainInterface}; +use fc_rpc_core::types::{FeeHistoryCache, FilterPool}; +use fc_storage::StorageOverrideHandler; use polkadot_primitives::CollatorPair; use sc_client_api::backend::Backend; use sc_consensus::{ImportQueue, LongestChain}; @@ -50,6 +57,8 @@ use sc_transaction_pool_api::OffchainTransactionPoolFactory; use sp_keystore::KeystorePtr; use substrate_prometheus_endpoint::Registry; +use crate::eth::{EthConfiguration, FrontierBackend}; + #[cfg(not(feature = "runtime-benchmarks"))] type HostFunctions = cumulus_client_service::ParachainHostFunctions; @@ -74,7 +83,14 @@ pub fn new_partial( MaybeFullSelectChain, sc_consensus::import_queue::BasicQueue, sc_transaction_pool::FullPool, - (ParachainBlockImport, Option, Option), + ( + eth::BlockImport, + Option, + Option, + Arc>, + FilterPool, + FeeHistoryCache, + ), >, sc_service::Error, > { @@ -129,7 +145,21 @@ pub fn new_partial( let select_chain = if dev { Some(LongestChain::new(backend.clone())) } else { None }; - let block_import = ParachainBlockImport::new(client.clone(), backend.clone()); + let frontier_backend = Arc::new(FrontierBackend::open( + Arc::clone(&client), + &config.database, + ð::db_config_dir(config), + )?); + + let evm_since = chain_spec::RelayExtensions::try_get(&config.chain_spec) + .map(|e| e.evm_since) + .unwrap_or(1); + let block_import = eth::BlockImport::new( + ParachainBlockImport::new(client.clone(), backend.clone()), + client.clone(), + frontier_backend.clone(), + evm_since, + ); let import_queue = if dev { sc_consensus_manual_seal::import_queue( @@ -147,6 +177,9 @@ pub fn new_partial( )? }; + let filter_pool: FilterPool = Arc::new(Mutex::new(BTreeMap::new())); + let fee_history_cache: FeeHistoryCache = Arc::new(Mutex::new(BTreeMap::new())); + Ok(PartialComponents { backend, client, @@ -155,14 +188,21 @@ pub fn new_partial( task_manager, transaction_pool, select_chain, - other: (block_import, telemetry, telemetry_worker_handle), + other: ( + block_import, + telemetry, + telemetry_worker_handle, + frontier_backend, + filter_pool, + fee_history_cache, + ), }) } /// Build the import queue for the parachain runtime. fn build_import_queue( client: Arc, - block_import: ParachainBlockImport, + block_import: eth::BlockImport, config: &Configuration, telemetry: Option, task_manager: &TaskManager, @@ -199,7 +239,7 @@ fn build_import_queue( fn start_consensus( client: Arc, - block_import: ParachainBlockImport, + block_import: eth::BlockImport, prometheus_registry: Option<&Registry>, telemetry: Option, task_manager: &TaskManager, @@ -266,6 +306,7 @@ fn start_consensus( async fn start_node_impl( parachain_config: Configuration, polkadot_config: Configuration, + eth_config: EthConfiguration, collator_options: CollatorOptions, sybil_resistance_level: CollatorSybilResistance, para_id: ParaId, @@ -277,7 +318,14 @@ where let parachain_config = prepare_node_config(parachain_config); let params = new_partial(¶chain_config, false)?; - let (block_import, mut telemetry, telemetry_worker_handle) = params.other; + let ( + block_import, + mut telemetry, + telemetry_worker_handle, + frontier_backend, + filter_pool, + fee_history_cache, + ) = params.other; let client = params.client.clone(); let backend = params.backend.clone(); @@ -337,17 +385,73 @@ where ); } + let storage_override = Arc::new(StorageOverrideHandler::new(client.clone())); + let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new( + task_manager.spawn_handle(), + storage_override.clone(), + eth_config.eth_log_block_cache, + eth_config.eth_statuses_cache, + prometheus_registry.clone(), + )); + + // Sinks for pubsub notifications. + // Everytime a new subscription is created, a new mpsc channel is added to the sink pool. + // The MappingSyncWorker sends through the channel on block import and the subscription emits a + // notification to the subscriber on receiving a message through this channel. + // This way we avoid race conditions when using native substrate block import notification + // stream. + let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + > = Default::default(); + let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks); + let rpc_builder = { let client = client.clone(); + let is_authority = parachain_config.role.is_authority(); let transaction_pool = transaction_pool.clone(); - - Box::new(move |deny_unsafe, _| { - let deps = crate::rpc::FullDeps { + let network = network.clone(); + let sync_service = sync_service.clone(); + let frontier_backend = frontier_backend.clone(); + let fee_history_cache = fee_history_cache.clone(); + let filter_pool = filter_pool.clone(); + let storage_override = storage_override.clone(); + let pubsub_notification_sinks = pubsub_notification_sinks.clone(); + + Box::new(move |deny_unsafe, subscription_task_executor| { + let deps = crate::rpc::FullDepsPolkadot { client: client.clone(), pool: transaction_pool.clone(), deny_unsafe, + command_sink: None, + }; + let module = crate::rpc::create_full_polkadot(deps)?; + + let eth_deps = crate::rpc::EthDeps { + client: client.clone(), + pool: transaction_pool.clone(), + graph: transaction_pool.pool().clone(), + converter: Some(TransactionConverter), + is_authority, + enable_dev_signer: eth_config.enable_dev_signer, + network: network.clone(), + sync_service: sync_service.clone(), + frontier_backend: frontier_backend.clone(), + storage_override: storage_override.clone(), + block_data_cache: block_data_cache.clone(), + filter_pool: filter_pool.clone(), + max_past_logs: eth_config.max_past_logs, + fee_history_cache: fee_history_cache.clone(), + fee_history_cache_limit: eth_config.fee_history_limit, + execute_gas_limit_multiplier: eth_config.execute_gas_limit_multiplier, }; - crate::rpc::create_full_polkadot(deps).map_err(Into::into) + + crate::rpc::create_eth( + module, + eth_deps, + subscription_task_executor, + pubsub_notification_sinks.clone(), + ) + .map_err(Into::into) }) }; @@ -358,7 +462,7 @@ where task_manager: &mut task_manager, config: parachain_config, keystore: params.keystore_container.keystore(), - backend, + backend: backend.clone(), network: network.clone(), sync_service: sync_service.clone(), system_rpc_tx, @@ -366,6 +470,19 @@ where telemetry: telemetry.as_mut(), })?; + eth::spawn_frontier_tasks( + &task_manager, + client.clone(), + backend, + frontier_backend, + filter_pool, + storage_override, + fee_history_cache, + eth_config.fee_history_limit, + sync_service.clone(), + pubsub_notification_sinks, + ); + if let Some(hwbench) = hwbench { sc_sysinfo::print_hwbench(&hwbench); @@ -435,6 +552,7 @@ where pub async fn start_node>( parachain_config: Configuration, polkadot_config: Configuration, + eth_config: EthConfiguration, collator_options: CollatorOptions, para_id: ParaId, hwbench: Option, @@ -442,6 +560,7 @@ pub async fn start_node>( start_node_impl::( parachain_config, polkadot_config, + eth_config, collator_options, CollatorSybilResistance::Resistant, para_id, diff --git a/node/service/src/dev.rs b/node/service/src/dev.rs index c4605d55f..5b6cbacdf 100644 --- a/node/service/src/dev.rs +++ b/node/service/src/dev.rs @@ -16,18 +16,33 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -use std::sync::Arc; - -use cumulus_primitives_parachain_inherent::MockValidationDataInherentDataProvider; -use futures::StreamExt; +use bifrost_polkadot_runtime::{constants::time::SLOT_DURATION, TransactionConverter}; +use cumulus_primitives_core::{ParaId, PersistedValidationData}; +use cumulus_primitives_parachain_inherent::{ + MockValidationDataInherentDataProvider, MockXcmConfig, ParachainInherentData, +}; +use cumulus_test_relay_sproof_builder::RelayStateSproofBuilder; +use jsonrpsee::core::async_trait; +use sc_client_api::Backend; use sc_executor::NativeElseWasmExecutor; use sc_service::{error::Error as ServiceError, Configuration, TaskManager}; +use sc_transaction_pool_api::OffchainTransactionPoolFactory; +use sp_core::U256; +use std::{ + cell::RefCell, + collections::BTreeMap, + sync::{Arc, Mutex}, +}; + +use crate::{ + collator_polkadot::FullClient, + eth::{spawn_frontier_tasks, EthConfiguration}, +}; pub type Block = bifrost_primitives::Block; -pub type Executor = crate::collator_kusama::BifrostExecutor; -pub type RuntimeApi = crate::collator_kusama::bifrost_kusama_runtime::RuntimeApi; -pub type FullClient = - sc_service::TFullClient>; +pub type Executor = crate::collator_polkadot::BifrostPolkadotExecutor; +pub type RuntimeApi = bifrost_polkadot_runtime::RuntimeApi; + pub type FullBackend = sc_service::TFullBackend; pub type FullSelectChain = sc_consensus::LongestChain; @@ -39,135 +54,304 @@ pub fn default_mock_parachain_inherent_data_provider() -> MockValidationDataInhe xcm_config: Default::default(), raw_downward_messages: vec![], raw_horizontal_messages: vec![], + para_blocks_per_relay_epoch: 0, + relay_randomness_config: (), + } +} + +thread_local!(static TIMESTAMP: RefCell = const { RefCell::new(0) }); + +/// Provide a mock duration starting at 0 in millisecond for timestamp inherent. +/// Each call will increment timestamp by slot_duration making Aura think time has passed. +struct MockTimestampInherentDataProvider; + +#[async_trait] +impl sp_inherents::InherentDataProvider for MockTimestampInherentDataProvider { + async fn provide_inherent_data( + &self, + inherent_data: &mut sp_inherents::InherentData, + ) -> Result<(), sp_inherents::Error> { + TIMESTAMP.with(|x| { + *x.borrow_mut() += SLOT_DURATION; + inherent_data.put_data(sp_timestamp::INHERENT_IDENTIFIER, &*x.borrow()) + }) + } + + async fn try_handle_error( + &self, + _identifier: &sp_inherents::InherentIdentifier, + _error: &[u8], + ) -> Option> { + // The pallet never reports error. + None } } /// Builds a new development service. This service uses manual seal, and mocks /// the parachain inherent. -pub fn start_node(config: Configuration) -> Result { - let sc_service::PartialComponents { - client, - backend, - mut task_manager, - import_queue, - keystore_container, - select_chain: maybe_select_chain, - transaction_pool, - other: (_, _), - } = crate::collator_kusama::new_partial::< - bifrost_kusama_runtime::RuntimeApi, - crate::collator_kusama::BifrostExecutor, - >(&config, true)?; - - let (network, system_rpc_tx, network_starter) = +/// Before calling this function, you must set OnTimestampSet in runtime to be (). +pub async fn start_node( + config: Configuration, + eth_config: EthConfiguration, +) -> sc_service::error::Result<(TaskManager, Arc)> { + let params = crate::collator_polkadot::new_partial(&config, ð_config, true)?; + let (block_import, mut telemetry, telemetry_worker_handle, frontier_backend) = params.other; + + let client = params.client.clone(); + let backend = params.backend.clone(); + let mut task_manager = params.task_manager; + + let validator = config.role.is_authority(); + let prometheus_registry = config.prometheus_registry().cloned(); + let transaction_pool = params.transaction_pool.clone(); + let net_config = sc_network::config::FullNetworkConfiguration::new(&config.network); + + let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) = sc_service::build_network(sc_service::BuildNetworkParams { config: &config, + net_config, client: client.clone(), transaction_pool: transaction_pool.clone(), spawn_handle: task_manager.spawn_handle(), - import_queue, + import_queue: params.import_queue, block_announce_validator_builder: None, - warp_sync: None, + warp_sync_params: None, + block_relay: None, })?; + let prometheus_registry = config.prometheus_registry().cloned(); + if config.offchain_worker.enabled { - let offchain_workers = Arc::new(sc_offchain::OffchainWorkers::new_with_options( - client.clone(), - sc_offchain::OffchainWorkerOptions { enable_http_requests: false }, - )); + use futures::FutureExt; - // Start the offchain workers to have + let backend_ofc = backend.clone(); task_manager.spawn_handle().spawn( - "offchain-notifications", - None, - sc_offchain::notification_future( - config.role.is_authority(), - client.clone(), - offchain_workers, - task_manager.spawn_handle(), - network.clone(), - ), + "offchain-workers-runner", + "offchain-work", + sc_offchain::OffchainWorkers::new(sc_offchain::OffchainWorkerOptions { + runtime_api_provider: client.clone(), + keystore: Some(params.keystore_container.keystore()), + offchain_db: backend_ofc.offchain_storage(), + transaction_pool: Some(OffchainTransactionPoolFactory::new( + transaction_pool.clone(), + )), + network_provider: network.clone(), + is_validator: config.role.is_authority(), + enable_http_requests: false, + custom_extensions: move |_| vec![], + }) + .run(client.clone(), task_manager.spawn_handle()) + .boxed(), ); } - let prometheus_registry = config.prometheus_registry().cloned(); let role = config.role.clone(); + let force_authoring = config.force_authoring; + let backoff_authoring_blocks: Option<()> = None; - let select_chain = maybe_select_chain - .expect("In dev mode, `new_partial` will return some `select_chain`; qed"); + let select_chain = params + .select_chain + .expect("In `dev` mode, `new_partial` will return some `select_chain`; qed"); - if role.is_authority() { - let proposer_factory = sc_basic_authorship::ProposerFactory::new( - task_manager.spawn_handle(), - client.clone(), - transaction_pool.clone(), - prometheus_registry.as_ref(), - None, - ); + let proposer_factory = sc_basic_authorship::ProposerFactory::new( + task_manager.spawn_handle(), + client.clone(), + transaction_pool.clone(), + None, + None, + ); + + // Channel for the rpc handler to communicate with the authorship task. + let (command_sink, commands_stream) = futures::channel::mpsc::channel(1024); + + let pool = transaction_pool.pool().clone(); - let pool = transaction_pool.pool().clone(); - let commands_stream = pool.validated_pool().import_notification_stream().map(|_| { - sc_consensus_manual_seal::rpc::EngineCommand::SealNewBlock { - create_empty: false, - finalize: true, - parent_hash: None, - sender: None, - } + let client_for_cidp = client.clone(); + + let (downward_xcm_sender, downward_xcm_receiver) = flume::bounded::>(100); + let (hrmp_xcm_sender, hrmp_xcm_receiver) = flume::bounded::<(ParaId, Vec)>(100); + + let authorship_future = + sc_consensus_manual_seal::run_manual_seal(sc_consensus_manual_seal::ManualSealParams { + block_import: client.clone(), + env: proposer_factory, + client: client.clone(), + pool: transaction_pool.clone(), + commands_stream, + select_chain, + consensus_data_provider: None, + create_inherent_data_providers: move |block, _| { + let current_para_block = client_for_cidp + .header(block) + .ok() + .flatten() + .expect("Header lookup should succeed") + .number; + let downward_xcm_receiver = downward_xcm_receiver.clone(); + let hrmp_xcm_receiver = hrmp_xcm_receiver.clone(); + let client_for_xcm = client_for_cidp.clone(); + async move { + let mocked_parachain = MockValidationDataInherentDataProvider { + current_para_block, + relay_offset: 1000, + relay_blocks_per_para_block: 2, + para_blocks_per_relay_epoch: 0, + relay_randomness_config: (), + xcm_config: MockXcmConfig::new( + &*client_for_xcm, + block, + Default::default(), + Default::default(), + ), + raw_downward_messages: downward_xcm_receiver.drain().collect(), + raw_horizontal_messages: hrmp_xcm_receiver.drain().collect(), + }; + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + Ok((timestamp, mocked_parachain)) + } + }, }); + // we spawn the future on a background thread managed by service. + task_manager.spawn_essential_handle().spawn_blocking( + "manual-seal", + Some("block-authoring"), + authorship_future, + ); - let authorship_future = - sc_consensus_manual_seal::run_manual_seal(sc_consensus_manual_seal::ManualSealParams { - block_import: client.clone(), - env: proposer_factory, - client: client.clone(), - pool: transaction_pool.clone(), - commands_stream, - select_chain, - consensus_data_provider: None, - create_inherent_data_providers: |_, _| async { - Ok(( - sp_timestamp::InherentDataProvider::from_system_time(), - default_mock_parachain_inherent_data_provider(), - )) - }, - }); - // we spawn the future on a background thread managed by service. - task_manager.spawn_essential_handle().spawn_blocking( - "instant-seal", - Some("block-authoring"), - authorship_future, - ); - } + let overrides = crate::rpc::overrides_handle(client.clone()); + + // Sinks for pubsub notifications. + // Everytime a new subscription is created, a new mpsc channel is added to the sink pool. + // The MappingSyncWorker sends through the channel on block import and the subscription emits a + // notification to the subscriber on receiving a message through this channel. + // This way we avoid race conditions when using native substrate block import notification + // stream. + let pubsub_notification_sinks: fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + > = Default::default(); + let pubsub_notification_sinks = Arc::new(pubsub_notification_sinks); + + let filter_pool = Some(Arc::new(Mutex::new(BTreeMap::new()))); + let fee_history_cache = Arc::new(Mutex::new(BTreeMap::new())); + // let fee_history_cache_limit = parachain_config.fee_history_limit; + let fee_history_cache_limit = 2048; - let rpc_extensions_builder = { + let rpc_builder = { let client = client.clone(); - let transaction_pool = transaction_pool.clone(); - Box::new(move |deny_unsafe, _| { - let deps = crate::rpc::FullDeps { + let pool = transaction_pool.clone(); + let network = network.clone(); + let sync_service = sync_service.clone(); + + let is_authority = config.role.is_authority(); + let enable_dev_signer = eth_config.enable_dev_signer; + let max_past_logs = eth_config.max_past_logs; + let execute_gas_limit_multiplier = eth_config.execute_gas_limit_multiplier; + let filter_pool = filter_pool.clone(); + let frontier_backend = frontier_backend.clone(); + let pubsub_notification_sinks = pubsub_notification_sinks.clone(); + let overrides = overrides.clone(); + let fee_history_cache = fee_history_cache.clone(); + let block_data_cache = Arc::new(fc_rpc::EthBlockDataCacheTask::new( + task_manager.spawn_handle(), + overrides.clone(), + eth_config.eth_log_block_cache, + eth_config.eth_statuses_cache, + prometheus_registry.clone(), + )); + + let pending_create_inherent_data_providers = move |_, _| async move { + let timestamp = sp_timestamp::InherentDataProvider::from_system_time(); + // Create a dummy parachain inherent data provider which is required to pass + // the checks by the para chain system. We use dummy values because in the 'pending + // context' neither do we have access to the real values nor do we need them. + let (relay_parent_storage_root, relay_chain_state) = + RelayStateSproofBuilder::default().into_state_root_and_proof(); + let vfp = PersistedValidationData { + // This is a hack to make + // `cumulus_pallet_parachain_system::RelayNumberStrictlyIncreases` happy. Relay + // parent number can't be bigger than u32::MAX. + relay_parent_number: u32::MAX, + relay_parent_storage_root, + ..Default::default() + }; + let parachain_inherent_data = ParachainInherentData { + validation_data: vfp, + relay_chain_state, + downward_messages: Default::default(), + horizontal_messages: Default::default(), + }; + Ok((timestamp, parachain_inherent_data)) + }; + + Box::new(move |deny_unsafe, subscription_task_executor| { + let eth_deps = crate::rpc::EthDeps { + client: client.clone(), + pool: pool.clone(), + graph: pool.pool().clone(), + converter: Some(TransactionConverter), + is_authority, + enable_dev_signer, + network: network.clone(), + sync: sync_service.clone(), + frontier_backend: match frontier_backend.clone() { + fc_db::Backend::KeyValue(b) => Arc::new(b), + fc_db::Backend::Sql(b) => Arc::new(b), + }, + overrides: overrides.clone(), + block_data_cache: block_data_cache.clone(), + filter_pool: filter_pool.clone(), + max_past_logs, + fee_history_cache: fee_history_cache.clone(), + fee_history_cache_limit, + execute_gas_limit_multiplier, + forced_parent_hashes: None, + pending_create_inherent_data_providers, + }; + let deps = crate::rpc::FullDepsPolkadot { client: client.clone(), - pool: transaction_pool.clone(), + pool: pool.clone(), deny_unsafe, + command_sink: Some(command_sink.clone()), + eth: eth_deps, }; - - Ok(crate::rpc::create_full_rpc(deps)) + crate::rpc::create_full_polkadot( + deps, + subscription_task_executor, + pubsub_notification_sinks.clone(), + ) + .map_err(Into::into) }) }; sc_service::spawn_tasks(sc_service::SpawnTasksParams { - network, - client, - keystore: keystore_container.sync_keystore(), + rpc_builder, + client: client.clone(), + transaction_pool: transaction_pool.clone(), task_manager: &mut task_manager, - transaction_pool, - rpc_extensions_builder, - backend, - system_rpc_tx, config, - telemetry: None, + keystore: params.keystore_container.keystore(), + backend: backend.clone(), + network: network.clone(), + sync_service: sync_service.clone(), + system_rpc_tx, + tx_handler_controller, + telemetry: telemetry.as_mut(), })?; + start_network.start_network(); - log::info!("Development Service Ready"); + spawn_frontier_tasks( + &task_manager, + client.clone(), + backend, + frontier_backend, + filter_pool, + overrides, + fee_history_cache, + fee_history_cache_limit, + sync_service.clone(), + pubsub_notification_sinks, + ) + .await; - network_starter.start_network(); - Ok(task_manager) + Ok((task_manager, client)) } diff --git a/node/service/src/eth.rs b/node/service/src/eth.rs new file mode 100644 index 000000000..ed19208e0 --- /dev/null +++ b/node/service/src/eth.rs @@ -0,0 +1,212 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use std::{marker::PhantomData, path::PathBuf, sync::Arc, time::Duration}; + +use crate::collator_polkadot::{FullBackend, FullClient}; +use bifrost_polkadot_runtime::opaque::Block; +use cumulus_client_consensus_common::ParachainBlockImportMarker; +use cumulus_primitives_core::BlockT; +use fc_consensus::Error; +pub use fc_consensus::FrontierBlockImport; +pub use fc_db::kv::Backend as FrontierBackend; +use fc_mapping_sync::{kv::MappingSyncWorker, SyncStrategy}; +use fc_rpc::EthTask; +pub use fc_rpc_core::types::{FeeHistoryCache, FeeHistoryCacheLimit, FilterPool}; +use fc_storage::StorageOverride; +use fp_consensus::ensure_log; +use fp_rpc::EthereumRuntimeRPCApi; +use futures::{future, prelude::*}; +use polkadot_service::HeaderT; +use sc_client_api::{AuxStore, BlockOf, BlockchainEvents}; +use sc_consensus::{ + BlockCheckParams, BlockImport as BlockImportT, BlockImportParams, ImportResult, +}; +use sc_network_sync::SyncingService; +use sc_service::{Configuration, TaskManager}; +use sp_api::ProvideRuntimeApi; +use sp_block_builder::BlockBuilder as BlockBuilderApi; +use sp_blockchain::HeaderBackend; +use sp_consensus::Error as ConsensusError; + +pub fn db_config_dir(config: &Configuration) -> PathBuf { + config.base_path.config_dir(config.chain_spec.id()) +} + +/// The ethereum-compatibility configuration used to run a node. +#[derive(Clone, Debug, clap::Parser)] +pub struct EthConfiguration { + /// Maximum number of logs in a query. + #[arg(long, default_value = "10000")] + pub max_past_logs: u32, + + /// Maximum fee history cache size. + #[arg(long, default_value = "2048")] + pub fee_history_limit: u64, + + #[arg(long)] + pub enable_dev_signer: bool, + + /// The dynamic-fee pallet target gas price set by block author + #[arg(long, default_value = "1")] + pub target_gas_price: u64, + + /// Maximum allowed gas limit will be `block.gas_limit * execute_gas_limit_multiplier` + /// when using eth_call/eth_estimateGas. + #[arg(long, default_value = "10")] + pub execute_gas_limit_multiplier: u64, + + /// Size in bytes of the LRU cache for block data. + #[arg(long, default_value = "50")] + pub eth_log_block_cache: usize, + + /// Size in bytes of the LRU cache for transactions statuses data. + #[arg(long, default_value = "50")] + pub eth_statuses_cache: usize, +} + +type BlockNumberOf = <::Header as HeaderT>::Number; + +pub struct BlockImport, C> { + inner: I, + client: Arc, + backend: Arc>, + evm_since: BlockNumberOf, + _marker: PhantomData, +} + +impl, C> Clone for BlockImport { + fn clone(&self) -> Self { + BlockImport { + inner: self.inner.clone(), + client: self.client.clone(), + backend: self.backend.clone(), + evm_since: self.evm_since, + _marker: PhantomData, + } + } +} + +impl BlockImport +where + B: BlockT, + I: BlockImportT + Send + Sync, + I::Error: Into, + C: ProvideRuntimeApi + Send + Sync + HeaderBackend + AuxStore + BlockOf, + C::Api: EthereumRuntimeRPCApi, + C::Api: BlockBuilderApi, +{ + pub fn new( + inner: I, + client: Arc, + backend: Arc>, + evm_since: BlockNumberOf, + ) -> Self { + Self { inner, client, backend, evm_since, _marker: PhantomData } + } +} + +#[async_trait::async_trait] +impl BlockImportT for BlockImport +where + B: BlockT, + ::Number: PartialOrd, + I: BlockImportT + Send + Sync, + I::Error: Into, + C: ProvideRuntimeApi + Send + Sync + HeaderBackend + AuxStore + BlockOf, + C::Api: EthereumRuntimeRPCApi, + C::Api: BlockBuilderApi, +{ + type Error = ConsensusError; + + async fn check_block( + &mut self, + block: BlockCheckParams, + ) -> Result { + self.inner.check_block(block).await.map_err(Into::into) + } + + async fn import_block( + &mut self, + block: BlockImportParams, + ) -> Result { + if *block.header.number() >= self.evm_since { + ensure_log(block.header.digest()).map_err(Error::from)?; + } + self.inner.import_block(block).await.map_err(Into::into) + } +} + +impl, C> ParachainBlockImportMarker for BlockImport {} + +pub fn spawn_frontier_tasks( + task_manager: &TaskManager, + client: Arc, + backend: Arc, + frontier_backend: Arc>, + filter_pool: FilterPool, + storage_overrides: Arc>, + fee_history_cache: FeeHistoryCache, + fee_history_cache_limit: FeeHistoryCacheLimit, + sync: Arc>, + pubsub_notification_sinks: Arc< + fc_mapping_sync::EthereumBlockNotificationSinks< + fc_mapping_sync::EthereumBlockNotification, + >, + >, +) { + task_manager.spawn_essential_handle().spawn( + "frontier-mapping-sync-worker", + None, + MappingSyncWorker::new( + client.import_notification_stream(), + Duration::new(6, 0), + client.clone(), + backend, + storage_overrides.clone(), + frontier_backend, + 3, + 0, + SyncStrategy::Parachain, + sync, + pubsub_notification_sinks, + ) + .for_each(|()| future::ready(())), + ); + + // Spawn Frontier EthFilterApi maintenance task. + // Each filter is allowed to stay in the pool for 100 blocks. + const FILTER_RETAIN_THRESHOLD: u64 = 100; + task_manager.spawn_essential_handle().spawn( + "frontier-filter-pool", + None, + EthTask::filter_pool_task(client.clone(), filter_pool, FILTER_RETAIN_THRESHOLD), + ); + + // Spawn Frontier FeeHistory cache maintenance task. + task_manager.spawn_essential_handle().spawn( + "frontier-fee-history", + None, + EthTask::fee_history_task( + client, + storage_overrides, + fee_history_cache, + fee_history_cache_limit, + ), + ); +} diff --git a/node/service/src/lib.rs b/node/service/src/lib.rs index 064905019..22fc5ab2f 100644 --- a/node/service/src/lib.rs +++ b/node/service/src/lib.rs @@ -23,7 +23,9 @@ pub mod chain_spec; pub mod collator_kusama; #[cfg(feature = "with-bifrost-polkadot-runtime")] pub mod collator_polkadot; +pub mod eth; pub use bifrost_rpc as rpc; +// pub mod dev; /// Can be called for a `Configuration` to check if it is a configuration for the `Bifrost` network. pub trait IdentifyVariant { diff --git a/pallets/currencies/src/lib.rs b/pallets/currencies/src/lib.rs index c72f04d65..5c6b448bc 100644 --- a/pallets/currencies/src/lib.rs +++ b/pallets/currencies/src/lib.rs @@ -619,13 +619,18 @@ impl fungibles::Inspect for Pallet { } impl fungibles::Unbalanced for Pallet { - fn handle_dust(_dust: fungibles::Dust) { - // https://github.com/paritytech/substrate/blob/569aae5341ea0c1d10426fa1ec13a36c0b64393b/frame/support/src/traits/tokens/fungibles/regular.rs#L124 - // Note: currently the field of Dust type is private and there is no constructor for it, so - // we can't construct a Dust value and pass it. Do nothing here. - // `Pallet` overwrites these functions which can be called as user-level operation of - // fungibles traits when calling these functions, it will not actually reach - // `Unbalanced::handle_dust`. + fn handle_dust(dust: fungibles::Dust) { + let asset = dust.0; + if asset == T::GetNativeCurrencyId::get() { + >::handle_dust(fungible::Dust( + dust.1.into(), + )) + } else { + >::handle_dust(fungibles::Dust( + dust.0.into(), + dust.1.into(), + )) + } } fn write_balance( diff --git a/pallets/evm-accounts/Cargo.toml b/pallets/evm-accounts/Cargo.toml new file mode 100644 index 000000000..4542bc2d6 --- /dev/null +++ b/pallets/evm-accounts/Cargo.toml @@ -0,0 +1,56 @@ +[package] +name = "pallet-evm-accounts" +version = "1.1.1" +authors = ['GalacticCouncil'] +edition = "2021" +license = "Apache-2.0" +homepage = 'https://github.com/galacticcouncil/hydradx-node' +repository = 'https://github.com/galacticcouncil/hydradx-node' +description = "HydraDX EVM accounts pallet" +readme = "README.md" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +# parity +scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } +codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "3.4.0" } + +frame-support = { workspace = true } +frame-system = { workspace = true } +sp-std = { workspace = true } +sp-core = { workspace = true } + +# Optional imports for benchmarking +frame-benchmarking = { workspace = true, optional = true } +sp-io = { workspace = true, optional = true } +pallet-traits = { workspace = true } + +[dev-dependencies] +sp-core = { workspace = true } +sp-io = { workspace = true } +frame-benchmarking = { workspace = true } +orml-tokens = { workspace = true } +orml-traits = { workspace = true, default-features = false } +hex-literal = { workspace = true } + +[features] +default = ["std"] +std = [ + "codec/std", + "scale-info/std", + "sp-std/std", + "sp-core/std", + "sp-io/std", + "frame-support/std", + "frame-system/std", + "orml-tokens/std", + "pallet-traits/std", + "frame-benchmarking/std", +] +runtime-benchmarks = [ + "frame-benchmarking/runtime-benchmarks", + "sp-io", +] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-accounts/README.md b/pallets/evm-accounts/README.md new file mode 100644 index 000000000..8e2a80b72 --- /dev/null +++ b/pallets/evm-accounts/README.md @@ -0,0 +1,34 @@ +# EVM accounts pallet + +## Terminology + +* **Truncated address:** * A substrate address created from an EVM address by prefixing it with "ETH\0" and appending with eight 0 bytes. +* **Full Substrate address:** * Original 32 bytes long native address (not a truncated address). +* **EVM address:** * First 20 bytes of a Substrate address. + +## Overview + +The pallet allows users to bind their Substrate account to the EVM address and to grant a permission to deploy smart contracts. +The purpose of this pallet is to make interaction with the EVM easier. +Binding an address is not necessary for interacting with the EVM. + +### Binding +Without binding, we are unable to get the original Substrate address from the EVM address inside +of the EVM. Inside of the EVM, we have access only to the EVM address (first 20 bytes of a Substrate account). +In this case we create and use a truncated version of the original Substrate address that called the EVM. +The original and truncated address are two different Substrate addresses. + +With binding, we store the last 12 bytes of the Substrate address. Then we can get the original +Substrate address by concatenating these 12 bytes stored in the storage to the EVM address. + +### Smart contract deployment +This pallet also allows granting a permission to deploy smart contracts. +`ControllerOrigin` can add this permission to EVM addresses. +The list of whitelisted accounts is stored in the storage of this pallet. + +### Dispatchable Functions + +* `bind_evm_address` - Binds a Substrate address to EVM address. +* `add_contract_deployer` - Adds a permission to deploy smart contracts. +* `remove_contract_deployer` - Removes a permission of whitelisted address to deploy smart contracts. +* `renounce_contract_deployer` - Renounce caller's permission to deploy smart contracts. diff --git a/pallets/evm-accounts/rpc/runtime-api/Cargo.toml b/pallets/evm-accounts/rpc/runtime-api/Cargo.toml new file mode 100644 index 000000000..731980d10 --- /dev/null +++ b/pallets/evm-accounts/rpc/runtime-api/Cargo.toml @@ -0,0 +1,24 @@ +[package] +name = "pallet-evm-accounts-rpc-runtime-api" +version = "1.0.0" +authors = ['GalacticCouncil'] +edition = "2021" +license = "Apache-2.0" +homepage = 'https://github.com/galacticcouncil/hydradx-node' +repository = 'https://github.com/galacticcouncil/hydradx-node' +description = "RPC runtime API for EVM accounts pallet" +readme = "README.md" + +[package.metadata.docs.rs] +targets = ["x86_64-unknown-linux-gnu"] + +[dependencies] +codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } +sp-api = { workspace = true } + +[features] +default = ["std"] +std = [ + "codec/std", + "sp-api/std", +] diff --git a/pallets/evm-accounts/rpc/runtime-api/README.md b/pallets/evm-accounts/rpc/runtime-api/README.md new file mode 100644 index 000000000..5969f05c4 --- /dev/null +++ b/pallets/evm-accounts/rpc/runtime-api/README.md @@ -0,0 +1 @@ +Runtime API definition for EVM accounts pallet. diff --git a/pallets/evm-accounts/rpc/runtime-api/src/lib.rs b/pallets/evm-accounts/rpc/runtime-api/src/lib.rs new file mode 100644 index 000000000..c26dcacf3 --- /dev/null +++ b/pallets/evm-accounts/rpc/runtime-api/src/lib.rs @@ -0,0 +1,38 @@ +// Copyright (C) 2020-2022 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Runtime API definition for the EVM accounts pallet. + +#![cfg_attr(not(feature = "std"), no_std)] + +use codec::Codec; + +sp_api::decl_runtime_apis! { + /// The API to query EVM account conversions. + pub trait EvmAccountsApi where + AccountId: Codec, + EvmAddress: Codec, + { + /// get the EVM address from the substrate address. + fn evm_address(account_id: AccountId) -> EvmAddress; + + /// Return the Substrate address bound to the EVM account. If not bound, returns `None`. + fn bound_account_id(evm_address: EvmAddress) -> Option; + + /// Get the Substrate address from the EVM address. + /// Returns the truncated version of the address if the address wasn't bind. + fn account_id(evm_address: EvmAddress) -> AccountId; + } +} diff --git a/pallets/evm-accounts/src/benchmarking.rs b/pallets/evm-accounts/src/benchmarking.rs new file mode 100644 index 000000000..9214eab69 --- /dev/null +++ b/pallets/evm-accounts/src/benchmarking.rs @@ -0,0 +1,78 @@ +// Copyright (C) 2020-2024 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +#![cfg(feature = "runtime-benchmarks")] + +use super::*; +use crate::Pallet as EVMAccounts; + +use frame_benchmarking::{account, benchmarks}; +use frame_system::RawOrigin; +use sp_std::prelude::*; + +benchmarks! { + where_clause { + where T::AccountId: AsRef<[u8; 32]> + frame_support::pallet_prelude::IsType, + } + + bind_evm_address { + let user: T::AccountId = account("user", 0, 1); + let evm_address = Pallet::::evm_address(&user); + assert!(!AccountExtension::::contains_key(evm_address)); + + }: _(RawOrigin::Signed(user.clone())) + verify { + assert!(AccountExtension::::contains_key(evm_address)); + } + + add_contract_deployer { + let user: T::AccountId = account("user", 0, 1); + let evm_address = Pallet::::evm_address(&user); + assert!(!ContractDeployer::::contains_key(evm_address)); + + }: _(RawOrigin::Root, evm_address) + verify { + assert!(ContractDeployer::::contains_key(evm_address)); + } + + remove_contract_deployer { + let user: T::AccountId = account("user", 0, 1); + let evm_address = Pallet::::evm_address(&user); + + EVMAccounts::::add_contract_deployer(RawOrigin::Root.into(), evm_address)?; + + assert!(ContractDeployer::::contains_key(evm_address)); + + }: _(RawOrigin::Root, evm_address) + verify { + assert!(!ContractDeployer::::contains_key(evm_address)); + } + + renounce_contract_deployer { + let user: T::AccountId = account("user", 0, 1); + let evm_address = Pallet::::evm_address(&user); + + EVMAccounts::::add_contract_deployer(RawOrigin::Root.into(), evm_address)?; + EVMAccounts::::bind_evm_address(RawOrigin::Signed(user.clone()).into())?; + + assert!(ContractDeployer::::contains_key(evm_address)); + + }: _(RawOrigin::Signed(user)) + verify { + assert!(!ContractDeployer::::contains_key(evm_address)); + } + + impl_benchmark_test_suite!(Pallet, crate::mock::ExtBuilder::default().build(), crate::mock::Test); +} diff --git a/pallets/evm-accounts/src/lib.rs b/pallets/evm-accounts/src/lib.rs new file mode 100644 index 000000000..e86a6d5e2 --- /dev/null +++ b/pallets/evm-accounts/src/lib.rs @@ -0,0 +1,317 @@ +// Copyright (C) 2020-2024 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! # EVM accounts pallet +//! +//! ## Terminology +//! +//! * **Truncated address:** * A substrate address created from an EVM address by prefixing it with +//! "ETH\0" and appending with eight 0 bytes. +//! * **Full Substrate address:** * Original 32 bytes long native address (not a truncated address). +//! * **EVM address:** * First 20 bytes of a Substrate address. +//! +//! ## Overview +//! +//! The pallet allows users to bind their Substrate account to the EVM address and to grant a +//! permission to deploy smart contracts. The purpose of this pallet is to make interaction with the +//! EVM easier. Binding an address is not necessary for interacting with the EVM. +//! +//! ### Binding +//! Without binding, we are unable to get the original Substrate address from the EVM address inside +//! of the EVM. Inside of the EVM, we have access only to the EVM address (first 20 bytes of a +//! Substrate account). In this case we create and use a truncated version of the original Substrate +//! address that called the EVM. The original and truncated address are two different Substrate +//! addresses. +//! +//! With binding, we store the last 12 bytes of the Substrate address. Then we can get the original +//! Substrate address by concatenating these 12 bytes stored in the storage to the EVM address. +//! +//! ### Smart contract deployment +//! This pallet also allows granting a permission to deploy smart contracts. +//! `ControllerOrigin` can add this permission to EVM addresses. +//! The list of whitelisted accounts is stored in the storage of this pallet. +//! +//! ### Dispatchable Functions +//! +//! * `bind_evm_address` - Binds a Substrate address to EVM address. +//! * `add_contract_deployer` - Adds a permission to deploy smart contracts. +//! * `remove_contract_deployer` - Removes a permission of whitelisted address to deploy smart +//! contracts. +//! * `renounce_contract_deployer` - Renounce caller's permission to deploy smart contracts. + +#![cfg_attr(not(feature = "std"), no_std)] + +use frame_support::{ + ensure, + pallet_prelude::{DispatchResult, Get}, +}; +use pallet_traits::evm::InspectEvmAccounts; +use sp_core::{ + crypto::{AccountId32, ByteArray}, + H160, U256, +}; + +#[cfg(test)] +mod mock; +#[cfg(test)] +mod tests; + +mod benchmarking; +pub mod weights; + +pub use pallet::*; +pub use weights::WeightInfo; + +pub type Balance = u128; +pub type EvmAddress = H160; +pub type AccountIdLast12Bytes = [u8; 12]; + +pub trait EvmNonceProvider { + fn get_nonce(evm_address: H160) -> U256; +} + +#[frame_support::pallet] +pub mod pallet { + use super::*; + use frame_support::pallet_prelude::*; + use frame_system::pallet_prelude::*; + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::config] + pub trait Config: frame_system::Config { + /// The overarching event type. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + /// EVM nonce provider. + type EvmNonceProvider: EvmNonceProvider; + + /// Fee multiplier for the binding of addresses. + #[pallet::constant] + type FeeMultiplier: Get; + + /// Origin that can whitelist addresses for smart contract deployment. + type ControllerOrigin: EnsureOrigin; + + /// Weight information for extrinsic in this pallet. + type WeightInfo: WeightInfo; + } + + /// Maps an EVM address to the last 12 bytes of a substrate account. + #[pallet::storage] + #[pallet::getter(fn account)] + pub(super) type AccountExtension = + StorageMap<_, Blake2_128Concat, EvmAddress, AccountIdLast12Bytes>; + + /// Whitelisted addresses that are allowed to deploy smart contracts. + #[pallet::storage] + pub(super) type ContractDeployer = StorageMap<_, Blake2_128Concat, EvmAddress, ()>; + + #[pallet::event] + #[pallet::generate_deposit(pub(crate) fn deposit_event)] + pub enum Event { + /// Binding was created. + Bound { account: T::AccountId, address: EvmAddress }, + /// Deployer was added. + DeployerAdded { who: EvmAddress }, + /// Deployer was removed. + DeployerRemoved { who: EvmAddress }, + } + + #[pallet::error] + #[cfg_attr(test, derive(PartialEq, Eq))] + pub enum Error { + /// EVM Account's nonce is not zero + TruncatedAccountAlreadyUsed, + /// Address is already bound + AddressAlreadyBound, + /// Bound address cannot be used + BoundAddressCannotBeUsed, + /// Address not whitelisted + AddressNotWhitelisted, + } + + #[pallet::hooks] + impl Hooks> for Pallet + where + T::AccountId: frame_support::traits::IsType, + { + fn integrity_test() { + // implementation of this pallet expects that EvmAddress is 20 bytes and AccountId is 32 + // bytes long. If this is not true, `copy_from_slice` might panic. + assert_eq!(EvmAddress::len_bytes(), 20, "EVM Address is expected to be 20 bytes long."); + assert_eq!(AccountId32::LEN, 32, "AccountId is expected to be 32 bytes long."); + } + } + + #[pallet::call] + impl Pallet + where + T::AccountId: AsRef<[u8; 32]> + frame_support::traits::IsType, + { + /// Binds a Substrate address to EVM address. + /// After binding, the EVM is able to convert an EVM address to the original Substrate + /// address. Without binding, the EVM converts an EVM address to a truncated Substrate + /// address, which doesn't correspond to the origin address. + /// + /// Binding an address is not necessary for interacting with the EVM. + /// + /// Parameters: + /// - `origin`: Substrate account binding an address + /// + /// Emits `EvmAccountBound` event when successful. + #[pallet::call_index(0)] + #[pallet::weight(::WeightInfo::bind_evm_address().saturating_mul(::FeeMultiplier::get() as u64))] + pub fn bind_evm_address(origin: OriginFor) -> DispatchResult { + let who = ensure_signed(origin)?; + + let evm_address = Self::evm_address(&who); + + // This check is not necessary. It prevents binding the same address multiple times. + // Without this check binding the address second time can have pass or fail, depending + // on the nonce. So it's better to prevent any confusion and throw an error when address + // is already bound. + ensure!( + !AccountExtension::::contains_key(evm_address), + Error::::AddressAlreadyBound + ); + + let nonce = T::EvmNonceProvider::get_nonce(evm_address); + ensure!(nonce.is_zero(), Error::::TruncatedAccountAlreadyUsed); + + let mut last_12_bytes: [u8; 12] = [0; 12]; + last_12_bytes.copy_from_slice(&who.as_ref()[20..32]); + + >::insert(evm_address, last_12_bytes); + + Self::deposit_event(Event::Bound { account: who, address: evm_address }); + + Ok(()) + } + + /// Adds an EVM address to the list of addresses that are allowed to deploy smart contracts. + /// + /// Parameters: + /// - `origin`: Substrate account whitelisting an address. Must be `ControllerOrigin`. + /// - `address`: EVM address that is whitelisted + /// + /// Emits `DeployerAdded` event when successful. + #[pallet::call_index(1)] + #[pallet::weight(::WeightInfo::add_contract_deployer())] + pub fn add_contract_deployer(origin: OriginFor, address: EvmAddress) -> DispatchResult { + T::ControllerOrigin::ensure_origin(origin.clone())?; + + >::insert(address, ()); + + Self::deposit_event(Event::DeployerAdded { who: address }); + + Ok(()) + } + + /// Removes an EVM address from the list of addresses that are allowed to deploy smart + /// contracts. + /// + /// Parameters: + /// - `origin`: Substrate account removing the EVM address from the whitelist. Must be + /// `ControllerOrigin`. + /// - `address`: EVM address that is removed from the whitelist + /// + /// Emits `DeployerRemoved` event when successful. + #[pallet::call_index(2)] + #[pallet::weight(::WeightInfo::remove_contract_deployer())] + pub fn remove_contract_deployer( + origin: OriginFor, + address: EvmAddress, + ) -> DispatchResult { + T::ControllerOrigin::ensure_origin(origin.clone())?; + + >::remove(address); + + Self::deposit_event(Event::DeployerRemoved { who: address }); + + Ok(()) + } + + /// Removes the account's EVM address from the list of addresses that are allowed to deploy + /// smart contracts. Based on the best practices, this extrinsic can be called by any + /// whitelisted account to renounce their own permission. + /// + /// Parameters: + /// - `origin`: Substrate account removing their EVM address from the whitelist. + /// + /// Emits `DeployerRemoved` event when successful. + #[pallet::call_index(3)] + #[pallet::weight(::WeightInfo::renounce_contract_deployer())] + pub fn renounce_contract_deployer(origin: OriginFor) -> DispatchResult { + let who = ensure_signed(origin.clone())?; + let address = Self::evm_address(&who); + + >::remove(address); + + Self::deposit_event(Event::DeployerRemoved { who: address }); + + Ok(()) + } + } +} + +impl InspectEvmAccounts for Pallet +where + T::AccountId: AsRef<[u8; 32]> + frame_support::traits::IsType, +{ + /// Returns `True` if the account is EVM truncated account. + fn is_evm_account(account_id: T::AccountId) -> bool { + let account_ref = account_id.as_ref(); + &account_ref[0..4] == b"ETH\0" && account_ref[24..32] == [0u8; 8] + } + + /// Get the EVM address from the substrate address. + fn evm_address(account_id: &impl AsRef<[u8; 32]>) -> EvmAddress { + let acc = account_id.as_ref(); + EvmAddress::from_slice(&acc[..20]) + } + + /// Get the truncated address from the EVM address. + fn truncated_account_id(evm_address: EvmAddress) -> T::AccountId { + let mut data: [u8; 32] = [0u8; 32]; + data[0..4].copy_from_slice(b"ETH\0"); + data[4..24].copy_from_slice(&evm_address[..]); + AccountId32::from(data).into() + } + + /// Return the Substrate address bound to the EVM account. If not bound, returns `None`. + fn bound_account_id(evm_address: EvmAddress) -> Option { + let Some(last_12_bytes) = AccountExtension::::get(evm_address) else { + return None; + }; + let mut data: [u8; 32] = [0u8; 32]; + data[..20].copy_from_slice(evm_address.0.as_ref()); + data[20..32].copy_from_slice(&last_12_bytes); + Some(AccountId32::from(data).into()) + } + + /// Get the Substrate address from the EVM address. + /// Returns the truncated version of the address if the address wasn't bind. + fn account_id(evm_address: EvmAddress) -> T::AccountId { + Self::bound_account_id(evm_address) + .unwrap_or_else(|| Self::truncated_account_id(evm_address)) + } + + /// Returns `True` if the address is allowed to deploy smart contracts. + fn can_deploy_contracts(evm_address: EvmAddress) -> bool { + ContractDeployer::::contains_key(evm_address) + } +} diff --git a/pallets/evm-accounts/src/mock.rs b/pallets/evm-accounts/src/mock.rs new file mode 100644 index 000000000..25d6514ac --- /dev/null +++ b/pallets/evm-accounts/src/mock.rs @@ -0,0 +1,128 @@ +#![cfg(test)] +use super::*; + +use crate as pallet_evm_accounts; +use crate::{Balance, Config}; +use frame_support::{ + derive_impl, parameter_types, + sp_runtime::{ + traits::{IdentifyAccount, IdentityLookup, Verify}, + BuildStorage, MultiSignature, + }, + traits::Everything, +}; +use frame_system::EnsureRoot; +use orml_traits::parameter_type_with_key; +pub use sp_core::H160; +use std::{cell::RefCell, collections::HashMap}; + +pub type AssetId = u32; +pub type Signature = MultiSignature; +pub type AccountId = <::Signer as IdentifyAccount>::AccountId; +type Block = frame_system::mocking::MockBlock; + +pub const ONE: Balance = 1_000_000_000_000; +pub const INITIAL_BALANCE: Balance = 1_000_000_000_000 * ONE; + +pub const ALICE: AccountId = AccountId::new([1; 32]); + +pub const HDX: AssetId = 0; + +thread_local! { + pub static NONCE: RefCell> = RefCell::new(HashMap::default()); +} + +frame_support::construct_runtime!( + pub enum Test + { + System: frame_system, + EVMAccounts: pallet_evm_accounts, + Tokens: orml_tokens, + } + +); + +parameter_types! { + pub const BlockHashCount: u64 = 250; + pub const SS58Prefix: u8 = 63; + pub const NativeAssetId: AssetId = HDX; +} + +pub struct EvmNonceProviderMock; +impl EvmNonceProvider for EvmNonceProviderMock { + fn get_nonce(evm_address: H160) -> U256 { + NONCE.with(|v| v.borrow().get(&evm_address).copied()).unwrap_or_default() + } +} + +impl Config for Test { + type RuntimeEvent = RuntimeEvent; + type FeeMultiplier = sp_core::ConstU32<10>; + type EvmNonceProvider = EvmNonceProviderMock; + type ControllerOrigin = EnsureRoot; + type WeightInfo = (); +} + +#[derive_impl(frame_system::config_preludes::TestDefaultConfig as frame_system::DefaultConfig)] +impl frame_system::Config for Test { + type Block = Block; + type AccountId = AccountId; + type Lookup = IdentityLookup; +} + +parameter_type_with_key! { + pub ExistentialDeposits: |_asset_id: AssetId| -> Balance { + 1 + }; +} + +impl orml_tokens::Config for Test { + type RuntimeEvent = RuntimeEvent; + type Balance = Balance; + type Amount = i128; + type CurrencyId = AssetId; + type WeightInfo = (); + type ExistentialDeposits = ExistentialDeposits; + type CurrencyHooks = (); + type MaxLocks = (); + type MaxReserves = (); + type ReserveIdentifier = (); + type DustRemovalWhitelist = Everything; +} + +pub struct ExtBuilder { + endowed_accounts: Vec<(AccountId, AssetId, Balance)>, +} + +impl Default for ExtBuilder { + fn default() -> Self { + NONCE.with(|v| { + v.borrow_mut().clear(); + }); + + Self { endowed_accounts: vec![(ALICE, HDX, INITIAL_BALANCE)] } + } +} + +impl ExtBuilder { + pub fn build(self) -> sp_io::TestExternalities { + let mut t = frame_system::GenesisConfig::::default().build_storage().unwrap(); + + orml_tokens::GenesisConfig:: { balances: self.endowed_accounts } + .assimilate_storage(&mut t) + .unwrap(); + + let mut r: sp_io::TestExternalities = t.into(); + r.execute_with(|| System::set_block_number(1)); + r + } + + pub fn with_non_zero_nonce(self, account_id: AccountId) -> Self { + let evm_address = EVMAccounts::evm_address(&account_id); + NONCE.with(|v| { + let mut m = v.borrow_mut(); + m.insert(evm_address, U256::one()); + }); + self + } +} diff --git a/pallets/evm-accounts/src/tests.rs b/pallets/evm-accounts/src/tests.rs new file mode 100644 index 000000000..e27d4335f --- /dev/null +++ b/pallets/evm-accounts/src/tests.rs @@ -0,0 +1,131 @@ +// This file is part of HydraDX-node. + +// Copyright (C) 2020-2024 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +use super::*; +use mock::*; + +use frame_support::{assert_noop, assert_ok}; +use hex_literal::hex; + +#[test] +fn eth_address_should_convert_to_truncated_address_when_not_bound() { + ExtBuilder::default().build().execute_with(|| { + // Arrange + let evm_address = H160::from(hex!["222222ff7Be76052e023Ec1a306fCca8F9659D80"]); + let truncated_address = AccountId::from(hex![ + "45544800222222ff7be76052e023ec1a306fcca8f9659d800000000000000000" + ]); + + assert_eq!(EVMAccounts::truncated_account_id(evm_address), truncated_address); + + // Act & Assert + assert_eq!(EVMAccounts::bound_account_id(evm_address), None); + assert_eq!(EVMAccounts::account_id(evm_address), truncated_address); + }); +} + +#[test] +fn eth_address_should_convert_to_full_address_when_bound() { + ExtBuilder::default().build().execute_with(|| { + // Arrange & Act + assert_ok!(EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE),)); + + // Assert + let evm_address = EVMAccounts::evm_address(&ALICE); + + assert_eq!(EVMAccounts::bound_account_id(evm_address), Some(ALICE)); + + assert_eq!(EVMAccounts::account_id(evm_address), ALICE); + }); +} + +#[test] +fn bind_address_should_fail_when_nonce_is_not_zero() { + ExtBuilder::default().with_non_zero_nonce(ALICE).build().execute_with(|| { + assert_noop!( + EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE)), + Error::::TruncatedAccountAlreadyUsed + ); + }); +} + +#[test] +fn bind_address_should_fail_when_already_bound() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE),)); + assert_noop!( + EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE)), + Error::::AddressAlreadyBound + ); + }); +} + +#[test] +fn add_contract_deployer_should_store_address_in_the_storage() { + ExtBuilder::default().build().execute_with(|| { + // Arrange + let evm_address = EVMAccounts::evm_address(&ALICE); + assert!(!EVMAccounts::can_deploy_contracts(evm_address)); + + // Act + assert_ok!(EVMAccounts::add_contract_deployer(RuntimeOrigin::root(), evm_address)); + + // Assert + assert!(EVMAccounts::can_deploy_contracts(evm_address)); + + // adding the address again should be ok + assert_ok!(EVMAccounts::add_contract_deployer(RuntimeOrigin::root(), evm_address)); + }); +} + +#[test] +fn remove_contract_deployer_should_remove_address_from_the_storage() { + ExtBuilder::default().build().execute_with(|| { + // Arrange + let evm_address = EVMAccounts::evm_address(&ALICE); + assert_ok!(EVMAccounts::add_contract_deployer(RuntimeOrigin::root(), evm_address)); + assert!(EVMAccounts::can_deploy_contracts(evm_address)); + + // Act + assert_ok!(EVMAccounts::remove_contract_deployer(RuntimeOrigin::root(), evm_address)); + + // Assert + assert!(!EVMAccounts::can_deploy_contracts(evm_address)); + + // removing the address again should be ok + assert_ok!(EVMAccounts::remove_contract_deployer(RuntimeOrigin::root(), evm_address)); + }); +} + +#[test] +fn renounce_contract_deployer_should_remove_address_from_the_storage() { + ExtBuilder::default().build().execute_with(|| { + // Arrange + let evm_address = EVMAccounts::evm_address(&ALICE); + assert_ok!(EVMAccounts::add_contract_deployer(RuntimeOrigin::root(), evm_address)); + assert!(EVMAccounts::can_deploy_contracts(evm_address)); + + // Act + assert_ok!(EVMAccounts::renounce_contract_deployer(RuntimeOrigin::signed(ALICE))); + + // Assert + assert!(!EVMAccounts::can_deploy_contracts(evm_address)); + + // ronouncing the address again should be ok + assert_ok!(EVMAccounts::renounce_contract_deployer(RuntimeOrigin::signed(ALICE))); + }); +} diff --git a/pallets/evm-accounts/src/weights.rs b/pallets/evm-accounts/src/weights.rs new file mode 100644 index 000000000..9421d1a0f --- /dev/null +++ b/pallets/evm-accounts/src/weights.rs @@ -0,0 +1,164 @@ +// This file is part of HydraDX. + +// Copyright (C) 2020-2024 Intergalactic, Limited (GIB). +// SPDX-License-Identifier: Apache-2.0 + +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +//! Autogenerated weights for `pallet_evm_accounts` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 4.0.0-dev +//! DATE: 2024-02-21, STEPS: `10`, REPEAT: `30`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` +//! WASM-EXECUTION: `Compiled`, CHAIN: `Some("dev")`, DB CACHE: 1024 + +// Executed Command: +// target/release/hydradx +// benchmark +// pallet +// --chain=dev +// --steps=10 +// --repeat=30 +// --wasm-execution=compiled +// --heap-pages=4096 +// --template=.maintain/pallet-weight-template-no-back.hbs +// --pallet=pallet-evm-accounts +// --output=weights-1.1.0/evm-accounts.rs +// --extrinsic=* + +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(clippy::unnecessary_cast)] + +use frame_support::{ + traits::Get, + weights::{constants::RocksDbWeight, Weight}, +}; +use sp_std::marker::PhantomData; + +pub trait WeightInfo { + fn bind_evm_address() -> Weight; + fn add_contract_deployer() -> Weight; + fn remove_contract_deployer() -> Weight; + fn renounce_contract_deployer() -> Weight; +} + +pub struct HydraWeight(PhantomData); + +impl WeightInfo for HydraWeight { + /// Storage: `EVMAccounts::AccountExtension` (r:1 w:1) + /// Proof: `EVMAccounts::AccountExtension` (`max_values`: None, `max_size`: Some(48), added: + /// 2523, mode: `MaxEncodedLen`) Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: + /// `MaxEncodedLen`) Storage: `AssetRegistry::NextAssetId` (r:1 w:0) + /// Proof: `AssetRegistry::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, + /// mode: `MaxEncodedLen`) Storage: `AssetRegistry::LocationAssets` (r:1 w:0) + /// Proof: `AssetRegistry::LocationAssets` (`max_values`: None, `max_size`: Some(622), added: + /// 3097, mode: `MaxEncodedLen`) Storage: `Tokens::Accounts` (r:1 w:0) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: + /// `MaxEncodedLen`) + fn bind_evm_address() -> Weight { + // Proof Size summary in bytes: + // Measured: `479` + // Estimated: `4087` + // Minimum execution time: 36_357_000 picoseconds. + Weight::from_parts(36_601_000, 4087) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn add_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_157_000 picoseconds. + Weight::from_parts(13_481_000, 0).saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn remove_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_196_000 picoseconds. + Weight::from_parts(13_517_000, 0).saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn renounce_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_153_000 picoseconds. + Weight::from_parts(13_380_000, 0).saturating_add(T::DbWeight::get().writes(1)) + } +} + +// For backwards compatibility and tests +impl WeightInfo for () { + /// Storage: `EVMAccounts::AccountExtension` (r:1 w:1) + /// Proof: `EVMAccounts::AccountExtension` (`max_values`: None, `max_size`: Some(48), added: + /// 2523, mode: `MaxEncodedLen`) Storage: `System::Account` (r:1 w:0) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: + /// `MaxEncodedLen`) Storage: `AssetRegistry::NextAssetId` (r:1 w:0) + /// Proof: `AssetRegistry::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, + /// mode: `MaxEncodedLen`) Storage: `AssetRegistry::LocationAssets` (r:1 w:0) + /// Proof: `AssetRegistry::LocationAssets` (`max_values`: None, `max_size`: Some(622), added: + /// 3097, mode: `MaxEncodedLen`) Storage: `Tokens::Accounts` (r:1 w:0) + /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: + /// `MaxEncodedLen`) + fn bind_evm_address() -> Weight { + // Proof Size summary in bytes: + // Measured: `479` + // Estimated: `4087` + // Minimum execution time: 36_357_000 picoseconds. + Weight::from_parts(36_601_000, 4087) + .saturating_add(RocksDbWeight::get().reads(5)) + .saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn add_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_157_000 picoseconds. + Weight::from_parts(13_481_000, 0).saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn remove_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_196_000 picoseconds. + Weight::from_parts(13_517_000, 0).saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: + /// 2511, mode: `MaxEncodedLen`) + fn renounce_contract_deployer() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_153_000 picoseconds. + Weight::from_parts(13_380_000, 0).saturating_add(RocksDbWeight::get().writes(1)) + } +} diff --git a/pallets/flexible-fee/src/lib.rs b/pallets/flexible-fee/src/lib.rs index 421ea4274..bebb95aaa 100644 --- a/pallets/flexible-fee/src/lib.rs +++ b/pallets/flexible-fee/src/lib.rs @@ -20,8 +20,9 @@ pub use crate::pallet::*; use bifrost_primitives::{ + currency::WETH, traits::{FeeGetter, XcmDestWeightAndFeeHandler}, - CurrencyId, ExtraFeeName, TryConvertFrom, XcmOperationType, BNC, + AccountFeeCurrency, CurrencyId, ExtraFeeName, TryConvertFrom, XcmOperationType, BNC, }; use bifrost_xcm_interface::{polkadot::RelaychainCall, traits::parachains, PolkadotXcmCall}; use core::convert::Into; @@ -644,3 +645,10 @@ where Ok(()) } } + +/// Provides account's fee payment asset or default fee asset ( Native asset ) +impl AccountFeeCurrency for Pallet { + fn get(who: &T::AccountId) -> CurrencyId { + Pallet::::get_user_default_fee_currency(who).unwrap_or_else(|| WETH) + } +} diff --git a/pallets/lend-market/src/mock.rs b/pallets/lend-market/src/mock.rs index 79b560c3a..42283470c 100644 --- a/pallets/lend-market/src/mock.rs +++ b/pallets/lend-market/src/mock.rs @@ -254,6 +254,10 @@ impl PriceFeeder for MockPriceFeeder { fn get_price(asset_id: &CurrencyId) -> Option { Self::PRICES.with(|prices| *prices.borrow().get(&CurrencyIdWrap(*asset_id)).unwrap()) } + + fn get_normal_price(_asset_id: &CurrencyId) -> Option { + todo!() + } } parameter_types! { diff --git a/pallets/leverage-staking/src/mock.rs b/pallets/leverage-staking/src/mock.rs index df9c51dca..55096d593 100644 --- a/pallets/leverage-staking/src/mock.rs +++ b/pallets/leverage-staking/src/mock.rs @@ -421,6 +421,10 @@ impl PriceFeeder for MockPriceFeeder { fn get_price(asset_id: &CurrencyId) -> Option { Self::PRICES.with(|prices| *prices.borrow().get(&CurrencyIdWrap(*asset_id)).unwrap()) } + + fn get_normal_price(_asset_id: &CurrencyId) -> Option { + todo!() + } } parameter_types! { diff --git a/pallets/prices/src/lib.rs b/pallets/prices/src/lib.rs index 3668e2b1e..c39db7ad0 100644 --- a/pallets/prices/src/lib.rs +++ b/pallets/prices/src/lib.rs @@ -107,6 +107,26 @@ pub mod pallet { pub type ForeignToNativeAsset = StorageMap<_, Twox64Concat, CurrencyId, CurrencyId, OptionQuery>; + #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] + pub struct GenesisConfig { + pub emergency_price: Vec<(CurrencyId, Price)>, + pub foreign_to_native_asset: Vec<(CurrencyId, CurrencyId)>, + pub phantom: PhantomData, + } + + #[pallet::genesis_build] + impl BuildGenesisConfig for GenesisConfig { + fn build(&self) { + for (asset_id, price) in self.emergency_price.iter() { + EmergencyPrice::::insert(asset_id, price); + } + for (foreign_asset_id, native) in self.foreign_to_native_asset.iter() { + ForeignToNativeAsset::::insert(foreign_asset_id, native); + } + } + } + #[pallet::pallet] #[pallet::without_storage_info] pub struct Pallet(PhantomData); @@ -218,6 +238,16 @@ impl PriceFeeder for Pallet { .and_then(|price| Self::normalize_detail_price(price, mantissa)) }) } + + fn get_normal_price(asset_id: &CurrencyId) -> Option { + let decimals = Self::get_asset_mantissa(asset_id)?; + Self::emergency_price(asset_id) + .and_then(|p| Some(p.into_inner().saturating_div(decimals))) + .or_else(|| { + T::Source::get(&asset_id) + .and_then(|price| Some(price.value.into_inner().saturating_div(decimals))) + }) + } } impl EmergencyPriceFeeder for Pallet { diff --git a/pallets/traits/src/evm.rs b/pallets/traits/src/evm.rs new file mode 100644 index 000000000..8dc1ea184 --- /dev/null +++ b/pallets/traits/src/evm.rs @@ -0,0 +1,20 @@ +pub trait InspectEvmAccounts { + /// Returns `True` if the account is EVM truncated account. + fn is_evm_account(account_id: AccountId) -> bool; + + /// get the EVM address from the substrate address. + fn evm_address(account_id: &impl AsRef<[u8; 32]>) -> EvmAddress; + + /// Get the truncated address from the EVM address. + fn truncated_account_id(evm_address: EvmAddress) -> AccountId; + + /// Return the Substrate address bound to the EVM account. If not bound, returns `None`. + fn bound_account_id(evm_address: EvmAddress) -> Option; + + /// Get the Substrate address from the EVM address. + /// Returns the truncated version of the address if the address wasn't bind. + fn account_id(evm_address: EvmAddress) -> AccountId; + + /// Returns `True` if the address is allowed to deploy smart contracts. + fn can_deploy_contracts(evm_address: EvmAddress) -> bool; +} diff --git a/pallets/traits/src/lib.rs b/pallets/traits/src/lib.rs index bfedd1594..b36d98329 100644 --- a/pallets/traits/src/lib.rs +++ b/pallets/traits/src/lib.rs @@ -3,7 +3,9 @@ use bifrost_primitives::{CurrencyId, PriceDetail}; use num_bigint::{BigUint, ToBigUint}; +pub mod evm; pub mod lend_market; + pub use lend_market::*; pub trait EmergencyCallFilter { @@ -12,6 +14,7 @@ pub trait EmergencyCallFilter { pub trait PriceFeeder { fn get_price(asset_id: &CurrencyId) -> Option; + fn get_normal_price(asset_id: &CurrencyId) -> Option; } pub trait EmergencyPriceFeeder { diff --git a/primitives/src/currency.rs b/primitives/src/currency.rs index 563e7fb63..f3598dff8 100644 --- a/primitives/src/currency.rs +++ b/primitives/src/currency.rs @@ -58,9 +58,25 @@ pub const ASTR: CurrencyId = CurrencyId::Token2(ASTR_TOKEN_ID); pub const FIL_TOKEN_ID: u8 = 4u8; pub const FIL: CurrencyId = CurrencyId::Token2(FIL_TOKEN_ID); pub const VFIL: CurrencyId = CurrencyId::VToken2(FIL_TOKEN_ID); +pub const USDC_TOKEN_ID: u8 = 5u8; +pub const USDC: CurrencyId = CurrencyId::Token2(USDC_TOKEN_ID); +pub const IBTC_TOKEN_ID: u8 = 6u8; +pub const IBTC: CurrencyId = CurrencyId::Token2(IBTC_TOKEN_ID); +pub const INTR_TOKEN_ID: u8 = 7u8; +pub const INTR: CurrencyId = CurrencyId::Token2(INTR_TOKEN_ID); pub const MANTA_TOKEN_ID: u8 = 8u8; pub const MANTA: CurrencyId = CurrencyId::Token2(MANTA_TOKEN_ID); pub const VMANTA: CurrencyId = CurrencyId::VToken2(MANTA_TOKEN_ID); +pub const BNCS_TOKEN_ID: u8 = 9u8; +pub const BNCS: CurrencyId = CurrencyId::Token2(BNCS_TOKEN_ID); +pub const PINK_TOKEN_ID: u8 = 10u8; +pub const PINK: CurrencyId = CurrencyId::Token2(PINK_TOKEN_ID); +pub const DED_TOKEN_ID: u8 = 11u8; +pub const DED: CurrencyId = CurrencyId::Token2(DED_TOKEN_ID); +pub const PEN_TOKEN_ID: u8 = 12u8; +pub const PEN: CurrencyId = CurrencyId::Token2(PEN_TOKEN_ID); +pub const WETH_TOKEN_ID: u8 = 13u8; +pub const WETH: CurrencyId = CurrencyId::Token2(WETH_TOKEN_ID); pub const VSBOND_BNC_2001_0_8: CurrencyId = CurrencyId::VSBond(TokenSymbol::BNC, 2001, 0, 8); pub const CLOUD_TOKEN_ID: u8 = 12u8; pub const CLOUD: CurrencyId = CurrencyId::Token2(CLOUD_TOKEN_ID); diff --git a/primitives/src/traits.rs b/primitives/src/traits.rs index 6279a91e9..87a9d5727 100644 --- a/primitives/src/traits.rs +++ b/primitives/src/traits.rs @@ -21,8 +21,8 @@ #![allow(clippy::unnecessary_cast)] use crate::{ - AssetIds, DerivativeIndex, ExtraFeeInfo, LeasePeriod, ParaId, PoolId, RedeemType, TokenId, - TokenSymbol, XcmOperationType, + AssetIds, CurrencyId, DerivativeIndex, ExtraFeeInfo, LeasePeriod, ParaId, PoolId, RedeemType, + TokenId, TokenSymbol, XcmOperationType, }; use frame_support::pallet_prelude::{DispatchResultWithPostInfo, Weight}; use parity_scale_codec::{Decode, Encode, FullCodec}; @@ -551,3 +551,20 @@ impl SlpHostingFeeProvider { + fn get(a: &AccountId) -> CurrencyId; +} + +/// Provides account's balance of fee asset currency in a given currency +pub trait AccountFeeCurrencyBalanceInCurrency { + type Output; + fn get_balance_in_currency(to_currency: CurrencyId, account: &AccountId) -> Self::Output; +} + +pub trait PriceProvider { + type Price; + + fn get_price(asset_a: CurrencyId, asset_b: CurrencyId) -> Option; +} diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index 7f00cb5a5..21863a436 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -109,6 +109,31 @@ zenlink-protocol-runtime-api = { workspace = true } # Nuts Finance bifrost-stable-asset = { workspace = true } +# Frontier +num_enum = { workspace = true } +primitive-types = { workspace = true } +ethabi = { workspace = true } +module-evm-utility-macro = { workspace = true } +evm = { workspace = true, features = ["with-codec"] } +fp-account = { workspace = true, features = ["serde"] } +fp-evm = { workspace = true, features = ["serde"] } +fp-rpc = { workspace = true } +fp-self-contained = { workspace = true, features = ["serde"] } +pallet-base-fee = { workspace = true } +pallet-dynamic-fee = { workspace = true } +pallet-ethereum = { workspace = true } +pallet-evm = { workspace = true } +pallet-evm-chain-id = { workspace = true } +pallet-evm-precompile-dispatch = { workspace = true } +pallet-evm-precompile-modexp = { workspace = true } +pallet-evm-precompile-sha3fips = { workspace = true } +pallet-evm-precompile-simple = { workspace = true } +pallet-evm-precompile-bn128 = { workspace = true } +pallet-evm-precompile-blake2 = { workspace = true } +pallet-evm-accounts = { workspace = true } +pallet-evm-accounts-rpc-runtime-api = { workspace = true } +pallet-traits = { workspace = true } + # Bifrost bifrost-asset-registry = { workspace = true } bifrost-buy-back = { workspace = true } @@ -257,6 +282,25 @@ std = [ "leverage-staking/std", "bifrost-xcm-interface/std", "bifrost-channel-commission/std", + # Frontier + "fp-account/std", + "fp-evm/std", + "fp-rpc/std", + "fp-account/std", + "fp-self-contained/std", + "pallet-base-fee/std", + "pallet-dynamic-fee/std", + "pallet-ethereum/std", + "pallet-evm/std", + "pallet-evm-chain-id/std", + "pallet-evm-precompile-dispatch/std", + "pallet-evm-precompile-modexp/std", + "pallet-evm-precompile-sha3fips/std", + "pallet-evm-precompile-simple/std", + "pallet-evm-precompile-bn128/std", + "pallet-evm-precompile-blake2/std", + "pallet-evm-accounts/std", + "pallet-evm-accounts-rpc-runtime-api/std", "bifrost-clouds-convert/std", "bifrost-vtoken-minting-rpc-runtime-api/std", @@ -281,6 +325,7 @@ runtime-benchmarks = [ "pallet-timestamp/runtime-benchmarks", "pallet-treasury/runtime-benchmarks", "pallet-utility/runtime-benchmarks", + "pallet-ethereum/runtime-benchmarks", "bifrost-vesting/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "sp-runtime/runtime-benchmarks", diff --git a/runtime/bifrost-polkadot/src/evm/accounts_conversion.rs b/runtime/bifrost-polkadot/src/evm/accounts_conversion.rs new file mode 100644 index 000000000..70035a95a --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/accounts_conversion.rs @@ -0,0 +1,55 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +#![allow(unused_imports)] +use crate::{ + evm::{ConsensusEngineId, FindAuthor}, + AccountId, Aura, EVMAccounts, Runtime, +}; +use core::marker::PhantomData; +use frame_support::traits::IsType; +use hex_literal::hex; +use pallet_evm::AddressMapping; +use pallet_traits::evm::InspectEvmAccounts; +use parity_scale_codec::{Decode, Encode}; +use sp_core::{crypto::ByteArray, H160}; +use sp_runtime::traits::AccountIdConversion; + +pub struct ExtendedAddressMapping; + +impl AddressMapping for ExtendedAddressMapping { + fn into_account_id(address: H160) -> AccountId { + EVMAccounts::account_id(address) + } +} + +// Ethereum-compatible blocks author (20 bytes) +// Converted by truncating from Substrate author (32 bytes) +pub struct FindAuthorTruncated(PhantomData); +impl> FindAuthor for FindAuthorTruncated { + fn find_author<'a, I>(digests: I) -> Option + where + I: 'a + IntoIterator, + { + if let Some(author_index) = F::find_author(digests) { + let authority_id = + pallet_aura::Authorities::::get()[author_index as usize].clone(); + return Some(H160::from_slice(&authority_id.to_raw_vec()[4..24])); + } + None + } +} diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/Cargo.toml b/runtime/bifrost-polkadot/src/evm/evm-utility/Cargo.toml new file mode 100644 index 000000000..5cb191086 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "module-evm-utility" +version = "2.21.0" +authors = ["Acala Developers"] +edition = "2021" + +[dependencies] +sha3 = { workspace = true } +sp-std = { workspace = true } +ethereum = { workspace = true } + +[features] +default = ["std"] +std = [ + "sha3/std", + "sp-std/std", + "ethereum/with-serde", +] diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/macro/Cargo.toml b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/Cargo.toml new file mode 100644 index 000000000..fb813d1aa --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "module-evm-utility-macro" +version = "2.21.0" +authors = ["Acala Developers"] +edition = "2021" + +[lib] +proc-macro = true + +[dependencies] +quote = { workspace = true } +syn = { workspace = true } +proc-macro2 = { workspace = true } +module-evm-utility = { path = ".." } diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/macro/src/lib.rs b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/src/lib.rs new file mode 100644 index 000000000..d913d3180 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/src/lib.rs @@ -0,0 +1,70 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use proc_macro::TokenStream; +use proc_macro2::Literal; +use quote::quote; +use syn::{parse_macro_input, Expr, ExprLit, Ident, ItemEnum, Lit, LitByteStr, LitStr}; + +#[proc_macro_attribute] +pub fn generate_function_selector(_: TokenStream, input: TokenStream) -> TokenStream { + let item = parse_macro_input!(input as ItemEnum); + + let ItemEnum { attrs, vis, enum_token, ident, variants, .. } = item; + + let mut ident_expressions: Vec = vec![]; + let mut variant_expressions: Vec = vec![]; + for variant in variants { + if let Some((_, Expr::Lit(ExprLit { lit, .. }))) = variant.discriminant { + if let Lit::Str(token) = lit { + let selector = module_evm_utility::get_function_selector(&token.value()); + // println!("method: {:?}, selector: {:?}", token.value(), selector); + ident_expressions.push(variant.ident); + variant_expressions.push(Expr::Lit(ExprLit { + lit: Lit::Verbatim(Literal::u32_suffixed(selector)), + attrs: Default::default(), + })); + } else { + panic!("Not method string: `{:?}`", lit); + } + } else { + panic!("Not enum: `{:?}`", variant); + } + } + + (quote! { + #(#attrs)* + #vis #enum_token #ident { + #( + #ident_expressions = #variant_expressions, + )* + } + }) + .into() +} + +#[proc_macro] +pub fn keccak256(input: TokenStream) -> TokenStream { + let lit_str = parse_macro_input!(input as LitStr); + + let result = module_evm_utility::sha3_256(&lit_str.value()); + + let eval = Lit::ByteStr(LitByteStr::new(result.as_ref(), proc_macro2::Span::call_site())); + + quote!(#eval).into() +} diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/macro/tests/test.rs b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/tests/test.rs new file mode 100644 index 000000000..9c4cc995f --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/macro/tests/test.rs @@ -0,0 +1,51 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +#[cfg(test)] +mod tests { + #[test] + fn generate_function_selector_works() { + #[module_evm_utility_macro::generate_function_selector] + #[derive(Debug, Eq, PartialEq)] + #[repr(u32)] + pub enum Action { + Name = "name()", + Symbol = "symbol()", + Decimals = "decimals()", + TotalSupply = "totalSupply()", + BalanceOf = "balanceOf(address)", + Transfer = "transfer(address,uint256)", + } + + assert_eq!(Action::Name as u32, 0x06fdde03_u32); + assert_eq!(Action::Symbol as u32, 0x95d89b41_u32); + assert_eq!(Action::Decimals as u32, 0x313ce567_u32); + assert_eq!(Action::TotalSupply as u32, 0x18160ddd_u32); + assert_eq!(Action::BalanceOf as u32, 0x70a08231_u32); + assert_eq!(Action::Transfer as u32, 0xa9059cbb_u32); + } + + #[test] + fn keccak256_works() { + assert_eq!(module_evm_utility_macro::keccak256!(""), &module_evm_utility::sha3_256("")); + assert_eq!( + module_evm_utility_macro::keccak256!("keccak256"), + &module_evm_utility::sha3_256("keccak256") + ); + } +} diff --git a/runtime/bifrost-polkadot/src/evm/evm-utility/src/lib.rs b/runtime/bifrost-polkadot/src/evm/evm-utility/src/lib.rs new file mode 100644 index 000000000..63578c532 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm-utility/src/lib.rs @@ -0,0 +1,43 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! # Evm utiltity Module +//! +//! A pallet provides some utility methods. + +#![cfg_attr(not(feature = "std"), no_std)] + +use sha3::{Digest, Keccak256}; + +pub fn sha3_256(s: &str) -> [u8; 32] { + let mut result = [0u8; 32]; + + // create a SHA3-256 object + let mut hasher = Keccak256::new(); + // write input message + hasher.update(s); + // read hash digest + result.copy_from_slice(&hasher.finalize()[..32]); + + result +} + +pub fn get_function_selector(s: &str) -> u32 { + let result = sha3_256(s); + u32::from_be_bytes(result[..4].try_into().unwrap()) +} diff --git a/runtime/bifrost-polkadot/src/evm/evm_fee.rs b/runtime/bifrost-polkadot/src/evm/evm_fee.rs new file mode 100644 index 000000000..ee4ecae00 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/evm_fee.rs @@ -0,0 +1,202 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::Currencies; +use bifrost_primitives::{AccountFeeCurrency, Balance, CurrencyId}; +use bifrost_runtime_common::Ratio; +use frame_support::traits::{ + tokens::{Fortitude, Precision, Preservation}, + Get, OnUnbalanced, TryDrop, +}; +use orml_traits::MultiCurrency; +use pallet_evm::{AddressMapping, Error, OnChargeEVMTransaction}; +use sp_core::{H160, U256}; +use sp_runtime::{ + helpers_128bit::multiply_by_rational_with_rounding, + traits::{Convert, UniqueSaturatedInto}, + Rounding, +}; +use sp_std::marker::PhantomData; + +#[derive(Copy, Clone, Default)] +pub struct EvmPaymentInfo { + amount: Balance, + currency_id: CurrencyId, + price: Ratio, +} + +impl EvmPaymentInfo { + pub fn merge(self, other: Self) -> Self { + EvmPaymentInfo { + amount: self.amount.saturating_add(other.amount), + currency_id: self.currency_id, + price: self.price, + } + } +} + +impl TryDrop for EvmPaymentInfo { + fn try_drop(self) -> Result<(), Self> { + if self.amount == 0 { + Ok(()) + } else { + Err(self) + } + } +} + +/// Implements the transaction payment for EVM transactions. +/// Supports multi-currency fees based on what is provided by AC - account currency. +pub struct TransferEvmFees(PhantomData<(OU, AC, EC, C, MC)>); + +impl OnChargeEVMTransaction for TransferEvmFees +where + T: pallet_evm::Config, + OU: OnUnbalanced, + U256: UniqueSaturatedInto, + AC: AccountFeeCurrency, // AccountCurrency + EC: Get, // Evm default fee asset + C: Convert<(CurrencyId, CurrencyId, Balance), Option<(Balance, Ratio)>>, /* Conversion from + * default fee + * asset to account + * currency */ + U256: UniqueSaturatedInto, + MC: frame_support::traits::tokens::fungibles::Mutate< + T::AccountId, + AssetId = CurrencyId, + Balance = Balance, + > + frame_support::traits::tokens::fungibles::Inspect< + T::AccountId, + AssetId = CurrencyId, + Balance = Balance, + >, + sp_runtime::AccountId32: From<::AccountId>, +{ + type LiquidityInfo = Option; + + fn withdraw_fee(who: &H160, fee: U256) -> Result> { + if fee.is_zero() { + return Ok(None); + } + let account_id = T::AddressMapping::into_account_id(*who); + let fee_currency = AC::get(&account_id); + + let Some((converted, price)) = + C::convert((EC::get(), fee_currency, fee.unique_saturated_into())) + else { + return Err(Error::::WithdrawFailed); + }; + + // Ensure that converted fee is not zero + if converted == 0 { + return Err(Error::::WithdrawFailed); + } + + let burned = MC::burn_from( + fee_currency, + &account_id, + converted, + Preservation::Expendable, + Precision::Exact, + Fortitude::Polite, + ) + .map_err(|_| Error::::BalanceLow)?; + + Ok(Some(EvmPaymentInfo { amount: burned, currency_id: fee_currency, price })) + } + + fn correct_and_deposit_fee( + who: &H160, + corrected_fee: U256, + _base_fee: U256, + already_withdrawn: Self::LiquidityInfo, + ) -> Self::LiquidityInfo { + if let Some(paid) = already_withdrawn { + let account_id = T::AddressMapping::into_account_id(*who); + + // fee / weth = amounts[1] / amounts[0] + // fee = weth * amounts[1] / amounts[0] + let adjusted_paid = if let Some(converted_corrected_fee) = + multiply_by_rational_with_rounding( + corrected_fee.unique_saturated_into(), + paid.price.n, + paid.price.d, + Rounding::Up, + ) { + // Calculate how much refund we should return + let refund_amount = paid.amount.saturating_sub(converted_corrected_fee); + + // refund to the account that paid the fees. If this fails, the + // account might have dropped below the existential balance. In + // that case we don't refund anything. + let result = MC::mint_into(paid.currency_id, &account_id, refund_amount); + + let refund_imbalance = if let Ok(amount) = result { + // Ensure that we minted all amount, in case of partial refund for some reason, + // refund the difference back to treasury + debug_assert_eq!(amount, refund_amount); + refund_amount.saturating_sub(amount) + } else { + // If error, we refund the whole amount back to treasury + refund_amount + }; + // figure out how much is left to mint back + // refund_amount already minted back to account, imbalance is what is left to mint + // if any + paid.amount.saturating_sub(refund_amount).saturating_add(refund_imbalance) + } else { + // if conversion failed for some reason, we refund the whole amount back to treasury + paid.amount + }; + + // We can simply refund all the remaining amount back to treasury + OU::on_unbalanced(EvmPaymentInfo { + amount: adjusted_paid, + currency_id: paid.currency_id, + price: paid.price, + }); + return None; + } + None + } + + fn pay_priority_fee(tip: Self::LiquidityInfo) { + if let Some(tip) = tip { + OU::on_unbalanced(tip); + } + } +} + +pub struct DepositEvmFeeToTreasury; +impl OnUnbalanced for DepositEvmFeeToTreasury { + // this is called for substrate-based transactions + fn on_unbalanceds(amounts: impl Iterator) { + Self::on_unbalanced(amounts.fold(EvmPaymentInfo::default(), |i, x| x.merge(i))) + } + + // this is called from pallet_evm for Ethereum-based transactions + // (technically, it calls on_unbalanced, which calls this when non-zero) + fn on_nonzero_unbalanced(payment_info: EvmPaymentInfo) { + let result = Currencies::deposit( + payment_info.currency_id, + &crate::BifrostTreasuryAccount::get(), + payment_info.amount, + ); + debug_assert_eq!(result, Ok(())); + } +} diff --git a/runtime/bifrost-polkadot/src/evm/mod.rs b/runtime/bifrost-polkadot/src/evm/mod.rs new file mode 100644 index 000000000..db779492e --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/mod.rs @@ -0,0 +1,165 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use frame_support::{pallet_prelude::Get, parameter_types, traits::FindAuthor, ConsensusEngineId}; +use orml_tokens::CurrencyAdapter; +use pallet_ethereum::PostLogContent; +use pallet_evm::EnsureAddressTruncated; +use pallet_transaction_payment::Multiplier; +use primitive_types::U256; + +use bifrost_primitives::{currency::WETH, CurrencyId}; +use bifrost_runtime_common::price::{ + ConvertAmount, FeeAssetBalanceInCurrency, OraclePriceProvider, +}; + +pub use crate::evm::accounts_conversion::{ExtendedAddressMapping, FindAuthorTruncated}; +use crate::{ + evm::runner::WrapRunner, governance::TechAdminOrCouncil, Aura, ConstU32, DynamicFee, + EVMChainId, Prices, Runtime, RuntimeEvent, Timestamp, Weight, EVM, MAXIMUM_BLOCK_WEIGHT, + NORMAL_DISPATCH_RATIO, WEIGHT_REF_TIME_PER_SECOND, +}; + +mod accounts_conversion; +mod evm_fee; +pub mod precompiles; +mod runner; + +// Current approximation of the gas per second consumption considering +// EVM execution over compiled WASM (on 4.4Ghz CPU). +// Given the 500ms Weight, from which 75% only are used for transactions, +// the total EVM execution gas limit is: GAS_PER_SECOND * 0.500 * 0.75 ~= +// 15_000_000. +pub const GAS_PER_SECOND: u64 = 40_000_000; +// Approximate ratio of the amount of Weight per Gas. +const WEIGHT_PER_GAS: u64 = WEIGHT_REF_TIME_PER_SECOND / GAS_PER_SECOND; + +parameter_types! { + // We allow for a 75% fullness of a 0.5s block + pub BlockGasLimit: U256 = U256::from(NORMAL_DISPATCH_RATIO * MAXIMUM_BLOCK_WEIGHT.ref_time() / +WEIGHT_PER_GAS); + pub PrecompilesValue: precompiles::BifrostPrecompiles = +precompiles::BifrostPrecompiles::<_>::new(); + pub WeightPerGas: Weight = Weight::from_parts(WEIGHT_PER_GAS, 0); +} + +pub struct WethAssetId; +impl Get for WethAssetId { + fn get() -> CurrencyId { + WETH + } +} + +type WethCurrency = CurrencyAdapter; + +pub struct TransactionPaymentMultiplier; + +impl Get for TransactionPaymentMultiplier { + fn get() -> Multiplier { + crate::TransactionPayment::next_fee_multiplier() + } +} + +parameter_types! { + /// The amount of gas per pov. A ratio of 4 if we convert ref_time to gas and we compare + /// it with the pov_size for a block. E.g. + /// ceil( + /// (max_extrinsic.ref_time() / max_extrinsic.proof_size()) / WEIGHT_PER_GAS + /// ) + pub const GasLimitPovSizeRatio: u64 = 4; + /// The amount of gas per storage (in bytes): BLOCK_GAS_LIMIT / BLOCK_STORAGE_LIMIT + /// The current definition of BLOCK_STORAGE_LIMIT is 40 KB, resulting in a value of 366. + pub GasLimitStorageGrowthRatio: u64 = 366; + + pub const SuicideQuickClearLimit: u32 = 0; +} + +impl pallet_evm::Config for Runtime { + type FeeCalculator = DynamicFee; + type GasWeightMapping = pallet_evm::FixedGasWeightMapping; + type WeightPerGas = WeightPerGas; + type BlockHashMapping = pallet_ethereum::EthereumBlockHashMapping; + type CallOrigin = EnsureAddressTruncated; + type WithdrawOrigin = EnsureAddressTruncated; + type AddressMapping = ExtendedAddressMapping; + type Currency = WethCurrency; + type RuntimeEvent = RuntimeEvent; + type PrecompilesType = precompiles::BifrostPrecompiles; + type PrecompilesValue = PrecompilesValue; + type ChainId = EVMChainId; + type BlockGasLimit = BlockGasLimit; + type Runner = WrapRunner< + Self, + pallet_evm::runner::stack::Runner, // Evm runner that we wrap + FeeAssetBalanceInCurrency< + crate::Runtime, + ConvertAmount>, + crate::FlexibleFee, // Get account's fee payment asset + crate::Currencies, // Account balance inspector + >, + >; + type OnChargeTransaction = evm_fee::TransferEvmFees< + evm_fee::DepositEvmFeeToTreasury, + crate::FlexibleFee, // Get account's fee payment asset + WethAssetId, + ConvertAmount>, + crate::Currencies, // Multi currency support + >; + type OnCreate = (); + type FindAuthor = FindAuthorTruncated; + type GasLimitPovSizeRatio = GasLimitPovSizeRatio; + type SuicideQuickClearLimit = SuicideQuickClearLimit; + type Timestamp = Timestamp; + type WeightInfo = pallet_evm::weights::SubstrateWeight; +} + +impl pallet_evm_chain_id::Config for Runtime {} + +parameter_types! { + pub const PostBlockAndTxnHashes: PostLogContent = PostLogContent::BlockAndTxnHashes; +} + +impl pallet_ethereum::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type StateRoot = pallet_ethereum::IntermediateStateRoot; + type PostLogContent = PostBlockAndTxnHashes; + type ExtraDataLength = ConstU32<30>; +} + +pub struct EvmNonceProvider; +impl pallet_evm_accounts::EvmNonceProvider for EvmNonceProvider { + fn get_nonce(evm_address: sp_core::H160) -> U256 { + EVM::account_basic(&evm_address).0.nonce + } +} + +impl pallet_evm_accounts::Config for Runtime { + type RuntimeEvent = RuntimeEvent; + type FeeMultiplier = ConstU32<50>; + type EvmNonceProvider = EvmNonceProvider; + type ControllerOrigin = TechAdminOrCouncil; + type WeightInfo = (); +} + +parameter_types! { + pub BoundDivision: U256 = U256::from(1024); +} + +impl pallet_dynamic_fee::Config for Runtime { + type MinGasPriceBoundDivisor = BoundDivision; +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/costs.rs b/runtime/bifrost-polkadot/src/evm/precompiles/costs.rs new file mode 100644 index 000000000..adb0259f1 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/costs.rs @@ -0,0 +1,43 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Cost calculations. +use crate::evm::precompiles::EvmResult; +use pallet_evm::{ExitError, PrecompileFailure}; + +// Cost calculation is copied from EVM code that is not publicly exposed by the crates. +// https://github.com/rust-blockchain/evm/blob/master/gasometer/src/costs.rs#L148 +pub fn log_costs(topics: usize, data_len: usize) -> EvmResult { + const G_LOG: u64 = 375; + const G_LOGDATA: u64 = 8; + const G_LOGTOPIC: u64 = 375; + + let topic_cost = G_LOGTOPIC + .checked_mul(topics as u64) + .ok_or(PrecompileFailure::Error { exit_status: ExitError::OutOfGas })?; + + let data_cost = G_LOGDATA + .checked_mul(data_len as u64) + .ok_or(PrecompileFailure::Error { exit_status: ExitError::OutOfGas })?; + + G_LOG + .checked_add(topic_cost) + .ok_or(PrecompileFailure::Error { exit_status: ExitError::OutOfGas })? + .checked_add(data_cost) + .ok_or(PrecompileFailure::Error { exit_status: ExitError::OutOfGas }) +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/erc20_mapping.rs b/runtime/bifrost-polkadot/src/evm/precompiles/erc20_mapping.rs new file mode 100644 index 000000000..763b3275b --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/erc20_mapping.rs @@ -0,0 +1,77 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::evm::precompiles::EvmAddress; +use bifrost_primitives::CurrencyId; +use parity_scale_codec::{Decode, Encode}; +use primitive_types::H160; + +pub const CURRENCY_PRECOMPILE_ADDRESS_PREFIX: &[u8] = &[255u8; 4]; + +/// A mapping between AssetId and Erc20 EVM address. +pub trait Erc20Mapping { + fn encode_evm_address(currency_id: CurrencyId) -> Option; + + fn decode_evm_address(evm_address: EvmAddress) -> Option; +} + +pub struct BifrostErc20Mapping; + +/// Erc20Mapping logic for HydraDX +/// The asset id (with type u32) is encoded in the last 4 bytes of EVM address +impl Erc20Mapping for BifrostErc20Mapping { + fn encode_evm_address(currency_id: CurrencyId) -> Option { + let asset_id_bytes = currency_id.encode(); + + let mut evm_address_bytes = [0u8; 20]; + + evm_address_bytes[0..4].copy_from_slice(CURRENCY_PRECOMPILE_ADDRESS_PREFIX); + match currency_id { + CurrencyId::VSBond(..) | CurrencyId::VSBond2(..) => + evm_address_bytes[6..].copy_from_slice(asset_id_bytes.as_slice()), + CurrencyId::LPToken(..) => + evm_address_bytes[15..].copy_from_slice(asset_id_bytes.as_slice()), + _ => evm_address_bytes[18..].copy_from_slice(asset_id_bytes.as_slice()), + }; + + Some(EvmAddress::from(evm_address_bytes)) + } + + fn decode_evm_address(evm_address: EvmAddress) -> Option { + if !is_asset_address(evm_address) { + return None; + } + + let mut currency_id = &evm_address.to_fixed_bytes()[6..]; + if !currency_id.to_vec().starts_with(&[0, 0]) { + return CurrencyId::decode(&mut currency_id).ok(); + }; + + let mut currency_id = &evm_address.to_fixed_bytes()[15..]; + if !currency_id.to_vec().starts_with(&[0, 0]) { + return CurrencyId::decode(&mut currency_id).ok(); + }; + + let mut currency_id = &evm_address.to_fixed_bytes()[18..]; + CurrencyId::decode(&mut currency_id).ok() + } +} + +pub fn is_asset_address(address: H160) -> bool { + &address.to_fixed_bytes()[0..4] == CURRENCY_PRECOMPILE_ADDRESS_PREFIX +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/handle.rs b/runtime/bifrost-polkadot/src/evm/precompiles/handle.rs new file mode 100644 index 000000000..0eeb42343 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/handle.rs @@ -0,0 +1,467 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::evm::precompiles::{costs, revert, Address, Bytes, EvmResult}; +use pallet_evm::{Context, Log, PrecompileHandle}; +use primitive_types::{H160, H256, U256}; +use smallvec::alloc; +use sp_std::{borrow::ToOwned, vec, vec::Vec}; + +/// Wrapper around an EVM input slice, helping to parse it. +/// Provide functions to parse common types. +#[derive(Clone, Copy, Debug)] +pub struct EvmDataReader<'a> { + input: &'a [u8], + cursor: usize, +} + +#[derive(Clone, Debug)] +pub struct EvmDataWriter { + pub(crate) data: Vec, + offset_data: Vec, + selector: Option, +} + +impl EvmDataWriter { + /// Creates a new empty output builder (without selector). + pub fn new() -> Self { + Self { data: vec![], offset_data: vec![], selector: None } + } + + /// Return the built data. + pub fn build(mut self) -> Vec { + Self::bake_offsets(&mut self.data, self.offset_data); + + if let Some(selector) = self.selector { + let mut output = selector.to_be_bytes().to_vec(); + output.append(&mut self.data); + output + } else { + self.data + } + } + + /// Add offseted data at the end of this writer's data, updating the offsets. + fn bake_offsets(output: &mut Vec, offsets: Vec) { + for mut offset_datum in offsets { + let offset_position = offset_datum.offset_position; + let offset_position_end = offset_position + 32; + + // The offset is the distance between the start of the data and the + // start of the pointed data (start of a struct, length of an array). + // Offsets in inner data are relative to the start of their respective "container". + // However in arrays the "container" is actually the item itself instead of the whole + // array, which is corrected by `offset_shift`. + let free_space_offset = output.len() - offset_datum.offset_shift; + + // Override dummy offset to the offset it will be in the final output. + U256::from(free_space_offset) + .to_big_endian(&mut output[offset_position..offset_position_end]); + + // Append this data at the end of the current output. + output.append(&mut offset_datum.data); + } + } + + /// Write arbitrary bytes. + /// Doesn't handle any alignement checks, prefer using `write` instead if possible. + fn write_raw_bytes(mut self, value: &[u8]) -> Self { + self.data.extend_from_slice(value); + self + } + + /// Write data of requested type. + pub fn write(mut self, value: T) -> Self { + T::write(&mut self, value); + self + } + + /// Writes a pointer to given data. + /// The data will be appended when calling `build`. + /// Initially write a dummy value as offset in this writer's data, which will be replaced by + /// the correct offset once the pointed data is appended. + /// + /// Takes `&mut self` since its goal is to be used inside `EvmData` impl and not in chains. + pub fn write_pointer(&mut self, data: Vec) { + let offset_position = self.data.len(); + H256::write(self, H256::repeat_byte(0xff)); + + self.offset_data.push(OffsetDatum { offset_position, data, offset_shift: 0 }); + } +} + +impl Default for EvmDataWriter { + fn default() -> Self { + Self::new() + } +} + +#[derive(Clone, Debug)] +struct OffsetDatum { + // Offset location in the container data. + offset_position: usize, + // Data pointed by the offset that must be inserted at the end of container data. + data: Vec, + // Inside of arrays, the offset is not from the start of array data (length), but from the + // start of the item. This shift allow to correct this. + offset_shift: usize, +} + +/// Data that can be converted from and to EVM data types. +pub trait EvmData: Sized { + fn read(reader: &mut EvmDataReader) -> EvmResult; + fn write(writer: &mut EvmDataWriter, value: Self); + fn has_static_size() -> bool; +} + +impl EvmData for U256 { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse U256 out of bounds"))?; + + Ok(U256::from_big_endian(data)) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let mut buffer = [0u8; 32]; + value.to_big_endian(&mut buffer); + writer.data.extend_from_slice(&buffer); + } + + fn has_static_size() -> bool { + true + } +} + +impl EvmData for H256 { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse H256 out of bounds"))?; + + Ok(H256::from_slice(data)) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + writer.data.extend_from_slice(value.as_bytes()); + } + + fn has_static_size() -> bool { + true + } +} + +impl EvmData for Bytes { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let mut inner_reader = reader.read_pointer()?; + + // Read bytes/string size. + let array_size: usize = inner_reader + .read::() + .map_err(|_| revert("tried to parse bytes/string length out of bounds"))? + .try_into() + .map_err(|_| revert("bytes/string length is too large"))?; + + // Get valid range over the bytes data. + let range = inner_reader.move_cursor(array_size)?; + + let data = inner_reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse bytes/string out of bounds"))?; + + let bytes = Self(data.to_owned()); + + Ok(bytes) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let length = value.0.len(); + + // Pad the data. + // Leave it as is if a multiple of 32, otherwise pad to next + // multiple or 32. + let chunks = length / 32; + let padded_size = match length % 32 { + 0 => chunks * 32, + _ => (chunks + 1) * 32, + }; + + let mut value = value.0.to_vec(); + value.resize(padded_size, 0); + + writer.write_pointer( + EvmDataWriter::new().write(U256::from(length)).write_raw_bytes(&value).build(), + ); + } + + fn has_static_size() -> bool { + false + } +} + +impl EvmData for Address { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let range = reader.move_cursor(32)?; + + let data = reader + .input + .get(range) + .ok_or_else(|| revert("tried to parse H160 out of bounds"))?; + + Ok(H160::from_slice(&data[12..32]).into()) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + H256::write(writer, value.0.into()); + } + + fn has_static_size() -> bool { + true + } +} + +macro_rules! impl_evmdata_for_uints { + ($($uint:ty, )*) => { + $( + impl EvmData for $uint { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let value256: U256 = reader.read()?; + + value256 + .try_into() + .map_err(|_| revert(alloc::format!( + "value too big for type", + ))) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + U256::write(writer, value.into()); + } + + fn has_static_size() -> bool { + true + } + } + )* + }; +} + +impl_evmdata_for_uints!(u8, u16, u32, u64, u128,); + +impl EvmData for bool { + fn read(reader: &mut EvmDataReader) -> EvmResult { + let h256 = H256::read(reader).map_err(|_| revert("tried to parse bool out of bounds"))?; + + Ok(!h256.is_zero()) + } + + fn write(writer: &mut EvmDataWriter, value: Self) { + let mut buffer = [0u8; 32]; + if value { + buffer[31] = 1; + } + + writer.data.extend_from_slice(&buffer); + } + + fn has_static_size() -> bool { + true + } +} + +impl<'a> EvmDataReader<'a> { + /// Create a new input parser. + pub fn new(input: &'a [u8]) -> Self { + Self { input, cursor: 0 } + } + + /// Create a new input parser from a selector-initial input. + pub fn read_selector(input: &'a [u8]) -> EvmResult + where + T: num_enum::TryFromPrimitive, + { + if input.len() < 4 { + return Err(revert("tried to parse selector out of bounds")); + } + + let mut buffer = [0u8; 4]; + buffer.copy_from_slice(&input[0..4]); + let selector = T::try_from_primitive(u32::from_be_bytes(buffer)).map_err(|_| { + log::trace!( + target: "precompile-utils", + "Failed to match function selector" + //TODO: add type in log + ); + revert("unknown selector") + })?; + + Ok(selector) + } + + /// Create a new input parser from a selector-initial input. + pub fn new_skip_selector(input: &'a [u8]) -> EvmResult { + if input.len() < 4 { + return Err(revert("input is too short")); + } + + Ok(Self::new(&input[4..])) + } + + /// Check the input has at least the correct amount of arguments before the end (32 bytes + /// values). + pub fn expect_arguments(&self, args: usize) -> EvmResult { + if self.input.len() >= self.cursor + args * 32 { + Ok(()) + } else { + Err(revert("input doesn't match expected length")) + } + } + + /// Read data from the input. + pub fn read(&mut self) -> EvmResult { + T::read(self) + } + + /// Reads a pointer, returning a reader targetting the pointed location. + pub fn read_pointer(&mut self) -> EvmResult { + let offset: usize = self + .read::() + .map_err(|_| revert("tried to parse array offset out of bounds"))? + .try_into() + .map_err(|_| revert("array offset is too large"))?; + + if offset >= self.input.len() { + return Err(revert("pointer points out of bounds")); + } + + Ok(Self { input: &self.input[offset..], cursor: 0 }) + } + + /// Move the reading cursor with provided length, and return a range from the previous cursor + /// location to the new one. + /// Checks cursor overflows. + fn move_cursor(&mut self, len: usize) -> EvmResult> { + let start = self.cursor; + let end = self + .cursor + .checked_add(len) + .ok_or_else(|| revert("data reading cursor overflow"))?; + + self.cursor = end; + + Ok(start..end) + } +} + +/// Represents modifiers a Solidity function can be annotated with. +#[derive(Copy, Clone, PartialEq, Eq)] +pub enum FunctionModifier { + /// Function that doesn't modify the state. + View, + /// Function that modifies the state but refuse receiving funds. + /// Correspond to a Solidity function with no modifiers. + NonPayable, + /// Function that modifies the state and accept funds. + Payable, +} + +pub trait PrecompileHandleExt: PrecompileHandle { + /// Record cost of a log manually. + /// This can be useful to record log costs early when their content have static size. + fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult; + + /// Record cost of logs. + fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult; + + /// Check that a function call is compatible with the context it is + /// called into. + fn check_function_modifier(&self, modifier: FunctionModifier) -> EvmResult; + + /// Read the selector from the input data. + fn read_selector(&self) -> EvmResult + where + T: num_enum::TryFromPrimitive; + + /// Returns a reader of the input, skipping the selector. + fn read_input(&self) -> EvmResult; +} + +impl PrecompileHandleExt for T { + /// Record cost of a log manualy. + /// This can be useful to record log costs early when their content have static size. + fn record_log_costs_manual(&mut self, topics: usize, data_len: usize) -> EvmResult { + self.record_cost(costs::log_costs(topics, data_len)?)?; + + Ok(()) + } + + /// Record cost of logs. + fn record_log_costs(&mut self, logs: &[&Log]) -> EvmResult { + for log in logs { + self.record_log_costs_manual(log.topics.len(), log.data.len())?; + } + + Ok(()) + } + + /// Check that a function call is compatible with the context it is + /// called into. + fn check_function_modifier(&self, modifier: FunctionModifier) -> EvmResult { + check_function_modifier(self.context(), self.is_static(), modifier) + } + + /// Read the selector from the input data. + fn read_selector(&self) -> EvmResult + where + S: num_enum::TryFromPrimitive, + { + let input = self.input(); + EvmDataReader::read_selector(input) + } + + /// Returns a reader of the input, skipping the selector. + fn read_input(&self) -> EvmResult { + EvmDataReader::new_skip_selector(self.input()) + } +} + +/// Check that a function call is compatible with the context it is +/// called into. +pub fn check_function_modifier( + context: &Context, + is_static: bool, + modifier: FunctionModifier, +) -> EvmResult { + if is_static && modifier != FunctionModifier::View { + return Err(revert("can't call non-static function in static context")); + } + + if modifier != FunctionModifier::Payable && context.apparent_value > U256::zero() { + return Err(revert("function is not payable")); + } + + Ok(()) +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/mod.rs b/runtime/bifrost-polkadot/src/evm/precompiles/mod.rs new file mode 100644 index 000000000..56fe7ef92 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/mod.rs @@ -0,0 +1,225 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use core::marker::PhantomData; + +use crate::evm::precompiles::{ + erc20_mapping::is_asset_address, multicurrency::MultiCurrencyPrecompile, +}; +use ethabi::Token; +use frame_support::dispatch::{GetDispatchInfo, PostDispatchInfo}; +use hex_literal::hex; +use pallet_evm::{ + ExitRevert, ExitSucceed, IsPrecompileResult, Precompile, PrecompileFailure, PrecompileHandle, + PrecompileOutput, PrecompileResult, PrecompileSet, +}; +use pallet_evm_precompile_blake2::Blake2F; +use pallet_evm_precompile_bn128::{Bn128Add, Bn128Mul, Bn128Pairing}; +use pallet_evm_precompile_modexp::Modexp; +use pallet_evm_precompile_simple::{ECRecover, Identity, Ripemd160, Sha256}; +use parity_scale_codec::Decode; +use primitive_types::{H160, U256}; +use sp_runtime::traits::Dispatchable; +use sp_std::{borrow::ToOwned, vec::Vec}; + +pub mod costs; +pub mod erc20_mapping; +pub mod handle; +pub mod multicurrency; +pub mod substrate; + +pub type EvmResult = Result; + +#[cfg(test)] +mod tests; + +pub type EvmAddress = H160; + +/// The `address` type of Solidity. +/// H160 could represent 2 types of data (bytes20 and address) that are not encoded the same way. +/// To avoid issues writing H160 is thus not supported. +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub struct Address(pub H160); + +impl From for Address { + fn from(a: H160) -> Address { + Address(a) + } +} + +impl From

for H160 { + fn from(a: Address) -> H160 { + a.0 + } +} + +pub struct BifrostPrecompiles(PhantomData); + +impl BifrostPrecompiles { + #[allow(clippy::new_without_default)] // We'll never use Default and can't derive it. + pub fn new() -> Self { + Self(Default::default()) + } +} + +// Same as Moonbean and Centrifuge, should benefit interoperability +// See also +// https://docs.moonbeam.network/builders/pallets-precompiles/precompiles/overview/#precompiled-contract-addresses +const DISPATCH_ADDR: H160 = addr(1025); + +pub const ECRECOVER: H160 = H160(hex!("0000000000000000000000000000000000000001")); +pub const SHA256: H160 = H160(hex!("0000000000000000000000000000000000000002")); +pub const RIPEMD: H160 = H160(hex!("0000000000000000000000000000000000000003")); +pub const IDENTITY: H160 = H160(hex!("0000000000000000000000000000000000000004")); +pub const MODEXP: H160 = H160(hex!("0000000000000000000000000000000000000005")); +pub const BN_ADD: H160 = H160(hex!("0000000000000000000000000000000000000006")); +pub const BN_MUL: H160 = H160(hex!("0000000000000000000000000000000000000007")); +pub const BN_PAIRING: H160 = H160(hex!("0000000000000000000000000000000000000008")); +pub const BLAKE2F: H160 = H160(hex!("0000000000000000000000000000000000000009")); + +pub const ETH_PRECOMPILE_END: H160 = BLAKE2F; + +fn is_standard_precompile(address: H160) -> bool { + !address.is_zero() && address <= ETH_PRECOMPILE_END +} + +impl PrecompileSet for BifrostPrecompiles +where + R: pallet_evm::Config + bifrost_currencies::Config, + R::RuntimeCall: Dispatchable + GetDispatchInfo + Decode, + ::RuntimeOrigin: From>, + MultiCurrencyPrecompile: Precompile, +{ + fn execute(&self, handle: &mut impl PrecompileHandle) -> Option { + let context = handle.context(); + let address = handle.code_address(); + + // Filter known precompile addresses except Ethereum officials + if address > ETH_PRECOMPILE_END && context.address != address { + return Some(Err(PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: "cannot be called with DELEGATECALL or CALLCODE".into(), + })); + } + + if address == ECRECOVER { + Some(ECRecover::execute(handle)) + } else if address == SHA256 { + Some(Sha256::execute(handle)) + } else if address == RIPEMD { + Some(Ripemd160::execute(handle)) + } else if address == IDENTITY { + Some(Identity::execute(handle)) + } else if address == MODEXP { + Some(Modexp::execute(handle)) + } else if address == BN_ADD { + Some(Bn128Add::execute(handle)) + } else if address == BN_MUL { + Some(Bn128Mul::execute(handle)) + } else if address == BN_PAIRING { + Some(Bn128Pairing::execute(handle)) + } else if address == BLAKE2F { + Some(Blake2F::execute(handle)) + } else if address == DISPATCH_ADDR { + Some(pallet_evm_precompile_dispatch::Dispatch::::execute(handle)) + } else if is_asset_address(address) { + Some(MultiCurrencyPrecompile::::execute(handle)) + } else { + None + } + } + + fn is_precompile(&self, address: H160, _remaining_gas: u64) -> IsPrecompileResult { + let is_precompile = address == DISPATCH_ADDR || + is_asset_address(address) || + is_standard_precompile(address); + IsPrecompileResult::Answer { is_precompile, extra_cost: 0 } + } +} + +// This is a reimplementation of the upstream u64->H160 conversion +// function, made `const` to make our precompile address `const`s a +// bit cleaner. It can be removed when upstream has a const conversion +// function. +pub const fn addr(a: u64) -> H160 { + let b = a.to_be_bytes(); + H160([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, b[0], b[1], b[2], b[3], b[4], b[5], b[6], b[7]]) +} + +pub fn revert(output: impl AsRef<[u8]>) -> PrecompileFailure { + PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: output.as_ref().to_owned(), + } +} + +pub fn succeed(output: impl AsRef<[u8]>) -> PrecompileOutput { + PrecompileOutput { exit_status: ExitSucceed::Returned, output: output.as_ref().to_owned() } +} + +pub struct Output; + +impl Output { + pub fn encode_uint(b: T) -> Vec + where + U256: From, + { + ethabi::encode(&[Token::Uint(U256::from(b))]) + } + + pub fn encode_bytes(b: &[u8]) -> Vec { + ethabi::encode(&[Token::Bytes(b.to_vec())]) + } +} + +/// The `bytes`/`string` type of Solidity. +/// It is different from `Vec` which will be serialized with padding for each `u8` element +/// of the array, while `Bytes` is tightly packed. +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct Bytes(pub Vec); + +impl Bytes { + /// Interpret as `bytes`. + pub fn as_bytes(&self) -> &[u8] { + &self.0 + } + + /// Interpret as `string`. + /// Can fail if the string is not valid UTF8. + pub fn as_str(&self) -> Result<&str, sp_std::str::Utf8Error> { + sp_std::str::from_utf8(&self.0) + } +} + +impl From<&[u8]> for Bytes { + fn from(a: &[u8]) -> Self { + Self(a.to_owned()) + } +} + +impl From<&str> for Bytes { + fn from(a: &str) -> Self { + a.as_bytes().into() + } +} + +impl From for Vec { + fn from(val: Bytes) -> Self { + val.0 + } +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/multicurrency.rs b/runtime/bifrost-polkadot/src/evm/precompiles/multicurrency.rs new file mode 100644 index 000000000..85c571694 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/multicurrency.rs @@ -0,0 +1,244 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::{ + evm::{ + precompiles::{ + erc20_mapping::{BifrostErc20Mapping, Erc20Mapping}, + handle::{EvmDataWriter, FunctionModifier, PrecompileHandleExt}, + substrate::RuntimeHelper, + succeed, Address, Output, + }, + ExtendedAddressMapping, + }, + Currencies, +}; +use bifrost_asset_registry::AssetIdMaps; +use bifrost_primitives::{Balance, CurrencyId, CurrencyIdMapping}; +use frame_support::traits::OriginTrait; +use num_enum::{IntoPrimitive, TryFromPrimitive}; +use orml_traits::{MultiCurrency as MultiCurrencyT, MultiCurrency}; +use pallet_evm::{ + AddressMapping, ExitRevert, Precompile, PrecompileFailure, PrecompileHandle, PrecompileResult, +}; +use primitive_types::H160; +use sp_runtime::{traits::Dispatchable, RuntimeDebug}; +use sp_std::{marker::PhantomData, prelude::*}; + +#[module_evm_utility_macro::generate_function_selector] +#[derive(RuntimeDebug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)] +#[repr(u32)] +pub enum Action { + Name = "name()", + Symbol = "symbol()", + Decimals = "decimals()", + TotalSupply = "totalSupply()", + BalanceOf = "balanceOf(address)", + Allowance = "allowance(address,address)", + Transfer = "transfer(address,uint256)", + Approve = "approve(address,uint256)", + TransferFrom = "transferFrom(address,address,uint256)", +} +pub struct MultiCurrencyPrecompile(PhantomData); + +impl Precompile for MultiCurrencyPrecompile +where + Runtime: frame_system::Config + + pallet_evm::Config + + bifrost_asset_registry::Config + + bifrost_currencies::Config, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, + Currencies: MultiCurrency, + bifrost_currencies::Pallet: + MultiCurrency, + ::AccountId: core::convert::From, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, +{ + fn execute(handle: &mut impl PrecompileHandle) -> pallet_evm::PrecompileResult { + let address = handle.code_address(); + if let Some(asset_id) = BifrostErc20Mapping::decode_evm_address(address) { + log::debug!(target: "evm", "multicurrency: currency id: {:?}", asset_id); + + let selector = match handle.read_selector() { + Ok(selector) => selector, + Err(e) => return Err(e), + }; + + handle.check_function_modifier(match selector { + Action::Transfer => FunctionModifier::NonPayable, + _ => FunctionModifier::View, + })?; + + return match selector { + Action::Name => Self::name(asset_id, handle), + Action::Symbol => Self::symbol(asset_id, handle), + Action::Decimals => Self::decimals(asset_id, handle), + Action::TotalSupply => Self::total_supply(asset_id, handle), + Action::BalanceOf => Self::balance_of(asset_id, handle), + Action::Transfer => Self::transfer(asset_id, handle), + Action::Allowance => Self::not_supported(asset_id, handle), + Action::Approve => Self::not_supported(asset_id, handle), + Action::TransferFrom => Self::not_supported(asset_id, handle), + }; + } + Err(PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: "invalid currency id".into(), + }) + } +} + +impl MultiCurrencyPrecompile +where + Runtime: frame_system::Config + + pallet_evm::Config + + bifrost_asset_registry::Config + + bifrost_currencies::Config, + Currencies: MultiCurrency, + bifrost_currencies::Pallet: + MultiCurrency, + ::AccountId: core::convert::From, + <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, +{ + fn name(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_bytes(metadata.name.as_slice()); + Ok(succeed(encoded)) + }, + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn symbol(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_bytes(metadata.symbol.as_slice()); + Ok(succeed(encoded)) + }, + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn decimals(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + match AssetIdMaps::::get_currency_metadata(currency_id) { + Some(metadata) => { + let encoded = Output::encode_uint::(metadata.decimals); + Ok(succeed(encoded)) + }, + None => Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("Non-existing asset.".into()), + }), + } + } + + fn total_supply( + currency_id: CurrencyId, + handle: &mut impl PrecompileHandle, + ) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let input = handle.read_input()?; + input.expect_arguments(0)?; + + let total_issuance = Currencies::total_issuance(currency_id); + + log::debug!(target: "evm", "multicurrency: totalSupply: {:?}", total_issuance); + + let encoded = Output::encode_uint::(total_issuance); + + Ok(succeed(encoded)) + } + + fn balance_of(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let mut input = handle.read_input()?; + input.expect_arguments(1)?; + + let owner: H160 = input.read::
()?.into(); + let who: Runtime::AccountId = ExtendedAddressMapping::into_account_id(owner).into(); //TODO: use pallet? + + let free_balance = Currencies::free_balance(currency_id, &who); + + log::debug!(target: "evm", "multicurrency: balanceOf: {:?}", free_balance); + + let encoded = Output::encode_uint::(free_balance); + + Ok(succeed(encoded)) + } + + fn transfer(currency_id: CurrencyId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let mut input = handle.read_input()?; + input.expect_arguments(2)?; + + let to: H160 = input.read::
()?.into(); + let amount = input.read::()?; + + let origin = ExtendedAddressMapping::into_account_id(handle.context().caller); + let to = ExtendedAddressMapping::into_account_id(to); + + log::debug!(target: "evm", "multicurrency: transfer from: {:?}, to: {:?}, amount: {:?}", origin, to, amount); + + as MultiCurrency>::transfer( + currency_id, + &(>::into(origin)), + &(>::into(to)), + amount, + ) + .map_err(|e| PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: Into::<&str>::into(e).as_bytes().to_vec(), + })?; + + Ok(succeed(EvmDataWriter::new().write(true).build())) + } + + fn not_supported(_: CurrencyId, _: &mut impl PrecompileHandle) -> PrecompileResult { + Err(PrecompileFailure::Error { + exit_status: pallet_evm::ExitError::Other("not supported".into()), + }) + } +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/substrate.rs b/runtime/bifrost-polkadot/src/evm/precompiles/substrate.rs new file mode 100644 index 000000000..b3214c822 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/substrate.rs @@ -0,0 +1,43 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! Utils related to Substrate features: +//! - Substrate call dispatch. +//! - Substrate DB read and write costs + +use core::marker::PhantomData; +use frame_support::{traits::Get, weights::Weight}; +use pallet_evm::GasWeightMapping; + +/// Helper functions requiring a Substrate runtime. +/// This runtime must of course implement `pallet_evm::Config`. +#[derive(Clone, Copy, Debug)] +pub struct RuntimeHelper(PhantomData); + +impl RuntimeHelper +where + Runtime: pallet_evm::Config + frame_system::Config, +{ + /// Cost of a Substrate DB read in gas. + pub fn db_read_gas_cost() -> u64 { + ::GasWeightMapping::weight_to_gas(Weight::from_parts( + ::DbWeight::get().read, + 0, + )) + } +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/tests/erc20_mapping.rs b/runtime/bifrost-polkadot/src/evm/precompiles/tests/erc20_mapping.rs new file mode 100644 index 000000000..266a062f2 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/tests/erc20_mapping.rs @@ -0,0 +1,113 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use crate::evm::precompiles::erc20_mapping::{BifrostErc20Mapping, Erc20Mapping}; +use bifrost_primitives::{ + CurrencyId, TokenSymbol, + TokenSymbol::{BNC, KSM}, +}; +use hex_literal::hex; +use primitive_types::H160; + +macro_rules! encode { + ($asset_id:expr) => {{ + BifrostErc20Mapping::encode_evm_address($asset_id).unwrap() + }}; +} + +macro_rules! decode { + ($evm_address:expr) => {{ + BifrostErc20Mapping::decode_evm_address(H160::from($evm_address)).unwrap() + }}; +} + +macro_rules! decode_optional { + ($evm_address:expr) => {{ + BifrostErc20Mapping::decode_evm_address(H160::from($evm_address)) + }}; +} + +#[test] +fn decode_asset_id_from_evm_address_should_work() { + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000001")), CurrencyId::Native(BNC)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000800")), CurrencyId::Token2(0)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000900")), CurrencyId::VToken2(0)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000204")), CurrencyId::Token(KSM)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000104")), CurrencyId::VToken(KSM)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000404")), CurrencyId::VSToken(KSM)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000a00")), CurrencyId::VSToken2(0)); + assert_eq!(decode!(hex!("ffffffff00000000000000000000000000000a00")), CurrencyId::VSToken2(0)); + assert_eq!( + decode!(hex!("ffffffff00000b00000000000000000000000000")), + CurrencyId::VSBond2(0, 0, 0, 0) + ); + assert_eq!( + decode!(hex!("ffffffff00000501000000000000000000000000")), + CurrencyId::VSBond(TokenSymbol::BNC, 0, 0, 0) + ); + assert_eq!( + decode!(hex!("ffffffff00000000000000000000000601000300")), + CurrencyId::LPToken(TokenSymbol::BNC, 0, TokenSymbol::DOT, 0) + ); +} + +#[test] +fn decode_asset_id_from_evm_address_should_not_work_with_invalid_asset_addresses() { + assert_eq!(decode_optional!(hex!("0000000000000000000000000000000200000000")), None); + assert_eq!(decode_optional!(hex!("0000000000000000000000000000000000000001")), None); + assert_eq!(decode_optional!(hex!("90000000000000000000000000000001ffffffff")), None); + assert_eq!(decode_optional!(hex!("0000000000000000000000000000001100000003")), None); + assert_eq!(decode_optional!(hex!("0000000000000000900000000000000100000003")), None); + assert_eq!(decode_optional!(hex!("7777777777777777777777777777777777777777")), None); +} + +#[test] +fn encode_asset_id_to_evm_address_should_work() { + assert_eq!( + encode!(CurrencyId::Native(BNC)), + H160::from(hex!("ffffffff00000000000000000000000000000001")) + ); + assert_eq!( + encode!(CurrencyId::Token2(0)), + H160::from(hex!("ffffffff00000000000000000000000000000800")) + ); + assert_eq!( + encode!(CurrencyId::VToken2(0)), + H160::from(hex!("ffffffff00000000000000000000000000000900")) + ); + assert_eq!( + encode!(CurrencyId::Token(KSM)), + H160::from(hex!("ffffffff00000000000000000000000000000204")) + ); + assert_eq!( + encode!(CurrencyId::VToken(KSM)), + H160::from(hex!("ffffffff00000000000000000000000000000104")) + ); + assert_eq!( + encode!(CurrencyId::VSBond2(0, 0, 0, 0)), + H160::from(hex!("ffffffff00000b00000000000000000000000000")) + ); + assert_eq!( + encode!(CurrencyId::LPToken(TokenSymbol::BNC, 0, TokenSymbol::DOT, 0)), + H160::from(hex!("ffffffff00000000000000000000000601000300")) + ); + assert_eq!( + encode!(CurrencyId::VSBond(TokenSymbol::BNC, 0, 0, 0)), + H160::from(hex!("ffffffff00000501000000000000000000000000")) + ); +} diff --git a/runtime/bifrost-polkadot/src/evm/precompiles/tests/mod.rs b/runtime/bifrost-polkadot/src/evm/precompiles/tests/mod.rs new file mode 100644 index 000000000..3f6a29386 --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/precompiles/tests/mod.rs @@ -0,0 +1,19 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +mod erc20_mapping; diff --git a/runtime/bifrost-polkadot/src/evm/runner.rs b/runtime/bifrost-polkadot/src/evm/runner.rs new file mode 100644 index 000000000..4ad5c4b7f --- /dev/null +++ b/runtime/bifrost-polkadot/src/evm/runner.rs @@ -0,0 +1,263 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +//! EVM stack-based runner. +//! This runner is a wrapper around the default stack-based runner that adds possibility to charge +//! fees in different currencies and to validate transactions based on the account's fee payment +//! asset. +//! +//! Shamelessly copied from pallet-evm and modified to support multi-currency fees. +use crate::{evm::WethAssetId, Weight}; +use bifrost_primitives::{AccountFeeCurrencyBalanceInCurrency, Balance}; +use fp_evm::{Account, TransactionValidationError}; +use frame_support::traits::Get; +use pallet_evm::{ + runner::Runner, AddressMapping, CallInfo, Config, CreateInfo, FeeCalculator, RunnerError, +}; +use primitive_types::{H160, H256, U256}; +use sp_runtime::traits::UniqueSaturatedInto; +use sp_std::vec::Vec; + +pub struct WrapRunner(sp_std::marker::PhantomData<(T, R, B)>); + +impl Runner for WrapRunner +where + T: Config, + R: Runner, + >::Error: core::convert::From, + B: AccountFeeCurrencyBalanceInCurrency, +{ + type Error = R::Error; + + fn validate( + source: H160, + target: Option, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + weight_limit: Option, + proof_size_base_cost: Option, + evm_config: &evm::Config, + ) -> Result<(), RunnerError> { + let (base_fee, mut weight) = T::FeeCalculator::min_gas_price(); + + let evm_currency = WethAssetId::get(); + let account_id = T::AddressMapping::into_account_id(source); + let account_nonce = frame_system::Pallet::::account_nonce(&account_id); + let (balance, b_weight) = B::get_balance_in_currency(evm_currency, &account_id); + + let (source_account, inner_weight) = ( + Account { + nonce: U256::from(UniqueSaturatedInto::::unique_saturated_into( + account_nonce, + )), + balance: U256::from(UniqueSaturatedInto::::unique_saturated_into(balance)), + }, + T::DbWeight::get().reads(1).saturating_add(b_weight), + ); + weight = weight.saturating_add(inner_weight); + + let _ = fp_evm::CheckEvmTransaction::::new( + fp_evm::CheckEvmTransactionConfig { + evm_config, + block_gas_limit: T::BlockGasLimit::get(), + base_fee, + chain_id: T::ChainId::get(), + is_transactional, + }, + fp_evm::CheckEvmTransactionInput { + chain_id: Some(T::ChainId::get()), + to: target, + input, + nonce: nonce.unwrap_or(source_account.nonce), + gas_limit: gas_limit.into(), + gas_price: None, + max_fee_per_gas, + max_priority_fee_per_gas, + value, + access_list, + }, + weight_limit, + proof_size_base_cost, + ) + .validate_in_block_for(&source_account) + .and_then(|v| v.with_base_fee()) + .and_then(|v| v.with_balance_for(&source_account)) + .map_err(|error| RunnerError { error, weight })?; + Ok(()) + } + + fn call( + source: H160, + target: H160, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + Some(target), + input.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + // Validated, flag set to false + R::call( + source, + target, + input, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } + + fn create( + source: H160, + init: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + None, + init.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + // Validated, flag set to false + R::create( + source, + init, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } + + fn create2( + source: H160, + init: Vec, + salt: H256, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + None, + init.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + //Validated, flag set to false + R::create2( + source, + init, + salt, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list, + is_transactional, + false, + weight_limit, + proof_size_base_cost, + config, + ) + } +} diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index 771777e8c..e837eea06 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -28,6 +28,7 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); use bifrost_slp::{DerivativeAccountProvider, QueryResponseManager}; use core::convert::TryInto; +use pallet_traits::evm::InspectEvmAccounts; // A few exports that help ease life for downstream crates. use cumulus_pallet_parachain_system::{RelayNumberStrictlyIncreases, RelaychainDataProvider}; pub use frame_support::{ @@ -51,7 +52,7 @@ pub use pallet_balances::Call as BalancesCall; pub use pallet_timestamp::Call as TimestampCall; use sp_api::impl_runtime_apis; use sp_arithmetic::Percent; -use sp_core::{OpaqueMetadata, U256}; +use sp_core::{OpaqueMetadata, H160, H256, U256}; use sp_runtime::{ create_runtime_str, generic, impl_opaque_keys, traits::{AccountIdConversion, BlakeTwo256, Block as BlockT, Zero}, @@ -65,6 +66,7 @@ use sp_version::RuntimeVersion; /// Constant values used within the runtime. pub mod constants; +mod evm; mod migration; pub mod weights; use bifrost_asset_registry::{AssetIdMaps, FixedRateOfAsset}; @@ -87,6 +89,8 @@ use bifrost_slp::QueryId; use bifrost_ve_minting::traits::VeMintingInterface; use constants::currency::*; use cumulus_primitives_core::ParaId as CumulusParaId; +use fp_evm::FeeCalculator; +use fp_rpc::TransactionStatus; use frame_support::{ dispatch::DispatchClass, genesis_builder_helper::{build_state, get_preset}, @@ -94,11 +98,12 @@ use frame_support::{ traits::{ fungible::HoldConsideration, tokens::{PayFromAccount, UnityAssetBalanceConversion}, - Currency, EitherOf, EitherOfDiverse, Get, InsideBoth, LinearStoragePrice, + Currency, EitherOf, EitherOfDiverse, Get, InsideBoth, LinearStoragePrice, OnFinalize, }, }; use frame_system::{EnsureRoot, EnsureRootWithSuccess, EnsureSigned}; use hex_literal::hex; +use pallet_ethereum::Transaction; use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; // zenlink imports use zenlink_protocol::{ @@ -108,10 +113,15 @@ use zenlink_protocol::{ // xcm config pub mod xcm_config; use orml_traits::{currency::MutationHooks, location::RelativeReserveProvider}; +use pallet_evm::{GasWeightMapping, Runner}; use pallet_identity::legacy::IdentityInfo; use pallet_xcm::{EnsureResponse, QueryStatus}; use polkadot_runtime_common::prod_or_fast; -use sp_runtime::traits::{IdentityLookup, Verify}; +use sp_arithmetic::traits::UniqueSaturatedInto; +use sp_runtime::{ + traits::{DispatchInfoOf, Dispatchable, IdentityLookup, PostDispatchInfoOf, Verify}, + transaction_validity::TransactionValidityError, +}; use static_assertions::const_assert; use xcm::{v3::MultiLocation, v4::prelude::*}; pub use xcm_config::{ @@ -129,9 +139,29 @@ use governance::{ TechAdminOrCouncil, }; -impl_opaque_keys! { - pub struct SessionKeys { - pub aura: Aura, +/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know +/// the specifics of the runtime. They can then be made to be agnostic over specific formats +/// of data like extrinsics, allowing for them to continue syncing the network through upgrades +/// to even the core data structures. +pub mod opaque { + use super::*; + use cumulus_primitives_core::relay_chain::HashT; + + pub use sp_runtime::OpaqueExtrinsic as UncheckedExtrinsic; + + /// Opaque block header type. + pub type Header = generic::Header; + /// Opaque block type. + pub type Block = generic::Block; + /// Opaque block identifier type. + pub type BlockId = generic::BlockId; + /// Opaque block hash type. + pub type Hash = ::Output; + + impl_opaque_keys! { + pub struct SessionKeys { + pub aura: Aura, + } } } @@ -812,10 +842,11 @@ parameter_types! { impl pallet_session::Config for Runtime { type RuntimeEvent = RuntimeEvent; - type Keys = SessionKeys; + type Keys = opaque::SessionKeys; type NextSessionRotation = pallet_session::PeriodicSessions; // Essentially just Aura, but lets be pedantic. - type SessionHandler = ::KeyTypeIdProviders; + type SessionHandler = + ::KeyTypeIdProviders; type SessionManager = CollatorSelection; type ShouldEndSession = pallet_session::PeriodicSessions; type ValidatorId = ::AccountId; @@ -1715,6 +1746,13 @@ construct_runtime! { Treasury: pallet_treasury = 61, Preimage: pallet_preimage = 64, + // Frontier and EVM pallets + Ethereum: pallet_ethereum = 65, + EVM: pallet_evm = 66, + EVMChainId: pallet_evm_chain_id = 67, + DynamicFee: pallet_dynamic_fee = 68, + EVMAccounts: pallet_evm_accounts = 69, + // Third party modules XTokens: orml_xtokens = 70, Tokens: orml_tokens = 71, @@ -1755,6 +1793,31 @@ construct_runtime! { } } +#[derive(Clone)] +pub struct TransactionConverter; + +impl fp_rpc::ConvertTransaction for TransactionConverter { + fn convert_transaction(&self, transaction: pallet_ethereum::Transaction) -> UncheckedExtrinsic { + UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ) + } +} + +impl fp_rpc::ConvertTransaction for TransactionConverter { + fn convert_transaction( + &self, + transaction: pallet_ethereum::Transaction, + ) -> opaque::UncheckedExtrinsic { + let extrinsic = UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ); + let encoded = extrinsic.encode(); + opaque::UncheckedExtrinsic::decode(&mut &encoded[..]) + .expect("Encoded extrinsic is always valid") + } +} + /// The type for looking up accounts. We don't expect more than 4 billion of them. pub type AccountIndex = u32; /// Alias to 512-bit hash when used in the context of a transaction signature on the chain. @@ -1787,9 +1850,10 @@ pub type SignedExtra = ( ); /// Unchecked extrinsic type as expected by this runtime. pub type UncheckedExtrinsic = - generic::UncheckedExtrinsic; + fp_self_contained::UncheckedExtrinsic; /// Extrinsic type that has already been checked. -pub type CheckedExtrinsic = generic::CheckedExtrinsic; +pub type CheckedExtrinsic = + fp_self_contained::CheckedExtrinsic; /// The payload being signed in transactions. pub type SignedPayload = generic::SignedPayload; @@ -1827,6 +1891,62 @@ pub type Executive = frame_executive::Executive< Migrations, >; +impl fp_self_contained::SelfContainedCall for RuntimeCall { + type SignedInfo = H160; + + fn is_self_contained(&self) -> bool { + match self { + RuntimeCall::Ethereum(call) => call.is_self_contained(), + _ => false, + } + } + + fn check_self_contained(&self) -> Option> { + match self { + RuntimeCall::Ethereum(call) => call.check_self_contained(), + _ => None, + } + } + + fn validate_self_contained( + &self, + info: &Self::SignedInfo, + dispatch_info: &DispatchInfoOf, + len: usize, + ) -> Option { + match self { + RuntimeCall::Ethereum(call) => call.validate_self_contained(info, dispatch_info, len), + _ => None, + } + } + + fn pre_dispatch_self_contained( + &self, + info: &Self::SignedInfo, + dispatch_info: &DispatchInfoOf, + len: usize, + ) -> Option> { + match self { + RuntimeCall::Ethereum(call) => + call.pre_dispatch_self_contained(info, dispatch_info, len), + _ => None, + } + } + + fn apply_self_contained( + self, + info: Self::SignedInfo, + ) -> Option>> { + match self { + call @ RuntimeCall::Ethereum(pallet_ethereum::Call::transact { .. }) => + Some(call.dispatch(RuntimeOrigin::from( + pallet_ethereum::RawOrigin::EthereumTransaction(info), + ))), + _ => None, + } + } +} + #[cfg(feature = "runtime-benchmarks")] #[macro_use] extern crate frame_benchmarking; @@ -1890,6 +2010,275 @@ impl_runtime_apis! { } } +impl fp_rpc::EthereumRuntimeRPCApi for Runtime { + fn chain_id() -> u64 { + ::ChainId::get() + } + + fn account_basic(address: H160) -> pallet_evm::Account { + let (account, _) = EVM::account_basic(&address); + account + } + + fn gas_price() -> U256 { + let (gas_price, _) = ::FeeCalculator::min_gas_price(); + gas_price + } + + fn account_code_at(address: H160) -> Vec { + pallet_evm::AccountCodes::::get(address) + } + + fn author() -> H160 { + >::find_author() + } + + fn storage_at(address: H160, index: U256) -> H256 { + let mut tmp = [0u8; 32]; + index.to_big_endian(&mut tmp); + pallet_evm::AccountStorages::::get(address, H256::from_slice(&tmp[..])) + } + + fn call( + from: H160, + to: H160, + data: Vec, + value: U256, + gas_limit: U256, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + estimate: bool, + access_list: Option)>>, + ) -> Result { + let mut config = ::config().clone(); + config.estimate = estimate; + + let is_transactional = false; + let validate = true; + + // Estimated encoded transaction size must be based on the heaviest transaction + // type (EIP1559Transaction) to be compatible with all transaction types. + let mut estimated_transaction_len = data.len() + + // pallet ethereum index: 1 + // transact call index: 1 + // Transaction enum variant: 1 + // chain_id 8 bytes + // nonce: 32 + // max_priority_fee_per_gas: 32 + // max_fee_per_gas: 32 + // gas_limit: 32 + // action: 21 (enum varianrt + call address) + // value: 32 + // access_list: 1 (empty vec size) + // 65 bytes signature + 258; + + if access_list.is_some() { + estimated_transaction_len += access_list.encoded_size(); + } + + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = + match ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + + // don't allow calling EVM RPC or Runtime API from a bound address + if EVMAccounts::bound_account_id(from).is_some() { + return Err(pallet_evm_accounts::Error::::BoundAddressCannotBeUsed.into()) + }; + + ::Runner::call( + from, + to, + data, + value, + gas_limit.unique_saturated_into(), + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.unwrap_or_default(), + is_transactional, + validate, + weight_limit, + proof_size_base_cost, + &config, + ) + .map_err(|err| err.error.into()) + } + + fn create( + from: H160, + data: Vec, + value: U256, + gas_limit: U256, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + estimate: bool, + access_list: Option)>>, + ) -> Result { + let config = if estimate { + let mut config = ::config().clone(); + config.estimate = true; + Some(config) + } else { + None + }; + + let is_transactional = false; + let validate = true; + + // Reused approach from Moonbeam since Frontier implementation doesn't support this + let mut estimated_transaction_len = data.len() + + // to: 20 + // from: 20 + // value: 32 + // gas_limit: 32 + // nonce: 32 + // 1 byte transaction action variant + // chain id 8 bytes + // 65 bytes signature + 210; + if max_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if max_priority_fee_per_gas.is_some() { + estimated_transaction_len += 32; + } + if access_list.is_some() { + estimated_transaction_len += access_list.encoded_size(); + } + + let gas_limit = gas_limit.min(u64::MAX.into()).low_u64(); + let without_base_extrinsic_weight = true; + + let (weight_limit, proof_size_base_cost) = + match ::GasWeightMapping::gas_to_weight( + gas_limit, + without_base_extrinsic_weight + ) { + weight_limit if weight_limit.proof_size() > 0 => { + (Some(weight_limit), Some(estimated_transaction_len as u64)) + } + _ => (None, None), + }; + + // don't allow calling EVM RPC or Runtime API from a bound address + if EVMAccounts::bound_account_id(from).is_some() { + return Err(pallet_evm_accounts::Error::::BoundAddressCannotBeUsed.into()) + }; + + // the address needs to have a permission to deploy smart contract + if !EVMAccounts::can_deploy_contracts(from) { + return Err(pallet_evm_accounts::Error::::AddressNotWhitelisted.into()) + }; + + #[allow(clippy::or_fun_call)] // suggestion not helpful here + ::Runner::create( + from, + data, + value, + gas_limit.unique_saturated_into(), + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + Vec::new(), + is_transactional, + validate, + weight_limit, + proof_size_base_cost, + config + .as_ref() + .unwrap_or(::config()), + ) + .map_err(|err| err.error.into()) + } + + fn current_transaction_statuses() -> Option> { + pallet_ethereum::CurrentTransactionStatuses::::get() + } + + fn current_block() -> Option { + pallet_ethereum::CurrentBlock::::get() + } + + fn current_receipts() -> Option> { + pallet_ethereum::CurrentReceipts::::get() + } + + fn current_all() -> ( + Option, + Option>, + Option>, + ) { + ( + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentReceipts::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get(), + ) + } + + fn extrinsic_filter(xts: Vec<::Extrinsic>) -> Vec { + xts.into_iter() + .filter_map(|xt| match xt.0.function { + RuntimeCall::Ethereum(pallet_ethereum::Call::transact { transaction }) => Some(transaction), + _ => None, + }) + .collect::>() + } + + fn elasticity() -> Option { + None + } + + fn gas_limit_multiplier_support() {} + + fn pending_block( + xts: Vec<::Extrinsic>, + ) -> (Option, Option>) { + for ext in xts.into_iter() { + let _ = Executive::apply_extrinsic(ext); + } + + Ethereum::on_finalize(System::block_number() + 1); + + ( + pallet_ethereum::CurrentBlock::::get(), + pallet_ethereum::CurrentTransactionStatuses::::get() + ) + } + } + + impl fp_rpc::ConvertTransactionRuntimeApi for Runtime { + fn convert_transaction(transaction: Transaction) -> ::Extrinsic { + UncheckedExtrinsic::new_unsigned( + pallet_ethereum::Call::::transact { transaction }.into(), + ) + } + } + + impl pallet_evm_accounts_rpc_runtime_api::EvmAccountsApi for Runtime { + fn evm_address(account_id: AccountId) -> H160 { + EVMAccounts::evm_address(&account_id) + } + fn bound_account_id(evm_address: H160) -> Option { + EVMAccounts::bound_account_id(evm_address) + } + fn account_id(evm_address: H160) -> AccountId { + EVMAccounts::account_id(evm_address) + } + } + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< Block, Balance, @@ -1936,11 +2325,11 @@ impl_runtime_apis! { fn decode_session_keys( encoded: Vec, ) -> Option, sp_core::crypto::KeyTypeId)>> { - SessionKeys::decode_into_raw_public_keys(&encoded) + opaque::SessionKeys::decode_into_raw_public_keys(&encoded) } fn generate_session_keys(seed: Option>) -> Vec { - SessionKeys::generate(seed) + opaque::SessionKeys::generate(seed) } } @@ -1961,8 +2350,9 @@ impl_runtime_apis! { } impl bifrost_flexible_fee_rpc_runtime_api::FlexibleFeeRuntimeApi for Runtime { - fn get_fee_token_and_amount(who: AccountId, fee: Balance, utx: ::Extrinsic) -> (CurrencyId, Balance) { - let call = utx.function; + fn get_fee_token_and_amount(who: AccountId, fee: Balance,utx: ::Extrinsic) -> (CurrencyId, Balance) { + let call = utx.0.function; + let rs = FlexibleFee::cal_fee_token_and_amount(&who, fee, &call); match rs { diff --git a/runtime/bifrost-polkadot/src/xcm_config.rs b/runtime/bifrost-polkadot/src/xcm_config.rs index 49513b263..b9ba1c7ed 100644 --- a/runtime/bifrost-polkadot/src/xcm_config.rs +++ b/runtime/bifrost-polkadot/src/xcm_config.rs @@ -19,7 +19,8 @@ use super::*; use bifrost_asset_registry::AssetIdMaps; use bifrost_primitives::{ - AccountId, CurrencyId, CurrencyIdMapping, TokenSymbol, DOT_TOKEN_ID, GLMR_TOKEN_ID, + currency::WETH_TOKEN_ID, AccountId, CurrencyId, CurrencyIdMapping, TokenSymbol, DOT_TOKEN_ID, + GLMR_TOKEN_ID, }; pub use bifrost_xcm_interface::traits::{parachains, XcmBaseWeight}; use cumulus_primitives_core::AggregateMessageOrigin; @@ -56,7 +57,7 @@ use bifrost_runtime_common::currency_adapter::{ BifrostDropAssets, DepositToAlternative, MultiCurrencyAdapter, }; use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling}; -use xcm::v4::{prelude::*, Asset, AssetId, InteriorLocation, Location}; +use xcm::v4::{Asset, AssetId, InteriorLocation, Location}; /// Bifrost Asset Matcher pub struct BifrostAssetMatcher( @@ -512,7 +513,7 @@ impl> ContainsPair for NativeAssetFrom { parameter_types! { /// Location of Asset Hub pub AssetHubLocation: Location = (Parent, Parachain(1000)).into(); - pub EthereumLocation: Location = Location::new(2, [GlobalConsensus(Ethereum { chain_id: 1 })]); + pub EthereumLocation: Location = Location::new(2, [GlobalConsensus(NetworkId::Ethereum { chain_id: 1 })]); } pub struct XcmConfig; @@ -659,6 +660,7 @@ impl bifrost_currencies::Config for Runtime { parameter_type_with_key! { pub ExistentialDeposits: |currency_id: CurrencyId| -> Balance { match currency_id { + &CurrencyId::Token2(WETH_TOKEN_ID) => 15_000_000_000_000, // 0.000015 WETH &CurrencyId::Native(TokenSymbol::BNC) => 10 * milli::(NativeCurrencyId::get()), // 0.01 BNC &CurrencyId::Token2(DOT_TOKEN_ID) => 1_000_000, // DOT &CurrencyId::LPToken(..) => 1 * micro::(NativeCurrencyId::get()), diff --git a/runtime/common/Cargo.toml b/runtime/common/Cargo.toml index 359d7a842..7937f5f93 100644 --- a/runtime/common/Cargo.toml +++ b/runtime/common/Cargo.toml @@ -24,6 +24,9 @@ sp-version = { workspace = true } sp-consensus-aura = { workspace = true } sp-arithmetic = { workspace = true } sp-io = { workspace = true } +num-traits = { workspace = true } +scale-info = { workspace = true } +serde = { workspace = true } # frame dependencies frame-executive = { workspace = true } @@ -38,6 +41,7 @@ pallet-scheduler = { workspace = true } pallet-treasury = { workspace = true } pallet-democracy = { workspace = true } pallet-multisig = { workspace = true } +pallet-traits = { workspace = true } # Cumulus dependencies cumulus-pallet-parachain-system = { workspace = true } @@ -93,6 +97,7 @@ std = [ "pallet-democracy/std", "pallet-multisig/std", "pallet-membership/std", + "pallet-traits/std", "pallet-utility/std", "pallet-treasury/std", "pallet-scheduler/std", diff --git a/runtime/common/src/lib.rs b/runtime/common/src/lib.rs index 6de8cf11c..9c5a0b7c7 100644 --- a/runtime/common/src/lib.rs +++ b/runtime/common/src/lib.rs @@ -31,6 +31,10 @@ use sp_runtime::{traits::Bounded, FixedPointNumber, Perquintill}; pub mod constants; pub mod currency_adapter; +pub mod price; +pub mod ratio; + +pub use ratio::Ratio; #[cfg(test)] mod tests; diff --git a/runtime/common/src/price.rs b/runtime/common/src/price.rs new file mode 100644 index 000000000..9b0747d18 --- /dev/null +++ b/runtime/common/src/price.rs @@ -0,0 +1,107 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use frame_support::{ + pallet_prelude::Get, + traits::tokens::{Fortitude, Preservation}, +}; +use sp_runtime::{helpers_128bit::multiply_by_rational_with_rounding, traits::Convert, Rounding}; +use sp_std::marker::PhantomData; +use xcm::latest::Weight; + +use bifrost_primitives::{ + AccountFeeCurrency, AccountFeeCurrencyBalanceInCurrency, Balance, CurrencyId, PriceProvider, +}; +use pallet_traits::PriceFeeder; + +use crate::Ratio; + +pub struct OraclePriceProvider(PhantomData); + +impl PriceProvider for OraclePriceProvider +where + PF: PriceFeeder, +{ + type Price = Ratio; + + fn get_price(asset_a: CurrencyId, asset_b: CurrencyId) -> Option { + if let Some(a) = PF::get_normal_price(&asset_a) { + if let Some(b) = PF::get_normal_price(&asset_b) { + Some(Ratio::from((a, b))) + } else { + None + } + } else { + None + } + } +} + +pub struct FeeAssetBalanceInCurrency(PhantomData<(T, C, AC, I)>); + +impl AccountFeeCurrencyBalanceInCurrency + for FeeAssetBalanceInCurrency +where + T: frame_system::Config, + C: Convert<(CurrencyId, CurrencyId, Balance), Option<(Balance, Ratio)>>, + AC: AccountFeeCurrency, + I: frame_support::traits::fungibles::Inspect< + T::AccountId, + AssetId = CurrencyId, + Balance = Balance, + >, +{ + type Output = (Balance, Weight); + + fn get_balance_in_currency(to_currency: CurrencyId, account: &T::AccountId) -> Self::Output { + let from_currency = AC::get(account); + let account_balance = + I::reducible_balance(from_currency, account, Preservation::Preserve, Fortitude::Polite); + let price_weight = T::DbWeight::get().reads(2); // 1 read to get currency and 1 read to get balance + + if from_currency == to_currency { + return (account_balance, price_weight); + } + + let Some((converted, _)) = C::convert((from_currency, to_currency, account_balance)) else { + return (0, price_weight); + }; + (converted, price_weight) + } +} + +pub struct ConvertAmount

(PhantomData

); + +// Converts `amount` of `from_currency` to `to_currency` using given oracle +// Input: (from_currency, to_currency, amount) +// Output: Option<(converted_amount, price)> +impl

Convert<(CurrencyId, CurrencyId, Balance), Option<(Balance, Ratio)>> for ConvertAmount

+where + P: PriceProvider, +{ + fn convert( + (from_currency, to_currency, amount): (CurrencyId, CurrencyId, Balance), + ) -> Option<(Balance, Ratio)> { + if from_currency == to_currency { + return Some((amount, Ratio::one())); + } + let price = P::get_price(from_currency, to_currency)?; + let converted = multiply_by_rational_with_rounding(amount, price.n, price.d, Rounding::Up)?; + Some((converted, price)) + } +} diff --git a/runtime/common/src/ratio.rs b/runtime/common/src/ratio.rs new file mode 100644 index 000000000..01022e8e7 --- /dev/null +++ b/runtime/common/src/ratio.rs @@ -0,0 +1,154 @@ +// This file is part of Bifrost. + +// Copyright (C) Liebi Technologies PTE. LTD. +// SPDX-License-Identifier: GPL-3.0-or-later WITH Classpath-exception-2.0 + +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . + +use core::cmp::{Ord, Ordering, PartialOrd}; +use num_traits::Zero; +use parity_scale_codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; +use serde::{Deserialize, Serialize}; +use sp_arithmetic::helpers_128bit; + +/// A rational number represented by a `n`umerator and `d`enominator. +#[derive( + Clone, + Copy, + Default, + PartialEq, + Eq, + Encode, + Decode, + Serialize, + Deserialize, + TypeInfo, + MaxEncodedLen, +)] +pub struct Ratio { + pub n: u128, + pub d: u128, +} + +impl Ratio { + /// Build from a raw `n/d`. Ensures that `d > 0`. + pub const fn new(n: u128, d: u128) -> Self { + // reimplement `.max(1)` so this can be `const` + let d = if d > 0 { d } else { 1 }; + Self { n, d } + } + + /// Build from a raw `n/d`. This could lead to / 0 if not properly handled. + pub const fn new_unchecked(n: u128, d: u128) -> Self { + Self { n, d } + } + + /// Return a representation of one. + /// + /// Note that more than one combination of `n` and `d` can be one. + pub const fn one() -> Self { + Self::new_unchecked(1, 1) + } + + /// Return whether `self` is one. + /// + /// Should a denominator of 0 happen, this function will return `false`. + /// + /// Note that more than one combination of `n` and `d` can be one. + pub const fn is_one(&self) -> bool { + self.d > 0 && self.n == self.d + } + + /// Return a representation of zero. + /// + /// Note that any combination of `n == 0` and `d` represents zero. + pub const fn zero() -> Self { + Self::new_unchecked(0, 1) + } + + /// Return whether `self` is zero. + /// + /// Note that any combination of `n == 0` and `d` represents zero. + pub const fn is_zero(&self) -> bool { + self.n == 0 + } + + /// Invert `n/d` to `d/n`. + /// + /// NOTE: Zero inverts to zero. + pub const fn inverted(self) -> Self { + if self.is_zero() { + self + } else { + Self { n: self.d, d: self.n } + } + } +} + +impl From for (u128, u128) { + fn from(ratio: Ratio) -> (u128, u128) { + (ratio.n, ratio.d) + } +} + +impl From for Ratio { + fn from(n: u128) -> Self { + Self::new(n, 1) + } +} + +impl From<(u128, u128)> for Ratio { + fn from((n, d): (u128, u128)) -> Self { + Self::new(n, d) + } +} + +impl PartialOrd for Ratio { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + +// Taken from Substrate's `Rational128`. +impl Ord for Ratio { + fn cmp(&self, other: &Self) -> Ordering { + if self.d == other.d { + self.n.cmp(&other.n) + } else if self.d.is_zero() { + Ordering::Greater + } else if other.d.is_zero() { + Ordering::Less + } else { + let self_n = helpers_128bit::to_big_uint(self.n) * helpers_128bit::to_big_uint(other.d); + let other_n = + helpers_128bit::to_big_uint(other.n) * helpers_128bit::to_big_uint(self.d); + self_n.cmp(&other_n) + } + } +} + +#[cfg(feature = "std")] +impl sp_std::fmt::Debug for Ratio { + fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result { + write!(f, "Ratio({} / {} ≈ {:.8})", self.n, self.d, self.n as f64 / self.d as f64) + } +} + +#[cfg(not(feature = "std"))] +impl sp_std::fmt::Debug for Ratio { + fn fmt(&self, f: &mut sp_std::fmt::Formatter<'_>) -> sp_std::fmt::Result { + write!(f, "Ratio({} / {})", self.n, self.d) + } +} From 3f569ff7e076410ba6be419bd2bd85abd9d82b0e Mon Sep 17 00:00:00 2001 From: NingBo Wang <2536935847@qq.com> Date: Thu, 1 Aug 2024 10:26:25 +0800 Subject: [PATCH 22/22] Fix try-runtime (#1323) --- runtime/bifrost-kusama/src/lib.rs | 8 ++++++++ runtime/bifrost-polkadot/Cargo.toml | 6 ++++++ runtime/bifrost-polkadot/src/lib.rs | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/runtime/bifrost-kusama/src/lib.rs b/runtime/bifrost-kusama/src/lib.rs index 9118a5d5b..acd0f4505 100644 --- a/runtime/bifrost-kusama/src/lib.rs +++ b/runtime/bifrost-kusama/src/lib.rs @@ -1957,6 +1957,11 @@ parameter_types! { pub const CallSwitchgearPalletName: &'static str = "CallSwitchgear"; } +impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { + // This must be the same as the `ChannelInfo` from the `Config`: + type ChannelList = ParachainSystem; +} + /// All migrations that will run on the next runtime upgrade. /// /// This contains the combined migrations of the last 10 releases. It allows to skip runtime @@ -1970,10 +1975,13 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( + // permanent migration, do not remove + pallet_xcm::migration::MigrateToLatestXcmVersion, frame_support::migrations::RemovePallet< CallSwitchgearPalletName, ::DbWeight, >, + cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, ); } diff --git a/runtime/bifrost-polkadot/Cargo.toml b/runtime/bifrost-polkadot/Cargo.toml index 21863a436..a1c48358f 100644 --- a/runtime/bifrost-polkadot/Cargo.toml +++ b/runtime/bifrost-polkadot/Cargo.toml @@ -414,6 +414,12 @@ try-runtime = [ "pallet-whitelist/try-runtime", "parachain-info/try-runtime", "zenlink-protocol/try-runtime", + "fp-self-contained/try-runtime", + "pallet-ethereum/try-runtime", + "pallet-evm-accounts/try-runtime", + "pallet-evm/try-runtime", + "pallet-evm-chain-id/try-runtime", + "pallet-dynamic-fee/try-runtime", ] # Enable the metadata hash generation in the wasm builder. diff --git a/runtime/bifrost-polkadot/src/lib.rs b/runtime/bifrost-polkadot/src/lib.rs index e837eea06..ef385bce4 100644 --- a/runtime/bifrost-polkadot/src/lib.rs +++ b/runtime/bifrost-polkadot/src/lib.rs @@ -1861,6 +1861,11 @@ parameter_types! { pub const CallSwitchgearPalletName: &'static str = "CallSwitchgear"; } +impl cumulus_pallet_xcmp_queue::migration::v5::V5Config for Runtime { + // This must be the same as the `ChannelInfo` from the `Config`: + type ChannelList = ParachainSystem; +} + /// All migrations that will run on the next runtime upgrade. /// /// This contains the combined migrations of the last 10 releases. It allows to skip runtime @@ -1874,10 +1879,13 @@ pub mod migrations { /// Unreleased migrations. Add new ones here: pub type Unreleased = ( + // permanent migration, do not remove + pallet_xcm::migration::MigrateToLatestXcmVersion, frame_support::migrations::RemovePallet< CallSwitchgearPalletName, ::DbWeight, >, + cumulus_pallet_xcmp_queue::migration::v5::MigrateV4ToV5, ); }