From b7cd6f5f44e525b3966b017476d0d727f930fd96 Mon Sep 17 00:00:00 2001 From: f-gate Date: Wed, 26 Feb 2025 19:12:10 +0100 Subject: [PATCH 01/38] pull over relevant files --- pallets/api/src/messaging/mod.rs | 655 ++++++++++++++++++ pallets/api/src/messaging/transports/ismp.rs | 254 +++++++ pallets/api/src/messaging/transports/mod.rs | 4 + pallets/api/src/messaging/transports/xcm.rs | 14 + pop-api/examples/messaging/Cargo.toml | 22 + pop-api/examples/messaging/lib.rs | 268 +++++++ .../contracts/messaging/Cargo.toml | 22 + .../contracts/messaging/lib.rs | 193 ++++++ pop-api/integration-tests/src/messaging.rs | 504 ++++++++++++++ runtime/devnet/src/config/api/mod.rs | 115 +++ runtime/devnet/src/config/ismp.rs | 18 +- 11 files changed, 2062 insertions(+), 7 deletions(-) create mode 100644 pallets/api/src/messaging/mod.rs create mode 100644 pallets/api/src/messaging/transports/ismp.rs create mode 100644 pallets/api/src/messaging/transports/mod.rs create mode 100644 pallets/api/src/messaging/transports/xcm.rs create mode 100755 pop-api/examples/messaging/Cargo.toml create mode 100755 pop-api/examples/messaging/lib.rs create mode 100755 pop-api/integration-tests/contracts/messaging/Cargo.toml create mode 100755 pop-api/integration-tests/contracts/messaging/lib.rs create mode 100644 pop-api/integration-tests/src/messaging.rs diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs new file mode 100644 index 000000000..4ec8019f3 --- /dev/null +++ b/pallets/api/src/messaging/mod.rs @@ -0,0 +1,655 @@ +//! TODO: pallet docs. + +use codec::{Decode, Encode}; +use frame_support::{ + dispatch::{DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, + pallet_prelude::MaxEncodedLen, + storage::KeyLenOf, + traits::{ + fungible::Inspect, + tokens::{fungible::hold::Mutate, Precision::Exact}, + Get, OriginTrait, + }, +}; +use frame_system::pallet_prelude::*; +pub use pallet::*; +use scale_info::TypeInfo; +use sp_core::H256; +use sp_runtime::{traits::Saturating, BoundedVec, SaturatedConversion}; +use sp_std::vec::Vec; +use transports::{ + ismp::{self as ismp, FeeMetadata, IsmpDispatcher}, + xcm::{self as xcm, Location, QueryId}, +}; +pub use xcm::NotifyQueryHandler; +use xcm::Response; + +use super::Weight; + +/// Messaging transports. +pub mod transports; + +type AccountIdOf = ::AccountId; +type BlockNumberOf = BlockNumberFor; +type BalanceOf = <::Deposit as Inspect>>::Balance; +pub type MessageId = u64; + +#[frame_support::pallet] +pub mod pallet { + + use frame_support::{ + dispatch::DispatchResult, + pallet_prelude::*, + storage::KeyLenOf, + traits::tokens::{fungible::hold::Mutate, Precision::Exact}, + }; + use sp_core::H256; + use sp_runtime::traits::TryConvert; + + use super::*; + + /// Configuration of the pallet by specifying the parameters and types on which it depends. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Because this pallet emits events, it depends on the runtime's definition of an event. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + type OriginConverter: TryConvert; + + #[pallet::constant] + type ByteFee: Get>; + + type Callback: CallbackT; + + /// The deposit mechanism. + type Deposit: Mutate + + Inspect; + + #[pallet::constant] + type IsmpByteFee: Get>; + + /// The ISMP message dispatcher. + type IsmpDispatcher: IsmpDispatcher>; + + /// The maximum length of any additional application-specific metadata relating to a + /// request. + #[pallet::constant] + type MaxContextLen: Get; + /// The maximum length of outbound (posted) data. + #[pallet::constant] + type MaxDataLen: Get; + #[pallet::constant] + type MaxKeys: Get; + #[pallet::constant] + type MaxKeyLen: Get; + + #[pallet::constant] + type MaxResponseLen: Get; + #[pallet::constant] + type MaxRemovals: Get; + + /// Overarching hold reason. + type RuntimeHoldReason: From; + + type Xcm: NotifyQueryHandler; + + type XcmResponseOrigin: EnsureOrigin; + } + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::storage] + pub(super) type Messages = StorageDoubleMap< + _, + Blake2_128Concat, + T::AccountId, + Blake2_128Concat, + MessageId, + Message, + OptionQuery, + >; + + #[pallet::storage] + pub(super) type IsmpRequests = + StorageMap<_, Identity, H256, (T::AccountId, MessageId), OptionQuery>; + + #[pallet::storage] + pub(super) type XcmQueries = + StorageMap<_, Identity, QueryId, (T::AccountId, MessageId), OptionQuery>; + + /// The events that can be emitted. + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// A GET has been dispatched via ISMP. + IsmpGetDispatched { + /// The origin of the request. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The ISMP request commitment. + commitment: H256, + /// An optional callback to be used to return the response. + callback: Option, + }, + /// A response to a GET has been received via ISMP. + IsmpGetResponseReceived { + /// The destination of the response. + dest: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The ISMP request commitment. + commitment: H256, + }, + /// A POST has been dispatched via ISMP. + IsmpPostDispatched { + /// The origin of the request. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The ISMP request commitment. + commitment: H256, + /// An optional callback to be used to return the response. + callback: Option, + }, + /// A response to a POST has been received via ISMP. + IsmpPostResponseReceived { + /// The destination of the response. + dest: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The ISMP request commitment. + commitment: H256, + }, + /// A XCM query has been created. + XcmQueryCreated { + /// The origin of the request. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The identifier of the created XCM query. + query_id: QueryId, + /// An optional callback to be used to return the response. + callback: Option, + }, + /// A response to a XCM query has been received. + XcmResponseReceived { + /// The destination of the response. + dest: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The identifier of the XCM query. + query_id: QueryId, + /// The query response. + response: Response, + }, + /// A callback has been executed successfully. + CallbackExecuted { + /// The origin of the callback. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The successful callback. + callback: Callback, + }, + /// A callback has failed. + CallbackFailed { + /// The origin of the callback. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The callback which failed. + callback: Callback, + post_info: PostDispatchInfo, + /// The error which occurred. + error: DispatchError, + }, + /// One or more messages have been removed for the origin. + Removed { + /// The origin of the messages. + origin: T::AccountId, + /// The messages which were removed. + messages: Vec, + }, + } + + #[pallet::error] + pub enum Error { + DispatchFailed, + InvalidMessage, + InvalidQuery, + OriginConversionFailed, + MessageExists, + RequestPending, + } + + /// A reason for the pallet placing a hold on funds. + #[pallet::composite_enum] + pub enum HoldReason { + /// Held for the duration of a message's lifespan. + #[codec(index = 0)] + Messaging, + } + + #[pallet::call] + impl Pallet { + #[pallet::call_index(0)] + #[pallet::weight(Weight::zero())] // todo: benchmarking after consolidating storage + pub fn send(_origin: OriginFor, _id: MessageId) -> DispatchResult { + // e.g. Message::StateQuery { dest: Parachain(1000), storage_keys: vec![] } + // e.g. Message::Transact { dest: Parachain(1000), call: vec![] } + todo!("Reserved for messaging abstractions") + } + + // TODO: does ismp allow querying to ensure that specified para id is supported? + #[pallet::call_index(1)] + #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage + // Add any additional gas limit specified for callback execution + .saturating_add(callback.map(|cb| { + T::Callback::weight().saturating_add(cb.weight) + }).unwrap_or_default()) + )] + pub fn ismp_get( + origin: OriginFor, + id: MessageId, + message: ismp::Get, + fee: BalanceOf, + callback: Option, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + // Calculate deposit and place on hold. + let deposit = Self::calculate_deposit( + message.calculate_deposit() + + // IsmpRequests + (KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len()) + .saturated_into::>() * + T::ByteFee::get(), + ); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + + // Process message by dispatching request via ISMP. + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + let commitment = T::IsmpDispatcher::default() + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) + .map_err(|_| Error::::DispatchFailed)?; + + // Store commitment for lookup on response, message for querying, response/timeout + // handling. + IsmpRequests::::insert(&commitment, (&origin, id)); + Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); + Pallet::::deposit_event(Event::::IsmpGetDispatched { + origin, + id, + commitment, + callback, + }); + Ok(()) + } + + // TODO: does ismp allow querying to ensure that specified para id is supported? + #[pallet::call_index(2)] + #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage + // Add any additional gas limit specified for callback execution + .saturating_add(callback.map(|cb| { + T::Callback::weight().saturating_add(cb.weight) + }).unwrap_or_default()) + )] + pub fn ismp_post( + origin: OriginFor, + id: MessageId, + message: ismp::Post, + fee: BalanceOf, + callback: Option, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + // Calculate deposit and place on hold. + let deposit = Self::calculate_deposit( + message.calculate_deposit() + + // IsmpRequests + (KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len()) + .saturated_into::>() * + T::ByteFee::get(), + ); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + + // Process message by dispatching request via ISMP. + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + let commitment = T::IsmpDispatcher::default() + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) + .map_err(|_| Error::::DispatchFailed)?; + + // Store commitment for lookup on response, message for querying, response/timeout + // handling. + IsmpRequests::::insert(&commitment, (&origin, id)); + Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); + Pallet::::deposit_event(Event::::IsmpPostDispatched { + origin, + id, + commitment, + callback, + }); + Ok(()) + } + + #[pallet::call_index(3)] + #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage + // Add any additional gas limit specified for callback execution + .saturating_add(callback.map(|cb| { + T::Callback::weight().saturating_add(cb.weight) + }).unwrap_or_default()) + // TODO: add weight of xcm_response dispatchable once benchmarked + )] + pub fn xcm_new_query( + origin: OriginFor, + id: u64, + responder: Location, + timeout: BlockNumberOf, + callback: Option, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + // Calculate deposit and place on hold. + let deposit = Self::calculate_deposit( + // XcmQueries + (KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len() + + Option::::max_encoded_len()) + .saturated_into::>() * + T::ByteFee::get(), + ); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + + // Process message by creating new query via XCM. + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + // Xcm only uses/stores pallet, index - i.e. (u8,u8) + let notify = Call::::xcm_response { query_id: 0, response: Default::default() }; + let querier = T::OriginConverter::try_convert(T::RuntimeOrigin::signed(origin.clone())) + .map_err(|_| Error::::OriginConversionFailed)?; + let query_id = T::Xcm::new_notify_query(responder, notify, timeout, querier); + + // Store query id for later lookup on response, message for querying status, + // response/timeout handling. + XcmQueries::::insert(&query_id, (&origin, id)); + Messages::::insert(&origin, id, Message::XcmQuery { query_id, callback, deposit }); + Pallet::::deposit_event(Event::::XcmQueryCreated { + origin, + id, + query_id, + callback, + }); + Ok(()) + } + + // NOTE: dispatchable should not fail, otherwise response will be lost. + #[pallet::call_index(4)] + #[pallet::weight(Weight::zero())] // todo: benchmarking + pub fn xcm_response( + origin: OriginFor, + query_id: QueryId, + response: Response, + ) -> DispatchResult { + T::XcmResponseOrigin::ensure_origin(origin)?; + + // Lookup message from query id. + let (origin, id) = XcmQueries::::take(query_id).ok_or(Error::::InvalidQuery)?; + let Some(Message::XcmQuery { query_id, callback, deposit }) = + Messages::::get(&origin, &id) + else { + return Err(Error::::InvalidMessage.into()) + }; + + // Attempt callback with response if specified. + if let Some(callback) = callback { + log::debug!(target: "pop-api::extension", "xcm callback={:?}, response={:?}", callback, response); + if Self::call(origin.clone(), callback, id, &response, deposit).is_ok() { + Self::deposit_event(Event::::XcmResponseReceived { + dest: origin, + id, + query_id, + response, + }); + return Ok(()); + } + } + + // Otherwise store response for manual retrieval and removal. + Messages::::insert( + &origin, + &id, + Message::XcmResponse { query_id, response: response.clone(), deposit }, + ); + Self::deposit_event(Event::::XcmResponseReceived { + dest: origin, + id, + query_id, + response, + }); + Ok(()) + } + + // Remove a request/response, returning any deposit previously taken. + #[pallet::call_index(5)] + #[pallet::weight(Weight::zero())] // todo: benchmarking after consolidating storage + pub fn remove( + origin: OriginFor, + messages: BoundedVec, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + for id in &messages { + // Ensure request exists and is not pending. + let deposit = match Messages::::take(&origin, id) { + Some(message) => match message { + Message::Ismp { .. } | Message::XcmQuery { .. } => { + return Err(Error::::RequestPending.into()); + }, + Message::IsmpResponse { commitment, deposit, .. } => { + IsmpRequests::::remove(commitment); + deposit + }, + Message::XcmResponse { query_id, deposit, .. } => { + XcmQueries::::remove(query_id); + deposit + }, + Message::IsmpTimedOut { .. } => { + todo!() + }, + }, + None => { + return Err(Error::::InvalidMessage.into()); + }, + }; + // Return deposit. + T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; + } + Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); + Ok(()) + } + } +} + +impl Pallet { + // Calculate the deposit required for a particular message. + fn calculate_deposit(deposit: BalanceOf) -> BalanceOf { + // Add amount for `Messages` key and value + deposit.saturating_add( + (KeyLenOf::>::get().saturated_into::>() + + Message::::max_encoded_len().saturated_into::>()) * + T::ByteFee::get(), + ) + } + + // Attempt to notify via callback. + fn call( + origin: AccountIdOf, + callback: Callback, + id: MessageId, + data: &impl Encode, + deposit: BalanceOf, + ) -> DispatchResult { + // TODO: check weight removed from block weight - may need dispatching via executive + // instead + let result = T::Callback::execute( + origin.clone(), + [callback.selector.to_vec(), (id, data).encode()].concat(), + callback.weight, + ); + log::debug!(target: "pop-api::extension", "callback weight={:?}, result={result:?}", callback.weight); + match result { + Ok(_post_info) => { + // TODO: do something with post_info: e.g. refund unused weight + // Return deposit. + T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; + Messages::::remove(&origin, &id); + Self::deposit_event(Event::::CallbackExecuted { + origin: origin.clone(), + id, + callback, + }); + Self::deposit_event(Event::::Removed { + origin: origin.clone(), + messages: [id].to_vec(), + }); + Ok(()) + }, + Err(sp_runtime::DispatchErrorWithPostInfo:: { post_info, error }) => { + // Fallback to storing the message for polling - pre-paid weight is lost. + Self::deposit_event(Event::::CallbackFailed { + origin: origin.clone(), + id, + callback, + post_info, + error, + }); + // TODO: logging + Err(error) + }, + } + } +} + +#[derive(Clone, Decode, Debug, Encode, MaxEncodedLen, PartialEq, TypeInfo)] +pub enum Status { + Pending, + TimedOut, + Complete, +} + +#[derive(Encode, Decode, Debug, MaxEncodedLen)] +#[cfg_attr(feature = "std", derive(PartialEq, Clone))] +#[repr(u8)] +#[allow(clippy::unnecessary_cast)] +pub enum Read { + #[codec(index = 0)] + Poll((T::AccountId, MessageId)), + #[codec(index = 1)] + Get((T::AccountId, MessageId)), + #[codec(index = 2)] + QueryId((T::AccountId, MessageId)), +} + +#[derive(Debug)] +#[cfg_attr(feature = "std", derive(PartialEq, Clone))] +pub enum ReadResult { + Poll(Option), + Get(Option>), + QueryId(Option), +} + +impl ReadResult { + pub fn encode(&self) -> Vec { + use ReadResult::*; + match self { + Poll(status) => status.encode(), + Get(response) => response.encode(), + QueryId(query_id) => query_id.encode(), + } + } +} + +impl crate::Read for Pallet { + type Read = Read; + type Result = ReadResult; + + fn weight(_read: &Self::Read) -> Weight { + // TODO: implement benchmarks + Weight::zero() + } + + fn read(request: Self::Read) -> Self::Result { + match request { + Read::Poll(request) => + ReadResult::Poll(Messages::::get(request.0, request.1).map(|m| match m { + Message::Ismp { .. } | Message::XcmQuery { .. } => Status::Pending, + Message::IsmpTimedOut { .. } => Status::TimedOut, + Message::IsmpResponse { .. } | Message::XcmResponse { .. } => Status::Complete, + })), + Read::Get(request) => + ReadResult::Get(Messages::::get(request.0, request.1).and_then(|m| match m { + Message::IsmpResponse { response, .. } => Some(response.into_inner()), + Message::XcmResponse { response, .. } => Some(response.encode()), + _ => None, + })), + Read::QueryId(request) => ReadResult::QueryId( + Messages::::get(request.0, request.1).and_then(|m| match m { + Message::XcmQuery { query_id, .. } | Message::XcmResponse { query_id, .. } => + Some(query_id), + _ => None, + }), + ), + } + } +} + +trait CalculateDeposit { + fn calculate_deposit(&self) -> Deposit; +} + +#[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +#[scale_info(skip_type_params(T))] +enum Message { + Ismp { + commitment: H256, + callback: Option, + deposit: BalanceOf, + }, + IsmpTimedOut { + commitment: H256, + deposit: BalanceOf, + }, + IsmpResponse { + commitment: H256, + deposit: BalanceOf, + response: BoundedVec, + }, + XcmQuery { + query_id: QueryId, + callback: Option, + deposit: BalanceOf, + }, + XcmResponse { + query_id: QueryId, + deposit: BalanceOf, + response: Response, + }, +} + +// Message selector and pre-paid weight used as gas limit +#[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +pub struct Callback { + pub selector: [u8; 4], + pub weight: Weight, +} + +pub trait CallbackT { + fn execute(account: T::AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo; + + fn weight() -> Weight; +} diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs new file mode 100644 index 000000000..5f179a15b --- /dev/null +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -0,0 +1,254 @@ +use core::marker::PhantomData; + +pub(crate) use ::ismp::dispatcher::{FeeMetadata, IsmpDispatcher}; +use ::ismp::{ + dispatcher::{ + DispatchGet, + DispatchRequest::{self}, + }, + host::StateMachine, +}; +use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::{ + pallet_prelude::Weight, traits::Get as _, CloneNoBound, DebugNoBound, EqNoBound, + PartialEqNoBound, +}; +use ismp::{ + dispatcher::DispatchPost, + module::IsmpModule, + router::{GetResponse, PostRequest, PostResponse, Request::*, Response, Timeout}, + Error, +}; +use pallet_ismp::weights::IsmpModuleWeight; +use scale_info::TypeInfo; +use sp_core::{keccak_256, H256}; +use sp_runtime::{BoundedVec, SaturatedConversion, Saturating}; + +use crate::messaging::{ + pallet::{Config, Event, IsmpRequests, Messages, Pallet}, + AccountIdOf, BalanceOf, CalculateDeposit, MessageId, Vec, +}; + +pub const ID: [u8; 3] = *b"pop"; + +type DbWeightOf = ::DbWeight; + +#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo)] +#[scale_info(skip_type_params(T))] +pub enum Message { + Get(Get), + Post(Post), +} + +impl From> for DispatchRequest { + fn from(value: Message) -> Self { + match value { + Message::Get(get) => get.into(), + Message::Post(post) => post.into(), + } + } +} + +#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo)] +#[scale_info(skip_type_params(T))] +pub struct Get { + // TODO: Option to support relay? + pub(crate) dest: u32, + pub(crate) height: u32, + pub(crate) timeout: u64, + pub(crate) context: BoundedVec, + pub(crate) keys: BoundedVec, T::MaxKeys>, +} + +impl From> for DispatchGet { + fn from(value: Get) -> Self { + DispatchGet { + dest: StateMachine::Polkadot(value.dest), + from: ID.into(), + keys: value.keys.into_iter().map(|key| key.into_inner()).collect(), + height: value.height.into(), + context: value.context.into_inner(), + timeout: value.timeout, + } + } +} + +impl From> for DispatchRequest { + fn from(value: Get) -> Self { + DispatchRequest::Get(value.into()) + } +} + +impl CalculateDeposit> for Get { + fn calculate_deposit(&self) -> BalanceOf { + let len = self.dest.encoded_size() + + self.height.encoded_size() + + self.timeout.encoded_size() + + self.context.len() + + self.keys.iter().map(|k| k.len()).sum::(); + calculate_deposit::(T::IsmpByteFee::get() * len.saturated_into()) + } +} + +#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo)] +#[scale_info(skip_type_params(T))] +pub struct Post { + // TODO: Option to support relay? + pub(crate) dest: u32, + pub(crate) timeout: u64, + pub(crate) data: BoundedVec, +} + +impl From> for DispatchPost { + fn from(value: Post) -> Self { + DispatchPost { + dest: StateMachine::Polkadot(value.dest), + from: ID.into(), + to: ID.into(), + timeout: value.timeout, + body: value.data.into_inner(), + } + } +} + +impl From> for DispatchRequest { + fn from(value: Post) -> Self { + DispatchRequest::Post(value.into()) + } +} + +impl CalculateDeposit> for Post { + fn calculate_deposit(&self) -> BalanceOf { + let len = self.dest.encoded_size() + self.timeout.encoded_size() + self.data.len(); + calculate_deposit::(T::IsmpByteFee::get() * len.saturated_into()) + } +} + +pub struct Handler(PhantomData); +impl Handler { + pub fn new() -> Self { + Self(PhantomData) + } +} + +impl IsmpModule for Handler { + fn on_accept(&self, _request: PostRequest) -> Result<(), Error> { + todo!() + } + + fn on_response(&self, response: Response) -> Result<(), Error> { + // Hash request to determine key for message lookup. + match response { + Response::Get(GetResponse { get, values }) => { + log::debug!(target: "pop-api::extension", "StorageValue={:?}", values[0]); + let commitment = H256::from(keccak_256(&ismp::router::Request::Get(get).encode())); + process_response( + &commitment, + &values, + || values.encode(), + |dest, id| Event::::IsmpGetResponseReceived { dest, id, commitment }, + ) + }, + Response::Post(PostResponse { post, response, .. }) => { + let commitment = H256::from(keccak_256(&Post(post).encode())); + process_response( + &commitment, + &response, + || response.clone(), // TODO: resolve unnecessary clone + |dest, id| Event::::IsmpPostResponseReceived { dest, id, commitment }, + ) + }, + } + } + + fn on_timeout(&self, timeout: Timeout) -> Result<(), Error> { + match timeout { + Timeout::Request(request) => { + // hash request to determine key for original request id lookup + let id = match request { + Get(get) => H256::from(keccak_256(&get.encode())), + Post(post) => H256::from(keccak_256(&post.encode())), + }; + let key = + IsmpRequests::::get(id).ok_or(Error::Custom("request not found".into()))?; + Messages::::try_mutate(key.0, key.1, |message| { + let Some(super::super::Message::Ismp { commitment, deposit, .. }) = message + else { + return Err(Error::Custom("message not found".into())) + }; + *message = Some(super::super::Message::IsmpTimedOut { + deposit: *deposit, + commitment: *commitment, + }); + Ok(()) + })?; + Ok(()) + }, + Timeout::Response(_response) => { + todo!() + }, + } + } +} + +// TODO: replace with benchmarked weight functions +impl IsmpModuleWeight for Pallet { + fn on_accept(&self, _request: &PostRequest) -> Weight { + todo!() + } + + fn on_timeout(&self, _timeout: &Timeout) -> Weight { + DbWeightOf::::get().reads_writes(2, 1) + } + + fn on_response(&self, _response: &Response) -> Weight { + DbWeightOf::::get().reads_writes(2, 2) + } +} + +fn calculate_deposit(mut deposit: BalanceOf) -> BalanceOf { + // Add amount for `IsmpRequests` lookup. + let key_len: BalanceOf = + (T::AccountId::max_encoded_len() + MessageId::max_encoded_len()).saturated_into(); + deposit.saturating_accrue( + T::ByteFee::get() * (H256::max_encoded_len().saturated_into::>() + key_len), + ); + + deposit +} + +fn process_response( + commitment: &H256, + encode: &impl Encode, + store: impl Fn() -> Vec, + event: impl Fn(AccountIdOf, MessageId) -> Event, +) -> Result<(), Error> { + let (origin, id) = + IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; + + let Some(super::super::Message::Ismp { commitment, callback, deposit }) = + Messages::::get(&origin, &id) + else { + return Err(Error::Custom("message not found".into())) + }; + + // Attempt callback with result if specified. + if let Some(callback) = callback { + // TODO: check response length + if Pallet::::call(origin.clone(), callback, id, &encode, deposit).is_ok() { + Pallet::::deposit_event(event(origin, id)); + return Ok(()); + } + } + + // Otherwise store response for manual retrieval and removal. + let response: BoundedVec = + store().try_into().map_err(|_| Error::Custom("response exceeds max".into()))?; + Messages::::insert( + &origin, + &id, + super::super::Message::IsmpResponse { commitment, deposit, response }, + ); + Pallet::::deposit_event(event(origin, id)); + Ok(()) +} diff --git a/pallets/api/src/messaging/transports/mod.rs b/pallets/api/src/messaging/transports/mod.rs new file mode 100644 index 000000000..64f4712a9 --- /dev/null +++ b/pallets/api/src/messaging/transports/mod.rs @@ -0,0 +1,4 @@ +/// Messaging using the Interoperable State Machine Protocol (ISMP). +pub mod ismp; +/// Messaging using Polkadot's Cross-Consensus Messaging (XCM). +pub(crate) mod xcm; diff --git a/pallets/api/src/messaging/transports/xcm.rs b/pallets/api/src/messaging/transports/xcm.rs new file mode 100644 index 000000000..f230d0463 --- /dev/null +++ b/pallets/api/src/messaging/transports/xcm.rs @@ -0,0 +1,14 @@ +pub(crate) use xcm::latest::{Location, QueryId, Response}; + +use crate::messaging::{pallet::Call, BlockNumberOf, Config}; + +pub trait NotifyQueryHandler { + /// Attempt to create a new query ID and register it as a query that is yet to respond, and + /// which will call a dispatchable when a response happens. + fn new_notify_query( + responder: impl Into, + notify: Call, + timeout: BlockNumberOf, + match_querier: impl Into, + ) -> u64; +} diff --git a/pop-api/examples/messaging/Cargo.toml b/pop-api/examples/messaging/Cargo.toml new file mode 100755 index 000000000..d0a800b40 --- /dev/null +++ b/pop-api/examples/messaging/Cargo.toml @@ -0,0 +1,22 @@ +[package] +authors = [ "R0GUE " ] +edition = "2021" +name = "messaging" +version = "0.1.0" + +[dependencies] +ink = { git = "https://github.com/r0gue-io/ink", branch = "sub0", default-features = false } +polkavm-derive = "0.11.0" +pop-api = { path = "../../../pop-api", default-features = false, features = [ "messaging" ] } + +[lib] +path = "lib.rs" + +[features] +default = [ "std" ] +e2e-tests = [ ] +ink-as-dependency = [ ] +std = [ + "ink/std", + "pop-api/std", +] diff --git a/pop-api/examples/messaging/lib.rs b/pop-api/examples/messaging/lib.rs new file mode 100755 index 000000000..1f015e51b --- /dev/null +++ b/pop-api/examples/messaging/lib.rs @@ -0,0 +1,268 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +use ink::{ + env::hash::{Blake2x256, CryptoHash}, + prelude::vec::Vec, + scale::{Compact, Encode}, + xcm::{ + prelude::{ + AccountId32, All, Asset, Junction::Parachain, Location, OriginKind, QueryId, + QueryResponseInfo, Weight, WeightLimit, Xcm, XcmHash, + }, + DoubleEncoded, VersionedXcm, + }, +}; +use pop_api::{ + incentives, + messaging::{self as api, ismp, ismp::Get, xcm::Response, MessageId, Status}, + StatusCode, +}; + +pub type Result = core::result::Result; + +#[ink::contract] +mod messaging { + use pop_api::messaging::{ismp::StorageValue, Callback}; + + use super::*; + + const UNAUTHORIZED: u32 = u32::MAX; + + #[ink(storage)] + #[derive(Default)] + pub struct Messaging { + para: u32, + id: MessageId, + } + + impl Messaging { + #[ink(constructor, payable)] + pub fn new(para: u32) -> Result { + let instance = Self { para, id: 0 }; + incentives::register(instance.env().account_id())?; + Ok(instance) + } + + #[ink(message)] + pub fn get(&mut self, key: Vec, height: u32) -> Result<()> { + self.id = self.id.saturating_add(1); + ismp::get( + self.id, + Get::new(self.para, height, 0, Vec::default(), Vec::from([key.clone()])), + 0, + Some(Callback::to(0x57ad942b, Weight::from_parts(800_000_000, 500_000))), + )?; + self.env().emit_event(IsmpRequested { id: self.id, key, height }); + Ok(()) + } + + #[ink(message, payable)] + pub fn fund(&mut self) -> Result<()> { + let dest = Location::new(1, Parachain(self.para)); + + // Reserve transfer specified assets to contract account on destination. + let asset: Asset = (Location::parent(), self.env().transferred_value()).into(); + let beneficiary = hashed_account(4_001, self.env().account_id()); // todo: para id getter + let message: Xcm<()> = Xcm::builder_unsafe() + .withdraw_asset(asset.clone().into()) + .initiate_reserve_withdraw( + asset.clone().into(), + dest.clone(), + Xcm::builder_unsafe() + .buy_execution(asset.clone(), WeightLimit::Unlimited) + .deposit_asset( + All.into(), + Location::new(0, AccountId32 { network: None, id: beneficiary.0 }), + ) + .build(), + ) + .build(); + api::xcm::execute(&VersionedXcm::V4(message)).unwrap(); // todo: handle error + + self.env().emit_event(Funded { + account_id: beneficiary, + value: self.env().transferred_value(), + }); + Ok(()) + } + + #[ink(message, payable)] + pub fn transact(&mut self, call: DoubleEncoded<()>, weight: Weight) -> Result<()> { + let dest = Location::new(1, Parachain(self.para)); + + // Register a new query for receiving a response, used to report transact status. + self.id = self.id.saturating_add(1); + let query_id = api::xcm::new_query( + self.id, + dest.clone(), + self.env().block_number().saturating_add(100), + Some(Callback::to(0x641b0b03, Weight::from_parts(800_000_000, 500_000))), + )? + .unwrap(); // TODO: handle error + + // TODO: provide an api function for determining the local para id and max weight value + // for processing the reported transact status on the local chain. + let response = QueryResponseInfo { + // Route back to this parachain. + destination: Location::new(1, Parachain(4_001)), + query_id, + max_weight: Weight::from_parts(1_000_000, 5_000), + }; + + // Send transact message. + let fees: Asset = (Location::parent(), self.env().transferred_value()).into(); + let message: Xcm<()> = self._transact(call, weight, fees, response); + let hash = api::xcm::send(&dest.into_versioned(), &VersionedXcm::V4(message)).unwrap(); // todo: handle error + + self.env().emit_event(XcmRequested { id: self.id, query_id, hash }); + Ok(()) + } + + #[ink(message)] + pub fn complete(&mut self, id: MessageId) -> Result<()> { + if let Ok(Some(status)) = api::poll((self.env().account_id(), id)) { + if status == Status::Complete { + let result = api::get((self.env().account_id(), id))?; + api::remove([id].to_vec())?; + self.env().emit_event(Completed { id, result }); + } + } + Ok(()) + } + + fn _transact( + &self, + call: DoubleEncoded<()>, + weight: Weight, + fees: Asset, + response: QueryResponseInfo, + ) -> Xcm<()> { + let beneficiary = hashed_account(4_001, self.env().account_id()); // todo: para id getter + Xcm::builder_unsafe() + .withdraw_asset(fees.clone().into()) + .buy_execution(fees, WeightLimit::Unlimited) + .set_appendix( + Xcm::builder_unsafe() + .refund_surplus() + .deposit_asset( + All.into(), + Location::new(0, AccountId32 { network: None, id: beneficiary.0 }), + ) + .build(), + ) + .set_error_handler(Xcm::builder_unsafe().report_error(response.clone()).build()) + .transact(OriginKind::SovereignAccount, weight, call) + .report_transact_status(response) + .build() + } + } + + impl api::ismp::OnGetResponse for Messaging { + #[ink(message)] + fn on_response(&mut self, id: MessageId, values: Vec) -> pop_api::Result<()> { + if self.env().caller() != self.env().account_id() { + return Err(UNAUTHORIZED.into()) + } + self.env().emit_event(GetCompleted { id, values }); + Ok(()) + } + } + + impl api::xcm::OnResponse for Messaging { + #[ink(message)] + fn on_response(&mut self, id: MessageId, response: Response) -> Result<()> { + if self.env().caller() != self.env().account_id() { + return Err(UNAUTHORIZED.into()) + } + self.env().emit_event(XcmCompleted { id, result: response }); + Ok(()) + } + } + + #[ink::event] + pub struct IsmpRequested { + #[ink(topic)] + pub id: MessageId, + pub key: Vec, + pub height: BlockNumber, + } + + #[ink::event] + pub struct Funded { + #[ink(topic)] + pub account_id: AccountId, + pub value: Balance, + } + + #[ink::event] + pub struct XcmRequested { + #[ink(topic)] + pub id: MessageId, + #[ink(topic)] + pub query_id: QueryId, + #[ink(topic)] + pub hash: XcmHash, + } + + #[ink::event] + pub struct Completed { + #[ink(topic)] + pub id: MessageId, + pub result: Option>, + } + + #[ink::event] + pub struct XcmCompleted { + #[ink(topic)] + pub id: MessageId, + pub result: Response, + } + + #[ink::event] + pub struct GetCompleted { + #[ink(topic)] + pub id: MessageId, + pub values: Vec, + } + + // todo: make hasher generic and move to pop-api + fn hashed_account(para_id: u32, account_id: AccountId) -> AccountId { + let location = ( + b"SiblingChain", + Compact::::from(para_id), + (b"AccountId32", account_id.0).encode(), + ) + .encode(); + let mut output = [0u8; 32]; + Blake2x256::hash(&location, &mut output); + AccountId::from(output) + } + + #[cfg(test)] + mod tests { + + use super::*; + + #[ink::test] + fn default_works() { + Messaging::new(1_000); + } + + #[test] + fn it_works() { + let account_id: [u8; 32] = [ + 27, 2, 24, 17, 104, 5, 173, 98, 25, 32, 36, 0, 82, 159, 11, 212, 178, 11, 39, 219, + 14, 178, 226, 179, 216, 62, 19, 85, 226, 17, 80, 179, + ]; + let location = ( + b"SiblingChain", + Compact::::from(4001), + (b"AccountId32", account_id).encode(), + ) + .encode(); + let mut output = [0u8; 32]; + Blake2x256::hash(&location, &mut output); + println!("{output:?}") + } + } +} diff --git a/pop-api/integration-tests/contracts/messaging/Cargo.toml b/pop-api/integration-tests/contracts/messaging/Cargo.toml new file mode 100755 index 000000000..28aa1a4c6 --- /dev/null +++ b/pop-api/integration-tests/contracts/messaging/Cargo.toml @@ -0,0 +1,22 @@ +[package] +authors = [ "R0GUE " ] +edition = "2021" +name = "messaging" +version = "0.1.0" + +[dependencies] +ink = { git = "https://github.com/r0gue-io/ink", branch = "sub0", default-features = false } +polkavm-derive = "0.11.0" +pop-api = { path = "../../../../pop-api", default-features = false, features = [ "messaging" ] } + +[lib] +path = "lib.rs" + +[features] +default = [ "std" ] +e2e-tests = [ ] +ink-as-dependency = [ ] +std = [ + "ink/std", + "pop-api/std", +] diff --git a/pop-api/integration-tests/contracts/messaging/lib.rs b/pop-api/integration-tests/contracts/messaging/lib.rs new file mode 100755 index 000000000..b2de8c3c8 --- /dev/null +++ b/pop-api/integration-tests/contracts/messaging/lib.rs @@ -0,0 +1,193 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +use ink::{env::debug_println, prelude::vec::Vec}; +use pop_api::{ + messaging::{ + self as api, + ismp::{Get, Post}, + xcm::{Location, QueryId, Response}, + Callback, MessageId, Status, + }, + StatusCode, +}; + +pub type Result = core::result::Result; + +#[ink::contract] +mod messaging { + use ink::xcm::prelude::Weight; + use pop_api::messaging::ismp::StorageValue; + + use super::*; + + #[ink(storage)] + #[derive(Default)] + pub struct Contract; + + impl Contract { + #[ink(constructor, payable)] + pub fn new() -> Self { + Default::default() + } + + #[ink(message)] + pub fn ismp_get( + &mut self, + id: MessageId, + request: Get, + fee: Balance, + callback: bool, + ) -> Result<()> { + debug_println!( + "messaging::ismp_get id={id}, dest={}, height={}, timeout={}, fee={fee}, \ + callback={callback}", + request.dest, + request.height, + request.timeout + ); + api::ismp::get( + id, + request, + fee, + callback.then_some( + // See `api::ismp::OnGetResponse` impl below + Callback::to(0x57ad942b, Weight::from_parts(600_000_000, 150_000)), + ), + )?; + Ok(()) + } + + #[ink(message)] + pub fn ismp_post( + &mut self, + id: MessageId, + request: Post, + fee: Balance, + callback: bool, + ) -> Result<()> { + debug_println!( + "messaging::ismp_post id={id}, dest={}, timeout={}, fee={fee}, callback={callback}", + request.dest, + request.timeout + ); + api::ismp::post( + id, + request, + fee, + callback.then_some( + // See `api::ismp::OnPostResponse` impl below + Callback::to(0xcfb0a1d2, Weight::from_parts(600_000_000, 150_000)), + ), + )?; + Ok(()) + } + + #[ink(message)] + pub fn xcm_new_query( + &mut self, + id: MessageId, + responder: Location, + timeout: BlockNumber, + callback: bool, + ) -> Result> { + debug_println!( + "messaging::xcm_new_query id={id}, responder={responder:?}, timeout={timeout}, \ + callback={callback}" + ); + api::xcm::new_query( + id, + responder, + timeout, + callback.then_some( + // See api::xcm::OnResponse impl below + Callback::to(0x641b0b03, Weight::from_parts(600_000_000, 200_000)), + ), + ) + } + + #[ink(message)] + pub fn poll(&self, id: MessageId) -> Result> { + debug_println!("messaging::poll id={id}"); + api::poll((self.env().account_id(), id)) + } + + #[ink(message)] + pub fn get(&self, id: MessageId) -> Result>> { + debug_println!("messaging::get id={id}"); + api::get((self.env().account_id(), id)) + } + + #[ink(message)] + pub fn remove(&mut self, id: MessageId) -> Result<()> { + debug_println!("messaging::remove id={id}"); + api::remove([id].to_vec())?; + Ok(()) + } + } + + impl api::ismp::OnGetResponse for Contract { + #[ink(message)] + fn on_response(&mut self, id: MessageId, values: Vec) -> Result<()> { + debug_println!("messaging::ismp::get::on_response id={id}, values={values:?});"); + self.env().emit_event(IsmpGetCompleted { id, values }); + Ok(()) + } + } + + impl api::ismp::OnPostResponse for Contract { + #[ink(message)] + fn on_response(&mut self, id: MessageId, response: Vec) -> Result<()> { + debug_println!("messaging::ismp::post::on_response id={id}, response={response:?});"); + self.env().emit_event(IsmpPostCompleted { id, response }); + Ok(()) + } + } + + impl api::xcm::OnResponse for Contract { + #[ink(message)] + fn on_response(&mut self, id: MessageId, response: Response) -> Result<()> { + debug_println!("messaging::xcm::on_response id={id}, response={response:?}"); + match response { + Response::Null => {}, + Response::Assets(_) => {}, + Response::ExecutionResult(_) => {}, + Response::Version(_) => {}, + Response::PalletsInfo(_) => {}, + Response::DispatchResult(_) => {}, + } + self.env().emit_event(XcmCompleted { id, result: response }); + Ok(()) + } + } + + #[ink::event] + pub struct IsmpGetCompleted { + #[ink(topic)] + pub id: MessageId, + pub values: Vec, + } + + #[ink::event] + pub struct IsmpPostCompleted { + #[ink(topic)] + pub id: MessageId, + pub response: Vec, + } + + #[ink::event] + pub struct XcmCompleted { + #[ink(topic)] + pub id: MessageId, + pub result: Response, + } + + #[cfg(test)] + mod tests { + use super::*; + + #[ink::test] + fn default_works() { + Contract::new(); + } + } +} diff --git a/pop-api/integration-tests/src/messaging.rs b/pop-api/integration-tests/src/messaging.rs new file mode 100644 index 000000000..4c312288c --- /dev/null +++ b/pop-api/integration-tests/src/messaging.rs @@ -0,0 +1,504 @@ +use ::ismp::router::{GetResponse, IsmpRouter, PostResponse, Response, StorageValue}; +use ismp::host::StateMachine; +use pallet_api::messaging::Event::*; +use pallet_ismp::mmr::Leaf; +use pop_api::{ + messaging::{ + ismp::{Get, Post}, + xcm::{self, Junction, Location, MaybeErrorCode, NetworkId, QueryId}, + MessageId, Status, + }, + primitives::{BlockNumber, Error}, +}; +use pop_runtime_devnet::RuntimeEvent; +use sp_io::{hashing::keccak_256, TestExternalities}; +use sp_runtime::{app_crypto::sp_core::H160, offchain::OffchainOverlayedChange, testing::H256}; +use xcm_executor::traits::OnResponse; + +use super::*; + +const CONTRACT: &str = "contracts/messaging/target/ink/messaging.riscv"; +const ASSET_HUB: u32 = 1_000; +const HYPERBRIDGE: u32 = 4_009; +pub(crate) const ISMP_MODULE_ID: [u8; 3] = *b"pop"; + +#[test] +fn ismp_get_request_works() { + let id = 42; + let key = "some_key".as_bytes().to_vec(); + let request = Get::new(ASSET_HUB, 0, 0, "some_context".as_bytes().to_vec(), vec![key.clone()]); + let response = vec![StorageValue { key, value: Some("some_value".as_bytes().to_vec()) }]; + + // Create a get request. + let mut ext = new_test_ext(); + let contract = ext.execute_with(|| { + let contract = Contract::new(); + + assert_ok!(contract.ismp_get(id, request, 0, false)); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(IsmpGetDispatched { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + assert!(System::events().iter().any(|e| { + matches!(e.event, + RuntimeEvent::Ismp(pallet_ismp::Event::Request { dest_chain, source_chain , ..}) + if dest_chain == StateMachine::Polkadot(ASSET_HUB) && source_chain == StateMachine::Polkadot(100) + ) + })); + + contract + }); + + // Look up the request within offchain state in order to provide a response. + let ismp::router::Request::Get(get) = get_ismp_request(&mut ext) else { panic!() }; + + // Provide a response. + ext.execute_with(|| { + let module = Router::default().module_for_id(ISMP_MODULE_ID.to_vec()).unwrap(); + let commitment = H256::from(keccak_256(&ismp::router::Request::Get(get.clone()).encode())); + module + .on_response(Response::Get(GetResponse { get, values: response.clone() })) + .unwrap(); + System::assert_has_event( + IsmpGetResponseReceived { dest: contract.id.clone(), id, commitment }.into(), + ); + + assert_eq!(contract.poll(id).unwrap(), Some(Status::Complete)); + assert_eq!(contract.get(id).unwrap(), Some(response.encode())); + assert_ok!(contract.remove(id)); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn ismp_get_request_with_callback_works() { + let id = 42; + let key = "some_key".as_bytes().to_vec(); + let request = Get::new(ASSET_HUB, 0, 0, "some_context".as_bytes().to_vec(), vec![key.clone()]); + let response = vec![StorageValue { key, value: Some("some_value".as_bytes().to_vec()) }]; + + // Create a get request with callback. + let mut ext = new_test_ext(); + let contract = ext.execute_with(|| { + let contract = Contract::new(); + + assert_ok!(contract.ismp_get(id, request, 0, true)); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(IsmpGetDispatched { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + assert!(System::events().iter().any(|e| { + matches!(e.event, + RuntimeEvent::Ismp(pallet_ismp::Event::Request { dest_chain, source_chain , ..}) + if dest_chain == StateMachine::Polkadot(ASSET_HUB) && source_chain == StateMachine::Polkadot(100) + ) + })); + + contract + }); + + // Look up the request within offchain state in order to provide a response. + let ismp::router::Request::Get(get) = get_ismp_request(&mut ext) else { panic!() }; + + // Provide a response. + ext.execute_with(|| { + let module = Router::default().module_for_id(ISMP_MODULE_ID.to_vec()).unwrap(); + let commitment = H256::from(keccak_256(&ismp::router::Request::Get(get.clone()).encode())); + module + .on_response(Response::Get(GetResponse { get, values: response.clone() })) + .unwrap(); + System::assert_has_event( + IsmpGetResponseReceived { dest: contract.id.clone(), id, commitment }.into(), + ); + + assert_eq!(contract.last_event(), IsmpGetCompleted { id, values: response }.encode()); + assert_eq!(contract.poll(id).unwrap(), None); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(CallbackExecuted { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn ismp_post_request_works() { + let id = 42; + let request = Post::new(HYPERBRIDGE, 0, "some_data".as_bytes().to_vec()); + let response = "some_value".as_bytes().to_vec(); + + // Create a post request. + let mut ext = new_test_ext(); + let contract = ext.execute_with(|| { + let contract = Contract::new(); + + assert_ok!(contract.ismp_post(id, request, 0, false)); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(IsmpPostDispatched { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + assert!(System::events().iter().any(|e| { + matches!(e.event, + RuntimeEvent::Ismp(pallet_ismp::Event::Request { dest_chain, source_chain , ..}) + if dest_chain == StateMachine::Polkadot(HYPERBRIDGE) && source_chain == StateMachine::Polkadot(100) + ) + })); + + contract + }); + + // Look up the request within offchain state in order to provide a response. + let ismp::router::Request::Post(post) = get_ismp_request(&mut ext) else { panic!() }; + + // Provide a response. + ext.execute_with(|| { + let module = Router::default().module_for_id(ISMP_MODULE_ID.to_vec()).unwrap(); + let commitment = + H256::from(keccak_256(&ismp::router::Request::Post(post.clone()).encode())); + module + .on_response(Response::Post(PostResponse { + post, + response: response.clone(), + timeout_timestamp: 0, + })) + .unwrap(); + System::assert_has_event( + IsmpPostResponseReceived { dest: contract.id.clone(), id, commitment }.into(), + ); + + assert_eq!(contract.poll(id).unwrap(), Some(Status::Complete)); + assert_eq!(contract.get(id).unwrap(), Some(response)); + assert_ok!(contract.remove(id)); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn ismp_post_request_with_callback_works() { + let id = 42; + let request = Post::new(HYPERBRIDGE, 0, "some_data".as_bytes().to_vec()); + let response = "some_value".as_bytes().to_vec(); + + // Create a post request with callback. + let mut ext = new_test_ext(); + let contract = ext.execute_with(|| { + let contract = Contract::new(); + + assert_ok!(contract.ismp_post(id, request, 0, true)); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(IsmpPostDispatched { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + assert!(System::events().iter().any(|e| { + matches!(e.event, + RuntimeEvent::Ismp(pallet_ismp::Event::Request { dest_chain, source_chain , ..}) + if dest_chain == StateMachine::Polkadot(HYPERBRIDGE) && source_chain == StateMachine::Polkadot(100) + ) + })); + + contract + }); + + // Look up the request within offchain state in order to provide a response. + let ismp::router::Request::Post(post) = get_ismp_request(&mut ext) else { panic!() }; + + // Provide a response. + ext.execute_with(|| { + let module = Router::default().module_for_id(ISMP_MODULE_ID.to_vec()).unwrap(); + let commitment = + H256::from(keccak_256(&ismp::router::Request::Post(post.clone()).encode())); + module + .on_response(Response::Post(PostResponse { + post, + response: response.clone(), + timeout_timestamp: 0, + })) + .unwrap(); + System::assert_has_event( + IsmpPostResponseReceived { dest: contract.id.clone(), id, commitment }.into(), + ); + + assert_eq!(contract.last_event(), IsmpPostCompleted { id, response }.encode()); + assert_eq!(contract.poll(id).unwrap(), None); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(CallbackExecuted { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn xcm_query_works() { + let id = 42u64; + let origin = Location::new(1, [Junction::Parachain(ASSET_HUB)]); + let responder = origin.clone(); + let timeout = 100; + let response = xcm::Response::DispatchResult(MaybeErrorCode::Success); + new_test_ext().execute_with(|| { + let contract = Contract::new(); + + // Create a new query and check its status + let query_id = contract.xcm_new_query(id, responder, timeout, false).unwrap().unwrap(); + assert_eq!(query_id, 0); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(XcmQueryCreated { origin, id: message_id, query_id, ..}) + if origin == &contract.id && *message_id == id && *query_id == 0 + ) + })); + + // Provide a response. + let origin = translate(&origin); + let querier: Location = Junction::AccountId32 { + network: Some(NetworkId::Polkadot), + id: contract.id.clone().into(), + } + .into(); + assert!(pop_runtime_devnet::PolkadotXcm::expecting_response( + &origin, + query_id, + Some(&translate(&querier)) + )); + assert_ok!(Messaging::xcm_response( + pallet_xcm::Origin::Response(origin).into(), + query_id, + translate(&response) + )); + + assert_eq!(contract.poll(id).unwrap(), Some(Status::Complete)); + assert_eq!(contract.get(id).unwrap(), Some(response.encode())); + assert_ok!(contract.remove(id)); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn xcm_query_with_callback_works() { + let id = 42u64; + let origin = Location::new(1, [Junction::Parachain(ASSET_HUB)]); + let responder = origin.clone(); + let timeout = 100; + let response = xcm::Response::DispatchResult(MaybeErrorCode::Success); + new_test_ext().execute_with(|| { + let contract = Contract::new(); + + // Create a new query and check its status + let query_id = contract.xcm_new_query(id, responder, timeout, true).unwrap().unwrap(); + assert_eq!(query_id, 0); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(XcmQueryCreated { origin, id: message_id, query_id, ..}) + if origin == &contract.id && *message_id == id && *query_id == 0 + ) + })); + + // Provide a response. + let origin = translate(&origin); + let querier: Location = Junction::AccountId32 { + network: Some(NetworkId::Polkadot), + id: contract.id.clone().into(), + } + .into(); + assert!(pop_runtime_devnet::PolkadotXcm::expecting_response( + &origin, + query_id, + Some(&translate(&querier)) + )); + assert_ok!(Messaging::xcm_response( + pallet_xcm::Origin::Response(origin).into(), + query_id, + translate(&response) + )); + + assert_eq!(contract.last_event(), XcmCompleted { id, result: response }.encode()); + assert_eq!(contract.poll(id).unwrap(), None); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(CallbackExecuted { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +// Get the last ismp request. +pub(crate) fn get_ismp_request(ext: &mut TestExternalities) -> ismp::router::Request { + // Get commitment from last ismp request event. + let commitment = ext.execute_with(|| { + System::read_events_for_pallet::>() + .iter() + .filter_map(|e| match e { + pallet_ismp::Event::::Request { commitment, .. } => + Some(commitment.clone()), + _ => None, + }) + .last() + .unwrap() + }); + // Read value from offchain storage overlay, stored via `NoOpMmrTree`. + let key = ("storage".as_bytes().to_vec(), (b"no_op", commitment).encode()); + let request = ext + .overlayed_changes() + .offchain() + .overlay() + .changes() + .filter_map(|c| { + (c.0 == &key).then(|| match c.1.value_ref() { + OffchainOverlayedChange::SetValue(value) => { + match Leaf::decode(&mut &value[..]).unwrap() { + Leaf::Request(req) => Some(req), + Leaf::Response(_) => None, + } + }, + _ => None, + }) + }) + .last() + .flatten() + .unwrap(); + // Ensure the request matches the commitment. + assert_eq!(commitment.0, keccak_256(&request.encode())); + request +} + +// Translate a source type into a target type via encoding/decoding. +fn translate(source: &S) -> T { + T::decode(&mut &source.encode()[..]).unwrap() +} + +// A simple, strongly typed wrapper for the contract. +struct Contract { + address: H160, + id: AccountId32, +} +impl Contract { + fn new() -> Self { + let (address, account_id) = + instantiate(CONTRACT, INIT_VALUE, function_selector("new"), vec![]); + Self { address, id: account_id } + } + + fn ismp_get( + &self, + id: MessageId, + request: Get, + fee: Balance, + callback: bool, + ) -> Result<(), Error> { + let result = self.call("ismp_get", (id, request, fee, callback).encode(), 0); + >::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn ismp_post( + &self, + id: MessageId, + request: Post, + fee: Balance, + callback: bool, + ) -> Result<(), Error> { + let result = self.call("ismp_post", (id, request, fee, callback).encode(), 0); + >::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn xcm_new_query( + &self, + id: MessageId, + responder: Location, + timeout: BlockNumber, + callback: bool, + ) -> Result, Error> { + let result = self.call("xcm_new_query", (id, responder, timeout, callback).encode(), 0); + , Error>>::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn poll(&self, request: MessageId) -> Result, Error> { + let result = self.call("poll", request.encode(), 0); + Result::, Error>::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn get(&self, request: MessageId) -> Result>, Error> { + let result = self.call("get", request.encode(), 0); + Result::>, Error>::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn remove(&self, request: MessageId) -> Result<(), Error> { + let result = self.call("remove", request.encode(), 0); + >::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn call(&self, function: &str, params: Vec, value: u128) -> ExecReturnValue { + let function = function_selector(function); + let params = [function, params].concat(); + bare_call(self.address.clone(), params, value).expect("should work") + } + + fn last_event(&self) -> Vec { + let events = System::read_events_for_pallet::>(); + let contract_events = events + .iter() + .filter_map(|event| match event { + pallet_revive::Event::::ContractEmitted { contract, data, .. } + if contract == &self.address => + Some(data.as_slice()), + _ => None, + }) + .collect::>(); + contract_events.last().unwrap().to_vec() + } +} + +#[derive(Decode, Encode)] +pub struct IsmpGetCompleted { + pub id: MessageId, + pub values: Vec, +} + +#[derive(Decode, Encode)] +pub struct IsmpPostCompleted { + pub id: MessageId, + pub response: Vec, +} + +#[derive(Decode, Encode)] +pub struct XcmCompleted { + pub id: MessageId, + pub result: xcm::Response, +} diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index e49a4c7d9..4735ed600 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -36,6 +36,10 @@ pub enum RuntimeRead { /// Non-fungible token queries. #[codec(index = 151)] NonFungibles(nonfungibles::Read), + /// Messaging read queries. + #[codec(index = 152)] + NonFungibles(messaging::Read), + } impl Readable for RuntimeRead { @@ -48,6 +52,8 @@ impl Readable for RuntimeRead { match self { RuntimeRead::Fungibles(key) => fungibles::Pallet::weight(key), RuntimeRead::NonFungibles(key) => nonfungibles::Pallet::weight(key), + RuntimeRead::Messaging(key) => messaging::Pallet::weight(key), + } } @@ -57,6 +63,7 @@ impl Readable for RuntimeRead { RuntimeRead::Fungibles(key) => RuntimeResult::Fungibles(fungibles::Pallet::read(key)), RuntimeRead::NonFungibles(key) => RuntimeResult::NonFungibles(nonfungibles::Pallet::read(key)), + RuntimeRead::Messaging(key) => RuntimeResult::Messaging(messaging::Pallet::read(key)), } } } @@ -69,6 +76,7 @@ pub enum RuntimeResult { Fungibles(fungibles::ReadResult), /// Non-fungible token read results. NonFungibles(nonfungibles::ReadResult), + Messaging(messaging::ReadResult), } impl RuntimeResult { @@ -93,6 +101,113 @@ impl nonfungibles::Config for Runtime { type WeightInfo = (); } +impl messaging::Config for Runtime { + type ByteFee = TransactionByteFee; + type Callback = Callback; + type Deposit = Balances; + // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as + // much as onchain cost. + type IsmpByteFee = (); + type IsmpDispatcher = Ismp; + type MaxContextLen = ConstU32<64>; + type MaxDataLen = ConstU32<1024>; + type MaxKeyLen = ConstU32<1000>; + type MaxKeys = ConstU32<10>; + // TODO: size appropriately + type MaxRemovals = ConstU32<1024>; + // TODO: ensure within the contract buffer bounds + type MaxResponseLen = ConstU32<1024>; + type OriginConverter = LocalOriginToLocation; + type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; + type Xcm = QueryHandler; + type XcmResponseOrigin = EnsureResponse; +} + +pub struct EnsureResponse; +impl> + From> EnsureOrigin for EnsureResponse { + type Success = Location; + + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + Origin::Response(location) => Ok(location), + r => Err(O::from(r)), + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + todo!() + } +} + +pub struct CallbackExecutor; +impl messaging::CallbackExecutor for CallbackExecutor { + fn execute(account: AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo { + type AddressMapper = ::AddressMapper; + + // Default + #[cfg(not(feature = "std"))] + let debug = DebugInfo::Skip; + #[cfg(not(feature = "std"))] + let collect_events = CollectEvents::Skip; + // Testing + #[cfg(feature = "std")] + let debug = DebugInfo::UnsafeDebug; + #[cfg(feature = "std")] + let collect_events = CollectEvents::UnsafeCollect; + + let mut output = Revive::bare_call( + RuntimeOrigin::signed(account.clone()), + AddressMapper::to_address(&account), + Default::default(), + weight, + Default::default(), + data, + debug, + collect_events, + ); + log::debug!(target: "pop-api::extension", "callback weight consumed={:?}, weight required={:?}", output.gas_consumed, output.gas_required); + if let Ok(return_value) = &output.result { + let pallet_revive::ExecReturnValue { flags, data } = return_value; + log::debug!(target: "pop-api::extension", "return data={:?}", data); + if return_value.did_revert() { + output.result = Err(pallet_revive::Error::::ContractReverted.into()); + } + } + + let post_info = PostDispatchInfo { + actual_weight: Some(output.gas_consumed.saturating_add(Self::weight())), + pays_fee: Default::default(), + }; + + output + .result + .map(|_| post_info) + .map_err(|e| DispatchErrorWithPostInfo { post_info, error: e }) + } + + fn weight() -> Weight { + todo!("") + use pallet_revive::WeightInfo; + ::WeightInfo::call() + } +} + + +// TODO!( default implementation where T: PolkadotXcm::Config +pub struct QueryHandler; +impl NotifyQueryHandler for QueryHandler { + fn new_notify_query( + responder: impl Into, + notify: messaging::Call, + timeout: BlockNumber, + match_querier: impl Into, + ) -> u64 { + PolkadotXcm::new_notify_query(responder, notify, timeout, match_querier) + } +} + #[derive(Default)] pub struct Config; impl pallet_api::extension::Config for Config { diff --git a/runtime/devnet/src/config/ismp.rs b/runtime/devnet/src/config/ismp.rs index 3b0693e8c..196df660c 100644 --- a/runtime/devnet/src/config/ismp.rs +++ b/runtime/devnet/src/config/ismp.rs @@ -1,9 +1,8 @@ -use alloc::{boxed::Box, vec::Vec}; - use frame_support::traits::Get; use frame_system::EnsureRoot; -use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; +use ismp::{error::Error, host::StateMachine, module::IsmpModule, router::IsmpRouter}; use ismp_parachain::ParachainConsensusClient; +use sp_std::prelude::*; use crate::{ AccountId, Balance, Balances, Ismp, IsmpParachain, ParachainInfo, Runtime, RuntimeEvent, @@ -17,7 +16,8 @@ impl pallet_ismp::Config for Runtime { type Coprocessor = Coprocessor; type Currency = Balances; type HostStateMachine = HostStateMachine; - type OffchainDB = (); + // State is stored in offchain database + type Mmr = pallet_ismp::NoOpMmrTree; type Router = Router; type RuntimeEvent = RuntimeEvent; type TimestampProvider = Timestamp; @@ -42,11 +42,15 @@ impl Get for HostStateMachine { StateMachine::Polkadot(ParachainInfo::get().into()) } } - + #[derive(Default)] pub struct Router; impl IsmpRouter for Router { - fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { - Err(anyhow::anyhow!("Module not found: {:?}", id)) + fn module_for_id(&self, id: Vec) -> Result, Error> { + use pallet_api::messaging::transports::ismp::*; + if id == ID { + return Ok(Box::new(Handler::::new())); + } + Err(Error::ModuleNotFound(id)) } } From e7b234b60087e7ad41d121af534b24353ca1a033 Mon Sep 17 00:00:00 2001 From: f-gate Date: Thu, 27 Feb 2025 11:40:05 +0100 Subject: [PATCH 02/38] fix compilation --- Cargo.lock | 6 ++ pallets/api/Cargo.toml | 9 +++ pallets/api/src/lib.rs | 1 + pallets/api/src/messaging/mod.rs | 14 ++-- pallets/api/src/messaging/transports/ismp.rs | 10 +-- pop-api/src/v0/messaging/ismp.rs | 74 +++++++++++++++++ pop-api/src/v0/messaging/mod.rs | 84 ++++++++++++++++++++ pop-api/src/v0/messaging/xcm.rs | 55 +++++++++++++ runtime/devnet/Cargo.toml | 4 + runtime/devnet/src/config/api/mod.rs | 24 +++--- runtime/devnet/src/config/ismp.rs | 7 +- runtime/devnet/src/config/mod.rs | 1 + runtime/devnet/src/config/revive.rs | 48 +++++++++++ runtime/devnet/src/lib.rs | 8 +- 14 files changed, 319 insertions(+), 26 deletions(-) create mode 100644 pop-api/src/v0/messaging/ismp.rs create mode 100644 pop-api/src/v0/messaging/mod.rs create mode 100644 pop-api/src/v0/messaging/xcm.rs create mode 100644 runtime/devnet/src/config/revive.rs diff --git a/Cargo.lock b/Cargo.lock index 3bc4c6de2..2603fa536 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8771,12 +8771,15 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" name = "pallet-api" version = "0.1.0" dependencies = [ + "anyhow", "frame-benchmarking 39.0.0", "frame-support 39.0.0", "frame-system 39.1.0", + "ismp", "log", "pallet-assets 41.0.0", "pallet-balances 40.0.0", + "pallet-ismp", "pallet-nfts 31.0.0", "parity-scale-codec", "pop-chain-extension", @@ -8785,6 +8788,7 @@ dependencies = [ "sp-io 39.0.0", "sp-runtime 40.1.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "staging-xcm 15.0.1", ] [[package]] @@ -13685,6 +13689,7 @@ dependencies = [ "pallet-nfts-runtime-api 25.0.0", "pallet-preimage 39.0.0", "pallet-proxy 39.0.0", + "pallet-revive", "pallet-scheduler 40.0.0", "pallet-session 39.0.0", "pallet-sudo 39.0.0", @@ -13713,6 +13718,7 @@ dependencies = [ "sp-offchain 35.0.0", "sp-runtime 40.1.0", "sp-session 37.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-transaction-pool 35.0.0", "sp-version 38.0.0", "staging-parachain-info 0.18.0", diff --git a/pallets/api/Cargo.toml b/pallets/api/Cargo.toml index 21c3f2f8e..5b4a3a8f6 100644 --- a/pallets/api/Cargo.toml +++ b/pallets/api/Cargo.toml @@ -25,6 +25,13 @@ pallet-assets.workspace = true pallet-nfts.workspace = true sp-runtime.workspace = true sp-std.workspace = true +sp-core.workspace = true +anyhow.workspace = true + +# Cross chain +ismp.workspace = true +pallet-ismp.workspace = true +xcm.workspace = true [dev-dependencies] pallet-balances.workspace = true @@ -47,9 +54,11 @@ std = [ "frame-benchmarking/std", "frame-support/std", "frame-system/std", + "ismp/std", "log/std", "pallet-assets/std", "pallet-balances/std", + "pallet-ismp/std", "pallet-nfts/std", "pop-chain-extension/std", "scale-info/std", diff --git a/pallets/api/src/lib.rs b/pallets/api/src/lib.rs index d0e82e5a5..b87188696 100644 --- a/pallets/api/src/lib.rs +++ b/pallets/api/src/lib.rs @@ -8,6 +8,7 @@ pub mod fungibles; #[cfg(test)] mod mock; pub mod nonfungibles; +pub mod messaging; /// Trait for performing reads of runtime state. pub trait Read { diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 4ec8019f3..c7ae3e3d7 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -59,7 +59,7 @@ pub mod pallet { #[pallet::constant] type ByteFee: Get>; - type Callback: CallbackT; + type CallbackExecutor: CallbackExecutor; /// The deposit mechanism. type Deposit: Mutate @@ -247,7 +247,7 @@ pub mod pallet { #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage // Add any additional gas limit specified for callback execution .saturating_add(callback.map(|cb| { - T::Callback::weight().saturating_add(cb.weight) + T::CallbackExecutor::execution_weight().saturating_add(cb.weight) }).unwrap_or_default()) )] pub fn ismp_get( @@ -295,7 +295,7 @@ pub mod pallet { #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage // Add any additional gas limit specified for callback execution .saturating_add(callback.map(|cb| { - T::Callback::weight().saturating_add(cb.weight) + T::CallbackExecutor::execution_weight().saturating_add(cb.weight) }).unwrap_or_default()) )] pub fn ismp_post( @@ -342,7 +342,7 @@ pub mod pallet { #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage // Add any additional gas limit specified for callback execution .saturating_add(callback.map(|cb| { - T::Callback::weight().saturating_add(cb.weight) + T::CallbackExecutor::execution_weight().saturating_add(cb.weight) }).unwrap_or_default()) // TODO: add weight of xcm_response dispatchable once benchmarked )] @@ -496,7 +496,7 @@ impl Pallet { ) -> DispatchResult { // TODO: check weight removed from block weight - may need dispatching via executive // instead - let result = T::Callback::execute( + let result = T::CallbackExecutor::execute( origin.clone(), [callback.selector.to_vec(), (id, data).encode()].concat(), callback.weight, @@ -648,8 +648,8 @@ pub struct Callback { pub weight: Weight, } -pub trait CallbackT { +pub trait CallbackExecutor { fn execute(account: T::AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo; - fn weight() -> Weight; + fn execution_weight() -> Weight; } diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 5f179a15b..738fd9f2f 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -132,11 +132,11 @@ impl Handler { } impl IsmpModule for Handler { - fn on_accept(&self, _request: PostRequest) -> Result<(), Error> { + fn on_accept(&self, _request: PostRequest) -> Result<(), anyhow::Error> { todo!() } - fn on_response(&self, response: Response) -> Result<(), Error> { + fn on_response(&self, response: Response) -> Result<(), anyhow::Error> { // Hash request to determine key for message lookup. match response { Response::Get(GetResponse { get, values }) => { @@ -161,7 +161,7 @@ impl IsmpModule for Handler { } } - fn on_timeout(&self, timeout: Timeout) -> Result<(), Error> { + fn on_timeout(&self, timeout: Timeout) -> Result<(), anyhow::Error> { match timeout { Timeout::Request(request) => { // hash request to determine key for original request id lookup @@ -222,14 +222,14 @@ fn process_response( encode: &impl Encode, store: impl Fn() -> Vec, event: impl Fn(AccountIdOf, MessageId) -> Event, -) -> Result<(), Error> { +) -> Result<(), anyhow::Error> { let (origin, id) = IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; let Some(super::super::Message::Ismp { commitment, callback, deposit }) = Messages::::get(&origin, &id) else { - return Err(Error::Custom("message not found".into())) + return Err(Error::Custom("message not found".into()).into()) }; // Attempt callback with result if specified. diff --git a/pop-api/src/v0/messaging/ismp.rs b/pop-api/src/v0/messaging/ismp.rs new file mode 100644 index 000000000..dfc32a39e --- /dev/null +++ b/pop-api/src/v0/messaging/ismp.rs @@ -0,0 +1,74 @@ +use super::*; + +#[ink::scale_derive(Encode, Decode, TypeInfo)] +pub struct Get { + pub dest: u32, + pub height: u32, + pub timeout: u64, + // TODO: Option + pub context: Vec, + pub keys: Vec>, +} + +impl Get { + pub fn new(dest: u32, height: u32, timeout: u64, context: Vec, keys: Vec>) -> Self { + // TODO: validate: dest para id, ensure at least one key + Self { dest, height, timeout, context, keys } + } +} + +#[ink::scale_derive(Encode, Decode, TypeInfo)] +pub struct Post { + pub dest: u32, + pub timeout: u64, + pub data: Vec, +} + +impl Post { + pub fn new(dest: u32, timeout: u64, data: Vec) -> Self { + // TODO: validate: dest para id, ensure data not empty + Self { dest, timeout, data } + } +} + +/// A verified storage value. +#[ink::scale_derive(Encode, Decode, TypeInfo)] +#[derive(Debug)] +pub struct StorageValue { + /// The request storage key. + pub key: Vec, + /// The verified value. + pub value: Option>, +} + +#[inline] +pub fn get(id: MessageId, request: Get, fee: Balance, callback: Option) -> Result<()> { + build_dispatch(ISMP_GET) + .input::<(MessageId, Get, Balance, Option)>() + .output::, true>() + .handle_error_code::() + .call(&(id, request, fee, callback)) +} + +#[inline] +pub fn post(id: MessageId, request: Post, fee: Balance, callback: Option) -> Result<()> { + build_dispatch(ISMP_POST) + .input::<(MessageId, Post, Balance, Option)>() + .output::, true>() + .handle_error_code::() + .call(&(id, request, fee, callback)) +} + +#[ink::trait_definition] +pub trait OnGetResponse { + // pop-api::messaging::ismp::OnGetResponse::on_response + #[ink(message, selector = 0x57ad942b)] + fn on_response(&mut self, id: MessageId, values: Vec) -> Result<()>; +} + +#[ink::trait_definition] +pub trait OnPostResponse { + // pop-api::messaging::ismp::OnPostResponse::on_response + #[ink(message, selector = 0xcfb0a1d2)] + fn on_response(&mut self, id: MessageId, response: Vec) -> Result<()>; +} diff --git a/pop-api/src/v0/messaging/mod.rs b/pop-api/src/v0/messaging/mod.rs new file mode 100644 index 000000000..4c28b9558 --- /dev/null +++ b/pop-api/src/v0/messaging/mod.rs @@ -0,0 +1,84 @@ +use ink::prelude::vec::Vec; + +use crate::{ + constants::MESSAGING, + messaging::xcm::Weight, + primitives::{AccountId, Balance, BlockNumber}, + ChainExtensionMethodApi, Result, StatusCode, +}; + +/// APIs for messaging using the Interoperable State Machine Protocol (ISMP). +pub mod ismp; +/// APIs for messaging using Polkadot's Cross-Consensus Messaging (XCM). +pub mod xcm; + +// Dispatchables +pub(super) const _REQUEST: u8 = 0; +pub(super) const ISMP_GET: u8 = 1; +pub(super) const ISMP_POST: u8 = 2; +pub(super) const XCM_NEW_QUERY: u8 = 3; +pub(super) const _XCM_RESPONSE: u8 = 4; +pub(super) const REMOVE: u8 = 5; +// Reads +pub(super) const POLL: u8 = 0; +pub(super) const GET: u8 = 1; +pub(super) const QUERY_ID: u8 = 2; + +pub type MessageId = u64; +pub type ParaId = u32; + +fn build_dispatch(dispatchable: u8) -> ChainExtensionMethodApi { + crate::v0::build_dispatch(MESSAGING, dispatchable) +} + +fn build_read_state(state_query: u8) -> ChainExtensionMethodApi { + crate::v0::build_read_state(MESSAGING, state_query) +} + +#[inline] +pub fn poll(id: (AccountId, MessageId)) -> Result> { + build_read_state(POLL) + .input::<(AccountId, MessageId)>() + .output::>, true>() + .handle_error_code::() + .call(&id) +} + +#[inline] +pub fn get(id: (AccountId, MessageId)) -> Result>> { + build_read_state(GET) + .input::<(AccountId, MessageId)>() + .output::>>, true>() + .handle_error_code::() + .call(&id) +} + +#[inline] +pub fn remove(requests: Vec) -> Result<()> { + build_dispatch(REMOVE) + .input::>() + .output::, true>() + .handle_error_code::() + .call(&requests) +} + +#[ink::scale_derive(Decode, Encode, TypeInfo)] +pub struct Callback { + selector: [u8; 4], + weight: Weight, +} + +impl Callback { + pub fn to(selector: u32, weight: Weight) -> Self { + Self { selector: selector.to_be_bytes(), weight } + } +} + +#[derive(PartialEq)] +#[ink::scale_derive(Decode, Encode, TypeInfo)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum Status { + Pending, + TimedOut, + Complete, +} diff --git a/pop-api/src/v0/messaging/xcm.rs b/pop-api/src/v0/messaging/xcm.rs new file mode 100644 index 000000000..d086ece43 --- /dev/null +++ b/pop-api/src/v0/messaging/xcm.rs @@ -0,0 +1,55 @@ +pub use ink::{ + env::call::Selector, + prelude::vec::Vec, + xcm::prelude::{ + Junction, Junctions, Location, MaybeErrorCode, NetworkId, QueryId, Response, + VersionedLocation, VersionedResponse, VersionedXcm, Weight, XcmContext, XcmHash, + }, +}; +use ink::{ + env::{account_id, xcm_execute, xcm_send, DefaultEnvironment}, + scale::Encode, +}; + +use super::*; + +/// Note: usage of a callback requires implementation of the [OnResponse] trait. +#[inline] +pub fn new_query( + id: MessageId, + responder: Location, + timeout: BlockNumber, + callback: Option, +) -> Result> { + build_dispatch(XCM_NEW_QUERY) + .input::<(MessageId, Location, BlockNumber, Option)>() + .output::, true>() + .handle_error_code::() + .call(&(id, responder, timeout, callback))?; + + build_read_state(QUERY_ID) + .input::<(AccountId, MessageId)>() + .output::>, true>() + .handle_error_code::() + .call(&(account_id::(), id)) +} + +/// Execute an XCM message locally, using the contract's address as the origin. +pub fn execute(msg: &VersionedXcm) -> ink::env::Result<()> { + xcm_execute::(msg) +} + +/// Send an XCM message, using the contract's address as the origin. +pub fn send( + dest: &VersionedLocation, + msg: &VersionedXcm, +) -> ink::env::Result { + xcm_send::(dest, msg) +} + +#[ink::trait_definition] +pub trait OnResponse { + // pop-api::messaging::xcm::OnResponse::on_response + #[ink(message, selector = 0x641b0b03)] + fn on_response(&mut self, id: MessageId, response: Response) -> Result<()>; +} diff --git a/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index 41e875184..26728a05b 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -50,6 +50,7 @@ pallet-nft-fractionalization.workspace = true pallet-nfts-runtime-api.workspace = true pallet-preimage.workspace = true pallet-proxy.workspace = true +pallet-revive.workspace = true pallet-scheduler.workspace = true pallet-session.workspace = true pallet-sudo.workspace = true @@ -68,6 +69,7 @@ sp-mmr-primitives.workspace = true sp-offchain.workspace = true sp-runtime.workspace = true sp-session.workspace = true +sp-std.workspace = true sp-transaction-pool.workspace = true sp-version.workspace = true @@ -97,6 +99,7 @@ parachains-common.workspace = true ismp.workspace = true ismp-parachain.workspace = true ismp-parachain-runtime-api.workspace = true +# TODO: use signed pallet-ismp = { workspace = true, features = [ "unsigned" ] } pallet-ismp-runtime-api.workspace = true @@ -147,6 +150,7 @@ std = [ "pallet-nfts/std", "pallet-preimage/std", "pallet-proxy/std", + "pallet-revive/std", "pallet-scheduler/std", "pallet-session/std", "pallet-sudo/std", diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 4735ed600..4ad688dc7 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -3,18 +3,24 @@ use core::marker::PhantomData; use codec::Decode; use cumulus_primitives_core::Weight; -use frame_support::traits::Contains; +use frame_support::{traits::Contains, pallet_prelude::*, dispatch::{PostDispatchInfo, DispatchErrorWithPostInfo}}; pub(crate) use pallet_api::Extension; use pallet_api::{extension::*, Read}; use sp_core::ConstU8; use sp_runtime::DispatchError; use versioning::*; +use pallet_revive::{DebugInfo, CollectEvents, AddressMapper}; +use xcm::latest::Location; +use pallet_xcm::Origin; use crate::{ config::assets::{TrustBackedAssetsInstance, TrustBackedNftsInstance}, - fungibles, nonfungibles, Runtime, RuntimeCall, RuntimeEvent, + fungibles, nonfungibles, Runtime, RuntimeCall, RuntimeEvent, messaging, + TransactionByteFee, Balances, Ismp, ConstU32, RuntimeHoldReason, config::xcm::LocalOriginToLocation, + AccountId, Revive, RuntimeOrigin, BlockNumber }; + mod versioning; type DecodingFailedError = DecodingFailed; @@ -38,7 +44,7 @@ pub enum RuntimeRead { NonFungibles(nonfungibles::Read), /// Messaging read queries. #[codec(index = 152)] - NonFungibles(messaging::Read), + Messaging(messaging::Read), } @@ -85,6 +91,7 @@ impl RuntimeResult { match self { RuntimeResult::Fungibles(result) => result.encode(), RuntimeResult::NonFungibles(result) => result.encode(), + RuntimeResult::Messaging(result) => result.encode(), } } } @@ -103,7 +110,7 @@ impl nonfungibles::Config for Runtime { impl messaging::Config for Runtime { type ByteFee = TransactionByteFee; - type Callback = Callback; + type CallbackExecutor = CallbackExecutor; type Deposit = Balances; // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as // much as onchain cost. @@ -177,7 +184,7 @@ impl messaging::CallbackExecutor for CallbackExecutor { } let post_info = PostDispatchInfo { - actual_weight: Some(output.gas_consumed.saturating_add(Self::weight())), + actual_weight: Some(output.gas_consumed.saturating_add(Self::execution_weight())), pays_fee: Default::default(), }; @@ -187,8 +194,7 @@ impl messaging::CallbackExecutor for CallbackExecutor { .map_err(|e| DispatchErrorWithPostInfo { post_info, error: e }) } - fn weight() -> Weight { - todo!("") + fn execution_weight() -> Weight { use pallet_revive::WeightInfo; ::WeightInfo::call() } @@ -197,14 +203,14 @@ impl messaging::CallbackExecutor for CallbackExecutor { // TODO!( default implementation where T: PolkadotXcm::Config pub struct QueryHandler; -impl NotifyQueryHandler for QueryHandler { +impl pallet_api::messaging::NotifyQueryHandler for QueryHandler { fn new_notify_query( responder: impl Into, notify: messaging::Call, timeout: BlockNumber, match_querier: impl Into, ) -> u64 { - PolkadotXcm::new_notify_query(responder, notify, timeout, match_querier) + crate::PolkadotXcm::new_notify_query(responder, notify, timeout, match_querier) } } diff --git a/runtime/devnet/src/config/ismp.rs b/runtime/devnet/src/config/ismp.rs index 196df660c..f4275f833 100644 --- a/runtime/devnet/src/config/ismp.rs +++ b/runtime/devnet/src/config/ismp.rs @@ -16,8 +16,7 @@ impl pallet_ismp::Config for Runtime { type Coprocessor = Coprocessor; type Currency = Balances; type HostStateMachine = HostStateMachine; - // State is stored in offchain database - type Mmr = pallet_ismp::NoOpMmrTree; + type OffchainDB = (); type Router = Router; type RuntimeEvent = RuntimeEvent; type TimestampProvider = Timestamp; @@ -46,11 +45,11 @@ impl Get for HostStateMachine { #[derive(Default)] pub struct Router; impl IsmpRouter for Router { - fn module_for_id(&self, id: Vec) -> Result, Error> { + fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { use pallet_api::messaging::transports::ismp::*; if id == ID { return Ok(Box::new(Handler::::new())); } - Err(Error::ModuleNotFound(id)) + Err(Error::ModuleNotFound(id).into()) } } diff --git a/runtime/devnet/src/config/mod.rs b/runtime/devnet/src/config/mod.rs index 61ae08273..5368f72d1 100644 --- a/runtime/devnet/src/config/mod.rs +++ b/runtime/devnet/src/config/mod.rs @@ -6,3 +6,4 @@ mod ismp; mod proxy; // Public due to integration tests crate. pub mod xcm; +mod revive; diff --git a/runtime/devnet/src/config/revive.rs b/runtime/devnet/src/config/revive.rs new file mode 100644 index 000000000..1754edb91 --- /dev/null +++ b/runtime/devnet/src/config/revive.rs @@ -0,0 +1,48 @@ +use frame_support::{ + parameter_types, + traits::{ConstBool, ConstU32, ConstU64, Nothing}, +}; +use frame_system::EnsureSigned; + +use super::api::{self, Config}; +use crate::{ + deposit, Balance, Balances, Perbill, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, + Timestamp, +}; + +parameter_types! { + pub const DepositPerItem: Balance = deposit(1, 0); + pub const DepositPerByte: Balance = deposit(0, 1); + pub const DefaultDepositLimit: Balance = deposit(1024, 1024 * 1024); + pub const CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(0); +} + +impl pallet_revive::Config for Runtime { + type AddressMapper = pallet_revive::AccountId32Mapper; + type CallFilter = Nothing; + type ChainExtension = (); //todo!("Call with peter, currently we are only implementing the extension for pallet-contracts"); + type ChainId = ConstU64<4001>; + type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; + type Currency = Balances; + type Debug = (); + type DepositPerByte = DepositPerByte; + type DepositPerItem = DepositPerItem; + type InstantiateOrigin = EnsureSigned; + type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>; + type Time = Timestamp; + type UnsafeUnstableInterface = ConstBool; + type UploadOrigin = EnsureSigned; + type WeightInfo = pallet_revive::weights::SubstrateWeight; + type WeightPrice = pallet_transaction_payment::Pallet; + type Xcm = pallet_xcm::Pallet; + type NativeToEthRatio = ConstU32<1_000_000>; +} + +// Mock implementation running for messaging. +// remove extrinsic tests / benchmarking. +// xcm spike +// ismp spike diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index aca3c865a..f66a86185 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -43,7 +43,7 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pallet_api::{fungibles, nonfungibles}; +use pallet_api::{fungibles, nonfungibles, messaging}; use pallet_balances::Call as BalancesCall; use pallet_ismp::offchain::{Leaf, Proof, ProofKeys}; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; @@ -654,6 +654,12 @@ mod runtime { pub type Fungibles = fungibles::Pallet; #[runtime::pallet_index(151)] pub type NonFungibles = nonfungibles::Pallet; + #[runtime::pallet_index(152)] + pub type Messaging = messaging::Pallet; + + // Revive + #[runtime::pallet_index(255)] + pub type Revive = pallet_revive::Pallet; } #[cfg(feature = "runtime-benchmarks")] From 5d169c3e1eaa98ec27ffb30054fed03962eead7b Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:03 +0000 Subject: [PATCH 03/38] pull over relevant files --- pallets/api/src/messaging/mod.rs | 655 ++++++++++++++++++ pallets/api/src/messaging/transports/ismp.rs | 254 +++++++ pallets/api/src/messaging/transports/mod.rs | 4 + pallets/api/src/messaging/transports/xcm.rs | 14 + pop-api/examples/messaging/Cargo.toml | 22 + pop-api/examples/messaging/lib.rs | 268 +++++++ .../contracts/messaging/Cargo.toml | 22 + .../contracts/messaging/lib.rs | 193 ++++++ pop-api/integration-tests/src/messaging.rs | 504 ++++++++++++++ runtime/devnet/src/config/api/mod.rs | 115 +++ runtime/devnet/src/config/ismp.rs | 18 +- 11 files changed, 2062 insertions(+), 7 deletions(-) create mode 100644 pallets/api/src/messaging/mod.rs create mode 100644 pallets/api/src/messaging/transports/ismp.rs create mode 100644 pallets/api/src/messaging/transports/mod.rs create mode 100644 pallets/api/src/messaging/transports/xcm.rs create mode 100755 pop-api/examples/messaging/Cargo.toml create mode 100755 pop-api/examples/messaging/lib.rs create mode 100755 pop-api/integration-tests/contracts/messaging/Cargo.toml create mode 100755 pop-api/integration-tests/contracts/messaging/lib.rs create mode 100644 pop-api/integration-tests/src/messaging.rs diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs new file mode 100644 index 000000000..4ec8019f3 --- /dev/null +++ b/pallets/api/src/messaging/mod.rs @@ -0,0 +1,655 @@ +//! TODO: pallet docs. + +use codec::{Decode, Encode}; +use frame_support::{ + dispatch::{DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, + pallet_prelude::MaxEncodedLen, + storage::KeyLenOf, + traits::{ + fungible::Inspect, + tokens::{fungible::hold::Mutate, Precision::Exact}, + Get, OriginTrait, + }, +}; +use frame_system::pallet_prelude::*; +pub use pallet::*; +use scale_info::TypeInfo; +use sp_core::H256; +use sp_runtime::{traits::Saturating, BoundedVec, SaturatedConversion}; +use sp_std::vec::Vec; +use transports::{ + ismp::{self as ismp, FeeMetadata, IsmpDispatcher}, + xcm::{self as xcm, Location, QueryId}, +}; +pub use xcm::NotifyQueryHandler; +use xcm::Response; + +use super::Weight; + +/// Messaging transports. +pub mod transports; + +type AccountIdOf = ::AccountId; +type BlockNumberOf = BlockNumberFor; +type BalanceOf = <::Deposit as Inspect>>::Balance; +pub type MessageId = u64; + +#[frame_support::pallet] +pub mod pallet { + + use frame_support::{ + dispatch::DispatchResult, + pallet_prelude::*, + storage::KeyLenOf, + traits::tokens::{fungible::hold::Mutate, Precision::Exact}, + }; + use sp_core::H256; + use sp_runtime::traits::TryConvert; + + use super::*; + + /// Configuration of the pallet by specifying the parameters and types on which it depends. + #[pallet::config] + pub trait Config: frame_system::Config { + /// Because this pallet emits events, it depends on the runtime's definition of an event. + type RuntimeEvent: From> + IsType<::RuntimeEvent>; + + type OriginConverter: TryConvert; + + #[pallet::constant] + type ByteFee: Get>; + + type Callback: CallbackT; + + /// The deposit mechanism. + type Deposit: Mutate + + Inspect; + + #[pallet::constant] + type IsmpByteFee: Get>; + + /// The ISMP message dispatcher. + type IsmpDispatcher: IsmpDispatcher>; + + /// The maximum length of any additional application-specific metadata relating to a + /// request. + #[pallet::constant] + type MaxContextLen: Get; + /// The maximum length of outbound (posted) data. + #[pallet::constant] + type MaxDataLen: Get; + #[pallet::constant] + type MaxKeys: Get; + #[pallet::constant] + type MaxKeyLen: Get; + + #[pallet::constant] + type MaxResponseLen: Get; + #[pallet::constant] + type MaxRemovals: Get; + + /// Overarching hold reason. + type RuntimeHoldReason: From; + + type Xcm: NotifyQueryHandler; + + type XcmResponseOrigin: EnsureOrigin; + } + + #[pallet::pallet] + pub struct Pallet(_); + + #[pallet::storage] + pub(super) type Messages = StorageDoubleMap< + _, + Blake2_128Concat, + T::AccountId, + Blake2_128Concat, + MessageId, + Message, + OptionQuery, + >; + + #[pallet::storage] + pub(super) type IsmpRequests = + StorageMap<_, Identity, H256, (T::AccountId, MessageId), OptionQuery>; + + #[pallet::storage] + pub(super) type XcmQueries = + StorageMap<_, Identity, QueryId, (T::AccountId, MessageId), OptionQuery>; + + /// The events that can be emitted. + #[pallet::event] + #[pallet::generate_deposit(pub(super) fn deposit_event)] + pub enum Event { + /// A GET has been dispatched via ISMP. + IsmpGetDispatched { + /// The origin of the request. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The ISMP request commitment. + commitment: H256, + /// An optional callback to be used to return the response. + callback: Option, + }, + /// A response to a GET has been received via ISMP. + IsmpGetResponseReceived { + /// The destination of the response. + dest: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The ISMP request commitment. + commitment: H256, + }, + /// A POST has been dispatched via ISMP. + IsmpPostDispatched { + /// The origin of the request. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The ISMP request commitment. + commitment: H256, + /// An optional callback to be used to return the response. + callback: Option, + }, + /// A response to a POST has been received via ISMP. + IsmpPostResponseReceived { + /// The destination of the response. + dest: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The ISMP request commitment. + commitment: H256, + }, + /// A XCM query has been created. + XcmQueryCreated { + /// The origin of the request. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The identifier of the created XCM query. + query_id: QueryId, + /// An optional callback to be used to return the response. + callback: Option, + }, + /// A response to a XCM query has been received. + XcmResponseReceived { + /// The destination of the response. + dest: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The identifier of the XCM query. + query_id: QueryId, + /// The query response. + response: Response, + }, + /// A callback has been executed successfully. + CallbackExecuted { + /// The origin of the callback. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The successful callback. + callback: Callback, + }, + /// A callback has failed. + CallbackFailed { + /// The origin of the callback. + origin: T::AccountId, + /// The identifier specified for the request. + id: MessageId, + /// The callback which failed. + callback: Callback, + post_info: PostDispatchInfo, + /// The error which occurred. + error: DispatchError, + }, + /// One or more messages have been removed for the origin. + Removed { + /// The origin of the messages. + origin: T::AccountId, + /// The messages which were removed. + messages: Vec, + }, + } + + #[pallet::error] + pub enum Error { + DispatchFailed, + InvalidMessage, + InvalidQuery, + OriginConversionFailed, + MessageExists, + RequestPending, + } + + /// A reason for the pallet placing a hold on funds. + #[pallet::composite_enum] + pub enum HoldReason { + /// Held for the duration of a message's lifespan. + #[codec(index = 0)] + Messaging, + } + + #[pallet::call] + impl Pallet { + #[pallet::call_index(0)] + #[pallet::weight(Weight::zero())] // todo: benchmarking after consolidating storage + pub fn send(_origin: OriginFor, _id: MessageId) -> DispatchResult { + // e.g. Message::StateQuery { dest: Parachain(1000), storage_keys: vec![] } + // e.g. Message::Transact { dest: Parachain(1000), call: vec![] } + todo!("Reserved for messaging abstractions") + } + + // TODO: does ismp allow querying to ensure that specified para id is supported? + #[pallet::call_index(1)] + #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage + // Add any additional gas limit specified for callback execution + .saturating_add(callback.map(|cb| { + T::Callback::weight().saturating_add(cb.weight) + }).unwrap_or_default()) + )] + pub fn ismp_get( + origin: OriginFor, + id: MessageId, + message: ismp::Get, + fee: BalanceOf, + callback: Option, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + // Calculate deposit and place on hold. + let deposit = Self::calculate_deposit( + message.calculate_deposit() + + // IsmpRequests + (KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len()) + .saturated_into::>() * + T::ByteFee::get(), + ); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + + // Process message by dispatching request via ISMP. + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + let commitment = T::IsmpDispatcher::default() + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) + .map_err(|_| Error::::DispatchFailed)?; + + // Store commitment for lookup on response, message for querying, response/timeout + // handling. + IsmpRequests::::insert(&commitment, (&origin, id)); + Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); + Pallet::::deposit_event(Event::::IsmpGetDispatched { + origin, + id, + commitment, + callback, + }); + Ok(()) + } + + // TODO: does ismp allow querying to ensure that specified para id is supported? + #[pallet::call_index(2)] + #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage + // Add any additional gas limit specified for callback execution + .saturating_add(callback.map(|cb| { + T::Callback::weight().saturating_add(cb.weight) + }).unwrap_or_default()) + )] + pub fn ismp_post( + origin: OriginFor, + id: MessageId, + message: ismp::Post, + fee: BalanceOf, + callback: Option, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + // Calculate deposit and place on hold. + let deposit = Self::calculate_deposit( + message.calculate_deposit() + + // IsmpRequests + (KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len()) + .saturated_into::>() * + T::ByteFee::get(), + ); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + + // Process message by dispatching request via ISMP. + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + let commitment = T::IsmpDispatcher::default() + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) + .map_err(|_| Error::::DispatchFailed)?; + + // Store commitment for lookup on response, message for querying, response/timeout + // handling. + IsmpRequests::::insert(&commitment, (&origin, id)); + Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); + Pallet::::deposit_event(Event::::IsmpPostDispatched { + origin, + id, + commitment, + callback, + }); + Ok(()) + } + + #[pallet::call_index(3)] + #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage + // Add any additional gas limit specified for callback execution + .saturating_add(callback.map(|cb| { + T::Callback::weight().saturating_add(cb.weight) + }).unwrap_or_default()) + // TODO: add weight of xcm_response dispatchable once benchmarked + )] + pub fn xcm_new_query( + origin: OriginFor, + id: u64, + responder: Location, + timeout: BlockNumberOf, + callback: Option, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + + // Calculate deposit and place on hold. + let deposit = Self::calculate_deposit( + // XcmQueries + (KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len() + + Option::::max_encoded_len()) + .saturated_into::>() * + T::ByteFee::get(), + ); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + + // Process message by creating new query via XCM. + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + // Xcm only uses/stores pallet, index - i.e. (u8,u8) + let notify = Call::::xcm_response { query_id: 0, response: Default::default() }; + let querier = T::OriginConverter::try_convert(T::RuntimeOrigin::signed(origin.clone())) + .map_err(|_| Error::::OriginConversionFailed)?; + let query_id = T::Xcm::new_notify_query(responder, notify, timeout, querier); + + // Store query id for later lookup on response, message for querying status, + // response/timeout handling. + XcmQueries::::insert(&query_id, (&origin, id)); + Messages::::insert(&origin, id, Message::XcmQuery { query_id, callback, deposit }); + Pallet::::deposit_event(Event::::XcmQueryCreated { + origin, + id, + query_id, + callback, + }); + Ok(()) + } + + // NOTE: dispatchable should not fail, otherwise response will be lost. + #[pallet::call_index(4)] + #[pallet::weight(Weight::zero())] // todo: benchmarking + pub fn xcm_response( + origin: OriginFor, + query_id: QueryId, + response: Response, + ) -> DispatchResult { + T::XcmResponseOrigin::ensure_origin(origin)?; + + // Lookup message from query id. + let (origin, id) = XcmQueries::::take(query_id).ok_or(Error::::InvalidQuery)?; + let Some(Message::XcmQuery { query_id, callback, deposit }) = + Messages::::get(&origin, &id) + else { + return Err(Error::::InvalidMessage.into()) + }; + + // Attempt callback with response if specified. + if let Some(callback) = callback { + log::debug!(target: "pop-api::extension", "xcm callback={:?}, response={:?}", callback, response); + if Self::call(origin.clone(), callback, id, &response, deposit).is_ok() { + Self::deposit_event(Event::::XcmResponseReceived { + dest: origin, + id, + query_id, + response, + }); + return Ok(()); + } + } + + // Otherwise store response for manual retrieval and removal. + Messages::::insert( + &origin, + &id, + Message::XcmResponse { query_id, response: response.clone(), deposit }, + ); + Self::deposit_event(Event::::XcmResponseReceived { + dest: origin, + id, + query_id, + response, + }); + Ok(()) + } + + // Remove a request/response, returning any deposit previously taken. + #[pallet::call_index(5)] + #[pallet::weight(Weight::zero())] // todo: benchmarking after consolidating storage + pub fn remove( + origin: OriginFor, + messages: BoundedVec, + ) -> DispatchResult { + let origin = ensure_signed(origin)?; + for id in &messages { + // Ensure request exists and is not pending. + let deposit = match Messages::::take(&origin, id) { + Some(message) => match message { + Message::Ismp { .. } | Message::XcmQuery { .. } => { + return Err(Error::::RequestPending.into()); + }, + Message::IsmpResponse { commitment, deposit, .. } => { + IsmpRequests::::remove(commitment); + deposit + }, + Message::XcmResponse { query_id, deposit, .. } => { + XcmQueries::::remove(query_id); + deposit + }, + Message::IsmpTimedOut { .. } => { + todo!() + }, + }, + None => { + return Err(Error::::InvalidMessage.into()); + }, + }; + // Return deposit. + T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; + } + Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); + Ok(()) + } + } +} + +impl Pallet { + // Calculate the deposit required for a particular message. + fn calculate_deposit(deposit: BalanceOf) -> BalanceOf { + // Add amount for `Messages` key and value + deposit.saturating_add( + (KeyLenOf::>::get().saturated_into::>() + + Message::::max_encoded_len().saturated_into::>()) * + T::ByteFee::get(), + ) + } + + // Attempt to notify via callback. + fn call( + origin: AccountIdOf, + callback: Callback, + id: MessageId, + data: &impl Encode, + deposit: BalanceOf, + ) -> DispatchResult { + // TODO: check weight removed from block weight - may need dispatching via executive + // instead + let result = T::Callback::execute( + origin.clone(), + [callback.selector.to_vec(), (id, data).encode()].concat(), + callback.weight, + ); + log::debug!(target: "pop-api::extension", "callback weight={:?}, result={result:?}", callback.weight); + match result { + Ok(_post_info) => { + // TODO: do something with post_info: e.g. refund unused weight + // Return deposit. + T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; + Messages::::remove(&origin, &id); + Self::deposit_event(Event::::CallbackExecuted { + origin: origin.clone(), + id, + callback, + }); + Self::deposit_event(Event::::Removed { + origin: origin.clone(), + messages: [id].to_vec(), + }); + Ok(()) + }, + Err(sp_runtime::DispatchErrorWithPostInfo:: { post_info, error }) => { + // Fallback to storing the message for polling - pre-paid weight is lost. + Self::deposit_event(Event::::CallbackFailed { + origin: origin.clone(), + id, + callback, + post_info, + error, + }); + // TODO: logging + Err(error) + }, + } + } +} + +#[derive(Clone, Decode, Debug, Encode, MaxEncodedLen, PartialEq, TypeInfo)] +pub enum Status { + Pending, + TimedOut, + Complete, +} + +#[derive(Encode, Decode, Debug, MaxEncodedLen)] +#[cfg_attr(feature = "std", derive(PartialEq, Clone))] +#[repr(u8)] +#[allow(clippy::unnecessary_cast)] +pub enum Read { + #[codec(index = 0)] + Poll((T::AccountId, MessageId)), + #[codec(index = 1)] + Get((T::AccountId, MessageId)), + #[codec(index = 2)] + QueryId((T::AccountId, MessageId)), +} + +#[derive(Debug)] +#[cfg_attr(feature = "std", derive(PartialEq, Clone))] +pub enum ReadResult { + Poll(Option), + Get(Option>), + QueryId(Option), +} + +impl ReadResult { + pub fn encode(&self) -> Vec { + use ReadResult::*; + match self { + Poll(status) => status.encode(), + Get(response) => response.encode(), + QueryId(query_id) => query_id.encode(), + } + } +} + +impl crate::Read for Pallet { + type Read = Read; + type Result = ReadResult; + + fn weight(_read: &Self::Read) -> Weight { + // TODO: implement benchmarks + Weight::zero() + } + + fn read(request: Self::Read) -> Self::Result { + match request { + Read::Poll(request) => + ReadResult::Poll(Messages::::get(request.0, request.1).map(|m| match m { + Message::Ismp { .. } | Message::XcmQuery { .. } => Status::Pending, + Message::IsmpTimedOut { .. } => Status::TimedOut, + Message::IsmpResponse { .. } | Message::XcmResponse { .. } => Status::Complete, + })), + Read::Get(request) => + ReadResult::Get(Messages::::get(request.0, request.1).and_then(|m| match m { + Message::IsmpResponse { response, .. } => Some(response.into_inner()), + Message::XcmResponse { response, .. } => Some(response.encode()), + _ => None, + })), + Read::QueryId(request) => ReadResult::QueryId( + Messages::::get(request.0, request.1).and_then(|m| match m { + Message::XcmQuery { query_id, .. } | Message::XcmResponse { query_id, .. } => + Some(query_id), + _ => None, + }), + ), + } + } +} + +trait CalculateDeposit { + fn calculate_deposit(&self) -> Deposit; +} + +#[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +#[scale_info(skip_type_params(T))] +enum Message { + Ismp { + commitment: H256, + callback: Option, + deposit: BalanceOf, + }, + IsmpTimedOut { + commitment: H256, + deposit: BalanceOf, + }, + IsmpResponse { + commitment: H256, + deposit: BalanceOf, + response: BoundedVec, + }, + XcmQuery { + query_id: QueryId, + callback: Option, + deposit: BalanceOf, + }, + XcmResponse { + query_id: QueryId, + deposit: BalanceOf, + response: Response, + }, +} + +// Message selector and pre-paid weight used as gas limit +#[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +pub struct Callback { + pub selector: [u8; 4], + pub weight: Weight, +} + +pub trait CallbackT { + fn execute(account: T::AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo; + + fn weight() -> Weight; +} diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs new file mode 100644 index 000000000..5f179a15b --- /dev/null +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -0,0 +1,254 @@ +use core::marker::PhantomData; + +pub(crate) use ::ismp::dispatcher::{FeeMetadata, IsmpDispatcher}; +use ::ismp::{ + dispatcher::{ + DispatchGet, + DispatchRequest::{self}, + }, + host::StateMachine, +}; +use codec::{Decode, Encode, MaxEncodedLen}; +use frame_support::{ + pallet_prelude::Weight, traits::Get as _, CloneNoBound, DebugNoBound, EqNoBound, + PartialEqNoBound, +}; +use ismp::{ + dispatcher::DispatchPost, + module::IsmpModule, + router::{GetResponse, PostRequest, PostResponse, Request::*, Response, Timeout}, + Error, +}; +use pallet_ismp::weights::IsmpModuleWeight; +use scale_info::TypeInfo; +use sp_core::{keccak_256, H256}; +use sp_runtime::{BoundedVec, SaturatedConversion, Saturating}; + +use crate::messaging::{ + pallet::{Config, Event, IsmpRequests, Messages, Pallet}, + AccountIdOf, BalanceOf, CalculateDeposit, MessageId, Vec, +}; + +pub const ID: [u8; 3] = *b"pop"; + +type DbWeightOf = ::DbWeight; + +#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo)] +#[scale_info(skip_type_params(T))] +pub enum Message { + Get(Get), + Post(Post), +} + +impl From> for DispatchRequest { + fn from(value: Message) -> Self { + match value { + Message::Get(get) => get.into(), + Message::Post(post) => post.into(), + } + } +} + +#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo)] +#[scale_info(skip_type_params(T))] +pub struct Get { + // TODO: Option to support relay? + pub(crate) dest: u32, + pub(crate) height: u32, + pub(crate) timeout: u64, + pub(crate) context: BoundedVec, + pub(crate) keys: BoundedVec, T::MaxKeys>, +} + +impl From> for DispatchGet { + fn from(value: Get) -> Self { + DispatchGet { + dest: StateMachine::Polkadot(value.dest), + from: ID.into(), + keys: value.keys.into_iter().map(|key| key.into_inner()).collect(), + height: value.height.into(), + context: value.context.into_inner(), + timeout: value.timeout, + } + } +} + +impl From> for DispatchRequest { + fn from(value: Get) -> Self { + DispatchRequest::Get(value.into()) + } +} + +impl CalculateDeposit> for Get { + fn calculate_deposit(&self) -> BalanceOf { + let len = self.dest.encoded_size() + + self.height.encoded_size() + + self.timeout.encoded_size() + + self.context.len() + + self.keys.iter().map(|k| k.len()).sum::(); + calculate_deposit::(T::IsmpByteFee::get() * len.saturated_into()) + } +} + +#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo)] +#[scale_info(skip_type_params(T))] +pub struct Post { + // TODO: Option to support relay? + pub(crate) dest: u32, + pub(crate) timeout: u64, + pub(crate) data: BoundedVec, +} + +impl From> for DispatchPost { + fn from(value: Post) -> Self { + DispatchPost { + dest: StateMachine::Polkadot(value.dest), + from: ID.into(), + to: ID.into(), + timeout: value.timeout, + body: value.data.into_inner(), + } + } +} + +impl From> for DispatchRequest { + fn from(value: Post) -> Self { + DispatchRequest::Post(value.into()) + } +} + +impl CalculateDeposit> for Post { + fn calculate_deposit(&self) -> BalanceOf { + let len = self.dest.encoded_size() + self.timeout.encoded_size() + self.data.len(); + calculate_deposit::(T::IsmpByteFee::get() * len.saturated_into()) + } +} + +pub struct Handler(PhantomData); +impl Handler { + pub fn new() -> Self { + Self(PhantomData) + } +} + +impl IsmpModule for Handler { + fn on_accept(&self, _request: PostRequest) -> Result<(), Error> { + todo!() + } + + fn on_response(&self, response: Response) -> Result<(), Error> { + // Hash request to determine key for message lookup. + match response { + Response::Get(GetResponse { get, values }) => { + log::debug!(target: "pop-api::extension", "StorageValue={:?}", values[0]); + let commitment = H256::from(keccak_256(&ismp::router::Request::Get(get).encode())); + process_response( + &commitment, + &values, + || values.encode(), + |dest, id| Event::::IsmpGetResponseReceived { dest, id, commitment }, + ) + }, + Response::Post(PostResponse { post, response, .. }) => { + let commitment = H256::from(keccak_256(&Post(post).encode())); + process_response( + &commitment, + &response, + || response.clone(), // TODO: resolve unnecessary clone + |dest, id| Event::::IsmpPostResponseReceived { dest, id, commitment }, + ) + }, + } + } + + fn on_timeout(&self, timeout: Timeout) -> Result<(), Error> { + match timeout { + Timeout::Request(request) => { + // hash request to determine key for original request id lookup + let id = match request { + Get(get) => H256::from(keccak_256(&get.encode())), + Post(post) => H256::from(keccak_256(&post.encode())), + }; + let key = + IsmpRequests::::get(id).ok_or(Error::Custom("request not found".into()))?; + Messages::::try_mutate(key.0, key.1, |message| { + let Some(super::super::Message::Ismp { commitment, deposit, .. }) = message + else { + return Err(Error::Custom("message not found".into())) + }; + *message = Some(super::super::Message::IsmpTimedOut { + deposit: *deposit, + commitment: *commitment, + }); + Ok(()) + })?; + Ok(()) + }, + Timeout::Response(_response) => { + todo!() + }, + } + } +} + +// TODO: replace with benchmarked weight functions +impl IsmpModuleWeight for Pallet { + fn on_accept(&self, _request: &PostRequest) -> Weight { + todo!() + } + + fn on_timeout(&self, _timeout: &Timeout) -> Weight { + DbWeightOf::::get().reads_writes(2, 1) + } + + fn on_response(&self, _response: &Response) -> Weight { + DbWeightOf::::get().reads_writes(2, 2) + } +} + +fn calculate_deposit(mut deposit: BalanceOf) -> BalanceOf { + // Add amount for `IsmpRequests` lookup. + let key_len: BalanceOf = + (T::AccountId::max_encoded_len() + MessageId::max_encoded_len()).saturated_into(); + deposit.saturating_accrue( + T::ByteFee::get() * (H256::max_encoded_len().saturated_into::>() + key_len), + ); + + deposit +} + +fn process_response( + commitment: &H256, + encode: &impl Encode, + store: impl Fn() -> Vec, + event: impl Fn(AccountIdOf, MessageId) -> Event, +) -> Result<(), Error> { + let (origin, id) = + IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; + + let Some(super::super::Message::Ismp { commitment, callback, deposit }) = + Messages::::get(&origin, &id) + else { + return Err(Error::Custom("message not found".into())) + }; + + // Attempt callback with result if specified. + if let Some(callback) = callback { + // TODO: check response length + if Pallet::::call(origin.clone(), callback, id, &encode, deposit).is_ok() { + Pallet::::deposit_event(event(origin, id)); + return Ok(()); + } + } + + // Otherwise store response for manual retrieval and removal. + let response: BoundedVec = + store().try_into().map_err(|_| Error::Custom("response exceeds max".into()))?; + Messages::::insert( + &origin, + &id, + super::super::Message::IsmpResponse { commitment, deposit, response }, + ); + Pallet::::deposit_event(event(origin, id)); + Ok(()) +} diff --git a/pallets/api/src/messaging/transports/mod.rs b/pallets/api/src/messaging/transports/mod.rs new file mode 100644 index 000000000..64f4712a9 --- /dev/null +++ b/pallets/api/src/messaging/transports/mod.rs @@ -0,0 +1,4 @@ +/// Messaging using the Interoperable State Machine Protocol (ISMP). +pub mod ismp; +/// Messaging using Polkadot's Cross-Consensus Messaging (XCM). +pub(crate) mod xcm; diff --git a/pallets/api/src/messaging/transports/xcm.rs b/pallets/api/src/messaging/transports/xcm.rs new file mode 100644 index 000000000..f230d0463 --- /dev/null +++ b/pallets/api/src/messaging/transports/xcm.rs @@ -0,0 +1,14 @@ +pub(crate) use xcm::latest::{Location, QueryId, Response}; + +use crate::messaging::{pallet::Call, BlockNumberOf, Config}; + +pub trait NotifyQueryHandler { + /// Attempt to create a new query ID and register it as a query that is yet to respond, and + /// which will call a dispatchable when a response happens. + fn new_notify_query( + responder: impl Into, + notify: Call, + timeout: BlockNumberOf, + match_querier: impl Into, + ) -> u64; +} diff --git a/pop-api/examples/messaging/Cargo.toml b/pop-api/examples/messaging/Cargo.toml new file mode 100755 index 000000000..d0a800b40 --- /dev/null +++ b/pop-api/examples/messaging/Cargo.toml @@ -0,0 +1,22 @@ +[package] +authors = [ "R0GUE " ] +edition = "2021" +name = "messaging" +version = "0.1.0" + +[dependencies] +ink = { git = "https://github.com/r0gue-io/ink", branch = "sub0", default-features = false } +polkavm-derive = "0.11.0" +pop-api = { path = "../../../pop-api", default-features = false, features = [ "messaging" ] } + +[lib] +path = "lib.rs" + +[features] +default = [ "std" ] +e2e-tests = [ ] +ink-as-dependency = [ ] +std = [ + "ink/std", + "pop-api/std", +] diff --git a/pop-api/examples/messaging/lib.rs b/pop-api/examples/messaging/lib.rs new file mode 100755 index 000000000..1f015e51b --- /dev/null +++ b/pop-api/examples/messaging/lib.rs @@ -0,0 +1,268 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +use ink::{ + env::hash::{Blake2x256, CryptoHash}, + prelude::vec::Vec, + scale::{Compact, Encode}, + xcm::{ + prelude::{ + AccountId32, All, Asset, Junction::Parachain, Location, OriginKind, QueryId, + QueryResponseInfo, Weight, WeightLimit, Xcm, XcmHash, + }, + DoubleEncoded, VersionedXcm, + }, +}; +use pop_api::{ + incentives, + messaging::{self as api, ismp, ismp::Get, xcm::Response, MessageId, Status}, + StatusCode, +}; + +pub type Result = core::result::Result; + +#[ink::contract] +mod messaging { + use pop_api::messaging::{ismp::StorageValue, Callback}; + + use super::*; + + const UNAUTHORIZED: u32 = u32::MAX; + + #[ink(storage)] + #[derive(Default)] + pub struct Messaging { + para: u32, + id: MessageId, + } + + impl Messaging { + #[ink(constructor, payable)] + pub fn new(para: u32) -> Result { + let instance = Self { para, id: 0 }; + incentives::register(instance.env().account_id())?; + Ok(instance) + } + + #[ink(message)] + pub fn get(&mut self, key: Vec, height: u32) -> Result<()> { + self.id = self.id.saturating_add(1); + ismp::get( + self.id, + Get::new(self.para, height, 0, Vec::default(), Vec::from([key.clone()])), + 0, + Some(Callback::to(0x57ad942b, Weight::from_parts(800_000_000, 500_000))), + )?; + self.env().emit_event(IsmpRequested { id: self.id, key, height }); + Ok(()) + } + + #[ink(message, payable)] + pub fn fund(&mut self) -> Result<()> { + let dest = Location::new(1, Parachain(self.para)); + + // Reserve transfer specified assets to contract account on destination. + let asset: Asset = (Location::parent(), self.env().transferred_value()).into(); + let beneficiary = hashed_account(4_001, self.env().account_id()); // todo: para id getter + let message: Xcm<()> = Xcm::builder_unsafe() + .withdraw_asset(asset.clone().into()) + .initiate_reserve_withdraw( + asset.clone().into(), + dest.clone(), + Xcm::builder_unsafe() + .buy_execution(asset.clone(), WeightLimit::Unlimited) + .deposit_asset( + All.into(), + Location::new(0, AccountId32 { network: None, id: beneficiary.0 }), + ) + .build(), + ) + .build(); + api::xcm::execute(&VersionedXcm::V4(message)).unwrap(); // todo: handle error + + self.env().emit_event(Funded { + account_id: beneficiary, + value: self.env().transferred_value(), + }); + Ok(()) + } + + #[ink(message, payable)] + pub fn transact(&mut self, call: DoubleEncoded<()>, weight: Weight) -> Result<()> { + let dest = Location::new(1, Parachain(self.para)); + + // Register a new query for receiving a response, used to report transact status. + self.id = self.id.saturating_add(1); + let query_id = api::xcm::new_query( + self.id, + dest.clone(), + self.env().block_number().saturating_add(100), + Some(Callback::to(0x641b0b03, Weight::from_parts(800_000_000, 500_000))), + )? + .unwrap(); // TODO: handle error + + // TODO: provide an api function for determining the local para id and max weight value + // for processing the reported transact status on the local chain. + let response = QueryResponseInfo { + // Route back to this parachain. + destination: Location::new(1, Parachain(4_001)), + query_id, + max_weight: Weight::from_parts(1_000_000, 5_000), + }; + + // Send transact message. + let fees: Asset = (Location::parent(), self.env().transferred_value()).into(); + let message: Xcm<()> = self._transact(call, weight, fees, response); + let hash = api::xcm::send(&dest.into_versioned(), &VersionedXcm::V4(message)).unwrap(); // todo: handle error + + self.env().emit_event(XcmRequested { id: self.id, query_id, hash }); + Ok(()) + } + + #[ink(message)] + pub fn complete(&mut self, id: MessageId) -> Result<()> { + if let Ok(Some(status)) = api::poll((self.env().account_id(), id)) { + if status == Status::Complete { + let result = api::get((self.env().account_id(), id))?; + api::remove([id].to_vec())?; + self.env().emit_event(Completed { id, result }); + } + } + Ok(()) + } + + fn _transact( + &self, + call: DoubleEncoded<()>, + weight: Weight, + fees: Asset, + response: QueryResponseInfo, + ) -> Xcm<()> { + let beneficiary = hashed_account(4_001, self.env().account_id()); // todo: para id getter + Xcm::builder_unsafe() + .withdraw_asset(fees.clone().into()) + .buy_execution(fees, WeightLimit::Unlimited) + .set_appendix( + Xcm::builder_unsafe() + .refund_surplus() + .deposit_asset( + All.into(), + Location::new(0, AccountId32 { network: None, id: beneficiary.0 }), + ) + .build(), + ) + .set_error_handler(Xcm::builder_unsafe().report_error(response.clone()).build()) + .transact(OriginKind::SovereignAccount, weight, call) + .report_transact_status(response) + .build() + } + } + + impl api::ismp::OnGetResponse for Messaging { + #[ink(message)] + fn on_response(&mut self, id: MessageId, values: Vec) -> pop_api::Result<()> { + if self.env().caller() != self.env().account_id() { + return Err(UNAUTHORIZED.into()) + } + self.env().emit_event(GetCompleted { id, values }); + Ok(()) + } + } + + impl api::xcm::OnResponse for Messaging { + #[ink(message)] + fn on_response(&mut self, id: MessageId, response: Response) -> Result<()> { + if self.env().caller() != self.env().account_id() { + return Err(UNAUTHORIZED.into()) + } + self.env().emit_event(XcmCompleted { id, result: response }); + Ok(()) + } + } + + #[ink::event] + pub struct IsmpRequested { + #[ink(topic)] + pub id: MessageId, + pub key: Vec, + pub height: BlockNumber, + } + + #[ink::event] + pub struct Funded { + #[ink(topic)] + pub account_id: AccountId, + pub value: Balance, + } + + #[ink::event] + pub struct XcmRequested { + #[ink(topic)] + pub id: MessageId, + #[ink(topic)] + pub query_id: QueryId, + #[ink(topic)] + pub hash: XcmHash, + } + + #[ink::event] + pub struct Completed { + #[ink(topic)] + pub id: MessageId, + pub result: Option>, + } + + #[ink::event] + pub struct XcmCompleted { + #[ink(topic)] + pub id: MessageId, + pub result: Response, + } + + #[ink::event] + pub struct GetCompleted { + #[ink(topic)] + pub id: MessageId, + pub values: Vec, + } + + // todo: make hasher generic and move to pop-api + fn hashed_account(para_id: u32, account_id: AccountId) -> AccountId { + let location = ( + b"SiblingChain", + Compact::::from(para_id), + (b"AccountId32", account_id.0).encode(), + ) + .encode(); + let mut output = [0u8; 32]; + Blake2x256::hash(&location, &mut output); + AccountId::from(output) + } + + #[cfg(test)] + mod tests { + + use super::*; + + #[ink::test] + fn default_works() { + Messaging::new(1_000); + } + + #[test] + fn it_works() { + let account_id: [u8; 32] = [ + 27, 2, 24, 17, 104, 5, 173, 98, 25, 32, 36, 0, 82, 159, 11, 212, 178, 11, 39, 219, + 14, 178, 226, 179, 216, 62, 19, 85, 226, 17, 80, 179, + ]; + let location = ( + b"SiblingChain", + Compact::::from(4001), + (b"AccountId32", account_id).encode(), + ) + .encode(); + let mut output = [0u8; 32]; + Blake2x256::hash(&location, &mut output); + println!("{output:?}") + } + } +} diff --git a/pop-api/integration-tests/contracts/messaging/Cargo.toml b/pop-api/integration-tests/contracts/messaging/Cargo.toml new file mode 100755 index 000000000..28aa1a4c6 --- /dev/null +++ b/pop-api/integration-tests/contracts/messaging/Cargo.toml @@ -0,0 +1,22 @@ +[package] +authors = [ "R0GUE " ] +edition = "2021" +name = "messaging" +version = "0.1.0" + +[dependencies] +ink = { git = "https://github.com/r0gue-io/ink", branch = "sub0", default-features = false } +polkavm-derive = "0.11.0" +pop-api = { path = "../../../../pop-api", default-features = false, features = [ "messaging" ] } + +[lib] +path = "lib.rs" + +[features] +default = [ "std" ] +e2e-tests = [ ] +ink-as-dependency = [ ] +std = [ + "ink/std", + "pop-api/std", +] diff --git a/pop-api/integration-tests/contracts/messaging/lib.rs b/pop-api/integration-tests/contracts/messaging/lib.rs new file mode 100755 index 000000000..b2de8c3c8 --- /dev/null +++ b/pop-api/integration-tests/contracts/messaging/lib.rs @@ -0,0 +1,193 @@ +#![cfg_attr(not(feature = "std"), no_std, no_main)] + +use ink::{env::debug_println, prelude::vec::Vec}; +use pop_api::{ + messaging::{ + self as api, + ismp::{Get, Post}, + xcm::{Location, QueryId, Response}, + Callback, MessageId, Status, + }, + StatusCode, +}; + +pub type Result = core::result::Result; + +#[ink::contract] +mod messaging { + use ink::xcm::prelude::Weight; + use pop_api::messaging::ismp::StorageValue; + + use super::*; + + #[ink(storage)] + #[derive(Default)] + pub struct Contract; + + impl Contract { + #[ink(constructor, payable)] + pub fn new() -> Self { + Default::default() + } + + #[ink(message)] + pub fn ismp_get( + &mut self, + id: MessageId, + request: Get, + fee: Balance, + callback: bool, + ) -> Result<()> { + debug_println!( + "messaging::ismp_get id={id}, dest={}, height={}, timeout={}, fee={fee}, \ + callback={callback}", + request.dest, + request.height, + request.timeout + ); + api::ismp::get( + id, + request, + fee, + callback.then_some( + // See `api::ismp::OnGetResponse` impl below + Callback::to(0x57ad942b, Weight::from_parts(600_000_000, 150_000)), + ), + )?; + Ok(()) + } + + #[ink(message)] + pub fn ismp_post( + &mut self, + id: MessageId, + request: Post, + fee: Balance, + callback: bool, + ) -> Result<()> { + debug_println!( + "messaging::ismp_post id={id}, dest={}, timeout={}, fee={fee}, callback={callback}", + request.dest, + request.timeout + ); + api::ismp::post( + id, + request, + fee, + callback.then_some( + // See `api::ismp::OnPostResponse` impl below + Callback::to(0xcfb0a1d2, Weight::from_parts(600_000_000, 150_000)), + ), + )?; + Ok(()) + } + + #[ink(message)] + pub fn xcm_new_query( + &mut self, + id: MessageId, + responder: Location, + timeout: BlockNumber, + callback: bool, + ) -> Result> { + debug_println!( + "messaging::xcm_new_query id={id}, responder={responder:?}, timeout={timeout}, \ + callback={callback}" + ); + api::xcm::new_query( + id, + responder, + timeout, + callback.then_some( + // See api::xcm::OnResponse impl below + Callback::to(0x641b0b03, Weight::from_parts(600_000_000, 200_000)), + ), + ) + } + + #[ink(message)] + pub fn poll(&self, id: MessageId) -> Result> { + debug_println!("messaging::poll id={id}"); + api::poll((self.env().account_id(), id)) + } + + #[ink(message)] + pub fn get(&self, id: MessageId) -> Result>> { + debug_println!("messaging::get id={id}"); + api::get((self.env().account_id(), id)) + } + + #[ink(message)] + pub fn remove(&mut self, id: MessageId) -> Result<()> { + debug_println!("messaging::remove id={id}"); + api::remove([id].to_vec())?; + Ok(()) + } + } + + impl api::ismp::OnGetResponse for Contract { + #[ink(message)] + fn on_response(&mut self, id: MessageId, values: Vec) -> Result<()> { + debug_println!("messaging::ismp::get::on_response id={id}, values={values:?});"); + self.env().emit_event(IsmpGetCompleted { id, values }); + Ok(()) + } + } + + impl api::ismp::OnPostResponse for Contract { + #[ink(message)] + fn on_response(&mut self, id: MessageId, response: Vec) -> Result<()> { + debug_println!("messaging::ismp::post::on_response id={id}, response={response:?});"); + self.env().emit_event(IsmpPostCompleted { id, response }); + Ok(()) + } + } + + impl api::xcm::OnResponse for Contract { + #[ink(message)] + fn on_response(&mut self, id: MessageId, response: Response) -> Result<()> { + debug_println!("messaging::xcm::on_response id={id}, response={response:?}"); + match response { + Response::Null => {}, + Response::Assets(_) => {}, + Response::ExecutionResult(_) => {}, + Response::Version(_) => {}, + Response::PalletsInfo(_) => {}, + Response::DispatchResult(_) => {}, + } + self.env().emit_event(XcmCompleted { id, result: response }); + Ok(()) + } + } + + #[ink::event] + pub struct IsmpGetCompleted { + #[ink(topic)] + pub id: MessageId, + pub values: Vec, + } + + #[ink::event] + pub struct IsmpPostCompleted { + #[ink(topic)] + pub id: MessageId, + pub response: Vec, + } + + #[ink::event] + pub struct XcmCompleted { + #[ink(topic)] + pub id: MessageId, + pub result: Response, + } + + #[cfg(test)] + mod tests { + use super::*; + + #[ink::test] + fn default_works() { + Contract::new(); + } + } +} diff --git a/pop-api/integration-tests/src/messaging.rs b/pop-api/integration-tests/src/messaging.rs new file mode 100644 index 000000000..4c312288c --- /dev/null +++ b/pop-api/integration-tests/src/messaging.rs @@ -0,0 +1,504 @@ +use ::ismp::router::{GetResponse, IsmpRouter, PostResponse, Response, StorageValue}; +use ismp::host::StateMachine; +use pallet_api::messaging::Event::*; +use pallet_ismp::mmr::Leaf; +use pop_api::{ + messaging::{ + ismp::{Get, Post}, + xcm::{self, Junction, Location, MaybeErrorCode, NetworkId, QueryId}, + MessageId, Status, + }, + primitives::{BlockNumber, Error}, +}; +use pop_runtime_devnet::RuntimeEvent; +use sp_io::{hashing::keccak_256, TestExternalities}; +use sp_runtime::{app_crypto::sp_core::H160, offchain::OffchainOverlayedChange, testing::H256}; +use xcm_executor::traits::OnResponse; + +use super::*; + +const CONTRACT: &str = "contracts/messaging/target/ink/messaging.riscv"; +const ASSET_HUB: u32 = 1_000; +const HYPERBRIDGE: u32 = 4_009; +pub(crate) const ISMP_MODULE_ID: [u8; 3] = *b"pop"; + +#[test] +fn ismp_get_request_works() { + let id = 42; + let key = "some_key".as_bytes().to_vec(); + let request = Get::new(ASSET_HUB, 0, 0, "some_context".as_bytes().to_vec(), vec![key.clone()]); + let response = vec![StorageValue { key, value: Some("some_value".as_bytes().to_vec()) }]; + + // Create a get request. + let mut ext = new_test_ext(); + let contract = ext.execute_with(|| { + let contract = Contract::new(); + + assert_ok!(contract.ismp_get(id, request, 0, false)); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(IsmpGetDispatched { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + assert!(System::events().iter().any(|e| { + matches!(e.event, + RuntimeEvent::Ismp(pallet_ismp::Event::Request { dest_chain, source_chain , ..}) + if dest_chain == StateMachine::Polkadot(ASSET_HUB) && source_chain == StateMachine::Polkadot(100) + ) + })); + + contract + }); + + // Look up the request within offchain state in order to provide a response. + let ismp::router::Request::Get(get) = get_ismp_request(&mut ext) else { panic!() }; + + // Provide a response. + ext.execute_with(|| { + let module = Router::default().module_for_id(ISMP_MODULE_ID.to_vec()).unwrap(); + let commitment = H256::from(keccak_256(&ismp::router::Request::Get(get.clone()).encode())); + module + .on_response(Response::Get(GetResponse { get, values: response.clone() })) + .unwrap(); + System::assert_has_event( + IsmpGetResponseReceived { dest: contract.id.clone(), id, commitment }.into(), + ); + + assert_eq!(contract.poll(id).unwrap(), Some(Status::Complete)); + assert_eq!(contract.get(id).unwrap(), Some(response.encode())); + assert_ok!(contract.remove(id)); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn ismp_get_request_with_callback_works() { + let id = 42; + let key = "some_key".as_bytes().to_vec(); + let request = Get::new(ASSET_HUB, 0, 0, "some_context".as_bytes().to_vec(), vec![key.clone()]); + let response = vec![StorageValue { key, value: Some("some_value".as_bytes().to_vec()) }]; + + // Create a get request with callback. + let mut ext = new_test_ext(); + let contract = ext.execute_with(|| { + let contract = Contract::new(); + + assert_ok!(contract.ismp_get(id, request, 0, true)); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(IsmpGetDispatched { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + assert!(System::events().iter().any(|e| { + matches!(e.event, + RuntimeEvent::Ismp(pallet_ismp::Event::Request { dest_chain, source_chain , ..}) + if dest_chain == StateMachine::Polkadot(ASSET_HUB) && source_chain == StateMachine::Polkadot(100) + ) + })); + + contract + }); + + // Look up the request within offchain state in order to provide a response. + let ismp::router::Request::Get(get) = get_ismp_request(&mut ext) else { panic!() }; + + // Provide a response. + ext.execute_with(|| { + let module = Router::default().module_for_id(ISMP_MODULE_ID.to_vec()).unwrap(); + let commitment = H256::from(keccak_256(&ismp::router::Request::Get(get.clone()).encode())); + module + .on_response(Response::Get(GetResponse { get, values: response.clone() })) + .unwrap(); + System::assert_has_event( + IsmpGetResponseReceived { dest: contract.id.clone(), id, commitment }.into(), + ); + + assert_eq!(contract.last_event(), IsmpGetCompleted { id, values: response }.encode()); + assert_eq!(contract.poll(id).unwrap(), None); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(CallbackExecuted { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn ismp_post_request_works() { + let id = 42; + let request = Post::new(HYPERBRIDGE, 0, "some_data".as_bytes().to_vec()); + let response = "some_value".as_bytes().to_vec(); + + // Create a post request. + let mut ext = new_test_ext(); + let contract = ext.execute_with(|| { + let contract = Contract::new(); + + assert_ok!(contract.ismp_post(id, request, 0, false)); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(IsmpPostDispatched { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + assert!(System::events().iter().any(|e| { + matches!(e.event, + RuntimeEvent::Ismp(pallet_ismp::Event::Request { dest_chain, source_chain , ..}) + if dest_chain == StateMachine::Polkadot(HYPERBRIDGE) && source_chain == StateMachine::Polkadot(100) + ) + })); + + contract + }); + + // Look up the request within offchain state in order to provide a response. + let ismp::router::Request::Post(post) = get_ismp_request(&mut ext) else { panic!() }; + + // Provide a response. + ext.execute_with(|| { + let module = Router::default().module_for_id(ISMP_MODULE_ID.to_vec()).unwrap(); + let commitment = + H256::from(keccak_256(&ismp::router::Request::Post(post.clone()).encode())); + module + .on_response(Response::Post(PostResponse { + post, + response: response.clone(), + timeout_timestamp: 0, + })) + .unwrap(); + System::assert_has_event( + IsmpPostResponseReceived { dest: contract.id.clone(), id, commitment }.into(), + ); + + assert_eq!(contract.poll(id).unwrap(), Some(Status::Complete)); + assert_eq!(contract.get(id).unwrap(), Some(response)); + assert_ok!(contract.remove(id)); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn ismp_post_request_with_callback_works() { + let id = 42; + let request = Post::new(HYPERBRIDGE, 0, "some_data".as_bytes().to_vec()); + let response = "some_value".as_bytes().to_vec(); + + // Create a post request with callback. + let mut ext = new_test_ext(); + let contract = ext.execute_with(|| { + let contract = Contract::new(); + + assert_ok!(contract.ismp_post(id, request, 0, true)); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(IsmpPostDispatched { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + assert!(System::events().iter().any(|e| { + matches!(e.event, + RuntimeEvent::Ismp(pallet_ismp::Event::Request { dest_chain, source_chain , ..}) + if dest_chain == StateMachine::Polkadot(HYPERBRIDGE) && source_chain == StateMachine::Polkadot(100) + ) + })); + + contract + }); + + // Look up the request within offchain state in order to provide a response. + let ismp::router::Request::Post(post) = get_ismp_request(&mut ext) else { panic!() }; + + // Provide a response. + ext.execute_with(|| { + let module = Router::default().module_for_id(ISMP_MODULE_ID.to_vec()).unwrap(); + let commitment = + H256::from(keccak_256(&ismp::router::Request::Post(post.clone()).encode())); + module + .on_response(Response::Post(PostResponse { + post, + response: response.clone(), + timeout_timestamp: 0, + })) + .unwrap(); + System::assert_has_event( + IsmpPostResponseReceived { dest: contract.id.clone(), id, commitment }.into(), + ); + + assert_eq!(contract.last_event(), IsmpPostCompleted { id, response }.encode()); + assert_eq!(contract.poll(id).unwrap(), None); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(CallbackExecuted { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn xcm_query_works() { + let id = 42u64; + let origin = Location::new(1, [Junction::Parachain(ASSET_HUB)]); + let responder = origin.clone(); + let timeout = 100; + let response = xcm::Response::DispatchResult(MaybeErrorCode::Success); + new_test_ext().execute_with(|| { + let contract = Contract::new(); + + // Create a new query and check its status + let query_id = contract.xcm_new_query(id, responder, timeout, false).unwrap().unwrap(); + assert_eq!(query_id, 0); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(XcmQueryCreated { origin, id: message_id, query_id, ..}) + if origin == &contract.id && *message_id == id && *query_id == 0 + ) + })); + + // Provide a response. + let origin = translate(&origin); + let querier: Location = Junction::AccountId32 { + network: Some(NetworkId::Polkadot), + id: contract.id.clone().into(), + } + .into(); + assert!(pop_runtime_devnet::PolkadotXcm::expecting_response( + &origin, + query_id, + Some(&translate(&querier)) + )); + assert_ok!(Messaging::xcm_response( + pallet_xcm::Origin::Response(origin).into(), + query_id, + translate(&response) + )); + + assert_eq!(contract.poll(id).unwrap(), Some(Status::Complete)); + assert_eq!(contract.get(id).unwrap(), Some(response.encode())); + assert_ok!(contract.remove(id)); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +#[test] +fn xcm_query_with_callback_works() { + let id = 42u64; + let origin = Location::new(1, [Junction::Parachain(ASSET_HUB)]); + let responder = origin.clone(); + let timeout = 100; + let response = xcm::Response::DispatchResult(MaybeErrorCode::Success); + new_test_ext().execute_with(|| { + let contract = Contract::new(); + + // Create a new query and check its status + let query_id = contract.xcm_new_query(id, responder, timeout, true).unwrap().unwrap(); + assert_eq!(query_id, 0); + assert_eq!(contract.poll(id).unwrap(), Some(Status::Pending)); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(XcmQueryCreated { origin, id: message_id, query_id, ..}) + if origin == &contract.id && *message_id == id && *query_id == 0 + ) + })); + + // Provide a response. + let origin = translate(&origin); + let querier: Location = Junction::AccountId32 { + network: Some(NetworkId::Polkadot), + id: contract.id.clone().into(), + } + .into(); + assert!(pop_runtime_devnet::PolkadotXcm::expecting_response( + &origin, + query_id, + Some(&translate(&querier)) + )); + assert_ok!(Messaging::xcm_response( + pallet_xcm::Origin::Response(origin).into(), + query_id, + translate(&response) + )); + + assert_eq!(contract.last_event(), XcmCompleted { id, result: response }.encode()); + assert_eq!(contract.poll(id).unwrap(), None); + assert!(System::events().iter().any(|e| { + matches!(&e.event, + RuntimeEvent::Messaging(CallbackExecuted { origin, id: message_id, ..}) + if origin == &contract.id && *message_id == id + ) + })); + System::assert_has_event( + Removed { origin: contract.id.clone(), messages: vec![id] }.into(), + ); + }); +} + +// Get the last ismp request. +pub(crate) fn get_ismp_request(ext: &mut TestExternalities) -> ismp::router::Request { + // Get commitment from last ismp request event. + let commitment = ext.execute_with(|| { + System::read_events_for_pallet::>() + .iter() + .filter_map(|e| match e { + pallet_ismp::Event::::Request { commitment, .. } => + Some(commitment.clone()), + _ => None, + }) + .last() + .unwrap() + }); + // Read value from offchain storage overlay, stored via `NoOpMmrTree`. + let key = ("storage".as_bytes().to_vec(), (b"no_op", commitment).encode()); + let request = ext + .overlayed_changes() + .offchain() + .overlay() + .changes() + .filter_map(|c| { + (c.0 == &key).then(|| match c.1.value_ref() { + OffchainOverlayedChange::SetValue(value) => { + match Leaf::decode(&mut &value[..]).unwrap() { + Leaf::Request(req) => Some(req), + Leaf::Response(_) => None, + } + }, + _ => None, + }) + }) + .last() + .flatten() + .unwrap(); + // Ensure the request matches the commitment. + assert_eq!(commitment.0, keccak_256(&request.encode())); + request +} + +// Translate a source type into a target type via encoding/decoding. +fn translate(source: &S) -> T { + T::decode(&mut &source.encode()[..]).unwrap() +} + +// A simple, strongly typed wrapper for the contract. +struct Contract { + address: H160, + id: AccountId32, +} +impl Contract { + fn new() -> Self { + let (address, account_id) = + instantiate(CONTRACT, INIT_VALUE, function_selector("new"), vec![]); + Self { address, id: account_id } + } + + fn ismp_get( + &self, + id: MessageId, + request: Get, + fee: Balance, + callback: bool, + ) -> Result<(), Error> { + let result = self.call("ismp_get", (id, request, fee, callback).encode(), 0); + >::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn ismp_post( + &self, + id: MessageId, + request: Post, + fee: Balance, + callback: bool, + ) -> Result<(), Error> { + let result = self.call("ismp_post", (id, request, fee, callback).encode(), 0); + >::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn xcm_new_query( + &self, + id: MessageId, + responder: Location, + timeout: BlockNumber, + callback: bool, + ) -> Result, Error> { + let result = self.call("xcm_new_query", (id, responder, timeout, callback).encode(), 0); + , Error>>::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn poll(&self, request: MessageId) -> Result, Error> { + let result = self.call("poll", request.encode(), 0); + Result::, Error>::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn get(&self, request: MessageId) -> Result>, Error> { + let result = self.call("get", request.encode(), 0); + Result::>, Error>::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn remove(&self, request: MessageId) -> Result<(), Error> { + let result = self.call("remove", request.encode(), 0); + >::decode(&mut &result.data[1..]) + .unwrap_or_else(|_| panic!("Contract reverted: {:?}", result)) + } + + fn call(&self, function: &str, params: Vec, value: u128) -> ExecReturnValue { + let function = function_selector(function); + let params = [function, params].concat(); + bare_call(self.address.clone(), params, value).expect("should work") + } + + fn last_event(&self) -> Vec { + let events = System::read_events_for_pallet::>(); + let contract_events = events + .iter() + .filter_map(|event| match event { + pallet_revive::Event::::ContractEmitted { contract, data, .. } + if contract == &self.address => + Some(data.as_slice()), + _ => None, + }) + .collect::>(); + contract_events.last().unwrap().to_vec() + } +} + +#[derive(Decode, Encode)] +pub struct IsmpGetCompleted { + pub id: MessageId, + pub values: Vec, +} + +#[derive(Decode, Encode)] +pub struct IsmpPostCompleted { + pub id: MessageId, + pub response: Vec, +} + +#[derive(Decode, Encode)] +pub struct XcmCompleted { + pub id: MessageId, + pub result: xcm::Response, +} diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index e49a4c7d9..4735ed600 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -36,6 +36,10 @@ pub enum RuntimeRead { /// Non-fungible token queries. #[codec(index = 151)] NonFungibles(nonfungibles::Read), + /// Messaging read queries. + #[codec(index = 152)] + NonFungibles(messaging::Read), + } impl Readable for RuntimeRead { @@ -48,6 +52,8 @@ impl Readable for RuntimeRead { match self { RuntimeRead::Fungibles(key) => fungibles::Pallet::weight(key), RuntimeRead::NonFungibles(key) => nonfungibles::Pallet::weight(key), + RuntimeRead::Messaging(key) => messaging::Pallet::weight(key), + } } @@ -57,6 +63,7 @@ impl Readable for RuntimeRead { RuntimeRead::Fungibles(key) => RuntimeResult::Fungibles(fungibles::Pallet::read(key)), RuntimeRead::NonFungibles(key) => RuntimeResult::NonFungibles(nonfungibles::Pallet::read(key)), + RuntimeRead::Messaging(key) => RuntimeResult::Messaging(messaging::Pallet::read(key)), } } } @@ -69,6 +76,7 @@ pub enum RuntimeResult { Fungibles(fungibles::ReadResult), /// Non-fungible token read results. NonFungibles(nonfungibles::ReadResult), + Messaging(messaging::ReadResult), } impl RuntimeResult { @@ -93,6 +101,113 @@ impl nonfungibles::Config for Runtime { type WeightInfo = (); } +impl messaging::Config for Runtime { + type ByteFee = TransactionByteFee; + type Callback = Callback; + type Deposit = Balances; + // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as + // much as onchain cost. + type IsmpByteFee = (); + type IsmpDispatcher = Ismp; + type MaxContextLen = ConstU32<64>; + type MaxDataLen = ConstU32<1024>; + type MaxKeyLen = ConstU32<1000>; + type MaxKeys = ConstU32<10>; + // TODO: size appropriately + type MaxRemovals = ConstU32<1024>; + // TODO: ensure within the contract buffer bounds + type MaxResponseLen = ConstU32<1024>; + type OriginConverter = LocalOriginToLocation; + type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; + type Xcm = QueryHandler; + type XcmResponseOrigin = EnsureResponse; +} + +pub struct EnsureResponse; +impl> + From> EnsureOrigin for EnsureResponse { + type Success = Location; + + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + Origin::Response(location) => Ok(location), + r => Err(O::from(r)), + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + todo!() + } +} + +pub struct CallbackExecutor; +impl messaging::CallbackExecutor for CallbackExecutor { + fn execute(account: AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo { + type AddressMapper = ::AddressMapper; + + // Default + #[cfg(not(feature = "std"))] + let debug = DebugInfo::Skip; + #[cfg(not(feature = "std"))] + let collect_events = CollectEvents::Skip; + // Testing + #[cfg(feature = "std")] + let debug = DebugInfo::UnsafeDebug; + #[cfg(feature = "std")] + let collect_events = CollectEvents::UnsafeCollect; + + let mut output = Revive::bare_call( + RuntimeOrigin::signed(account.clone()), + AddressMapper::to_address(&account), + Default::default(), + weight, + Default::default(), + data, + debug, + collect_events, + ); + log::debug!(target: "pop-api::extension", "callback weight consumed={:?}, weight required={:?}", output.gas_consumed, output.gas_required); + if let Ok(return_value) = &output.result { + let pallet_revive::ExecReturnValue { flags, data } = return_value; + log::debug!(target: "pop-api::extension", "return data={:?}", data); + if return_value.did_revert() { + output.result = Err(pallet_revive::Error::::ContractReverted.into()); + } + } + + let post_info = PostDispatchInfo { + actual_weight: Some(output.gas_consumed.saturating_add(Self::weight())), + pays_fee: Default::default(), + }; + + output + .result + .map(|_| post_info) + .map_err(|e| DispatchErrorWithPostInfo { post_info, error: e }) + } + + fn weight() -> Weight { + todo!("") + use pallet_revive::WeightInfo; + ::WeightInfo::call() + } +} + + +// TODO!( default implementation where T: PolkadotXcm::Config +pub struct QueryHandler; +impl NotifyQueryHandler for QueryHandler { + fn new_notify_query( + responder: impl Into, + notify: messaging::Call, + timeout: BlockNumber, + match_querier: impl Into, + ) -> u64 { + PolkadotXcm::new_notify_query(responder, notify, timeout, match_querier) + } +} + #[derive(Default)] pub struct Config; impl pallet_api::extension::Config for Config { diff --git a/runtime/devnet/src/config/ismp.rs b/runtime/devnet/src/config/ismp.rs index 3b0693e8c..196df660c 100644 --- a/runtime/devnet/src/config/ismp.rs +++ b/runtime/devnet/src/config/ismp.rs @@ -1,9 +1,8 @@ -use alloc::{boxed::Box, vec::Vec}; - use frame_support::traits::Get; use frame_system::EnsureRoot; -use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; +use ismp::{error::Error, host::StateMachine, module::IsmpModule, router::IsmpRouter}; use ismp_parachain::ParachainConsensusClient; +use sp_std::prelude::*; use crate::{ AccountId, Balance, Balances, Ismp, IsmpParachain, ParachainInfo, Runtime, RuntimeEvent, @@ -17,7 +16,8 @@ impl pallet_ismp::Config for Runtime { type Coprocessor = Coprocessor; type Currency = Balances; type HostStateMachine = HostStateMachine; - type OffchainDB = (); + // State is stored in offchain database + type Mmr = pallet_ismp::NoOpMmrTree; type Router = Router; type RuntimeEvent = RuntimeEvent; type TimestampProvider = Timestamp; @@ -42,11 +42,15 @@ impl Get for HostStateMachine { StateMachine::Polkadot(ParachainInfo::get().into()) } } - + #[derive(Default)] pub struct Router; impl IsmpRouter for Router { - fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { - Err(anyhow::anyhow!("Module not found: {:?}", id)) + fn module_for_id(&self, id: Vec) -> Result, Error> { + use pallet_api::messaging::transports::ismp::*; + if id == ID { + return Ok(Box::new(Handler::::new())); + } + Err(Error::ModuleNotFound(id)) } } From 37a89c2a3b1dcf1989be359d9e49214d83cff61e Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:14 +0000 Subject: [PATCH 04/38] fix compilation --- Cargo.lock | 6 ++ pallets/api/Cargo.toml | 9 +++ pallets/api/src/lib.rs | 1 + pallets/api/src/messaging/mod.rs | 14 ++-- pallets/api/src/messaging/transports/ismp.rs | 10 +-- pop-api/src/v0/messaging/ismp.rs | 74 +++++++++++++++++ pop-api/src/v0/messaging/mod.rs | 84 ++++++++++++++++++++ pop-api/src/v0/messaging/xcm.rs | 55 +++++++++++++ runtime/devnet/Cargo.toml | 4 + runtime/devnet/src/config/api/mod.rs | 24 +++--- runtime/devnet/src/config/ismp.rs | 7 +- runtime/devnet/src/config/mod.rs | 1 + runtime/devnet/src/config/revive.rs | 48 +++++++++++ runtime/devnet/src/lib.rs | 8 +- 14 files changed, 319 insertions(+), 26 deletions(-) create mode 100644 pop-api/src/v0/messaging/ismp.rs create mode 100644 pop-api/src/v0/messaging/mod.rs create mode 100644 pop-api/src/v0/messaging/xcm.rs create mode 100644 runtime/devnet/src/config/revive.rs diff --git a/Cargo.lock b/Cargo.lock index 3bc4c6de2..2603fa536 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8771,12 +8771,15 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" name = "pallet-api" version = "0.1.0" dependencies = [ + "anyhow", "frame-benchmarking 39.0.0", "frame-support 39.0.0", "frame-system 39.1.0", + "ismp", "log", "pallet-assets 41.0.0", "pallet-balances 40.0.0", + "pallet-ismp", "pallet-nfts 31.0.0", "parity-scale-codec", "pop-chain-extension", @@ -8785,6 +8788,7 @@ dependencies = [ "sp-io 39.0.0", "sp-runtime 40.1.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "staging-xcm 15.0.1", ] [[package]] @@ -13685,6 +13689,7 @@ dependencies = [ "pallet-nfts-runtime-api 25.0.0", "pallet-preimage 39.0.0", "pallet-proxy 39.0.0", + "pallet-revive", "pallet-scheduler 40.0.0", "pallet-session 39.0.0", "pallet-sudo 39.0.0", @@ -13713,6 +13718,7 @@ dependencies = [ "sp-offchain 35.0.0", "sp-runtime 40.1.0", "sp-session 37.0.0", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-transaction-pool 35.0.0", "sp-version 38.0.0", "staging-parachain-info 0.18.0", diff --git a/pallets/api/Cargo.toml b/pallets/api/Cargo.toml index 21c3f2f8e..5b4a3a8f6 100644 --- a/pallets/api/Cargo.toml +++ b/pallets/api/Cargo.toml @@ -25,6 +25,13 @@ pallet-assets.workspace = true pallet-nfts.workspace = true sp-runtime.workspace = true sp-std.workspace = true +sp-core.workspace = true +anyhow.workspace = true + +# Cross chain +ismp.workspace = true +pallet-ismp.workspace = true +xcm.workspace = true [dev-dependencies] pallet-balances.workspace = true @@ -47,9 +54,11 @@ std = [ "frame-benchmarking/std", "frame-support/std", "frame-system/std", + "ismp/std", "log/std", "pallet-assets/std", "pallet-balances/std", + "pallet-ismp/std", "pallet-nfts/std", "pop-chain-extension/std", "scale-info/std", diff --git a/pallets/api/src/lib.rs b/pallets/api/src/lib.rs index d0e82e5a5..b87188696 100644 --- a/pallets/api/src/lib.rs +++ b/pallets/api/src/lib.rs @@ -8,6 +8,7 @@ pub mod fungibles; #[cfg(test)] mod mock; pub mod nonfungibles; +pub mod messaging; /// Trait for performing reads of runtime state. pub trait Read { diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 4ec8019f3..c7ae3e3d7 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -59,7 +59,7 @@ pub mod pallet { #[pallet::constant] type ByteFee: Get>; - type Callback: CallbackT; + type CallbackExecutor: CallbackExecutor; /// The deposit mechanism. type Deposit: Mutate @@ -247,7 +247,7 @@ pub mod pallet { #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage // Add any additional gas limit specified for callback execution .saturating_add(callback.map(|cb| { - T::Callback::weight().saturating_add(cb.weight) + T::CallbackExecutor::execution_weight().saturating_add(cb.weight) }).unwrap_or_default()) )] pub fn ismp_get( @@ -295,7 +295,7 @@ pub mod pallet { #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage // Add any additional gas limit specified for callback execution .saturating_add(callback.map(|cb| { - T::Callback::weight().saturating_add(cb.weight) + T::CallbackExecutor::execution_weight().saturating_add(cb.weight) }).unwrap_or_default()) )] pub fn ismp_post( @@ -342,7 +342,7 @@ pub mod pallet { #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage // Add any additional gas limit specified for callback execution .saturating_add(callback.map(|cb| { - T::Callback::weight().saturating_add(cb.weight) + T::CallbackExecutor::execution_weight().saturating_add(cb.weight) }).unwrap_or_default()) // TODO: add weight of xcm_response dispatchable once benchmarked )] @@ -496,7 +496,7 @@ impl Pallet { ) -> DispatchResult { // TODO: check weight removed from block weight - may need dispatching via executive // instead - let result = T::Callback::execute( + let result = T::CallbackExecutor::execute( origin.clone(), [callback.selector.to_vec(), (id, data).encode()].concat(), callback.weight, @@ -648,8 +648,8 @@ pub struct Callback { pub weight: Weight, } -pub trait CallbackT { +pub trait CallbackExecutor { fn execute(account: T::AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo; - fn weight() -> Weight; + fn execution_weight() -> Weight; } diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 5f179a15b..738fd9f2f 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -132,11 +132,11 @@ impl Handler { } impl IsmpModule for Handler { - fn on_accept(&self, _request: PostRequest) -> Result<(), Error> { + fn on_accept(&self, _request: PostRequest) -> Result<(), anyhow::Error> { todo!() } - fn on_response(&self, response: Response) -> Result<(), Error> { + fn on_response(&self, response: Response) -> Result<(), anyhow::Error> { // Hash request to determine key for message lookup. match response { Response::Get(GetResponse { get, values }) => { @@ -161,7 +161,7 @@ impl IsmpModule for Handler { } } - fn on_timeout(&self, timeout: Timeout) -> Result<(), Error> { + fn on_timeout(&self, timeout: Timeout) -> Result<(), anyhow::Error> { match timeout { Timeout::Request(request) => { // hash request to determine key for original request id lookup @@ -222,14 +222,14 @@ fn process_response( encode: &impl Encode, store: impl Fn() -> Vec, event: impl Fn(AccountIdOf, MessageId) -> Event, -) -> Result<(), Error> { +) -> Result<(), anyhow::Error> { let (origin, id) = IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; let Some(super::super::Message::Ismp { commitment, callback, deposit }) = Messages::::get(&origin, &id) else { - return Err(Error::Custom("message not found".into())) + return Err(Error::Custom("message not found".into()).into()) }; // Attempt callback with result if specified. diff --git a/pop-api/src/v0/messaging/ismp.rs b/pop-api/src/v0/messaging/ismp.rs new file mode 100644 index 000000000..dfc32a39e --- /dev/null +++ b/pop-api/src/v0/messaging/ismp.rs @@ -0,0 +1,74 @@ +use super::*; + +#[ink::scale_derive(Encode, Decode, TypeInfo)] +pub struct Get { + pub dest: u32, + pub height: u32, + pub timeout: u64, + // TODO: Option + pub context: Vec, + pub keys: Vec>, +} + +impl Get { + pub fn new(dest: u32, height: u32, timeout: u64, context: Vec, keys: Vec>) -> Self { + // TODO: validate: dest para id, ensure at least one key + Self { dest, height, timeout, context, keys } + } +} + +#[ink::scale_derive(Encode, Decode, TypeInfo)] +pub struct Post { + pub dest: u32, + pub timeout: u64, + pub data: Vec, +} + +impl Post { + pub fn new(dest: u32, timeout: u64, data: Vec) -> Self { + // TODO: validate: dest para id, ensure data not empty + Self { dest, timeout, data } + } +} + +/// A verified storage value. +#[ink::scale_derive(Encode, Decode, TypeInfo)] +#[derive(Debug)] +pub struct StorageValue { + /// The request storage key. + pub key: Vec, + /// The verified value. + pub value: Option>, +} + +#[inline] +pub fn get(id: MessageId, request: Get, fee: Balance, callback: Option) -> Result<()> { + build_dispatch(ISMP_GET) + .input::<(MessageId, Get, Balance, Option)>() + .output::, true>() + .handle_error_code::() + .call(&(id, request, fee, callback)) +} + +#[inline] +pub fn post(id: MessageId, request: Post, fee: Balance, callback: Option) -> Result<()> { + build_dispatch(ISMP_POST) + .input::<(MessageId, Post, Balance, Option)>() + .output::, true>() + .handle_error_code::() + .call(&(id, request, fee, callback)) +} + +#[ink::trait_definition] +pub trait OnGetResponse { + // pop-api::messaging::ismp::OnGetResponse::on_response + #[ink(message, selector = 0x57ad942b)] + fn on_response(&mut self, id: MessageId, values: Vec) -> Result<()>; +} + +#[ink::trait_definition] +pub trait OnPostResponse { + // pop-api::messaging::ismp::OnPostResponse::on_response + #[ink(message, selector = 0xcfb0a1d2)] + fn on_response(&mut self, id: MessageId, response: Vec) -> Result<()>; +} diff --git a/pop-api/src/v0/messaging/mod.rs b/pop-api/src/v0/messaging/mod.rs new file mode 100644 index 000000000..4c28b9558 --- /dev/null +++ b/pop-api/src/v0/messaging/mod.rs @@ -0,0 +1,84 @@ +use ink::prelude::vec::Vec; + +use crate::{ + constants::MESSAGING, + messaging::xcm::Weight, + primitives::{AccountId, Balance, BlockNumber}, + ChainExtensionMethodApi, Result, StatusCode, +}; + +/// APIs for messaging using the Interoperable State Machine Protocol (ISMP). +pub mod ismp; +/// APIs for messaging using Polkadot's Cross-Consensus Messaging (XCM). +pub mod xcm; + +// Dispatchables +pub(super) const _REQUEST: u8 = 0; +pub(super) const ISMP_GET: u8 = 1; +pub(super) const ISMP_POST: u8 = 2; +pub(super) const XCM_NEW_QUERY: u8 = 3; +pub(super) const _XCM_RESPONSE: u8 = 4; +pub(super) const REMOVE: u8 = 5; +// Reads +pub(super) const POLL: u8 = 0; +pub(super) const GET: u8 = 1; +pub(super) const QUERY_ID: u8 = 2; + +pub type MessageId = u64; +pub type ParaId = u32; + +fn build_dispatch(dispatchable: u8) -> ChainExtensionMethodApi { + crate::v0::build_dispatch(MESSAGING, dispatchable) +} + +fn build_read_state(state_query: u8) -> ChainExtensionMethodApi { + crate::v0::build_read_state(MESSAGING, state_query) +} + +#[inline] +pub fn poll(id: (AccountId, MessageId)) -> Result> { + build_read_state(POLL) + .input::<(AccountId, MessageId)>() + .output::>, true>() + .handle_error_code::() + .call(&id) +} + +#[inline] +pub fn get(id: (AccountId, MessageId)) -> Result>> { + build_read_state(GET) + .input::<(AccountId, MessageId)>() + .output::>>, true>() + .handle_error_code::() + .call(&id) +} + +#[inline] +pub fn remove(requests: Vec) -> Result<()> { + build_dispatch(REMOVE) + .input::>() + .output::, true>() + .handle_error_code::() + .call(&requests) +} + +#[ink::scale_derive(Decode, Encode, TypeInfo)] +pub struct Callback { + selector: [u8; 4], + weight: Weight, +} + +impl Callback { + pub fn to(selector: u32, weight: Weight) -> Self { + Self { selector: selector.to_be_bytes(), weight } + } +} + +#[derive(PartialEq)] +#[ink::scale_derive(Decode, Encode, TypeInfo)] +#[cfg_attr(feature = "std", derive(Debug))] +pub enum Status { + Pending, + TimedOut, + Complete, +} diff --git a/pop-api/src/v0/messaging/xcm.rs b/pop-api/src/v0/messaging/xcm.rs new file mode 100644 index 000000000..d086ece43 --- /dev/null +++ b/pop-api/src/v0/messaging/xcm.rs @@ -0,0 +1,55 @@ +pub use ink::{ + env::call::Selector, + prelude::vec::Vec, + xcm::prelude::{ + Junction, Junctions, Location, MaybeErrorCode, NetworkId, QueryId, Response, + VersionedLocation, VersionedResponse, VersionedXcm, Weight, XcmContext, XcmHash, + }, +}; +use ink::{ + env::{account_id, xcm_execute, xcm_send, DefaultEnvironment}, + scale::Encode, +}; + +use super::*; + +/// Note: usage of a callback requires implementation of the [OnResponse] trait. +#[inline] +pub fn new_query( + id: MessageId, + responder: Location, + timeout: BlockNumber, + callback: Option, +) -> Result> { + build_dispatch(XCM_NEW_QUERY) + .input::<(MessageId, Location, BlockNumber, Option)>() + .output::, true>() + .handle_error_code::() + .call(&(id, responder, timeout, callback))?; + + build_read_state(QUERY_ID) + .input::<(AccountId, MessageId)>() + .output::>, true>() + .handle_error_code::() + .call(&(account_id::(), id)) +} + +/// Execute an XCM message locally, using the contract's address as the origin. +pub fn execute(msg: &VersionedXcm) -> ink::env::Result<()> { + xcm_execute::(msg) +} + +/// Send an XCM message, using the contract's address as the origin. +pub fn send( + dest: &VersionedLocation, + msg: &VersionedXcm, +) -> ink::env::Result { + xcm_send::(dest, msg) +} + +#[ink::trait_definition] +pub trait OnResponse { + // pop-api::messaging::xcm::OnResponse::on_response + #[ink(message, selector = 0x641b0b03)] + fn on_response(&mut self, id: MessageId, response: Response) -> Result<()>; +} diff --git a/runtime/devnet/Cargo.toml b/runtime/devnet/Cargo.toml index 41e875184..26728a05b 100644 --- a/runtime/devnet/Cargo.toml +++ b/runtime/devnet/Cargo.toml @@ -50,6 +50,7 @@ pallet-nft-fractionalization.workspace = true pallet-nfts-runtime-api.workspace = true pallet-preimage.workspace = true pallet-proxy.workspace = true +pallet-revive.workspace = true pallet-scheduler.workspace = true pallet-session.workspace = true pallet-sudo.workspace = true @@ -68,6 +69,7 @@ sp-mmr-primitives.workspace = true sp-offchain.workspace = true sp-runtime.workspace = true sp-session.workspace = true +sp-std.workspace = true sp-transaction-pool.workspace = true sp-version.workspace = true @@ -97,6 +99,7 @@ parachains-common.workspace = true ismp.workspace = true ismp-parachain.workspace = true ismp-parachain-runtime-api.workspace = true +# TODO: use signed pallet-ismp = { workspace = true, features = [ "unsigned" ] } pallet-ismp-runtime-api.workspace = true @@ -147,6 +150,7 @@ std = [ "pallet-nfts/std", "pallet-preimage/std", "pallet-proxy/std", + "pallet-revive/std", "pallet-scheduler/std", "pallet-session/std", "pallet-sudo/std", diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 4735ed600..4ad688dc7 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -3,18 +3,24 @@ use core::marker::PhantomData; use codec::Decode; use cumulus_primitives_core::Weight; -use frame_support::traits::Contains; +use frame_support::{traits::Contains, pallet_prelude::*, dispatch::{PostDispatchInfo, DispatchErrorWithPostInfo}}; pub(crate) use pallet_api::Extension; use pallet_api::{extension::*, Read}; use sp_core::ConstU8; use sp_runtime::DispatchError; use versioning::*; +use pallet_revive::{DebugInfo, CollectEvents, AddressMapper}; +use xcm::latest::Location; +use pallet_xcm::Origin; use crate::{ config::assets::{TrustBackedAssetsInstance, TrustBackedNftsInstance}, - fungibles, nonfungibles, Runtime, RuntimeCall, RuntimeEvent, + fungibles, nonfungibles, Runtime, RuntimeCall, RuntimeEvent, messaging, + TransactionByteFee, Balances, Ismp, ConstU32, RuntimeHoldReason, config::xcm::LocalOriginToLocation, + AccountId, Revive, RuntimeOrigin, BlockNumber }; + mod versioning; type DecodingFailedError = DecodingFailed; @@ -38,7 +44,7 @@ pub enum RuntimeRead { NonFungibles(nonfungibles::Read), /// Messaging read queries. #[codec(index = 152)] - NonFungibles(messaging::Read), + Messaging(messaging::Read), } @@ -85,6 +91,7 @@ impl RuntimeResult { match self { RuntimeResult::Fungibles(result) => result.encode(), RuntimeResult::NonFungibles(result) => result.encode(), + RuntimeResult::Messaging(result) => result.encode(), } } } @@ -103,7 +110,7 @@ impl nonfungibles::Config for Runtime { impl messaging::Config for Runtime { type ByteFee = TransactionByteFee; - type Callback = Callback; + type CallbackExecutor = CallbackExecutor; type Deposit = Balances; // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as // much as onchain cost. @@ -177,7 +184,7 @@ impl messaging::CallbackExecutor for CallbackExecutor { } let post_info = PostDispatchInfo { - actual_weight: Some(output.gas_consumed.saturating_add(Self::weight())), + actual_weight: Some(output.gas_consumed.saturating_add(Self::execution_weight())), pays_fee: Default::default(), }; @@ -187,8 +194,7 @@ impl messaging::CallbackExecutor for CallbackExecutor { .map_err(|e| DispatchErrorWithPostInfo { post_info, error: e }) } - fn weight() -> Weight { - todo!("") + fn execution_weight() -> Weight { use pallet_revive::WeightInfo; ::WeightInfo::call() } @@ -197,14 +203,14 @@ impl messaging::CallbackExecutor for CallbackExecutor { // TODO!( default implementation where T: PolkadotXcm::Config pub struct QueryHandler; -impl NotifyQueryHandler for QueryHandler { +impl pallet_api::messaging::NotifyQueryHandler for QueryHandler { fn new_notify_query( responder: impl Into, notify: messaging::Call, timeout: BlockNumber, match_querier: impl Into, ) -> u64 { - PolkadotXcm::new_notify_query(responder, notify, timeout, match_querier) + crate::PolkadotXcm::new_notify_query(responder, notify, timeout, match_querier) } } diff --git a/runtime/devnet/src/config/ismp.rs b/runtime/devnet/src/config/ismp.rs index 196df660c..f4275f833 100644 --- a/runtime/devnet/src/config/ismp.rs +++ b/runtime/devnet/src/config/ismp.rs @@ -16,8 +16,7 @@ impl pallet_ismp::Config for Runtime { type Coprocessor = Coprocessor; type Currency = Balances; type HostStateMachine = HostStateMachine; - // State is stored in offchain database - type Mmr = pallet_ismp::NoOpMmrTree; + type OffchainDB = (); type Router = Router; type RuntimeEvent = RuntimeEvent; type TimestampProvider = Timestamp; @@ -46,11 +45,11 @@ impl Get for HostStateMachine { #[derive(Default)] pub struct Router; impl IsmpRouter for Router { - fn module_for_id(&self, id: Vec) -> Result, Error> { + fn module_for_id(&self, id: Vec) -> Result, anyhow::Error> { use pallet_api::messaging::transports::ismp::*; if id == ID { return Ok(Box::new(Handler::::new())); } - Err(Error::ModuleNotFound(id)) + Err(Error::ModuleNotFound(id).into()) } } diff --git a/runtime/devnet/src/config/mod.rs b/runtime/devnet/src/config/mod.rs index 61ae08273..5368f72d1 100644 --- a/runtime/devnet/src/config/mod.rs +++ b/runtime/devnet/src/config/mod.rs @@ -6,3 +6,4 @@ mod ismp; mod proxy; // Public due to integration tests crate. pub mod xcm; +mod revive; diff --git a/runtime/devnet/src/config/revive.rs b/runtime/devnet/src/config/revive.rs new file mode 100644 index 000000000..1754edb91 --- /dev/null +++ b/runtime/devnet/src/config/revive.rs @@ -0,0 +1,48 @@ +use frame_support::{ + parameter_types, + traits::{ConstBool, ConstU32, ConstU64, Nothing}, +}; +use frame_system::EnsureSigned; + +use super::api::{self, Config}; +use crate::{ + deposit, Balance, Balances, Perbill, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, + Timestamp, +}; + +parameter_types! { + pub const DepositPerItem: Balance = deposit(1, 0); + pub const DepositPerByte: Balance = deposit(0, 1); + pub const DefaultDepositLimit: Balance = deposit(1024, 1024 * 1024); + pub const CodeHashLockupDepositPercent: Perbill = Perbill::from_percent(0); +} + +impl pallet_revive::Config for Runtime { + type AddressMapper = pallet_revive::AccountId32Mapper; + type CallFilter = Nothing; + type ChainExtension = (); //todo!("Call with peter, currently we are only implementing the extension for pallet-contracts"); + type ChainId = ConstU64<4001>; + type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; + type Currency = Balances; + type Debug = (); + type DepositPerByte = DepositPerByte; + type DepositPerItem = DepositPerItem; + type InstantiateOrigin = EnsureSigned; + type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; + type RuntimeCall = RuntimeCall; + type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; + type RuntimeMemory = ConstU32<{ 128 * 1024 * 1024 }>; + type Time = Timestamp; + type UnsafeUnstableInterface = ConstBool; + type UploadOrigin = EnsureSigned; + type WeightInfo = pallet_revive::weights::SubstrateWeight; + type WeightPrice = pallet_transaction_payment::Pallet; + type Xcm = pallet_xcm::Pallet; + type NativeToEthRatio = ConstU32<1_000_000>; +} + +// Mock implementation running for messaging. +// remove extrinsic tests / benchmarking. +// xcm spike +// ismp spike diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index aca3c865a..f66a86185 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -43,7 +43,7 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pallet_api::{fungibles, nonfungibles}; +use pallet_api::{fungibles, nonfungibles, messaging}; use pallet_balances::Call as BalancesCall; use pallet_ismp::offchain::{Leaf, Proof, ProofKeys}; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; @@ -654,6 +654,12 @@ mod runtime { pub type Fungibles = fungibles::Pallet; #[runtime::pallet_index(151)] pub type NonFungibles = nonfungibles::Pallet; + #[runtime::pallet_index(152)] + pub type Messaging = messaging::Pallet; + + // Revive + #[runtime::pallet_index(255)] + pub type Revive = pallet_revive::Pallet; } #[cfg(feature = "runtime-benchmarks")] From e82bc6da325a33b8a85504a8fe5826e1eb5f0bbf Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:18 +0000 Subject: [PATCH 05/38] messaging mock impl --- Cargo.lock | 2 + pallets/api/Cargo.toml | 4 ++ pallets/api/src/mock.rs | 98 +++++++++++++++++++++++++++- runtime/devnet/src/config/api/mod.rs | 18 +---- 4 files changed, 104 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2603fa536..d2f373b10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8781,6 +8781,7 @@ dependencies = [ "pallet-balances 40.0.0", "pallet-ismp", "pallet-nfts 31.0.0", + "pallet-xcm 18.0.0", "parity-scale-codec", "pop-chain-extension", "scale-info", @@ -8789,6 +8790,7 @@ dependencies = [ "sp-runtime 40.1.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", + "staging-xcm-builder 18.0.0", ] [[package]] diff --git a/pallets/api/Cargo.toml b/pallets/api/Cargo.toml index 5b4a3a8f6..92aed05fe 100644 --- a/pallets/api/Cargo.toml +++ b/pallets/api/Cargo.toml @@ -37,6 +37,8 @@ xcm.workspace = true pallet-balances.workspace = true sp-core.workspace = true sp-io.workspace = true +pallet-xcm.workspace = true +xcm-builder.workspace = true [features] default = [ "std" ] @@ -60,12 +62,14 @@ std = [ "pallet-balances/std", "pallet-ismp/std", "pallet-nfts/std", + "pallet-xcm/std", "pop-chain-extension/std", "scale-info/std", "sp-core/std", "sp-io/std", "sp-runtime/std", "sp-std/std", + "xcm-builder/std" ] try-runtime = [ "frame-support/try-runtime", diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index d75c127c7..45bcf8b5a 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -12,9 +12,16 @@ use sp_runtime::{ BuildStorage, }; +use crate::messaging::{CallbackExecutor, NotifyQueryHandler, Call}; +use xcm::latest::Location; +use frame_system::{pallet_prelude::BlockNumberFor}; +use frame_support::{pallet_prelude::EnsureOrigin, traits::OriginTrait}; +use pallet_xcm::Origin; + pub(crate) const ALICE: AccountId = 1; pub(crate) const BOB: AccountId = 2; pub(crate) const CHARLIE: AccountId = 3; +pub(crate) const RESPONSE: AccountId = 4; pub(crate) const INIT_AMOUNT: Balance = 100_000_000 * UNIT; pub(crate) const UNIT: Balance = 10_000_000_000; @@ -33,7 +40,8 @@ frame_support::construct_runtime!( Balances: pallet_balances, Fungibles: crate::fungibles, Nfts: pallet_nfts::, - NonFungibles: crate::nonfungibles + NonFungibles: crate::nonfungibles, + Messaging: crate::messaging, } ); @@ -200,6 +208,94 @@ impl crate::nonfungibles::Config for Test { type WeightInfo = (); } +pub struct MockCallbackExecutor(T); +impl CallbackExecutor for MockCallbackExecutor { + fn execute(account: ::AccountId, data: Vec, weight: sp_runtime::Weight) -> frame_support::dispatch::DispatchResultWithPostInfo { + Ok(().into()) + } + + fn execution_weight() -> sp_runtime::Weight { + Default::default() + } +} + +parameter_types! { + pub const TransactionByteFee: Balance = 10; +} + +pub struct MockNotifyQuery(T); +impl NotifyQueryHandler for MockNotifyQuery { + fn new_notify_query( + responder: impl Into, + notify: Call, + timeout: BlockNumberFor, + match_querier: impl Into, + ) -> u64 { + 0u64 + } +} + +impl crate::messaging::Config for Test { + type ByteFee = TransactionByteFee; + type CallbackExecutor = MockCallbackExecutor; + type Deposit = Balances; + type IsmpByteFee = (); + type IsmpDispatcher = MockIsmpDispatcher; + type MaxContextLen = ConstU32<64>; + type MaxDataLen = ConstU32<1024>; + type MaxKeyLen = ConstU32<1000>; + type MaxKeys = ConstU32<10>; + type MaxRemovals = ConstU32<1024>; + type MaxResponseLen = ConstU32<1024>; + type OriginConverter = (); + type RuntimeEvent = RuntimeEvent; + type RuntimeHoldReason = RuntimeHoldReason; + type Xcm = MockNotifyQuery; + type XcmResponseOrigin = EnsureResponse; +} + +#[derive(Default)] +pub struct MockIsmpDispatcher; +impl ismp::dispatcher::IsmpDispatcher for MockIsmpDispatcher { + type Account = AccountId; + type Balance = Balance; + + fn dispatch_request( + &self, + request: ismp::dispatcher::DispatchRequest, + fee: ismp::dispatcher::FeeMetadata, + ) -> Result { + + Ok(Default::default()) + } + fn dispatch_response( + &self, + response: ismp::router::PostResponse, + fee: ismp::dispatcher::FeeMetadata, + ) -> Result { + Ok(Default::default()) + } +} + +pub struct EnsureResponse; +impl EnsureOrigin for EnsureResponse { + type Success = Location; + + fn try_origin(o: RuntimeOrigin) -> Result { + let signer = o.clone().into_signer(); + if signer == Some(RESPONSE) { + Ok(xcm::latest::Location::here()) + } else { + Err(o) + } + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + todo!() + } +} + pub(crate) fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::::default() .build_storage() diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 4ad688dc7..622598d17 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -20,7 +20,6 @@ use crate::{ AccountId, Revive, RuntimeOrigin, BlockNumber }; - mod versioning; type DecodingFailedError = DecodingFailed; @@ -128,25 +127,10 @@ impl messaging::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; type Xcm = QueryHandler; - type XcmResponseOrigin = EnsureResponse; + type XcmResponseOrigin = pallet_xcm::EnsureResponse<()>; } -pub struct EnsureResponse; -impl> + From> EnsureOrigin for EnsureResponse { - type Success = Location; - - fn try_origin(o: O) -> Result { - o.into().and_then(|o| match o { - Origin::Response(location) => Ok(location), - r => Err(O::from(r)), - }) - } - #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { - todo!() - } -} pub struct CallbackExecutor; impl messaging::CallbackExecutor for CallbackExecutor { From 59189a16d0cb6ae912637b169eff99a0f5b84dd4 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:22 +0000 Subject: [PATCH 06/38] query status refactor, fix stuck deposits, write first test --- Cargo.toml | 21 ++ pallets/api/src/messaging/mod.rs | 250 +++++++++++-------- pallets/api/src/messaging/tests.rs | 73 ++++++ pallets/api/src/messaging/transports/ismp.rs | 14 +- 4 files changed, 247 insertions(+), 111 deletions(-) create mode 100644 pallets/api/src/messaging/tests.rs diff --git a/Cargo.toml b/Cargo.toml index 516ad84b1..933209d36 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -203,3 +203,24 @@ ismp-parachain-runtime-api = { git = "https://github.com/r0gue-io/ismp", branch pallet-ismp = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2412", default-features = false } pallet-ismp-rpc = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2412", default-features = false } pallet-ismp-runtime-api = { git = "https://github.com/r0gue-io/ismp", branch = "polkadot-stable2412", default-features = false } + +# Revive +# array-bytes = { version = "6.2.2", default-features = false } +# assert_matches = { version = "1.5.0" } +# bitflags = { version = "1.3.2" } +# environmental = { version = "1.1.4", default-features = false } +# pallet-revive-fixtures = { path = "pallets/revive/fixtures", default-features = false } +# pallet-revive-mock-network = { default-features = false, path = "pallets/revive/mock-network" } +# pallet-revive-proc-macro = { path = "pallets/revive/proc-macro", default-features = false } +# pallet-revive-uapi = { path = "pallets/revive/uapi", default-features = false } +# parity-wasm = { version = "0.45.0" } +# paste = { version = "1.0.14", default-features = false } +# pretty_assertions = { version = "1.3.0" } +# proc-macro2 = { version = "1.0.64" } +# quote = { version = "1.0.33" } +# rlp = { version = "0.5.2", default-features = false } +# sp-tracing = { version = "16.0.0", default-features = false } +# syn = { version = "2.0.53" } +# tempfile = { version = "3.8.1" } +# toml = { version = "0.8.8" } +# wat = { version = "1.0.0" } diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index c7ae3e3d7..a1bc525bc 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -29,10 +29,13 @@ use super::Weight; /// Messaging transports. pub mod transports; +#[cfg(test)] +mod tests; + type AccountIdOf = ::AccountId; type BlockNumberOf = BlockNumberFor; type BalanceOf = <::Deposit as Inspect>>::Balance; -pub type MessageId = u64; +pub type MessageId = [u8; 32]; #[frame_support::pallet] pub mod pallet { @@ -131,7 +134,7 @@ pub mod pallet { /// The ISMP request commitment. commitment: H256, /// An optional callback to be used to return the response. - callback: Option, + callback: Option>, }, /// A response to a GET has been received via ISMP. IsmpGetResponseReceived { @@ -151,7 +154,7 @@ pub mod pallet { /// The ISMP request commitment. commitment: H256, /// An optional callback to be used to return the response. - callback: Option, + callback: Option>, }, /// A response to a POST has been received via ISMP. IsmpPostResponseReceived { @@ -171,7 +174,7 @@ pub mod pallet { /// The identifier of the created XCM query. query_id: QueryId, /// An optional callback to be used to return the response. - callback: Option, + callback: Option>, }, /// A response to a XCM query has been received. XcmResponseReceived { @@ -191,7 +194,7 @@ pub mod pallet { /// The identifier specified for the request. id: MessageId, /// The successful callback. - callback: Callback, + callback: Callback, }, /// A callback has failed. CallbackFailed { @@ -200,7 +203,7 @@ pub mod pallet { /// The identifier specified for the request. id: MessageId, /// The callback which failed. - callback: Callback, + callback: Callback, post_info: PostDispatchInfo, /// The error which occurred. error: DispatchError, @@ -216,12 +219,18 @@ pub mod pallet { #[pallet::error] pub enum Error { - DispatchFailed, + /// The message is invalid. InvalidMessage, + /// The query is invalid. InvalidQuery, + /// Failed to convert origin. OriginConversionFailed, + /// The message already exists. MessageExists, + /// The request is pending. RequestPending, + /// dispatching a call via ISMP falied + IsmpDispatchFailed, } /// A reason for the pallet placing a hold on funds. @@ -234,30 +243,18 @@ pub mod pallet { #[pallet::call] impl Pallet { - #[pallet::call_index(0)] - #[pallet::weight(Weight::zero())] // todo: benchmarking after consolidating storage - pub fn send(_origin: OriginFor, _id: MessageId) -> DispatchResult { - // e.g. Message::StateQuery { dest: Parachain(1000), storage_keys: vec![] } - // e.g. Message::Transact { dest: Parachain(1000), call: vec![] } - todo!("Reserved for messaging abstractions") - } - // TODO: does ismp allow querying to ensure that specified para id is supported? #[pallet::call_index(1)] - #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage - // Add any additional gas limit specified for callback execution - .saturating_add(callback.map(|cb| { - T::CallbackExecutor::execution_weight().saturating_add(cb.weight) - }).unwrap_or_default()) - )] + #[pallet::weight(Weight::zero())] pub fn ismp_get( origin: OriginFor, id: MessageId, message: ismp::Get, fee: BalanceOf, - callback: Option, + callback: Option>, ) -> DispatchResult { let origin = ensure_signed(origin)?; + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); // Calculate deposit and place on hold. let deposit = Self::calculate_deposit( @@ -272,40 +269,44 @@ pub mod pallet { T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. - ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let commitment = T::IsmpDispatcher::default() - .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) - .map_err(|_| Error::::DispatchFailed)?; - - // Store commitment for lookup on response, message for querying, response/timeout - // handling. - IsmpRequests::::insert(&commitment, (&origin, id)); - Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); - Pallet::::deposit_event(Event::::IsmpGetDispatched { - origin, - id, - commitment, - callback, - }); - Ok(()) + let maybe_commitment = T::IsmpDispatcher::default() + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }); + + match maybe_commitment { + Ok(commitment) => { + // Store commitment for lookup on response, message for querying, response/timeout + // handling. + IsmpRequests::::insert(&commitment, (&origin, id)); + Messages::::insert(&origin, id, Message::Ismp { commitment, callback: callback.clone(), deposit, status: MessageStatus::Ok}); + Pallet::::deposit_event(Event::::IsmpGetDispatched { + origin, + id, + commitment, + callback, + }); + Ok(()) + }, + Err(e) => { + // Allow a caller to poll for the status still and retreive the message deposit. + Messages::::insert(&origin, id, Message::Ismp { commitment: Default::default(), callback, deposit, status: MessageStatus::Err(Error::::IsmpDispatchFailed.into())}); + Err(Error::::IsmpDispatchFailed.into()) + } + } + } // TODO: does ismp allow querying to ensure that specified para id is supported? #[pallet::call_index(2)] - #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage - // Add any additional gas limit specified for callback execution - .saturating_add(callback.map(|cb| { - T::CallbackExecutor::execution_weight().saturating_add(cb.weight) - }).unwrap_or_default()) - )] + #[pallet::weight(Weight::zero())] pub fn ismp_post( origin: OriginFor, id: MessageId, message: ismp::Post, fee: BalanceOf, - callback: Option, + callback: Option>, ) -> DispatchResult { let origin = ensure_signed(origin)?; + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); // Calculate deposit and place on hold. let deposit = Self::calculate_deposit( @@ -320,65 +321,66 @@ pub mod pallet { T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. - ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let commitment = T::IsmpDispatcher::default() - .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) - .map_err(|_| Error::::DispatchFailed)?; - - // Store commitment for lookup on response, message for querying, response/timeout - // handling. - IsmpRequests::::insert(&commitment, (&origin, id)); - Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); - Pallet::::deposit_event(Event::::IsmpPostDispatched { - origin, - id, - commitment, - callback, - }); - Ok(()) + let maybe_commitment = T::IsmpDispatcher::default() + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }); + + match maybe_commitment { + Ok(commitment) => { + // Store commitment for lookup on response, message for querying, response/timeout + // handling. + IsmpRequests::::insert(&commitment, (&origin, id)); + Messages::::insert(&origin, id, Message::Ismp { commitment, callback: callback.clone(), deposit, status: MessageStatus::Ok }); + Pallet::::deposit_event(Event::::IsmpPostDispatched { + origin, + id, + commitment, + callback, + }); + Ok(()) + }, + Err(e) => { + // Allow a caller to poll for the status still and retreive the message deposit. + Messages::::insert(&origin, id, Message::Ismp { commitment: Default::default(), callback, deposit, status: MessageStatus::Err(Error::::IsmpDispatchFailed.into())}); + Err(Error::::IsmpDispatchFailed.into()) + } + } } #[pallet::call_index(3)] - #[pallet::weight(Weight::zero() // todo: benchmarking after consolidating storage - // Add any additional gas limit specified for callback execution - .saturating_add(callback.map(|cb| { - T::CallbackExecutor::execution_weight().saturating_add(cb.weight) - }).unwrap_or_default()) - // TODO: add weight of xcm_response dispatchable once benchmarked - )] + #[pallet::weight(Weight::zero())] pub fn xcm_new_query( origin: OriginFor, - id: u64, + id: MessageId, responder: Location, timeout: BlockNumberOf, - callback: Option, + callback: Option>, ) -> DispatchResult { let origin = ensure_signed(origin)?; + let querier = T::OriginConverter::try_convert(T::RuntimeOrigin::signed(origin.clone())) + .map_err(|_| Error::::OriginConversionFailed)?; + ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); // Calculate deposit and place on hold. let deposit = Self::calculate_deposit( // XcmQueries (KeyLenOf::>::get() as usize + AccountIdOf::::max_encoded_len() + MessageId::max_encoded_len() + - Option::::max_encoded_len()) + Option::>::max_encoded_len()) .saturated_into::>() * T::ByteFee::get(), ); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by creating new query via XCM. - ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - // Xcm only uses/stores pallet, index - i.e. (u8,u8) + // Xcm only uses/stores pallet, index - i.e. (u8,u8), hence the fields in xcm_response are ignored. let notify = Call::::xcm_response { query_id: 0, response: Default::default() }; - let querier = T::OriginConverter::try_convert(T::RuntimeOrigin::signed(origin.clone())) - .map_err(|_| Error::::OriginConversionFailed)?; let query_id = T::Xcm::new_notify_query(responder, notify, timeout, querier); // Store query id for later lookup on response, message for querying status, // response/timeout handling. XcmQueries::::insert(&query_id, (&origin, id)); - Messages::::insert(&origin, id, Message::XcmQuery { query_id, callback, deposit }); + Messages::::insert(&origin, id, Message::XcmQuery { query_id, callback: callback.clone(), deposit, status: MessageStatus::Ok}); Pallet::::deposit_event(Event::::XcmQueryCreated { origin, id, @@ -399,8 +401,8 @@ pub mod pallet { T::XcmResponseOrigin::ensure_origin(origin)?; // Lookup message from query id. - let (origin, id) = XcmQueries::::take(query_id).ok_or(Error::::InvalidQuery)?; - let Some(Message::XcmQuery { query_id, callback, deposit }) = + let (origin, id) = XcmQueries::::get(query_id).ok_or(Error::::InvalidQuery)?; + let Some(Message::XcmQuery { query_id, callback, deposit, status }) = Messages::::get(&origin, &id) else { return Err(Error::::InvalidMessage.into()) @@ -424,7 +426,7 @@ pub mod pallet { Messages::::insert( &origin, &id, - Message::XcmResponse { query_id, response: response.clone(), deposit }, + Message::XcmResponse { query_id, response: response.clone(), deposit, status: MessageStatus::Ok}, ); Self::deposit_event(Event::::XcmResponseReceived { dest: origin, @@ -437,7 +439,7 @@ pub mod pallet { // Remove a request/response, returning any deposit previously taken. #[pallet::call_index(5)] - #[pallet::weight(Weight::zero())] // todo: benchmarking after consolidating storage + #[pallet::weight(Weight::zero())] pub fn remove( origin: OriginFor, messages: BoundedVec, @@ -447,27 +449,38 @@ pub mod pallet { // Ensure request exists and is not pending. let deposit = match Messages::::take(&origin, id) { Some(message) => match message { - Message::Ismp { .. } | Message::XcmQuery { .. } => { - return Err(Error::::RequestPending.into()); + Message::Ismp { status, deposit, .. } => { + match status { + MessageStatus::Ok => { + return Err(Error::::RequestPending.into()); + }, + MessageStatus::Timeout | MessageStatus::Err(_) => { + Messages::::remove(&origin, &id); + deposit + } + } }, Message::IsmpResponse { commitment, deposit, .. } => { IsmpRequests::::remove(commitment); + Messages::::remove(&origin, &id); deposit }, + Message::XcmQuery { .. } => { + // XCM queries are infallible after origin checks. + return Err(Error::::RequestPending.into()) + }, Message::XcmResponse { query_id, deposit, .. } => { XcmQueries::::remove(query_id); + Messages::::remove(&origin, &id); deposit }, - Message::IsmpTimedOut { .. } => { - todo!() - }, }, None => { return Err(Error::::InvalidMessage.into()); }, }; // Return deposit. - T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; + T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; } Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); Ok(()) @@ -489,7 +502,7 @@ impl Pallet { // Attempt to notify via callback. fn call( origin: AccountIdOf, - callback: Callback, + callback: Callback, id: MessageId, data: &impl Encode, deposit: BalanceOf, @@ -548,9 +561,9 @@ pub enum Status { #[allow(clippy::unnecessary_cast)] pub enum Read { #[codec(index = 0)] - Poll((T::AccountId, MessageId)), + PollStatus((T::AccountId, MessageId)), #[codec(index = 1)] - Get((T::AccountId, MessageId)), + GetResponse((T::AccountId, MessageId)), #[codec(index = 2)] QueryId((T::AccountId, MessageId)), } @@ -558,7 +571,7 @@ pub enum Read { #[derive(Debug)] #[cfg_attr(feature = "std", derive(PartialEq, Clone))] pub enum ReadResult { - Poll(Option), + Poll(Option), Get(Option>), QueryId(Option), } @@ -585,22 +598,25 @@ impl crate::Read for Pallet { fn read(request: Self::Read) -> Self::Result { match request { - Read::Poll(request) => + Read::PollStatus(request) => ReadResult::Poll(Messages::::get(request.0, request.1).map(|m| match m { - Message::Ismp { .. } | Message::XcmQuery { .. } => Status::Pending, - Message::IsmpTimedOut { .. } => Status::TimedOut, - Message::IsmpResponse { .. } | Message::XcmResponse { .. } => Status::Complete, + Message::Ismp {status, .. } => status, + Message::IsmpResponse { status, .. } => status, + Message::XcmQuery { status, .. } => status, + Message::XcmResponse { status , ..} => status, + })), - Read::Get(request) => + Read::GetResponse(request) => ReadResult::Get(Messages::::get(request.0, request.1).and_then(|m| match m { + Message::Ismp { .. } => None, Message::IsmpResponse { response, .. } => Some(response.into_inner()), - Message::XcmResponse { response, .. } => Some(response.encode()), - _ => None, + Message::XcmQuery { .. } => None, + Message::XcmResponse { response , ..} => Some(response.encode()), })), Read::QueryId(request) => ReadResult::QueryId( Messages::::get(request.0, request.1).and_then(|m| match m { Message::XcmQuery { query_id, .. } | Message::XcmResponse { query_id, .. } => - Some(query_id), + Some(query_id), _ => None, }), ), @@ -617,35 +633,59 @@ trait CalculateDeposit { enum Message { Ismp { commitment: H256, - callback: Option, - deposit: BalanceOf, - }, - IsmpTimedOut { - commitment: H256, + callback: Option>, deposit: BalanceOf, + status: MessageStatus, }, IsmpResponse { commitment: H256, deposit: BalanceOf, response: BoundedVec, + status: MessageStatus, }, XcmQuery { query_id: QueryId, - callback: Option, + callback: Option>, deposit: BalanceOf, + status: MessageStatus }, XcmResponse { query_id: QueryId, deposit: BalanceOf, response: Response, + status: MessageStatus, }, } +#[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +pub enum MessageStatus { + /// No errors have been recorded. + Ok, + /// An error has occurred with this message> + Err(sp_runtime::DispatchError), + /// A timeout has occurred + Timeout, +} + +#[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +pub enum CallbackExecutionStatus { + Failure(CallbackErrorReason), + Success, +} + +#[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +pub enum CallbackErrorReason { + NotEnoughGas, + BadExecution, +} + // Message selector and pre-paid weight used as gas limit #[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] -pub struct Callback { +#[scale_info(skip_type_params(T))] +pub struct Callback { pub selector: [u8; 4], pub weight: Weight, + pub spare_weight_creditor: AccountId, } pub trait CallbackExecutor { diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs new file mode 100644 index 000000000..76c8371b4 --- /dev/null +++ b/pallets/api/src/messaging/tests.rs @@ -0,0 +1,73 @@ +use codec::Encode; +use frame_support::{ + assert_noop, assert_ok, + dispatch::WithPostDispatchInfo, + sp_runtime::{traits::Zero, BoundedVec, DispatchError::BadOrigin}, + weights::Weight, +}; +use pallet_nfts::{CollectionSetting, MintWitness, WeightInfo as NftsWeightInfoTrait}; + +use crate::{ + mock::*, + Read, + messaging::*, +}; +use sp_core::H256; +use frame_support::testing_prelude::bounded_vec; + + mod remove { + use super::*; + + + #[test] + fn ismp_message_is_noop_when_status_is_ok() { + new_test_ext().execute_with(|| { + let m = Message::Ismp { commitment: H256::default(), callback: None, deposit: 100, status: MessageStatus::Ok }; + let message_id: MessageId = [0u8; 32]; + Messages::::insert(&ALICE, message_id, &m); + assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(message_id)), Error::::RequestPending); + }); + } + + #[test] + fn ismp_message_is_removed_and_deposit_returned_when_status_is_timeout() { + new_test_ext().execute_with(|| { + + }); + } + + #[test] + fn ismp_message_is_removed_and_deposit_returned_when_status_is_err() { + new_test_ext().execute_with(|| { + + }); + } + + #[test] + fn ismp_response_message_can_always_be_removed() { + new_test_ext().execute_with(|| { + + }); + } + #[test] + fn xcm_queries_cannot_be_removed () { + new_test_ext().execute_with(|| { + + }); + } + + #[test] + fn xcm_response_messages_can_always_be_removed() { + new_test_ext().execute_with(|| { + + }); + } + + #[test] + fn multiple_messages_remove_works() { + new_test_ext().execute_with(|| { + + }); + } + } + \ No newline at end of file diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 738fd9f2f..401ad23dd 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -176,10 +176,11 @@ impl IsmpModule for Handler { else { return Err(Error::Custom("message not found".into())) }; - *message = Some(super::super::Message::IsmpTimedOut { - deposit: *deposit, - commitment: *commitment, - }); + todo!("Update message status to timed out"); + // *message = Some(super::super::Message::IsmpTimedOut { + // deposit: *deposit, + // commitment: *commitment, + // }); Ok(()) })?; Ok(()) @@ -226,7 +227,7 @@ fn process_response( let (origin, id) = IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; - let Some(super::super::Message::Ismp { commitment, callback, deposit }) = + let Some(super::super::Message::Ismp { commitment, callback, deposit, status}) = Messages::::get(&origin, &id) else { return Err(Error::Custom("message not found".into()).into()) @@ -235,6 +236,7 @@ fn process_response( // Attempt callback with result if specified. if let Some(callback) = callback { // TODO: check response length + todo!("update message status on success or fail."); if Pallet::::call(origin.clone(), callback, id, &encode, deposit).is_ok() { Pallet::::deposit_event(event(origin, id)); return Ok(()); @@ -247,7 +249,7 @@ fn process_response( Messages::::insert( &origin, &id, - super::super::Message::IsmpResponse { commitment, deposit, response }, + super::super::Message::IsmpResponse { commitment, deposit, response , status: todo!("take status from callback return value.")}, ); Pallet::::deposit_event(event(origin, id)); Ok(()) From d39755084fb088d47a0ec8ae68b2dee70e7de479 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:31 +0000 Subject: [PATCH 07/38] remove tests 1 --- extension/src/lib.rs | 2 +- pallets/api/src/messaging/tests.rs | 71 ++++++++++++++++++-- pallets/api/src/messaging/transports/ismp.rs | 2 +- pop-api/src/v0/mod.rs | 3 + runtime/devnet/src/config/api/mod.rs | 19 +++++- 5 files changed, 88 insertions(+), 9 deletions(-) diff --git a/extension/src/lib.rs b/extension/src/lib.rs index a9010ca7f..5114ae004 100644 --- a/extension/src/lib.rs +++ b/extension/src/lib.rs @@ -167,7 +167,7 @@ mod extension { // Invalid encoded runtime call. let input = vec![0u8, 99]; let mut env = MockEnvironment::new(DispatchExtFuncId::get(), input.clone()); - let mut extension = Extension::::default(); + let mut extension: Extension = Extension::::default(); assert!(extension.call(&mut env).is_err()); // Charges weight. assert_eq!( diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 76c8371b4..123d36638 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -17,8 +17,6 @@ use frame_support::testing_prelude::bounded_vec; mod remove { use super::*; - - #[test] fn ismp_message_is_noop_when_status_is_ok() { new_test_ext().execute_with(|| { @@ -26,33 +24,80 @@ use frame_support::testing_prelude::bounded_vec; let message_id: MessageId = [0u8; 32]; Messages::::insert(&ALICE, message_id, &m); assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(message_id)), Error::::RequestPending); + assert!(Messages::::get(ALICE, message_id).is_some(), "Message has been deleted when it should exist."); }); } #[test] fn ismp_message_is_removed_and_deposit_returned_when_status_is_timeout() { new_test_ext().execute_with(|| { - + let deposit: Balance = 100; + let message_id: MessageId = [0u8; 32]; + let m = Message::Ismp { commitment: H256::default(), callback: None, deposit, status: MessageStatus::Timeout }; + let alice_balance_pre_hold = Balances::free_balance(&ALICE); + + ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit).unwrap(); + + let alice_balance_post_hold = Balances::free_balance(&ALICE); + + Messages::::insert(&ALICE, message_id, &m); + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + + let alice_balance_post_remove = Balances::free_balance(&ALICE); + + assert_eq!(alice_balance_post_hold + deposit, alice_balance_pre_hold, "deposit amount is incorrect"); + assert_eq!(alice_balance_post_remove, alice_balance_pre_hold, "alice balance has been mutated when it shouldnt have."); + assert!(Messages::::get(&ALICE, message_id).is_none()); }); } #[test] fn ismp_message_is_removed_and_deposit_returned_when_status_is_err() { new_test_ext().execute_with(|| { - + let deposit: Balance = 100; + let message_id: MessageId = [0u8; 32]; + let m = Message::Ismp { commitment: H256::default(), callback: None, deposit, status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()) }; + let alice_balance_pre_hold = Balances::free_balance(&ALICE); + + ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit).unwrap(); + + let alice_balance_post_hold = Balances::free_balance(&ALICE); + + Messages::::insert(&ALICE, message_id, &m); + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + + let alice_balance_post_remove = Balances::free_balance(&ALICE); + + assert_eq!(alice_balance_post_hold + deposit, alice_balance_pre_hold, "deposit amount is incorrect"); + assert_eq!(alice_balance_post_remove, alice_balance_pre_hold, "alice balance has been mutated when it shouldnt have."); + assert!(Messages::::get(&ALICE, message_id).is_none()); }); } #[test] fn ismp_response_message_can_always_be_removed() { new_test_ext().execute_with(|| { - + }); } #[test] fn xcm_queries_cannot_be_removed () { new_test_ext().execute_with(|| { - + let m_1_id = [0;32]; + let m_1 = Message::XcmQuery { query_id: 0, callback: None, deposit: 0, status: MessageStatus::Ok }; + let m_2_id = [1;32]; + let m_2 = Message::XcmQuery { query_id: 1, callback: None, deposit: 0, status: MessageStatus::Timeout }; + let m_3_id = [2;32]; + let m_3 = Message::XcmQuery { query_id: 2, callback: None, deposit: 0, status: MessageStatus::Err(Error::::InvalidQuery.into())}; + Messages::::insert(&ALICE, m_1_id, &m_1); + Messages::::insert(&ALICE, m_2_id, &m_2); + Messages::::insert(&ALICE, m_3_id, &m_3); + assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(m_1_id)), Error::::RequestPending); + assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(m_2_id)), Error::::RequestPending); + assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(m_3_id)), Error::::RequestPending); + assert!(Messages::::get(ALICE, &m_1_id).is_some(), "Message has been deleted when it should still exist."); + assert!(Messages::::get(ALICE, &m_2_id).is_some(), "Message has been deleted when it should still exist."); + assert!(Messages::::get(ALICE, &m_3_id).is_some(), "Message has been deleted when it should still exist."); }); } @@ -69,5 +114,19 @@ use frame_support::testing_prelude::bounded_vec; }); } + + #[test] + fn multiple_messages_remove_ignores_erroneous_removes_and_continues() { + new_test_ext().execute_with(|| { + + }); + } + + #[test] + fn origin_can_only_remove_messages_related_to_itself() { + new_test_ext().execute_with(|| { + + }); + } } \ No newline at end of file diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 401ad23dd..b91520b04 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -238,7 +238,7 @@ fn process_response( // TODO: check response length todo!("update message status on success or fail."); if Pallet::::call(origin.clone(), callback, id, &encode, deposit).is_ok() { - Pallet::::deposit_event(event(origin, id)); + Pallet::::deposit_event(event(origin, id)); return Ok(()); } } diff --git a/pop-api/src/v0/mod.rs b/pop-api/src/v0/mod.rs index ea5bccb47..4d6bbd5eb 100644 --- a/pop-api/src/v0/mod.rs +++ b/pop-api/src/v0/mod.rs @@ -11,6 +11,9 @@ pub mod fungibles; /// APIs for non-fungible tokens. #[cfg(feature = "nonfungibles")] pub mod nonfungibles; +/// APIs for messaging. +#[cfg(feature = "messaging")] +pub mod messaging; pub(crate) const V0: u8 = 0; diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 622598d17..447909005 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -127,10 +127,27 @@ impl messaging::Config for Runtime { type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; type Xcm = QueryHandler; - type XcmResponseOrigin = pallet_xcm::EnsureResponse<()>; + type XcmResponseOrigin = EnsureResponse; } +pub struct EnsureResponse; +impl> + From> EnsureOrigin for EnsureResponse { + type Success = Location; + + fn try_origin(o: O) -> Result { + o.into().and_then(|o| match o { + Origin::Response(location) => Ok(location), + r => Err(O::from(r)), + }) + } + + #[cfg(feature = "runtime-benchmarks")] + fn try_successful_origin() -> Result { + todo!() + } +} + pub struct CallbackExecutor; impl messaging::CallbackExecutor for CallbackExecutor { From 12b745aea4c82820f5e98c1810a74df8de97ef19 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:37 +0000 Subject: [PATCH 08/38] refactor remove extrinsic for better testing --- pallets/api/src/messaging/mod.rs | 116 ++++++++++++++++++++--------- pallets/api/src/messaging/tests.rs | 11 +-- 2 files changed, 84 insertions(+), 43 deletions(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index a1bc525bc..b6d0fd38a 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -231,6 +231,8 @@ pub mod pallet { RequestPending, /// dispatching a call via ISMP falied IsmpDispatchFailed, + /// The message was not found + MessageNotFound, } /// A reason for the pallet placing a hold on funds. @@ -446,41 +448,16 @@ pub mod pallet { ) -> DispatchResult { let origin = ensure_signed(origin)?; for id in &messages { - // Ensure request exists and is not pending. - let deposit = match Messages::::take(&origin, id) { - Some(message) => match message { - Message::Ismp { status, deposit, .. } => { - match status { - MessageStatus::Ok => { - return Err(Error::::RequestPending.into()); - }, - MessageStatus::Timeout | MessageStatus::Err(_) => { - Messages::::remove(&origin, &id); - deposit - } - } - }, - Message::IsmpResponse { commitment, deposit, .. } => { - IsmpRequests::::remove(commitment); - Messages::::remove(&origin, &id); - deposit - }, - Message::XcmQuery { .. } => { - // XCM queries are infallible after origin checks. - return Err(Error::::RequestPending.into()) - }, - Message::XcmResponse { query_id, deposit, .. } => { - XcmQueries::::remove(query_id); - Messages::::remove(&origin, &id); - deposit - }, + match Messages::::take(&origin, id) { + Some(message) => { + ensure!(message.is_removable().is_ok(), message.unwrap_err()); + message.remove(&origin, &id); + message.release_deposit(&origin)?; }, None => { - return Err(Error::::InvalidMessage.into()); + Err(Error::::MessageNotFound.into()) }, - }; - // Return deposit. - T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; + }?; } Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); Ok(()) @@ -507,8 +484,6 @@ impl Pallet { data: &impl Encode, deposit: BalanceOf, ) -> DispatchResult { - // TODO: check weight removed from block weight - may need dispatching via executive - // instead let result = T::CallbackExecutor::execute( origin.clone(), [callback.selector.to_vec(), (id, data).encode()].concat(), @@ -657,6 +632,79 @@ enum Message { }, } +impl Message { + /// Define in what state a message can be removed, returning the Ok if removable. + pub fn is_removable(&self) -> Result<(), Error> { + match self { + /// Ismp messages can only be removed if their status is erroneous. + Message::Ismp { status, .. } => { + match status { + MessageStatus::Ok => { + Err(Error::::RequestPending.into()) + }, + MessageStatus::Timeout | MessageStatus::Err(_) => { + Ok(()) + } + } + }, + /// Ismp responses can always be removed. + Message::IsmpResponse { .. } => { + Ok(()) + }, + /// Xcm queries can only be removed if their status is erroneous. + Message::XcmQuery { status, .. } => { + MessageStatus::Ok => { + Err(Error::::RequestPending.into()) + }, + MessageStatus::Timeout | MessageStatus::Err(_) => { + Ok(()) + } + }, + /// XCM responses can always be removed. + Message::XcmResponse { .. } => { + Ok(()) + }, + } + } + /// Remove a message from storage. + /// Does no check on wether a message should be removed. + pub fn remove(&self, origin: &AccountIdOf, id: &MessageId) { + Messages::::remove(&origin, &id); + match self { + Message::Ismp { commitment, .. } => { + IsmpRequests::::remove(commitment); + }, + Message::IsmpResponse { .. } => { + IsmpRequests::::remove(commitment); + }, + Message::XcmQuery { query_id, .. } => { + XcmQueries::::remove(query_id); + }, + Message::XcmResponse { query_id, .. } => { + XcmQueries::::remove(query_id); + }, + } + } + + pub fn release_deposit(&self, origin: &T::AccountId) -> Result<(), Error> { + let deposit = match self { + Message::Ismp { deposit, .. } => { + deposit + }, + Message::IsmpResponse { deposit, .. } => { + deposit + }, + Message::XcmQuery { deposit, .. } => { + deposit + }, + Message::XcmResponse { deposit, .. } => { + deposit + }, + } + T::Deposit::release(&HoldReason::Messaging.into(), origin, deposit)?; + } +} + #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum MessageStatus { /// No errors have been recorded. diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 123d36638..1d0ae980a 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -104,21 +104,14 @@ use frame_support::testing_prelude::bounded_vec; #[test] fn xcm_response_messages_can_always_be_removed() { new_test_ext().execute_with(|| { - - }); - } - #[test] - fn multiple_messages_remove_works() { - new_test_ext().execute_with(|| { - }); } #[test] - fn multiple_messages_remove_ignores_erroneous_removes_and_continues() { + fn multiple_messages_remove_works() { new_test_ext().execute_with(|| { - + }); } From 16be2600a91635e96cd571d914db5b4fdc512f78 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:43 +0000 Subject: [PATCH 09/38] second refactor, much better --- pallets/api/src/messaging/mod.rs | 72 +++++++++++++++++++------------- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index b6d0fd38a..1fb2d2261 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -15,12 +15,13 @@ use frame_system::pallet_prelude::*; pub use pallet::*; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{traits::Saturating, BoundedVec, SaturatedConversion}; -use sp_std::vec::Vec; +use sp_runtime::{traits::Saturating, BoundedVec, SaturatedConversion, DispatchError}; +use sp_std::{vec::Vec, collections::btree_set::BTreeSet}; use transports::{ ismp::{self as ismp, FeeMetadata, IsmpDispatcher}, xcm::{self as xcm, Location, QueryId}, }; + pub use xcm::NotifyQueryHandler; use xcm::Response; @@ -440,31 +441,35 @@ pub mod pallet { } // Remove a request/response, returning any deposit previously taken. + /// Will ignore any erroneous messages and continue trying to process the remainder. + #[frame_support::transactional] #[pallet::call_index(5)] #[pallet::weight(Weight::zero())] pub fn remove( origin: OriginFor, - messages: BoundedVec, + mut messages: BoundedVec, ) -> DispatchResult { let origin = ensure_signed(origin)?; + for id in &messages { - match Messages::::take(&origin, id) { - Some(message) => { - ensure!(message.is_removable().is_ok(), message.unwrap_err()); - message.remove(&origin, &id); - message.release_deposit(&origin)?; - }, - None => { - Err(Error::::MessageNotFound.into()) - }, - }?; + let Some(message) = Messages::::get(&origin, id) else { + return Err(Error::::MessageNotFound.into()); + }; + + message + .try_remove(&origin, id) + .and_then(|_| message.release_deposit(&origin))?; } - Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); + + Self::deposit_event(Event::::Removed { + origin, + messages: messages.into_inner(), + }); + Ok(()) } } } - impl Pallet { // Calculate the deposit required for a particular message. fn calculate_deposit(deposit: BalanceOf) -> BalanceOf { @@ -633,8 +638,8 @@ enum Message { } impl Message { - /// Define in what state a message can be removed, returning the Ok if removable. - pub fn is_removable(&self) -> Result<(), Error> { + /// Try and remove self. + pub fn try_remove(&self, origin: &AccountIdOf, id: &MessageId) -> Result<(), DispatchError> { match self { /// Ismp messages can only be removed if their status is erroneous. Message::Ismp { status, .. } => { @@ -643,38 +648,44 @@ impl Message { Err(Error::::RequestPending.into()) }, MessageStatus::Timeout | MessageStatus::Err(_) => { + self.remove(origin, id); Ok(()) } } }, /// Ismp responses can always be removed. Message::IsmpResponse { .. } => { + self.remove(origin, id); Ok(()) }, /// Xcm queries can only be removed if their status is erroneous. Message::XcmQuery { status, .. } => { - MessageStatus::Ok => { - Err(Error::::RequestPending.into()) - }, - MessageStatus::Timeout | MessageStatus::Err(_) => { - Ok(()) + match status { + MessageStatus::Ok => { + Err(Error::::RequestPending.into()) + }, + MessageStatus::Timeout | MessageStatus::Err(_) => { + self.remove(origin, id); + Ok(()) + } } }, /// XCM responses can always be removed. Message::XcmResponse { .. } => { + self.remove(origin, id); Ok(()) }, } } /// Remove a message from storage. /// Does no check on wether a message should be removed. - pub fn remove(&self, origin: &AccountIdOf, id: &MessageId) { + fn remove(&self, origin: &AccountIdOf, id: &MessageId) { Messages::::remove(&origin, &id); match self { Message::Ismp { commitment, .. } => { IsmpRequests::::remove(commitment); }, - Message::IsmpResponse { .. } => { + Message::IsmpResponse { commitment, .. } => { IsmpRequests::::remove(commitment); }, Message::XcmQuery { query_id, .. } => { @@ -686,7 +697,7 @@ impl Message { } } - pub fn release_deposit(&self, origin: &T::AccountId) -> Result<(), Error> { + pub fn release_deposit(&self, origin: &T::AccountId) -> Result<(), DispatchError> { let deposit = match self { Message::Ismp { deposit, .. } => { deposit @@ -700,17 +711,18 @@ impl Message { Message::XcmResponse { deposit, .. } => { deposit }, - } - T::Deposit::release(&HoldReason::Messaging.into(), origin, deposit)?; + }; + T::Deposit::release(&HoldReason::Messaging.into(), origin, *deposit, Exact)?; + Ok(()) } -} + } #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum MessageStatus { /// No errors have been recorded. Ok, /// An error has occurred with this message> - Err(sp_runtime::DispatchError), + Err(DispatchError), /// A timeout has occurred Timeout, } @@ -741,3 +753,5 @@ pub trait CallbackExecutor { fn execution_weight() -> Weight; } + + From e0b2e21dc742b05269abc349f9bad4ac93e59103 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:49 +0000 Subject: [PATCH 10/38] fmt --- pallets/api/src/lib.rs | 2 +- pallets/api/src/messaging/mod.rs | 216 ++++++++------ pallets/api/src/messaging/tests.rs | 297 +++++++++++-------- pallets/api/src/messaging/transports/ismp.rs | 11 +- pallets/api/src/mock.rs | 44 +-- runtime/devnet/src/config/api/mod.rs | 27 +- runtime/devnet/src/config/ismp.rs | 2 +- runtime/devnet/src/config/mod.rs | 2 +- runtime/devnet/src/config/revive.rs | 10 +- runtime/devnet/src/lib.rs | 2 +- 10 files changed, 358 insertions(+), 255 deletions(-) diff --git a/pallets/api/src/lib.rs b/pallets/api/src/lib.rs index b87188696..235d29325 100644 --- a/pallets/api/src/lib.rs +++ b/pallets/api/src/lib.rs @@ -5,10 +5,10 @@ use frame_support::pallet_prelude::Weight; pub mod extension; pub mod fungibles; +pub mod messaging; #[cfg(test)] mod mock; pub mod nonfungibles; -pub mod messaging; /// Trait for performing reads of runtime state. pub trait Read { diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 1fb2d2261..63b8705b2 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -15,13 +15,12 @@ use frame_system::pallet_prelude::*; pub use pallet::*; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{traits::Saturating, BoundedVec, SaturatedConversion, DispatchError}; -use sp_std::{vec::Vec, collections::btree_set::BTreeSet}; +use sp_runtime::{traits::Saturating, BoundedVec, DispatchError, SaturatedConversion}; +use sp_std::{collections::btree_set::BTreeSet, vec::Vec}; use transports::{ ismp::{self as ismp, FeeMetadata, IsmpDispatcher}, xcm::{self as xcm, Location, QueryId}, }; - pub use xcm::NotifyQueryHandler; use xcm::Response; @@ -63,7 +62,7 @@ pub mod pallet { #[pallet::constant] type ByteFee: Get>; - type CallbackExecutor: CallbackExecutor; + type CallbackExecutor: CallbackExecutor; /// The deposit mechanism. type Deposit: Mutate @@ -277,10 +276,19 @@ pub mod pallet { match maybe_commitment { Ok(commitment) => { - // Store commitment for lookup on response, message for querying, response/timeout - // handling. + // Store commitment for lookup on response, message for querying, + // response/timeout handling. IsmpRequests::::insert(&commitment, (&origin, id)); - Messages::::insert(&origin, id, Message::Ismp { commitment, callback: callback.clone(), deposit, status: MessageStatus::Ok}); + Messages::::insert( + &origin, + id, + Message::Ismp { + commitment, + callback: callback.clone(), + deposit, + status: MessageStatus::Ok, + }, + ); Pallet::::deposit_event(Event::::IsmpGetDispatched { origin, id, @@ -291,11 +299,19 @@ pub mod pallet { }, Err(e) => { // Allow a caller to poll for the status still and retreive the message deposit. - Messages::::insert(&origin, id, Message::Ismp { commitment: Default::default(), callback, deposit, status: MessageStatus::Err(Error::::IsmpDispatchFailed.into())}); + Messages::::insert( + &origin, + id, + Message::Ismp { + commitment: Default::default(), + callback, + deposit, + status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), + }, + ); Err(Error::::IsmpDispatchFailed.into()) - } + }, } - } // TODO: does ismp allow querying to ensure that specified para id is supported? @@ -329,10 +345,19 @@ pub mod pallet { match maybe_commitment { Ok(commitment) => { - // Store commitment for lookup on response, message for querying, response/timeout - // handling. + // Store commitment for lookup on response, message for querying, + // response/timeout handling. IsmpRequests::::insert(&commitment, (&origin, id)); - Messages::::insert(&origin, id, Message::Ismp { commitment, callback: callback.clone(), deposit, status: MessageStatus::Ok }); + Messages::::insert( + &origin, + id, + Message::Ismp { + commitment, + callback: callback.clone(), + deposit, + status: MessageStatus::Ok, + }, + ); Pallet::::deposit_event(Event::::IsmpPostDispatched { origin, id, @@ -340,12 +365,21 @@ pub mod pallet { callback, }); Ok(()) - }, + }, Err(e) => { // Allow a caller to poll for the status still and retreive the message deposit. - Messages::::insert(&origin, id, Message::Ismp { commitment: Default::default(), callback, deposit, status: MessageStatus::Err(Error::::IsmpDispatchFailed.into())}); + Messages::::insert( + &origin, + id, + Message::Ismp { + commitment: Default::default(), + callback, + deposit, + status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), + }, + ); Err(Error::::IsmpDispatchFailed.into()) - } + }, } } @@ -360,7 +394,7 @@ pub mod pallet { ) -> DispatchResult { let origin = ensure_signed(origin)?; let querier = T::OriginConverter::try_convert(T::RuntimeOrigin::signed(origin.clone())) - .map_err(|_| Error::::OriginConversionFailed)?; + .map_err(|_| Error::::OriginConversionFailed)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); // Calculate deposit and place on hold. @@ -376,14 +410,24 @@ pub mod pallet { T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by creating new query via XCM. - // Xcm only uses/stores pallet, index - i.e. (u8,u8), hence the fields in xcm_response are ignored. + // Xcm only uses/stores pallet, index - i.e. (u8,u8), hence the fields in xcm_response + // are ignored. let notify = Call::::xcm_response { query_id: 0, response: Default::default() }; let query_id = T::Xcm::new_notify_query(responder, notify, timeout, querier); // Store query id for later lookup on response, message for querying status, // response/timeout handling. XcmQueries::::insert(&query_id, (&origin, id)); - Messages::::insert(&origin, id, Message::XcmQuery { query_id, callback: callback.clone(), deposit, status: MessageStatus::Ok}); + Messages::::insert( + &origin, + id, + Message::XcmQuery { + query_id, + callback: callback.clone(), + deposit, + status: MessageStatus::Ok, + }, + ); Pallet::::deposit_event(Event::::XcmQueryCreated { origin, id, @@ -429,7 +473,12 @@ pub mod pallet { Messages::::insert( &origin, &id, - Message::XcmResponse { query_id, response: response.clone(), deposit, status: MessageStatus::Ok}, + Message::XcmResponse { + query_id, + response: response.clone(), + deposit, + status: MessageStatus::Ok, + }, ); Self::deposit_event(Event::::XcmResponseReceived { dest: origin, @@ -455,17 +504,12 @@ pub mod pallet { let Some(message) = Messages::::get(&origin, id) else { return Err(Error::::MessageNotFound.into()); }; - - message - .try_remove(&origin, id) - .and_then(|_| message.release_deposit(&origin))?; + + message.try_remove(&origin, id).and_then(|_| message.release_deposit(&origin))?; } - - Self::deposit_event(Event::::Removed { - origin, - messages: messages.into_inner(), - }); - + + Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); + Ok(()) } } @@ -580,23 +624,22 @@ impl crate::Read for Pallet { match request { Read::PollStatus(request) => ReadResult::Poll(Messages::::get(request.0, request.1).map(|m| match m { - Message::Ismp {status, .. } => status, + Message::Ismp { status, .. } => status, Message::IsmpResponse { status, .. } => status, Message::XcmQuery { status, .. } => status, - Message::XcmResponse { status , ..} => status, - + Message::XcmResponse { status, .. } => status, })), Read::GetResponse(request) => ReadResult::Get(Messages::::get(request.0, request.1).and_then(|m| match m { Message::Ismp { .. } => None, Message::IsmpResponse { response, .. } => Some(response.into_inner()), Message::XcmQuery { .. } => None, - Message::XcmResponse { response , ..} => Some(response.encode()), + Message::XcmResponse { response, .. } => Some(response.encode()), })), Read::QueryId(request) => ReadResult::QueryId( Messages::::get(request.0, request.1).and_then(|m| match m { Message::XcmQuery { query_id, .. } | Message::XcmResponse { query_id, .. } => - Some(query_id), + Some(query_id), _ => None, }), ), @@ -627,7 +670,7 @@ enum Message { query_id: QueryId, callback: Option>, deposit: BalanceOf, - status: MessageStatus + status: MessageStatus, }, XcmResponse { query_id: QueryId, @@ -638,20 +681,16 @@ enum Message { } impl Message { - /// Try and remove self. + /// Try and remove self. pub fn try_remove(&self, origin: &AccountIdOf, id: &MessageId) -> Result<(), DispatchError> { match self { /// Ismp messages can only be removed if their status is erroneous. - Message::Ismp { status, .. } => { - match status { - MessageStatus::Ok => { - Err(Error::::RequestPending.into()) - }, - MessageStatus::Timeout | MessageStatus::Err(_) => { - self.remove(origin, id); - Ok(()) - } - } + Message::Ismp { status, .. } => match status { + MessageStatus::Ok => Err(Error::::RequestPending.into()), + MessageStatus::Timeout | MessageStatus::Err(_) => { + self.remove(origin, id); + Ok(()) + }, }, /// Ismp responses can always be removed. Message::IsmpResponse { .. } => { @@ -659,16 +698,12 @@ impl Message { Ok(()) }, /// Xcm queries can only be removed if their status is erroneous. - Message::XcmQuery { status, .. } => { - match status { - MessageStatus::Ok => { - Err(Error::::RequestPending.into()) - }, - MessageStatus::Timeout | MessageStatus::Err(_) => { - self.remove(origin, id); - Ok(()) - } - } + Message::XcmQuery { status, .. } => match status { + MessageStatus::Ok => Err(Error::::RequestPending.into()), + MessageStatus::Timeout | MessageStatus::Err(_) => { + self.remove(origin, id); + Ok(()) + }, }, /// XCM responses can always be removed. Message::XcmResponse { .. } => { @@ -677,46 +712,39 @@ impl Message { }, } } - /// Remove a message from storage. - /// Does no check on wether a message should be removed. - fn remove(&self, origin: &AccountIdOf, id: &MessageId) { - Messages::::remove(&origin, &id); - match self { - Message::Ismp { commitment, .. } => { - IsmpRequests::::remove(commitment); - }, - Message::IsmpResponse { commitment, .. } => { - IsmpRequests::::remove(commitment); - }, - Message::XcmQuery { query_id, .. } => { - XcmQueries::::remove(query_id); - }, - Message::XcmResponse { query_id, .. } => { - XcmQueries::::remove(query_id); - }, - } - } - pub fn release_deposit(&self, origin: &T::AccountId) -> Result<(), DispatchError> { - let deposit = match self { - Message::Ismp { deposit, .. } => { - deposit - }, - Message::IsmpResponse { deposit, .. } => { - deposit - }, - Message::XcmQuery { deposit, .. } => { - deposit - }, - Message::XcmResponse { deposit, .. } => { - deposit - }, - }; - T::Deposit::release(&HoldReason::Messaging.into(), origin, *deposit, Exact)?; - Ok(()) + /// Remove a message from storage. + /// Does no check on wether a message should be removed. + fn remove(&self, origin: &AccountIdOf, id: &MessageId) { + Messages::::remove(&origin, &id); + match self { + Message::Ismp { commitment, .. } => { + IsmpRequests::::remove(commitment); + }, + Message::IsmpResponse { commitment, .. } => { + IsmpRequests::::remove(commitment); + }, + Message::XcmQuery { query_id, .. } => { + XcmQueries::::remove(query_id); + }, + Message::XcmResponse { query_id, .. } => { + XcmQueries::::remove(query_id); + }, } } + pub fn release_deposit(&self, origin: &T::AccountId) -> Result<(), DispatchError> { + let deposit = match self { + Message::Ismp { deposit, .. } => deposit, + Message::IsmpResponse { deposit, .. } => deposit, + Message::XcmQuery { deposit, .. } => deposit, + Message::XcmResponse { deposit, .. } => deposit, + }; + T::Deposit::release(&HoldReason::Messaging.into(), origin, *deposit, Exact)?; + Ok(()) + } +} + #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum MessageStatus { /// No errors have been recorded. @@ -753,5 +781,3 @@ pub trait CallbackExecutor { fn execution_weight() -> Weight; } - - diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 1d0ae980a..4c8dc6b7b 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -3,123 +3,188 @@ use frame_support::{ assert_noop, assert_ok, dispatch::WithPostDispatchInfo, sp_runtime::{traits::Zero, BoundedVec, DispatchError::BadOrigin}, + testing_prelude::bounded_vec, weights::Weight, }; use pallet_nfts::{CollectionSetting, MintWitness, WeightInfo as NftsWeightInfoTrait}; - -use crate::{ - mock::*, - Read, - messaging::*, -}; use sp_core::H256; -use frame_support::testing_prelude::bounded_vec; - - mod remove { - use super::*; - #[test] - fn ismp_message_is_noop_when_status_is_ok() { - new_test_ext().execute_with(|| { - let m = Message::Ismp { commitment: H256::default(), callback: None, deposit: 100, status: MessageStatus::Ok }; - let message_id: MessageId = [0u8; 32]; - Messages::::insert(&ALICE, message_id, &m); - assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(message_id)), Error::::RequestPending); - assert!(Messages::::get(ALICE, message_id).is_some(), "Message has been deleted when it should exist."); - }); - } - - #[test] - fn ismp_message_is_removed_and_deposit_returned_when_status_is_timeout() { - new_test_ext().execute_with(|| { - let deposit: Balance = 100; - let message_id: MessageId = [0u8; 32]; - let m = Message::Ismp { commitment: H256::default(), callback: None, deposit, status: MessageStatus::Timeout }; - let alice_balance_pre_hold = Balances::free_balance(&ALICE); - - ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit).unwrap(); - - let alice_balance_post_hold = Balances::free_balance(&ALICE); - - Messages::::insert(&ALICE, message_id, &m); - assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); - - let alice_balance_post_remove = Balances::free_balance(&ALICE); - - assert_eq!(alice_balance_post_hold + deposit, alice_balance_pre_hold, "deposit amount is incorrect"); - assert_eq!(alice_balance_post_remove, alice_balance_pre_hold, "alice balance has been mutated when it shouldnt have."); - assert!(Messages::::get(&ALICE, message_id).is_none()); - }); - } - - #[test] - fn ismp_message_is_removed_and_deposit_returned_when_status_is_err() { - new_test_ext().execute_with(|| { - let deposit: Balance = 100; - let message_id: MessageId = [0u8; 32]; - let m = Message::Ismp { commitment: H256::default(), callback: None, deposit, status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()) }; - let alice_balance_pre_hold = Balances::free_balance(&ALICE); - - ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit).unwrap(); - - let alice_balance_post_hold = Balances::free_balance(&ALICE); - - Messages::::insert(&ALICE, message_id, &m); - assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); - - let alice_balance_post_remove = Balances::free_balance(&ALICE); - - assert_eq!(alice_balance_post_hold + deposit, alice_balance_pre_hold, "deposit amount is incorrect"); - assert_eq!(alice_balance_post_remove, alice_balance_pre_hold, "alice balance has been mutated when it shouldnt have."); - assert!(Messages::::get(&ALICE, message_id).is_none()); - }); - } - - #[test] - fn ismp_response_message_can_always_be_removed() { - new_test_ext().execute_with(|| { - - }); - } - #[test] - fn xcm_queries_cannot_be_removed () { - new_test_ext().execute_with(|| { - let m_1_id = [0;32]; - let m_1 = Message::XcmQuery { query_id: 0, callback: None, deposit: 0, status: MessageStatus::Ok }; - let m_2_id = [1;32]; - let m_2 = Message::XcmQuery { query_id: 1, callback: None, deposit: 0, status: MessageStatus::Timeout }; - let m_3_id = [2;32]; - let m_3 = Message::XcmQuery { query_id: 2, callback: None, deposit: 0, status: MessageStatus::Err(Error::::InvalidQuery.into())}; - Messages::::insert(&ALICE, m_1_id, &m_1); - Messages::::insert(&ALICE, m_2_id, &m_2); - Messages::::insert(&ALICE, m_3_id, &m_3); - assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(m_1_id)), Error::::RequestPending); - assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(m_2_id)), Error::::RequestPending); - assert_noop!(Messaging::remove(signed(ALICE), bounded_vec!(m_3_id)), Error::::RequestPending); - assert!(Messages::::get(ALICE, &m_1_id).is_some(), "Message has been deleted when it should still exist."); - assert!(Messages::::get(ALICE, &m_2_id).is_some(), "Message has been deleted when it should still exist."); - assert!(Messages::::get(ALICE, &m_3_id).is_some(), "Message has been deleted when it should still exist."); - }); - } - - #[test] - fn xcm_response_messages_can_always_be_removed() { - new_test_ext().execute_with(|| { - - }); - } - - #[test] - fn multiple_messages_remove_works() { - new_test_ext().execute_with(|| { - - }); - } - - #[test] - fn origin_can_only_remove_messages_related_to_itself() { - new_test_ext().execute_with(|| { - - }); - } - } - \ No newline at end of file + +use crate::{messaging::*, mock::*, Read}; + +mod remove { + use super::*; + #[test] + fn ismp_message_is_noop_when_status_is_ok() { + new_test_ext().execute_with(|| { + let m = Message::Ismp { + commitment: H256::default(), + callback: None, + deposit: 100, + status: MessageStatus::Ok, + }; + let message_id: MessageId = [0u8; 32]; + Messages::::insert(&ALICE, message_id, &m); + assert_noop!( + Messaging::remove(signed(ALICE), bounded_vec!(message_id)), + Error::::RequestPending + ); + assert!( + Messages::::get(ALICE, message_id).is_some(), + "Message has been deleted when it should exist." + ); + }); + } + + #[test] + fn ismp_message_is_removed_and_deposit_returned_when_status_is_timeout() { + new_test_ext().execute_with(|| { + let deposit: Balance = 100; + let message_id: MessageId = [0u8; 32]; + let m = Message::Ismp { + commitment: H256::default(), + callback: None, + deposit, + status: MessageStatus::Timeout, + }; + let alice_balance_pre_hold = Balances::free_balance(&ALICE); + + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + + let alice_balance_post_hold = Balances::free_balance(&ALICE); + + Messages::::insert(&ALICE, message_id, &m); + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + + let alice_balance_post_remove = Balances::free_balance(&ALICE); + + assert_eq!( + alice_balance_post_hold + deposit, + alice_balance_pre_hold, + "deposit amount is incorrect" + ); + assert_eq!( + alice_balance_post_remove, alice_balance_pre_hold, + "alice balance has been mutated when it shouldnt have." + ); + assert!(Messages::::get(&ALICE, message_id).is_none()); + }); + } + + #[test] + fn ismp_message_is_removed_and_deposit_returned_when_status_is_err() { + new_test_ext().execute_with(|| { + let deposit: Balance = 100; + let message_id: MessageId = [0u8; 32]; + let m = Message::Ismp { + commitment: H256::default(), + callback: None, + deposit, + status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), + }; + let alice_balance_pre_hold = Balances::free_balance(&ALICE); + + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + + let alice_balance_post_hold = Balances::free_balance(&ALICE); + + Messages::::insert(&ALICE, message_id, &m); + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + + let alice_balance_post_remove = Balances::free_balance(&ALICE); + + assert_eq!( + alice_balance_post_hold + deposit, + alice_balance_pre_hold, + "deposit amount is incorrect" + ); + assert_eq!( + alice_balance_post_remove, alice_balance_pre_hold, + "alice balance has been mutated when it shouldnt have." + ); + assert!(Messages::::get(&ALICE, message_id).is_none()); + }); + } + + #[test] + fn ismp_response_message_can_always_be_removed() { + new_test_ext().execute_with(|| {}); + } + #[test] + fn xcm_queries_cannot_be_removed() { + new_test_ext().execute_with(|| { + let m_1_id = [0; 32]; + let m_1 = Message::XcmQuery { + query_id: 0, + callback: None, + deposit: 0, + status: MessageStatus::Ok, + }; + let m_2_id = [1; 32]; + let m_2 = Message::XcmQuery { + query_id: 1, + callback: None, + deposit: 0, + status: MessageStatus::Timeout, + }; + let m_3_id = [2; 32]; + let m_3 = Message::XcmQuery { + query_id: 2, + callback: None, + deposit: 0, + status: MessageStatus::Err(Error::::InvalidQuery.into()), + }; + Messages::::insert(&ALICE, m_1_id, &m_1); + Messages::::insert(&ALICE, m_2_id, &m_2); + Messages::::insert(&ALICE, m_3_id, &m_3); + assert_noop!( + Messaging::remove(signed(ALICE), bounded_vec!(m_1_id)), + Error::::RequestPending + ); + assert_noop!( + Messaging::remove(signed(ALICE), bounded_vec!(m_2_id)), + Error::::RequestPending + ); + assert_noop!( + Messaging::remove(signed(ALICE), bounded_vec!(m_3_id)), + Error::::RequestPending + ); + assert!( + Messages::::get(ALICE, &m_1_id).is_some(), + "Message has been deleted when it should still exist." + ); + assert!( + Messages::::get(ALICE, &m_2_id).is_some(), + "Message has been deleted when it should still exist." + ); + assert!( + Messages::::get(ALICE, &m_3_id).is_some(), + "Message has been deleted when it should still exist." + ); + }); + } + + #[test] + fn xcm_response_messages_can_always_be_removed() { + new_test_ext().execute_with(|| {}); + } + + #[test] + fn multiple_messages_remove_works() { + new_test_ext().execute_with(|| {}); + } + + #[test] + fn origin_can_only_remove_messages_related_to_itself() { + new_test_ext().execute_with(|| {}); + } +} diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index b91520b04..40566bd8d 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -227,7 +227,7 @@ fn process_response( let (origin, id) = IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; - let Some(super::super::Message::Ismp { commitment, callback, deposit, status}) = + let Some(super::super::Message::Ismp { commitment, callback, deposit, status }) = Messages::::get(&origin, &id) else { return Err(Error::Custom("message not found".into()).into()) @@ -238,7 +238,7 @@ fn process_response( // TODO: check response length todo!("update message status on success or fail."); if Pallet::::call(origin.clone(), callback, id, &encode, deposit).is_ok() { - Pallet::::deposit_event(event(origin, id)); + Pallet::::deposit_event(event(origin, id)); return Ok(()); } } @@ -249,7 +249,12 @@ fn process_response( Messages::::insert( &origin, &id, - super::super::Message::IsmpResponse { commitment, deposit, response , status: todo!("take status from callback return value.")}, + super::super::Message::IsmpResponse { + commitment, + deposit, + response, + status: todo!("take status from callback return value."), + }, ); Pallet::::deposit_event(event(origin, id)); Ok(()) diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 45bcf8b5a..e02c61b0f 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -1,22 +1,22 @@ use codec::{Decode, Encode}; use frame_support::{ - derive_impl, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Everything}, + derive_impl, + pallet_prelude::EnsureOrigin, + parameter_types, + traits::{AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Everything, OriginTrait}, }; -use frame_system::{EnsureRoot, EnsureSigned}; +use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned}; use pallet_nfts::PalletFeatures; +use pallet_xcm::Origin; use scale_info::TypeInfo; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, Verify}, BuildStorage, }; - -use crate::messaging::{CallbackExecutor, NotifyQueryHandler, Call}; use xcm::latest::Location; -use frame_system::{pallet_prelude::BlockNumberFor}; -use frame_support::{pallet_prelude::EnsureOrigin, traits::OriginTrait}; -use pallet_xcm::Origin; + +use crate::messaging::{Call, CallbackExecutor, NotifyQueryHandler}; pub(crate) const ALICE: AccountId = 1; pub(crate) const BOB: AccountId = 2; @@ -210,7 +210,11 @@ impl crate::nonfungibles::Config for Test { pub struct MockCallbackExecutor(T); impl CallbackExecutor for MockCallbackExecutor { - fn execute(account: ::AccountId, data: Vec, weight: sp_runtime::Weight) -> frame_support::dispatch::DispatchResultWithPostInfo { + fn execute( + account: ::AccountId, + data: Vec, + weight: sp_runtime::Weight, + ) -> frame_support::dispatch::DispatchResultWithPostInfo { Ok(().into()) } @@ -259,20 +263,20 @@ pub struct MockIsmpDispatcher; impl ismp::dispatcher::IsmpDispatcher for MockIsmpDispatcher { type Account = AccountId; type Balance = Balance; - - fn dispatch_request( - &self, - request: ismp::dispatcher::DispatchRequest, - fee: ismp::dispatcher::FeeMetadata, - ) -> Result { - Ok(Default::default()) + fn dispatch_request( + &self, + request: ismp::dispatcher::DispatchRequest, + fee: ismp::dispatcher::FeeMetadata, + ) -> Result { + Ok(Default::default()) } + fn dispatch_response( - &self, - response: ismp::router::PostResponse, - fee: ismp::dispatcher::FeeMetadata, - ) -> Result { + &self, + response: ismp::router::PostResponse, + fee: ismp::dispatcher::FeeMetadata, + ) -> Result { Ok(Default::default()) } } diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 447909005..6a1076d9c 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -3,21 +3,27 @@ use core::marker::PhantomData; use codec::Decode; use cumulus_primitives_core::Weight; -use frame_support::{traits::Contains, pallet_prelude::*, dispatch::{PostDispatchInfo, DispatchErrorWithPostInfo}}; +use frame_support::{ + dispatch::{DispatchErrorWithPostInfo, PostDispatchInfo}, + pallet_prelude::*, + traits::Contains, +}; pub(crate) use pallet_api::Extension; use pallet_api::{extension::*, Read}; +use pallet_revive::{AddressMapper, CollectEvents, DebugInfo}; +use pallet_xcm::Origin; use sp_core::ConstU8; use sp_runtime::DispatchError; use versioning::*; - -use pallet_revive::{DebugInfo, CollectEvents, AddressMapper}; use xcm::latest::Location; -use pallet_xcm::Origin; + use crate::{ - config::assets::{TrustBackedAssetsInstance, TrustBackedNftsInstance}, - fungibles, nonfungibles, Runtime, RuntimeCall, RuntimeEvent, messaging, - TransactionByteFee, Balances, Ismp, ConstU32, RuntimeHoldReason, config::xcm::LocalOriginToLocation, - AccountId, Revive, RuntimeOrigin, BlockNumber + config::{ + assets::{TrustBackedAssetsInstance, TrustBackedNftsInstance}, + xcm::LocalOriginToLocation, + }, + fungibles, messaging, nonfungibles, AccountId, Balances, BlockNumber, ConstU32, Ismp, Revive, + Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, TransactionByteFee, }; mod versioning; @@ -44,7 +50,6 @@ pub enum RuntimeRead { /// Messaging read queries. #[codec(index = 152)] Messaging(messaging::Read), - } impl Readable for RuntimeRead { @@ -58,7 +63,6 @@ impl Readable for RuntimeRead { RuntimeRead::Fungibles(key) => fungibles::Pallet::weight(key), RuntimeRead::NonFungibles(key) => nonfungibles::Pallet::weight(key), RuntimeRead::Messaging(key) => messaging::Pallet::weight(key), - } } @@ -130,7 +134,6 @@ impl messaging::Config for Runtime { type XcmResponseOrigin = EnsureResponse; } - pub struct EnsureResponse; impl> + From> EnsureOrigin for EnsureResponse { type Success = Location; @@ -148,7 +151,6 @@ impl> + From> EnsureOrigin for EnsureRespon } } - pub struct CallbackExecutor; impl messaging::CallbackExecutor for CallbackExecutor { fn execute(account: AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo { @@ -201,7 +203,6 @@ impl messaging::CallbackExecutor for CallbackExecutor { } } - // TODO!( default implementation where T: PolkadotXcm::Config pub struct QueryHandler; impl pallet_api::messaging::NotifyQueryHandler for QueryHandler { diff --git a/runtime/devnet/src/config/ismp.rs b/runtime/devnet/src/config/ismp.rs index f4275f833..986fadedd 100644 --- a/runtime/devnet/src/config/ismp.rs +++ b/runtime/devnet/src/config/ismp.rs @@ -41,7 +41,7 @@ impl Get for HostStateMachine { StateMachine::Polkadot(ParachainInfo::get().into()) } } - + #[derive(Default)] pub struct Router; impl IsmpRouter for Router { diff --git a/runtime/devnet/src/config/mod.rs b/runtime/devnet/src/config/mod.rs index 5368f72d1..184abe9ef 100644 --- a/runtime/devnet/src/config/mod.rs +++ b/runtime/devnet/src/config/mod.rs @@ -5,5 +5,5 @@ mod contracts; mod ismp; mod proxy; // Public due to integration tests crate. -pub mod xcm; mod revive; +pub mod xcm; diff --git a/runtime/devnet/src/config/revive.rs b/runtime/devnet/src/config/revive.rs index 1754edb91..2afe9fd09 100644 --- a/runtime/devnet/src/config/revive.rs +++ b/runtime/devnet/src/config/revive.rs @@ -20,7 +20,9 @@ parameter_types! { impl pallet_revive::Config for Runtime { type AddressMapper = pallet_revive::AccountId32Mapper; type CallFilter = Nothing; - type ChainExtension = (); //todo!("Call with peter, currently we are only implementing the extension for pallet-contracts"); + type ChainExtension = (); + // todo!("Call with peter, currently we are only implementing the extension for + // pallet-contracts"); type ChainId = ConstU64<4001>; type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; type Currency = Balances; @@ -28,6 +30,7 @@ impl pallet_revive::Config for Runtime { type DepositPerByte = DepositPerByte; type DepositPerItem = DepositPerItem; type InstantiateOrigin = EnsureSigned; + type NativeToEthRatio = ConstU32<1_000_000>; type PVFMemory = ConstU32<{ 512 * 1024 * 1024 }>; type RuntimeCall = RuntimeCall; type RuntimeEvent = RuntimeEvent; @@ -39,10 +42,9 @@ impl pallet_revive::Config for Runtime { type WeightInfo = pallet_revive::weights::SubstrateWeight; type WeightPrice = pallet_transaction_payment::Pallet; type Xcm = pallet_xcm::Pallet; - type NativeToEthRatio = ConstU32<1_000_000>; } // Mock implementation running for messaging. -// remove extrinsic tests / benchmarking. +// remove extrinsic tests / benchmarking. // xcm spike -// ismp spike +// ismp spike diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index f66a86185..c396ccb78 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -43,7 +43,7 @@ use frame_system::{ limits::{BlockLength, BlockWeights}, EnsureRoot, }; -use pallet_api::{fungibles, nonfungibles, messaging}; +use pallet_api::{fungibles, messaging, nonfungibles}; use pallet_balances::Call as BalancesCall; use pallet_ismp::offchain::{Leaf, Proof, ProofKeys}; use pallet_xcm::{EnsureXcm, IsVoiceOfBody}; From 3e916f8c1ad8b9785e897dc1e56b779cc0cdb1c0 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:52 +0000 Subject: [PATCH 11/38] fmt, fixes, test, benchmark --- Cargo.lock | 6947 ++++-------------- Cargo.toml | 2 +- pallets/api/Cargo.toml | 2 + pallets/api/src/messaging/benchmarking.rs | 72 + pallets/api/src/messaging/mod.rs | 17 +- pallets/api/src/messaging/tests.rs | 590 +- pallets/api/src/messaging/weights.rs | 0 pallets/api/src/nonfungibles/benchmarking.rs | 6 +- pop-api/Cargo.toml | 1 + pop-api/src/v0/mod.rs | 6 +- runtime/devnet/src/config/revive.rs | 2 +- runtime/devnet/src/lib.rs | 1 + 12 files changed, 2150 insertions(+), 5496 deletions(-) create mode 100644 pallets/api/src/messaging/benchmarking.rs create mode 100644 pallets/api/src/messaging/weights.rs diff --git a/Cargo.lock b/Cargo.lock index d2f373b10..7c25cc102 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,17 +71,6 @@ dependencies = [ "subtle 2.6.1", ] -[[package]] -name = "ahash" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" -dependencies = [ - "getrandom 0.2.15", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.11" @@ -465,256 +454,6 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b34d609dfbaf33d6889b2b7106d3ca345eacad44200913df5ba02bfd31d2ba9" -[[package]] -name = "asset-hub-paseo-runtime" -version = "1.0.0" -source = "git+https://github.com/paseo-network/runtimes?tag=v1.3.4#313b81aa2b2cb076b4f99c9b2bea040a8bcf709f" -dependencies = [ - "assets-common 0.15.0", - "bp-asset-hub-paseo", - "bp-bridge-hub-kusama", - "bp-bridge-hub-paseo", - "bp-bridge-hub-polkadot", - "collectives-polkadot-runtime-constants", - "cumulus-pallet-aura-ext 0.15.0", - "cumulus-pallet-parachain-system 0.15.0", - "cumulus-pallet-session-benchmarking 17.0.0", - "cumulus-pallet-xcm 0.15.0", - "cumulus-pallet-xcmp-queue 0.15.0", - "cumulus-primitives-aura 0.14.0", - "cumulus-primitives-core 0.14.0", - "cumulus-primitives-utility 0.15.0", - "frame-benchmarking 36.0.0", - "frame-executive 36.0.0", - "frame-metadata-hash-extension 0.4.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "frame-system-benchmarking 36.0.0", - "frame-system-rpc-runtime-api 33.0.0", - "frame-try-runtime 0.42.0", - "hex-literal", - "log", - "pallet-asset-conversion 18.0.0", - "pallet-asset-conversion-tx-payment 18.0.0", - "pallet-assets 37.0.0", - "pallet-aura 35.0.0", - "pallet-authorship 36.0.0", - "pallet-balances 37.0.0", - "pallet-collator-selection 17.0.0", - "pallet-message-queue 39.0.2", - "pallet-multisig 36.0.0", - "pallet-nfts 30.0.0", - "pallet-nfts-runtime-api 22.0.0", - "pallet-proxy 36.0.0", - "pallet-session 36.0.0", - "pallet-sudo 36.0.0", - "pallet-timestamp 35.0.0", - "pallet-transaction-payment 36.0.0", - "pallet-transaction-payment-rpc-runtime-api 36.0.0", - "pallet-uniques 36.0.0", - "pallet-utility 36.0.0", - "pallet-vesting 36.0.0", - "pallet-xcm 15.0.0", - "pallet-xcm-benchmarks 15.0.0", - "pallet-xcm-bridge-hub-router 0.13.0", - "parachains-common 15.0.0", - "parity-scale-codec", - "paseo-runtime-constants", - "polkadot-core-primitives 14.0.0", - "polkadot-parachain-primitives 13.0.0", - "polkadot-runtime-common 15.0.0", - "primitive-types 0.12.2", - "scale-info", - "serde_json", - "snowbridge-router-primitives 0.14.0", - "sp-api 33.0.0", - "sp-block-builder 33.0.0", - "sp-consensus-aura 0.39.0", - "sp-core 34.0.0", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-genesis-builder 0.14.0", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-offchain 33.0.0", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "sp-transaction-pool 33.0.0", - "sp-version 36.0.0", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-parachain-info 0.15.0", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "staging-xcm-executor 15.0.0", - "substrate-wasm-builder 23.0.0", - "system-parachains-constants 1.0.0 (git+https://github.com/paseo-network/runtimes?tag=v1.3.4)", - "xcm-runtime-apis 0.2.0", -] - -[[package]] -name = "asset-hub-westend-runtime" -version = "0.27.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "assets-common 0.19.0", - "bp-asset-hub-rococo", - "bp-asset-hub-westend", - "bp-bridge-hub-rococo", - "bp-bridge-hub-westend", - "cumulus-pallet-aura-ext 0.18.0", - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-pallet-session-benchmarking 20.0.0", - "cumulus-pallet-xcm 0.18.0", - "cumulus-pallet-xcmp-queue 0.18.0", - "cumulus-primitives-aura 0.16.0", - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-storage-weight-reclaim", - "cumulus-primitives-utility 0.18.0", - "frame-benchmarking 39.0.0", - "frame-executive 39.0.0", - "frame-metadata-hash-extension 0.7.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "frame-system-benchmarking 39.0.0", - "frame-system-rpc-runtime-api 35.0.0", - "frame-try-runtime 0.45.0", - "hex-literal", - "log", - "pallet-asset-conversion 21.0.0", - "pallet-asset-conversion-ops", - "pallet-asset-conversion-tx-payment 21.0.0", - "pallet-assets 41.0.0", - "pallet-assets-freezer", - "pallet-aura 38.0.0", - "pallet-authorship 39.0.0", - "pallet-balances 40.0.0", - "pallet-collator-selection 20.0.0", - "pallet-message-queue 42.0.0", - "pallet-multisig 39.0.0", - "pallet-nft-fractionalization", - "pallet-nfts 33.0.0", - "pallet-nfts-runtime-api 25.0.0", - "pallet-proxy 39.0.0", - "pallet-revive", - "pallet-session 39.0.0", - "pallet-state-trie-migration 43.0.0", - "pallet-timestamp 38.0.0", - "pallet-transaction-payment 39.0.0", - "pallet-transaction-payment-rpc-runtime-api 39.0.0", - "pallet-uniques 39.0.0", - "pallet-utility 39.0.0", - "pallet-xcm 18.0.0", - "pallet-xcm-benchmarks 18.0.0", - "pallet-xcm-bridge-hub-router 0.16.0", - "parachains-common 19.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-runtime-common 18.0.0", - "primitive-types 0.13.1", - "scale-info", - "serde_json", - "snowbridge-router-primitives 0.18.1", - "sp-api 35.0.0", - "sp-block-builder 35.0.0", - "sp-consensus-aura 0.41.0", - "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", - "sp-keyring 40.0.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-storage 22.0.0", - "sp-transaction-pool 35.0.0", - "sp-version 38.0.0", - "staging-parachain-info 0.18.0", - "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", - "testnet-parachains-constants", - "westend-runtime-constants", - "xcm-runtime-apis 0.5.0", -] - -[[package]] -name = "asset-test-utils" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-pallet-xcmp-queue 0.18.0", - "cumulus-primitives-core 0.17.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-assets 41.0.0", - "pallet-balances 40.0.0", - "pallet-collator-selection 20.0.0", - "pallet-session 39.0.0", - "pallet-timestamp 38.0.0", - "pallet-xcm 18.0.0", - "pallet-xcm-bridge-hub-router 0.16.0", - "parachains-common 19.0.0", - "parachains-runtimes-test-utils", - "parity-scale-codec", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "staging-parachain-info 0.18.0", - "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", -] - -[[package]] -name = "assets-common" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4e2360c96927aa33b3fef7190eabf2aa4129fe3505c11dfa860ada0f27fd1b1" -dependencies = [ - "cumulus-primitives-core 0.14.0", - "frame-support 36.0.1", - "impl-trait-for-tuples", - "log", - "pallet-asset-conversion 18.0.0", - "pallet-xcm 15.0.0", - "parachains-common 15.0.0", - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "staging-xcm-executor 15.0.0", - "substrate-wasm-builder 23.0.0", -] - -[[package]] -name = "assets-common" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "cumulus-primitives-core 0.17.0", - "frame-support 39.0.0", - "impl-trait-for-tuples", - "log", - "pallet-asset-conversion 21.0.0", - "pallet-assets 41.0.0", - "pallet-xcm 18.0.0", - "parachains-common 19.0.0", - "parity-scale-codec", - "scale-info", - "sp-api 35.0.0", - "sp-runtime 40.1.0", - "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", -] - [[package]] name = "async-channel" version = "1.9.0" @@ -1034,16 +773,6 @@ dependencies = [ "serde", ] -[[package]] -name = "binary-merkle-tree" -version = "15.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336bf780dd7526a9a4bc1521720b25c1994dc132cccd59553431923fa4d1a693" -dependencies = [ - "hash-db", - "log", -] - [[package]] name = "binary-merkle-tree" version = "16.0.0" @@ -1316,521 +1045,163 @@ dependencies = [ ] [[package]] -name = "bp-asset-hub-paseo" -version = "1.0.0" -source = "git+https://github.com/paseo-network/runtimes?tag=v1.3.4#313b81aa2b2cb076b4f99c9b2bea040a8bcf709f" -dependencies = [ - "bp-xcm-bridge-hub-router 0.13.0", - "frame-support 36.0.1", - "parity-scale-codec", - "scale-info", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "system-parachains-constants 1.0.0 (git+https://github.com/paseo-network/runtimes?tag=v1.3.4)", -] - -[[package]] -name = "bp-asset-hub-rococo" +name = "bp-xcm-bridge-hub-router" version = "0.15.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "bp-xcm-bridge-hub-router 0.15.0", - "frame-support 39.0.0", "parity-scale-codec", "scale-info", "sp-core 35.0.0", + "sp-runtime", "staging-xcm 15.0.1", ] [[package]] -name = "bp-asset-hub-westend" -version = "0.14.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" dependencies = [ - "bp-xcm-bridge-hub-router 0.15.0", - "frame-support 39.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "staging-xcm 15.0.1", + "sha2 0.10.8", + "tinyvec", ] [[package]] -name = "bp-bridge-hub-cumulus" -version = "0.15.0" +name = "build-helper" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48cca10dce1c6d2914e48594f13add2da4a5b7c3ed54fd0fa324054dfb8569a" +checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" dependencies = [ - "bp-messages 0.15.0", - "bp-polkadot-core 0.15.0", - "bp-runtime 0.15.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "polkadot-primitives 14.0.0", - "sp-api 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "semver 0.6.0", ] [[package]] -name = "bp-bridge-hub-cumulus" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "bp-messages 0.19.0", - "bp-polkadot-core 0.19.0", - "bp-runtime 0.19.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "polkadot-primitives 17.0.0", - "sp-api 35.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", -] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] -name = "bp-bridge-hub-kusama" -version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" -dependencies = [ - "bp-bridge-hub-cumulus 0.15.0", - "bp-messages 0.15.0", - "bp-runtime 0.15.0", - "frame-support 36.0.1", - "kusama-runtime-constants", - "polkadot-runtime-constants", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "system-parachains-constants 1.0.0 (git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4)", -] +name = "byte-slice-cast" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" [[package]] -name = "bp-bridge-hub-paseo" -version = "1.0.0" -source = "git+https://github.com/paseo-network/runtimes?tag=v1.3.4#313b81aa2b2cb076b4f99c9b2bea040a8bcf709f" -dependencies = [ - "bp-bridge-hub-cumulus 0.15.0", - "bp-messages 0.15.0", - "bp-polkadot-bulletin", - "bp-runtime 0.15.0", - "frame-support 36.0.1", - "kusama-runtime-constants", - "paseo-runtime-constants", - "snowbridge-core 0.8.0", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "system-parachains-constants 1.0.0 (git+https://github.com/paseo-network/runtimes?tag=v1.3.4)", -] +name = "byte-tools" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] -name = "bp-bridge-hub-polkadot" -version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" -dependencies = [ - "bp-bridge-hub-cumulus 0.15.0", - "bp-messages 0.15.0", - "bp-polkadot-bulletin", - "bp-runtime 0.15.0", - "frame-support 36.0.1", - "kusama-runtime-constants", - "polkadot-runtime-constants", - "snowbridge-core 0.8.0", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "system-parachains-constants 1.0.0 (git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4)", -] +name = "bytemuck" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" [[package]] -name = "bp-bridge-hub-rococo" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" + +[[package]] +name = "bzip2-sys" +version = "0.1.11+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" dependencies = [ - "bp-bridge-hub-cumulus 0.19.0", - "bp-messages 0.19.0", - "bp-runtime 0.19.0", - "bp-xcm-bridge-hub", - "frame-support 39.0.0", - "parity-scale-codec", - "sp-api 35.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "cc", + "libc", + "pkg-config", ] [[package]] -name = "bp-bridge-hub-westend" -version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" +name = "c2-chacha" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" dependencies = [ - "bp-bridge-hub-cumulus 0.19.0", - "bp-messages 0.19.0", - "bp-runtime 0.19.0", - "bp-xcm-bridge-hub", - "frame-support 39.0.0", - "parity-scale-codec", - "sp-api 35.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "cipher 0.2.5", + "ppv-lite86", ] [[package]] -name = "bp-header-chain" -version = "0.15.0" +name = "camino" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57cac4b71008e46d43e346476ed1be85cf7b505efacee17dad84d687344bf1b1" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ - "bp-runtime 0.15.0", - "finality-grandpa", - "frame-support 36.0.1", - "parity-scale-codec", - "scale-info", "serde", - "sp-consensus-grandpa 20.0.0", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "bp-header-chain" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ - "bp-runtime 0.19.0", - "finality-grandpa", - "frame-support 39.0.0", - "parity-scale-codec", - "scale-info", "serde", - "sp-consensus-grandpa 22.0.0", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] [[package]] -name = "bp-messages" -version = "0.15.0" +name = "cargo_metadata" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97eec00a98efeb052ac9fc9676d9fccf5acd19e3b18530f3d72af1a1faf21ec" +checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" dependencies = [ - "bp-header-chain 0.15.0", - "bp-runtime 0.15.0", - "frame-support 36.0.1", - "parity-scale-codec", - "scale-info", + "camino", + "cargo-platform", + "semver 1.0.25", "serde", - "sp-core 34.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json", + "thiserror 1.0.69", ] [[package]] -name = "bp-messages" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" +name = "cargo_metadata" +version = "0.19.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" dependencies = [ - "bp-header-chain 0.19.0", - "bp-runtime 0.19.0", - "frame-support 39.0.0", - "parity-scale-codec", - "scale-info", + "camino", + "cargo-platform", + "semver 1.0.25", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "serde_json", + "thiserror 2.0.11", ] [[package]] -name = "bp-polkadot-bulletin" -version = "0.12.0" +name = "cc" +version = "1.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb5b3cd885b40b52bf96e52ffbec92d0c435f7303fc11374ccfcfa5bebfbc4f" +checksum = "755717a7de9ec452bf7f3f1a3099085deabd7f2962b861dae91ecd7a365903d2" dependencies = [ - "bp-header-chain 0.15.0", - "bp-messages 0.15.0", - "bp-polkadot-core 0.15.0", - "bp-runtime 0.15.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "jobserver", + "libc", + "shlex", ] [[package]] -name = "bp-polkadot-core" -version = "0.15.0" +name = "cesu8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef2272823ecfee580c00f6542dfcab3ec7abdb00857af853429736847c3a2d9" -dependencies = [ - "bp-messages 0.15.0", - "bp-runtime 0.15.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "parity-util-mem", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" [[package]] -name = "bp-polkadot-core" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" dependencies = [ - "bp-messages 0.19.0", - "bp-runtime 0.19.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", -] - -[[package]] -name = "bp-runtime" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904644c23b437dde65741f3148067624ed0b4d8360f68adf9e92273aeb970814" -dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "hash-db", - "impl-trait-for-tuples", - "log", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-state-machine 0.42.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 36.0.0", - "trie-db", -] - -[[package]] -name = "bp-runtime" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", - "hash-db", - "impl-trait-for-tuples", - "log", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-trie 38.0.0", - "trie-db", -] - -[[package]] -name = "bp-xcm-bridge-hub" -version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "bp-messages 0.19.0", - "bp-runtime 0.19.0", - "frame-support 39.0.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", -] - -[[package]] -name = "bp-xcm-bridge-hub-router" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7dae4d1ec894ee920195dd39070b279ef3c1d4d078c3fcf7336c93a1d502a9d" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-runtime 38.0.1", -] - -[[package]] -name = "bp-xcm-bridge-hub-router" -version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "staging-xcm 15.0.1", -] - -[[package]] -name = "bs58" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" -dependencies = [ - "sha2 0.10.8", - "tinyvec", -] - -[[package]] -name = "build-helper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdce191bf3fa4995ce948c8c83b4640a1745457a149e73c6db75b4ffe36aad5f" -dependencies = [ - "semver 0.6.0", -] - -[[package]] -name = "bumpalo" -version = "3.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" - -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - -[[package]] -name = "byte-tools" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" - -[[package]] -name = "bytemuck" -version = "1.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef657dfab802224e671f5818e9a4935f9b1957ed18e58292690cc39e7a4092a3" - -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - -[[package]] -name = "bytes" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - -[[package]] -name = "c2-chacha" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d27dae93fe7b1e0424dc57179ac396908c26b035a87234809f5c4dfd1b47dc80" -dependencies = [ - "cipher 0.2.5", - "ppv-lite86", -] - -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.25", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "cargo_metadata" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8769706aad5d996120af43197bf46ef6ad0fda35216b4505f926a365a232d924" -dependencies = [ - "camino", - "cargo-platform", - "semver 1.0.25", - "serde", - "serde_json", - "thiserror 2.0.11", -] - -[[package]] -name = "cc" -version = "1.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "755717a7de9ec452bf7f3f1a3099085deabd7f2962b861dae91ecd7a365903d2" -dependencies = [ - "jobserver", - "libc", - "shlex", -] - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", + "nom", ] [[package]] @@ -2028,11 +1399,6 @@ dependencies = [ "unicode-width 0.1.14", ] -[[package]] -name = "collectives-polkadot-runtime-constants" -version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" - [[package]] name = "color-print" version = "0.3.7" @@ -2557,7 +1923,7 @@ dependencies = [ "sc-service", "sp-blockchain", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "url", ] @@ -2568,19 +1934,19 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "futures", "parity-scale-codec", "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-client-api", - "sp-api 35.0.0", + "sp-api", "sp-consensus", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "tracing", ] @@ -2594,8 +1960,8 @@ dependencies = [ "cumulus-client-consensus-common", "cumulus-client-consensus-proposer", "cumulus-client-parachain-inherent", - "cumulus-primitives-aura 0.16.0", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-aura", + "cumulus-primitives-core", "cumulus-relay-chain-interface", "futures", "parity-scale-codec", @@ -2604,7 +1970,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-client-api", "sc-consensus", "sc-consensus-aura", @@ -2613,18 +1979,18 @@ dependencies = [ "sc-telemetry", "sc-utils", "schnellru", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-application-crypto", + "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-consensus-aura 0.41.0", + "sp-consensus-aura", "sp-core 35.0.0", - "sp-inherents 35.0.0", + "sp-inherents", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", - "sp-timestamp 35.0.0", + "sp-timestamp", "substrate-prometheus-endpoint", "tokio", "tracing", @@ -2637,25 +2003,25 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "async-trait", "cumulus-client-pov-recovery", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "cumulus-relay-chain-interface", "dyn-clone", "futures", "log", "parity-scale-codec", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-client-api", "sc-consensus", "sc-consensus-babe", "schnellru", "sp-blockchain", "sp-consensus", - "sp-consensus-slots 0.41.0", + "sp-consensus-slots", "sp-core 35.0.0", - "sp-runtime 40.1.0", - "sp-timestamp 35.0.0", + "sp-runtime", + "sp-timestamp", "sp-trie 38.0.0", - "sp-version 38.0.0", + "sp-version", "substrate-prometheus-endpoint", "tracing", ] @@ -2667,10 +2033,10 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "anyhow", "async-trait", - "cumulus-primitives-parachain-inherent 0.17.0", + "cumulus-primitives-parachain-inherent", "sp-consensus", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", "sp-state-machine 0.44.0", "thiserror 1.0.69", ] @@ -2688,16 +2054,16 @@ dependencies = [ "parking_lot 0.12.3", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", + "polkadot-parachain-primitives", + "polkadot-primitives", "sc-client-api", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-consensus", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", - "sp-version 38.0.0", + "sp-version", "tracing", ] @@ -2707,16 +2073,16 @@ version = "0.15.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "async-trait", - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-parachain-inherent 0.17.0", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", "cumulus-test-relay-sproof-builder", "parity-scale-codec", "sc-client-api", - "sp-api 35.0.0", + "sp-api", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", "sp-state-machine 0.44.0", "sp-storage 22.0.0", "sp-trie 38.0.0", @@ -2729,7 +2095,7 @@ version = "0.21.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "async-trait", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "cumulus-relay-chain-interface", "futures", "futures-timer", @@ -2737,15 +2103,15 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "sc-client-api", "sc-consensus", - "sp-api 35.0.0", + "sp-api", "sp-consensus", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-runtime 40.1.0", - "sp-version 38.0.0", + "sp-maybe-compressed-blob", + "sp-runtime", + "sp-version", "tracing", ] @@ -2759,13 +2125,13 @@ dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", "cumulus-client-pov-recovery", - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-proof-size-hostfunction 0.11.0", + "cumulus-primitives-core", + "cumulus-primitives-proof-size-hostfunction", "cumulus-relay-chain-inprocess-interface", "cumulus-relay-chain-interface", "cumulus-relay-chain-minimal-node", "futures", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-client-api", "sc-consensus", "sc-network", @@ -2777,32 +2143,13 @@ dependencies = [ "sc-telemetry", "sc-transaction-pool", "sc-utils", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-consensus", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-transaction-pool 35.0.0", -] - -[[package]] -name = "cumulus-pallet-aura-ext" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e8af48090936c45483d489ee681acb54277763586b53fa3dbd17173aa474fc" -dependencies = [ - "cumulus-pallet-parachain-system 0.15.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "pallet-aura 35.0.0", - "pallet-timestamp 35.0.0", - "parity-scale-codec", - "scale-info", - "sp-application-crypto 37.0.0", - "sp-consensus-aura 0.39.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", + "sp-transaction-pool", ] [[package]] @@ -2810,53 +2157,16 @@ name = "cumulus-pallet-aura-ext" version = "0.18.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "cumulus-pallet-parachain-system 0.18.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-aura 38.0.0", - "pallet-timestamp 38.0.0", - "parity-scale-codec", - "scale-info", - "sp-application-crypto 39.0.0", - "sp-consensus-aura 0.41.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "cumulus-pallet-parachain-system" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "300d5509bd8ac95bafe158fa475278315175a4eb0422c2cd82e08e8b9dde035c" -dependencies = [ - "bytes", - "cumulus-pallet-parachain-system-proc-macro 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "cumulus-primitives-core 0.14.0", - "cumulus-primitives-parachain-inherent 0.14.0", - "cumulus-primitives-proof-size-hostfunction 0.9.0", - "environmental", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "impl-trait-for-tuples", - "log", - "pallet-message-queue 39.0.2", + "cumulus-pallet-parachain-system", + "frame-support", + "frame-system", + "pallet-aura", + "pallet-timestamp", "parity-scale-codec", - "polkadot-parachain-primitives 13.0.0", - "polkadot-runtime-common 15.0.0", - "polkadot-runtime-parachains 15.0.4", "scale-info", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-state-machine 0.42.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 36.0.0", - "sp-version 36.0.0", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "trie-db", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", ] [[package]] @@ -2865,41 +2175,40 @@ version = "0.18.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "bytes", - "cumulus-pallet-parachain-system-proc-macro 0.6.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-parachain-inherent 0.17.0", - "cumulus-primitives-proof-size-hostfunction 0.11.0", + "cumulus-pallet-parachain-system-proc-macro", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", + "cumulus-primitives-proof-size-hostfunction", "environmental", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-message-queue 42.0.0", + "pallet-message-queue", "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-runtime-common 18.0.0", - "polkadot-runtime-parachains 18.0.1", + "polkadot-parachain-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", "scale-info", "sp-core 35.0.0", "sp-externalities 0.30.0", - "sp-inherents 35.0.0", + "sp-inherents", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-trie 38.0.0", - "sp-version 38.0.0", + "sp-version", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", + "staging-xcm-builder", "trie-db", ] [[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=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "proc-macro-crate 3.2.0", "proc-macro2", @@ -2908,59 +2217,16 @@ dependencies = [ ] [[package]] -name = "cumulus-pallet-parachain-system-proc-macro" -version = "0.6.0" +name = "cumulus-pallet-session-benchmarking" +version = "20.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "cumulus-pallet-session-benchmarking" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "506daacefa861aa2909b64f26e76495ce029227fd8355b97e074cc1d5dc54ab2" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "pallet-session 36.0.0", - "parity-scale-codec", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "cumulus-pallet-session-benchmarking" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-session 39.0.0", - "parity-scale-codec", - "sp-runtime 40.1.0", -] - -[[package]] -name = "cumulus-pallet-xcm" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d5224285f60e5159bab549f458079d606a7f95ef779def8b89f1a244dc7cf81" -dependencies = [ - "cumulus-primitives-core 0.14.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-session", + "parity-scale-codec", + "sp-runtime", ] [[package]] @@ -2968,81 +2234,39 @@ name = "cumulus-pallet-xcm" version = "0.18.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "cumulus-primitives-core 0.17.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "cumulus-primitives-core", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "staging-xcm 15.0.1", ] -[[package]] -name = "cumulus-pallet-xcmp-queue" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0adf5409618b21e754fef0ac70f257878d22d61c48fdeefcab666835dcb8e0f0" -dependencies = [ - "bounded-collections", - "bp-xcm-bridge-hub-router 0.13.0", - "cumulus-primitives-core 0.14.0", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-message-queue 39.0.2", - "parity-scale-codec", - "polkadot-runtime-common 15.0.0", - "polkadot-runtime-parachains 15.0.4", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "staging-xcm-executor 15.0.0", -] - [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.18.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "bounded-collections", - "bp-xcm-bridge-hub-router 0.15.0", - "cumulus-primitives-core 0.17.0", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "bp-xcm-bridge-hub-router", + "cumulus-primitives-core", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-message-queue 42.0.0", + "pallet-message-queue", "parity-scale-codec", - "polkadot-runtime-common 18.0.0", - "polkadot-runtime-parachains 18.0.1", + "polkadot-runtime-common", + "polkadot-runtime-parachains", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", -] - -[[package]] -name = "cumulus-primitives-aura" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e7977947ad43a4cbc532ca33abcde136ae3deffdc7168b2ae253d73ccd371e4" -dependencies = [ - "parity-scale-codec", - "polkadot-core-primitives 14.0.0", - "polkadot-primitives 14.0.0", - "sp-api 33.0.0", - "sp-consensus-aura 0.39.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -3050,26 +2274,8 @@ name = "cumulus-primitives-aura" version = "0.16.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "sp-api 35.0.0", - "sp-consensus-aura 0.41.0", -] - -[[package]] -name = "cumulus-primitives-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "751e64b89a839d5cfabebc1c797936e5eee791d0fa2322d91e86f8440a743ddb" -dependencies = [ - "parity-scale-codec", - "polkadot-core-primitives 14.0.0", - "polkadot-parachain-primitives 13.0.0", - "polkadot-primitives 14.0.0", - "scale-info", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 36.0.0", - "staging-xcm 14.0.3", + "sp-api", + "sp-consensus-aura", ] [[package]] @@ -3078,59 +2284,30 @@ version = "0.17.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "parity-scale-codec", - "polkadot-core-primitives 16.0.0", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", "scale-info", - "sp-api 35.0.0", - "sp-runtime 40.1.0", + "sp-api", + "sp-runtime", "sp-trie 38.0.0", "staging-xcm 15.0.1", ] -[[package]] -name = "cumulus-primitives-parachain-inherent" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df521e13b48278b86d02c61d6e44036d6d263deb5aaec4838b1751da8988d3d2" -dependencies = [ - "async-trait", - "cumulus-primitives-core 0.14.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-inherents 33.0.0", - "sp-runtime 38.0.1", - "sp-state-machine 0.42.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 36.0.0", -] - [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.17.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "async-trait", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "parity-scale-codec", "scale-info", "sp-core 35.0.0", - "sp-inherents 35.0.0", + "sp-inherents", "sp-trie 38.0.0", ] -[[package]] -name = "cumulus-primitives-proof-size-hostfunction" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f973d2a7262c90e48dcd42062bcb1e0fbf48bbcdac4ea6df3d85212d8d8be5d" -dependencies = [ - "sp-externalities 0.29.0", - "sp-runtime-interface 28.0.0", - "sp-trie 36.0.0", -] - [[package]] name = "cumulus-primitives-proof-size-hostfunction" version = "0.11.0" @@ -3146,37 +2323,16 @@ name = "cumulus-primitives-storage-weight-reclaim" version = "9.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-proof-size-hostfunction 0.11.0", + "cumulus-primitives-core", + "cumulus-primitives-proof-size-hostfunction", "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", -] - -[[package]] -name = "cumulus-primitives-utility" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05742c520065e3870d419683113ed7f6d35de66f0c80af6828e7878d1bb0ea94" -dependencies = [ - "cumulus-primitives-core 0.14.0", - "frame-support 36.0.1", - "log", - "pallet-asset-conversion 18.0.0", - "parity-scale-codec", - "polkadot-runtime-common 15.0.0", - "polkadot-runtime-parachains 15.0.4", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "staging-xcm-executor 15.0.0", + "sp-runtime", ] [[package]] @@ -3184,16 +2340,16 @@ name = "cumulus-primitives-utility" version = "0.18.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "cumulus-primitives-core 0.17.0", - "frame-support 39.0.0", + "cumulus-primitives-core", + "frame-support", "log", - "pallet-asset-conversion 21.0.0", + "pallet-asset-conversion", "parity-scale-codec", - "polkadot-runtime-common 18.0.0", - "sp-runtime 40.1.0", + "polkadot-runtime-common", + "sp-runtime", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -3202,7 +2358,7 @@ version = "0.22.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "async-trait", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "cumulus-relay-chain-interface", "futures", "futures-timer", @@ -3213,10 +2369,10 @@ dependencies = [ "sc-sysinfo", "sc-telemetry", "sc-tracing", - "sp-api 35.0.0", + "sp-api", "sp-consensus", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", ] @@ -3226,16 +2382,16 @@ version = "0.21.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "async-trait", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "futures", "jsonrpsee-core 0.24.8", "parity-scale-codec", "polkadot-overseer", "sc-client-api", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-state-machine 0.44.0", - "sp-version 38.0.0", + "sp-version", "thiserror 1.0.69", ] @@ -3246,16 +2402,16 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "array-bytes", "async-trait", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "cumulus-relay-chain-interface", "cumulus-relay-chain-rpc-interface", "futures", - "polkadot-core-primitives 16.0.0", + "polkadot-core-primitives", "polkadot-network-bridge", "polkadot-node-network-protocol", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "polkadot-service", "sc-authority-discovery", "sc-client-api", @@ -3264,11 +2420,11 @@ dependencies = [ "sc-service", "sc-tracing", "sc-utils", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.41.0", - "sp-runtime 40.1.0", + "sp-consensus-babe", + "sp-runtime", "substrate-prometheus-endpoint", "tokio", "tracing", @@ -3280,7 +2436,7 @@ version = "0.21.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "async-trait", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "cumulus-relay-chain-interface", "either", "futures", @@ -3299,14 +2455,14 @@ dependencies = [ "serde_json", "smoldot 0.11.0", "smoldot-light 0.9.0", - "sp-api 35.0.0", - "sp-authority-discovery 35.0.0", - "sp-consensus-babe 0.41.0", + "sp-api", + "sp-authority-discovery", + "sp-consensus-babe", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "sp-storage 22.0.0", - "sp-version 38.0.0", + "sp-version", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -3320,10 +2476,10 @@ name = "cumulus-test-relay-sproof-builder" version = "0.17.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "parity-scale-codec", - "polkadot-primitives 17.0.0", - "sp-runtime 40.1.0", + "polkadot-primitives", + "sp-runtime", "sp-state-machine 0.44.0", "sp-trie 38.0.0", ] @@ -3916,41 +3072,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "emulated-integration-tests-common" -version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "asset-test-utils", - "bp-messages 0.19.0", - "bp-xcm-bridge-hub", - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-pallet-xcmp-queue 0.18.0", - "cumulus-primitives-core 0.17.0", - "frame-support 39.0.0", - "pallet-assets 41.0.0", - "pallet-balances 40.0.0", - "pallet-bridge-messages", - "pallet-message-queue 42.0.0", - "pallet-xcm 18.0.0", - "pallet-xcm-bridge-hub", - "parachains-common 19.0.0", - "parity-scale-codec", - "paste", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", - "polkadot-runtime-parachains 18.0.1", - "sc-consensus-grandpa", - "sp-authority-discovery 35.0.0", - "sp-consensus-babe 0.41.0", - "sp-consensus-beefy 23.0.0", - "sp-core 35.0.0", - "sp-keyring 40.0.0", - "sp-runtime 40.1.0", - "staging-xcm 15.0.1", - "xcm-emulator", -] - [[package]] name = "encode_unicode" version = "1.0.0" @@ -4096,41 +3217,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "ethabi-decode" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d398648d65820a727d6a81e58b962f874473396a047e4c30bafe3240953417" -dependencies = [ - "ethereum-types 0.14.1", - "tiny-keccak", -] - -[[package]] -name = "ethabi-decode" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52029c4087f9f01108f851d0d02df9c21feb5660a19713466724b7f95bd2d773" -dependencies = [ - "ethereum-types 0.15.1", - "tiny-keccak", -] - -[[package]] -name = "ethbloom" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" -dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec 0.6.0", - "impl-rlp 0.3.0", - "impl-serde 0.4.0", - "scale-info", - "tiny-keccak", -] - [[package]] name = "ethbloom" version = "0.14.1" @@ -4140,38 +3226,22 @@ dependencies = [ "crunchy", "fixed-hash", "impl-codec 0.7.0", - "impl-rlp 0.4.0", + "impl-rlp", "impl-serde 0.5.0", "scale-info", "tiny-keccak", ] -[[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" -dependencies = [ - "ethbloom 0.13.0", - "fixed-hash", - "impl-codec 0.6.0", - "impl-rlp 0.3.0", - "impl-serde 0.4.0", - "primitive-types 0.12.2", - "scale-info", - "uint 0.9.5", -] - [[package]] name = "ethereum-types" version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ab15ed80916029f878e0267c3a9f92b67df55e79af370bf66199059ae2b4ee3" dependencies = [ - "ethbloom 0.14.1", + "ethbloom", "fixed-hash", "impl-codec 0.7.0", - "impl-rlp 0.4.0", + "impl-rlp", "impl-serde 0.5.0", "primitive-types 0.13.1", "scale-info", @@ -4468,51 +3538,25 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" -[[package]] -name = "frame-benchmarking" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "709b26657ebbba53dc7bb616577375ca462b20fef1b00e8d9b20d2435e87f7bc" -dependencies = [ - "frame-support 36.0.1", - "frame-support-procedural 30.0.4", - "frame-system 36.1.0", - "linregress", - "log", - "parity-scale-codec", - "paste", - "scale-info", - "serde", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-runtime-interface 28.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "static_assertions", -] - [[package]] name = "frame-benchmarking" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-support-procedural 31.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-support-procedural", + "frame-system", "linregress", "log", "parity-scale-codec", "paste", "scale-info", "serde", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-runtime-interface 29.0.0", "sp-storage 22.0.0", "static_assertions", @@ -4529,10 +3573,10 @@ dependencies = [ "clap", "comfy-table", "cumulus-client-parachain-inherent", - "cumulus-primitives-proof-size-hostfunction 0.11.0", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "cumulus-primitives-proof-size-hostfunction", + "frame-benchmarking", + "frame-support", + "frame-system", "gethostname", "handlebars", "hex", @@ -4540,8 +3584,8 @@ dependencies = [ "linked-hash-map", "log", "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", + "polkadot-parachain-primitives", + "polkadot-primitives", "rand", "rand_pcg", "sc-block-builder", @@ -4555,24 +3599,24 @@ dependencies = [ "sc-sysinfo", "serde", "serde_json", - "sp-api 35.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-block-builder", "sp-blockchain", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-database", "sp-externalities 0.30.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "sp-storage 22.0.0", - "sp-timestamp 35.0.0", - "sp-transaction-pool 35.0.0", + "sp-timestamp", + "sp-transaction-pool", "sp-trie 38.0.0", - "sp-version 38.0.0", + "sp-version", "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "subxt", "subxt-signer", @@ -4580,18 +3624,6 @@ dependencies = [ "thousands", ] -[[package]] -name = "frame-election-provider-solution-type" -version = "14.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8156f209055d352994ecd49e19658c6b469d7c6de923bd79868957d0dcfb6f71" -dependencies = [ - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "frame-election-provider-solution-type" version = "14.0.1" @@ -4603,58 +3635,20 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "frame-election-provider-support" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1ec289ebad5e601bb165cf7eb6ec2179ae34280ee310d0710a3111d4f8f8f94" -dependencies = [ - "frame-election-provider-solution-type 14.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-npos-elections 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "frame-election-provider-support" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-election-provider-solution-type 14.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-election-provider-solution-type", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", - "sp-npos-elections 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "frame-executive" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d878830330eaa9e8b886279c338556b05702d0059989cb51cfb226b70bf3fa4" -dependencies = [ - "aquamarine", - "frame-support 36.0.1", - "frame-system 36.1.0", - "frame-try-runtime 0.42.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-npos-elections", + "sp-runtime", ] [[package]] @@ -4663,15 +3657,15 @@ version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "aquamarine", - "frame-support 39.0.0", - "frame-system 39.1.0", - "frame-try-runtime 0.45.0", + "frame-support", + "frame-system", + "frame-try-runtime", "log", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] @@ -4710,22 +3704,6 @@ dependencies = [ "serde", ] -[[package]] -name = "frame-metadata-hash-extension" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf37fc730bf4b51e82a34c6357eebe32c04dbacf6525e0a7b9726f6a17ec9427" -dependencies = [ - "array-bytes", - "docify", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", -] - [[package]] name = "frame-metadata-hash-extension" version = "0.7.0" @@ -4734,54 +3712,12 @@ dependencies = [ "array-bytes", "const-hex", "docify", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 40.1.0", -] - -[[package]] -name = "frame-support" -version = "36.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4d08149c28010bfa568dcfa832aea628fb794d4243794a13b1bdef1aa66fb1" -dependencies = [ - "aquamarine", - "array-bytes", - "bitflags 1.3.2", - "docify", - "environmental", - "frame-metadata 16.0.0", - "frame-support-procedural 30.0.4", - "impl-trait-for-tuples", - "k256", + "frame-support", + "frame-system", "log", - "macro_magic", "parity-scale-codec", - "paste", "scale-info", - "serde", - "serde_json", - "smallvec", - "sp-api 33.0.0", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-crypto-hashing-proc-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-genesis-builder 0.14.0", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-metadata-ir 0.7.0", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-state-machine 0.42.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "static_assertions", - "tt-call", + "sp-runtime", ] [[package]] @@ -4791,12 +3727,12 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "aquamarine", "array-bytes", - "binary-merkle-tree 16.0.0", + "binary-merkle-tree", "bitflags 1.3.2", "docify", "environmental", "frame-metadata 18.0.0", - "frame-support-procedural 31.0.0", + "frame-support-procedural", "impl-trait-for-tuples", "k256", "log", @@ -4807,17 +3743,17 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-api 35.0.0", + "sp-api", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", - "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-crypto-hashing-proc-macro", "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", - "sp-metadata-ir 0.8.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", + "sp-metadata-ir", + "sp-runtime", + "sp-staking", "sp-state-machine 0.44.0", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", @@ -4827,26 +3763,6 @@ dependencies = [ "tt-call", ] -[[package]] -name = "frame-support-procedural" -version = "30.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e8f9b6bc1517a6fcbf0b2377e5c8c6d39f5bb7862b191a59a9992081d63972d" -dependencies = [ - "Inflector", - "cfg-expr", - "derive-syn-parse", - "expander", - "frame-support-procedural-tools 13.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.11.0", - "macro_magic", - "proc-macro-warning 1.0.2", - "proc-macro2", - "quote", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 2.0.98", -] - [[package]] name = "frame-support-procedural" version = "31.0.0" @@ -4857,7 +3773,7 @@ dependencies = [ "derive-syn-parse", "docify", "expander", - "frame-support-procedural-tools 13.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "frame-support-procedural-tools", "itertools 0.11.0", "macro_magic", "proc-macro-warning 1.0.2", @@ -4870,39 +3786,15 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "13.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a088fd6fda5f53ff0c17fc7551ce8bd0ead14ba742228443c8196296a7369b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support-procedural-tools-derive 12.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "frame-support-procedural-tools-derive", "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.98", ] -[[package]] -name = "frame-support-procedural-tools" -version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-support-procedural-tools-derive 12.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "frame-support-procedural-tools-derive" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed971c6435503a099bdac99fe4c5bea08981709e5b5a0a8535a1856f48561191" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" @@ -4913,27 +3805,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "frame-system" -version = "36.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d6a0e7bb6503facdcc6f8e19c83cd0bfc8bbbd268522b1a50e107dfc6b972d" -dependencies = [ - "cfg-if", - "docify", - "frame-support 36.0.1", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version 36.0.0", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "frame-system" version = "39.1.0" @@ -4941,57 +3812,31 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "cfg-if", "docify", - "frame-support 39.0.0", + "frame-support", "log", "parity-scale-codec", "scale-info", "serde", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-version 38.0.0", + "sp-version", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] -[[package]] -name = "frame-system-benchmarking" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15afc91c7780e18274dcea58ed1edb700c48d10e086a9785e3f6708099cd3250" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "frame-system-benchmarking" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "frame-system-rpc-runtime-api" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e9e2b7b85e451e367f4fb85ff3295bd039e17f64de1906154d3976e2638ee8" -dependencies = [ - "parity-scale-codec", - "sp-api 33.0.0", + "sp-runtime", ] [[package]] @@ -5001,20 +3846,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "docify", "parity-scale-codec", - "sp-api 35.0.0", -] - -[[package]] -name = "frame-try-runtime" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6ba8b36a52775ad39ccfb45ff4ad814c3cb45ec74d0a4271889e00bd791c6c" -dependencies = [ - "frame-support 36.0.1", - "parity-scale-codec", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-api", ] [[package]] @@ -5022,10 +3854,10 @@ name = "frame-try-runtime" version = "0.45.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", + "frame-support", "parity-scale-codec", - "sp-api 35.0.0", - "sp-runtime 40.1.0", + "sp-api", + "sp-runtime", ] [[package]] @@ -5479,9 +4311,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" @@ -5489,7 +4318,7 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" dependencies = [ - "ahash 0.8.11", + "ahash", ] [[package]] @@ -5498,7 +4327,7 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ - "ahash 0.8.11", + "ahash", "allocator-api2", "serde", ] @@ -6122,17 +4951,6 @@ dependencies = [ "parity-scale-codec", ] -[[package]] -name = "impl-num-traits" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "951641f13f873bff03d4bf19ae8bec531935ac0ac2cc775f84d7edfdcfed3f17" -dependencies = [ - "integer-sqrt", - "num-traits", - "uint 0.9.5", -] - [[package]] name = "impl-num-traits" version = "0.2.0" @@ -6144,22 +4962,13 @@ dependencies = [ "uint 0.10.0", ] -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp 0.5.2", -] - [[package]] name = "impl-rlp" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54ed8ad1f3877f7e775b8cbf30ed1bd3209a95401817f19a0eb4402d13f8cf90" dependencies = [ - "rlp 0.6.1", + "rlp", ] [[package]] @@ -6467,43 +5276,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "integration-tests" -version = "0.0.0" -dependencies = [ - "asset-hub-paseo-runtime", - "asset-hub-westend-runtime", - "asset-test-utils", - "cumulus-primitives-core 0.17.0", - "emulated-integration-tests-common", - "frame-support 39.0.0", - "pallet-assets 41.0.0", - "pallet-balances 40.0.0", - "pallet-message-queue 42.0.0", - "pallet-xcm 18.0.0", - "parity-scale-codec", - "paseo-runtime", - "paseo-runtime-constants", - "polkadot-primitives 17.0.0", - "polkadot-runtime-parachains 18.0.1", - "pop-runtime-common", - "pop-runtime-devnet", - "pop-runtime-mainnet", - "pop-runtime-testnet", - "sp-authority-discovery 35.0.0", - "sp-consensus-aura 0.41.0", - "sp-consensus-babe 0.41.0", - "sp-consensus-beefy 23.0.0", - "sp-consensus-grandpa 22.0.0", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "staging-xcm 15.0.1", - "staging-xcm-executor 18.0.0", - "tracing-subscriber", - "westend-runtime", - "westend-runtime-constants", -] - [[package]] name = "io-lifetimes" version = "1.0.11" @@ -6587,10 +5359,10 @@ name = "ismp-parachain" version = "1.15.3" source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2412#144c98de434ebd6732283b0585c1942c64577873" dependencies = [ - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-primitives-core 0.17.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "cumulus-pallet-parachain-system", + "cumulus-primitives-core", + "frame-support", + "frame-system", "hex-literal", "ismp", "log", @@ -6599,10 +5371,10 @@ dependencies = [ "primitive-types 0.13.1", "scale-info", "serde", - "sp-consensus-aura 0.41.0", - "sp-inherents 35.0.0", + "sp-consensus-aura", + "sp-inherents", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-trie 38.0.0", "substrate-state-machine", ] @@ -6614,7 +5386,7 @@ source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2412#144c98 dependencies = [ "anyhow", "async-trait", - "cumulus-primitives-core 0.17.0", + "cumulus-primitives-core", "cumulus-relay-chain-interface", "ismp", "ismp-parachain", @@ -6622,10 +5394,10 @@ dependencies = [ "log", "pallet-ismp-runtime-api", "parity-scale-codec", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", ] [[package]] @@ -6633,8 +5405,8 @@ name = "ismp-parachain-runtime-api" version = "1.15.1" source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2412#144c98de434ebd6732283b0585c1942c64577873" dependencies = [ - "cumulus-pallet-parachain-system 0.18.0", - "sp-api 35.0.0", + "cumulus-pallet-parachain-system", + "sp-api", ] [[package]] @@ -7099,21 +5871,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c33070833c9ee02266356de0c43f723152bd38bd96ddf52c82b3af10c9138b28" -[[package]] -name = "kusama-runtime-constants" -version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" -dependencies = [ - "frame-support 36.0.1", - "polkadot-primitives 14.0.0", - "polkadot-runtime-common 15.0.0", - "smallvec", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm-builder 15.0.0", -] - [[package]] name = "kvdb" version = "0.13.0" @@ -7874,15 +6631,6 @@ version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" -[[package]] -name = "lru" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e8aaa3f231bb4bd57b84b2d5dc3ae7f350265df8aa96492e0bc394a1571909" -dependencies = [ - "hashbrown 0.12.3", -] - [[package]] name = "lru" version = "0.11.1" @@ -8153,13 +6901,13 @@ dependencies = [ "parity-scale-codec", "sc-client-api", "sc-offchain", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-consensus", - "sp-consensus-beefy 23.0.0", + "sp-consensus-beefy", "sp-core 35.0.0", - "sp-mmr-primitives 35.0.0", - "sp-runtime 40.1.0", + "sp-mmr-primitives", + "sp-runtime", ] [[package]] @@ -8170,11 +6918,11 @@ dependencies = [ "jsonrpsee 0.24.8", "parity-scale-codec", "serde", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-core 35.0.0", - "sp-mmr-primitives 35.0.0", - "sp-runtime 40.1.0", + "sp-mmr-primitives", + "sp-runtime", ] [[package]] @@ -8772,45 +7520,25 @@ name = "pallet-api" version = "0.1.0" dependencies = [ "anyhow", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "ismp", "log", - "pallet-assets 41.0.0", - "pallet-balances 40.0.0", + "pallet-assets", + "pallet-balances", "pallet-ismp", "pallet-nfts 31.0.0", - "pallet-xcm 18.0.0", + "pallet-xcm", "parity-scale-codec", "pop-chain-extension", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", -] - -[[package]] -name = "pallet-asset-conversion" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f726ebb59401c1844a4a8703047bdafcd99a1827cd5d8b2c82abeb8948a7f25b" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "staging-xcm-builder", ] [[package]] @@ -8818,695 +7546,317 @@ name = "pallet-asset-conversion" version = "21.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-api 35.0.0", + "sp-api", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] -name = "pallet-asset-conversion-ops" -version = "0.7.0" +name = "pallet-asset-rate" +version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-asset-conversion 21.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] -name = "pallet-asset-conversion-tx-payment" -version = "18.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0fde03a96382f4dbe37ef95cb4ef7aade7c0be410cb6c888eda911c94af3eaf" +name = "pallet-asset-tx-payment" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "pallet-asset-conversion 18.0.0", - "pallet-transaction-payment 36.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-transaction-payment", "parity-scale-codec", "scale-info", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime", ] [[package]] -name = "pallet-asset-conversion-tx-payment" -version = "21.0.0" +name = "pallet-assets" +version = "41.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-asset-conversion 21.0.0", - "pallet-transaction-payment 39.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", + "log", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", + "sp-core 35.0.0", + "sp-runtime", ] [[package]] -name = "pallet-asset-rate" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e806842bec955190ec64f8b2179f74f5355137c4cadf04f3269e6196cd19caf9" +name = "pallet-aura" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", + "frame-support", + "frame-system", + "log", + "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-application-crypto", + "sp-consensus-aura", + "sp-runtime", ] [[package]] -name = "pallet-asset-rate" -version = "18.0.0" +name = "pallet-authority-discovery" +version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", + "pallet-session", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-application-crypto", + "sp-authority-discovery", + "sp-runtime", ] [[package]] -name = "pallet-asset-tx-payment" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "100a180dfbf30a1c872100ec2dae8a61c0f5e8b3f2d3a5cbb34093826293e2ab" +name = "pallet-authorship" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "pallet-transaction-payment 36.0.0", + "frame-support", + "frame-system", + "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] -name = "pallet-asset-tx-payment" +name = "pallet-babe" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-transaction-payment 39.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-session", + "pallet-timestamp", "parity-scale-codec", "scale-info", - "serde", + "sp-application-crypto", + "sp-consensus-babe", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", + "sp-session", + "sp-staking", ] [[package]] -name = "pallet-assets" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79ef6a7763fc08177f014052469ee12aefcdad0d99a747372360c2f648d2cc4" +name = "pallet-bags-list" +version = "38.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "impl-trait-for-tuples", + "aquamarine", + "docify", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", "log", + "pallet-balances", "parity-scale-codec", "scale-info", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime", + "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] [[package]] -name = "pallet-assets" -version = "41.0.0" +name = "pallet-balances" +version = "40.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "impl-trait-for-tuples", + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] -name = "pallet-assets-freezer" -version = "0.6.0" +name = "pallet-beefy" +version = "40.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "log", - "pallet-assets 41.0.0", + "pallet-authorship", + "pallet-session", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", + "serde", + "sp-consensus-beefy", + "sp-runtime", + "sp-session", + "sp-staking", ] [[package]] -name = "pallet-aura" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0861b2a1ad6526948567bb59a3fdc4c7f02ee79b07be8b931a544350ec35ab0c" +name = "pallet-beefy-mmr" +version = "40.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", + "array-bytes", + "binary-merkle-tree", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-timestamp 35.0.0", + "pallet-beefy", + "pallet-mmr", + "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto 37.0.0", - "sp-consensus-aura 0.39.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "serde", + "sp-api", + "sp-consensus-beefy", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime", + "sp-state-machine 0.44.0", ] [[package]] -name = "pallet-aura" -version = "38.0.0" +name = "pallet-bounties" +version = "38.0.1" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-timestamp 38.0.0", + "pallet-treasury", "parity-scale-codec", "scale-info", - "sp-application-crypto 39.0.0", - "sp-consensus-aura 0.41.0", - "sp-runtime 40.1.0", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime", ] [[package]] -name = "pallet-authority-discovery" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed2c3666a476132f5846fe4d5e1961a923a58a0f54d873d84566f24ffaa3684f" +name = "pallet-broker" +version = "0.18.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "pallet-session 36.0.0", + "bitvec", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", "parity-scale-codec", "scale-info", - "sp-application-crypto 37.0.0", - "sp-authority-discovery 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-api", + "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-core 35.0.0", + "sp-runtime", ] [[package]] -name = "pallet-authority-discovery" -version = "39.0.0" +name = "pallet-child-bounties" +version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-session 39.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-bounties", + "pallet-treasury", "parity-scale-codec", "scale-info", - "sp-application-crypto 39.0.0", - "sp-authority-discovery 35.0.0", - "sp-runtime 40.1.0", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime", ] [[package]] -name = "pallet-authorship" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38885846dbcf03b025fdbd7edb3649046dbc68fa0b419ffe8837ef853a10d31f" +name = "pallet-collator-selection" +version = "20.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "impl-trait-for-tuples", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", + "pallet-authorship", + "pallet-balances", + "pallet-session", "parity-scale-codec", + "rand", "scale-info", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", + "sp-staking", ] [[package]] -name = "pallet-authorship" +name = "pallet-collective" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", - "impl-trait-for-tuples", + "docify", + "frame-benchmarking", + "frame-support", + "frame-system", + "log", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime", ] [[package]] -name = "pallet-babe" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b23d2d814e3cb793659fcf84533f66fdf0ed9cccb66cb2225851f482843ed096" +name = "pallet-contracts" +version = "39.0.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", + "bitflags 1.3.2", + "environmental", + "frame-benchmarking", + "frame-support", + "frame-system", + "impl-trait-for-tuples", "log", - "pallet-authorship 36.0.0", - "pallet-session 36.0.0", - "pallet-timestamp 35.0.0", - "parity-scale-codec", - "scale-info", - "sp-application-crypto 37.0.0", - "sp-consensus-babe 0.39.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-babe" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-authorship 39.0.0", - "pallet-session 39.0.0", - "pallet-timestamp 38.0.0", - "parity-scale-codec", - "scale-info", - "sp-application-crypto 39.0.0", - "sp-consensus-babe 0.41.0", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-bags-list" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af34fa3fb6a0abe3577e435988039a9e441f6705ae2d3ad627a23e3f705baa2d" -dependencies = [ - "aquamarine", - "docify", - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-balances 37.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-bags-list" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "aquamarine", - "docify", - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-balances 40.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", -] - -[[package]] -name = "pallet-balances" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6878e240962d3887f0e0654ac343a18845adb95ad493c9d4d5e803c015d4a4c3" -dependencies = [ - "docify", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-balances" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-beefy" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "715dfcd1bf3f1f37af6335d4eb3cef921e746ac54721e2258c4fd968b61eb009" -dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-authorship 36.0.0", - "pallet-session 36.0.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-consensus-beefy 20.0.0", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-beefy" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-authorship 39.0.0", - "pallet-session 39.0.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-consensus-beefy 23.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-beefy-mmr" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d70c6f872eb3f2635355ccbea944a4f9ea411c0aa25f6f1a15219e8da11ad2" -dependencies = [ - "array-bytes", - "binary-merkle-tree 15.0.1", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-beefy 36.0.0", - "pallet-mmr 35.0.0", - "pallet-session 36.0.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api 33.0.0", - "sp-consensus-beefy 20.0.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-state-machine 0.42.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-beefy-mmr" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "array-bytes", - "binary-merkle-tree 16.0.0", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-beefy 40.0.0", - "pallet-mmr 39.0.0", - "pallet-session 39.0.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api 35.0.0", - "sp-consensus-beefy 23.0.0", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-state-machine 0.44.0", -] - -[[package]] -name = "pallet-bounties" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0566499e74ba4b7ccbd1b667eef0dab76ca28402a8d501e22b73a363717b05a9" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-treasury 35.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-bounties" -version = "38.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-treasury 38.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-bridge-messages" -version = "0.19.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "bp-header-chain 0.19.0", - "bp-messages 0.19.0", - "bp-runtime 0.19.0", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-trie 38.0.0", -] - -[[package]] -name = "pallet-broker" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0d652c399b6ed776ee3322e60f40e323f86b413719d7696eddb8f64c368ac0" -dependencies = [ - "bitvec", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-broker" -version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "bitvec", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-api 35.0.0", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-child-bounties" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38e351f103ebbdd1eb095da8c2379caccc82ebc59a740c2731693d2204286b83" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-bounties 35.0.0", - "pallet-treasury 35.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-child-bounties" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-bounties 38.0.1", - "pallet-treasury 38.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-collator-selection" -version = "17.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f660cc09f2f277a3976da2eef856b5c725ab7ad1192902ef7f4e4bafd992f04f" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-authorship 36.0.0", - "pallet-balances 37.0.0", - "pallet-session 36.0.0", - "parity-scale-codec", - "rand", - "scale-info", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-collator-selection" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-authorship 39.0.0", - "pallet-balances 40.0.0", - "pallet-session 39.0.0", - "parity-scale-codec", - "rand", - "scale-info", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-collective" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-contracts" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "bitflags 1.3.2", - "environmental", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "impl-trait-for-tuples", - "log", - "pallet-balances 40.0.0", - "pallet-contracts-proc-macro", - "pallet-contracts-uapi 12.0.1", + "pallet-balances", + "pallet-contracts-proc-macro", + "pallet-contracts-uapi 12.0.1", "parity-scale-codec", "paste", "rand", @@ -9514,13 +7864,13 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", + "staging-xcm-builder", "wasm-instrument", "wasmi 0.32.3", ] @@ -9557,53 +7907,20 @@ dependencies = [ "scale-info", ] -[[package]] -name = "pallet-conviction-voting" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9033f0d23500bbc39298fd50c07b89a2f2d9f07300139b4df8005995ef683875" -dependencies = [ - "assert_matches", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pallet-conviction-voting" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "assert_matches", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "serde", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-delegated-staking" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0596ec5ab55e02b1b5637b3ec2b99027d036fe97a1ab4733ae105474dfa727cf" -dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -9611,14 +7928,14 @@ name = "pallet-delegated-staking" version = "6.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", + "sp-runtime", + "sp-staking", ] [[package]] @@ -9626,40 +7943,16 @@ name = "pallet-democracy" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "serde", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-election-provider-multi-phase" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd1090fdc6ccdd8ff08c60000c970428baaaf0b33e7a6b01a91ec8b697a650a3" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-election-provider-support-benchmarking 35.0.0", - "parity-scale-codec", - "rand", - "scale-info", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-npos-elections 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "strum 0.26.3", + "sp-runtime", ] [[package]] @@ -9667,49 +7960,34 @@ name = "pallet-election-provider-multi-phase" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", "log", - "pallet-election-provider-support-benchmarking 38.0.0", + "pallet-election-provider-support-benchmarking", "parity-scale-codec", "rand", "scale-info", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-npos-elections 35.0.0", - "sp-runtime 40.1.0", + "sp-npos-elections", + "sp-runtime", "strum 0.26.3", ] -[[package]] -name = "pallet-election-provider-support-benchmarking" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93475989d2f6900caf8f1c847a55d909295c156525a7510c5f1dde176ec7c714" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-system 36.1.0", - "parity-scale-codec", - "sp-npos-elections 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pallet-election-provider-support-benchmarking" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-election-provider-support", + "frame-system", "parity-scale-codec", - "sp-npos-elections 35.0.0", - "sp-runtime 40.1.0", + "sp-npos-elections", + "sp-runtime", ] [[package]] @@ -9717,37 +7995,17 @@ name = "pallet-elections-phragmen" version = "40.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-npos-elections 35.0.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-fast-unstake" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9155f4f762513e0287320411415c76a647152799ad33db1785c9b71c36a14575" -dependencies = [ - "docify", - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-npos-elections", + "sp-runtime", + "sp-staking", ] [[package]] @@ -9756,40 +8014,16 @@ version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "docify", - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-grandpa" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8244b686d5cae6a8af1557ed0f49db08f812f0e7942a8d2da554b4da8a69daf0" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-authorship 36.0.0", - "pallet-session 36.0.0", - "parity-scale-codec", - "scale-info", - "sp-application-crypto 37.0.0", - "sp-consensus-grandpa 20.0.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", + "sp-staking", ] [[package]] @@ -9797,39 +8031,21 @@ name = "pallet-grandpa" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-authorship 39.0.0", - "pallet-session 39.0.0", + "pallet-authorship", + "pallet-session", "parity-scale-codec", "scale-info", - "sp-application-crypto 39.0.0", - "sp-consensus-grandpa 22.0.0", + "sp-application-crypto", + "sp-consensus-grandpa", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-identity" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4555795a3e0e3aa49ea432b7afecb9c71a7db8793a99c68bd8dd3a52a12571f3" -dependencies = [ - "enumflags2", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", + "sp-session", + "sp-staking", ] [[package]] @@ -9838,35 +8054,14 @@ version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "enumflags2", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-im-online" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa761292e95020304b58b50e5187f8bb82f557c8c2d013e3c96ab41d611873b0" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-authorship 36.0.0", - "parity-scale-codec", - "scale-info", - "sp-application-crypto 37.0.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -9874,36 +8069,18 @@ name = "pallet-im-online" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-authorship 39.0.0", + "pallet-authorship", "parity-scale-codec", "scale-info", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-indices" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b183880ad5efae06afe6066e76f2bac5acf67f34b3cfab7352ceec46accf4b45" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-keyring 38.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", + "sp-staking", ] [[package]] @@ -9911,15 +8088,15 @@ name = "pallet-indices" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-keyring 40.0.0", - "sp-runtime 40.1.0", + "sp-keyring", + "sp-runtime", ] [[package]] @@ -9929,19 +8106,19 @@ source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2412#144c98 dependencies = [ "anyhow", "fortuples", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "ismp", "log", "parity-scale-codec", "scale-info", "serde", - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-mmr-primitives 35.0.0", - "sp-runtime 40.1.0", + "sp-mmr-primitives", + "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] @@ -9951,7 +8128,7 @@ version = "1.15.3" source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2412#144c98de434ebd6732283b0585c1942c64577873" dependencies = [ "anyhow", - "frame-system 39.1.0", + "frame-system", "hash-db", "hex", "hex-literal", @@ -9964,11 +8141,11 @@ dependencies = [ "sc-rpc", "serde", "serde_json", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-core 35.0.0", - "sp-mmr-primitives 35.0.0", - "sp-runtime 40.1.0", + "sp-mmr-primitives", + "sp-runtime", "sp-storage 22.0.0", "sp-trie 38.0.0", "tower", @@ -9985,8 +8162,8 @@ dependencies = [ "parity-scale-codec", "primitive-types 0.13.1", "serde", - "sp-api 35.0.0", - "sp-mmr-primitives 35.0.0", + "sp-api", + "sp-mmr-primitives", ] [[package]] @@ -9994,36 +8171,15 @@ name = "pallet-membership" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-message-queue" -version = "39.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e565e64035684e8768e00e54aaa4a0c8e69c83703899d74e8de57ed5fde399da" -dependencies = [ - "environmental", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-core 35.0.0", + "sp-io 39.0.0", + "sp-runtime", ] [[package]] @@ -10032,16 +8188,16 @@ version = "42.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "environmental", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] @@ -10052,34 +8208,15 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "cfg-if", "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-mmr" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf8ccec82827413f031689fef4c714fdb0213d58c7a6e208d33f5eab80483770" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-mmr-primitives 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10087,50 +8224,33 @@ name = "pallet-mmr" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-mmr-primitives 35.0.0", - "sp-runtime 40.1.0", + "sp-mmr-primitives", + "sp-runtime", ] [[package]] name = "pallet-motion" version = "4.0.0-dev" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-balances 40.0.0", + "pallet-balances", "pallet-collective", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-multisig" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be58483d827602eb8353ecf36aed65c857f0974db5d27981831e5ebf853040bd" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10149,34 +8269,15 @@ name = "pallet-nft-fractionalization" version = "22.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-assets 41.0.0", + "pallet-assets", "pallet-nfts 33.0.0", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-nfts" -version = "30.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e1cd476809de3840e19091a083d5a79178af1f108ad489706e1f9e04c8836a4" -dependencies = [ - "enumflags2", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10184,17 +8285,17 @@ name = "pallet-nfts" version = "31.0.0" dependencies = [ "enumflags2", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-balances 40.0.0", + "pallet-balances", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -10203,27 +8304,15 @@ version = "33.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "enumflags2", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-nfts-runtime-api" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0ca7a0446d2d3c27f726a016c6366218df2e0bfef9ed35886b252cfa9757f6c" -dependencies = [ - "pallet-nfts 30.0.0", - "parity-scale-codec", - "sp-api 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10233,7 +8322,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "pallet-nfts 33.0.0", "parity-scale-codec", - "sp-api 35.0.0", + "sp-api", ] [[package]] @@ -10241,34 +8330,14 @@ name = "pallet-nis" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-nomination-pools" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f8c994eb7298a394b58f98afd520b521b5d46f6f39eade4657eeaac9962471" -dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-balances 37.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10276,71 +8345,37 @@ name = "pallet-nomination-pools" version = "37.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "log", - "pallet-balances 40.0.0", + "pallet-balances", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", + "sp-runtime", + "sp-staking", "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] -[[package]] -name = "pallet-nomination-pools-benchmarking" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ee599f2861e55fc6113c01e9b14d6e85fda46bac36a906b5dd5a951fa0455c" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "pallet-bags-list 35.0.0", - "pallet-delegated-staking 3.0.0", - "pallet-nomination-pools 33.0.0", - "pallet-staking 36.0.0", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", - "sp-runtime-interface 28.0.0", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pallet-nomination-pools-benchmarking" version = "37.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-bags-list 38.0.0", - "pallet-delegated-staking 6.0.0", - "pallet-nomination-pools 37.0.0", - "pallet-staking 39.0.1", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", + "pallet-bags-list", + "pallet-delegated-staking", + "pallet-nomination-pools", + "pallet-staking", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", + "sp-runtime", "sp-runtime-interface 29.0.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-nomination-pools-runtime-api" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2906899d8f029780f0d9da77b90ae86f42bcfda5ac402c931406cd84852012ed" -dependencies = [ - "pallet-nomination-pools 33.0.0", - "parity-scale-codec", - "sp-api 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-staking", ] [[package]] @@ -10348,27 +8383,9 @@ name = "pallet-nomination-pools-runtime-api" version = "35.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "pallet-nomination-pools 37.0.0", - "parity-scale-codec", - "sp-api 35.0.0", -] - -[[package]] -name = "pallet-offences" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4859e7bb2af46d2e0f137c2f777adf39f0e5d4d188226158d599f1cfcfb76b9e" -dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-balances 37.0.0", + "pallet-nomination-pools", "parity-scale-codec", - "scale-info", - "serde", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-api", ] [[package]] @@ -10376,40 +8393,15 @@ name = "pallet-offences" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "log", - "pallet-balances 40.0.0", + "pallet-balances", "parity-scale-codec", "scale-info", "serde", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-offences-benchmarking" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4351b0edafcdf3240f0471c638b39d2c981bde9d17c0172536a0aa3b7c3097ef" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-babe 36.0.0", - "pallet-balances 37.0.0", - "pallet-grandpa 36.0.0", - "pallet-im-online 35.0.0", - "pallet-offences 35.0.0", - "pallet-session 36.0.0", - "pallet-staking 36.0.0", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", + "sp-staking", ] [[package]] @@ -10417,41 +8409,22 @@ name = "pallet-offences-benchmarking" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", "log", - "pallet-babe 39.0.0", - "pallet-balances 40.0.0", - "pallet-grandpa 39.0.0", - "pallet-im-online 38.0.0", - "pallet-offences 38.0.0", - "pallet-session 39.0.0", - "pallet-staking 39.0.1", - "parity-scale-codec", - "scale-info", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-parameters" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58d9a81a93202105a660e6aa3d3f81638bdd109ca0497f3e528529cd52d034db" -dependencies = [ - "docify", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", + "pallet-babe", + "pallet-balances", + "pallet-grandpa", + "pallet-im-online", + "pallet-offences", + "pallet-session", + "pallet-staking", "parity-scale-codec", - "paste", "scale-info", - "serde", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", + "sp-staking", ] [[package]] @@ -10460,33 +8433,15 @@ version = "0.10.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "paste", "scale-info", "serde", "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-preimage" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ac726abc5b1bcd6c8f783514b8e1a48be32c7d15e0b263e4bc28cc1e4e7763" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10494,31 +8449,15 @@ name = "pallet-preimage" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-proxy" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4e12680e176607815a78a0cd10a52af50790292cb950404f30a885e2a7229e9" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10536,9 +8475,9 @@ name = "pallet-ranked-collective" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", "parity-scale-codec", @@ -10546,7 +8485,7 @@ dependencies = [ "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -10554,33 +8493,13 @@ name = "pallet-recovery" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-referenda" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2c906a9c4573eb58de4134ec7180bf12c6769df2b9859dae8adcbc5fce78add" -dependencies = [ - "assert_matches", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10589,16 +8508,16 @@ version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "assert_matches", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "serde", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -10609,34 +8528,34 @@ dependencies = [ "bitflags 1.3.2", "derive_more 0.99.19", "environmental", - "ethereum-types 0.15.1", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "ethereum-types", + "frame-benchmarking", + "frame-support", + "frame-system", "hex", "impl-trait-for-tuples", "jsonrpsee 0.24.8", "log", - "pallet-balances 40.0.0", + "pallet-balances", "pallet-revive-fixtures", "pallet-revive-proc-macro", "pallet-revive-uapi", - "pallet-transaction-payment 39.0.0", + "pallet-transaction-payment", "parity-scale-codec", "paste", "polkavm 0.13.0", - "rlp 0.6.1", + "rlp", "scale-info", "serde", - "sp-api 35.0.0", + "sp-api", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", + "staging-xcm-builder", "subxt-signer", ] @@ -10646,13 +8565,13 @@ version = "0.3.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "anyhow", - "frame-system 39.1.0", + "frame-system", "log", "parity-wasm", "polkavm-linker 0.14.0", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "tempfile", "toml 0.8.19", ] @@ -10684,32 +8603,13 @@ name = "pallet-root-testing" version = "15.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-scheduler" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b170d6aa191197d3f50b1193925546972ffc394376ead4d2739eb40909b73c85" -dependencies = [ - "docify", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10718,93 +8618,52 @@ version = "40.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] -[[package]] -name = "pallet-session" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c92b24c911c2cfa5351616edc7f2f93427ea6f4f95efdb13f0f5d51997939c3" -dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "impl-trait-for-tuples", - "log", - "pallet-timestamp 35.0.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-staking 33.0.0", - "sp-state-machine 0.42.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 36.0.0", -] - [[package]] name = "pallet-session" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-timestamp 38.0.0", + "pallet-timestamp", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-staking 37.0.0", + "sp-runtime", + "sp-session", + "sp-staking", "sp-state-machine 0.44.0", "sp-trie 38.0.0", ] -[[package]] -name = "pallet-session-benchmarking" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd02aaf5f10734670346677042ece94fae20dcd5436eafeb9b429d8d6d5b6385" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "pallet-session 36.0.0", - "pallet-staking 36.0.0", - "parity-scale-codec", - "rand", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pallet-session-benchmarking" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-session 39.0.0", - "pallet-staking 39.0.1", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-session", + "pallet-staking", "parity-scale-codec", "rand", - "sp-runtime 40.1.0", - "sp-session 37.0.0", + "sp-runtime", + "sp-session", ] [[package]] @@ -10812,40 +8671,16 @@ name = "pallet-society" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "rand_chacha", "scale-info", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-staking" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbebdb060417654f215fc6f03675e5f44cfc83837d9e523e1b8fd9a4a2e1bdc2" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-authorship 36.0.0", - "pallet-session 36.0.0", - "parity-scale-codec", - "rand_chacha", - "scale-info", - "serde", - "sp-application-crypto 37.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10853,43 +8688,21 @@ name = "pallet-staking" version = "39.0.1" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", "log", - "pallet-authorship 39.0.0", - "pallet-session 39.0.0", + "pallet-authorship", + "pallet-session", "parity-scale-codec", "rand_chacha", "scale-info", "serde", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-staking-reward-curve" -version = "12.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db5e6b1d8ee9d3f6894c5abd8c3e17737ed738c9854f87bfd16239741b7f4d5d" -dependencies = [ - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "pallet-staking-reward-fn" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "988a7ebeacc84d4bdb0b12409681e956ffe35438447d8f8bc78db547cffb6ebc" -dependencies = [ - "log", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", + "sp-staking", ] [[package]] @@ -10901,43 +8714,14 @@ dependencies = [ "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] -[[package]] -name = "pallet-staking-runtime-api" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3350ef1795b832f4adc464e88fb6d44827bd3f98701b0b0bbee495267b444a92" -dependencies = [ - "parity-scale-codec", - "sp-api 33.0.0", - "sp-staking 33.0.0", -] - [[package]] name = "pallet-staking-runtime-api" version = "25.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "parity-scale-codec", - "sp-api 35.0.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "pallet-state-trie-migration" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e07f8626f4ff62ac79d6ad0bd01fab7645897ce35706ddb95fa084e75be9306d" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-api", + "sp-staking", ] [[package]] @@ -10945,32 +8729,15 @@ name = "pallet-state-trie-migration" version = "43.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-sudo" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bd2a8797c1bb3d3897b4f87a7716111da5eeb8561345277b6e6d70349ec8b35" -dependencies = [ - "docify", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -10979,34 +8746,13 @@ version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-timestamp" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae789d344be857679b0b98b28a67c747119724847f81d704d3fd03ee13fb6841" -dependencies = [ - "docify", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "sp-timestamp 33.0.0", + "sp-runtime", ] [[package]] @@ -11015,17 +8761,17 @@ version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-inherents 35.0.0", + "sp-inherents", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-storage 22.0.0", - "sp-timestamp 35.0.0", + "sp-timestamp", ] [[package]] @@ -11033,34 +8779,17 @@ name = "pallet-tips" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", - "pallet-treasury 38.0.0", + "pallet-treasury", "parity-scale-codec", "scale-info", "serde", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-transaction-payment" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fb6114223c8d967c3c2f21cbc845e8ea604ff7e21a8e59d119d5a9257ba886" -dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -11068,15 +8797,15 @@ name = "pallet-transaction-payment" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "serde", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -11085,125 +8814,45 @@ version = "42.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "jsonrpsee 0.24.8", - "pallet-transaction-payment-rpc-runtime-api 39.0.0", + "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-core 35.0.0", "sp-rpc", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] -[[package]] -name = "pallet-transaction-payment-rpc-runtime-api" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4bad1700ad7eb5ab254189e1df894d1d16b3626a3c4b9c45259ec4d9efc262c" -dependencies = [ - "pallet-transaction-payment 36.0.0", - "parity-scale-codec", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "pallet-transaction-payment 39.0.0", + "pallet-transaction-payment", "parity-scale-codec", - "sp-api 35.0.0", - "sp-runtime 40.1.0", + "sp-api", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] -[[package]] -name = "pallet-treasury" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c502615bb4fdd02856a131cb2a612ad40c26435ec938f65f11cae4ff230812b" -dependencies = [ - "docify", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "impl-trait-for-tuples", - "pallet-balances 37.0.0", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "pallet-treasury" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "docify", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-balances 40.0.0", + "pallet-balances", "parity-scale-codec", "scale-info", "serde", "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-uniques" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a59e8599a8c19908e934645f845b5cb546cef1f08745319db7e5b9c24f9e0e4" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "pallet-uniques" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-utility" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3238fe6ad00da6a137be115904c39cab97eb5c7f03da0bb1a20de1bef03f0c71" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -11211,30 +8860,14 @@ name = "pallet-utility" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-vesting" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f7f0f4fe5e1d851e85d81e5e73b6f929f0c35af786ce8be9c9e3363717c136" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -11242,29 +8875,13 @@ name = "pallet-vesting" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-whitelist" -version = "35.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4f27640279229eb73fde0cb06e98b799305e6b0bc724f4dfbef2001ab4ad00" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "sp-runtime", ] [[package]] @@ -11272,38 +8889,13 @@ name = "pallet-whitelist" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "parity-scale-codec", - "scale-info", - "sp-api 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "pallet-xcm" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7409458b7fedc5c7d46459da154ccc2dc22a843ce08e8ab6c1743ef5cf972c" -dependencies = [ - "bounded-collections", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-balances 37.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "staging-xcm-executor 15.0.0", - "xcm-runtime-apis 0.2.0", + "sp-api", + "sp-runtime", ] [[package]] @@ -11312,41 +8904,21 @@ version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "bounded-collections", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-balances 40.0.0", + "frame-benchmarking", + "frame-support", + "frame-system", + "pallet-balances", "parity-scale-codec", "scale-info", "serde", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", + "staging-xcm-builder", + "staging-xcm-executor", "tracing", - "xcm-runtime-apis 0.5.0", -] - -[[package]] -name = "pallet-xcm-benchmarks" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f177a171203cc0bec3cff1bdd5d3b926abfbd0ecf347e044b147194e664f717" -dependencies = [ - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "staging-xcm-executor 15.0.0", + "xcm-runtime-apis", ] [[package]] @@ -11354,110 +8926,17 @@ name = "pallet-xcm-benchmarks" version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "log", "parity-scale-codec", "scale-info", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", -] - -[[package]] -name = "pallet-xcm-bridge-hub" -version = "0.14.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "bp-messages 0.19.0", - "bp-runtime 0.19.0", - "bp-xcm-bridge-hub", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "pallet-bridge-messages", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", -] - -[[package]] -name = "pallet-xcm-bridge-hub-router" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48bd38d4061a51f263f4c08021e66100e16cbda9978fba163d2544637b31dab" -dependencies = [ - "bp-xcm-bridge-hub-router 0.13.0", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", -] - -[[package]] -name = "pallet-xcm-bridge-hub-router" -version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "bp-xcm-bridge-hub-router 0.15.0", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "log", - "parity-scale-codec", - "scale-info", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-runtime", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", -] - -[[package]] -name = "parachains-common" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9319e656eebdf161666e54a4d8e24f73137f702f01600247f7be650bc4d46167" -dependencies = [ - "cumulus-primitives-core 0.14.0", - "cumulus-primitives-utility 0.15.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "log", - "pallet-asset-tx-payment 36.0.0", - "pallet-assets 37.0.0", - "pallet-authorship 36.0.0", - "pallet-balances 37.0.0", - "pallet-collator-selection 17.0.0", - "pallet-message-queue 39.0.2", - "pallet-xcm 15.0.0", - "parity-scale-codec", - "polkadot-primitives 14.0.0", - "scale-info", - "sp-consensus-aura 0.39.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-parachain-info 0.15.0", - "staging-xcm 14.0.3", - "staging-xcm-executor 15.0.0", - "substrate-wasm-builder 23.0.0", + "staging-xcm-builder", + "staging-xcm-executor", ] [[package]] @@ -11465,59 +8944,29 @@ name = "parachains-common" version = "19.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-utility 0.18.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "cumulus-primitives-core", + "cumulus-primitives-utility", + "frame-support", + "frame-system", "log", - "pallet-asset-tx-payment 39.0.0", - "pallet-assets 41.0.0", - "pallet-authorship 39.0.0", - "pallet-balances 40.0.0", - "pallet-collator-selection 20.0.0", - "pallet-message-queue 42.0.0", - "pallet-xcm 18.0.0", - "parity-scale-codec", - "polkadot-primitives 17.0.0", + "pallet-asset-tx-payment", + "pallet-assets", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", + "pallet-message-queue", + "pallet-xcm", + "parity-scale-codec", + "polkadot-primitives", "scale-info", - "sp-consensus-aura 0.41.0", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "staging-parachain-info 0.18.0", - "staging-xcm 15.0.1", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", -] - -[[package]] -name = "parachains-runtimes-test-utils" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-pallet-xcmp-queue 0.18.0", - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-parachain-inherent 0.17.0", - "cumulus-test-relay-sproof-builder", - "frame-support 39.0.0", - "frame-system 39.1.0", - "pallet-balances 40.0.0", - "pallet-collator-selection 20.0.0", - "pallet-session 39.0.0", - "pallet-timestamp 38.0.0", - "pallet-xcm 18.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "sp-consensus-aura 0.41.0", + "sp-consensus-aura", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-parachain-info 0.18.0", + "sp-runtime", + "staging-parachain-info", "staging-xcm 15.0.1", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", + "staging-xcm-executor", + "substrate-wasm-builder", ] [[package]] @@ -11533,12 +8982,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "parity-bytes" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b56e3a2420138bdb970f84dfb9c774aea80fa0e7371549eedec0d80c209c67" - [[package]] name = "parity-db" version = "0.4.13" @@ -11587,35 +9030,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "parity-util-mem" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d32c34f4f5ca7f9196001c0aba5a1f9a5a12382c8944b8b0f90233282d1e8f8" -dependencies = [ - "cfg-if", - "ethereum-types 0.14.1", - "hashbrown 0.12.3", - "impl-trait-for-tuples", - "lru 0.8.1", - "parity-util-mem-derive", - "parking_lot 0.12.3", - "primitive-types 0.12.2", - "smallvec", - "winapi", -] - -[[package]] -name = "parity-util-mem-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f557c32c6d268a07c921471619c0295f5efad3a0e76d4f97a05c091a51d110b2" -dependencies = [ - "proc-macro2", - "syn 1.0.109", - "synstructure 0.12.6", -] - [[package]] name = "parity-wasm" version = "0.45.0" @@ -11682,122 +9096,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7924d1d0ad836f665c9065e26d016c673ece3993f30d340068b16f282afc1156" -[[package]] -name = "paseo-runtime" -version = "1.3.4" -source = "git+https://github.com/paseo-network/runtimes?tag=v1.3.4#313b81aa2b2cb076b4f99c9b2bea040a8bcf709f" -dependencies = [ - "binary-merkle-tree 15.0.1", - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-executive 36.0.0", - "frame-metadata-hash-extension 0.4.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "frame-system-benchmarking 36.0.0", - "frame-system-rpc-runtime-api 33.0.0", - "frame-try-runtime 0.42.0", - "hex-literal", - "log", - "pallet-asset-rate 15.0.0", - "pallet-authority-discovery 36.0.0", - "pallet-authorship 36.0.0", - "pallet-babe 36.0.0", - "pallet-bags-list 35.0.0", - "pallet-balances 37.0.0", - "pallet-beefy 36.0.0", - "pallet-beefy-mmr 36.0.0", - "pallet-bounties 35.0.0", - "pallet-broker 0.15.0", - "pallet-child-bounties 35.0.0", - "pallet-conviction-voting 36.0.0", - "pallet-election-provider-multi-phase 35.0.0", - "pallet-election-provider-support-benchmarking 35.0.0", - "pallet-fast-unstake 35.0.0", - "pallet-grandpa 36.0.0", - "pallet-indices 36.0.0", - "pallet-message-queue 39.0.2", - "pallet-mmr 35.0.0", - "pallet-multisig 36.0.0", - "pallet-nomination-pools 33.0.0", - "pallet-nomination-pools-benchmarking 34.0.0", - "pallet-nomination-pools-runtime-api 31.0.0", - "pallet-offences 35.0.0", - "pallet-offences-benchmarking 36.0.0", - "pallet-parameters 0.7.0", - "pallet-preimage 36.0.0", - "pallet-proxy 36.0.0", - "pallet-referenda 36.0.0", - "pallet-scheduler 37.0.0", - "pallet-session 36.0.0", - "pallet-session-benchmarking 36.0.0", - "pallet-staking 36.0.0", - "pallet-staking-reward-curve", - "pallet-staking-reward-fn 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pallet-staking-runtime-api 21.0.0", - "pallet-state-trie-migration 37.0.0", - "pallet-sudo 36.0.0", - "pallet-timestamp 35.0.0", - "pallet-transaction-payment 36.0.0", - "pallet-transaction-payment-rpc-runtime-api 36.0.0", - "pallet-treasury 35.0.0", - "pallet-utility 36.0.0", - "pallet-vesting 36.0.0", - "pallet-whitelist 35.0.0", - "pallet-xcm 15.0.0", - "pallet-xcm-benchmarks 15.0.0", - "parity-scale-codec", - "paseo-runtime-constants", - "polkadot-parachain-primitives 13.0.0", - "polkadot-primitives 14.0.0", - "polkadot-runtime-common 15.0.0", - "polkadot-runtime-parachains 15.0.4", - "relay-common", - "scale-info", - "serde_json", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-authority-discovery 33.0.0", - "sp-block-builder 33.0.0", - "sp-consensus-babe 0.39.0", - "sp-consensus-beefy 20.0.0", - "sp-core 34.0.0", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-genesis-builder 0.14.0", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-npos-elections 33.0.0", - "sp-offchain 33.0.0", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "sp-transaction-pool 33.0.0", - "sp-version 36.0.0", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "staging-xcm-executor 15.0.0", - "substrate-wasm-builder 23.0.0", - "xcm-runtime-apis 0.2.0", -] - -[[package]] -name = "paseo-runtime-constants" -version = "1.0.0" -source = "git+https://github.com/paseo-network/runtimes?tag=v1.3.4#313b81aa2b2cb076b4f99c9b2bea040a8bcf709f" -dependencies = [ - "frame-support 36.0.1", - "polkadot-primitives 14.0.0", - "polkadot-runtime-common 15.0.0", - "smallvec", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm-builder 15.0.0", -] - [[package]] name = "password-hash" version = "0.5.0" @@ -11974,7 +9272,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "tracing-gum", ] @@ -11990,7 +9288,7 @@ dependencies = [ "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "tracing-gum", ] @@ -12009,7 +9307,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "sc-network", "schnellru", @@ -12033,7 +9331,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "sc-network", "schnellru", @@ -12073,9 +9371,9 @@ dependencies = [ "sc-tracing", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-keyring 40.0.0", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-runtime 40.1.0", + "sp-keyring", + "sp-maybe-compressed-blob", + "sp-runtime", "substrate-build-script-utils", "thiserror 1.0.69", ] @@ -12093,29 +9391,16 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "schnellru", "sp-core 35.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", "tokio-util", "tracing-gum", ] -[[package]] -name = "polkadot-core-primitives" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c72ee63bcf920f963cd7ac066759b0b649350c8ab3781a85a6aac87b1488f2" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "polkadot-core-primitives" version = "16.0.0" @@ -12124,7 +9409,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -12143,10 +9428,10 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-network", "schnellru", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-keystore 0.41.0", "thiserror 1.0.69", "tracing-gum", @@ -12159,7 +9444,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "parity-scale-codec", "polkadot-node-primitives", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "reed-solomon-novelpoly", "sp-core 35.0.0", "sp-trie 38.0.0", @@ -12176,12 +9461,12 @@ dependencies = [ "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "rand_chacha", "sc-network", "sc-network-common", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-keystore 0.41.0", @@ -12204,7 +9489,7 @@ dependencies = [ "polkadot-node-network-protocol", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-network", "sp-consensus", "thiserror 1.0.69", @@ -12222,10 +9507,10 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "schnellru", "sp-core 35.0.0", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-maybe-compressed-blob", "thiserror 1.0.69", "tracing-gum", ] @@ -12248,17 +9533,17 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "rand_chacha", "rand_core", "sc-keystore", "schnellru", "schnorrkel 0.11.4", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-consensus", - "sp-consensus-slots 0.41.0", - "sp-runtime 40.1.0", + "sp-consensus-slots", + "sp-runtime", "thiserror 1.0.69", "tracing-gum", ] @@ -12280,15 +9565,15 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "rand_chacha", "rand_core", "sc-keystore", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-consensus", - "sp-consensus-slots 0.41.0", - "sp-runtime 40.1.0", + "sp-consensus-slots", + "sp-runtime", "thiserror 1.0.69", "tracing-gum", ] @@ -12308,7 +9593,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sp-consensus", "thiserror 1.0.69", "tracing-gum", @@ -12326,8 +9611,8 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", + "polkadot-parachain-primitives", + "polkadot-primitives", "polkadot-statement-table", "schnellru", "sp-keystore 0.41.0", @@ -12343,7 +9628,7 @@ dependencies = [ "futures", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sp-keystore 0.41.0", "thiserror 1.0.69", "tracing-gum", @@ -12365,9 +9650,9 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", - "sp-application-crypto 39.0.0", + "polkadot-parachain-primitives", + "polkadot-primitives", + "sp-application-crypto", "sp-keystore 0.41.0", "tracing-gum", ] @@ -12398,7 +9683,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "thiserror 1.0.69", "tracing-gum", ] @@ -12415,7 +9700,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-keystore", "schnellru", "thiserror 1.0.69", @@ -12432,9 +9717,9 @@ dependencies = [ "futures-timer", "polkadot-node-subsystem", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sp-blockchain", - "sp-inherents 35.0.0", + "sp-inherents", "thiserror 1.0.69", "tracing-gum", ] @@ -12448,7 +9733,7 @@ dependencies = [ "futures", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "thiserror 1.0.69", "tracing-gum", ] @@ -12465,7 +9750,7 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "schnellru", "thiserror 1.0.69", "tracing-gum", @@ -12484,13 +9769,13 @@ dependencies = [ "futures-timer", "parity-scale-codec", "pin-project", - "polkadot-core-primitives 16.0.0", + "polkadot-core-primitives", "polkadot-node-core-pvf-common", "polkadot-node-metrics", "polkadot-node-primitives", "polkadot-node-subsystem", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", + "polkadot-parachain-primitives", + "polkadot-primitives", "rand", "slotmap", "sp-core 35.0.0", @@ -12511,7 +9796,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sp-keystore 0.41.0", "thiserror 1.0.69", "tracing-gum", @@ -12528,8 +9813,8 @@ dependencies = [ "libc", "nix 0.28.0", "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", + "polkadot-parachain-primitives", + "polkadot-primitives", "sc-executor", "sc-executor-common", "sc-executor-wasmtime", @@ -12552,9 +9837,9 @@ dependencies = [ "polkadot-node-metrics", "polkadot-node-subsystem", "polkadot-node-subsystem-types", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "schnellru", - "sp-consensus-babe 0.41.0", + "sp-consensus-babe", "tracing-gum", ] @@ -12568,7 +9853,7 @@ dependencies = [ "futures-timer", "log", "parity-scale-codec", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "prioritized-metered-channel", "sc-cli", "sc-service", @@ -12591,12 +9876,12 @@ dependencies = [ "hex", "parity-scale-codec", "polkadot-node-primitives", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "rand", "sc-authority-discovery", "sc-network", "sc-network-types", - "sp-runtime 40.1.0", + "sp-runtime", "strum 0.26.3", "thiserror 1.0.69", "tracing-gum", @@ -12612,18 +9897,18 @@ dependencies = [ "futures", "futures-timer", "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", + "polkadot-parachain-primitives", + "polkadot-primitives", "sc-keystore", "schnorrkel 0.11.4", "serde", - "sp-application-crypto 39.0.0", - "sp-consensus-babe 0.41.0", - "sp-consensus-slots 0.41.0", + "sp-application-crypto", + "sp-consensus-babe", + "sp-consensus-slots", "sp-core 35.0.0", "sp-keystore 0.41.0", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-runtime 40.1.0", + "sp-maybe-compressed-blob", + "sp-runtime", "thiserror 1.0.69", "zstd 0.12.4", ] @@ -12650,18 +9935,18 @@ dependencies = [ "orchestra", "polkadot-node-network-protocol", "polkadot-node-primitives", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "polkadot-statement-table", "sc-client-api", "sc-network", "sc-network-types", "sc-transaction-pool-api", "smallvec", - "sp-api 35.0.0", - "sp-authority-discovery 35.0.0", + "sp-api", + "sp-authority-discovery", "sp-blockchain", - "sp-consensus-babe 0.41.0", - "sp-runtime 40.1.0", + "sp-consensus-babe", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] @@ -12689,12 +9974,12 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-types", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "prioritized-metered-channel", "rand", "sc-client-api", "schnellru", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-core 35.0.0", "sp-keystore 0.41.0", "thiserror 1.0.69", @@ -12715,32 +10000,14 @@ dependencies = [ "polkadot-node-network-protocol", "polkadot-node-primitives", "polkadot-node-subsystem-types", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-client-api", - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", "tikv-jemalloc-ctl", "tracing-gum", ] -[[package]] -name = "polkadot-parachain-primitives" -version = "13.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61070d0ff28f596890def0e0d03c231860796130b2a43e293106fa86a50c9a9" -dependencies = [ - "bounded-collections", - "derive_more 0.99.19", - "parity-scale-codec", - "polkadot-core-primitives 14.0.0", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "polkadot-parachain-primitives" version = "15.0.0" @@ -12748,41 +10015,13 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "bounded-collections", "derive_more 0.99.19", - "parity-scale-codec", - "polkadot-core-primitives 16.0.0", - "scale-info", - "serde", - "sp-core 35.0.0", - "sp-runtime 40.1.0", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", -] - -[[package]] -name = "polkadot-primitives" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a4879609f4340138930c3c7313256941104a3ff6f7ecb2569d15223da9b35b2" -dependencies = [ - "bitvec", - "hex-literal", - "log", - "parity-scale-codec", - "polkadot-core-primitives 14.0.0", - "polkadot-parachain-primitives 13.0.0", - "scale-info", - "serde", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-authority-discovery 33.0.0", - "sp-consensus-slots 0.39.0", - "sp-core 34.0.0", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-keystore 0.40.0", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parity-scale-codec", + "polkadot-core-primitives", + "scale-info", + "serde", + "sp-core 35.0.0", + "sp-runtime", + "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] [[package]] @@ -12794,21 +10033,21 @@ dependencies = [ "hex-literal", "log", "parity-scale-codec", - "polkadot-core-primitives 16.0.0", - "polkadot-parachain-primitives 15.0.0", + "polkadot-core-primitives", + "polkadot-parachain-primitives", "scale-info", "serde", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-authority-discovery 35.0.0", - "sp-consensus-slots 0.41.0", + "sp-authority-discovery", + "sp-consensus-slots", "sp-core 35.0.0", - "sp-inherents 35.0.0", + "sp-inherents", "sp-io 39.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", + "sp-runtime", + "sp-staking", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "thiserror 1.0.69", ] @@ -12821,7 +10060,7 @@ dependencies = [ "jsonrpsee 0.24.8", "mmr-rpc", "pallet-transaction-payment-rpc", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sc-chain-spec", "sc-client-api", "sc-consensus-babe", @@ -12835,213 +10074,82 @@ dependencies = [ "sc-rpc-spec-v2", "sc-sync-state-rpc", "sc-transaction-pool-api", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-application-crypto", + "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.41.0", - "sp-consensus-beefy 23.0.0", + "sp-consensus-babe", + "sp-consensus-beefy", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-frame-rpc-system", "substrate-state-trie-migration-rpc", ] -[[package]] -name = "polkadot-runtime-common" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28fdcb41bb21c7b14d0341a9a17364ccc04ad34de05d41e7938cb03acbc11066" -dependencies = [ - "bitvec", - "frame-benchmarking 36.0.0", - "frame-election-provider-support 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "impl-trait-for-tuples", - "libsecp256k1", - "log", - "pallet-asset-rate 15.0.0", - "pallet-authorship 36.0.0", - "pallet-babe 36.0.0", - "pallet-balances 37.0.0", - "pallet-broker 0.15.0", - "pallet-election-provider-multi-phase 35.0.0", - "pallet-fast-unstake 35.0.0", - "pallet-identity 36.0.0", - "pallet-session 36.0.0", - "pallet-staking 36.0.0", - "pallet-staking-reward-fn 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "pallet-timestamp 35.0.0", - "pallet-transaction-payment 36.0.0", - "pallet-treasury 35.0.0", - "pallet-vesting 36.0.0", - "parity-scale-codec", - "polkadot-primitives 14.0.0", - "polkadot-runtime-parachains 15.0.4", - "rustc-hex", - "scale-info", - "serde", - "serde_derive", - "slot-range-helper 14.0.0", - "sp-api 33.0.0", - "sp-core 34.0.0", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-npos-elections 33.0.0", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", - "staging-xcm-executor 15.0.0", - "static_assertions", -] - [[package]] name = "polkadot-runtime-common" version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "bitvec", - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-election-provider-support", + "frame-support", + "frame-system", "impl-trait-for-tuples", "libsecp256k1", "log", - "pallet-asset-rate 18.0.0", - "pallet-authorship 39.0.0", - "pallet-babe 39.0.0", - "pallet-balances 40.0.0", - "pallet-broker 0.18.0", - "pallet-election-provider-multi-phase 38.0.0", - "pallet-fast-unstake 38.0.0", - "pallet-identity 39.0.0", - "pallet-session 39.0.0", - "pallet-staking 39.0.1", - "pallet-staking-reward-fn 22.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "pallet-timestamp 38.0.0", - "pallet-transaction-payment 39.0.0", - "pallet-treasury 38.0.0", - "pallet-vesting 39.0.0", - "parity-scale-codec", - "polkadot-primitives 17.0.0", - "polkadot-runtime-parachains 18.0.1", + "pallet-asset-rate", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-broker", + "pallet-election-provider-multi-phase", + "pallet-fast-unstake", + "pallet-identity", + "pallet-session", + "pallet-staking", + "pallet-staking-reward-fn", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-treasury", + "pallet-vesting", + "parity-scale-codec", + "polkadot-primitives", + "polkadot-runtime-parachains", "rustc-hex", "scale-info", "serde", "serde_derive", - "slot-range-helper 16.0.0", - "sp-api 35.0.0", + "slot-range-helper", + "sp-api", "sp-core 35.0.0", - "sp-inherents 35.0.0", + "sp-inherents", "sp-io 39.0.0", - "sp-keyring 40.0.0", - "sp-npos-elections 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-staking 37.0.0", + "sp-keyring", + "sp-npos-elections", + "sp-runtime", + "sp-session", + "sp-staking", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", ] -[[package]] -name = "polkadot-runtime-constants" -version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" -dependencies = [ - "frame-support 36.0.1", - "polkadot-primitives 14.0.0", - "polkadot-runtime-common 15.0.0", - "smallvec", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm-builder 15.0.0", -] - -[[package]] -name = "polkadot-runtime-metrics" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac75b3fea8464e5681b44733ed11cf09e22ff1e956f6703b918b637bd40e7427" -dependencies = [ - "bs58", - "frame-benchmarking 36.0.0", - "parity-scale-codec", - "polkadot-primitives 14.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "polkadot-runtime-metrics" version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "bs58", - "frame-benchmarking 39.0.0", + "frame-benchmarking", "parity-scale-codec", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] -[[package]] -name = "polkadot-runtime-parachains" -version = "15.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63f6a36ba61ca8f2c07b7061894f3a947d77189c66e992a2f23109eb01dfa9e0" -dependencies = [ - "bitflags 1.3.2", - "bitvec", - "derive_more 0.99.19", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "impl-trait-for-tuples", - "log", - "pallet-authority-discovery 36.0.0", - "pallet-authorship 36.0.0", - "pallet-babe 36.0.0", - "pallet-balances 37.0.0", - "pallet-broker 0.15.0", - "pallet-message-queue 39.0.2", - "pallet-session 36.0.0", - "pallet-staking 36.0.0", - "pallet-timestamp 35.0.0", - "pallet-vesting 36.0.0", - "parity-scale-codec", - "polkadot-core-primitives 14.0.0", - "polkadot-parachain-primitives 13.0.0", - "polkadot-primitives 14.0.0", - "polkadot-runtime-metrics 15.0.0", - "rand", - "rand_chacha", - "scale-info", - "serde", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-inherents 33.0.0", - "sp-io 37.0.0", - "sp-keystore 0.40.0", - "sp-runtime 38.0.1", - "sp-session 34.0.0", - "sp-staking 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-executor 15.0.0", - "static_assertions", - "xcm-procedural 10.0.1", -] - [[package]] name = "polkadot-runtime-parachains" version = "18.0.1" @@ -13050,44 +10158,44 @@ dependencies = [ "bitflags 1.3.2", "bitvec", "derive_more 0.99.19", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-benchmarking", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-authority-discovery 39.0.0", - "pallet-authorship 39.0.0", - "pallet-babe 39.0.0", - "pallet-balances 40.0.0", - "pallet-broker 0.18.0", - "pallet-message-queue 42.0.0", - "pallet-mmr 39.0.0", - "pallet-session 39.0.0", - "pallet-staking 39.0.1", - "pallet-timestamp 38.0.0", - "pallet-vesting 39.0.0", - "parity-scale-codec", - "polkadot-core-primitives 16.0.0", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", - "polkadot-runtime-metrics 18.0.0", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-broker", + "pallet-message-queue", + "pallet-mmr", + "pallet-session", + "pallet-staking", + "pallet-timestamp", + "pallet-vesting", + "parity-scale-codec", + "polkadot-core-primitives", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-metrics", "rand", "rand_chacha", "scale-info", "serde", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", - "sp-inherents 35.0.0", + "sp-inherents", "sp-io 39.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-staking 37.0.0", + "sp-runtime", + "sp-session", + "sp-staking", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", - "staging-xcm-executor 18.0.0", + "staging-xcm-executor", "static_assertions", ] @@ -13097,32 +10205,32 @@ version = "0.8.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "docify", - "frame-benchmarking 39.0.0", - "frame-executive 39.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "frame-system-benchmarking 39.0.0", - "frame-system-rpc-runtime-api 35.0.0", - "frame-try-runtime 0.45.0", + "frame-benchmarking", + "frame-executive", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", "log", "parity-scale-codec", "scale-info", - "sp-api 35.0.0", + "sp-api", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-block-builder 35.0.0", - "sp-consensus-aura 0.41.0", - "sp-consensus-grandpa 22.0.0", + "sp-block-builder", + "sp-consensus-aura", + "sp-consensus-grandpa", "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", - "sp-keyring 40.0.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-session", "sp-storage 22.0.0", - "sp-transaction-pool 35.0.0", - "sp-version 38.0.0", + "sp-transaction-pool", + "sp-version", ] [[package]] @@ -13131,18 +10239,18 @@ version = "22.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "async-trait", - "frame-benchmarking 39.0.0", + "frame-benchmarking", "frame-benchmarking-cli", - "frame-system 39.1.0", - "frame-system-rpc-runtime-api 35.0.0", + "frame-system", + "frame-system-rpc-runtime-api", "futures", "is_executable", "kvdb", "kvdb-rocksdb", "log", "mmr-gadget", - "pallet-transaction-payment 39.0.0", - "pallet-transaction-payment-rpc-runtime-api 39.0.0", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", "parity-db", "parity-scale-codec", "parking_lot 0.12.3", @@ -13151,7 +10259,7 @@ dependencies = [ "polkadot-availability-distribution", "polkadot-availability-recovery", "polkadot-collator-protocol", - "polkadot-core-primitives 16.0.0", + "polkadot-core-primitives", "polkadot-dispute-distribution", "polkadot-gossip-support", "polkadot-network-bridge", @@ -13177,9 +10285,9 @@ dependencies = [ "polkadot-node-subsystem-types", "polkadot-node-subsystem-util", "polkadot-overseer", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "polkadot-rpc", - "polkadot-runtime-parachains 18.0.1", + "polkadot-runtime-parachains", "polkadot-statement-distribution", "rococo-runtime", "sc-authority-discovery", @@ -13204,33 +10312,33 @@ dependencies = [ "sc-transaction-pool-api", "serde", "serde_json", - "sp-api 35.0.0", - "sp-authority-discovery 35.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-authority-discovery", + "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.41.0", - "sp-consensus-beefy 23.0.0", - "sp-consensus-grandpa 22.0.0", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", - "sp-keyring 40.0.0", - "sp-mmr-primitives 35.0.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-timestamp 35.0.0", - "sp-transaction-pool 35.0.0", - "sp-version 38.0.0", + "sp-keyring", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-timestamp", + "sp-transaction-pool", + "sp-version", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tracing-gum", "westend-runtime", - "xcm-runtime-apis 0.5.0", + "xcm-runtime-apis", ] [[package]] @@ -13249,9 +10357,9 @@ dependencies = [ "polkadot-node-primitives", "polkadot-node-subsystem", "polkadot-node-subsystem-util", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sp-keystore 0.41.0", - "sp-staking 37.0.0", + "sp-staking", "thiserror 1.0.69", "tracing-gum", ] @@ -13262,7 +10370,7 @@ version = "17.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "parity-scale-codec", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "sp-core 35.0.0", "tracing-gum", ] @@ -13511,11 +10619,11 @@ version = "0.1.0" dependencies = [ "contract-build", "env_logger 0.11.6", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "log", - "pallet-assets 41.0.0", - "pallet-balances 40.0.0", + "pallet-assets", + "pallet-balances", "pallet-contracts", "parity-scale-codec", "pop-api", @@ -13523,7 +10631,7 @@ dependencies = [ "pop-runtime-devnet", "pop-runtime-testnet", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -13532,19 +10640,19 @@ version = "0.1.0" dependencies = [ "contract-build", "env_logger 0.11.6", - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-balances 40.0.0", + "pallet-balances", "pallet-contracts", - "pallet-timestamp 38.0.0", + "pallet-timestamp", "parity-scale-codec", "rand", "scale-info", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] @@ -13560,12 +10668,12 @@ dependencies = [ "cumulus-client-consensus-common", "cumulus-client-consensus-proposer", "cumulus-client-service", - "cumulus-primitives-aura 0.16.0", - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-parachain-inherent 0.17.0", + "cumulus-primitives-aura", + "cumulus-primitives-core", + "cumulus-primitives-parachain-inherent", "cumulus-relay-chain-interface", "docify", - "frame-benchmarking 39.0.0", + "frame-benchmarking", "frame-benchmarking-cli", "futures", "ismp-parachain", @@ -13575,11 +10683,11 @@ dependencies = [ "log", "pallet-ismp-rpc", "pallet-ismp-runtime-api", - "pallet-multisig 39.0.0", + "pallet-multisig", "pallet-transaction-payment-rpc", "parity-scale-codec", "polkadot-cli", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "pop-runtime-common", "pop-runtime-devnet", "pop-runtime-mainnet", @@ -13602,20 +10710,20 @@ dependencies = [ "sc-transaction-pool-api", "serde", "serde_json", - "sp-api 35.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-block-builder", "sp-blockchain", - "sp-consensus-aura 0.41.0", + "sp-consensus-aura", "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", + "sp-genesis-builder", "sp-io 39.0.0", - "sp-keyring 40.0.0", + "sp-keyring", "sp-keystore 0.41.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-timestamp 35.0.0", - "sp-transaction-pool 35.0.0", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-timestamp", + "sp-transaction-pool", "staging-xcm 15.0.1", "substrate-build-script-utils", "substrate-frame-rpc-system", @@ -13636,12 +10744,12 @@ name = "pop-runtime-common" version = "0.0.0" dependencies = [ "docify", - "frame-support 39.0.0", - "parachains-common 19.0.0", + "frame-support", + "parachains-common", "parity-scale-codec", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "scale-info", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -13649,26 +10757,26 @@ name = "pop-runtime-devnet" version = "0.1.0" dependencies = [ "anyhow", - "cumulus-pallet-aura-ext 0.18.0", - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-pallet-session-benchmarking 20.0.0", - "cumulus-pallet-xcm 0.18.0", - "cumulus-pallet-xcmp-queue 0.18.0", - "cumulus-primitives-aura 0.16.0", - "cumulus-primitives-core 0.17.0", + "cumulus-pallet-aura-ext", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", + "cumulus-primitives-core", "cumulus-primitives-storage-weight-reclaim", - "cumulus-primitives-utility 0.18.0", + "cumulus-primitives-utility", "docify", "enumflags2", "env_logger 0.11.6", - "frame-benchmarking 39.0.0", - "frame-executive 39.0.0", - "frame-metadata-hash-extension 0.7.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "frame-system-benchmarking 39.0.0", - "frame-system-rpc-runtime-api 35.0.0", - "frame-try-runtime 0.45.0", + "frame-benchmarking", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", "hex", "hex-literal", "ismp", @@ -13676,209 +10784,209 @@ dependencies = [ "ismp-parachain-runtime-api", "log", "pallet-api", - "pallet-assets 41.0.0", - "pallet-aura 38.0.0", - "pallet-authorship 39.0.0", - "pallet-balances 40.0.0", - "pallet-collator-selection 20.0.0", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", "pallet-contracts", "pallet-ismp", "pallet-ismp-runtime-api", - "pallet-message-queue 42.0.0", - "pallet-multisig 39.0.0", + "pallet-message-queue", + "pallet-multisig", "pallet-nft-fractionalization", "pallet-nfts 31.0.0", - "pallet-nfts-runtime-api 25.0.0", - "pallet-preimage 39.0.0", - "pallet-proxy 39.0.0", + "pallet-nfts-runtime-api", + "pallet-preimage", + "pallet-proxy", "pallet-revive", - "pallet-scheduler 40.0.0", - "pallet-session 39.0.0", - "pallet-sudo 39.0.0", - "pallet-timestamp 38.0.0", - "pallet-transaction-payment 39.0.0", - "pallet-transaction-payment-rpc-runtime-api 39.0.0", - "pallet-utility 39.0.0", - "pallet-xcm 18.0.0", - "parachains-common 19.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-runtime-common 18.0.0", + "pallet-scheduler", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-runtime-common", "pop-chain-extension", "pop-primitives", "pop-runtime-common", "scale-info", "smallvec", - "sp-api 35.0.0", - "sp-block-builder 35.0.0", - "sp-consensus-aura 0.41.0", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", - "sp-mmr-primitives 35.0.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-transaction-pool 35.0.0", - "sp-version 38.0.0", - "staging-parachain-info 0.18.0", + "sp-transaction-pool", + "sp-version", + "staging-parachain-info", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", ] [[package]] name = "pop-runtime-mainnet" version = "0.1.0" dependencies = [ - "cumulus-pallet-aura-ext 0.18.0", - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-pallet-session-benchmarking 20.0.0", - "cumulus-pallet-xcm 0.18.0", - "cumulus-pallet-xcmp-queue 0.18.0", - "cumulus-primitives-aura 0.16.0", - "cumulus-primitives-core 0.17.0", + "cumulus-pallet-aura-ext", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", + "cumulus-primitives-core", "cumulus-primitives-storage-weight-reclaim", - "cumulus-primitives-utility 0.18.0", + "cumulus-primitives-utility", "docify", "enumflags2", "env_logger 0.11.6", - "frame-benchmarking 39.0.0", - "frame-executive 39.0.0", - "frame-metadata-hash-extension 0.7.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "frame-system-benchmarking 39.0.0", - "frame-system-rpc-runtime-api 35.0.0", - "frame-try-runtime 0.45.0", + "frame-benchmarking", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", "hex", "log", - "pallet-aura 38.0.0", - "pallet-authorship 39.0.0", - "pallet-balances 40.0.0", - "pallet-collator-selection 20.0.0", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", "pallet-collective", - "pallet-message-queue 42.0.0", + "pallet-message-queue", "pallet-motion", - "pallet-multisig 39.0.0", - "pallet-preimage 39.0.0", - "pallet-proxy 39.0.0", + "pallet-multisig", + "pallet-preimage", + "pallet-proxy", "pallet-revive", - "pallet-scheduler 40.0.0", - "pallet-session 39.0.0", - "pallet-sudo 39.0.0", - "pallet-timestamp 38.0.0", - "pallet-transaction-payment 39.0.0", - "pallet-transaction-payment-rpc-runtime-api 39.0.0", - "pallet-treasury 38.0.0", - "pallet-utility 39.0.0", - "pallet-xcm 18.0.0", - "parachains-common 19.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-runtime-common 18.0.0", + "pallet-scheduler", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-runtime-common", "pop-runtime-common", "scale-info", "smallvec", - "sp-api 35.0.0", - "sp-block-builder 35.0.0", - "sp-consensus-aura 0.41.0", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", - "sp-keyring 40.0.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-transaction-pool 35.0.0", - "sp-version 38.0.0", - "staging-parachain-info 0.18.0", + "sp-keyring", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-transaction-pool", + "sp-version", + "staging-parachain-info", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", - "xcm-runtime-apis 0.5.0", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", + "xcm-runtime-apis", ] [[package]] name = "pop-runtime-testnet" version = "0.4.2" dependencies = [ - "cumulus-pallet-aura-ext 0.18.0", - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-pallet-session-benchmarking 20.0.0", - "cumulus-pallet-xcm 0.18.0", - "cumulus-pallet-xcmp-queue 0.18.0", - "cumulus-primitives-aura 0.16.0", - "cumulus-primitives-core 0.17.0", + "cumulus-pallet-aura-ext", + "cumulus-pallet-parachain-system", + "cumulus-pallet-session-benchmarking", + "cumulus-pallet-xcm", + "cumulus-pallet-xcmp-queue", + "cumulus-primitives-aura", + "cumulus-primitives-core", "cumulus-primitives-storage-weight-reclaim", - "cumulus-primitives-utility 0.18.0", + "cumulus-primitives-utility", "docify", "enumflags2", "env_logger 0.11.6", - "frame-benchmarking 39.0.0", - "frame-executive 39.0.0", - "frame-metadata-hash-extension 0.7.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "frame-system-benchmarking 39.0.0", - "frame-system-rpc-runtime-api 35.0.0", - "frame-try-runtime 0.45.0", + "frame-benchmarking", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", "hex", "hex-literal", "log", "pallet-api", - "pallet-assets 41.0.0", - "pallet-aura 38.0.0", - "pallet-authorship 39.0.0", - "pallet-balances 40.0.0", - "pallet-collator-selection 20.0.0", + "pallet-assets", + "pallet-aura", + "pallet-authorship", + "pallet-balances", + "pallet-collator-selection", "pallet-contracts", - "pallet-message-queue 42.0.0", - "pallet-multisig 39.0.0", + "pallet-message-queue", + "pallet-multisig", "pallet-nft-fractionalization", "pallet-nfts 31.0.0", - "pallet-nfts-runtime-api 25.0.0", - "pallet-preimage 39.0.0", - "pallet-proxy 39.0.0", - "pallet-scheduler 40.0.0", - "pallet-session 39.0.0", - "pallet-sudo 39.0.0", - "pallet-timestamp 38.0.0", - "pallet-transaction-payment 39.0.0", - "pallet-transaction-payment-rpc-runtime-api 39.0.0", - "pallet-utility 39.0.0", - "pallet-xcm 18.0.0", - "parachains-common 19.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-runtime-common 18.0.0", + "pallet-nfts-runtime-api", + "pallet-preimage", + "pallet-proxy", + "pallet-scheduler", + "pallet-session", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-utility", + "pallet-xcm", + "parachains-common", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-runtime-common", "pop-chain-extension", "pop-primitives", "pop-runtime-common", "scale-info", "smallvec", - "sp-api 35.0.0", - "sp-block-builder 35.0.0", - "sp-consensus-aura 0.41.0", + "sp-api", + "sp-block-builder", + "sp-consensus-aura", "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-transaction-pool 35.0.0", - "sp-version 38.0.0", - "staging-parachain-info 0.18.0", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-transaction-pool", + "sp-version", + "staging-parachain-info", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", ] [[package]] @@ -13960,8 +11068,6 @@ checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" dependencies = [ "fixed-hash", "impl-codec 0.6.0", - "impl-num-traits 0.1.2", - "impl-rlp 0.3.0", "impl-serde 0.4.0", "scale-info", "uint 0.9.5", @@ -13975,8 +11081,8 @@ checksum = "d15600a7d856470b7d278b3fe0e311fe28c2526348549f8ef2ff7db3299c87f5" dependencies = [ "fixed-hash", "impl-codec 0.7.0", - "impl-num-traits 0.2.0", - "impl-rlp 0.4.0", + "impl-num-traits", + "impl-rlp", "impl-serde 0.5.0", "scale-info", "uint 0.10.0", @@ -14566,19 +11672,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" -[[package]] -name = "relay-common" -version = "1.0.0" -source = "git+https://github.com/paseo-network/runtimes?tag=v1.3.4#313b81aa2b2cb076b4f99c9b2bea040a8bcf709f" -dependencies = [ - "pallet-staking-reward-fn 22.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parity-scale-codec", - "polkadot-primitives 14.0.0", - "scale-info", - "sp-api 33.0.0", - "sp-runtime 38.0.1", -] - [[package]] name = "resolv-conf" version = "0.7.0" @@ -14644,16 +11737,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" -[[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rustc-hex", -] - [[package]] name = "rlp" version = "0.6.1" @@ -14679,101 +11762,101 @@ name = "rococo-runtime" version = "21.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "binary-merkle-tree 16.0.0", + "binary-merkle-tree", "bitvec", - "frame-benchmarking 39.0.0", - "frame-executive 39.0.0", - "frame-metadata-hash-extension 0.7.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "frame-system-benchmarking 39.0.0", - "frame-system-rpc-runtime-api 35.0.0", - "frame-try-runtime 0.45.0", + "frame-benchmarking", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", "hex-literal", "log", - "pallet-asset-rate 18.0.0", - "pallet-authority-discovery 39.0.0", - "pallet-authorship 39.0.0", - "pallet-babe 39.0.0", - "pallet-balances 40.0.0", - "pallet-beefy 40.0.0", - "pallet-beefy-mmr 40.0.0", - "pallet-bounties 38.0.1", - "pallet-child-bounties 38.0.0", + "pallet-asset-rate", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", + "pallet-bounties", + "pallet-child-bounties", "pallet-collective", - "pallet-conviction-voting 39.0.0", + "pallet-conviction-voting", "pallet-democracy", "pallet-elections-phragmen", - "pallet-grandpa 39.0.0", - "pallet-identity 39.0.0", - "pallet-indices 39.0.0", + "pallet-grandpa", + "pallet-identity", + "pallet-indices", "pallet-membership", - "pallet-message-queue 42.0.0", + "pallet-message-queue", "pallet-migrations", - "pallet-mmr 39.0.0", - "pallet-multisig 39.0.0", + "pallet-mmr", + "pallet-multisig", "pallet-nis", - "pallet-offences 38.0.0", - "pallet-parameters 0.10.0", - "pallet-preimage 39.0.0", - "pallet-proxy 39.0.0", + "pallet-offences", + "pallet-parameters", + "pallet-preimage", + "pallet-proxy", "pallet-ranked-collective", "pallet-recovery", - "pallet-referenda 39.0.0", + "pallet-referenda", "pallet-root-testing", - "pallet-scheduler 40.0.0", - "pallet-session 39.0.0", + "pallet-scheduler", + "pallet-session", "pallet-society", - "pallet-staking 39.0.1", - "pallet-state-trie-migration 43.0.0", - "pallet-sudo 39.0.0", - "pallet-timestamp 38.0.0", + "pallet-staking", + "pallet-state-trie-migration", + "pallet-sudo", + "pallet-timestamp", "pallet-tips", - "pallet-transaction-payment 39.0.0", - "pallet-transaction-payment-rpc-runtime-api 39.0.0", - "pallet-treasury 38.0.0", - "pallet-utility 39.0.0", - "pallet-vesting 39.0.0", - "pallet-whitelist 38.0.0", - "pallet-xcm 18.0.0", - "pallet-xcm-benchmarks 18.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", - "polkadot-runtime-common 18.0.0", - "polkadot-runtime-parachains 18.0.1", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", "rococo-runtime-constants", "scale-info", "serde", "serde_derive", "serde_json", "smallvec", - "sp-api 35.0.0", + "sp-api", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-authority-discovery 35.0.0", - "sp-block-builder 35.0.0", - "sp-consensus-babe 0.41.0", - "sp-consensus-beefy 23.0.0", - "sp-consensus-grandpa 22.0.0", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", - "sp-keyring 40.0.0", - "sp-mmr-primitives 35.0.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-staking 37.0.0", + "sp-keyring", + "sp-mmr-primitives", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", "sp-storage 22.0.0", - "sp-transaction-pool 35.0.0", - "sp-version 38.0.0", + "sp-transaction-pool", + "sp-version", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", + "staging-xcm-builder", + "staging-xcm-executor", "static_assertions", - "substrate-wasm-builder 25.0.0", - "xcm-runtime-apis 0.5.0", + "substrate-wasm-builder", + "xcm-runtime-apis", ] [[package]] @@ -14781,15 +11864,15 @@ name = "rococo-runtime-constants" version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "polkadot-primitives 17.0.0", - "polkadot-runtime-common 18.0.0", + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", "smallvec", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", + "staging-xcm-builder", ] [[package]] @@ -15175,12 +12258,12 @@ dependencies = [ "sc-client-api", "sc-network", "sc-network-types", - "sp-api 35.0.0", - "sp-authority-discovery 35.0.0", + "sp-api", + "sp-authority-discovery", "sp-blockchain", "sp-core 35.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] @@ -15198,12 +12281,12 @@ dependencies = [ "sc-proposer-metrics", "sc-telemetry", "sc-transaction-pool-api", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-consensus", "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", "substrate-prometheus-endpoint", ] @@ -15213,12 +12296,12 @@ version = "0.43.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "parity-scale-codec", - "sp-api 35.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-block-builder", "sp-blockchain", "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", "sp-trie 38.0.0", ] @@ -15242,9 +12325,9 @@ dependencies = [ "sp-blockchain", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-genesis-builder 0.16.0", + "sp-genesis-builder", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] @@ -15293,11 +12376,11 @@ dependencies = [ "serde_json", "sp-blockchain", "sp-core 35.0.0", - "sp-keyring 40.0.0", + "sp-keyring", "sp-keystore 0.41.0", "sp-panic-handler 13.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-runtime 40.1.0", - "sp-version 38.0.0", + "sp-runtime", + "sp-version", "thiserror 1.0.69", "tokio", ] @@ -15315,13 +12398,13 @@ dependencies = [ "sc-executor", "sc-transaction-pool-api", "sc-utils", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-consensus", "sp-core 35.0.0", "sp-database", "sp-externalities 0.30.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "sp-statement-store", "sp-storage 22.0.0", @@ -15350,7 +12433,7 @@ dependencies = [ "sp-blockchain", "sp-core 35.0.0", "sp-database", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "sp-trie 38.0.0", ] @@ -15369,11 +12452,11 @@ dependencies = [ "sc-network-types", "sc-utils", "serde", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-consensus", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -15393,17 +12476,17 @@ dependencies = [ "sc-consensus", "sc-consensus-slots", "sc-telemetry", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-application-crypto", + "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-consensus-aura 0.41.0", - "sp-consensus-slots 0.41.0", + "sp-consensus-aura", + "sp-consensus-slots", "sp-core 35.0.0", - "sp-inherents 35.0.0", + "sp-inherents", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] @@ -15428,18 +12511,18 @@ dependencies = [ "sc-consensus-slots", "sc-telemetry", "sc-transaction-pool-api", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-application-crypto", + "sp-block-builder", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.41.0", - "sp-consensus-slots 0.41.0", + "sp-consensus-babe", + "sp-consensus-slots", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-inherents 35.0.0", + "sp-inherents", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] @@ -15455,14 +12538,14 @@ dependencies = [ "sc-consensus-epochs", "sc-rpc-api", "serde", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-blockchain", "sp-consensus", - "sp-consensus-babe 0.41.0", + "sp-consensus-babe", "sp-core 35.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] @@ -15486,16 +12569,16 @@ dependencies = [ "sc-network-sync", "sc-network-types", "sc-utils", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-blockchain", "sp-consensus", - "sp-consensus-beefy 23.0.0", + "sp-consensus-beefy", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -15515,10 +12598,10 @@ dependencies = [ "sc-consensus-beefy", "sc-rpc", "serde", - "sp-application-crypto 39.0.0", - "sp-consensus-beefy 23.0.0", + "sp-application-crypto", + "sp-consensus-beefy", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] @@ -15532,7 +12615,7 @@ dependencies = [ "sc-client-api", "sc-consensus", "sp-blockchain", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -15540,7 +12623,7 @@ name = "sc-consensus-grandpa" version = "0.33.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "ahash 0.8.11", + "ahash", "array-bytes", "async-trait", "dyn-clone", @@ -15565,16 +12648,16 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde_json", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-blockchain", "sp-consensus", - "sp-consensus-grandpa 22.0.0", + "sp-consensus-grandpa", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] @@ -15595,7 +12678,7 @@ dependencies = [ "serde", "sp-blockchain", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] @@ -15615,10 +12698,10 @@ dependencies = [ "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-blockchain", "sp-consensus", - "sp-consensus-slots 0.41.0", + "sp-consensus-slots", "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", "sp-state-machine 0.44.0", ] @@ -15633,14 +12716,14 @@ dependencies = [ "sc-executor-polkavm", "sc-executor-wasmtime", "schnellru", - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", "sp-externalities 0.30.0", "sp-io 39.0.0", "sp-panic-handler 13.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-runtime-interface 29.0.0", "sp-trie 38.0.0", - "sp-version 38.0.0", + "sp-version", "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "tracing", ] @@ -15652,7 +12735,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "polkavm 0.9.3", "sc-allocator", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-maybe-compressed-blob", "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "thiserror 1.0.69", "wasm-instrument", @@ -15701,7 +12784,7 @@ dependencies = [ "sc-network-common", "sc-network-sync", "sp-blockchain", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -15712,7 +12795,7 @@ dependencies = [ "array-bytes", "parking_lot 0.12.3", "serde_json", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-core 35.0.0", "sp-keystore 0.41.0", "thiserror 1.0.69", @@ -15738,12 +12821,12 @@ dependencies = [ "sc-network", "sc-network-types", "sc-transaction-pool-api", - "sp-api 35.0.0", + "sp-api", "sp-consensus", "sp-core 35.0.0", "sp-keystore 0.41.0", "sp-mixnet", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] @@ -15787,7 +12870,7 @@ dependencies = [ "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-blockchain", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -15812,8 +12895,8 @@ dependencies = [ "sc-consensus", "sc-network-types", "sp-consensus", - "sp-consensus-grandpa 22.0.0", - "sp-runtime 40.1.0", + "sp-consensus-grandpa", + "sp-runtime", ] [[package]] @@ -15821,7 +12904,7 @@ name = "sc-network-gossip" version = "0.48.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "ahash 0.8.11", + "ahash", "futures", "futures-timer", "log", @@ -15830,7 +12913,7 @@ dependencies = [ "sc-network-sync", "sc-network-types", "schnellru", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", "tracing", ] @@ -15852,7 +12935,7 @@ dependencies = [ "sc-network-types", "sp-blockchain", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] @@ -15883,9 +12966,9 @@ dependencies = [ "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-blockchain", "sp-consensus", - "sp-consensus-grandpa 22.0.0", + "sp-consensus-grandpa", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -15907,7 +12990,7 @@ dependencies = [ "sc-network-types", "sc-utils", "sp-consensus", - "sp-runtime 40.1.0", + "sp-runtime", "substrate-prometheus-endpoint", ] @@ -15955,12 +13038,12 @@ dependencies = [ "sc-network-types", "sc-transaction-pool-api", "sc-utils", - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", "sp-externalities 0.30.0", "sp-keystore 0.41.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", + "sp-offchain", + "sp-runtime", "threadpool", "tracing", ] @@ -15993,16 +13076,16 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde_json", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-core 35.0.0", "sp-keystore 0.41.0", - "sp-offchain 35.0.0", + "sp-offchain", "sp-rpc", - "sp-runtime 40.1.0", - "sp-session 37.0.0", + "sp-runtime", + "sp-session", "sp-statement-store", - "sp-version 38.0.0", + "sp-version", "tokio", ] @@ -16021,8 +13104,8 @@ dependencies = [ "serde_json", "sp-core 35.0.0", "sp-rpc", - "sp-runtime 40.1.0", - "sp-version 38.0.0", + "sp-runtime", + "sp-version", "thiserror 1.0.69", ] @@ -16071,12 +13154,12 @@ dependencies = [ "sc-transaction-pool-api", "schnellru", "serde", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-core 35.0.0", "sp-rpc", - "sp-runtime 40.1.0", - "sp-version 38.0.0", + "sp-runtime", + "sp-version", "thiserror 1.0.69", "tokio", "tokio-stream", @@ -16123,20 +13206,20 @@ dependencies = [ "schnellru", "serde", "serde_json", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-consensus", "sp-core 35.0.0", "sp-externalities 0.30.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", + "sp-runtime", + "sp-session", "sp-state-machine 0.44.0", "sp-storage 22.0.0", - "sp-transaction-pool 35.0.0", + "sp-transaction-pool", "sp-transaction-storage-proof", "sp-trie 38.0.0", - "sp-version 38.0.0", + "sp-version", "static_init", "substrate-prometheus-endpoint", "tempfile", @@ -16185,7 +13268,7 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] @@ -16246,11 +13329,11 @@ dependencies = [ "sc-client-api", "sc-tracing-proc-macro", "serde", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-core 35.0.0", "sp-rpc", - "sp-runtime 40.1.0", + "sp-runtime", "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "thiserror 1.0.69", "tracing", @@ -16287,13 +13370,13 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "serde", - "sp-api 35.0.0", + "sp-api", "sp-blockchain", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-runtime 40.1.0", + "sp-runtime", "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-transaction-pool 35.0.0", + "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tokio", @@ -16312,7 +13395,7 @@ dependencies = [ "serde", "sp-blockchain", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] @@ -16578,7 +13661,7 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "356285bbf17bea63d9e52e96bd18f039672ac92b55b8cb997d6162a2a37d1649" dependencies = [ - "ahash 0.8.11", + "ahash", "cfg-if", "hashbrown 0.13.2", ] @@ -16791,15 +13874,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd31f59f6fe2b0c055371bb2f16d7f0aa7d8881676c04a55b1596d1a17cd10a4" -dependencies = [ - "serde", -] - [[package]] name = "serde-hex-utils" version = "0.1.0" @@ -17090,19 +14164,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" -[[package]] -name = "slot-range-helper" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4d67aa9b1ccfd746c8529754c4ce06445b1d48e189567402ef856340a3a6b14" -dependencies = [ - "enumn", - "parity-scale-codec", - "paste", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "slot-range-helper" version = "16.0.0" @@ -17111,7 +14172,7 @@ dependencies = [ "enumn", "parity-scale-codec", "paste", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -17367,203 +14428,6 @@ dependencies = [ "subtle 2.6.1", ] -[[package]] -name = "snowbridge-amcl" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "460a9ed63cdf03c1b9847e8a12a5f5ba19c4efd5869e4a737e05be25d7c427e5" -dependencies = [ - "parity-scale-codec", - "scale-info", -] - -[[package]] -name = "snowbridge-beacon-primitives" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0ad61e3ab1c48d4c8060c7ef8571c5b6007df26687e8dbfdb6c857d840cfd2c" -dependencies = [ - "byte-slice-cast", - "frame-support 36.0.1", - "hex", - "parity-scale-codec", - "rlp 0.5.2", - "scale-info", - "serde", - "snowbridge-ethereum 0.8.0", - "snowbridge-milagro-bls", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "ssz_rs", - "ssz_rs_derive", -] - -[[package]] -name = "snowbridge-beacon-primitives" -version = "0.12.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "byte-slice-cast", - "frame-support 39.0.0", - "hex", - "parity-scale-codec", - "rlp 0.6.1", - "scale-info", - "serde", - "snowbridge-ethereum 0.11.0", - "snowbridge-milagro-bls", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "ssz_rs", - "ssz_rs_derive", -] - -[[package]] -name = "snowbridge-core" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "668cd71582305168ed51cb0357a4b4ea814c68c7db3898a9ba4d492f712c54e1" -dependencies = [ - "ethabi-decode 1.0.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "hex-literal", - "parity-scale-codec", - "polkadot-parachain-primitives 13.0.0", - "scale-info", - "serde", - "snowbridge-beacon-primitives 0.8.0", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-builder 15.0.0", -] - -[[package]] -name = "snowbridge-core" -version = "0.12.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "ethabi-decode 2.0.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "hex-literal", - "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "scale-info", - "serde", - "snowbridge-beacon-primitives 0.12.0", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", -] - -[[package]] -name = "snowbridge-ethereum" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ef1f6f60f6c8cc3cdb2a829d7452de946d8707f63f70c6f714d1c52cbc0fc17" -dependencies = [ - "ethabi-decode 1.0.0", - "ethbloom 0.13.0", - "ethereum-types 0.14.1", - "hex-literal", - "parity-bytes", - "parity-scale-codec", - "rlp 0.5.2", - "scale-info", - "serde", - "serde-big-array", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "snowbridge-ethereum" -version = "0.11.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "ethabi-decode 2.0.0", - "ethbloom 0.14.1", - "ethereum-types 0.15.1", - "hex-literal", - "parity-bytes", - "parity-scale-codec", - "rlp 0.6.1", - "scale-info", - "serde", - "serde-big-array", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", -] - -[[package]] -name = "snowbridge-milagro-bls" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "026aa8638f690a53e3f7676024b9e913b1cab0111d1b7b92669d40a188f9d7e6" -dependencies = [ - "hex", - "lazy_static", - "parity-scale-codec", - "rand", - "scale-info", - "snowbridge-amcl", - "zeroize", -] - -[[package]] -name = "snowbridge-router-primitives" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8e6707ced1308d763117bfe68f85e3f22fcdca7987b32e438c0485570f6ac7" -dependencies = [ - "frame-support 36.0.1", - "hex-literal", - "log", - "parity-scale-codec", - "scale-info", - "snowbridge-core 0.8.0", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-executor 15.0.0", -] - -[[package]] -name = "snowbridge-router-primitives" -version = "0.18.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "frame-support 39.0.0", - "hex-literal", - "log", - "parity-scale-codec", - "scale-info", - "snowbridge-core 0.12.0", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", - "staging-xcm-executor 18.0.0", -] - [[package]] name = "socket2" version = "0.4.10" @@ -17615,29 +14479,6 @@ dependencies = [ "sha1", ] -[[package]] -name = "sp-api" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e43fbf034e9dbaa8ffc6a238a22808777eb38c580f66fc6736d8511631789e" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "scale-info", - "sp-api-proc-macro 20.0.0", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-metadata-ir 0.7.0", - "sp-runtime 38.0.1", - "sp-runtime-interface 28.0.0", - "sp-state-machine 0.42.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 36.0.0", - "sp-version 36.0.0", - "thiserror 1.0.69", -] - [[package]] name = "sp-api" version = "35.0.0" @@ -17645,34 +14486,19 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "docify", "hash-db", - "log", - "parity-scale-codec", - "scale-info", - "sp-api-proc-macro 21.0.0", - "sp-core 35.0.0", - "sp-externalities 0.30.0", - "sp-metadata-ir 0.8.0", - "sp-runtime 40.1.0", - "sp-runtime-interface 29.0.0", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", - "sp-version 38.0.0", - "thiserror 1.0.69", -] - -[[package]] -name = "sp-api-proc-macro" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9aadf9e97e694f0e343978aa632938c5de309cbcc8afed4136cb71596737278" -dependencies = [ - "Inflector", - "blake2 0.10.6", - "expander", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", + "log", + "parity-scale-codec", + "scale-info", + "sp-api-proc-macro", + "sp-core 35.0.0", + "sp-externalities 0.30.0", + "sp-metadata-ir", + "sp-runtime", + "sp-runtime-interface 29.0.0", + "sp-state-machine 0.44.0", + "sp-trie 38.0.0", + "sp-version", + "thiserror 1.0.69", ] [[package]] @@ -17689,20 +14515,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "sp-application-crypto" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d96d1fc0f1c741bbcbd0dd5470eff7b66f011708cc1942b088ebf0d4efb3d93" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sp-application-crypto" version = "39.0.0" @@ -17745,19 +14557,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "sp-authority-discovery" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a4a1e45abc3277f18484ee0b0f9808e4206eb696ad38500c892c72f33480d69" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-runtime 38.0.1", -] - [[package]] name = "sp-authority-discovery" version = "35.0.0" @@ -17765,20 +14564,9 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "parity-scale-codec", "scale-info", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-block-builder" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cf199dc4f9f77abd3fd91c409759118159ce6ffcd8bc90b229b684ccc8c981f" -dependencies = [ - "sp-api 33.0.0", - "sp-inherents 33.0.0", - "sp-runtime 38.0.1", + "sp-api", + "sp-application-crypto", + "sp-runtime", ] [[package]] @@ -17786,9 +14574,9 @@ name = "sp-block-builder" version = "35.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "sp-api 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-api", + "sp-inherents", + "sp-runtime", ] [[package]] @@ -17800,11 +14588,11 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", "schnellru", - "sp-api 35.0.0", + "sp-api", "sp-consensus", "sp-core 35.0.0", "sp-database", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "thiserror 1.0.69", "tracing", @@ -17819,29 +14607,12 @@ dependencies = [ "futures", "log", "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", "sp-state-machine 0.44.0", "thiserror 1.0.69", ] -[[package]] -name = "sp-consensus-aura" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ebb90bf00f331b898eb729a1f707251846c1d5582d7467f083884799a69b89" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-consensus-slots 0.39.0", - "sp-inherents 33.0.0", - "sp-runtime 38.0.1", - "sp-timestamp 33.0.0", -] - [[package]] name = "sp-consensus-aura" version = "0.41.0" @@ -17850,31 +14621,12 @@ dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", - "sp-consensus-slots 0.41.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "sp-timestamp 35.0.0", -] - -[[package]] -name = "sp-consensus-babe" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3aa2de4c7100a3279658d8dd4affd8f92487528deae5cb4b40322717b9175ed5" -dependencies = [ - "async-trait", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-consensus-slots 0.39.0", - "sp-core 34.0.0", - "sp-inherents 33.0.0", - "sp-runtime 38.0.1", - "sp-timestamp 33.0.0", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", + "sp-inherents", + "sp-runtime", + "sp-timestamp", ] [[package]] @@ -17886,34 +14638,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", - "sp-consensus-slots 0.41.0", + "sp-api", + "sp-application-crypto", + "sp-consensus-slots", "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", - "sp-timestamp 35.0.0", -] - -[[package]] -name = "sp-consensus-beefy" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b277bc109da8e1c3768d3a046e1cd1ab687aabac821c976c5f510deb6f0bc8d3" -dependencies = [ - "lazy_static", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-core 34.0.0", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-io 37.0.0", - "sp-keystore 0.40.0", - "sp-mmr-primitives 33.0.0", - "sp-runtime 38.0.1", - "strum 0.26.3", + "sp-inherents", + "sp-runtime", + "sp-timestamp", ] [[package]] @@ -17924,36 +14655,18 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-io 39.0.0", "sp-keystore 0.41.0", - "sp-mmr-primitives 35.0.0", - "sp-runtime 40.1.0", + "sp-mmr-primitives", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "strum 0.26.3", ] -[[package]] -name = "sp-consensus-grandpa" -version = "20.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dd06bf366c60f69411668b26d6ab3c55120aa6d423e6af0373ec23d8957300" -dependencies = [ - "finality-grandpa", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-api 33.0.0", - "sp-application-crypto 37.0.0", - "sp-core 34.0.0", - "sp-keystore 0.40.0", - "sp-runtime 38.0.1", -] - [[package]] name = "sp-consensus-grandpa" version = "22.0.0" @@ -17964,23 +14677,11 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-core 35.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-consensus-slots" -version = "0.39.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ca60d713f8ddb03bbebcc755d5e6463fdc0b6259fabfc4221b20a5f1e428fd" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-timestamp 33.0.0", + "sp-runtime", ] [[package]] @@ -17991,7 +14692,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-timestamp 35.0.0", + "sp-timestamp", ] [[package]] @@ -18114,17 +14815,6 @@ dependencies = [ "twox-hash", ] -[[package]] -name = "sp-crypto-hashing-proc-macro" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85d0f1f1e44bd8617eb2a48203ee854981229e3e79e6f468c7175d5fd37489b" -dependencies = [ - "quote", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 2.0.98", -] - [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" @@ -18186,19 +14876,6 @@ dependencies = [ "sp-storage 22.0.0", ] -[[package]] -name = "sp-genesis-builder" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcd065854d96fd81521c103d0aaa287d4f08b9b15c9fae2a3bfb208b0812bf44" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde_json", - "sp-api 33.0.0", - "sp-runtime 38.0.1", -] - [[package]] name = "sp-genesis-builder" version = "0.16.0" @@ -18207,22 +14884,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde_json", - "sp-api 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-inherents" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53407ba38ec22ca4a16381722c4bd0b559a0428bc1713079b0d5163ada63186a" -dependencies = [ - "async-trait", - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", - "thiserror 1.0.69", + "sp-api", + "sp-runtime", ] [[package]] @@ -18234,37 +14897,10 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] -[[package]] -name = "sp-io" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5036cad2e48d41f5caf6785226c8be1a7db15bec14a9fd7aa6cca84f34cf689f" -dependencies = [ - "bytes", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "polkavm-derive 0.9.1", - "rustversion", - "secp256k1 0.28.2", - "sp-core 34.0.0", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.29.0", - "sp-keystore 0.40.0", - "sp-runtime-interface 28.0.0", - "sp-state-machine 0.42.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-tracing 17.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 36.0.0", - "tracing", - "tracing-core", -] - [[package]] name = "sp-io" version = "38.0.0" @@ -18318,24 +14954,13 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "sp-keyring" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03536e1ff3ec2bd8181eeaa26c0d682ebdcbd01548a055cf591077188b8c3f0" -dependencies = [ - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "strum 0.26.3", -] - [[package]] name = "sp-keyring" version = "40.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "strum 0.26.3", ] @@ -18362,16 +14987,6 @@ dependencies = [ "sp-externalities 0.30.0", ] -[[package]] -name = "sp-maybe-compressed-blob" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c768c11afbe698a090386876911da4236af199cd38a5866748df4d8628aeff" -dependencies = [ - "thiserror 1.0.69", - "zstd 0.12.4", -] - [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" @@ -18381,17 +14996,6 @@ dependencies = [ "zstd 0.12.4", ] -[[package]] -name = "sp-metadata-ir" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a616fa51350b35326682a472ee8e6ba742fdacb18babac38ecd46b3e05ead869" -dependencies = [ - "frame-metadata 16.0.0", - "parity-scale-codec", - "scale-info", -] - [[package]] name = "sp-metadata-ir" version = "0.8.0" @@ -18409,26 +15013,8 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "parity-scale-codec", "scale-info", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", -] - -[[package]] -name = "sp-mmr-primitives" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47412a2d2e988430d5f59d7fec1473f229e1ef5ce24c1ea4f601b4b3679cac52" -dependencies = [ - "log", - "parity-scale-codec", - "polkadot-ckb-merkle-mountain-range", - "scale-info", - "serde", - "sp-api 33.0.0", - "sp-core 34.0.0", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 38.0.1", - "thiserror 1.0.69", + "sp-api", + "sp-application-crypto", ] [[package]] @@ -18441,27 +15027,13 @@ dependencies = [ "polkadot-ckb-merkle-mountain-range", "scale-info", "serde", - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-runtime 40.1.0", + "sp-runtime", "thiserror 1.0.69", ] -[[package]] -name = "sp-npos-elections" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0c51a7b60cd663f2661e6949069eb316b092f22c239691d5272a4d0cfca0fb" -dependencies = [ - "parity-scale-codec", - "scale-info", - "serde", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-runtime 38.0.1", -] - [[package]] name = "sp-npos-elections" version = "35.0.0" @@ -18472,18 +15044,7 @@ dependencies = [ "serde", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-offchain" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbe721c367760bddf10fcfa24fb48edd64c442f71db971f043c8ac73f51aa6e9" -dependencies = [ - "sp-api 33.0.0", - "sp-core 34.0.0", - "sp-runtime 38.0.1", + "sp-runtime", ] [[package]] @@ -18491,9 +15052,9 @@ name = "sp-offchain" version = "35.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -18525,39 +15086,12 @@ dependencies = [ "sp-core 35.0.0", ] -[[package]] -name = "sp-runtime" -version = "38.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5273900f0b0bef48b2e1ff9c4fb5e188b8168ee5891418a427f4be2af92ee40f" -dependencies = [ - "docify", - "either", - "hash256-std-hasher", - "impl-trait-for-tuples", - "log", - "num-traits", - "parity-scale-codec", - "paste", - "rand", - "scale-info", - "serde", - "simple-mermaid", - "sp-application-crypto 37.0.0", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tracing", -] - [[package]] name = "sp-runtime" version = "40.1.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "binary-merkle-tree 16.0.0", + "binary-merkle-tree", "docify", "either", "hash256-std-hasher", @@ -18570,7 +15104,7 @@ dependencies = [ "scale-info", "serde", "simple-mermaid", - "sp-application-crypto 39.0.0", + "sp-application-crypto", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", "sp-io 39.0.0", @@ -18638,28 +15172,13 @@ dependencies = [ name = "sp-runtime-interface-proc-macro" version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "Inflector", - "expander", - "proc-macro-crate 3.2.0", - "proc-macro2", - "quote", - "syn 2.0.98", -] - -[[package]] -name = "sp-session" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4daf2e40ffc7e7e8de08efb860eb9534faf614a49c53dc282f430faedb4aed13" -dependencies = [ - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-core 34.0.0", - "sp-keystore 0.40.0", - "sp-runtime 38.0.1", - "sp-staking 33.0.0", +dependencies = [ + "Inflector", + "expander", + "proc-macro-crate 3.2.0", + "proc-macro2", + "quote", + "syn 2.0.98", ] [[package]] @@ -18669,25 +15188,11 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "parity-scale-codec", "scale-info", - "sp-api 35.0.0", + "sp-api", "sp-core 35.0.0", "sp-keystore 0.41.0", - "sp-runtime 40.1.0", - "sp-staking 37.0.0", -] - -[[package]] -name = "sp-staking" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a0b7abfe66c07a3b6eb99e1286dfa9b6f3b057b0e986e7da2ccbf707f6c781a" -dependencies = [ - "impl-trait-for-tuples", - "parity-scale-codec", - "scale-info", - "serde", - "sp-core 34.0.0", - "sp-runtime 38.0.1", + "sp-runtime", + "sp-staking", ] [[package]] @@ -18700,28 +15205,7 @@ dependencies = [ "scale-info", "serde", "sp-core 35.0.0", - "sp-runtime 40.1.0", -] - -[[package]] -name = "sp-state-machine" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "211e528aa6e902261a343f7b40840aa3d66fe4ad3aadbd04a035f10baf96dbc5" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "rand", - "smallvec", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-panic-handler 13.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 36.0.0", - "thiserror 1.0.69", - "tracing", - "trie-db", + "sp-runtime", ] [[package]] @@ -18778,12 +15262,12 @@ dependencies = [ "rand", "scale-info", "sha2 0.10.8", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-core 35.0.0", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-externalities 0.30.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-runtime-interface 29.0.0", "thiserror 1.0.69", "x25519-dalek", @@ -18825,19 +15309,6 @@ dependencies = [ "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", ] -[[package]] -name = "sp-timestamp" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78becf144a76f6fd108dfe94a90e20a185b38c0b310dc5482328196143c8266b" -dependencies = [ - "async-trait", - "parity-scale-codec", - "sp-inherents 33.0.0", - "sp-runtime 38.0.1", - "thiserror 1.0.69", -] - [[package]] name = "sp-timestamp" version = "35.0.0" @@ -18845,8 +15316,8 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de88 dependencies = [ "async-trait", "parity-scale-codec", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", "thiserror 1.0.69", ] @@ -18873,23 +15344,13 @@ dependencies = [ "tracing-subscriber", ] -[[package]] -name = "sp-transaction-pool" -version = "33.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3c9d1604aadc15b70e95f4388d0b1aa380215520b7ddfd372531a6d8262269c" -dependencies = [ - "sp-api 33.0.0", - "sp-runtime 38.0.1", -] - [[package]] name = "sp-transaction-pool" version = "35.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "sp-api 35.0.0", - "sp-runtime 40.1.0", + "sp-api", + "sp-runtime", ] [[package]] @@ -18901,42 +15362,18 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-core 35.0.0", - "sp-inherents 35.0.0", - "sp-runtime 40.1.0", + "sp-inherents", + "sp-runtime", "sp-trie 38.0.0", ] -[[package]] -name = "sp-trie" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d717c0f465f5371569e6fdc25b6f32d47c15d6e4c92b3b779e1c9b18b951d" -dependencies = [ - "ahash 0.8.11", - "hash-db", - "lazy_static", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot 0.12.3", - "rand", - "scale-info", - "schnellru", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "thiserror 1.0.69", - "tracing", - "trie-db", - "trie-root", -] - [[package]] name = "sp-trie" version = "37.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6282aef9f4b6ecd95a67a45bcdb67a71f4a4155c09a53c10add4ffe823db18cd" dependencies = [ - "ahash 0.8.11", + "ahash", "hash-db", "lazy_static", "memory-db", @@ -18959,7 +15396,7 @@ name = "sp-trie" version = "38.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "ahash 0.8.11", + "ahash", "hash-db", "memory-db", "nohash-hasher", @@ -18976,24 +15413,6 @@ dependencies = [ "trie-root", ] -[[package]] -name = "sp-version" -version = "36.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bccf96fefae339dee7c4453f91be64eb28cce4c2fe82130445cf096b18b2c081" -dependencies = [ - "impl-serde 0.4.0", - "parity-scale-codec", - "parity-wasm", - "scale-info", - "serde", - "sp-crypto-hashing-proc-macro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-version-proc-macro 14.0.0", - "thiserror 1.0.69", -] - [[package]] name = "sp-version" version = "38.0.0" @@ -19004,25 +15423,13 @@ dependencies = [ "parity-wasm", "scale-info", "serde", - "sp-crypto-hashing-proc-macro 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-runtime 40.1.0", + "sp-crypto-hashing-proc-macro", + "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-version-proc-macro 15.0.0", + "sp-version-proc-macro", "thiserror 1.0.69", ] -[[package]] -name = "sp-version-proc-macro" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aee8f6730641a65fcf0c8f9b1e448af4b3bb083d08058b47528188bccc7b7a7" -dependencies = [ - "parity-scale-codec", - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "sp-version-proc-macro" version = "15.0.0" @@ -19134,61 +15541,23 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "ssz_rs" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057291e5631f280978fa9c8009390663ca4613359fc1318e36a8c24c392f6d1f" -dependencies = [ - "bitvec", - "num-bigint", - "sha2 0.9.9", - "ssz_rs_derive", -] - -[[package]] -name = "ssz_rs_derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07d54c4d01a1713eb363b55ba51595da15f6f1211435b71466460da022aa140" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "staging-parachain-info" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd00d586b0dac4f42736bdd0ad52213a891b240e011ea82b38938263dd821c25" -dependencies = [ - "cumulus-primitives-core 0.14.0", - "frame-support 36.0.1", - "frame-system 36.1.0", - "parity-scale-codec", - "scale-info", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "staging-parachain-info" version = "0.18.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "cumulus-primitives-core 0.17.0", - "frame-support 39.0.0", - "frame-system 39.1.0", + "cumulus-primitives-core", + "frame-support", + "frame-system", "parity-scale-codec", "scale-info", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -19210,25 +15579,6 @@ dependencies = [ "xcm-procedural 8.0.0", ] -[[package]] -name = "staging-xcm" -version = "14.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21f9bbb4905116e1ba08efe2264c046ac4d6a42dcfcb402705119068f5ac3671" -dependencies = [ - "array-bytes", - "bounded-collections", - "derivative", - "environmental", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "xcm-procedural 10.0.1", -] - [[package]] name = "staging-xcm" version = "15.0.1" @@ -19238,83 +15588,38 @@ dependencies = [ "bounded-collections", "derivative", "environmental", - "frame-support 39.0.0", + "frame-support", "hex-literal", "impl-trait-for-tuples", "log", "parity-scale-codec", "scale-info", "serde", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "xcm-procedural 11.0.0", ] -[[package]] -name = "staging-xcm-builder" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847fa2afe1bed2751eaabf7b91fa4043037947f17653d7cc59ea202cc44c6bb8" -dependencies = [ - "frame-support 36.0.1", - "frame-system 36.1.0", - "impl-trait-for-tuples", - "log", - "pallet-transaction-payment 36.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 13.0.0", - "scale-info", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-executor 15.0.0", -] - [[package]] name = "staging-xcm-builder" version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "frame-system 39.1.0", + "frame-support", + "frame-system", "impl-trait-for-tuples", "log", - "pallet-asset-conversion 21.0.0", - "pallet-transaction-payment 39.0.0", + "pallet-asset-conversion", + "pallet-transaction-payment", "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", + "polkadot-parachain-primitives", "scale-info", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", - "staging-xcm-executor 18.0.0", -] - -[[package]] -name = "staging-xcm-executor" -version = "15.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b98d8219449eaf02e71a7edf1a14b14d4c713dd01d9df66fde1ce30dba4d6d" -dependencies = [ - "environmental", - "frame-benchmarking 36.0.0", - "frame-support 36.0.1", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-core 34.0.0", - "sp-io 37.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", + "staging-xcm-executor", ] [[package]] @@ -19323,15 +15628,15 @@ version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "environmental", - "frame-benchmarking 39.0.0", - "frame-support 39.0.0", + "frame-benchmarking", + "frame-support", "impl-trait-for-tuples", "parity-scale-codec", "scale-info", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", "tracing", @@ -19471,18 +15776,18 @@ version = "42.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "docify", - "frame-system-rpc-runtime-api 35.0.0", + "frame-system-rpc-runtime-api", "futures", "jsonrpsee 0.24.8", "log", "parity-scale-codec", "sc-rpc-api", "sc-transaction-pool-api", - "sp-api 35.0.0", - "sp-block-builder 35.0.0", + "sp-api", + "sp-block-builder", "sp-blockchain", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", ] [[package]] @@ -19504,7 +15809,7 @@ name = "substrate-state-machine" version = "1.15.3" source = "git+https://github.com/r0gue-io/ismp?branch=polkadot-stable2412#144c98de434ebd6732283b0585c1942c64577873" dependencies = [ - "frame-support 39.0.0", + "frame-support", "hash-db", "ismp", "pallet-ismp", @@ -19512,9 +15817,9 @@ dependencies = [ "primitive-types 0.13.1", "scale-info", "serde", - "sp-consensus-aura 0.41.0", - "sp-consensus-babe 0.41.0", - "sp-runtime 40.1.0", + "sp-consensus-aura", + "sp-consensus-babe", + "sp-runtime", "sp-trie 38.0.0", ] @@ -19529,32 +15834,12 @@ dependencies = [ "sc-rpc-api", "serde", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-state-machine 0.44.0", "sp-trie 38.0.0", "trie-db", ] -[[package]] -name = "substrate-wasm-builder" -version = "23.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dc993ad871b63fbba60362f3ea86583f5e7e1256e8fdcb3b5b249c9ead354bf" -dependencies = [ - "build-helper", - "cargo_metadata 0.15.4", - "console", - "filetime", - "parity-wasm", - "polkavm-linker 0.9.2", - "sp-maybe-compressed-blob 11.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "strum 0.26.3", - "tempfile", - "toml 0.8.19", - "walkdir", - "wasm-opt", -] - [[package]] name = "substrate-wasm-builder" version = "25.0.0" @@ -19575,9 +15860,9 @@ dependencies = [ "shlex", "sp-core 35.0.0", "sp-io 39.0.0", - "sp-maybe-compressed-blob 11.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-maybe-compressed-blob", "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-version 38.0.0", + "sp-version", "strum 0.26.3", "tempfile", "toml 0.8.19", @@ -19822,41 +16107,6 @@ dependencies = [ "libc", ] -[[package]] -name = "system-parachains-constants" -version = "1.0.0" -source = "git+https://github.com/paseo-network/runtimes?tag=v1.3.4#313b81aa2b2cb076b4f99c9b2bea040a8bcf709f" -dependencies = [ - "frame-support 36.0.1", - "parachains-common 15.0.0", - "paseo-runtime-constants", - "polkadot-core-primitives 14.0.0", - "polkadot-primitives 14.0.0", - "smallvec", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", -] - -[[package]] -name = "system-parachains-constants" -version = "1.0.0" -source = "git+https://github.com/polkadot-fellows/runtimes?tag=v1.3.4#3b18d942c766c7f358da50608b44edbe218284a4" -dependencies = [ - "frame-support 36.0.1", - "kusama-runtime-constants", - "parachains-common 15.0.0", - "polkadot-core-primitives 14.0.0", - "polkadot-primitives 14.0.0", - "polkadot-runtime-constants", - "smallvec", - "sp-core 34.0.0", - "sp-runtime 38.0.1", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", -] - [[package]] name = "tap" version = "1.0.1" @@ -19918,21 +16168,6 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f50febec83f5ee1df3015341d8bd429f2d1cc62bcba7ea2076759d315084683" -[[package]] -name = "testnet-parachains-constants" -version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "cumulus-primitives-core 0.17.0", - "frame-support 39.0.0", - "polkadot-core-primitives 16.0.0", - "rococo-runtime-constants", - "smallvec", - "sp-runtime 40.1.0", - "staging-xcm 15.0.1", - "westend-runtime-constants", -] - [[package]] name = "thiserror" version = "1.0.69" @@ -20340,7 +16575,7 @@ version = "17.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ "coarsetime", - "polkadot-primitives 17.0.0", + "polkadot-primitives", "tracing", "tracing-gum-proc-macro", ] @@ -20986,7 +17221,7 @@ version = "0.32.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c128c039340ffd50d4195c3f8ce31aac357f06804cfc494c8b9508d4b30dca4" dependencies = [ - "ahash 0.8.11", + "ahash", "hashbrown 0.14.5", "string-interner", ] @@ -21031,7 +17266,7 @@ version = "0.220.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e246c2772ce3ebc83f89a2d4487ac5794cad6c309b2071818a88c7db7c36d87b" dependencies = [ - "ahash 0.8.11", + "ahash", "bitflags 2.8.0", "hashbrown 0.14.5", "indexmap 2.7.1", @@ -21283,109 +17518,109 @@ name = "westend-runtime" version = "21.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "binary-merkle-tree 16.0.0", + "binary-merkle-tree", "bitvec", - "frame-benchmarking 39.0.0", - "frame-election-provider-support 39.0.0", - "frame-executive 39.0.0", - "frame-metadata-hash-extension 0.7.0", - "frame-support 39.0.0", - "frame-system 39.1.0", - "frame-system-benchmarking 39.0.0", - "frame-system-rpc-runtime-api 35.0.0", - "frame-try-runtime 0.45.0", + "frame-benchmarking", + "frame-election-provider-support", + "frame-executive", + "frame-metadata-hash-extension", + "frame-support", + "frame-system", + "frame-system-benchmarking", + "frame-system-rpc-runtime-api", + "frame-try-runtime", "hex-literal", "log", - "pallet-asset-rate 18.0.0", - "pallet-authority-discovery 39.0.0", - "pallet-authorship 39.0.0", - "pallet-babe 39.0.0", - "pallet-bags-list 38.0.0", - "pallet-balances 40.0.0", - "pallet-beefy 40.0.0", - "pallet-beefy-mmr 40.0.0", + "pallet-asset-rate", + "pallet-authority-discovery", + "pallet-authorship", + "pallet-babe", + "pallet-bags-list", + "pallet-balances", + "pallet-beefy", + "pallet-beefy-mmr", "pallet-collective", - "pallet-conviction-voting 39.0.0", - "pallet-delegated-staking 6.0.0", + "pallet-conviction-voting", + "pallet-delegated-staking", "pallet-democracy", - "pallet-election-provider-multi-phase 38.0.0", - "pallet-election-provider-support-benchmarking 38.0.0", + "pallet-election-provider-multi-phase", + "pallet-election-provider-support-benchmarking", "pallet-elections-phragmen", - "pallet-fast-unstake 38.0.0", - "pallet-grandpa 39.0.0", - "pallet-identity 39.0.0", - "pallet-indices 39.0.0", + "pallet-fast-unstake", + "pallet-grandpa", + "pallet-identity", + "pallet-indices", "pallet-membership", - "pallet-message-queue 42.0.0", + "pallet-message-queue", "pallet-migrations", - "pallet-mmr 39.0.0", - "pallet-multisig 39.0.0", - "pallet-nomination-pools 37.0.0", - "pallet-nomination-pools-benchmarking 37.0.0", - "pallet-nomination-pools-runtime-api 35.0.0", - "pallet-offences 38.0.0", - "pallet-offences-benchmarking 39.0.0", - "pallet-parameters 0.10.0", - "pallet-preimage 39.0.0", - "pallet-proxy 39.0.0", + "pallet-mmr", + "pallet-multisig", + "pallet-nomination-pools", + "pallet-nomination-pools-benchmarking", + "pallet-nomination-pools-runtime-api", + "pallet-offences", + "pallet-offences-benchmarking", + "pallet-parameters", + "pallet-preimage", + "pallet-proxy", "pallet-recovery", - "pallet-referenda 39.0.0", + "pallet-referenda", "pallet-root-testing", - "pallet-scheduler 40.0.0", - "pallet-session 39.0.0", - "pallet-session-benchmarking 39.0.0", + "pallet-scheduler", + "pallet-session", + "pallet-session-benchmarking", "pallet-society", - "pallet-staking 39.0.1", - "pallet-staking-runtime-api 25.0.0", - "pallet-state-trie-migration 43.0.0", - "pallet-sudo 39.0.0", - "pallet-timestamp 38.0.0", - "pallet-transaction-payment 39.0.0", - "pallet-transaction-payment-rpc-runtime-api 39.0.0", - "pallet-treasury 38.0.0", - "pallet-utility 39.0.0", - "pallet-vesting 39.0.0", - "pallet-whitelist 38.0.0", - "pallet-xcm 18.0.0", - "pallet-xcm-benchmarks 18.0.0", - "parity-scale-codec", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", - "polkadot-runtime-common 18.0.0", - "polkadot-runtime-parachains 18.0.1", + "pallet-staking", + "pallet-staking-runtime-api", + "pallet-state-trie-migration", + "pallet-sudo", + "pallet-timestamp", + "pallet-transaction-payment", + "pallet-transaction-payment-rpc-runtime-api", + "pallet-treasury", + "pallet-utility", + "pallet-vesting", + "pallet-whitelist", + "pallet-xcm", + "pallet-xcm-benchmarks", + "parity-scale-codec", + "polkadot-parachain-primitives", + "polkadot-primitives", + "polkadot-runtime-common", + "polkadot-runtime-parachains", "scale-info", "serde", "serde_derive", "serde_json", "smallvec", - "sp-api 35.0.0", - "sp-application-crypto 39.0.0", + "sp-api", + "sp-application-crypto", "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-authority-discovery 35.0.0", - "sp-block-builder 35.0.0", - "sp-consensus-babe 0.41.0", - "sp-consensus-beefy 23.0.0", - "sp-consensus-grandpa 22.0.0", + "sp-authority-discovery", + "sp-block-builder", + "sp-consensus-babe", + "sp-consensus-beefy", + "sp-consensus-grandpa", "sp-core 35.0.0", - "sp-genesis-builder 0.16.0", - "sp-inherents 35.0.0", + "sp-genesis-builder", + "sp-inherents", "sp-io 39.0.0", - "sp-keyring 40.0.0", - "sp-mmr-primitives 35.0.0", - "sp-npos-elections 35.0.0", - "sp-offchain 35.0.0", - "sp-runtime 40.1.0", - "sp-session 37.0.0", - "sp-staking 37.0.0", + "sp-keyring", + "sp-mmr-primitives", + "sp-npos-elections", + "sp-offchain", + "sp-runtime", + "sp-session", + "sp-staking", "sp-storage 22.0.0", - "sp-transaction-pool 35.0.0", - "sp-version 38.0.0", + "sp-transaction-pool", + "sp-version", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", - "staging-xcm-executor 18.0.0", - "substrate-wasm-builder 25.0.0", + "staging-xcm-builder", + "staging-xcm-executor", + "substrate-wasm-builder", "westend-runtime-constants", - "xcm-runtime-apis 0.5.0", + "xcm-runtime-apis", ] [[package]] @@ -21393,15 +17628,15 @@ name = "westend-runtime-constants" version = "18.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", - "polkadot-primitives 17.0.0", - "polkadot-runtime-common 18.0.0", + "frame-support", + "polkadot-primitives", + "polkadot-runtime-common", "smallvec", "sp-core 35.0.0", - "sp-runtime 40.1.0", + "sp-runtime", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", - "staging-xcm-builder 18.0.0", + "staging-xcm-builder", ] [[package]] @@ -21816,40 +18051,6 @@ dependencies = [ "time", ] -[[package]] -name = "xcm-emulator" -version = "0.17.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" -dependencies = [ - "array-bytes", - "cumulus-pallet-parachain-system 0.18.0", - "cumulus-pallet-xcmp-queue 0.18.0", - "cumulus-primitives-core 0.17.0", - "cumulus-primitives-parachain-inherent 0.17.0", - "cumulus-test-relay-sproof-builder", - "frame-support 39.0.0", - "frame-system 39.1.0", - "impl-trait-for-tuples", - "log", - "pallet-balances 40.0.0", - "pallet-message-queue 42.0.0", - "parachains-common 19.0.0", - "parity-scale-codec", - "paste", - "polkadot-parachain-primitives 15.0.0", - "polkadot-primitives 17.0.0", - "polkadot-runtime-parachains 18.0.1", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-io 39.0.0", - "sp-runtime 40.1.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", - "staging-xcm-executor 18.0.0", -] - [[package]] name = "xcm-procedural" version = "8.0.0" @@ -21862,18 +18063,6 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "xcm-procedural" -version = "10.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a95797c7b227a8466a65a16376bc275e1b8f2a5471325f00f6870314c45f9e" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn 2.0.98", -] - [[package]] name = "xcm-procedural" version = "11.0.0" @@ -21885,34 +18074,18 @@ dependencies = [ "syn 2.0.98", ] -[[package]] -name = "xcm-runtime-apis" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30fffcd9128a46abd836c37dd001c2cbe122aeb8904cd7b9bac8358564fb7b56" -dependencies = [ - "frame-support 36.0.1", - "parity-scale-codec", - "scale-info", - "sp-api 33.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "staging-xcm 14.0.3", - "staging-xcm-executor 15.0.0", -] - [[package]] name = "xcm-runtime-apis" version = "0.5.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#9de8837d9d0acede6204893ae553c722e1097b03" dependencies = [ - "frame-support 39.0.0", + "frame-support", "parity-scale-codec", "scale-info", - "sp-api 35.0.0", + "sp-api", "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "staging-xcm 15.0.1", - "staging-xcm-executor 18.0.0", + "staging-xcm-executor", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 933209d36..08923b29f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,9 +19,9 @@ exclude = [ "extension/contract", "pop-api", "tests/contracts", + "integration-tests", ] members = [ - "integration-tests", "node", "pallets/*", "pop-api/integration-tests", diff --git a/pallets/api/Cargo.toml b/pallets/api/Cargo.toml index 92aed05fe..99dbd07df 100644 --- a/pallets/api/Cargo.toml +++ b/pallets/api/Cargo.toml @@ -22,6 +22,7 @@ frame-benchmarking.workspace = true frame-support.workspace = true frame-system.workspace = true pallet-assets.workspace = true +pallet-balances.workspace = true pallet-nfts.workspace = true sp-runtime.workspace = true sp-std.workspace = true @@ -47,6 +48,7 @@ runtime-benchmarks = [ "frame-support/runtime-benchmarks", "frame-system/runtime-benchmarks", "pallet-assets/runtime-benchmarks", + "pallet-balances/runtime-benchmarks", "pallet-nfts/runtime-benchmarks", "pop-chain-extension/runtime-benchmarks", "sp-runtime/runtime-benchmarks", diff --git a/pallets/api/src/messaging/benchmarking.rs b/pallets/api/src/messaging/benchmarking.rs new file mode 100644 index 000000000..0e33183e1 --- /dev/null +++ b/pallets/api/src/messaging/benchmarking.rs @@ -0,0 +1,72 @@ +// //! Benchmarking setup for pallet_api::nonfungibles +// #![cfg(feature = "runtime-benchmarks")] + +// use frame_benchmarking::{account, v2::*}; +// use frame_support::{BoundedVec, dispatch::RawOrigin, traits::Currency}; +// use sp_runtime::traits::Zero; + + +// use super::*; +// use crate::Read as _; +// const SEED: u32 = 1; + +// // See if `generic_event` has been emitted. +// fn assert_has_event +// (generic_event: ::RuntimeEvent) +// where + +// { +// frame_system::Pallet::::assert_has_event(generic_event.into()); +// } + + +// #[benchmarks( +// where +// T: pallet_balances::Config +// )] +// mod messaging_benchmarks { +// use super::*; + +// #[benchmark] +// // x: The number of removals required. +// fn remove(x: Linear<1, 255>) { +// let deposit: BalanceOf = sp_runtime::traits::One::one(); +// let owner: AccountIdOf = account("Alice", 0, SEED); +// let mut message_ids: BoundedVec = BoundedVec::new(); +// pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); + +// for i in 0..x { +// ::Deposit::hold( +// &HoldReason::Messaging.into(), +// &owner, +// deposit, +// ) +// .unwrap(); + +// let message_id = H256::repeat_byte(i as u8); +// let commitment = H256::repeat_byte(i as u8); + +// let good_message = Message::IsmpResponse { +// commitment: commitment.clone(), +// deposit, +// response: Default::default(), +// status: MessageStatus::Ok, +// }; + +// Messages::::insert(&owner, &message_id.0, &good_message); +// IsmpRequests::::insert(&commitment, (&owner, &message_id.0)); +// message_ids.try_push(message_id.0).unwrap() +// } +// #[extrinsic_call] +// Pallet::::remove(RawOrigin::Signed(owner.clone()), message_ids.clone()); + +// assert_has_event::( +// crate::messaging::Event::Removed { +// origin: owner, +// messages: message_ids.to_vec(), +// }.into() +// ) +// } + +// impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); +// } diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 63b8705b2..e5fde37b6 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -26,6 +26,9 @@ use xcm::Response; use super::Weight; +#[cfg(feature = "runtime-benchmarks")] +mod benchmarking; + /// Messaging transports. pub mod transports; @@ -489,8 +492,8 @@ pub mod pallet { Ok(()) } - // Remove a request/response, returning any deposit previously taken. - /// Will ignore any erroneous messages and continue trying to process the remainder. + /// Try and remove a collection of messages. + /// Will revert if any one of the messages is erroneous. #[frame_support::transactional] #[pallet::call_index(5)] #[pallet::weight(Weight::zero())] @@ -684,7 +687,7 @@ impl Message { /// Try and remove self. pub fn try_remove(&self, origin: &AccountIdOf, id: &MessageId) -> Result<(), DispatchError> { match self { - /// Ismp messages can only be removed if their status is erroneous. + // Ismp messages can only be removed if their status is erroneous. Message::Ismp { status, .. } => match status { MessageStatus::Ok => Err(Error::::RequestPending.into()), MessageStatus::Timeout | MessageStatus::Err(_) => { @@ -692,12 +695,12 @@ impl Message { Ok(()) }, }, - /// Ismp responses can always be removed. + // Ismp responses can always be removed. Message::IsmpResponse { .. } => { self.remove(origin, id); Ok(()) }, - /// Xcm queries can only be removed if their status is erroneous. + // Xcm queries can only be removed if their status is erroneous. Message::XcmQuery { status, .. } => match status { MessageStatus::Ok => Err(Error::::RequestPending.into()), MessageStatus::Timeout | MessageStatus::Err(_) => { @@ -705,7 +708,7 @@ impl Message { Ok(()) }, }, - /// XCM responses can always be removed. + // XCM responses can always be removed. Message::XcmResponse { .. } => { self.remove(origin, id); Ok(()) @@ -715,7 +718,7 @@ impl Message { /// Remove a message from storage. /// Does no check on wether a message should be removed. - fn remove(&self, origin: &AccountIdOf, id: &MessageId) { + pub(crate) fn remove(&self, origin: &AccountIdOf, id: &MessageId) { Messages::::remove(&origin, &id); match self { Message::Ismp { commitment, .. } => { diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 4c8dc6b7b..615bfa5fc 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -2,7 +2,7 @@ use codec::Encode; use frame_support::{ assert_noop, assert_ok, dispatch::WithPostDispatchInfo, - sp_runtime::{traits::Zero, BoundedVec, DispatchError::BadOrigin}, + sp_runtime::{traits::Zero, DispatchError::BadOrigin}, testing_prelude::bounded_vec, weights::Weight, }; @@ -11,82 +11,468 @@ use sp_core::H256; use crate::{messaging::*, mock::*, Read}; -mod remove { +fn events() -> Vec> { + let result = System::events() + .into_iter() + .map(|r| r.event) + .filter_map(|e| if let crate::mock::RuntimeEvent::Messaging(inner) = e { Some(inner) } else { None }) + .collect::>(); + + System::reset_events(); + + result +} + + +// All the tests for the Message enum impls. +mod message { use super::*; + + // Basic remove tests to ensure storage is cleaned. #[test] - fn ismp_message_is_noop_when_status_is_ok() { + fn remove_ismp_message() { new_test_ext().execute_with(|| { + let commitment = H256::default(); + let message_id = [0u8; 32]; let m = Message::Ismp { - commitment: H256::default(), + commitment, callback: None, deposit: 100, status: MessageStatus::Ok, }; - let message_id: MessageId = [0u8; 32]; - Messages::::insert(&ALICE, message_id, &m); - assert_noop!( - Messaging::remove(signed(ALICE), bounded_vec!(message_id)), - Error::::RequestPending + Messages::::insert(&ALICE, &message_id, &m); + IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); + m.remove(&ALICE, &message_id); + assert!( + Messages::::get(&ALICE, &message_id).is_none(), + "Message should have been removed but hasnt." + ); + assert!( + IsmpRequests::::get(&commitment).is_none(), + "Request should have been removed but hasnt." + ); + }) + } + + #[test] + fn remove_ismp_response() { + new_test_ext().execute_with(|| { + let commitment = H256::default(); + let message_id = [0u8; 32]; + let m = Message::IsmpResponse { + commitment, + response: bounded_vec!(), + deposit: 100, + status: MessageStatus::Ok, + }; + Messages::::insert(&ALICE, &message_id, &m); + IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); + m.remove(&ALICE, &message_id); + assert!( + Messages::::get(&ALICE, &message_id).is_none(), + "Message should have been removed but hasnt." + ); + assert!( + IsmpRequests::::get(&commitment).is_none(), + "Request should have been removed but hasnt." + ); + }) + } + + #[test] + fn remove_xcm_query() { + new_test_ext().execute_with(|| { + let query_id = 0; + let message_id = [0u8; 32]; + let m = Message::XcmQuery { + query_id, + callback: None, + deposit: 0, + status: MessageStatus::Ok, + }; + Messages::::insert(&ALICE, &message_id, &m); + XcmQueries::::insert(query_id, (&ALICE, &message_id)); + m.remove(&ALICE, &message_id); + assert!( + Messages::::get(&ALICE, &message_id).is_none(), + "Message should have been removed but hasnt" ); assert!( - Messages::::get(ALICE, message_id).is_some(), + XcmQueries::::get(query_id).is_none(), + "Message should have been removed but hasnt." + ); + }) + } + + #[test] + fn remove_xcm_response() { + new_test_ext().execute_with(|| { + let query_id = 0; + let message_id = [0u8; 32]; + let m = Message::XcmResponse { + query_id, + deposit: 0, + response: Default::default(), + status: MessageStatus::Ok, + }; + Messages::::insert(&ALICE, &message_id, &m); + XcmQueries::::insert(query_id, (&ALICE, &message_id)); + m.remove(&ALICE, &message_id); + assert!( + Messages::::get(&ALICE, &message_id).is_none(), + "Message should have been removed but hasnt" + ); + assert!( + XcmQueries::::get(query_id).is_none(), + "Message should have been removed but hasnt." + ); + }) + } + + // Basic try_remove tests to ensure validation of message status is correct. + #[test] + fn try_remove_ismp_message_is_noop_when_status_is_ok() { + new_test_ext().execute_with(|| { + let message_id: MessageId = [0u8; 32]; + let m = Message::Ismp { + commitment: H256::default(), + callback: None, + deposit: 100, + status: MessageStatus::Ok, + }; + Messages::::insert(&ALICE, &message_id, &m); + assert_noop!(m.try_remove(&ALICE, &message_id), Error::::RequestPending); + assert!( + Messages::::get(ALICE, &message_id).is_some(), "Message has been deleted when it should exist." ); }); } #[test] - fn ismp_message_is_removed_and_deposit_returned_when_status_is_timeout() { + fn try_remove_ismp_message_is_ok_when_status_is_timeout() { new_test_ext().execute_with(|| { - let deposit: Balance = 100; let message_id: MessageId = [0u8; 32]; let m = Message::Ismp { commitment: H256::default(), callback: None, - deposit, + deposit: 0, status: MessageStatus::Timeout, }; - let alice_balance_pre_hold = Balances::free_balance(&ALICE); + Messages::::insert(&ALICE, message_id, &m); + assert_ok!(m.try_remove(&ALICE, &message_id)); + assert!(Messages::::get(&ALICE, message_id).is_none()); + }); + } + + #[test] + fn try_remove_ismp_message_is_ok_when_status_is_err() { + new_test_ext().execute_with(|| { + let message_id: MessageId = [0u8; 32]; + let m = Message::Ismp { + commitment: H256::default(), + callback: None, + deposit: 0, + status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), + }; + Messages::::insert(&ALICE, message_id, &m); + assert_ok!(m.try_remove(&ALICE, &message_id)); + assert!(Messages::::get(&ALICE, message_id).is_none()); + }); + } + + #[test] + fn try_remove_ismp_response_is_ok_any_status() { + new_test_ext().execute_with(|| { + let m_id = [0; 32]; + let m2_id = [1; 32]; + let m3_id = [2; 32]; + + let m = Message::IsmpResponse { + commitment: Default::default(), + deposit: 0, + response: Default::default(), + status: MessageStatus::Ok, + }; + let m2 = Message::IsmpResponse { + commitment: Default::default(), + deposit: 0, + response: Default::default(), + status: MessageStatus::Ok, + }; + + let m3 = Message::IsmpResponse { + commitment: Default::default(), + deposit: 0, + response: Default::default(), + status: MessageStatus::Ok, + }; + + Messages::::insert(&ALICE, m_id, &m); + Messages::::insert(&ALICE, m2_id, &m2); + Messages::::insert(&ALICE, m3_id, &m3); + + assert_ok!(m.try_remove(&ALICE, &m_id)); + assert_ok!(m.try_remove(&ALICE, &m2_id)); + assert_ok!(m.try_remove(&ALICE, &m3_id)); + + assert!(Messages::::get(&ALICE, m_id).is_none()); + assert!(Messages::::get(&ALICE, m2_id).is_none()); + assert!(Messages::::get(&ALICE, m3_id).is_none()); + }); + } + + #[test] + fn try_remove_xcm_query_is_noop_when_status_is_ok() { + new_test_ext().execute_with(|| { + let message_id: MessageId = [0u8; 32]; + let m = Message::XcmQuery { + query_id: 0, + callback: None, + deposit: 0, + status: MessageStatus::Ok, + }; + Messages::::insert(&ALICE, message_id, &m); + assert_noop!(m.try_remove(&ALICE, &message_id), Error::::RequestPending); + assert!(Messages::::get(&ALICE, message_id).is_some()); + }); + } + + #[test] + fn try_remove_xcm_query_is_ok_when_status_is_timeout() { + new_test_ext().execute_with(|| { + let message_id: MessageId = [0u8; 32]; + let m = Message::XcmQuery { + query_id: 0, + callback: None, + deposit: 0, + status: MessageStatus::Timeout, + }; + Messages::::insert(&ALICE, message_id, &m); + assert_ok!(m.try_remove(&ALICE, &message_id)); + assert!(Messages::::get(&ALICE, message_id).is_none()); + }); + } + + #[test] + fn try_remove_xcm_query_is_ok_when_status_is_err() { + new_test_ext().execute_with(|| { + let message_id: MessageId = [0u8; 32]; + let m = Message::XcmQuery { + query_id: 0, + callback: None, + deposit: 0, + status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), + }; + Messages::::insert(&ALICE, message_id, &m); + assert_ok!(m.try_remove(&ALICE, &message_id)); + assert!(Messages::::get(&ALICE, message_id).is_none()); + }); + } + + #[test] + fn try_remove_xcm_response_is_ok_any_status() { + new_test_ext().execute_with(|| { + let m_id = [0; 32]; + let m2_id = [1; 32]; + let m3_id = [2; 32]; + + let m = Message::XcmResponse { + query_id: 0, + deposit: 0, + response: Default::default(), + status: MessageStatus::Ok, + }; + + let m2 = Message::XcmResponse { + query_id: 0, + deposit: 0, + response: Default::default(), + status: MessageStatus::Timeout, + }; + + let m3 = Message::XcmResponse { + query_id: 0, + deposit: 0, + response: Default::default(), + status: MessageStatus::Err(Error::::InvalidMessage.into()), + }; + + Messages::::insert(&ALICE, m_id, &m); + Messages::::insert(&ALICE, m2_id, &m2); + Messages::::insert(&ALICE, m3_id, &m3); + + assert_ok!(m.try_remove(&ALICE, &m_id)); + assert_ok!(m.try_remove(&ALICE, &m2_id)); + assert_ok!(m.try_remove(&ALICE, &m3_id)); + assert!(Messages::::get(&ALICE, m_id).is_none()); + assert!(Messages::::get(&ALICE, m2_id).is_none()); + assert!(Messages::::get(&ALICE, m3_id).is_none()); + }); + } + + // Basic release deposit to ensure quantites are correct. +} + +// Tests for the remove extrinsic. +mod remove { + use super::*; + + #[test] + fn success_event() { + new_test_ext().execute_with(|| { + + let deposit: Balance = 100; + let m = Message::IsmpResponse { + commitment: Default::default(), + deposit, + response: Default::default(), + status: MessageStatus::Ok, + }; + let m_id = [0u8; 32]; + let m2_id = [1u8; 32]; + + Messages::::insert(&ALICE, m_id, &m); + Messages::::insert(&ALICE, m2_id, &m); + + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(m_id, m2_id))); + + assert!(events().contains( + &Event::::Removed { + origin: ALICE, + messages: vec![m_id, m2_id] + } + )); + + }) + } + + #[test] + fn message_not_found() { + new_test_ext().execute_with(|| { + assert_noop!( + Messaging::remove(signed(ALICE), bounded_vec!(Default::default())), + Error::::MessageNotFound + ); + }) + } + + #[test] + fn multiple_messages_remove_works() { + new_test_ext().execute_with(|| { + let deposit: Balance = 100; + // An ismp response can always be removed. + let m = Message::IsmpResponse { + commitment: Default::default(), + deposit, + response: Default::default(), + status: MessageStatus::Ok, + }; + let m_id = [0; 32]; + let m2_id = [1; 32]; + let m3_id = [2; 32]; + + Messages::::insert(&ALICE, m_id, &m); + Messages::::insert(&ALICE, m2_id, &m); + Messages::::insert(&ALICE, m3_id, &m); + + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); ::Deposit::hold( &HoldReason::Messaging.into(), &ALICE, deposit, ) .unwrap(); + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(m_id, m2_id, m3_id))); + + assert!( + Messages::::get(&ALICE, m_id).is_none(), + "Message should have been removed." + ); + assert!( + Messages::::get(&ALICE, m2_id).is_none(), + "Message should have been removed." + ); + assert!( + Messages::::get(&ALICE, m3_id).is_none(), + "Message should have been removed." + ); + }); + } + + #[test] + fn deposit_is_returned_if_try_remove_is_ok() { + new_test_ext().execute_with(|| { + let alice_initial_balance = Balances::free_balance(&ALICE); + let deposit: Balance = 100; + // An ismp response can always be removed. + let m = Message::IsmpResponse { + commitment: Default::default(), + deposit, + response: Default::default(), + status: MessageStatus::Ok, + }; + let m_id = [0; 32]; + + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + Messages::::insert(&ALICE, m_id, &m); let alice_balance_post_hold = Balances::free_balance(&ALICE); - Messages::::insert(&ALICE, message_id, &m); - assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(m_id))); let alice_balance_post_remove = Balances::free_balance(&ALICE); - assert_eq!( - alice_balance_post_hold + deposit, - alice_balance_pre_hold, - "deposit amount is incorrect" - ); - assert_eq!( - alice_balance_post_remove, alice_balance_pre_hold, - "alice balance has been mutated when it shouldnt have." - ); - assert!(Messages::::get(&ALICE, message_id).is_none()); + assert_eq!(alice_initial_balance, alice_balance_post_remove); + assert_eq!(alice_balance_post_remove, alice_balance_post_hold + deposit); }); } #[test] - fn ismp_message_is_removed_and_deposit_returned_when_status_is_err() { + fn deposit_is_not_returned_if_try_remove_is_noop() { new_test_ext().execute_with(|| { + let alice_initial_balance = Balances::free_balance(&ALICE); let deposit: Balance = 100; - let message_id: MessageId = [0u8; 32]; + + // Ismp message with status of Ok is considered pending. let m = Message::Ismp { commitment: H256::default(), callback: None, deposit, - status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), + status: MessageStatus::Ok, }; - let alice_balance_pre_hold = Balances::free_balance(&ALICE); + let m_id = [0; 32]; ::Deposit::hold( &HoldReason::Messaging.into(), @@ -94,93 +480,105 @@ mod remove { deposit, ) .unwrap(); + Messages::::insert(&ALICE, m_id, &m); let alice_balance_post_hold = Balances::free_balance(&ALICE); - Messages::::insert(&ALICE, message_id, &m); - assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + assert_noop!( + Messaging::remove(signed(ALICE), bounded_vec!(m_id)), + Error::::RequestPending + ); let alice_balance_post_remove = Balances::free_balance(&ALICE); - assert_eq!( - alice_balance_post_hold + deposit, - alice_balance_pre_hold, - "deposit amount is incorrect" - ); - assert_eq!( - alice_balance_post_remove, alice_balance_pre_hold, - "alice balance has been mutated when it shouldnt have." - ); - assert!(Messages::::get(&ALICE, message_id).is_none()); + assert_eq!(alice_initial_balance, alice_balance_post_remove + deposit); + assert_eq!(alice_balance_post_remove, alice_balance_post_hold); }); } #[test] - fn ismp_response_message_can_always_be_removed() { - new_test_ext().execute_with(|| {}); - } - #[test] - fn xcm_queries_cannot_be_removed() { + fn multiple_messages_rolls_back_if_one_fails() { new_test_ext().execute_with(|| { - let m_1_id = [0; 32]; - let m_1 = Message::XcmQuery { - query_id: 0, - callback: None, + let deposit: Balance = 100; + let alice_initial_balance = Balances::free_balance(&ALICE); + let good_message = Message::IsmpResponse { + commitment: Default::default(), deposit: 0, + response: Default::default(), status: MessageStatus::Ok, }; - let m_2_id = [1; 32]; - let m_2 = Message::XcmQuery { - query_id: 1, - callback: None, - deposit: 0, - status: MessageStatus::Timeout, - }; - let m_3_id = [2; 32]; - let m_3 = Message::XcmQuery { - query_id: 2, + + let erroneous_message = Message::Ismp { + commitment: H256::default(), callback: None, - deposit: 0, - status: MessageStatus::Err(Error::::InvalidQuery.into()), + deposit: 100, + status: MessageStatus::Ok, }; - Messages::::insert(&ALICE, m_1_id, &m_1); - Messages::::insert(&ALICE, m_2_id, &m_2); - Messages::::insert(&ALICE, m_3_id, &m_3); - assert_noop!( - Messaging::remove(signed(ALICE), bounded_vec!(m_1_id)), - Error::::RequestPending - ); - assert_noop!( - Messaging::remove(signed(ALICE), bounded_vec!(m_2_id)), - Error::::RequestPending - ); + + let good_id_1 = [0; 32]; + let good_id_2 = [1; 32]; + let good_id_3 = [2; 32]; + let good_id_4 = [3; 32]; + let erroneous_id_1 = [4; 32]; + + Messages::::insert(&ALICE, good_id_1, &good_message); + Messages::::insert(&ALICE, good_id_2, &good_message); + Messages::::insert(&ALICE, good_id_3, &good_message); + Messages::::insert(&ALICE, good_id_4, &good_message); + Messages::::insert(&ALICE, erroneous_id_1, &erroneous_message); + + // gonna do 5 messages. + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + + let alice_balance_post_hold = Balances::free_balance(&ALICE); + assert_noop!( - Messaging::remove(signed(ALICE), bounded_vec!(m_3_id)), + Messaging::remove( + signed(ALICE), + bounded_vec!(good_id_1, good_id_2, good_id_3, good_id_4, erroneous_id_1) + ), Error::::RequestPending ); - assert!( - Messages::::get(ALICE, &m_1_id).is_some(), - "Message has been deleted when it should still exist." - ); - assert!( - Messages::::get(ALICE, &m_2_id).is_some(), - "Message has been deleted when it should still exist." - ); - assert!( - Messages::::get(ALICE, &m_3_id).is_some(), - "Message has been deleted when it should still exist." - ); - }); - } - #[test] - fn xcm_response_messages_can_always_be_removed() { - new_test_ext().execute_with(|| {}); - } + assert!(Messages::::get(&ALICE, good_id_1).is_some()); + assert!(Messages::::get(&ALICE, good_id_2).is_some()); + assert!(Messages::::get(&ALICE, good_id_3).is_some()); + assert!(Messages::::get(&ALICE, good_id_4).is_some()); + assert!(Messages::::get(&ALICE, erroneous_id_1).is_some()); - #[test] - fn multiple_messages_remove_works() { - new_test_ext().execute_with(|| {}); + let alice_balance_post_remove = Balances::free_balance(&ALICE); + assert_eq!(alice_initial_balance, alice_balance_post_hold + deposit * 5); + assert_eq!(alice_balance_post_remove, alice_balance_post_hold); + }); } #[test] diff --git a/pallets/api/src/messaging/weights.rs b/pallets/api/src/messaging/weights.rs new file mode 100644 index 000000000..e69de29bb diff --git a/pallets/api/src/nonfungibles/benchmarking.rs b/pallets/api/src/nonfungibles/benchmarking.rs index 650f98588..bd38ebbb8 100644 --- a/pallets/api/src/nonfungibles/benchmarking.rs +++ b/pallets/api/src/nonfungibles/benchmarking.rs @@ -1,9 +1,13 @@ //! Benchmarking setup for pallet_api::nonfungibles use frame_benchmarking::{account, v2::*}; -use frame_support::BoundedVec; +use frame_support::{ + BoundedVec, + traits::Currency, +}; use sp_runtime::traits::Zero; + use super::{ AttributeNamespace, CollectionIdOf, Config, Inspect, ItemIdOf, NftsInstanceOf, Pallet, Read, }; diff --git a/pop-api/Cargo.toml b/pop-api/Cargo.toml index e3597236a..de4f0c246 100644 --- a/pop-api/Cargo.toml +++ b/pop-api/Cargo.toml @@ -40,3 +40,4 @@ std = [ "pop-primitives/std", "sp-io/std", ] +messaging = [ ] diff --git a/pop-api/src/v0/mod.rs b/pop-api/src/v0/mod.rs index 4d6bbd5eb..bebdb0292 100644 --- a/pop-api/src/v0/mod.rs +++ b/pop-api/src/v0/mod.rs @@ -8,12 +8,12 @@ use crate::{ /// APIs for fungible tokens. #[cfg(feature = "fungibles")] pub mod fungibles; -/// APIs for non-fungible tokens. -#[cfg(feature = "nonfungibles")] -pub mod nonfungibles; /// APIs for messaging. #[cfg(feature = "messaging")] pub mod messaging; +/// APIs for non-fungible tokens. +#[cfg(feature = "nonfungibles")] +pub mod nonfungibles; pub(crate) const V0: u8 = 0; diff --git a/runtime/devnet/src/config/revive.rs b/runtime/devnet/src/config/revive.rs index 2afe9fd09..ae87e6246 100644 --- a/runtime/devnet/src/config/revive.rs +++ b/runtime/devnet/src/config/revive.rs @@ -22,7 +22,7 @@ impl pallet_revive::Config for Runtime { type CallFilter = Nothing; type ChainExtension = (); // todo!("Call with peter, currently we are only implementing the extension for - // pallet-contracts"); + // pallet-contracts"); type ChainId = ConstU64<4001>; type CodeHashLockupDepositPercent = CodeHashLockupDepositPercent; type Currency = Balances; diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index c396ccb78..6486dcee8 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -677,6 +677,7 @@ mod benches { [pallet_collator_selection, CollatorSelection] [cumulus_pallet_parachain_system, ParachainSystem] [cumulus_pallet_xcmp_queue, XcmpQueue] + [messaging, Messaging] ); } From 12827435b6569ea79b67c20eac21637186164db3 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:55 +0000 Subject: [PATCH 12/38] refactor storage deposits --- pallets/api/src/messaging/benchmarking.rs | 118 +++++++++---------- pallets/api/src/messaging/deposits.rs | 43 +++++++ pallets/api/src/messaging/mod.rs | 61 +++------- pallets/api/src/messaging/tests.rs | 73 ++++++------ pallets/api/src/messaging/transports/ismp.rs | 35 +----- pallets/api/src/nonfungibles/benchmarking.rs | 6 +- 6 files changed, 155 insertions(+), 181 deletions(-) create mode 100644 pallets/api/src/messaging/deposits.rs diff --git a/pallets/api/src/messaging/benchmarking.rs b/pallets/api/src/messaging/benchmarking.rs index 0e33183e1..df30e1ac0 100644 --- a/pallets/api/src/messaging/benchmarking.rs +++ b/pallets/api/src/messaging/benchmarking.rs @@ -1,72 +1,70 @@ -// //! Benchmarking setup for pallet_api::nonfungibles -// #![cfg(feature = "runtime-benchmarks")] +//! Benchmarking setup for pallet_api::nonfungibles +#![cfg(feature = "runtime-benchmarks")] -// use frame_benchmarking::{account, v2::*}; -// use frame_support::{BoundedVec, dispatch::RawOrigin, traits::Currency}; -// use sp_runtime::traits::Zero; +use frame_benchmarking::{account, v2::*}; +use frame_support::{BoundedVec, dispatch::RawOrigin, traits::Currency}; +use sp_runtime::traits::Zero; +use super::*; +use crate::Read as _; +const SEED: u32 = 1; -// use super::*; -// use crate::Read as _; -// const SEED: u32 = 1; +// See if `generic_event` has been emitted. +fn assert_has_event +(generic_event: ::RuntimeEvent) +where -// // See if `generic_event` has been emitted. -// fn assert_has_event -// (generic_event: ::RuntimeEvent) -// where +{ + frame_system::Pallet::::assert_has_event(generic_event.into()); +} -// { -// frame_system::Pallet::::assert_has_event(generic_event.into()); -// } +#[benchmarks( + where + T: pallet_balances::Config +)] +mod messaging_benchmarks { + use super::*; + #[benchmark] + // x: The number of removals required. + fn remove(x: Linear<1, 255>) { + let deposit: BalanceOf = sp_runtime::traits::One::one(); + let owner: AccountIdOf = account("Alice", 0, SEED); + let mut message_ids: BoundedVec = BoundedVec::new(); + pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); -// #[benchmarks( -// where -// T: pallet_balances::Config -// )] -// mod messaging_benchmarks { -// use super::*; + for i in 0..x { + ::Deposit::hold( + &HoldReason::Messaging.into(), + &owner, + deposit, + ) + .unwrap(); -// #[benchmark] -// // x: The number of removals required. -// fn remove(x: Linear<1, 255>) { -// let deposit: BalanceOf = sp_runtime::traits::One::one(); -// let owner: AccountIdOf = account("Alice", 0, SEED); -// let mut message_ids: BoundedVec = BoundedVec::new(); -// pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); + let message_id = H256::repeat_byte(i as u8); + let commitment = H256::repeat_byte(i as u8); -// for i in 0..x { -// ::Deposit::hold( -// &HoldReason::Messaging.into(), -// &owner, -// deposit, -// ) -// .unwrap(); - -// let message_id = H256::repeat_byte(i as u8); -// let commitment = H256::repeat_byte(i as u8); + let good_message = Message::IsmpResponse { + commitment: commitment.clone(), + deposit, + response: Default::default(), + status: MessageStatus::Ok, + }; -// let good_message = Message::IsmpResponse { -// commitment: commitment.clone(), -// deposit, -// response: Default::default(), -// status: MessageStatus::Ok, -// }; + Messages::::insert(&owner, &message_id.0, &good_message); + IsmpRequests::::insert(&commitment, (&owner, &message_id.0)); + message_ids.try_push(message_id.0).unwrap() + } + #[extrinsic_call] + Pallet::::remove(RawOrigin::Signed(owner.clone()), message_ids.clone()); -// Messages::::insert(&owner, &message_id.0, &good_message); -// IsmpRequests::::insert(&commitment, (&owner, &message_id.0)); -// message_ids.try_push(message_id.0).unwrap() -// } -// #[extrinsic_call] -// Pallet::::remove(RawOrigin::Signed(owner.clone()), message_ids.clone()); - -// assert_has_event::( -// crate::messaging::Event::Removed { -// origin: owner, -// messages: message_ids.to_vec(), -// }.into() -// ) -// } + assert_has_event::( + crate::messaging::Event::Removed { + origin: owner, + messages: message_ids.to_vec(), + }.into() + ) + } -// impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); -// } + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); +} diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs new file mode 100644 index 000000000..bf212a1fa --- /dev/null +++ b/pallets/api/src/messaging/deposits.rs @@ -0,0 +1,43 @@ + +use super::*; +use sp_runtime::{traits::Zero, SaturatedConversion}; + + +#[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +pub enum ProtocolStorageDeposit { + XcmQueries, + IsmpRequests, +} + +fn calculate_type_deposit() -> BalanceOf { + T::ByteFee::get() * U::max_encoded_len().saturated_into() +} + +fn calculate_protocol_deposit(p: ProtocolStorageDeposit) -> BalanceOf { + let base: usize = match p { + ProtocolStorageDeposit::XcmQueries => { + KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len() + + Option::>::max_encoded_len() + }, + ProtocolStorageDeposit::IsmpRequests => { + KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len() + }, + }; + T::ByteFee::get() * base.saturated_into() +} + +fn calculate_message_deposit() -> BalanceOf { + T::ByteFee::get() * (KeyLenOf::>::get() as usize + Message::::max_encoded_len()).saturated_into() +} + + +pub fn calculate_deposit(p: ProtocolStorageDeposit) -> BalanceOf { + calculate_type_deposit::() + .saturating_add(calculate_protocol_deposit::(p)) + .saturating_add(calculate_message_deposit::()) +} + diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index e5fde37b6..576378196 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -32,6 +32,10 @@ mod benchmarking; /// Messaging transports. pub mod transports; +/// Message storage deposit calculations. +mod deposits; +use deposits::{ProtocolStorageDeposit, calculate_deposit}; + #[cfg(test)] mod tests; @@ -62,18 +66,21 @@ pub mod pallet { type OriginConverter: TryConvert; + /// The base byte fee for a request, used to prevent bloating. #[pallet::constant] type ByteFee: Get>; + /// The incentive byte fee is used to encourage users to remove requests from storage. + #[pallet::constant] + type IsmpByteFee: Get>; + type CallbackExecutor: CallbackExecutor; /// The deposit mechanism. type Deposit: Mutate + Inspect; - #[pallet::constant] - type IsmpByteFee: Get>; - + /// The ISMP message dispatcher. type IsmpDispatcher: IsmpDispatcher>; @@ -261,16 +268,7 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - // Calculate deposit and place on hold. - let deposit = Self::calculate_deposit( - message.calculate_deposit() + - // IsmpRequests - (KeyLenOf::>::get() as usize + - AccountIdOf::::max_encoded_len() + - MessageId::max_encoded_len()) - .saturated_into::>() * - T::ByteFee::get(), - ); + let deposit = deposits::calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. @@ -330,16 +328,7 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - // Calculate deposit and place on hold. - let deposit = Self::calculate_deposit( - message.calculate_deposit() + - // IsmpRequests - (KeyLenOf::>::get() as usize + - AccountIdOf::::max_encoded_len() + - MessageId::max_encoded_len()) - .saturated_into::>() * - T::ByteFee::get(), - ); + let deposit = deposits::calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. @@ -400,16 +389,8 @@ pub mod pallet { .map_err(|_| Error::::OriginConversionFailed)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - // Calculate deposit and place on hold. - let deposit = Self::calculate_deposit( - // XcmQueries - (KeyLenOf::>::get() as usize + - AccountIdOf::::max_encoded_len() + - MessageId::max_encoded_len() + - Option::>::max_encoded_len()) - .saturated_into::>() * - T::ByteFee::get(), - ); + + let deposit = deposits::calculate_deposit::(ProtocolStorageDeposit::XcmQueries); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by creating new query via XCM. @@ -518,16 +499,6 @@ pub mod pallet { } } impl Pallet { - // Calculate the deposit required for a particular message. - fn calculate_deposit(deposit: BalanceOf) -> BalanceOf { - // Add amount for `Messages` key and value - deposit.saturating_add( - (KeyLenOf::>::get().saturated_into::>() + - Message::::max_encoded_len().saturated_into::>()) * - T::ByteFee::get(), - ) - } - // Attempt to notify via callback. fn call( origin: AccountIdOf, @@ -650,10 +621,6 @@ impl crate::Read for Pallet { } } -trait CalculateDeposit { - fn calculate_deposit(&self) -> Deposit; -} - #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] enum Message { diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 615bfa5fc..2b5c190cc 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -15,7 +15,13 @@ fn events() -> Vec> { let result = System::events() .into_iter() .map(|r| r.event) - .filter_map(|e| if let crate::mock::RuntimeEvent::Messaging(inner) = e { Some(inner) } else { None }) + .filter_map(|e| { + if let crate::mock::RuntimeEvent::Messaging(inner) = e { + Some(inner) + } else { + None + } + }) .collect::>(); System::reset_events(); @@ -23,7 +29,6 @@ fn events() -> Vec> { result } - // All the tests for the Message enum impls. mod message { use super::*; @@ -322,42 +327,36 @@ mod remove { #[test] fn success_event() { new_test_ext().execute_with(|| { + let deposit: Balance = 100; + let m = Message::IsmpResponse { + commitment: Default::default(), + deposit, + response: Default::default(), + status: MessageStatus::Ok, + }; + let m_id = [0u8; 32]; + let m2_id = [1u8; 32]; - let deposit: Balance = 100; - let m = Message::IsmpResponse { - commitment: Default::default(), - deposit, - response: Default::default(), - status: MessageStatus::Ok, - }; - let m_id = [0u8; 32]; - let m2_id = [1u8; 32]; - - Messages::::insert(&ALICE, m_id, &m); - Messages::::insert(&ALICE, m2_id, &m); - - ::Deposit::hold( - &HoldReason::Messaging.into(), - &ALICE, - deposit, - ) - .unwrap(); - ::Deposit::hold( - &HoldReason::Messaging.into(), - &ALICE, - deposit, - ) - .unwrap(); - - assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(m_id, m2_id))); - - assert!(events().contains( - &Event::::Removed { - origin: ALICE, - messages: vec![m_id, m2_id] - } - )); + Messages::::insert(&ALICE, m_id, &m); + Messages::::insert(&ALICE, m2_id, &m); + + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(m_id, m2_id))); + assert!(events() + .contains(&Event::::Removed { origin: ALICE, messages: vec![m_id, m2_id] })); }) } @@ -442,7 +441,7 @@ mod remove { ::Deposit::hold( &HoldReason::Messaging.into(), - &ALICE, + &ALICE, deposit, ) .unwrap(); diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 40566bd8d..5a4000e8b 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -26,7 +26,7 @@ use sp_runtime::{BoundedVec, SaturatedConversion, Saturating}; use crate::messaging::{ pallet::{Config, Event, IsmpRequests, Messages, Pallet}, - AccountIdOf, BalanceOf, CalculateDeposit, MessageId, Vec, + AccountIdOf, BalanceOf, MessageId, Vec, }; pub const ID: [u8; 3] = *b"pop"; @@ -49,7 +49,7 @@ impl From> for DispatchRequest { } } -#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo)] +#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct Get { // TODO: Option to support relay? @@ -79,18 +79,7 @@ impl From> for DispatchRequest { } } -impl CalculateDeposit> for Get { - fn calculate_deposit(&self) -> BalanceOf { - let len = self.dest.encoded_size() + - self.height.encoded_size() + - self.timeout.encoded_size() + - self.context.len() + - self.keys.iter().map(|k| k.len()).sum::(); - calculate_deposit::(T::IsmpByteFee::get() * len.saturated_into()) - } -} - -#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo)] +#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo, MaxEncodedLen)] #[scale_info(skip_type_params(T))] pub struct Post { // TODO: Option to support relay? @@ -117,13 +106,6 @@ impl From> for DispatchRequest { } } -impl CalculateDeposit> for Post { - fn calculate_deposit(&self) -> BalanceOf { - let len = self.dest.encoded_size() + self.timeout.encoded_size() + self.data.len(); - calculate_deposit::(T::IsmpByteFee::get() * len.saturated_into()) - } -} - pub struct Handler(PhantomData); impl Handler { pub fn new() -> Self { @@ -207,17 +189,6 @@ impl IsmpModuleWeight for Pallet { } } -fn calculate_deposit(mut deposit: BalanceOf) -> BalanceOf { - // Add amount for `IsmpRequests` lookup. - let key_len: BalanceOf = - (T::AccountId::max_encoded_len() + MessageId::max_encoded_len()).saturated_into(); - deposit.saturating_accrue( - T::ByteFee::get() * (H256::max_encoded_len().saturated_into::>() + key_len), - ); - - deposit -} - fn process_response( commitment: &H256, encode: &impl Encode, diff --git a/pallets/api/src/nonfungibles/benchmarking.rs b/pallets/api/src/nonfungibles/benchmarking.rs index bd38ebbb8..20c7416c1 100644 --- a/pallets/api/src/nonfungibles/benchmarking.rs +++ b/pallets/api/src/nonfungibles/benchmarking.rs @@ -1,13 +1,9 @@ //! Benchmarking setup for pallet_api::nonfungibles use frame_benchmarking::{account, v2::*}; -use frame_support::{ - BoundedVec, - traits::Currency, -}; +use frame_support::{traits::Currency, BoundedVec}; use sp_runtime::traits::Zero; - use super::{ AttributeNamespace, CollectionIdOf, Config, Inspect, ItemIdOf, NftsInstanceOf, Pallet, Read, }; From 789096fc5e98e2965e4090c488fbee8478d76de9 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:29:58 +0000 Subject: [PATCH 13/38] check warnings --- pallets/api/src/messaging/deposits.rs | 2 +- pallets/api/src/messaging/mod.rs | 21 +++++++++----------- pallets/api/src/messaging/transports/ismp.rs | 5 ++--- 3 files changed, 12 insertions(+), 16 deletions(-) diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs index bf212a1fa..f24200518 100644 --- a/pallets/api/src/messaging/deposits.rs +++ b/pallets/api/src/messaging/deposits.rs @@ -1,6 +1,6 @@ use super::*; -use sp_runtime::{traits::Zero, SaturatedConversion}; +use sp_runtime::SaturatedConversion; #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 576378196..5dd46d29c 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -1,5 +1,3 @@ -//! TODO: pallet docs. - use codec::{Decode, Encode}; use frame_support::{ dispatch::{DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, @@ -15,8 +13,8 @@ use frame_system::pallet_prelude::*; pub use pallet::*; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{traits::Saturating, BoundedVec, DispatchError, SaturatedConversion}; -use sp_std::{collections::btree_set::BTreeSet, vec::Vec}; +use sp_runtime::{traits::Saturating, BoundedVec, DispatchError}; +use sp_std::vec::Vec; use transports::{ ismp::{self as ismp, FeeMetadata, IsmpDispatcher}, xcm::{self as xcm, Location, QueryId}, @@ -50,8 +48,7 @@ pub mod pallet { use frame_support::{ dispatch::DispatchResult, pallet_prelude::*, - storage::KeyLenOf, - traits::tokens::{fungible::hold::Mutate, Precision::Exact}, + traits::tokens::fungible::hold::Mutate, }; use sp_core::H256; use sp_runtime::traits::TryConvert; @@ -268,7 +265,7 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = deposits::calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); + let deposit = calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. @@ -298,7 +295,7 @@ pub mod pallet { }); Ok(()) }, - Err(e) => { + Err(_) => { // Allow a caller to poll for the status still and retreive the message deposit. Messages::::insert( &origin, @@ -328,7 +325,7 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = deposits::calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); + let deposit = calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. @@ -358,7 +355,7 @@ pub mod pallet { }); Ok(()) }, - Err(e) => { + Err(_) => { // Allow a caller to poll for the status still and retreive the message deposit. Messages::::insert( &origin, @@ -390,7 +387,7 @@ pub mod pallet { ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = deposits::calculate_deposit::(ProtocolStorageDeposit::XcmQueries); + let deposit = calculate_deposit::(ProtocolStorageDeposit::XcmQueries); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by creating new query via XCM. @@ -480,7 +477,7 @@ pub mod pallet { #[pallet::weight(Weight::zero())] pub fn remove( origin: OriginFor, - mut messages: BoundedVec, + messages: BoundedVec, ) -> DispatchResult { let origin = ensure_signed(origin)?; diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 5a4000e8b..c0c478a3d 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -22,11 +22,11 @@ use ismp::{ use pallet_ismp::weights::IsmpModuleWeight; use scale_info::TypeInfo; use sp_core::{keccak_256, H256}; -use sp_runtime::{BoundedVec, SaturatedConversion, Saturating}; +use sp_runtime::{BoundedVec, Saturating}; use crate::messaging::{ pallet::{Config, Event, IsmpRequests, Messages, Pallet}, - AccountIdOf, BalanceOf, MessageId, Vec, + AccountIdOf, MessageId, Vec, }; pub const ID: [u8; 3] = *b"pop"; @@ -163,7 +163,6 @@ impl IsmpModule for Handler { // deposit: *deposit, // commitment: *commitment, // }); - Ok(()) })?; Ok(()) }, From e0e686093badaad193d08334022bb3c3fb39674c Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:02 +0000 Subject: [PATCH 14/38] fmt --- pallets/api/src/messaging/benchmarking.rs | 14 ++---- pallets/api/src/messaging/deposits.rs | 47 +++++++++----------- pallets/api/src/messaging/mod.rs | 13 +++--- pallets/api/src/messaging/transports/ismp.rs | 8 +++- 4 files changed, 38 insertions(+), 44 deletions(-) diff --git a/pallets/api/src/messaging/benchmarking.rs b/pallets/api/src/messaging/benchmarking.rs index df30e1ac0..a92d91ec5 100644 --- a/pallets/api/src/messaging/benchmarking.rs +++ b/pallets/api/src/messaging/benchmarking.rs @@ -2,7 +2,7 @@ #![cfg(feature = "runtime-benchmarks")] use frame_benchmarking::{account, v2::*}; -use frame_support::{BoundedVec, dispatch::RawOrigin, traits::Currency}; +use frame_support::{dispatch::RawOrigin, traits::Currency, BoundedVec}; use sp_runtime::traits::Zero; use super::*; @@ -10,11 +10,7 @@ use crate::Read as _; const SEED: u32 = 1; // See if `generic_event` has been emitted. -fn assert_has_event -(generic_event: ::RuntimeEvent) -where - -{ +fn assert_has_event(generic_event: ::RuntimeEvent) { frame_system::Pallet::::assert_has_event(generic_event.into()); } @@ -59,10 +55,8 @@ mod messaging_benchmarks { Pallet::::remove(RawOrigin::Signed(owner.clone()), message_ids.clone()); assert_has_event::( - crate::messaging::Event::Removed { - origin: owner, - messages: message_ids.to_vec(), - }.into() + crate::messaging::Event::Removed { origin: owner, messages: message_ids.to_vec() } + .into(), ) } diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs index f24200518..3293cfd01 100644 --- a/pallets/api/src/messaging/deposits.rs +++ b/pallets/api/src/messaging/deposits.rs @@ -1,43 +1,40 @@ - -use super::*; use sp_runtime::SaturatedConversion; +use super::*; #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum ProtocolStorageDeposit { - XcmQueries, - IsmpRequests, + XcmQueries, + IsmpRequests, } fn calculate_type_deposit() -> BalanceOf { - T::ByteFee::get() * U::max_encoded_len().saturated_into() + T::ByteFee::get() * U::max_encoded_len().saturated_into() } fn calculate_protocol_deposit(p: ProtocolStorageDeposit) -> BalanceOf { - let base: usize = match p { - ProtocolStorageDeposit::XcmQueries => { - KeyLenOf::>::get() as usize + - AccountIdOf::::max_encoded_len() + - MessageId::max_encoded_len() + - Option::>::max_encoded_len() - }, - ProtocolStorageDeposit::IsmpRequests => { - KeyLenOf::>::get() as usize + - AccountIdOf::::max_encoded_len() + - MessageId::max_encoded_len() - }, - }; - T::ByteFee::get() * base.saturated_into() + let base: usize = match p { + ProtocolStorageDeposit::XcmQueries => + KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len() + + Option::>::max_encoded_len(), + ProtocolStorageDeposit::IsmpRequests => + KeyLenOf::>::get() as usize + + AccountIdOf::::max_encoded_len() + + MessageId::max_encoded_len(), + }; + T::ByteFee::get() * base.saturated_into() } fn calculate_message_deposit() -> BalanceOf { - T::ByteFee::get() * (KeyLenOf::>::get() as usize + Message::::max_encoded_len()).saturated_into() + T::ByteFee::get() * + (KeyLenOf::>::get() as usize + Message::::max_encoded_len()) + .saturated_into() } - pub fn calculate_deposit(p: ProtocolStorageDeposit) -> BalanceOf { - calculate_type_deposit::() - .saturating_add(calculate_protocol_deposit::(p)) - .saturating_add(calculate_message_deposit::()) + calculate_type_deposit::() + .saturating_add(calculate_protocol_deposit::(p)) + .saturating_add(calculate_message_deposit::()) } - diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 5dd46d29c..691042e5b 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -32,7 +32,7 @@ pub mod transports; /// Message storage deposit calculations. mod deposits; -use deposits::{ProtocolStorageDeposit, calculate_deposit}; +use deposits::{calculate_deposit, ProtocolStorageDeposit}; #[cfg(test)] mod tests; @@ -46,9 +46,7 @@ pub type MessageId = [u8; 32]; pub mod pallet { use frame_support::{ - dispatch::DispatchResult, - pallet_prelude::*, - traits::tokens::fungible::hold::Mutate, + dispatch::DispatchResult, pallet_prelude::*, traits::tokens::fungible::hold::Mutate, }; use sp_core::H256; use sp_runtime::traits::TryConvert; @@ -77,7 +75,6 @@ pub mod pallet { type Deposit: Mutate + Inspect; - /// The ISMP message dispatcher. type IsmpDispatcher: IsmpDispatcher>; @@ -265,7 +262,8 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); + let deposit = + calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. @@ -325,7 +323,8 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); + let deposit = + calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index c0c478a3d..212155809 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -49,7 +49,9 @@ impl From> for DispatchRequest { } } -#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo, MaxEncodedLen)] +#[derive( + Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo, MaxEncodedLen, +)] #[scale_info(skip_type_params(T))] pub struct Get { // TODO: Option to support relay? @@ -79,7 +81,9 @@ impl From> for DispatchRequest { } } -#[derive(Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo, MaxEncodedLen)] +#[derive( + Encode, EqNoBound, CloneNoBound, DebugNoBound, Decode, PartialEqNoBound, TypeInfo, MaxEncodedLen, +)] #[scale_info(skip_type_params(T))] pub struct Post { // TODO: Option to support relay? From b4c67d91c7f364ce993eeba0682735302734ef8f Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:07 +0000 Subject: [PATCH 15/38] Off chain and on chain byte fees --- pallets/api/src/messaging/deposits.rs | 23 ++++++++++----------- pallets/api/src/messaging/mod.rs | 29 ++++++++++++++++++--------- pallets/api/src/mock.rs | 4 ++-- runtime/devnet/src/config/api/mod.rs | 4 ++-- 4 files changed, 34 insertions(+), 26 deletions(-) diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs index 3293cfd01..9d6f552c4 100644 --- a/pallets/api/src/messaging/deposits.rs +++ b/pallets/api/src/messaging/deposits.rs @@ -1,6 +1,7 @@ use sp_runtime::SaturatedConversion; use super::*; +use sp_std::ops::Mul; #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum ProtocolStorageDeposit { @@ -8,11 +9,8 @@ pub enum ProtocolStorageDeposit { IsmpRequests, } -fn calculate_type_deposit() -> BalanceOf { - T::ByteFee::get() * U::max_encoded_len().saturated_into() -} - -fn calculate_protocol_deposit(p: ProtocolStorageDeposit) -> BalanceOf { +/// Calculate the deposit required for the space used for a specific protocol. +pub fn calculate_protocol_deposit>>(p: ProtocolStorageDeposit) -> BalanceOf { let base: usize = match p { ProtocolStorageDeposit::XcmQueries => KeyLenOf::>::get() as usize + @@ -24,17 +22,18 @@ fn calculate_protocol_deposit(p: ProtocolStorageDeposit) -> BalanceOf AccountIdOf::::max_encoded_len() + MessageId::max_encoded_len(), }; - T::ByteFee::get() * base.saturated_into() + ByteFee::get() * base.saturated_into() } -fn calculate_message_deposit() -> BalanceOf { - T::ByteFee::get() * +/// Calculate the deposit for the storage used for the Message enum. +pub fn calculate_message_deposit>>() -> BalanceOf { + ByteFee::get() * (KeyLenOf::>::get() as usize + Message::::max_encoded_len()) .saturated_into() } -pub fn calculate_deposit(p: ProtocolStorageDeposit) -> BalanceOf { - calculate_type_deposit::() - .saturating_add(calculate_protocol_deposit::(p)) - .saturating_add(calculate_message_deposit::()) +/// Blanket implementation of generating the deposit for a type that implements MaxEncodedLen. +pub fn calculate_deposit_of>, U: MaxEncodedLen>() -> BalanceOf { + ByteFee::get() * U::max_encoded_len().saturated_into() } + diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 691042e5b..6207aa016 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -32,7 +32,7 @@ pub mod transports; /// Message storage deposit calculations. mod deposits; -use deposits::{calculate_deposit, ProtocolStorageDeposit}; +use deposits::*; #[cfg(test)] mod tests; @@ -61,13 +61,13 @@ pub mod pallet { type OriginConverter: TryConvert; - /// The base byte fee for a request, used to prevent bloating. + /// The base byte fee for data stored onchain. #[pallet::constant] - type ByteFee: Get>; + type OnChainByteFee: Get>; - /// The incentive byte fee is used to encourage users to remove requests from storage. + /// The base byte fee for data stored offchain. #[pallet::constant] - type IsmpByteFee: Get>; + type OffChainByteFee: Get>; type CallbackExecutor: CallbackExecutor; @@ -262,8 +262,11 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = - calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); + let deposit = + calculate_protocol_deposit::(ProtocolStorageDeposit::IsmpRequests) + + calculate_message_deposit::() + + calculate_deposit_of::>(); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. @@ -323,8 +326,11 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = - calculate_deposit::>(ProtocolStorageDeposit::IsmpRequests); + let deposit = + calculate_protocol_deposit::(ProtocolStorageDeposit::IsmpRequests) + + calculate_message_deposit::() + + calculate_deposit_of::>(); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. @@ -386,7 +392,10 @@ pub mod pallet { ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = calculate_deposit::(ProtocolStorageDeposit::XcmQueries); + let deposit = + calculate_protocol_deposit::(ProtocolStorageDeposit::IsmpRequests) + + calculate_message_deposit::(); + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by creating new query via XCM. diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index e02c61b0f..03e0a2aff 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -240,10 +240,10 @@ impl NotifyQueryHandler for MockNotifyQuery { } impl crate::messaging::Config for Test { - type ByteFee = TransactionByteFee; + type OnChainByteFee = TransactionByteFee; type CallbackExecutor = MockCallbackExecutor; type Deposit = Balances; - type IsmpByteFee = (); + type OffChainByteFee = (); type IsmpDispatcher = MockIsmpDispatcher; type MaxContextLen = ConstU32<64>; type MaxDataLen = ConstU32<1024>; diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 6a1076d9c..7274f8560 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -112,12 +112,12 @@ impl nonfungibles::Config for Runtime { } impl messaging::Config for Runtime { - type ByteFee = TransactionByteFee; + type OnChainByteFee = TransactionByteFee; type CallbackExecutor = CallbackExecutor; type Deposit = Balances; // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as // much as onchain cost. - type IsmpByteFee = (); + type OffChainByteFee = (); type IsmpDispatcher = Ismp; type MaxContextLen = ConstU32<64>; type MaxDataLen = ConstU32<1024>; From a7e3558862a8967626cb0ea77cd24fbeab61fcbf Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:16 +0000 Subject: [PATCH 16/38] fmt --- pallets/api/src/messaging/deposits.rs | 10 ++++++---- pallets/api/src/messaging/mod.rs | 18 +++++++++--------- pallets/api/src/mock.rs | 4 ++-- runtime/devnet/src/config/api/mod.rs | 8 ++++---- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs index 9d6f552c4..c39e0c341 100644 --- a/pallets/api/src/messaging/deposits.rs +++ b/pallets/api/src/messaging/deposits.rs @@ -1,7 +1,7 @@ use sp_runtime::SaturatedConversion; +use sp_std::ops::Mul; use super::*; -use sp_std::ops::Mul; #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum ProtocolStorageDeposit { @@ -10,7 +10,9 @@ pub enum ProtocolStorageDeposit { } /// Calculate the deposit required for the space used for a specific protocol. -pub fn calculate_protocol_deposit>>(p: ProtocolStorageDeposit) -> BalanceOf { +pub fn calculate_protocol_deposit>>( + p: ProtocolStorageDeposit, +) -> BalanceOf { let base: usize = match p { ProtocolStorageDeposit::XcmQueries => KeyLenOf::>::get() as usize + @@ -33,7 +35,7 @@ pub fn calculate_message_deposit>>() -> Bal } /// Blanket implementation of generating the deposit for a type that implements MaxEncodedLen. -pub fn calculate_deposit_of>, U: MaxEncodedLen>() -> BalanceOf { +pub fn calculate_deposit_of>, U: MaxEncodedLen>( +) -> BalanceOf { ByteFee::get() * U::max_encoded_len().saturated_into() } - diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 6207aa016..8400d81c7 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -262,9 +262,9 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = - calculate_protocol_deposit::(ProtocolStorageDeposit::IsmpRequests) + - calculate_message_deposit::() + + let deposit = calculate_protocol_deposit::( + ProtocolStorageDeposit::IsmpRequests, + ) + calculate_message_deposit::() + calculate_deposit_of::>(); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; @@ -326,9 +326,9 @@ pub mod pallet { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = - calculate_protocol_deposit::(ProtocolStorageDeposit::IsmpRequests) + - calculate_message_deposit::() + + let deposit = calculate_protocol_deposit::( + ProtocolStorageDeposit::IsmpRequests, + ) + calculate_message_deposit::() + calculate_deposit_of::>(); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; @@ -392,9 +392,9 @@ pub mod pallet { ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = - calculate_protocol_deposit::(ProtocolStorageDeposit::IsmpRequests) + - calculate_message_deposit::(); + let deposit = calculate_protocol_deposit::( + ProtocolStorageDeposit::IsmpRequests, + ) + calculate_message_deposit::(); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 03e0a2aff..7b5cd83d4 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -240,10 +240,8 @@ impl NotifyQueryHandler for MockNotifyQuery { } impl crate::messaging::Config for Test { - type OnChainByteFee = TransactionByteFee; type CallbackExecutor = MockCallbackExecutor; type Deposit = Balances; - type OffChainByteFee = (); type IsmpDispatcher = MockIsmpDispatcher; type MaxContextLen = ConstU32<64>; type MaxDataLen = ConstU32<1024>; @@ -251,6 +249,8 @@ impl crate::messaging::Config for Test { type MaxKeys = ConstU32<10>; type MaxRemovals = ConstU32<1024>; type MaxResponseLen = ConstU32<1024>; + type OffChainByteFee = (); + type OnChainByteFee = TransactionByteFee; type OriginConverter = (); type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 7274f8560..963c1a5f6 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -112,12 +112,8 @@ impl nonfungibles::Config for Runtime { } impl messaging::Config for Runtime { - type OnChainByteFee = TransactionByteFee; type CallbackExecutor = CallbackExecutor; type Deposit = Balances; - // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as - // much as onchain cost. - type OffChainByteFee = (); type IsmpDispatcher = Ismp; type MaxContextLen = ConstU32<64>; type MaxDataLen = ConstU32<1024>; @@ -127,6 +123,10 @@ impl messaging::Config for Runtime { type MaxRemovals = ConstU32<1024>; // TODO: ensure within the contract buffer bounds type MaxResponseLen = ConstU32<1024>; + // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as + // much as onchain cost. + type OffChainByteFee = (); + type OnChainByteFee = TransactionByteFee; type OriginConverter = LocalOriginToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; From e193b0c34215f0ea16f606a5e8a14c89363cd2f5 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:24 +0000 Subject: [PATCH 17/38] comments --- pallets/api/src/messaging/deposits.rs | 55 +++++++++++++++++++++------ pallets/api/src/messaging/mod.rs | 53 ++++---------------------- pop-api/Cargo.toml | 2 +- 3 files changed, 51 insertions(+), 59 deletions(-) diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs index c39e0c341..e0002abb7 100644 --- a/pallets/api/src/messaging/deposits.rs +++ b/pallets/api/src/messaging/deposits.rs @@ -15,27 +15,58 @@ pub fn calculate_protocol_deposit>>( ) -> BalanceOf { let base: usize = match p { ProtocolStorageDeposit::XcmQueries => - KeyLenOf::>::get() as usize + - AccountIdOf::::max_encoded_len() + - MessageId::max_encoded_len() + - Option::>::max_encoded_len(), - ProtocolStorageDeposit::IsmpRequests => - KeyLenOf::>::get() as usize + - AccountIdOf::::max_encoded_len() + - MessageId::max_encoded_len(), + (KeyLenOf::>::get() as usize) + .saturating_add(AccountIdOf::::max_encoded_len()) + .saturating_add(MessageId::max_encoded_len()) + .saturating_add(Option::>::max_encoded_len()), + + ProtocolStorageDeposit::IsmpRequests => + (KeyLenOf::>::get() as usize) + .saturating_add(AccountIdOf::::max_encoded_len()) + .saturating_add(MessageId::max_encoded_len()), }; - ByteFee::get() * base.saturated_into() + ByteFee::get().saturating_mul(base.saturated_into()) } /// Calculate the deposit for the storage used for the Message enum. pub fn calculate_message_deposit>>() -> BalanceOf { - ByteFee::get() * + ByteFee::get().saturating_mul( (KeyLenOf::>::get() as usize + Message::::max_encoded_len()) - .saturated_into() + .saturated_into()) } /// Blanket implementation of generating the deposit for a type that implements MaxEncodedLen. pub fn calculate_deposit_of>, U: MaxEncodedLen>( ) -> BalanceOf { - ByteFee::get() * U::max_encoded_len().saturated_into() + ByteFee::get().saturating_mul(U::max_encoded_len().saturated_into()) +} + +#[cfg(test)] +mod tests { + use super::*; + use crate::mock::*; + use frame_support::pallet_prelude::Get; + + struct Two; + impl Get for Two { + fn get() -> u128 { + 2 + } + } + + #[test] + fn calculate_deposit_of_works() { + new_test_ext().execute_with(|| { + // 4 + 4 bytes. + #[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] + struct Data { + pub a: u32, + pub b: u32, + } + + // 8 * 2 = 16 units + assert_eq!(calculate_deposit_of::(), 16); + }) + } + } diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 8400d81c7..95fc8aa08 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -270,11 +270,8 @@ pub mod pallet { T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. - let maybe_commitment = T::IsmpDispatcher::default() - .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }); - - match maybe_commitment { - Ok(commitment) => { + let commitment = T::IsmpDispatcher::default() + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }).map_err(|_|Error::::IsmpDispatchFailed)?; // Store commitment for lookup on response, message for querying, // response/timeout handling. IsmpRequests::::insert(&commitment, (&origin, id)); @@ -295,22 +292,6 @@ pub mod pallet { callback, }); Ok(()) - }, - Err(_) => { - // Allow a caller to poll for the status still and retreive the message deposit. - Messages::::insert( - &origin, - id, - Message::Ismp { - commitment: Default::default(), - callback, - deposit, - status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), - }, - ); - Err(Error::::IsmpDispatchFailed.into()) - }, - } } // TODO: does ismp allow querying to ensure that specified para id is supported? @@ -334,11 +315,9 @@ pub mod pallet { T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. - let maybe_commitment = T::IsmpDispatcher::default() - .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }); + let commitment = T::IsmpDispatcher::default() + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }).map_err(|_| Error::::IsmpDispatchFailed)?; - match maybe_commitment { - Ok(commitment) => { // Store commitment for lookup on response, message for querying, // response/timeout handling. IsmpRequests::::insert(&commitment, (&origin, id)); @@ -359,22 +338,6 @@ pub mod pallet { callback, }); Ok(()) - }, - Err(_) => { - // Allow a caller to poll for the status still and retreive the message deposit. - Messages::::insert( - &origin, - id, - Message::Ismp { - commitment: Default::default(), - callback, - deposit, - status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), - }, - ); - Err(Error::::IsmpDispatchFailed.into()) - }, - } } #[pallet::call_index(3)] @@ -479,8 +442,6 @@ pub mod pallet { } /// Try and remove a collection of messages. - /// Will revert if any one of the messages is erroneous. - #[frame_support::transactional] #[pallet::call_index(5)] #[pallet::weight(Weight::zero())] pub fn remove( @@ -689,7 +650,7 @@ impl Message { } /// Remove a message from storage. - /// Does no check on wether a message should be removed. + /// Does no check on whether a message should be removed. pub(crate) fn remove(&self, origin: &AccountIdOf, id: &MessageId) { Messages::::remove(&origin, &id); match self { @@ -724,9 +685,9 @@ impl Message { pub enum MessageStatus { /// No errors have been recorded. Ok, - /// An error has occurred with this message> + /// An error has occurred with this message. Err(DispatchError), - /// A timeout has occurred + /// A timeout has occurred. Timeout, } diff --git a/pop-api/Cargo.toml b/pop-api/Cargo.toml index de4f0c246..e0a94769d 100644 --- a/pop-api/Cargo.toml +++ b/pop-api/Cargo.toml @@ -40,4 +40,4 @@ std = [ "pop-primitives/std", "sp-io/std", ] -messaging = [ ] +messaging = [ "default" ] From 855ab4f8057982ff9d39dfb9174221714c4055e8 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:31 +0000 Subject: [PATCH 18/38] remove useless test --- pallets/api/src/messaging/tests.rs | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 2b5c190cc..f7271bd18 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -579,9 +579,4 @@ mod remove { assert_eq!(alice_balance_post_remove, alice_balance_post_hold); }); } - - #[test] - fn origin_can_only_remove_messages_related_to_itself() { - new_test_ext().execute_with(|| {}); - } } From eb6ad295da9255ccc89294b92a8b36d689758f97 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:38 +0000 Subject: [PATCH 19/38] fmt --- pallets/api/src/messaging/deposits.rs | 27 +++++---- pallets/api/src/messaging/mod.rs | 86 ++++++++++++++------------- 2 files changed, 58 insertions(+), 55 deletions(-) diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs index e0002abb7..8aa86d6a3 100644 --- a/pallets/api/src/messaging/deposits.rs +++ b/pallets/api/src/messaging/deposits.rs @@ -14,16 +14,14 @@ pub fn calculate_protocol_deposit>>( p: ProtocolStorageDeposit, ) -> BalanceOf { let base: usize = match p { - ProtocolStorageDeposit::XcmQueries => - (KeyLenOf::>::get() as usize) - .saturating_add(AccountIdOf::::max_encoded_len()) - .saturating_add(MessageId::max_encoded_len()) - .saturating_add(Option::>::max_encoded_len()), + ProtocolStorageDeposit::XcmQueries => (KeyLenOf::>::get() as usize) + .saturating_add(AccountIdOf::::max_encoded_len()) + .saturating_add(MessageId::max_encoded_len()) + .saturating_add(Option::>::max_encoded_len()), - ProtocolStorageDeposit::IsmpRequests => - (KeyLenOf::>::get() as usize) - .saturating_add(AccountIdOf::::max_encoded_len()) - .saturating_add(MessageId::max_encoded_len()), + ProtocolStorageDeposit::IsmpRequests => (KeyLenOf::>::get() as usize) + .saturating_add(AccountIdOf::::max_encoded_len()) + .saturating_add(MessageId::max_encoded_len()), }; ByteFee::get().saturating_mul(base.saturated_into()) } @@ -32,7 +30,8 @@ pub fn calculate_protocol_deposit>>( pub fn calculate_message_deposit>>() -> BalanceOf { ByteFee::get().saturating_mul( (KeyLenOf::>::get() as usize + Message::::max_encoded_len()) - .saturated_into()) + .saturated_into(), + ) } /// Blanket implementation of generating the deposit for a type that implements MaxEncodedLen. @@ -43,9 +42,10 @@ pub fn calculate_deposit_of>, U: MaxEncoded #[cfg(test)] mod tests { + use frame_support::pallet_prelude::Get; + use super::*; use crate::mock::*; - use frame_support::pallet_prelude::Get; struct Two; impl Get for Two { @@ -58,7 +58,9 @@ mod tests { fn calculate_deposit_of_works() { new_test_ext().execute_with(|| { // 4 + 4 bytes. - #[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] + #[derive( + Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo, + )] struct Data { pub a: u32, pub b: u32, @@ -68,5 +70,4 @@ mod tests { assert_eq!(calculate_deposit_of::(), 16); }) } - } diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 95fc8aa08..935ebb041 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -271,27 +271,28 @@ pub mod pallet { // Process message by dispatching request via ISMP. let commitment = T::IsmpDispatcher::default() - .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }).map_err(|_|Error::::IsmpDispatchFailed)?; - // Store commitment for lookup on response, message for querying, - // response/timeout handling. - IsmpRequests::::insert(&commitment, (&origin, id)); - Messages::::insert( - &origin, - id, - Message::Ismp { - commitment, - callback: callback.clone(), - deposit, - status: MessageStatus::Ok, - }, - ); - Pallet::::deposit_event(Event::::IsmpGetDispatched { - origin, - id, - commitment, - callback, - }); - Ok(()) + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) + .map_err(|_| Error::::IsmpDispatchFailed)?; + // Store commitment for lookup on response, message for querying, + // response/timeout handling. + IsmpRequests::::insert(&commitment, (&origin, id)); + Messages::::insert( + &origin, + id, + Message::Ismp { + commitment, + callback: callback.clone(), + deposit, + status: MessageStatus::Ok, + }, + ); + Pallet::::deposit_event(Event::::IsmpGetDispatched { + origin, + id, + commitment, + callback, + }); + Ok(()) } // TODO: does ismp allow querying to ensure that specified para id is supported? @@ -316,28 +317,29 @@ pub mod pallet { // Process message by dispatching request via ISMP. let commitment = T::IsmpDispatcher::default() - .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }).map_err(|_| Error::::IsmpDispatchFailed)?; + .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) + .map_err(|_| Error::::IsmpDispatchFailed)?; - // Store commitment for lookup on response, message for querying, - // response/timeout handling. - IsmpRequests::::insert(&commitment, (&origin, id)); - Messages::::insert( - &origin, - id, - Message::Ismp { - commitment, - callback: callback.clone(), - deposit, - status: MessageStatus::Ok, - }, - ); - Pallet::::deposit_event(Event::::IsmpPostDispatched { - origin, - id, - commitment, - callback, - }); - Ok(()) + // Store commitment for lookup on response, message for querying, + // response/timeout handling. + IsmpRequests::::insert(&commitment, (&origin, id)); + Messages::::insert( + &origin, + id, + Message::Ismp { + commitment, + callback: callback.clone(), + deposit, + status: MessageStatus::Ok, + }, + ); + Pallet::::deposit_event(Event::::IsmpPostDispatched { + origin, + id, + commitment, + callback, + }); + Ok(()) } #[pallet::call_index(3)] From ceaeab43a2a6c5a465cfb1df50fc49ec959f78aa Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:44 +0000 Subject: [PATCH 20/38] defensive --- pallets/api/src/messaging/mod.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 935ebb041..fae5094b6 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -264,8 +264,9 @@ pub mod pallet { let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, - ) + calculate_message_deposit::() + - calculate_deposit_of::>(); + ).saturating_add(calculate_message_deposit::()) + .saturating_add( + calculate_deposit_of::>()); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; @@ -310,8 +311,8 @@ pub mod pallet { let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, - ) + calculate_message_deposit::() + - calculate_deposit_of::>(); + ).saturating_add(calculate_message_deposit::()).saturating_add( + calculate_deposit_of::>()); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; @@ -359,7 +360,7 @@ pub mod pallet { let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, - ) + calculate_message_deposit::(); + ).saturating_add(calculate_message_deposit::()); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; From 3f04120a6b3ff6aa89487366e2889473c58ae1ba Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:50 +0000 Subject: [PATCH 21/38] fmt --- pallets/api/src/messaging/mod.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index fae5094b6..dbe0b1264 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -264,9 +264,9 @@ pub mod pallet { let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, - ).saturating_add(calculate_message_deposit::()) - .saturating_add( - calculate_deposit_of::>()); + ) + .saturating_add(calculate_message_deposit::()) + .saturating_add(calculate_deposit_of::>()); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; @@ -311,8 +311,9 @@ pub mod pallet { let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, - ).saturating_add(calculate_message_deposit::()).saturating_add( - calculate_deposit_of::>()); + ) + .saturating_add(calculate_message_deposit::()) + .saturating_add(calculate_deposit_of::>()); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; @@ -360,7 +361,8 @@ pub mod pallet { let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, - ).saturating_add(calculate_message_deposit::()); + ) + .saturating_add(calculate_message_deposit::()); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; From 22776ca7d1da7ca347148a53e144cbb37b1b0fdc Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 10 Mar 2025 12:30:57 +0000 Subject: [PATCH 22/38] fix storage deposit --- pallets/api/src/messaging/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index dbe0b1264..e346bb605 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -360,7 +360,7 @@ pub mod pallet { ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); let deposit = calculate_protocol_deposit::( - ProtocolStorageDeposit::IsmpRequests, + ProtocolStorageDeposit::XcmQueries, ) .saturating_add(calculate_message_deposit::()); From 3f07f3c386e897283fb385e686345901dc2069fa Mon Sep 17 00:00:00 2001 From: f-gate Date: Tue, 11 Mar 2025 15:22:57 +0000 Subject: [PATCH 23/38] use ok_or --- pallets/api/src/messaging/mod.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index e346bb605..532e28587 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -456,10 +456,7 @@ pub mod pallet { let origin = ensure_signed(origin)?; for id in &messages { - let Some(message) = Messages::::get(&origin, id) else { - return Err(Error::::MessageNotFound.into()); - }; - + let message = Messages::::get(&origin, id).ok_or(Error::::MessageNotFound)?; message.try_remove(&origin, id).and_then(|_| message.release_deposit(&origin))?; } From 1f01c3af2c9a14da73b1f7d692bf9c7f7d1327e4 Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 17 Mar 2025 13:08:16 +0000 Subject: [PATCH 24/38] fix --- pallets/api/src/lib.rs | 1 - pallets/api/src/messaging/mod.rs | 14 ++++---------- runtime/devnet/src/config/mod.rs | 1 - 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/pallets/api/src/lib.rs b/pallets/api/src/lib.rs index f70dd102d..235d29325 100644 --- a/pallets/api/src/lib.rs +++ b/pallets/api/src/lib.rs @@ -9,7 +9,6 @@ pub mod messaging; #[cfg(test)] mod mock; pub mod nonfungibles; -pub mod messaging; /// Trait for performing reads of runtime state. pub trait Read { diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index e7824d00a..018b3c699 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -1,8 +1,3 @@ -<<<<<<< HEAD -//! TODO: pallet docs. - -======= ->>>>>>> 3f07f3c386e897283fb385e686345901dc2069fa use codec::{Decode, Encode}; use frame_support::{ dispatch::{DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, @@ -42,20 +37,19 @@ use deposits::*; #[cfg(test)] mod tests; -type AccountIdOf = ::AccountId; -type BlockNumberOf = BlockNumberFor; -type BalanceOf = <::Deposit as Inspect>>::Balance; +pub(crate) type AccountIdOf = ::AccountId; +pub(crate) type BlockNumberOf = BlockNumberFor; +pub(crate) type BalanceOf = <::Deposit as Inspect>>::Balance; pub type MessageId = [u8; 32]; #[frame_support::pallet] pub mod pallet { use frame_support::{ - dispatch::DispatchResult, pallet_prelude::*, storage::KeyLenOf, traits::tokens::{fungible::hold::Mutate, Precision::Exact}, - dispatch::DispatchResult, pallet_prelude::*, traits::tokens::fungible::hold::Mutate, + dispatch::DispatchResult, pallet_prelude::*, }; use sp_core::H256; use sp_runtime::traits::TryConvert; diff --git a/runtime/devnet/src/config/mod.rs b/runtime/devnet/src/config/mod.rs index 9fa4d2e01..5368f72d1 100644 --- a/runtime/devnet/src/config/mod.rs +++ b/runtime/devnet/src/config/mod.rs @@ -5,6 +5,5 @@ mod contracts; mod ismp; mod proxy; // Public due to integration tests crate. -mod revive; pub mod xcm; mod revive; From 8ceb523a2c37594b28fe5489a9e8941be96d5c5d Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 17 Mar 2025 14:09:19 +0000 Subject: [PATCH 25/38] fix --- runtime/mainnet/src/apis.rs | 4 ++-- runtime/testnet/src/config/api/mod.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/mainnet/src/apis.rs b/runtime/mainnet/src/apis.rs index 551d93384..37daa04fa 100644 --- a/runtime/mainnet/src/apis.rs +++ b/runtime/mainnet/src/apis.rs @@ -362,8 +362,8 @@ impl_runtime_apis! { } impl xcm_runtime_apis::dry_run::DryRunApi for Runtime { - fn dry_run_call(origin: OriginCaller, call: RuntimeCall) -> Result, XcmDryRunApiError> { - PolkadotXcm::dry_run_call::(origin, call) + fn dry_run_call(origin: OriginCaller, call: RuntimeCall, xcm_version: xcm::Version) -> Result, XcmDryRunApiError> { + PolkadotXcm::dry_run_call::(origin, call, xcm_version) } fn dry_run_xcm(origin_location: VersionedLocation, xcm: VersionedXcm) -> Result, XcmDryRunApiError> { diff --git a/runtime/testnet/src/config/api/mod.rs b/runtime/testnet/src/config/api/mod.rs index 6394cbf8a..084e77f0e 100644 --- a/runtime/testnet/src/config/api/mod.rs +++ b/runtime/testnet/src/config/api/mod.rs @@ -297,7 +297,7 @@ impl Contains for Filter { let contain_messaging: bool = { use messaging::Read::*; - matches!(r, RuntimeRead::Messaging(Poll(..) | Get(..) | QueryId(..))) + matches!(r, RuntimeRead::Messaging(PollStatus(..) | GetResponse(..) | QueryId(..))) }; contain_fungibles | contain_messaging From 83bd4cb6a9ce020c1e07e9ca7bbdf6796c17f17c Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:08:32 +0000 Subject: [PATCH 26/38] Messaging: XCM (#501) * messaging mock impl * query status refactor, fix stuck deposits, write first test * remove tests 1 * refactor remove extrinsic for better testing * second refactor, much better * fmt * fmt, fixes, test, benchmark * refactor storage deposits * check warnings * fmt * Off chain and on chain byte fees * fmt * comments * remove useless test * fmt * fix * moar tests * xcm-new-query benchmark * fmt * refactor response status * xcm timeouts * refactor to original format * fix tests * tests * moar tests, hooks, xcm_response * fmt * xcm_response benchmark * fmt * fix * fmt * lock * comments * fmt --- Cargo.lock | 1942 ++++++------------ Cargo.toml | 2 +- pallets/api/Cargo.toml | 4 +- pallets/api/src/messaging/benchmarking.rs | 83 +- pallets/api/src/messaging/mod.rs | 354 ++-- pallets/api/src/messaging/tests.rs | 797 ++++--- pallets/api/src/messaging/transports/ismp.rs | 13 +- pallets/api/src/messaging/transports/xcm.rs | 2 + pallets/api/src/mock.rs | 77 +- runtime/devnet/src/config/api/mod.rs | 14 +- runtime/devnet/src/config/ismp.rs | 2 +- runtime/devnet/src/config/mod.rs | 2 +- runtime/testnet/src/apis.rs | 3 +- runtime/testnet/src/config/api/mod.rs | 23 +- 14 files changed, 1470 insertions(+), 1848 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b95122d3..930244e9d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -343,12 +343,6 @@ version = "6.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5d5dde061bd34119e902bbb2d9b90c5692635cf59fb91d582c2b68043f1b8293" -[[package]] -name = "array-init" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d62b7694a562cdf5a74227903507c56ab2cc8bdd1f781ed5cb4cf9c9f810bfc" - [[package]] name = "arrayref" version = "0.3.9" @@ -1051,9 +1045,9 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d7132 dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "staging-xcm 15.0.1", + "staging-xcm", ] [[package]] @@ -1522,26 +1516,6 @@ dependencies = [ "tiny-keccak", ] -[[package]] -name = "const_env" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9e4f72c6e3398ca6da372abd9affd8f89781fe728869bbf986206e9af9627e" -dependencies = [ - "const_env_impl", -] - -[[package]] -name = "const_env_impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a4f51209740b5e1589e702b3044cdd4562cef41b6da404904192ffffb852d62" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "const_format" version = "0.2.34" @@ -1940,7 +1914,7 @@ dependencies = [ "sc-client-api", "sc-service", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "url", ] @@ -1963,7 +1937,7 @@ dependencies = [ "sc-client-api", "sp-api", "sp-consensus", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "tracing", ] @@ -2003,11 +1977,11 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-aura", - "sp-core 35.0.0", + "sp-core", "sp-inherents", - "sp-keystore 0.41.0", + "sp-keystore", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", "sp-timestamp", "substrate-prometheus-endpoint", "tokio", @@ -2035,10 +2009,10 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "sp-timestamp", - "sp-trie 38.0.0", + "sp-trie", "sp-version", "substrate-prometheus-endpoint", "tracing", @@ -2055,7 +2029,7 @@ dependencies = [ "sp-consensus", "sp-inherents", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", "thiserror 1.0.69", ] @@ -2078,9 +2052,9 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", "sp-version", "tracing", ] @@ -2101,9 +2075,9 @@ dependencies = [ "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-inherents", "sp-runtime", - "sp-state-machine 0.44.0", - "sp-storage 22.0.0", - "sp-trie 38.0.0", + "sp-state-machine", + "sp-storage", + "sp-trie", "tracing", ] @@ -2164,8 +2138,8 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", "sp-transaction-pool", ] @@ -2209,16 +2183,16 @@ dependencies = [ "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", - "sp-core 35.0.0", - "sp-externalities 0.30.0", + "sp-core", + "sp-externalities", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-runtime", - "sp-state-machine 0.44.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-trie 38.0.0", + "sp-state-machine", + "sp-std", + "sp-trie", "sp-version", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "trie-db", ] @@ -2257,9 +2231,9 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-io 39.0.0", + "sp-io", "sp-runtime", - "staging-xcm 15.0.1", + "staging-xcm", ] [[package]] @@ -2279,10 +2253,10 @@ dependencies = [ "polkadot-runtime-common", "polkadot-runtime-parachains", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", ] @@ -2308,8 +2282,8 @@ dependencies = [ "scale-info", "sp-api", "sp-runtime", - "sp-trie 38.0.0", - "staging-xcm 15.0.1", + "sp-trie", + "staging-xcm", ] [[package]] @@ -2321,9 +2295,9 @@ dependencies = [ "cumulus-primitives-core", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", + "sp-core", "sp-inherents", - "sp-trie 38.0.0", + "sp-trie", ] [[package]] @@ -2331,9 +2305,9 @@ name = "cumulus-primitives-proof-size-hostfunction" version = "0.11.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ - "sp-externalities 0.30.0", - "sp-runtime-interface 29.0.0", - "sp-trie 38.0.0", + "sp-externalities", + "sp-runtime-interface", + "sp-trie", ] [[package]] @@ -2365,7 +2339,7 @@ dependencies = [ "parity-scale-codec", "polkadot-runtime-common", "sp-runtime", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", ] @@ -2389,9 +2363,9 @@ dependencies = [ "sc-tracing", "sp-api", "sp-consensus", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", ] [[package]] @@ -2402,13 +2376,13 @@ dependencies = [ "async-trait", "cumulus-primitives-core", "futures", - "jsonrpsee-core 0.24.8", + "jsonrpsee-core 0.24.9", "parity-scale-codec", "polkadot-overseer", "sc-client-api", "sp-api", "sp-blockchain", - "sp-state-machine 0.44.0", + "sp-state-machine", "sp-version", "thiserror 1.0.69", ] @@ -2459,7 +2433,7 @@ dependencies = [ "either", "futures", "futures-timer", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "parity-scale-codec", "pin-project", "polkadot-overseer", @@ -2476,10 +2450,10 @@ dependencies = [ "sp-api", "sp-authority-discovery", "sp-consensus-babe", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "sp-state-machine 0.44.0", - "sp-storage 22.0.0", + "sp-state-machine", + "sp-storage", "sp-version", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -2498,8 +2472,8 @@ dependencies = [ "parity-scale-codec", "polkadot-primitives", "sp-runtime", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", + "sp-state-machine", + "sp-trie", ] [[package]] @@ -2750,9 +2724,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", "serde", @@ -3578,11 +3552,11 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "sp-runtime-interface 29.0.0", - "sp-storage 22.0.0", + "sp-runtime-interface", + "sp-storage", "static_assertions", ] @@ -3626,22 +3600,22 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-database", - "sp-externalities 0.30.0", + "sp-externalities", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", - "sp-keystore 0.41.0", + "sp-io", + "sp-keystore", "sp-runtime", - "sp-state-machine 0.44.0", - "sp-storage 22.0.0", + "sp-state-machine", + "sp-storage", "sp-timestamp", "sp-transaction-pool", - "sp-trie 38.0.0", + "sp-trie", "sp-version", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-wasm-interface", "subxt", "subxt-signer", "thiserror 1.0.69", @@ -3669,8 +3643,8 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", + "sp-arithmetic", + "sp-core", "sp-npos-elections", "sp-runtime", ] @@ -3687,10 +3661,10 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-tracing", ] [[package]] @@ -3768,21 +3742,21 @@ dependencies = [ "serde_json", "smallvec", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", + "sp-arithmetic", + "sp-core", "sp-crypto-hashing-proc-macro", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-debug-derive", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-metadata-ir", "sp-runtime", "sp-staking", - "sp-state-machine 0.44.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-trie 38.0.0", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-state-machine", + "sp-std", + "sp-tracing", + "sp-trie", + "sp-weights", "static_assertions", "tt-call", ] @@ -3841,12 +3815,12 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-std", "sp-version", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-weights", ] [[package]] @@ -3859,7 +3833,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] @@ -4119,14 +4093,14 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -5073,208 +5047,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" -[[package]] -name = "ink" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d7438a13d38fa8f4eebea8d1e7c2931058eafd0336c79f4141d4ed0162a412" -dependencies = [ - "derive_more 1.0.0", - "ink_env", - "ink_macro", - "ink_metadata", - "ink_prelude", - "ink_primitives", - "ink_storage", - "pallet-contracts-uapi 9.0.0", - "parity-scale-codec", - "scale-info", - "staging-xcm 11.0.0", -] - -[[package]] -name = "ink_allocator" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ec348ce75d284bc2e698187dc01da416a52dfa2d685e2a57d04e9e580447df0" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ink_codegen" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2238f147295746f1fee4cf7dcdee6378c94e61fbf7b9f9f4bb2a7f918530801b" -dependencies = [ - "blake2 0.10.6", - "derive_more 1.0.0", - "either", - "heck 0.5.0", - "impl-serde 0.4.0", - "ink_ir", - "ink_primitives", - "itertools 0.12.1", - "parity-scale-codec", - "proc-macro2", - "quote", - "serde", - "serde_json", - "syn 2.0.100", -] - -[[package]] -name = "ink_engine" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273f2aa983d04a6476d3c5ac76ddbef07555664b88f923996e7465e261dda48" -dependencies = [ - "blake2 0.10.6", - "derive_more 1.0.0", - "ink_primitives", - "pallet-contracts-uapi 9.0.0", - "parity-scale-codec", - "secp256k1 0.28.2", - "sha2 0.10.8", - "sha3", -] - -[[package]] -name = "ink_env" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9ee6089a1836c2e92d00be97d42308b7fb2c2b51ff6150b1130166a58107092" -dependencies = [ - "blake2 0.10.6", - "cfg-if", - "const_env", - "derive_more 1.0.0", - "ink_allocator", - "ink_engine", - "ink_prelude", - "ink_primitives", - "ink_storage_traits", - "num-traits", - "pallet-contracts-uapi 9.0.0", - "parity-scale-codec", - "paste", - "rlibc", - "scale-decode 0.11.1", - "scale-encode 0.6.0", - "scale-info", - "schnorrkel 0.11.4", - "secp256k1 0.28.2", - "sha2 0.10.8", - "sha3", - "staging-xcm 11.0.0", - "static_assertions", -] - -[[package]] -name = "ink_ir" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e201688fb27ff97496a4231a393dd4befcc5a9c092d6bf231f0f5d409ef44f34" -dependencies = [ - "blake2 0.10.6", - "either", - "impl-serde 0.4.0", - "ink_prelude", - "itertools 0.12.1", - "proc-macro2", - "quote", - "syn 2.0.100", -] - -[[package]] -name = "ink_macro" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce9465553d3066a8e28bd94a94880289084c4ff12f1852312553e902fa1ffdd" -dependencies = [ - "ink_codegen", - "ink_ir", - "ink_primitives", - "parity-scale-codec", - "proc-macro2", - "quote", - "syn 2.0.100", - "synstructure 0.13.1", -] - -[[package]] -name = "ink_metadata" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27135c651274087ba0578d2c07866c31d8dd481ae8de5bb7295fe3931491aa80" -dependencies = [ - "derive_more 1.0.0", - "impl-serde 0.4.0", - "ink_prelude", - "ink_primitives", - "linkme", - "parity-scale-codec", - "scale-info", - "schemars", - "serde", -] - -[[package]] -name = "ink_prelude" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b29c9b7f686f4305f523bca5e2ae6f22a09531ec2bf0a9498cdc877959f70ad0" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "ink_primitives" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a530c1b352a53176ea718f3a65f15003e54e0474ec12353ea0e0e5bb60b25741" -dependencies = [ - "derive_more 1.0.0", - "ink_prelude", - "parity-scale-codec", - "scale-decode 0.11.1", - "scale-encode 0.6.0", - "scale-info", - "xxhash-rust", -] - -[[package]] -name = "ink_storage" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bed602a974481b194084b93957917f27e724c7561fd0de9b6f3c171590c839b" -dependencies = [ - "array-init", - "cfg-if", - "derive_more 1.0.0", - "ink_env", - "ink_metadata", - "ink_prelude", - "ink_primitives", - "ink_storage_traits", - "pallet-contracts-uapi 9.0.0", - "parity-scale-codec", - "scale-info", -] - -[[package]] -name = "ink_storage_traits" -version = "5.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde9b3f4a1e355682e5d13fd5639e5da4d0a2029537292e05a4255ea1169663e" -dependencies = [ - "ink_metadata", - "ink_prelude", - "ink_primitives", - "parity-scale-codec", - "scale-info", -] - [[package]] name = "inout" version = "0.1.4" @@ -5399,9 +5171,9 @@ dependencies = [ "serde", "sp-consensus-aura", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-runtime", - "sp-trie 38.0.0", + "sp-trie", "substrate-state-machine", ] @@ -5515,6 +5287,22 @@ dependencies = [ "walkdir", ] +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror 1.0.69", + "walkdir", + "windows-sys 0.45.0", +] + [[package]] name = "jni-sys" version = "0.3.0" @@ -5565,18 +5353,18 @@ dependencies = [ [[package]] name = "jsonrpsee" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "834af00800e962dee8f7bfc0f60601de215e73e78e5497d733a2919da837d3c8" +checksum = "37b26c20e2178756451cfeb0661fb74c47dd5988cb7e3939de7e9241fd604d42" dependencies = [ - "jsonrpsee-client-transport 0.24.8", - "jsonrpsee-core 0.24.8", - "jsonrpsee-http-client 0.24.8", + "jsonrpsee-client-transport 0.24.9", + "jsonrpsee-core 0.24.9", + "jsonrpsee-http-client 0.24.9", "jsonrpsee-proc-macros", "jsonrpsee-server", - "jsonrpsee-types 0.24.8", + "jsonrpsee-types 0.24.9", "jsonrpsee-wasm-client", - "jsonrpsee-ws-client 0.24.8", + "jsonrpsee-ws-client 0.24.9", "tokio", "tracing", ] @@ -5615,7 +5403,7 @@ dependencies = [ "pin-project", "rustls 0.23.25", "rustls-pki-types", - "rustls-platform-verifier", + "rustls-platform-verifier 0.3.4", "soketto 0.8.1", "thiserror 1.0.69", "tokio", @@ -5627,20 +5415,20 @@ dependencies = [ [[package]] name = "jsonrpsee-client-transport" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def0fd41e2f53118bd1620478d12305b2c75feef57ea1f93ef70568c98081b7e" +checksum = "bacb85abf4117092455e1573625e21b8f8ef4dec8aff13361140b2dc266cdff2" dependencies = [ "base64 0.22.1", "futures-channel", "futures-util", "gloo-net", "http 1.3.1", - "jsonrpsee-core 0.24.8", + "jsonrpsee-core 0.24.9", "pin-project", "rustls 0.23.25", "rustls-pki-types", - "rustls-platform-verifier", + "rustls-platform-verifier 0.5.1", "soketto 0.8.1", "thiserror 1.0.69", "tokio", @@ -5697,9 +5485,9 @@ dependencies = [ [[package]] name = "jsonrpsee-core" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76637f6294b04e747d68e69336ef839a3493ca62b35bf488ead525f7da75c5bb" +checksum = "456196007ca3a14db478346f58c7238028d55ee15c1df15115596e411ff27925" dependencies = [ "async-trait", "bytes", @@ -5708,7 +5496,7 @@ dependencies = [ "http 1.3.1", "http-body 1.0.1", "http-body-util", - "jsonrpsee-types 0.24.8", + "jsonrpsee-types 0.24.9", "parking_lot 0.12.3", "pin-project", "rand 0.8.5", @@ -5744,9 +5532,9 @@ dependencies = [ [[package]] name = "jsonrpsee-http-client" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c24e981ad17798bbca852b0738bfb7b94816ed687bd0d5da60bfa35fa0fdc3" +checksum = "c872b6c9961a4ccc543e321bb5b89f6b2d2c7fe8b61906918273a3333c95400c" dependencies = [ "async-trait", "base64 0.22.1", @@ -5754,10 +5542,10 @@ dependencies = [ "hyper 1.6.0", "hyper-rustls 0.27.5", "hyper-util", - "jsonrpsee-core 0.24.8", - "jsonrpsee-types 0.24.8", + "jsonrpsee-core 0.24.9", + "jsonrpsee-types 0.24.9", "rustls 0.23.25", - "rustls-platform-verifier", + "rustls-platform-verifier 0.5.1", "serde", "serde_json", "thiserror 1.0.69", @@ -5769,9 +5557,9 @@ dependencies = [ [[package]] name = "jsonrpsee-proc-macros" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcae0c6c159e11541080f1f829873d8f374f81eda0abc67695a13fc8dc1a580" +checksum = "5e65763c942dfc9358146571911b0cd1c361c2d63e2d2305622d40d36376ca80" dependencies = [ "heck 0.5.0", "proc-macro-crate 3.3.0", @@ -5782,9 +5570,9 @@ dependencies = [ [[package]] name = "jsonrpsee-server" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b7a3df90a1a60c3ed68e7ca63916b53e9afa928e33531e87f61a9c8e9ae87b" +checksum = "55e363146da18e50ad2b51a0a7925fc423137a0b1371af8235b1c231a0647328" dependencies = [ "futures-util", "http 1.3.1", @@ -5792,8 +5580,8 @@ dependencies = [ "http-body-util", "hyper 1.6.0", "hyper-util", - "jsonrpsee-core 0.24.8", - "jsonrpsee-types 0.24.8", + "jsonrpsee-core 0.24.9", + "jsonrpsee-types 0.24.9", "pin-project", "route-recognizer", "serde", @@ -5835,9 +5623,9 @@ dependencies = [ [[package]] name = "jsonrpsee-types" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddb81adb1a5ae9182df379e374a79e24e992334e7346af4d065ae5b2acb8d4c6" +checksum = "08a8e70baf945b6b5752fc8eb38c918a48f1234daf11355e07106d963f860089" dependencies = [ "http 1.3.1", "serde", @@ -5847,13 +5635,13 @@ dependencies = [ [[package]] name = "jsonrpsee-wasm-client" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42e41af42ca39657313748174d02766e5287d3a57356f16756dbd8065b933977" +checksum = "e6558a9586cad43019dafd0b6311d0938f46efc116b34b28c74778bc11a2edf6" dependencies = [ - "jsonrpsee-client-transport 0.24.8", - "jsonrpsee-core 0.24.8", - "jsonrpsee-types 0.24.8", + "jsonrpsee-client-transport 0.24.9", + "jsonrpsee-core 0.24.9", + "jsonrpsee-types 0.24.9", ] [[package]] @@ -5871,14 +5659,14 @@ dependencies = [ [[package]] name = "jsonrpsee-ws-client" -version = "0.24.8" +version = "0.24.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f4f3642a292f5b76d8a16af5c88c16a0860f2ccc778104e5c848b28183d9538" +checksum = "01b3323d890aa384f12148e8d2a1fd18eb66e9e7e825f9de4fa53bcc19b93eef" dependencies = [ "http 1.3.1", - "jsonrpsee-client-transport 0.24.8", - "jsonrpsee-core 0.24.8", - "jsonrpsee-types 0.24.8", + "jsonrpsee-client-transport 0.24.9", + "jsonrpsee-core 0.24.9", + "jsonrpsee-types 0.24.9", "url", ] @@ -6548,26 +6336,6 @@ dependencies = [ "linked-hash-map", ] -[[package]] -name = "linkme" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22d227772b5999ddc0690e733f734f95ca05387e329c4084fe65678c51198ffe" -dependencies = [ - "linkme-impl", -] - -[[package]] -name = "linkme-impl" -version = "0.3.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a98813fa0073a317ed6a8055dcd4722a49d9b862af828ee68449adb799b6be" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "linregress" version = "0.5.4" @@ -6872,7 +6640,7 @@ dependencies = [ "blake3", "frame-metadata 18.0.0", "parity-scale-codec", - "scale-decode 0.13.1", + "scale-decode", "scale-info", ] @@ -6954,7 +6722,7 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-beefy", - "sp-core 35.0.0", + "sp-core", "sp-mmr-primitives", "sp-runtime", ] @@ -6964,12 +6732,12 @@ name = "mmr-rpc" version = "39.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "parity-scale-codec", "serde", "sp-api", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-mmr-primitives", "sp-runtime", ] @@ -7582,11 +7350,11 @@ dependencies = [ "parity-scale-codec", "pop-chain-extension", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-std", + "staging-xcm", "staging-xcm-builder", ] @@ -7602,9 +7370,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-runtime", ] @@ -7618,7 +7386,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] @@ -7634,8 +7402,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -7651,7 +7419,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] @@ -7715,8 +7483,8 @@ dependencies = [ "scale-info", "sp-application-crypto", "sp-consensus-babe", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", "sp-session", "sp-staking", @@ -7737,10 +7505,10 @@ dependencies = [ "pallet-balances", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-tracing", ] [[package]] @@ -7796,10 +7564,10 @@ dependencies = [ "serde", "sp-api", "sp-consensus-beefy", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", ] [[package]] @@ -7814,8 +7582,8 @@ dependencies = [ "pallet-treasury", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -7832,8 +7600,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", + "sp-arithmetic", + "sp-core", "sp-runtime", ] @@ -7850,8 +7618,8 @@ dependencies = [ "pallet-treasury", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -7886,8 +7654,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -7905,7 +7673,7 @@ dependencies = [ "log", "pallet-balances", "pallet-contracts-proc-macro", - "pallet-contracts-uapi 12.0.1", + "pallet-contracts-uapi", "parity-scale-codec", "paste", "rand 0.8.5", @@ -7914,11 +7682,11 @@ dependencies = [ "serde", "smallvec", "sp-api", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-std", + "staging-xcm", "staging-xcm-builder", "wasm-instrument", "wasmi 0.32.3", @@ -7934,17 +7702,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "pallet-contracts-uapi" -version = "9.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7a51646d9ff1d91abd0186d2c074f0dfd3b1a2d55f08a229a2f2e4bc6d1e49" -dependencies = [ - "bitflags 1.3.2", - "paste", - "polkavm-derive 0.9.1", -] - [[package]] name = "pallet-contracts-uapi" version = "12.0.1" @@ -7968,7 +7725,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-io 39.0.0", + "sp-io", "sp-runtime", ] @@ -7982,7 +7739,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-io 39.0.0", + "sp-io", "sp-runtime", "sp-staking", ] @@ -7999,8 +7756,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8018,9 +7775,9 @@ dependencies = [ "parity-scale-codec", "rand 0.8.5", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-npos-elections", "sp-runtime", "strum 0.26.3", @@ -8050,8 +7807,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-npos-elections", "sp-runtime", "sp-staking", @@ -8070,7 +7827,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-io 39.0.0", + "sp-io", "sp-runtime", "sp-staking", ] @@ -8090,8 +7847,8 @@ dependencies = [ "scale-info", "sp-application-crypto", "sp-consensus-grandpa", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", "sp-session", "sp-staking", @@ -8109,7 +7866,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-io 39.0.0", + "sp-io", "sp-runtime", ] @@ -8126,8 +7883,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-application-crypto", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", "sp-staking", ] @@ -8142,8 +7899,8 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-keyring", "sp-runtime", ] @@ -8164,11 +7921,11 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-mmr-primitives", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-std", ] [[package]] @@ -8182,7 +7939,7 @@ dependencies = [ "hex", "hex-literal", "ismp", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "pallet-ismp", "pallet-ismp-runtime-api", "parity-scale-codec", @@ -8192,11 +7949,11 @@ dependencies = [ "serde_json", "sp-api", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-mmr-primitives", "sp-runtime", - "sp-storage 22.0.0", - "sp-trie 38.0.0", + "sp-storage", + "sp-trie", "tower", "trie-db", ] @@ -8226,8 +7983,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8243,11 +8000,11 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-weights", ] [[package]] @@ -8264,7 +8021,7 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] @@ -8279,8 +8036,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-mmr-primitives", "sp-runtime", ] @@ -8297,8 +8054,8 @@ dependencies = [ "pallet-collective", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8341,9 +8098,9 @@ dependencies = [ "pallet-balances", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-io", + "sp-keystore", "sp-runtime", ] @@ -8359,8 +8116,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8384,8 +8141,8 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", + "sp-arithmetic", + "sp-core", "sp-runtime", ] @@ -8400,11 +8157,11 @@ dependencies = [ "pallet-balances", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", "sp-staking", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-tracing", ] [[package]] @@ -8423,7 +8180,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-runtime", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface", "sp-staking", ] @@ -8489,7 +8246,7 @@ dependencies = [ "paste", "scale-info", "serde", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] @@ -8504,8 +8261,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8531,9 +8288,9 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8547,7 +8304,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-io 39.0.0", + "sp-io", "sp-runtime", ] @@ -8564,8 +8321,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-io", "sp-runtime", ] @@ -8583,7 +8340,7 @@ dependencies = [ "frame-system", "hex", "impl-trait-for-tuples", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "pallet-balances", "pallet-revive-proc-macro", @@ -8596,13 +8353,13 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-std", + "sp-weights", + "staging-xcm", "staging-xcm-builder", "subxt-signer", ] @@ -8638,8 +8395,8 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8655,9 +8412,9 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-io 39.0.0", + "sp-io", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-weights", ] [[package]] @@ -8672,13 +8429,13 @@ dependencies = [ "pallet-timestamp", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", "sp-session", "sp-staking", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", + "sp-state-machine", + "sp-trie", ] [[package]] @@ -8709,8 +8466,8 @@ dependencies = [ "parity-scale-codec", "rand_chacha 0.3.1", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-io", "sp-runtime", ] @@ -8731,7 +8488,7 @@ dependencies = [ "scale-info", "serde", "sp-application-crypto", - "sp-io 39.0.0", + "sp-io", "sp-runtime", "sp-staking", ] @@ -8742,7 +8499,7 @@ version = "22.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ "log", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", ] [[package]] @@ -8766,8 +8523,8 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8782,7 +8539,7 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-io 39.0.0", + "sp-io", "sp-runtime", ] @@ -8799,9 +8556,9 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-runtime", - "sp-storage 22.0.0", + "sp-storage", "sp-timestamp", ] @@ -8818,8 +8575,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8834,8 +8591,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8844,15 +8601,15 @@ name = "pallet-transaction-payment-rpc" version = "42.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "pallet-transaction-payment-rpc-runtime-api", "parity-scale-codec", "sp-api", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-rpc", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-weights", ] [[package]] @@ -8864,7 +8621,7 @@ dependencies = [ "parity-scale-codec", "sp-api", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-weights", ] [[package]] @@ -8882,7 +8639,7 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] @@ -8896,8 +8653,8 @@ dependencies = [ "frame-system", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", ] @@ -8942,10 +8699,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "tracing", @@ -8963,9 +8720,9 @@ dependencies = [ "log", "parity-scale-codec", "scale-info", - "sp-io 39.0.0", + "sp-io", "sp-runtime", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", ] @@ -8991,11 +8748,11 @@ dependencies = [ "polkadot-primitives", "scale-info", "sp-consensus-aura", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", "staging-parachain-info", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-executor", "substrate-wasm-builder", ] @@ -9354,8 +9111,8 @@ dependencies = [ "rand 0.8.5", "sc-network", "schnellru", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "thiserror 1.0.69", "tracing-gum", ] @@ -9412,8 +9169,8 @@ dependencies = [ "sc-storage-monitor", "sc-sysinfo", "sc-tracing", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-keyring", "sp-maybe-compressed-blob", "sp-runtime", @@ -9436,8 +9193,8 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "schnellru", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "sp-runtime", "thiserror 1.0.69", "tokio-util", @@ -9451,7 +9208,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d7132 dependencies = [ "parity-scale-codec", "scale-info", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] @@ -9475,7 +9232,7 @@ dependencies = [ "sc-network", "schnellru", "sp-application-crypto", - "sp-keystore 0.41.0", + "sp-keystore", "thiserror 1.0.69", "tracing-gum", ] @@ -9489,8 +9246,8 @@ dependencies = [ "polkadot-node-primitives", "polkadot-primitives", "reed-solomon-novelpoly", - "sp-core 35.0.0", - "sp-trie 38.0.0", + "sp-core", + "sp-trie", "thiserror 1.0.69", ] @@ -9510,9 +9267,9 @@ dependencies = [ "sc-network", "sc-network-common", "sp-application-crypto", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-keystore 0.41.0", + "sp-keystore", "tracing-gum", ] @@ -9552,7 +9309,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-primitives", "schnellru", - "sp-core 35.0.0", + "sp-core", "sp-maybe-compressed-blob", "thiserror 1.0.69", "tracing-gum", @@ -9658,7 +9415,7 @@ dependencies = [ "polkadot-primitives", "polkadot-statement-table", "schnellru", - "sp-keystore 0.41.0", + "sp-keystore", "thiserror 1.0.69", "tracing-gum", ] @@ -9672,7 +9429,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-keystore 0.41.0", + "sp-keystore", "thiserror 1.0.69", "tracing-gum", "wasm-timer", @@ -9696,7 +9453,7 @@ dependencies = [ "polkadot-parachain-primitives", "polkadot-primitives", "sp-application-crypto", - "sp-keystore 0.41.0", + "sp-keystore", "tracing-gum", ] @@ -9821,7 +9578,7 @@ dependencies = [ "polkadot-primitives", "rand 0.8.5", "slotmap", - "sp-core 35.0.0", + "sp-core", "strum 0.26.3", "tempfile", "thiserror 1.0.69", @@ -9840,7 +9597,7 @@ dependencies = [ "polkadot-node-subsystem-util", "polkadot-overseer", "polkadot-primitives", - "sp-keystore 0.41.0", + "sp-keystore", "thiserror 1.0.69", "tracing-gum", ] @@ -9862,11 +9619,11 @@ dependencies = [ "sc-executor-common", "sc-executor-wasmtime", "seccompiler", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-externalities 0.30.0", - "sp-io 39.0.0", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-externalities", + "sp-io", + "sp-tracing", "thiserror 1.0.69", "tracing-gum", ] @@ -9948,8 +9705,8 @@ dependencies = [ "sp-application-crypto", "sp-consensus-babe", "sp-consensus-slots", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "sp-maybe-compressed-blob", "sp-runtime", "thiserror 1.0.69", @@ -10023,8 +9780,8 @@ dependencies = [ "sc-client-api", "schnellru", "sp-application-crypto", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "thiserror 1.0.69", "tracing-gum", ] @@ -10046,7 +9803,7 @@ dependencies = [ "polkadot-primitives", "sc-client-api", "sp-api", - "sp-core 35.0.0", + "sp-core", "tikv-jemalloc-ctl", "tracing-gum", ] @@ -10062,9 +9819,9 @@ dependencies = [ "polkadot-core-primitives", "scale-info", "serde", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-weights", ] [[package]] @@ -10082,16 +9839,16 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-authority-discovery", "sp-consensus-slots", - "sp-core 35.0.0", + "sp-core", "sp-inherents", - "sp-io 39.0.0", - "sp-keystore 0.41.0", + "sp-io", + "sp-keystore", "sp-runtime", "sp-staking", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-std", "thiserror 1.0.69", ] @@ -10100,7 +9857,7 @@ name = "polkadot-rpc" version = "22.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "mmr-rpc", "pallet-transaction-payment-rpc", "polkadot-primitives", @@ -10124,7 +9881,7 @@ dependencies = [ "sp-consensus", "sp-consensus-babe", "sp-consensus-beefy", - "sp-keystore 0.41.0", + "sp-keystore", "sp-runtime", "substrate-frame-rpc-system", "substrate-state-trie-migration-rpc", @@ -10167,15 +9924,15 @@ dependencies = [ "serde_derive", "slot-range-helper", "sp-api", - "sp-core 35.0.0", + "sp-core", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-keyring", "sp-npos-elections", "sp-runtime", "sp-session", "sp-staking", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "static_assertions", @@ -10190,7 +9947,7 @@ dependencies = [ "frame-benchmarking", "parity-scale-codec", "polkadot-primitives", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-tracing", ] [[package]] @@ -10228,16 +9985,16 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", + "sp-arithmetic", + "sp-core", "sp-inherents", - "sp-io 39.0.0", - "sp-keystore 0.41.0", + "sp-io", + "sp-keystore", "sp-runtime", "sp-session", "sp-staking", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-std", + "staging-xcm", "staging-xcm-executor", "static_assertions", ] @@ -10259,19 +10016,19 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-block-builder", "sp-consensus-aura", "sp-consensus-grandpa", - "sp-core 35.0.0", + "sp-core", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-keyring", "sp-offchain", "sp-runtime", "sp-session", - "sp-storage 22.0.0", + "sp-storage", "sp-transaction-pool", "sp-version", ] @@ -10363,10 +10120,10 @@ dependencies = [ "sp-consensus-babe", "sp-consensus-beefy", "sp-consensus-grandpa", - "sp-core 35.0.0", + "sp-core", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-keyring", "sp-mmr-primitives", "sp-offchain", @@ -10375,8 +10132,8 @@ dependencies = [ "sp-timestamp", "sp-transaction-pool", "sp-version", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-weights", + "staging-xcm", "substrate-prometheus-endpoint", "thiserror 1.0.69", "tracing-gum", @@ -10401,7 +10158,7 @@ dependencies = [ "polkadot-node-subsystem", "polkadot-node-subsystem-util", "polkadot-primitives", - "sp-keystore 0.41.0", + "sp-keystore", "sp-staking", "thiserror 1.0.69", "tracing-gum", @@ -10414,7 +10171,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d7132 dependencies = [ "parity-scale-codec", "polkadot-primitives", - "sp-core 35.0.0", + "sp-core", "tracing-gum", ] @@ -10630,45 +10387,6 @@ dependencies = [ "universal-hash", ] -[[package]] -name = "pop-api" -version = "0.0.0" -dependencies = [ - "bitflags 1.3.2", - "enumflags2", - "ink", - "pop-primitives", - "sp-io 38.0.0", -] - -[[package]] -name = "pop-api-integration-tests" -version = "0.1.0" -dependencies = [ - "contract-build", - "env_logger 0.11.7", - "frame-support", - "frame-system", - "ismp", - "log", - "pallet-api", - "pallet-assets", - "pallet-balances", - "pallet-contracts", - "pallet-ismp", - "pallet-nfts 31.0.0", - "pallet-xcm", - "parity-scale-codec", - "pop-api", - "pop-primitives", - "pop-runtime-devnet", - "pop-runtime-testnet", - "sp-io 39.0.0", - "sp-runtime", - "staging-xcm 15.0.1", - "staging-xcm-executor", -] - [[package]] name = "pop-chain-extension" version = "0.1.0" @@ -10685,10 +10403,10 @@ dependencies = [ "parity-scale-codec", "rand 0.8.5", "scale-info", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-std", ] [[package]] @@ -10714,7 +10432,7 @@ dependencies = [ "ismp-parachain", "ismp-parachain-inherent", "ismp-parachain-runtime-api", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "pallet-ismp-rpc", "pallet-ismp-runtime-api", @@ -10749,17 +10467,17 @@ dependencies = [ "sp-block-builder", "sp-blockchain", "sp-consensus-aura", - "sp-core 35.0.0", + "sp-core", "sp-genesis-builder", - "sp-io 39.0.0", + "sp-io", "sp-keyring", - "sp-keystore 0.41.0", + "sp-keystore", "sp-offchain", "sp-runtime", "sp-session", "sp-timestamp", "sp-transaction-pool", - "staging-xcm 15.0.1", + "staging-xcm", "substrate-build-script-utils", "substrate-frame-rpc-system", "substrate-prometheus-endpoint", @@ -10814,7 +10532,7 @@ dependencies = [ "serde_json", "sp-keyring", "sp-runtime", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", ] @@ -10887,19 +10605,19 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core 35.0.0", + "sp-core", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-mmr-primitives", "sp-offchain", "sp-runtime", "sp-session", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-std", "sp-transaction-pool", "sp-version", "staging-parachain-info", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", @@ -10966,10 +10684,10 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core 35.0.0", + "sp-core", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-keyring", "sp-offchain", "sp-runtime", @@ -10977,7 +10695,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "staging-parachain-info", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", @@ -11055,10 +10773,10 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-consensus-aura", - "sp-core 35.0.0", + "sp-core", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-mmr-primitives", "sp-offchain", "sp-runtime", @@ -11066,7 +10784,7 @@ dependencies = [ "sp-transaction-pool", "sp-version", "staging-parachain-info", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", @@ -11501,6 +11219,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -11564,7 +11288,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.2", ] [[package]] @@ -11845,12 +11569,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "rlibc" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc874b127765f014d792f16763a81245ab80500e2ad921ed4ee9e82481ee08fe" - [[package]] name = "rlp" version = "0.6.1" @@ -11946,26 +11664,26 @@ dependencies = [ "serde_json", "smallvec", "sp-api", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", "sp-consensus-beefy", "sp-consensus-grandpa", - "sp-core 35.0.0", + "sp-core", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-keyring", "sp-mmr-primitives", "sp-offchain", "sp-runtime", "sp-session", "sp-staking", - "sp-storage 22.0.0", + "sp-storage", "sp-transaction-pool", "sp-version", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "static_assertions", @@ -11982,10 +11700,10 @@ dependencies = [ "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-weights", + "staging-xcm", "staging-xcm-builder", ] @@ -12119,9 +11837,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" dependencies = [ "bitflags 2.9.0", "errno", @@ -12251,7 +11969,7 @@ checksum = "afbb878bdfdf63a336a5e63561b1835e7a8c91524f51621db870169eac84b490" dependencies = [ "core-foundation 0.9.4", "core-foundation-sys", - "jni", + "jni 0.19.0", "log", "once_cell", "rustls 0.23.25", @@ -12264,6 +11982,27 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustls-platform-verifier" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5467026f437b4cb2a533865eaa73eb840019a0916f4b9ec563c6e617e086c9" +dependencies = [ + "core-foundation 0.10.0", + "core-foundation-sys", + "jni 0.21.1", + "log", + "once_cell", + "rustls 0.23.25", + "rustls-native-certs 0.8.1", + "rustls-platform-verifier-android", + "rustls-webpki 0.103.0", + "security-framework 3.2.0", + "security-framework-sys", + "webpki-root-certs", + "windows-sys 0.59.0", +] + [[package]] name = "rustls-platform-verifier-android" version = "0.1.1" @@ -12371,8 +12110,8 @@ version = "30.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ "log", - "sp-core 35.0.0", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-core", + "sp-wasm-interface", "thiserror 1.0.69", ] @@ -12399,8 +12138,8 @@ dependencies = [ "sp-api", "sp-authority-discovery", "sp-blockchain", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -12422,7 +12161,7 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 35.0.0", + "sp-core", "sp-inherents", "sp-runtime", "substrate-prometheus-endpoint", @@ -12437,10 +12176,10 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-inherents", "sp-runtime", - "sp-trie 38.0.0", + "sp-trie", ] [[package]] @@ -12461,13 +12200,13 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-genesis-builder", - "sp-io 39.0.0", + "sp-io", "sp-runtime", - "sp-state-machine 0.44.0", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-state-machine", + "sp-tracing", ] [[package]] @@ -12513,10 +12252,10 @@ dependencies = [ "serde", "serde_json", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-keyring", - "sp-keystore 0.41.0", - "sp-panic-handler 13.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-keystore", + "sp-panic-handler", "sp-runtime", "sp-version", "thiserror 1.0.69", @@ -12539,14 +12278,14 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 35.0.0", + "sp-core", "sp-database", - "sp-externalities 0.30.0", + "sp-externalities", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", "sp-statement-store", - "sp-storage 22.0.0", - "sp-trie 38.0.0", + "sp-storage", + "sp-trie", "substrate-prometheus-endpoint", ] @@ -12567,13 +12306,13 @@ dependencies = [ "sc-client-api", "sc-state-db", "schnellru", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-database", "sp-runtime", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", + "sp-state-machine", + "sp-trie", ] [[package]] @@ -12593,9 +12332,9 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", "substrate-prometheus-endpoint", "thiserror 1.0.69", ] @@ -12621,9 +12360,9 @@ dependencies = [ "sp-consensus", "sp-consensus-aura", "sp-consensus-slots", - "sp-core 35.0.0", + "sp-core", "sp-inherents", - "sp-keystore 0.41.0", + "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -12656,10 +12395,10 @@ dependencies = [ "sp-consensus", "sp-consensus-babe", "sp-consensus-slots", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-inherents", - "sp-keystore 0.41.0", + "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -12671,7 +12410,7 @@ version = "0.48.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ "futures", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "sc-consensus-babe", "sc-consensus-epochs", "sc-rpc-api", @@ -12681,8 +12420,8 @@ dependencies = [ "sp-blockchain", "sp-consensus", "sp-consensus-babe", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "sp-runtime", "thiserror 1.0.69", ] @@ -12709,13 +12448,13 @@ dependencies = [ "sc-utils", "sp-api", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-blockchain", "sp-consensus", "sp-consensus-beefy", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-keystore 0.41.0", + "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -12729,7 +12468,7 @@ version = "27.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ "futures", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "parity-scale-codec", "parking_lot 0.12.3", @@ -12738,7 +12477,7 @@ dependencies = [ "serde", "sp-application-crypto", "sp-consensus-beefy", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "thiserror 1.0.69", ] @@ -12788,13 +12527,13 @@ dependencies = [ "serde_json", "sp-api", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-keystore 0.41.0", + "sp-keystore", "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -12807,7 +12546,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d7132 dependencies = [ "finality-grandpa", "futures", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "parity-scale-codec", "sc-client-api", @@ -12815,7 +12554,7 @@ dependencies = [ "sc-rpc", "serde", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "thiserror 1.0.69", ] @@ -12833,14 +12572,14 @@ dependencies = [ "sc-client-api", "sc-consensus", "sc-telemetry", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-blockchain", "sp-consensus", "sp-consensus-slots", - "sp-core 35.0.0", + "sp-core", "sp-inherents", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", ] [[package]] @@ -12855,14 +12594,14 @@ dependencies = [ "sc-executor-wasmtime", "schnellru", "sp-api", - "sp-core 35.0.0", - "sp-externalities 0.30.0", - "sp-io 39.0.0", - "sp-panic-handler 13.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-runtime-interface 29.0.0", - "sp-trie 38.0.0", + "sp-core", + "sp-externalities", + "sp-io", + "sp-panic-handler", + "sp-runtime-interface", + "sp-trie", "sp-version", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-wasm-interface", "tracing", ] @@ -12874,7 +12613,7 @@ dependencies = [ "polkavm 0.9.3", "sc-allocator", "sp-maybe-compressed-blob", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-wasm-interface", "thiserror 1.0.69", "wasm-instrument", ] @@ -12887,7 +12626,7 @@ dependencies = [ "log", "polkavm 0.9.3", "sc-executor-common", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-wasm-interface", ] [[package]] @@ -12903,8 +12642,8 @@ dependencies = [ "rustix 0.36.17", "sc-allocator", "sc-executor-common", - "sp-runtime-interface 29.0.0", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-runtime-interface", + "sp-wasm-interface", "wasmtime", ] @@ -12934,8 +12673,8 @@ dependencies = [ "parking_lot 0.12.3", "serde_json", "sp-application-crypto", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "thiserror 1.0.69", ] @@ -12961,8 +12700,8 @@ dependencies = [ "sc-transaction-pool-api", "sp-api", "sp-consensus", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "sp-mixnet", "sp-runtime", "thiserror 1.0.69", @@ -13005,9 +12744,9 @@ dependencies = [ "serde", "serde_json", "smallvec", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -13072,7 +12811,7 @@ dependencies = [ "sc-network", "sc-network-types", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "thiserror 1.0.69", ] @@ -13101,11 +12840,11 @@ dependencies = [ "sc-utils", "schnellru", "smallvec", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-blockchain", "sp-consensus", "sp-consensus-grandpa", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -13177,9 +12916,9 @@ dependencies = [ "sc-transaction-pool-api", "sc-utils", "sp-api", - "sp-core 35.0.0", - "sp-externalities 0.30.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-externalities", + "sp-keystore", "sp-offchain", "sp-runtime", "threadpool", @@ -13201,7 +12940,7 @@ version = "43.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ "futures", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "parity-scale-codec", "parking_lot 0.12.3", @@ -13216,8 +12955,8 @@ dependencies = [ "serde_json", "sp-api", "sp-blockchain", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "sp-offchain", "sp-rpc", "sp-runtime", @@ -13232,7 +12971,7 @@ name = "sc-rpc-api" version = "0.47.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "parity-scale-codec", "sc-chain-spec", "sc-mixnet", @@ -13240,7 +12979,7 @@ dependencies = [ "scale-info", "serde", "serde_json", - "sp-core 35.0.0", + "sp-core", "sp-rpc", "sp-runtime", "sp-version", @@ -13260,7 +12999,7 @@ dependencies = [ "http-body-util", "hyper 1.6.0", "ip_network", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "sc-rpc-api", "serde", @@ -13281,7 +13020,7 @@ dependencies = [ "futures-util", "hex", "itertools 0.11.0", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "parity-scale-codec", "parking_lot 0.12.3", @@ -13294,7 +13033,7 @@ dependencies = [ "serde", "sp-api", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-rpc", "sp-runtime", "sp-version", @@ -13313,7 +13052,7 @@ dependencies = [ "exit-future", "futures", "futures-timer", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "parity-scale-codec", "parking_lot 0.12.3", @@ -13347,16 +13086,16 @@ dependencies = [ "sp-api", "sp-blockchain", "sp-consensus", - "sp-core 35.0.0", - "sp-externalities 0.30.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-externalities", + "sp-keystore", "sp-runtime", "sp-session", - "sp-state-machine 0.44.0", - "sp-storage 22.0.0", + "sp-state-machine", + "sp-storage", "sp-transaction-pool", "sp-transaction-storage-proof", - "sp-trie 38.0.0", + "sp-trie", "sp-version", "static_init", "substrate-prometheus-endpoint", @@ -13375,7 +13114,7 @@ dependencies = [ "log", "parity-scale-codec", "parking_lot 0.12.3", - "sp-core 35.0.0", + "sp-core", ] [[package]] @@ -13386,7 +13125,7 @@ dependencies = [ "clap", "fs4", "log", - "sp-core 35.0.0", + "sp-core", "thiserror 1.0.69", "tokio", ] @@ -13396,7 +13135,7 @@ name = "sc-sync-state-rpc" version = "0.48.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "parity-scale-codec", "sc-chain-spec", "sc-client-api", @@ -13425,10 +13164,10 @@ dependencies = [ "sc-telemetry", "serde", "serde_json", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-io 39.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-io", + "sp-std", ] [[package]] @@ -13469,10 +13208,10 @@ dependencies = [ "serde", "sp-api", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-rpc", "sp-runtime", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-tracing", "thiserror 1.0.69", "tracing", "tracing-log", @@ -13510,10 +13249,10 @@ dependencies = [ "serde", "sp-api", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", "sp-runtime", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-tracing", "sp-transaction-pool", "substrate-prometheus-endpoint", "thiserror 1.0.69", @@ -13532,7 +13271,7 @@ dependencies = [ "parity-scale-codec", "serde", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-runtime", "thiserror 1.0.69", ] @@ -13548,17 +13287,7 @@ dependencies = [ "log", "parking_lot 0.12.3", "prometheus", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", -] - -[[package]] -name = "scale-bits" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662d10dcd57b1c2a3c41c9cf68f71fb09747ada1ea932ad961aca7e2ca28315f" -dependencies = [ - "parity-scale-codec", - "scale-type-resolver 0.1.1", + "sp-arithmetic", ] [[package]] @@ -13569,51 +13298,25 @@ checksum = "e57b1e7f6b65ed1f04e79a85a57d755ad56d76fdf1e9bddcc9ae14f71fcdcf54" dependencies = [ "parity-scale-codec", "scale-info", - "scale-type-resolver 0.2.0", + "scale-type-resolver", "serde", ] [[package]] name = "scale-decode" -version = "0.11.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc79ba56a1c742f5aeeed1f1801f3edf51f7e818f0a54582cac6f131364ea7b" +checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" dependencies = [ "derive_more 0.99.19", "parity-scale-codec", - "scale-bits 0.5.0", - "scale-decode-derive 0.11.1", - "scale-type-resolver 0.1.1", + "primitive-types 0.12.2", + "scale-bits", + "scale-decode-derive", + "scale-type-resolver", "smallvec", ] -[[package]] -name = "scale-decode" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98f3262c250d90e700bb802eb704e1f841e03331c2eb815e46516c4edbf5b27" -dependencies = [ - "derive_more 0.99.19", - "parity-scale-codec", - "primitive-types 0.12.2", - "scale-bits 0.6.0", - "scale-decode-derive 0.13.1", - "scale-type-resolver 0.2.0", - "smallvec", -] - -[[package]] -name = "scale-decode-derive" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5398fdb3c7bea3cb419bac4983aadacae93fe1a7b5f693f4ebd98c3821aad7a5" -dependencies = [ - "darling 0.14.4", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "scale-decode-derive" version = "0.13.1" @@ -13626,19 +13329,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "scale-encode" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628800925a33794fb5387781b883b5e14d130fece9af5a63613867b8de07c5c7" -dependencies = [ - "derive_more 0.99.19", - "parity-scale-codec", - "scale-encode-derive 0.6.0", - "scale-type-resolver 0.1.1", - "smallvec", -] - [[package]] name = "scale-encode" version = "0.7.2" @@ -13648,25 +13338,12 @@ dependencies = [ "derive_more 0.99.19", "parity-scale-codec", "primitive-types 0.12.2", - "scale-bits 0.6.0", - "scale-encode-derive 0.7.2", - "scale-type-resolver 0.2.0", + "scale-bits", + "scale-encode-derive", + "scale-type-resolver", "smallvec", ] -[[package]] -name = "scale-encode-derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a304e1af7cdfbe7a24e08b012721456cc8cecdedadc14b3d10513eada63233c" -dependencies = [ - "darling 0.14.4", - "proc-macro-crate 1.1.3", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "scale-encode-derive" version = "0.7.2" @@ -13691,7 +13368,6 @@ dependencies = [ "derive_more 1.0.0", "parity-scale-codec", "scale-info-derive", - "schemars", "serde", ] @@ -13707,15 +13383,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "scale-type-resolver" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10b800069bfd43374e0f96f653e0d46882a2cb16d6d961ac43bea80f26c76843" -dependencies = [ - "smallvec", -] - [[package]] name = "scale-type-resolver" version = "0.2.0" @@ -13751,11 +13418,11 @@ dependencies = [ "either", "frame-metadata 15.1.0", "parity-scale-codec", - "scale-bits 0.6.0", - "scale-decode 0.13.1", - "scale-encode 0.7.2", + "scale-bits", + "scale-decode", + "scale-encode", "scale-info", - "scale-type-resolver 0.2.0", + "scale-type-resolver", "serde", "yap", ] @@ -13769,30 +13436,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "schemars" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.100", -] - [[package]] name = "schnellru" version = "0.2.4" @@ -14042,17 +13685,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "serde_json" version = "1.0.140" @@ -14628,13 +14260,13 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api-proc-macro", - "sp-core 35.0.0", - "sp-externalities 0.30.0", + "sp-core", + "sp-externalities", "sp-metadata-ir", "sp-runtime", - "sp-runtime-interface 29.0.0", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", + "sp-runtime-interface", + "sp-state-machine", + "sp-trie", "sp-version", "thiserror 1.0.69", ] @@ -14661,24 +14293,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", - "sp-io 39.0.0", -] - -[[package]] -name = "sp-arithmetic" -version = "26.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46d0d0a4c591c421d3231ddd5e27d828618c24456d51445d21a1f79fcee97c23" -dependencies = [ - "docify", - "integer-sqrt", - "num-traits", - "parity-scale-codec", - "scale-info", - "serde", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "static_assertions", + "sp-core", + "sp-io", ] [[package]] @@ -14728,10 +14344,10 @@ dependencies = [ "schnellru", "sp-api", "sp-consensus", - "sp-core 35.0.0", + "sp-core", "sp-database", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", "thiserror 1.0.69", "tracing", ] @@ -14744,10 +14360,10 @@ dependencies = [ "async-trait", "futures", "log", - "sp-core 35.0.0", + "sp-core", "sp-inherents", "sp-runtime", - "sp-state-machine 0.44.0", + "sp-state-machine", "thiserror 1.0.69", ] @@ -14779,7 +14395,7 @@ dependencies = [ "sp-api", "sp-application-crypto", "sp-consensus-slots", - "sp-core 35.0.0", + "sp-core", "sp-inherents", "sp-runtime", "sp-timestamp", @@ -14795,13 +14411,13 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-io 39.0.0", - "sp-keystore 0.41.0", + "sp-io", + "sp-keystore", "sp-mmr-primitives", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-weights", "strum 0.26.3", ] @@ -14817,8 +14433,8 @@ dependencies = [ "serde", "sp-api", "sp-application-crypto", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "sp-runtime", ] @@ -14833,53 +14449,6 @@ dependencies = [ "sp-timestamp", ] -[[package]] -name = "sp-core" -version = "34.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c961a5e33fb2962fa775c044ceba43df9c6f917e2c35d63bfe23738468fa76a7" -dependencies = [ - "array-bytes", - "bitflags 1.3.2", - "blake2 0.10.6", - "bounded-collections", - "bs58", - "dyn-clonable", - "ed25519-zebra", - "futures", - "hash-db", - "hash256-std-hasher", - "impl-serde 0.4.0", - "itertools 0.11.0", - "k256", - "libsecp256k1", - "log", - "merlin", - "parity-bip39", - "parity-scale-codec", - "parking_lot 0.12.3", - "paste", - "primitive-types 0.12.2", - "rand 0.8.5", - "scale-info", - "schnorrkel 0.11.4", - "secp256k1 0.28.2", - "secrecy", - "serde", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.29.0", - "sp-runtime-interface 28.0.0", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "ss58-registry", - "substrate-bip39 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "thiserror 1.0.69", - "tracing", - "w3f-bls", - "zeroize", -] - [[package]] name = "sp-core" version = "35.0.0" @@ -14913,13 +14482,13 @@ dependencies = [ "secrecy", "serde", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-externalities 0.30.0", - "sp-runtime-interface 29.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-storage 22.0.0", + "sp-debug-derive", + "sp-externalities", + "sp-runtime-interface", + "sp-std", + "sp-storage", "ss58-registry", - "substrate-bip39 0.6.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "substrate-bip39", "thiserror 1.0.69", "tracing", "w3f-bls", @@ -14972,17 +14541,6 @@ dependencies = [ "parking_lot 0.12.3", ] -[[package]] -name = "sp-debug-derive" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d09fa0a5f7299fb81ee25ae3853d26200f7a348148aed6de76be905c007dbe" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "sp-debug-derive" version = "14.0.0" @@ -14993,17 +14551,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "sp-externalities" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a904407d61cb94228c71b55a9d3708e9d6558991f9e83bd42bd91df37a159d30" -dependencies = [ - "environmental", - "parity-scale-codec", - "sp-storage 21.0.0", -] - [[package]] name = "sp-externalities" version = "0.30.0" @@ -15011,7 +14558,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d7132 dependencies = [ "environmental", "parity-scale-codec", - "sp-storage 22.0.0", + "sp-storage", ] [[package]] @@ -15039,33 +14586,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "sp-io" -version = "38.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ef7eb561bb4839cc8424ce58c5ea236cbcca83f26fcc0426d8decfe8aa97d4" -dependencies = [ - "bytes", - "docify", - "ed25519-dalek", - "libsecp256k1", - "log", - "parity-scale-codec", - "polkavm-derive 0.9.1", - "rustversion", - "secp256k1 0.28.2", - "sp-core 34.0.0", - "sp-crypto-hashing 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-externalities 0.29.0", - "sp-keystore 0.40.0", - "sp-runtime-interface 28.0.0", - "sp-state-machine 0.43.0", - "sp-tracing 17.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 37.0.0", - "tracing", - "tracing-core", -] - [[package]] name = "sp-io" version = "39.0.0" @@ -15080,14 +14600,14 @@ dependencies = [ "polkavm-derive 0.9.1", "rustversion", "secp256k1 0.28.2", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-externalities 0.30.0", - "sp-keystore 0.41.0", - "sp-runtime-interface 29.0.0", - "sp-state-machine 0.44.0", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-trie 38.0.0", + "sp-externalities", + "sp-keystore", + "sp-runtime-interface", + "sp-state-machine", + "sp-tracing", + "sp-trie", "tracing", "tracing-core", ] @@ -15097,23 +14617,11 @@ name = "sp-keyring" version = "40.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ - "sp-core 35.0.0", + "sp-core", "sp-runtime", "strum 0.26.3", ] -[[package]] -name = "sp-keystore" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0248b4d784cb4a01472276928977121fa39d977a5bb24793b6b15e64b046df42" -dependencies = [ - "parity-scale-codec", - "parking_lot 0.12.3", - "sp-core 34.0.0", - "sp-externalities 0.29.0", -] - [[package]] name = "sp-keystore" version = "0.41.0" @@ -15121,8 +14629,8 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d7132 dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", - "sp-core 35.0.0", - "sp-externalities 0.30.0", + "sp-core", + "sp-externalities", ] [[package]] @@ -15166,8 +14674,8 @@ dependencies = [ "scale-info", "serde", "sp-api", - "sp-core 35.0.0", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-core", + "sp-debug-derive", "sp-runtime", "thiserror 1.0.69", ] @@ -15180,8 +14688,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", + "sp-arithmetic", + "sp-core", "sp-runtime", ] @@ -15191,20 +14699,10 @@ version = "35.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ "sp-api", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] -[[package]] -name = "sp-panic-handler" -version = "13.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81478b3740b357fa0ea10fcdc1ee02ebae7734e50f80342c4743476d9f78eeea" -dependencies = [ - "backtrace", - "regex", -] - [[package]] name = "sp-panic-handler" version = "13.0.1" @@ -15221,7 +14719,7 @@ source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d7132 dependencies = [ "rustc-hash 1.1.0", "serde", - "sp-core 35.0.0", + "sp-core", ] [[package]] @@ -15243,36 +14741,16 @@ dependencies = [ "serde", "simple-mermaid", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-io 39.0.0", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-trie 38.0.0", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", + "sp-core", + "sp-io", + "sp-std", + "sp-trie", + "sp-weights", "tracing", "tuplex", ] -[[package]] -name = "sp-runtime-interface" -version = "28.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985eb981f40c689c6a0012c937b68ed58dabb4341d06f2dfe4dfd5ed72fa4017" -dependencies = [ - "bytes", - "impl-trait-for-tuples", - "parity-scale-codec", - "polkavm-derive 0.9.1", - "primitive-types 0.12.2", - "sp-externalities 0.29.0", - "sp-runtime-interface-proc-macro 18.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-std 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-storage 21.0.0", - "sp-tracing 17.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-wasm-interface 21.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "static_assertions", -] - [[package]] name = "sp-runtime-interface" version = "29.0.0" @@ -15283,29 +14761,15 @@ dependencies = [ "parity-scale-codec", "polkavm-derive 0.9.1", "primitive-types 0.13.1", - "sp-externalities 0.30.0", - "sp-runtime-interface-proc-macro 18.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-storage 22.0.0", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-wasm-interface 21.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-externalities", + "sp-runtime-interface-proc-macro", + "sp-std", + "sp-storage", + "sp-tracing", + "sp-wasm-interface", "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" -dependencies = [ - "Inflector", - "expander", - "proc-macro-crate 3.3.0", - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" @@ -15327,8 +14791,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-core 35.0.0", - "sp-keystore 0.41.0", + "sp-core", + "sp-keystore", "sp-runtime", "sp-staking", ] @@ -15342,31 +14806,10 @@ dependencies = [ "parity-scale-codec", "scale-info", "serde", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] -[[package]] -name = "sp-state-machine" -version = "0.43.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930104d6ae882626e8880d9b1578da9300655d337a3ffb45e130c608b6c89660" -dependencies = [ - "hash-db", - "log", - "parity-scale-codec", - "parking_lot 0.12.3", - "rand 0.8.5", - "smallvec", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "sp-panic-handler 13.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-trie 37.0.0", - "thiserror 1.0.69", - "tracing", - "trie-db", -] - [[package]] name = "sp-state-machine" version = "0.44.0" @@ -15378,10 +14821,10 @@ dependencies = [ "parking_lot 0.12.3", "rand 0.8.5", "smallvec", - "sp-core 35.0.0", - "sp-externalities 0.30.0", - "sp-panic-handler 13.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-trie 38.0.0", + "sp-core", + "sp-externalities", + "sp-panic-handler", + "sp-trie", "thiserror 1.0.69", "tracing", "trie-db", @@ -15402,39 +14845,20 @@ dependencies = [ "sha2 0.10.8", "sp-api", "sp-application-crypto", - "sp-core 35.0.0", + "sp-core", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-externalities 0.30.0", + "sp-externalities", "sp-runtime", - "sp-runtime-interface 29.0.0", + "sp-runtime-interface", "thiserror 1.0.69", "x25519-dalek", ] -[[package]] -name = "sp-std" -version = "14.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f8ee986414b0a9ad741776762f4083cd3a5128449b982a3919c4df36874834" - [[package]] name = "sp-std" version = "14.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" -[[package]] -name = "sp-storage" -version = "21.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c82989b3a4979a7e1ad848aad9f5d0b4388f1f454cc131766526601ab9e8f8" -dependencies = [ - "impl-serde 0.4.0", - "parity-scale-codec", - "ref-cast", - "serde", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sp-storage" version = "22.0.0" @@ -15444,7 +14868,7 @@ dependencies = [ "parity-scale-codec", "ref-cast", "serde", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-debug-derive", ] [[package]] @@ -15459,18 +14883,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "sp-tracing" -version = "17.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf641a1d17268c8fcfdb8e0fa51a79c2d4222f4cfda5f3944dbdbc384dced8d5" -dependencies = [ - "parity-scale-codec", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "sp-tracing" version = "17.0.1" @@ -15499,34 +14911,10 @@ dependencies = [ "async-trait", "parity-scale-codec", "scale-info", - "sp-core 35.0.0", + "sp-core", "sp-inherents", "sp-runtime", - "sp-trie 38.0.0", -] - -[[package]] -name = "sp-trie" -version = "37.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6282aef9f4b6ecd95a67a45bcdb67a71f4a4155c09a53c10add4ffe823db18cd" -dependencies = [ - "ahash", - "hash-db", - "lazy_static", - "memory-db", - "nohash-hasher", - "parity-scale-codec", - "parking_lot 0.12.3", - "rand 0.8.5", - "scale-info", - "schnellru", - "sp-core 34.0.0", - "sp-externalities 0.29.0", - "thiserror 1.0.69", - "tracing", - "trie-db", - "trie-root", + "sp-trie", ] [[package]] @@ -15543,8 +14931,8 @@ dependencies = [ "rand 0.8.5", "scale-info", "schnellru", - "sp-core 35.0.0", - "sp-externalities 0.30.0", + "sp-core", + "sp-externalities", "thiserror 1.0.69", "tracing", "trie-db", @@ -15563,7 +14951,7 @@ dependencies = [ "serde", "sp-crypto-hashing-proc-macro", "sp-runtime", - "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-std", "sp-version-proc-macro", "thiserror 1.0.69", ] @@ -15580,18 +14968,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "sp-wasm-interface" -version = "21.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b066baa6d57951600b14ffe1243f54c47f9c23dd89c262e17ca00ae8dca58be9" -dependencies = [ - "anyhow", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", -] - [[package]] name = "sp-wasm-interface" version = "21.0.1" @@ -15604,21 +14980,6 @@ dependencies = [ "wasmtime", ] -[[package]] -name = "sp-weights" -version = "31.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93cdaf72a1dad537bbb130ba4d47307ebe5170405280ed1aa31fa712718a400e" -dependencies = [ - "bounded-collections", - "parity-scale-codec", - "scale-info", - "serde", - "smallvec", - "sp-arithmetic 26.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "sp-debug-derive 14.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "sp-weights" version = "31.0.0" @@ -15629,8 +14990,8 @@ dependencies = [ "scale-info", "serde", "smallvec", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-debug-derive 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", + "sp-debug-derive", ] [[package]] @@ -15698,25 +15059,6 @@ dependencies = [ "sp-runtime", ] -[[package]] -name = "staging-xcm" -version = "11.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aded0292274ad473250c22ed3deaf2d9ed47d15786d700e9e83ab7c1cad2ad44" -dependencies = [ - "array-bytes", - "bounded-collections", - "derivative", - "environmental", - "impl-trait-for-tuples", - "log", - "parity-scale-codec", - "scale-info", - "serde", - "sp-weights 31.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "xcm-procedural 8.0.0", -] - [[package]] name = "staging-xcm" version = "15.0.1" @@ -15734,8 +15076,8 @@ dependencies = [ "scale-info", "serde", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "xcm-procedural 11.0.0", + "sp-weights", + "xcm-procedural", ] [[package]] @@ -15752,11 +15094,11 @@ dependencies = [ "parity-scale-codec", "polkadot-parachain-primitives", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-io", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-weights", + "staging-xcm", "staging-xcm-executor", ] @@ -15771,12 +15113,12 @@ dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", "scale-info", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-arithmetic", + "sp-core", + "sp-io", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-weights", + "staging-xcm", "tracing", ] @@ -15878,19 +15220,6 @@ dependencies = [ "syn 2.0.100", ] -[[package]] -name = "substrate-bip39" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca58ffd742f693dc13d69bdbb2e642ae239e0053f6aab3b104252892f856700a" -dependencies = [ - "hmac 0.12.1", - "pbkdf2", - "schnorrkel 0.11.4", - "sha2 0.10.8", - "zeroize", -] - [[package]] name = "substrate-bip39" version = "0.6.0" @@ -15916,7 +15245,7 @@ dependencies = [ "docify", "frame-system-rpc-runtime-api", "futures", - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "log", "parity-scale-codec", "sc-rpc-api", @@ -15924,7 +15253,7 @@ dependencies = [ "sp-api", "sp-block-builder", "sp-blockchain", - "sp-core 35.0.0", + "sp-core", "sp-runtime", ] @@ -15958,7 +15287,7 @@ dependencies = [ "sp-consensus-aura", "sp-consensus-babe", "sp-runtime", - "sp-trie 38.0.0", + "sp-trie", ] [[package]] @@ -15966,15 +15295,15 @@ name = "substrate-state-trie-migration-rpc" version = "41.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" dependencies = [ - "jsonrpsee 0.24.8", + "jsonrpsee 0.24.9", "parity-scale-codec", "sc-client-api", "sc-rpc-api", "serde", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "sp-state-machine 0.44.0", - "sp-trie 38.0.0", + "sp-state-machine", + "sp-trie", "trie-db", ] @@ -15996,10 +15325,10 @@ dependencies = [ "polkavm-linker", "sc-executor", "shlex", - "sp-core 35.0.0", - "sp-io 39.0.0", + "sp-core", + "sp-io", "sp-maybe-compressed-blob", - "sp-tracing 17.0.1 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-tracing", "sp-version", "strum 0.26.3", "tempfile", @@ -16044,9 +15373,9 @@ dependencies = [ "parity-scale-codec", "primitive-types 0.12.2", "reconnecting-jsonrpsee-ws-client", - "scale-bits 0.6.0", - "scale-decode 0.13.1", - "scale-encode 0.7.2", + "scale-bits", + "scale-decode", + "scale-encode", "scale-info", "scale-value", "serde", @@ -16098,9 +15427,9 @@ dependencies = [ "impl-serde 0.4.0", "parity-scale-codec", "primitive-types 0.12.2", - "scale-bits 0.6.0", - "scale-decode 0.13.1", - "scale-encode 0.7.2", + "scale-bits", + "scale-decode", + "scale-encode", "scale-info", "scale-value", "serde", @@ -16264,9 +15593,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" dependencies = [ "fastrand 2.3.0", - "getrandom 0.3.1", + "getrandom 0.3.2", "once_cell", - "rustix 1.0.2", + "rustix 1.0.3", "windows-sys 0.59.0", ] @@ -16295,7 +15624,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix 1.0.2", + "rustix 1.0.3", "windows-sys 0.59.0", ] @@ -16413,9 +15742,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.39" +version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" +checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" dependencies = [ "deranged", "itoa", @@ -16428,15 +15757,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" +checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" dependencies = [ "num-conv", "time-core", @@ -17162,9 +16491,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -17652,6 +16981,15 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "webpki-root-certs" +version = "0.26.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09aed61f5e8d2c18344b3faa33a4c837855fe56642757754775548fee21386c4" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "webpki-roots" version = "0.25.4" @@ -17749,16 +17087,16 @@ dependencies = [ "smallvec", "sp-api", "sp-application-crypto", - "sp-arithmetic 26.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", + "sp-arithmetic", "sp-authority-discovery", "sp-block-builder", "sp-consensus-babe", "sp-consensus-beefy", "sp-consensus-grandpa", - "sp-core 35.0.0", + "sp-core", "sp-genesis-builder", "sp-inherents", - "sp-io 39.0.0", + "sp-io", "sp-keyring", "sp-mmr-primitives", "sp-npos-elections", @@ -17766,10 +17104,10 @@ dependencies = [ "sp-runtime", "sp-session", "sp-staking", - "sp-storage 22.0.0", + "sp-storage", "sp-transaction-pool", "sp-version", - "staging-xcm 15.0.1", + "staging-xcm", "staging-xcm-builder", "staging-xcm-executor", "substrate-wasm-builder", @@ -17786,10 +17124,10 @@ dependencies = [ "polkadot-primitives", "polkadot-runtime-common", "smallvec", - "sp-core 35.0.0", + "sp-core", "sp-runtime", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-weights", + "staging-xcm", "staging-xcm-builder", ] @@ -17893,9 +17231,9 @@ dependencies = [ [[package]] name = "windows-link" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-result" @@ -18147,9 +17485,9 @@ checksum = "d135d17ab770252ad95e9a872d365cf3090e3be864a34ab46f48555993efc904" [[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags 2.9.0", ] @@ -18221,18 +17559,6 @@ dependencies = [ "time", ] -[[package]] -name = "xcm-procedural" -version = "8.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4717a97970a9cda70d7db53cf50d2615c2f6f6b7c857445325b4a39ea7aa2cd" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn 2.0.100", -] - [[package]] name = "xcm-procedural" version = "11.0.0" @@ -18253,8 +17579,8 @@ dependencies = [ "parity-scale-codec", "scale-info", "sp-api", - "sp-weights 31.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", - "staging-xcm 15.0.1", + "sp-weights", + "staging-xcm", "staging-xcm-executor", ] @@ -18273,12 +17599,6 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "xxhash-rust" -version = "0.8.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd20c5420375476fbd4394763288da7eb0cc0b8c11deed431a91562af7335d3" - [[package]] name = "yamux" version = "0.12.1" @@ -18454,9 +17774,9 @@ dependencies = [ [[package]] name = "zip" -version = "2.3.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84e9a772a54b54236b9b744aaaf8d7be01b4d6e99725523cb82cb32d1c81b1d7" +checksum = "938cc23ac49778ac8340e366ddc422b2227ea176edb447e23fc0627608dddadd" dependencies = [ "arbitrary", "crc32fast", diff --git a/Cargo.toml b/Cargo.toml index c54f5eb8f..bd416b0ec 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ exclude = [ members = [ "node", "pallets/*", - "pop-api/integration-tests", + #"pop-api/integration-tests", "primitives", "runtime/devnet", "runtime/mainnet", diff --git a/pallets/api/Cargo.toml b/pallets/api/Cargo.toml index 1bda3d7ab..fbc128d07 100644 --- a/pallets/api/Cargo.toml +++ b/pallets/api/Cargo.toml @@ -32,12 +32,13 @@ sp-std.workspace = true # Cross chain ismp.workspace = true pallet-ismp.workspace = true +pallet-xcm.workspace = true xcm.workspace = true +xcm-builder.workspace = true [dev-dependencies] pallet-balances.workspace = true sp-io.workspace = true -pallet-xcm.workspace = true xcm-builder.workspace = true [features] @@ -49,6 +50,7 @@ runtime-benchmarks = [ "pallet-assets/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-nfts/runtime-benchmarks", + "pallet-xcm/runtime-benchmarks", "pop-chain-extension/runtime-benchmarks", "sp-runtime/runtime-benchmarks", ] diff --git a/pallets/api/src/messaging/benchmarking.rs b/pallets/api/src/messaging/benchmarking.rs index a92d91ec5..54f3babf2 100644 --- a/pallets/api/src/messaging/benchmarking.rs +++ b/pallets/api/src/messaging/benchmarking.rs @@ -1,9 +1,10 @@ //! Benchmarking setup for pallet_api::nonfungibles #![cfg(feature = "runtime-benchmarks")] +use ::xcm::latest::{Junctions, Location}; use frame_benchmarking::{account, v2::*}; use frame_support::{dispatch::RawOrigin, traits::Currency, BoundedVec}; -use sp_runtime::traits::Zero; +use sp_runtime::traits::{One, Zero}; use super::*; use crate::Read as _; @@ -21,8 +22,8 @@ fn assert_has_event(generic_event: ::R mod messaging_benchmarks { use super::*; + /// x: The number of removals required. #[benchmark] - // x: The number of removals required. fn remove(x: Linear<1, 255>) { let deposit: BalanceOf = sp_runtime::traits::One::one(); let owner: AccountIdOf = account("Alice", 0, SEED); @@ -44,7 +45,6 @@ mod messaging_benchmarks { commitment: commitment.clone(), deposit, response: Default::default(), - status: MessageStatus::Ok, }; Messages::::insert(&owner, &message_id.0, &good_message); @@ -60,5 +60,82 @@ mod messaging_benchmarks { ) } + #[benchmark] + fn xcm_new_query() { + let owner: AccountIdOf = account("Alice", 0, SEED); + let message_id: [u8; 32] = [0; 32]; + let responder = Location { parents: 1, interior: Junctions::Here }; + let timeout = as One>::one() + frame_system::Pallet::::block_number(); + let callback = + Callback { selector: [0; 4], weight: 100.into(), spare_weight_creditor: owner.clone() }; + + pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); + + #[extrinsic_call] + Pallet::::xcm_new_query( + RawOrigin::Signed(owner.clone()), + message_id.clone(), + responder.clone(), + timeout, + Some(callback.clone()), + ); + + assert_has_event::( + crate::messaging::Event::XcmQueryCreated { + origin: owner, + id: message_id, + query_id: 0, + callback: Some(callback), + } + .into(), + ) + } + + /// x: Wether a successfully executing callback is provided. + #[benchmark] + fn xcm_response(x: Linear<0, 1>) { + let owner: AccountIdOf = account("Alice", 0, SEED); + let message_id: [u8; 32] = [0; 32]; + let responder = Location { parents: 1, interior: Junctions::Here }; + let timeout = as One>::one() + frame_system::Pallet::::block_number(); + let callback = None; + let response = Response::ExecutionResult(None); + + if x == 1 { + // The mock will always assume successfull callback. + let callback = Some(Callback { + selector: [0; 4], + weight: 100.into(), + spare_weight_creditor: owner.clone(), + }); + } + + pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); + + Pallet::::xcm_new_query( + RawOrigin::Signed(owner.clone()).into(), + message_id.clone(), + responder.clone(), + timeout, + callback.clone(), + ) + .unwrap(); + + #[extrinsic_call] + Pallet::::xcm_response(RawOrigin::Root, 0, response.clone()); + + assert_has_event::( + crate::messaging::Event::XcmResponseReceived { + dest: owner.clone(), + id: message_id, + query_id: 0, + response, + } + .into(), + ); + assert!(Messages::::get(&owner, &message_id).is_none()); + assert!(XcmQueries::::get(0).is_none()); + } + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); } diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 018b3c699..e0c1dcd0e 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -1,3 +1,7 @@ +extern crate alloc; + +pub use alloc::borrow::ToOwned; + use codec::{Decode, Encode}; use frame_support::{ dispatch::{DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, @@ -13,7 +17,7 @@ use frame_system::pallet_prelude::*; pub use pallet::*; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{traits::Saturating, BoundedVec, SaturatedConversion, DispatchError}; +use sp_runtime::{traits::Saturating, BoundedVec, DispatchError}; use sp_std::vec::Vec; use transports::{ ismp::{self as ismp, FeeMetadata, IsmpDispatcher}, @@ -37,9 +41,11 @@ use deposits::*; #[cfg(test)] mod tests; -pub(crate) type AccountIdOf = ::AccountId; -pub(crate) type BlockNumberOf = BlockNumberFor; -pub(crate) type BalanceOf = <::Deposit as Inspect>>::Balance; +type AccountIdOf = ::AccountId; +type BlockNumberOf = BlockNumberFor; +type BalanceOf = <::Deposit as Inspect>>::Balance; +type DbWeightOf = ::DbWeight; + pub type MessageId = [u8; 32]; #[frame_support::pallet] @@ -47,9 +53,7 @@ pub mod pallet { use frame_support::{ pallet_prelude::*, - storage::KeyLenOf, - traits::tokens::{fungible::hold::Mutate, Precision::Exact}, - dispatch::DispatchResult, pallet_prelude::*, + traits::{tokens::fungible::hold::Mutate, OnInitialize}, }; use sp_core::H256; use sp_runtime::traits::TryConvert; @@ -104,13 +108,18 @@ pub mod pallet { type Xcm: NotifyQueryHandler; type XcmResponseOrigin: EnsureOrigin; + + /// SAFETY: Recommended this is small as is used to updated a message status in the hooks. + /// The maximum number of xcm timeout updates that can be processed per block. + #[pallet::constant] + type MaxXcmQueryTimeoutsPerBlock: Get; } #[pallet::pallet] pub struct Pallet(_); #[pallet::storage] - pub(super) type Messages = StorageDoubleMap< + pub(crate) type Messages = StorageDoubleMap< _, Blake2_128Concat, T::AccountId, @@ -128,6 +137,15 @@ pub mod pallet { pub(super) type XcmQueries = StorageMap<_, Identity, QueryId, (T::AccountId, MessageId), OptionQuery>; + #[pallet::storage] + pub(super) type XcmQueryTimeouts = StorageMap< + _, + Identity, + BlockNumberOf, + BoundedVec<(T::AccountId, MessageId), T::MaxXcmQueryTimeoutsPerBlock>, + ValueQuery, + >; + /// The events that can be emitted. #[pallet::event] #[pallet::generate_deposit(pub(super) fn deposit_event)] @@ -240,6 +258,12 @@ pub mod pallet { IsmpDispatchFailed, /// The message was not found MessageNotFound, + /// The request has timed out + RequestTimedOut, + /// Timeouts must be in the future. + FutureTimeoutMandatory, + /// Message block limit has been reached for this expiry block. Try a different timeout. + MaxMessageTimeoutPerBlockReached, } /// A reason for the pallet placing a hold on funds. @@ -250,6 +274,29 @@ pub mod pallet { Messaging, } + #[pallet::hooks] + impl Hooks> for Pallet { + fn on_initialize(n: BlockNumberOf) -> Weight { + // As of polkadot-2412 XCM timeouts are not handled by the implementation of OnResponse + // in pallet-xcm. As a result, we must handle timeouts in the pallet. + // Iterate through the queries that have expired and update their status. + let mut weight: Weight = Zero::zero(); + for (origin, message_id) in XcmQueryTimeouts::::get(n) { + weight = weight.saturating_add(DbWeightOf::::get().reads_writes(2, 1)); + Messages::::mutate(origin, message_id, |maybe_message| { + if let Some(Message::XcmQuery { query_id, deposit, .. }) = + maybe_message.as_mut() + { + *maybe_message = + Some(Message::XcmTimeout { query_id: *query_id, deposit: *deposit }); + } + }) + } + + weight + } + } + #[pallet::call] impl Pallet { // TODO: does ismp allow querying to ensure that specified para id is supported? @@ -283,12 +330,7 @@ pub mod pallet { Messages::::insert( &origin, id, - Message::Ismp { - commitment, - callback: callback.clone(), - deposit, - status: MessageStatus::Ok, - }, + Message::Ismp { commitment, callback: callback.clone(), deposit }, ); Pallet::::deposit_event(Event::::IsmpGetDispatched { origin, @@ -331,12 +373,7 @@ pub mod pallet { Messages::::insert( &origin, id, - Message::Ismp { - commitment, - callback: callback.clone(), - deposit, - status: MessageStatus::Ok, - }, + Message::Ismp { commitment, callback: callback.clone(), deposit }, ); Pallet::::deposit_event(Event::::IsmpPostDispatched { origin, @@ -356,12 +393,23 @@ pub mod pallet { timeout: BlockNumberOf, callback: Option>, ) -> DispatchResult { - let origin = ensure_signed(origin)?; - let querier = T::OriginConverter::try_convert(T::RuntimeOrigin::signed(origin.clone())) + let querier_location = T::OriginConverter::try_convert(origin.clone()) .map_err(|_| Error::::OriginConversionFailed)?; - + let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + let current_block = frame_system::Pallet::::block_number(); + ensure!(current_block < timeout, Error::::FutureTimeoutMandatory); + + XcmQueryTimeouts::::try_mutate( + current_block.saturating_add(timeout), + |bounded_vec| { + bounded_vec + .try_push((origin.clone(), id)) + .map_err(|_| Error::::MaxMessageTimeoutPerBlockReached) + }, + )?; + let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::XcmQueries, ) @@ -372,8 +420,8 @@ pub mod pallet { // Process message by creating new query via XCM. // Xcm only uses/stores pallet, index - i.e. (u8,u8), hence the fields in xcm_response // are ignored. - let notify = Call::::xcm_response { query_id: 0, response: Default::default() }; - let query_id = T::Xcm::new_notify_query(responder, notify, timeout, querier); + let notify = Call::::xcm_response { query_id: 0, xcm_response: Default::default() }; + let query_id = T::Xcm::new_notify_query(responder, notify, timeout, querier_location); // Store query id for later lookup on response, message for querying status, // response/timeout handling. @@ -381,12 +429,7 @@ pub mod pallet { Messages::::insert( &origin, id, - Message::XcmQuery { - query_id, - callback: callback.clone(), - deposit, - status: MessageStatus::Ok, - }, + Message::XcmQuery { query_id, callback: callback.clone(), deposit }, ); Pallet::::deposit_event(Event::::XcmQueryCreated { origin, @@ -403,49 +446,48 @@ pub mod pallet { pub fn xcm_response( origin: OriginFor, query_id: QueryId, - response: Response, + xcm_response: Response, ) -> DispatchResult { T::XcmResponseOrigin::ensure_origin(origin)?; - - // Lookup message from query id. - let (origin, id) = XcmQueries::::get(query_id).ok_or(Error::::InvalidQuery)?; - let Some(Message::XcmQuery { query_id, callback, deposit, status }) = - Messages::::get(&origin, &id) - else { - return Err(Error::::InvalidMessage.into()) + let (origin, id) = XcmQueries::::get(query_id).ok_or(Error::::MessageNotFound)?; + let xcm_query_message = + Messages::::get(&origin, &id).ok_or(Error::::MessageNotFound)?; + + let (query_id, callback, deposit) = match &xcm_query_message { + Message::XcmQuery { query_id, callback, deposit } => (query_id, callback, deposit), + Message::XcmTimeout { .. } => return Err(Error::::RequestTimedOut.into()), + _ => return Err(Error::::InvalidMessage.into()), }; - // Attempt callback with response if specified. + // Emit event before possible callback execution. + Self::deposit_event(Event::::XcmResponseReceived { + dest: origin.clone(), + id, + query_id: *query_id, + response: xcm_response.clone(), + }); + if let Some(callback) = callback { - log::debug!(target: "pop-api::extension", "xcm callback={:?}, response={:?}", callback, response); - if Self::call(origin.clone(), callback, id, &response, deposit).is_ok() { - Self::deposit_event(Event::::XcmResponseReceived { - dest: origin, - id, - query_id, - response, - }); - return Ok(()); + // Attempt callback with response if specified. + log::debug!(target: "pop-api::extension", "xcm callback={:?}, response={:?}", callback, xcm_response); + if Self::call(&origin, callback.to_owned(), &id, &xcm_response).is_ok() { + Messages::::remove(&origin, &id); + XcmQueries::::remove(query_id); + T::Deposit::release(&HoldReason::Messaging.into(), &origin, *deposit, Exact)?; + return Ok(()) } } - - // Otherwise store response for manual retrieval and removal. + // No callback is executed, Messages::::insert( &origin, &id, Message::XcmResponse { - query_id, - response: response.clone(), - deposit, - status: MessageStatus::Ok, + query_id: *query_id, + deposit: *deposit, + response: xcm_response, }, ); - Self::deposit_event(Event::::XcmResponseReceived { - dest: origin, - id, - query_id, - response, - }); + Ok(()) } @@ -459,8 +501,36 @@ pub mod pallet { let origin = ensure_signed(origin)?; for id in &messages { - let message = Messages::::get(&origin, id).ok_or(Error::::MessageNotFound)?; - message.try_remove(&origin, id).and_then(|_| message.release_deposit(&origin))?; + let Some(message) = Messages::::get(&origin, id) else { + return Err(Error::::MessageNotFound.into()); + }; + + let deposit = match message { + Message::Ismp { .. } => Err(Error::::RequestPending), + Message::XcmQuery { .. } => Err(Error::::RequestPending), + Message::IsmpResponse { deposit, commitment, .. } => { + Messages::::remove(&origin, &id); + IsmpRequests::::remove(&commitment); + Ok(deposit) + }, + Message::XcmResponse { deposit, query_id, .. } => { + Messages::::remove(&origin, &id); + XcmQueries::::remove(query_id); + Ok(deposit) + }, + Message::IsmpTimeout { deposit, commitment, .. } => { + Messages::::remove(&origin, &id); + IsmpRequests::::remove(&commitment); + Ok(deposit) + }, + Message::XcmTimeout { query_id, deposit, .. } => { + Messages::::remove(&origin, &id); + XcmQueries::::remove(query_id); + Ok(deposit) + }, + }?; + + T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; } Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); @@ -471,41 +541,35 @@ pub mod pallet { } impl Pallet { // Attempt to notify via callback. - fn call( - origin: AccountIdOf, + pub(crate) fn call( + origin: &AccountIdOf, callback: Callback, - id: MessageId, + id: &MessageId, data: &impl Encode, - deposit: BalanceOf, ) -> DispatchResult { let result = T::CallbackExecutor::execute( origin.clone(), [callback.selector.to_vec(), (id, data).encode()].concat(), callback.weight, ); + log::debug!(target: "pop-api::extension", "callback weight={:?}, result={result:?}", callback.weight); match result { Ok(_post_info) => { - // TODO: do something with post_info: e.g. refund unused weight - // Return deposit. - T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; - Messages::::remove(&origin, &id); + // todo!("return weight") Self::deposit_event(Event::::CallbackExecuted { origin: origin.clone(), - id, + id: id.clone(), callback, }); - Self::deposit_event(Event::::Removed { - origin: origin.clone(), - messages: [id].to_vec(), - }); + Ok(()) }, Err(sp_runtime::DispatchErrorWithPostInfo:: { post_info, error }) => { // Fallback to storing the message for polling - pre-paid weight is lost. Self::deposit_event(Event::::CallbackFailed { origin: origin.clone(), - id, + id: id.clone(), callback, post_info, error, @@ -517,13 +581,6 @@ impl Pallet { } } -#[derive(Clone, Decode, Debug, Encode, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum Status { - Pending, - TimedOut, - Complete, -} - #[derive(Encode, Decode, Debug, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(PartialEq, Clone))] #[repr(u8)] @@ -567,24 +624,21 @@ impl crate::Read for Pallet { fn read(request: Self::Read) -> Self::Result { match request { - Read::PollStatus(request) => - ReadResult::Poll(Messages::::get(request.0, request.1).map(|m| match m { - Message::Ismp { status, .. } => status, - Message::IsmpResponse { status, .. } => status, - Message::XcmQuery { status, .. } => status, - Message::XcmResponse { status, .. } => status, - })), + Read::PollStatus(request) => ReadResult::Poll( + Messages::::get(request.0, request.1).map(|m| MessageStatus::from(&m)), + ), Read::GetResponse(request) => ReadResult::Get(Messages::::get(request.0, request.1).and_then(|m| match m { Message::Ismp { .. } => None, - Message::IsmpResponse { response, .. } => Some(response.into_inner()), Message::XcmQuery { .. } => None, + Message::IsmpResponse { response, .. } => Some(response.into_inner()), Message::XcmResponse { response, .. } => Some(response.encode()), + Message::IsmpTimeout { .. } => None, + Message::XcmTimeout { .. } => None, })), Read::QueryId(request) => ReadResult::QueryId( Messages::::get(request.0, request.1).and_then(|m| match m { - Message::XcmQuery { query_id, .. } | Message::XcmResponse { query_id, .. } => - Some(query_id), + Message::XcmQuery { query_id, .. } => Some(query_id), _ => None, }), ), @@ -594,120 +648,57 @@ impl crate::Read for Pallet { #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] -enum Message { +pub enum Message { Ismp { commitment: H256, callback: Option>, deposit: BalanceOf, - status: MessageStatus, + }, + XcmQuery { + query_id: QueryId, + callback: Option>, + deposit: BalanceOf, }, IsmpResponse { commitment: H256, deposit: BalanceOf, response: BoundedVec, - status: MessageStatus, }, - XcmQuery { + XcmResponse { query_id: QueryId, - callback: Option>, deposit: BalanceOf, - status: MessageStatus, + response: Response, }, - XcmResponse { + IsmpTimeout { + commitment: H256, + deposit: BalanceOf, + }, + XcmTimeout { query_id: QueryId, deposit: BalanceOf, - response: Response, - status: MessageStatus, }, } -impl Message { - /// Try and remove self. - pub fn try_remove(&self, origin: &AccountIdOf, id: &MessageId) -> Result<(), DispatchError> { - match self { - // Ismp messages can only be removed if their status is erroneous. - Message::Ismp { status, .. } => match status { - MessageStatus::Ok => Err(Error::::RequestPending.into()), - MessageStatus::Timeout | MessageStatus::Err(_) => { - self.remove(origin, id); - Ok(()) - }, - }, - // Ismp responses can always be removed. - Message::IsmpResponse { .. } => { - self.remove(origin, id); - Ok(()) - }, - // Xcm queries can only be removed if their status is erroneous. - Message::XcmQuery { status, .. } => match status { - MessageStatus::Ok => Err(Error::::RequestPending.into()), - MessageStatus::Timeout | MessageStatus::Err(_) => { - self.remove(origin, id); - Ok(()) - }, - }, - // XCM responses can always be removed. - Message::XcmResponse { .. } => { - self.remove(origin, id); - Ok(()) - }, - } - } - - /// Remove a message from storage. - /// Does no check on whether a message should be removed. - pub(crate) fn remove(&self, origin: &AccountIdOf, id: &MessageId) { - Messages::::remove(&origin, &id); - match self { - Message::Ismp { commitment, .. } => { - IsmpRequests::::remove(commitment); - }, - Message::IsmpResponse { commitment, .. } => { - IsmpRequests::::remove(commitment); - }, - Message::XcmQuery { query_id, .. } => { - XcmQueries::::remove(query_id); - }, - Message::XcmResponse { query_id, .. } => { - XcmQueries::::remove(query_id); - }, +impl From<&Message> for MessageStatus { + fn from(value: &Message) -> Self { + match value { + &Message::Ismp { .. } => MessageStatus::Pending, + &Message::XcmQuery { .. } => MessageStatus::Pending, + &Message::IsmpResponse { .. } => MessageStatus::Complete, + &Message::XcmResponse { .. } => MessageStatus::Complete, + &Message::IsmpTimeout { .. } => MessageStatus::Timeout, + &Message::XcmTimeout { .. } => MessageStatus::Timeout, } } - - pub fn release_deposit(&self, origin: &T::AccountId) -> Result<(), DispatchError> { - let deposit = match self { - Message::Ismp { deposit, .. } => deposit, - Message::IsmpResponse { deposit, .. } => deposit, - Message::XcmQuery { deposit, .. } => deposit, - Message::XcmResponse { deposit, .. } => deposit, - }; - T::Deposit::release(&HoldReason::Messaging.into(), origin, *deposit, Exact)?; - Ok(()) - } } #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum MessageStatus { - /// No errors have been recorded. - Ok, - /// An error has occurred with this message. - Err(DispatchError), - /// A timeout has occurred. + Pending, + Complete, Timeout, } -#[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum CallbackExecutionStatus { - Failure(CallbackErrorReason), - Success, -} - -#[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] -pub enum CallbackErrorReason { - NotEnoughGas, - BadExecution, -} - // Message selector and pre-paid weight used as gas limit #[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] @@ -719,6 +710,5 @@ pub struct Callback { pub trait CallbackExecutor { fn execute(account: T::AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo; - fn execution_weight() -> Weight; } diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index f7271bd18..760da3e56 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -1,3 +1,4 @@ +#![cfg(test)] use codec::Encode; use frame_support::{ assert_noop, assert_ok, @@ -29,297 +30,6 @@ fn events() -> Vec> { result } -// All the tests for the Message enum impls. -mod message { - use super::*; - - // Basic remove tests to ensure storage is cleaned. - #[test] - fn remove_ismp_message() { - new_test_ext().execute_with(|| { - let commitment = H256::default(); - let message_id = [0u8; 32]; - let m = Message::Ismp { - commitment, - callback: None, - deposit: 100, - status: MessageStatus::Ok, - }; - Messages::::insert(&ALICE, &message_id, &m); - IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); - m.remove(&ALICE, &message_id); - assert!( - Messages::::get(&ALICE, &message_id).is_none(), - "Message should have been removed but hasnt." - ); - assert!( - IsmpRequests::::get(&commitment).is_none(), - "Request should have been removed but hasnt." - ); - }) - } - - #[test] - fn remove_ismp_response() { - new_test_ext().execute_with(|| { - let commitment = H256::default(); - let message_id = [0u8; 32]; - let m = Message::IsmpResponse { - commitment, - response: bounded_vec!(), - deposit: 100, - status: MessageStatus::Ok, - }; - Messages::::insert(&ALICE, &message_id, &m); - IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); - m.remove(&ALICE, &message_id); - assert!( - Messages::::get(&ALICE, &message_id).is_none(), - "Message should have been removed but hasnt." - ); - assert!( - IsmpRequests::::get(&commitment).is_none(), - "Request should have been removed but hasnt." - ); - }) - } - - #[test] - fn remove_xcm_query() { - new_test_ext().execute_with(|| { - let query_id = 0; - let message_id = [0u8; 32]; - let m = Message::XcmQuery { - query_id, - callback: None, - deposit: 0, - status: MessageStatus::Ok, - }; - Messages::::insert(&ALICE, &message_id, &m); - XcmQueries::::insert(query_id, (&ALICE, &message_id)); - m.remove(&ALICE, &message_id); - assert!( - Messages::::get(&ALICE, &message_id).is_none(), - "Message should have been removed but hasnt" - ); - assert!( - XcmQueries::::get(query_id).is_none(), - "Message should have been removed but hasnt." - ); - }) - } - - #[test] - fn remove_xcm_response() { - new_test_ext().execute_with(|| { - let query_id = 0; - let message_id = [0u8; 32]; - let m = Message::XcmResponse { - query_id, - deposit: 0, - response: Default::default(), - status: MessageStatus::Ok, - }; - Messages::::insert(&ALICE, &message_id, &m); - XcmQueries::::insert(query_id, (&ALICE, &message_id)); - m.remove(&ALICE, &message_id); - assert!( - Messages::::get(&ALICE, &message_id).is_none(), - "Message should have been removed but hasnt" - ); - assert!( - XcmQueries::::get(query_id).is_none(), - "Message should have been removed but hasnt." - ); - }) - } - - // Basic try_remove tests to ensure validation of message status is correct. - #[test] - fn try_remove_ismp_message_is_noop_when_status_is_ok() { - new_test_ext().execute_with(|| { - let message_id: MessageId = [0u8; 32]; - let m = Message::Ismp { - commitment: H256::default(), - callback: None, - deposit: 100, - status: MessageStatus::Ok, - }; - Messages::::insert(&ALICE, &message_id, &m); - assert_noop!(m.try_remove(&ALICE, &message_id), Error::::RequestPending); - assert!( - Messages::::get(ALICE, &message_id).is_some(), - "Message has been deleted when it should exist." - ); - }); - } - - #[test] - fn try_remove_ismp_message_is_ok_when_status_is_timeout() { - new_test_ext().execute_with(|| { - let message_id: MessageId = [0u8; 32]; - let m = Message::Ismp { - commitment: H256::default(), - callback: None, - deposit: 0, - status: MessageStatus::Timeout, - }; - Messages::::insert(&ALICE, message_id, &m); - assert_ok!(m.try_remove(&ALICE, &message_id)); - assert!(Messages::::get(&ALICE, message_id).is_none()); - }); - } - - #[test] - fn try_remove_ismp_message_is_ok_when_status_is_err() { - new_test_ext().execute_with(|| { - let message_id: MessageId = [0u8; 32]; - let m = Message::Ismp { - commitment: H256::default(), - callback: None, - deposit: 0, - status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), - }; - Messages::::insert(&ALICE, message_id, &m); - assert_ok!(m.try_remove(&ALICE, &message_id)); - assert!(Messages::::get(&ALICE, message_id).is_none()); - }); - } - - #[test] - fn try_remove_ismp_response_is_ok_any_status() { - new_test_ext().execute_with(|| { - let m_id = [0; 32]; - let m2_id = [1; 32]; - let m3_id = [2; 32]; - - let m = Message::IsmpResponse { - commitment: Default::default(), - deposit: 0, - response: Default::default(), - status: MessageStatus::Ok, - }; - let m2 = Message::IsmpResponse { - commitment: Default::default(), - deposit: 0, - response: Default::default(), - status: MessageStatus::Ok, - }; - - let m3 = Message::IsmpResponse { - commitment: Default::default(), - deposit: 0, - response: Default::default(), - status: MessageStatus::Ok, - }; - - Messages::::insert(&ALICE, m_id, &m); - Messages::::insert(&ALICE, m2_id, &m2); - Messages::::insert(&ALICE, m3_id, &m3); - - assert_ok!(m.try_remove(&ALICE, &m_id)); - assert_ok!(m.try_remove(&ALICE, &m2_id)); - assert_ok!(m.try_remove(&ALICE, &m3_id)); - - assert!(Messages::::get(&ALICE, m_id).is_none()); - assert!(Messages::::get(&ALICE, m2_id).is_none()); - assert!(Messages::::get(&ALICE, m3_id).is_none()); - }); - } - - #[test] - fn try_remove_xcm_query_is_noop_when_status_is_ok() { - new_test_ext().execute_with(|| { - let message_id: MessageId = [0u8; 32]; - let m = Message::XcmQuery { - query_id: 0, - callback: None, - deposit: 0, - status: MessageStatus::Ok, - }; - Messages::::insert(&ALICE, message_id, &m); - assert_noop!(m.try_remove(&ALICE, &message_id), Error::::RequestPending); - assert!(Messages::::get(&ALICE, message_id).is_some()); - }); - } - - #[test] - fn try_remove_xcm_query_is_ok_when_status_is_timeout() { - new_test_ext().execute_with(|| { - let message_id: MessageId = [0u8; 32]; - let m = Message::XcmQuery { - query_id: 0, - callback: None, - deposit: 0, - status: MessageStatus::Timeout, - }; - Messages::::insert(&ALICE, message_id, &m); - assert_ok!(m.try_remove(&ALICE, &message_id)); - assert!(Messages::::get(&ALICE, message_id).is_none()); - }); - } - - #[test] - fn try_remove_xcm_query_is_ok_when_status_is_err() { - new_test_ext().execute_with(|| { - let message_id: MessageId = [0u8; 32]; - let m = Message::XcmQuery { - query_id: 0, - callback: None, - deposit: 0, - status: MessageStatus::Err(Error::::IsmpDispatchFailed.into()), - }; - Messages::::insert(&ALICE, message_id, &m); - assert_ok!(m.try_remove(&ALICE, &message_id)); - assert!(Messages::::get(&ALICE, message_id).is_none()); - }); - } - - #[test] - fn try_remove_xcm_response_is_ok_any_status() { - new_test_ext().execute_with(|| { - let m_id = [0; 32]; - let m2_id = [1; 32]; - let m3_id = [2; 32]; - - let m = Message::XcmResponse { - query_id: 0, - deposit: 0, - response: Default::default(), - status: MessageStatus::Ok, - }; - - let m2 = Message::XcmResponse { - query_id: 0, - deposit: 0, - response: Default::default(), - status: MessageStatus::Timeout, - }; - - let m3 = Message::XcmResponse { - query_id: 0, - deposit: 0, - response: Default::default(), - status: MessageStatus::Err(Error::::InvalidMessage.into()), - }; - - Messages::::insert(&ALICE, m_id, &m); - Messages::::insert(&ALICE, m2_id, &m2); - Messages::::insert(&ALICE, m3_id, &m3); - - assert_ok!(m.try_remove(&ALICE, &m_id)); - assert_ok!(m.try_remove(&ALICE, &m2_id)); - assert_ok!(m.try_remove(&ALICE, &m3_id)); - - assert!(Messages::::get(&ALICE, m_id).is_none()); - assert!(Messages::::get(&ALICE, m2_id).is_none()); - assert!(Messages::::get(&ALICE, m3_id).is_none()); - }); - } - - // Basic release deposit to ensure quantites are correct. -} - // Tests for the remove extrinsic. mod remove { use super::*; @@ -332,7 +42,6 @@ mod remove { commitment: Default::default(), deposit, response: Default::default(), - status: MessageStatus::Ok, }; let m_id = [0u8; 32]; let m2_id = [1u8; 32]; @@ -379,7 +88,6 @@ mod remove { commitment: Default::default(), deposit, response: Default::default(), - status: MessageStatus::Ok, }; let m_id = [0; 32]; let m2_id = [1; 32]; @@ -435,7 +143,6 @@ mod remove { commitment: Default::default(), deposit, response: Default::default(), - status: MessageStatus::Ok, }; let m_id = [0; 32]; @@ -465,12 +172,7 @@ mod remove { let deposit: Balance = 100; // Ismp message with status of Ok is considered pending. - let m = Message::Ismp { - commitment: H256::default(), - callback: None, - deposit, - status: MessageStatus::Ok, - }; + let m = Message::Ismp { commitment: H256::default(), callback: None, deposit }; let m_id = [0; 32]; ::Deposit::hold( @@ -504,15 +206,10 @@ mod remove { commitment: Default::default(), deposit: 0, response: Default::default(), - status: MessageStatus::Ok, }; - let erroneous_message = Message::Ismp { - commitment: H256::default(), - callback: None, - deposit: 100, - status: MessageStatus::Ok, - }; + let erroneous_message = + Message::Ismp { commitment: H256::default(), callback: None, deposit: 100 }; let good_id_1 = [0; 32]; let good_id_2 = [1; 32]; @@ -579,4 +276,490 @@ mod remove { assert_eq!(alice_balance_post_remove, alice_balance_post_hold); }); } + + // Basic remove tests to ensure storage is cleaned. + #[test] + fn remove_ismp_message() { + new_test_ext().execute_with(|| { + let commitment = H256::default(); + let message_id = [0u8; 32]; + let deposit = 100; + let m = Message::Ismp { commitment, callback: None, deposit }; + Messages::::insert(&ALICE, &message_id, &m); + IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); + ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + .unwrap(); + + assert_noop!( + Messaging::remove(signed(ALICE), bounded_vec!(message_id)), + Error::::RequestPending + ); + + assert!( + Messages::::get(&ALICE, &message_id).is_some(), + "Message should not have been removed but has." + ); + assert!( + IsmpRequests::::get(&commitment).is_some(), + "Message should not have been removed but has." + ); + }) + } + + #[test] + fn remove_ismp_response() { + new_test_ext().execute_with(|| { + let commitment = H256::default(); + let message_id = [0u8; 32]; + let deposit = 100; + + let m = Message::IsmpResponse { commitment, response: bounded_vec!(), deposit }; + Messages::::insert(&ALICE, &message_id, &m); + IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); + ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + .unwrap(); + + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + + assert!( + Messages::::get(&ALICE, &message_id).is_none(), + "Message should have been removed but hasnt." + ); + assert!( + IsmpRequests::::get(&commitment).is_none(), + "Request should have been removed but hasnt." + ); + }) + } + + #[test] + fn remove_ismp_timeout() { + new_test_ext().execute_with(|| { + let commitment = H256::default(); + let message_id = [0u8; 32]; + let deposit = 100; + + let m = Message::IsmpTimeout { commitment, deposit }; + Messages::::insert(&ALICE, &message_id, &m); + IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); + ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + .unwrap(); + + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + + assert!( + Messages::::get(&ALICE, &message_id).is_none(), + "Message should have been removed but hasnt." + ); + assert!( + IsmpRequests::::get(&commitment).is_none(), + "Request should have been removed but hasnt." + ); + }) + } + + #[test] + fn remove_xcm_query() { + new_test_ext().execute_with(|| { + let query_id = 0; + let message_id = [0u8; 32]; + let deposit = 100; + + let m = Message::XcmQuery { query_id, callback: None, deposit }; + Messages::::insert(&ALICE, &message_id, &m); + XcmQueries::::insert(query_id, (&ALICE, &message_id)); + ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + .unwrap(); + + assert_noop!( + Messaging::remove(signed(ALICE), bounded_vec!(message_id)), + Error::::RequestPending + ); + assert!( + Messages::::get(&ALICE, &message_id).is_some(), + "Message should not have been removed but has" + ); + assert!( + XcmQueries::::get(query_id).is_some(), + "Message should not have been removed but has." + ); + }) + } + + #[test] + fn remove_xcm_response() { + new_test_ext().execute_with(|| { + let query_id = 0; + let message_id = [0u8; 32]; + let deposit = 100; + let m = Message::XcmResponse { query_id, deposit, response: Default::default() }; + Messages::::insert(&ALICE, &message_id, &m); + XcmQueries::::insert(query_id, (&ALICE, &message_id)); + ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + .unwrap(); + + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + + assert!( + Messages::::get(&ALICE, &message_id).is_none(), + "Message should have been removed but hasnt" + ); + assert!( + XcmQueries::::get(query_id).is_none(), + "Message should have been removed but hasnt." + ); + }) + } + + #[test] + fn remove_xcm_timeout() { + new_test_ext().execute_with(|| { + let query_id = 0; + let message_id = [0u8; 32]; + let deposit = 100; + let m = Message::XcmTimeout { query_id, deposit }; + + ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + .unwrap(); + + Messages::::insert(&ALICE, &message_id, &m); + XcmQueries::::insert(query_id, (&ALICE, &message_id)); + + assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); + + assert!( + Messages::::get(&ALICE, &message_id).is_none(), + "Message should have been removed but hasnt" + ); + assert!( + XcmQueries::::get(query_id).is_none(), + "Message should have been removed but hasnt." + ); + }) + } +} + +mod xcm_new_query { + + use super::*; + + #[test] + fn success_assert_last_event() { + new_test_ext().execute_with(|| { + let timeout = System::block_number() + 1; + let message_id = [0; 32]; + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + )); + assert!(events().contains(&Event::::XcmQueryCreated { + origin: ALICE, + id: message_id, + query_id: 0, + callback: None + })); + }) + } + + #[test] + fn message_id_already_exists() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number() + 1; + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + )); + + assert_noop!( + Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + ), + Error::::MessageExists + ); + }) + } + + #[test] + fn takes_deposit() { + new_test_ext().execute_with(|| { + let timeout = System::block_number() + 1; + let expected_deposit = calculate_protocol_deposit::< + Test, + ::OnChainByteFee, + >(ProtocolStorageDeposit::XcmQueries) + .saturating_add(calculate_message_deposit::::OnChainByteFee>()); + + assert!( + expected_deposit > 0, + "set an onchain byte fee with T::OnChainByteFee to run this test." + ); + + let alices_balance_pre_hold = Balances::free_balance(&ALICE); + + let message_id = [0; 32]; + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + )); + + let alices_balance_post_hold = Balances::free_balance(&ALICE); + + assert_eq!(alices_balance_pre_hold - alices_balance_post_hold, expected_deposit); + }); + } + + #[test] + fn assert_state() { + new_test_ext().execute_with(|| { + // Looking for an item in Messages and XcmQueries. + let message_id = [0; 32]; + let expected_callback = + Callback { selector: [1; 4], weight: 100.into(), spare_weight_creditor: BOB }; + let timeout = System::block_number() + 1; + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + Some(expected_callback.clone()), + )); + let m = Messages::::get(ALICE, message_id) + .expect("should exist after xcm_new_query."); + if let Message::XcmQuery { query_id, callback, deposit } = m { + assert_eq!(query_id, 0); + assert_eq!(callback, Some(expected_callback)); + } else { + panic!("Wrong message type.") + } + + assert_eq!(XcmQueries::::get(0), Some((ALICE, message_id))); + }) + } + + #[test] + fn xcm_timeouts_must_be_in_the_future() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number(); + assert_noop!( + Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None + ), + Error::::FutureTimeoutMandatory + ); + }) + } +} + +mod xcm_response { + use super::*; + + #[test] + fn message_not_found() { + new_test_ext().execute_with(|| { + assert_noop!( + Messaging::xcm_response(root(), 0, Default::default()), + Error::::MessageNotFound + ); + }) + } + + #[test] + fn timeout_messages_are_noop() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number() + 1; + let mut generated_query_id = 0; + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + )); + + // Update the message to XcmTimedOut + Messages::::mutate(&ALICE, &message_id, |message| { + let Some(Message::XcmQuery { query_id, deposit, .. }): &mut Option> = + message + else { + panic!("No message!"); + }; + generated_query_id = *query_id; + *message = Some(Message::XcmTimeout { query_id: *query_id, deposit: *deposit }); + }); + + assert_noop!( + Messaging::xcm_response(root(), generated_query_id, Default::default()), + Error::::RequestTimedOut + ); + }) + } + + #[test] + fn assert_event_no_callback() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number() + 1; + let mut generated_query_id = 0; + let xcm_response = Response::Null; + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + )); + + assert_ok!(Messaging::xcm_response(root(), generated_query_id, xcm_response)); + + assert!(events().contains(&Event::::XcmResponseReceived { + dest: ALICE, + id: message_id, + query_id: generated_query_id, + response: Response::Null + })); + }) + } + + #[test] + fn assert_message_is_stored_for_polling_no_callback() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number() + 1; + let mut expected_query_id = 0; + let xcm_response = Response::ExecutionResult(None); + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + )); + + assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); + let Some(Message::XcmResponse { query_id, deposit, response }): Option> = + Messages::get(&ALICE, message_id) + else { + panic!("wrong message type"); + }; + + assert_eq!(query_id, expected_query_id); + assert_eq!(xcm_response, response); + }) + } + + #[test] + fn message_is_removed_after_successfull_callback_execution() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number() + 1; + let mut expected_query_id = 0; + let xcm_response = Response::ExecutionResult(None); + let callback = + Callback { selector: [1; 4], weight: 100.into(), spare_weight_creditor: BOB }; + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + Some(callback), + )); + + assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); + assert!(Messages::::get(&ALICE, &message_id).is_none()); + assert!(XcmQueries::::get(expected_query_id).is_none()); + }) + } + + #[test] + fn deposit_returned_after_successfull_callback_execution() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number() + 1; + let mut expected_query_id = 0; + let xcm_response = Response::ExecutionResult(None); + let callback = + Callback { selector: [1; 4], weight: 100.into(), spare_weight_creditor: BOB }; + let expected_deposit = calculate_protocol_deposit::< + Test, + ::OnChainByteFee, + >(ProtocolStorageDeposit::XcmQueries) + + calculate_message_deposit::< + Test, + ::OnChainByteFee, + >(); + + let alice_balance_pre_hold = Balances::free_balance(&ALICE); + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + Some(callback), + )); + + let alice_balance_post_hold = Balances::free_balance(&ALICE); + + assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); + + let alice_balance_post_release = Balances::free_balance(&ALICE); + + assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); + assert_eq!(alice_balance_post_release, alice_balance_pre_hold); + }) + } +} + +mod hooks { + use super::*; + + #[test] + fn xcm_queries_expire_on_expiry_block() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number() + 10; + let xcm_response = Response::ExecutionResult(None); + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + )); + + run_to(timeout + 1); + + let Some(Message::XcmTimeout { .. }): Option> = + Messages::get(&ALICE, message_id) + else { + panic!("Message should be timedout!") + }; + }) + } } diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 212155809..42914ad1e 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -201,7 +201,7 @@ fn process_response( let (origin, id) = IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; - let Some(super::super::Message::Ismp { commitment, callback, deposit, status }) = + let Some(super::super::Message::Ismp { commitment, callback, deposit }) = Messages::::get(&origin, &id) else { return Err(Error::Custom("message not found".into()).into()) @@ -210,8 +210,8 @@ fn process_response( // Attempt callback with result if specified. if let Some(callback) = callback { // TODO: check response length - todo!("update message status on success or fail."); - if Pallet::::call(origin.clone(), callback, id, &encode, deposit).is_ok() { + // TODO: update status if failed + if Pallet::::call(&origin, callback, &id, &encode).is_ok() { Pallet::::deposit_event(event(origin, id)); return Ok(()); } @@ -223,12 +223,7 @@ fn process_response( Messages::::insert( &origin, &id, - super::super::Message::IsmpResponse { - commitment, - deposit, - response, - status: todo!("take status from callback return value."), - }, + super::super::Message::IsmpResponse { commitment, deposit, response }, ); Pallet::::deposit_event(event(origin, id)); Ok(()) diff --git a/pallets/api/src/messaging/transports/xcm.rs b/pallets/api/src/messaging/transports/xcm.rs index f230d0463..b5318b545 100644 --- a/pallets/api/src/messaging/transports/xcm.rs +++ b/pallets/api/src/messaging/transports/xcm.rs @@ -1,8 +1,10 @@ pub(crate) use xcm::latest::{Location, QueryId, Response}; +use xcm_builder::QueryControllerWeightInfo; use crate::messaging::{pallet::Call, BlockNumberOf, Config}; pub trait NotifyQueryHandler { + type WeightInfo: QueryControllerWeightInfo; /// Attempt to create a new query ID and register it as a query that is yet to respond, and /// which will call a dispatchable when a response happens. fn new_notify_query( diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 7b5cd83d4..23a2b9c67 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -1,27 +1,30 @@ +use ::xcm::latest::{Junction, Junctions, Location}; use codec::{Decode, Encode}; use frame_support::{ derive_impl, pallet_prelude::EnsureOrigin, parameter_types, - traits::{AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Everything, OriginTrait}, + traits::{ + AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Everything, Hooks, OriginTrait, + }, }; use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned}; use pallet_nfts::PalletFeatures; -use pallet_xcm::Origin; +use pallet_xcm::{Origin, TestWeightInfo}; use scale_info::TypeInfo; use sp_core::H256; use sp_runtime::{ - traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, Verify}, + traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, TryConvert, Verify}, BuildStorage, }; -use xcm::latest::Location; -use crate::messaging::{Call, CallbackExecutor, NotifyQueryHandler}; +use crate::messaging::{Call, CallbackExecutor, Messages, NotifyQueryHandler}; pub(crate) const ALICE: AccountId = 1; pub(crate) const BOB: AccountId = 2; pub(crate) const CHARLIE: AccountId = 3; pub(crate) const RESPONSE: AccountId = 4; +pub(crate) const RESPONSE_LOCATION: Location = Location { parents: 1, interior: Junctions::Here }; pub(crate) const INIT_AMOUNT: Balance = 100_000_000 * UNIT; pub(crate) const UNIT: Balance = 10_000_000_000; @@ -208,8 +211,8 @@ impl crate::nonfungibles::Config for Test { type WeightInfo = (); } -pub struct MockCallbackExecutor(T); -impl CallbackExecutor for MockCallbackExecutor { +pub struct AlwaysSuccessfullCallbackExecutor(T); +impl CallbackExecutor for AlwaysSuccessfullCallbackExecutor { fn execute( account: ::AccountId, data: Vec, @@ -224,23 +227,33 @@ impl CallbackExecutor for MockCallbackExecutor(T); impl NotifyQueryHandler for MockNotifyQuery { + type WeightInfo = (); + fn new_notify_query( responder: impl Into, notify: Call, timeout: BlockNumberFor, match_querier: impl Into, ) -> u64 { - 0u64 + get_next_query_id() } } +// Just done based on the count of the queries created +// Problematic if one is removed. +pub fn get_next_query_id() -> u64 { + Messages::::iter().count() as u64 +} + impl crate::messaging::Config for Test { - type CallbackExecutor = MockCallbackExecutor; + type CallbackExecutor = AlwaysSuccessfullCallbackExecutor; type Deposit = Balances; type IsmpDispatcher = MockIsmpDispatcher; type MaxContextLen = ConstU32<64>; @@ -249,13 +262,14 @@ impl crate::messaging::Config for Test { type MaxKeys = ConstU32<10>; type MaxRemovals = ConstU32<1024>; type MaxResponseLen = ConstU32<1024>; - type OffChainByteFee = (); - type OnChainByteFee = TransactionByteFee; - type OriginConverter = (); + type MaxXcmQueryTimeoutsPerBlock = MaxXcmQueryTimeoutsPerBlock; + type OffChainByteFee = OffChainByteFee; + type OnChainByteFee = OnChainByteFee; + type OriginConverter = AccountToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; type Xcm = MockNotifyQuery; - type XcmResponseOrigin = EnsureResponse; + type XcmResponseOrigin = EnsureRootWithResponseSuccess; } #[derive(Default)] @@ -281,14 +295,27 @@ impl ismp::dispatcher::IsmpDispatcher for MockIsmpDispatcher { } } -pub struct EnsureResponse; -impl EnsureOrigin for EnsureResponse { +pub struct AccountToLocation; + +impl TryConvert for AccountToLocation { + fn try_convert(origin: RuntimeOrigin) -> Result { + let signer = origin.into_signer(); + let l = Junctions::from(Junction::AccountIndex64 { + network: None, + index: signer.expect("No account id, required."), + }) + .into_location(); + Ok(l) + } +} + +pub struct EnsureRootWithResponseSuccess; +impl EnsureOrigin for EnsureRootWithResponseSuccess { type Success = Location; fn try_origin(o: RuntimeOrigin) -> Result { - let signer = o.clone().into_signer(); - if signer == Some(RESPONSE) { - Ok(xcm::latest::Location::here()) + if let Ok(_) = EnsureRoot::ensure_origin(o.clone()) { + Ok(RESPONSE_LOCATION) } else { Err(o) } @@ -327,3 +354,15 @@ pub(crate) fn root() -> RuntimeOrigin { pub(crate) fn none() -> RuntimeOrigin { RuntimeOrigin::none() } + +pub fn next_block() { + let next_block: u64 = System::block_number() + 1; + System::set_block_number(next_block); + Messaging::on_initialize(next_block); +} + +pub fn run_to(block_number: u64) { + while System::block_number() < block_number { + next_block(); + } +} diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index c471e74b5..910337902 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -22,11 +22,11 @@ use crate::{ assets::{TrustBackedAssetsInstance, TrustBackedNftsInstance}, xcm::LocalOriginToLocation, }, - fungibles, messaging, nonfungibles, AccountId, Balances, BlockNumber, ConstU32, Ismp, Revive, - Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, TransactionByteFee, + fungibles, messaging, nonfungibles, parameter_types, AccountId, Balances, BlockNumber, + ConstU32, Ismp, Revive, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, + TransactionByteFee, }; - mod versioning; type DecodingFailedError = DecodingFailed; @@ -112,6 +112,10 @@ impl nonfungibles::Config for Runtime { type WeightInfo = (); } +parameter_types! { + pub const MaxXcmQueryTimeoutsPerBlock: u32 = 100; +} + impl messaging::Config for Runtime { type CallbackExecutor = CallbackExecutor; type Deposit = Balances; @@ -124,6 +128,7 @@ impl messaging::Config for Runtime { type MaxRemovals = ConstU32<1024>; // TODO: ensure within the contract buffer bounds type MaxResponseLen = ConstU32<1024>; + type MaxXcmQueryTimeoutsPerBlock = MaxXcmQueryTimeoutsPerBlock; // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as // much as onchain cost. type OffChainByteFee = (); @@ -204,9 +209,10 @@ impl messaging::CallbackExecutor for CallbackExecutor { } } -// TODO!( default implementation where T: PolkadotXcm::Config pub struct QueryHandler; impl pallet_api::messaging::NotifyQueryHandler for QueryHandler { + type WeightInfo = pallet_xcm::Pallet; + fn new_notify_query( responder: impl Into, notify: messaging::Call, diff --git a/runtime/devnet/src/config/ismp.rs b/runtime/devnet/src/config/ismp.rs index f4275f833..986fadedd 100644 --- a/runtime/devnet/src/config/ismp.rs +++ b/runtime/devnet/src/config/ismp.rs @@ -41,7 +41,7 @@ impl Get for HostStateMachine { StateMachine::Polkadot(ParachainInfo::get().into()) } } - + #[derive(Default)] pub struct Router; impl IsmpRouter for Router { diff --git a/runtime/devnet/src/config/mod.rs b/runtime/devnet/src/config/mod.rs index 5368f72d1..184abe9ef 100644 --- a/runtime/devnet/src/config/mod.rs +++ b/runtime/devnet/src/config/mod.rs @@ -5,5 +5,5 @@ mod contracts; mod ismp; mod proxy; // Public due to integration tests crate. -pub mod xcm; mod revive; +pub mod xcm; diff --git a/runtime/testnet/src/apis.rs b/runtime/testnet/src/apis.rs index 2bfe53e19..ca96a30b8 100644 --- a/runtime/testnet/src/apis.rs +++ b/runtime/testnet/src/apis.rs @@ -15,7 +15,7 @@ use sp_runtime::{ transaction_validity::{TransactionSource, TransactionValidity}, ApplyExtrinsicResult, }; -use crate::messaging::ReadResult::*; + // Local module imports use super::{ config::system::RuntimeBlockWeights, genesis, AccountId, AuraId, Balance, Balances, Block, @@ -24,6 +24,7 @@ use super::{ RuntimeGenesisConfig, RuntimeOrigin, RuntimeVersion, SessionKeys, System, TransactionPayment, UncheckedExtrinsic, Weight, CONTRACTS_DEBUG_OUTPUT, CONTRACTS_EVENTS, VERSION, *, }; +use crate::messaging::ReadResult::*; impl_runtime_apis! { diff --git a/runtime/testnet/src/config/api/mod.rs b/runtime/testnet/src/config/api/mod.rs index 084e77f0e..5b309752a 100644 --- a/runtime/testnet/src/config/api/mod.rs +++ b/runtime/testnet/src/config/api/mod.rs @@ -16,13 +16,14 @@ use sp_runtime::DispatchError; use versioning::*; use xcm::prelude::Location; - use crate::{ config::{ assets::TrustBackedAssetsInstance, monetary::TransactionByteFee, xcm::LocalOriginToLocation, }, - fungibles, AccountId, Balances, BlockNumber, Contracts, Ismp, PolkadotXcm, Runtime, - RuntimeCall, RuntimeEvent, RuntimeHoldReason, messaging::ReadResult::*, + fungibles, + messaging::ReadResult::*, + parameter_types, AccountId, Balances, BlockNumber, Contracts, Ismp, PolkadotXcm, Runtime, + RuntimeCall, RuntimeEvent, RuntimeHoldReason, }; mod versioning; @@ -90,9 +91,12 @@ impl RuntimeResult { } } +parameter_types! { + pub const MaxXcmQueryTimeoutsPerBlock: u32 = 100; + +} + impl messaging::Config for Runtime { - type OffChainByteFee = TransactionByteFee; - type OnChainByteFee = TransactionByteFee; type CallbackExecutor = CallbackExecutor; type Deposit = Balances; type IsmpDispatcher = Ismp; @@ -104,6 +108,9 @@ impl messaging::Config for Runtime { type MaxRemovals = ConstU32<1024>; // TODO: ensure within the contract buffer bounds type MaxResponseLen = ConstU32<1024>; + type MaxXcmQueryTimeoutsPerBlock = MaxXcmQueryTimeoutsPerBlock; + type OffChainByteFee = TransactionByteFee; + type OnChainByteFee = TransactionByteFee; type OriginConverter = LocalOriginToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; @@ -178,6 +185,8 @@ impl messaging::CallbackExecutor for CallbackExecutor { pub struct QueryHandler; impl NotifyQueryHandler for QueryHandler { + type WeightInfo = pallet_xcm::Pallet; + fn new_notify_query( responder: impl Into, notify: messaging::Call, @@ -269,9 +278,7 @@ impl> Contains f matches!( c, RuntimeCall::Messaging( - ismp_get { .. } | ismp_post { .. } | - xcm_new_query { .. } | - remove { .. }, + ismp_get { .. } | ismp_post { .. } | xcm_new_query { .. } | remove { .. }, ) ) }; From 8975a8fa19f1f9125b30ef1b49f749a9fbcd7de6 Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Tue, 1 Apr 2025 08:51:35 +0100 Subject: [PATCH 27/38] Messaging CallbackExecutor (#502) * messaging mock impl * query status refactor, fix stuck deposits, write first test * remove tests 1 * refactor remove extrinsic for better testing * second refactor, much better * fmt * fmt, fixes, test, benchmark * refactor storage deposits * check warnings * fmt * Off chain and on chain byte fees * fmt * comments * remove useless test * fmt * fix * moar tests * xcm-new-query benchmark * fmt * refactor response status * xcm timeouts * refactor to original format * fix tests * tests * moar tests, hooks, xcm_response * fmt * xcm_response benchmark * fmt * fix * fmt * lock * make callback events unit testable * failing test for imbalance handler * call tests * comments * fmt * add the new weight to fee config, config test * fmt * fmt * lock * comments --- Cargo.lock | 705 +++++++++++++------------- Cargo.toml | 1 + pallets/api/Cargo.toml | 1 + pallets/api/src/messaging/mod.rs | 36 +- pallets/api/src/messaging/tests.rs | 136 ++++- pallets/api/src/mock.rs | 18 +- runtime/devnet/src/config/api/mod.rs | 18 + runtime/testnet/src/config/api/mod.rs | 1 + 8 files changed, 547 insertions(+), 369 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 930244e9d..e8050b701 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -770,7 +770,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "hash-db", "log", @@ -931,9 +931,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "675f87afced0413c9bb02843499dbbd3882a237645883f71a2b59644a6d2f753" +checksum = "b17679a8d69b6d7fd9cd9801a536cec9fa5e5970b69f9d4747f70b39b031f5e7" dependencies = [ "arrayref", "arrayvec 0.7.6", @@ -1019,9 +1019,9 @@ dependencies = [ [[package]] name = "bounded-collections" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ed0a820ed50891d36358e997d27741a6142e382242df40ff01c89bcdcc7a2b" +checksum = "64ad8a0bed7827f0b07a5d23cec2e58cc02038a99e4ca81616cb2bb2025f804d" dependencies = [ "log", "parity-scale-codec", @@ -1041,7 +1041,7 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -1173,9 +1173,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "jobserver", "libc", @@ -1384,12 +1384,13 @@ dependencies = [ [[package]] name = "codespan-reporting" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" dependencies = [ + "serde", "termcolor", - "unicode-width 0.1.14", + "unicode-width", ] [[package]] @@ -1446,7 +1447,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4a65ebfec4fb190b6f90e944a817d60499ee0744e582530e2c9900a22e591d9a" dependencies = [ "unicode-segmentation", - "unicode-width 0.2.0", + "unicode-width", ] [[package]] @@ -1473,7 +1474,7 @@ dependencies = [ "encode_unicode", "libc", "once_cell", - "unicode-width 0.2.0", + "unicode-width", "windows-sys 0.59.0", ] @@ -1905,7 +1906,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.21.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "clap", "parity-scale-codec", @@ -1922,7 +1923,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1945,7 +1946,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-client-collator", @@ -1991,7 +1992,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -2021,7 +2022,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "anyhow", "async-trait", @@ -2036,7 +2037,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -2062,7 +2063,7 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2084,7 +2085,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2110,7 +2111,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -2147,7 +2148,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -2164,7 +2165,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -2200,7 +2201,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -2211,7 +2212,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-session-benchmarking" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -2224,7 +2225,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2239,7 +2240,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" version = "0.18.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -2264,7 +2265,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-aura" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "sp-api", "sp-consensus-aura", @@ -2273,7 +2274,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -2289,7 +2290,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2303,7 +2304,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-proof-size-hostfunction" version = "0.11.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "sp-externalities", "sp-runtime-interface", @@ -2313,7 +2314,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-storage-weight-reclaim" version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-proof-size-hostfunction", @@ -2330,7 +2331,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2347,7 +2348,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2371,7 +2372,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2390,7 +2391,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "async-trait", @@ -2425,7 +2426,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" version = "0.21.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2466,7 +2467,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2518,9 +2519,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "342b09ea23e087717542308a865984555782302855f29427540bbe02d5e8a28a" +checksum = "6d1cf22155cf6a8e0b0536efc30c775eadd7a481c376d2d7e30daf0825a42ef9" dependencies = [ "cc", "cxxbridge-cmd", @@ -2532,9 +2533,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3ff8c449a5074983677c19c894eadc62b6a82ade4d6316547798eb79342ae5" +checksum = "db4e07e3a69db032f03450594e53785a5d6b1d787c2ad5b901d9347f0064af94" dependencies = [ "cc", "codespan-reporting", @@ -2546,9 +2547,9 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40399fddbf3977647bfff7453dacffc6b5701b19a282a283369a870115d0a049" +checksum = "48e9ff9c627d3abe06190462f7db81fb6cc12f3424ea081c2a8c9ed7a8cc167a" dependencies = [ "clap", "codespan-reporting", @@ -2559,15 +2560,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9161673896b799047e79a245927e7921787ad016eed6770227f3f23de2746c7" +checksum = "2e6417f4e1518ded330e088d5a66f50fbae9bbc96840e147058ae44970a2b51a" [[package]] name = "cxxbridge-macro" -version = "1.0.148" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff513230582d396298cc00e8fb3d9a752822f85137c323fac4227ac5be6c268" +checksum = "856ff0dba6e023dd78189c8f4667126842dfe88392b5d4e94118bd18b8f2afbf" dependencies = [ "proc-macro2", "quote", @@ -2724,9 +2725,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" dependencies = [ "powerfmt", "serde", @@ -3495,7 +3496,7 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "fork-tree" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", ] @@ -3532,14 +3533,14 @@ dependencies = [ [[package]] name = "fragile" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa" +checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-support-procedural", @@ -3563,7 +3564,7 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" version = "46.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "Inflector", "array-bytes", @@ -3625,7 +3626,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "14.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -3636,7 +3637,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3652,7 +3653,7 @@ dependencies = [ [[package]] name = "frame-executive" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "aquamarine", "frame-support", @@ -3705,7 +3706,7 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "const-hex", @@ -3721,7 +3722,7 @@ dependencies = [ [[package]] name = "frame-support" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "aquamarine", "array-bytes", @@ -3764,7 +3765,7 @@ dependencies = [ [[package]] name = "frame-support-procedural" version = "31.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "Inflector", "cfg-expr", @@ -3784,7 +3785,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.3.0", @@ -3796,7 +3797,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "proc-macro2", "quote", @@ -3806,7 +3807,7 @@ dependencies = [ [[package]] name = "frame-system" version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cfg-if", "docify", @@ -3826,7 +3827,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -3840,7 +3841,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "parity-scale-codec", @@ -3850,7 +3851,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "parity-scale-codec", @@ -4694,14 +4695,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core 0.52.0", ] @@ -5251,9 +5253,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d699bc6dfc879fb1bf9bdff0d4c56f0884fc6f0d0eb0fba397a6d00cd9a6b85e" +checksum = "c102670231191d07d37a35af3eb77f1f0dbf7a71be51a962dcd57ea607be7260" dependencies = [ "jiff-static", "log", @@ -5264,9 +5266,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d16e75759ee0aa64c57a56acbf43916987b20c77373cb7e808979e02b93c9f9" +checksum = "4cdde31a9d349f1b1f51a0b3714a5940ac022976f4b49485fc04be052b183b4c" dependencies = [ "proc-macro2", "quote", @@ -6450,9 +6452,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "lru" @@ -6711,7 +6713,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "log", @@ -6730,7 +6732,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "jsonrpsee 0.24.9", "parity-scale-codec", @@ -7354,6 +7356,7 @@ dependencies = [ "sp-io", "sp-runtime", "sp-std", + "sp-weights", "staging-xcm", "staging-xcm-builder", ] @@ -7361,7 +7364,7 @@ dependencies = [ [[package]] name = "pallet-asset-conversion" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7379,7 +7382,7 @@ dependencies = [ [[package]] name = "pallet-asset-rate" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7393,7 +7396,7 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7410,7 +7413,7 @@ dependencies = [ [[package]] name = "pallet-assets" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7426,7 +7429,7 @@ dependencies = [ [[package]] name = "pallet-aura" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -7442,7 +7445,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -7457,7 +7460,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -7470,7 +7473,7 @@ dependencies = [ [[package]] name = "pallet-babe" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7493,7 +7496,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "aquamarine", "docify", @@ -7514,7 +7517,7 @@ dependencies = [ [[package]] name = "pallet-balances" version = "40.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -7529,7 +7532,7 @@ dependencies = [ [[package]] name = "pallet-beefy" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -7548,7 +7551,7 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -7573,7 +7576,7 @@ dependencies = [ [[package]] name = "pallet-bounties" version = "38.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7590,7 +7593,7 @@ dependencies = [ [[package]] name = "pallet-broker" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "frame-benchmarking", @@ -7608,7 +7611,7 @@ dependencies = [ [[package]] name = "pallet-child-bounties" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7626,7 +7629,7 @@ dependencies = [ [[package]] name = "pallet-collator-selection" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7645,7 +7648,7 @@ dependencies = [ [[package]] name = "pallet-collective" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -7662,7 +7665,7 @@ dependencies = [ [[package]] name = "pallet-contracts" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitflags 1.3.2", "environmental", @@ -7695,7 +7698,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "23.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "proc-macro2", "quote", @@ -7705,7 +7708,7 @@ dependencies = [ [[package]] name = "pallet-contracts-uapi" version = "12.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -7716,7 +7719,7 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7732,7 +7735,7 @@ dependencies = [ [[package]] name = "pallet-delegated-staking" version = "6.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -7747,7 +7750,7 @@ dependencies = [ [[package]] name = "pallet-democracy" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7764,7 +7767,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7786,7 +7789,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7799,7 +7802,7 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7817,7 +7820,7 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -7835,7 +7838,7 @@ dependencies = [ [[package]] name = "pallet-grandpa" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7857,7 +7860,7 @@ dependencies = [ [[package]] name = "pallet-identity" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7873,7 +7876,7 @@ dependencies = [ [[package]] name = "pallet-im-online" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7892,7 +7895,7 @@ dependencies = [ [[package]] name = "pallet-indices" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7975,7 +7978,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -7991,7 +7994,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "environmental", "frame-benchmarking", @@ -8010,7 +8013,7 @@ dependencies = [ [[package]] name = "pallet-migrations" version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cfg-if", "docify", @@ -8028,7 +8031,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8062,7 +8065,7 @@ dependencies = [ [[package]] name = "pallet-multisig" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "log", "parity-scale-codec", @@ -8073,7 +8076,7 @@ dependencies = [ [[package]] name = "pallet-nft-fractionalization" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8107,7 +8110,7 @@ dependencies = [ [[package]] name = "pallet-nfts" version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "enumflags2", "frame-benchmarking", @@ -8124,7 +8127,7 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "pallet-nfts 33.0.0", "parity-scale-codec", @@ -8134,7 +8137,7 @@ dependencies = [ [[package]] name = "pallet-nis" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8149,7 +8152,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -8167,7 +8170,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8187,7 +8190,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -8197,7 +8200,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -8213,7 +8216,7 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8236,7 +8239,7 @@ dependencies = [ [[package]] name = "pallet-parameters" version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -8253,7 +8256,7 @@ dependencies = [ [[package]] name = "pallet-preimage" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8269,7 +8272,7 @@ dependencies = [ [[package]] name = "pallet-proxy" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -8279,7 +8282,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8297,7 +8300,7 @@ dependencies = [ [[package]] name = "pallet-recovery" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8311,7 +8314,7 @@ dependencies = [ [[package]] name = "pallet-referenda" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8329,7 +8332,7 @@ dependencies = [ [[package]] name = "pallet-revive" version = "0.3.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitflags 1.3.2", "derive_more 0.99.19", @@ -8367,7 +8370,7 @@ dependencies = [ [[package]] name = "pallet-revive-proc-macro" version = "0.1.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "proc-macro2", "quote", @@ -8377,7 +8380,7 @@ dependencies = [ [[package]] name = "pallet-revive-uapi" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -8389,7 +8392,7 @@ dependencies = [ [[package]] name = "pallet-root-testing" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -8403,7 +8406,7 @@ dependencies = [ [[package]] name = "pallet-scheduler" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -8420,7 +8423,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -8441,7 +8444,7 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8457,7 +8460,7 @@ dependencies = [ [[package]] name = "pallet-society" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8474,7 +8477,7 @@ dependencies = [ [[package]] name = "pallet-staking" version = "39.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8496,7 +8499,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "log", "sp-arithmetic", @@ -8505,7 +8508,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "sp-api", @@ -8515,7 +8518,7 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8531,7 +8534,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -8546,7 +8549,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -8565,7 +8568,7 @@ dependencies = [ [[package]] name = "pallet-tips" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8583,7 +8586,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8599,7 +8602,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "jsonrpsee 0.24.9", "pallet-transaction-payment-rpc-runtime-api", @@ -8615,7 +8618,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8627,7 +8630,7 @@ dependencies = [ [[package]] name = "pallet-treasury" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -8646,7 +8649,7 @@ dependencies = [ [[package]] name = "pallet-utility" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8661,7 +8664,7 @@ dependencies = [ [[package]] name = "pallet-vesting" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8675,7 +8678,7 @@ dependencies = [ [[package]] name = "pallet-whitelist" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8689,7 +8692,7 @@ dependencies = [ [[package]] name = "pallet-xcm" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8712,7 +8715,7 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-benchmarking", "frame-support", @@ -8730,7 +8733,7 @@ dependencies = [ [[package]] name = "parachains-common" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -8936,9 +8939,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.15" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b7cafe60d6cf8e62e1b9b2ea516a089c008945bb5a275416789e7db0bc199dc" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" dependencies = [ "memchr", "thiserror 2.0.12", @@ -8947,9 +8950,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.15" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816518421cfc6887a0d62bf441b6ffb4536fcc926395a69e1a85852d4363f57e" +checksum = "d725d9cfd79e87dccc9341a2ef39d1b6f6353d68c4b33c177febbe1a402c97c5" dependencies = [ "pest", "pest_generator", @@ -8957,9 +8960,9 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.15" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d1396fd3a870fc7838768d171b4616d5c91f6cc25e377b673d714567d99377b" +checksum = "db7d01726be8ab66ab32f9df467ae8b1148906685bbe75c82d1e65d7f5b3f841" dependencies = [ "pest", "pest_meta", @@ -8970,9 +8973,9 @@ dependencies = [ [[package]] name = "pest_meta" -version = "2.7.15" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e58089ea25d717bfd31fb534e4f3afcc2cc569c70de3e239778991ea3b7dea" +checksum = "7f9f832470494906d1fca5329f8ab5791cc60beb230c74815dff541cbd2b5ca0" dependencies = [ "once_cell", "pest", @@ -9061,7 +9064,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polkadot-approval-distribution" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "futures", @@ -9080,7 +9083,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "always-assert", "futures", @@ -9096,7 +9099,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "derive_more 0.99.19", "fatality", @@ -9120,7 +9123,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "fatality", @@ -9153,7 +9156,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "22.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cfg-if", "clap", @@ -9181,7 +9184,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "fatality", @@ -9204,7 +9207,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -9215,7 +9218,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "21.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "derive_more 0.99.19", "fatality", @@ -9240,7 +9243,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9254,7 +9257,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "futures-timer", @@ -9276,7 +9279,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "always-assert", "async-trait", @@ -9299,7 +9302,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "parity-scale-codec", @@ -9318,7 +9321,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "bitvec", @@ -9351,7 +9354,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting-parallel" version = "0.4.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -9381,7 +9384,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "futures", @@ -9402,7 +9405,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "fatality", @@ -9423,7 +9426,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "polkadot-node-subsystem", @@ -9438,7 +9441,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -9460,7 +9463,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "polkadot-node-metrics", @@ -9474,7 +9477,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "futures-timer", @@ -9491,7 +9494,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "fatality", "futures", @@ -9510,7 +9513,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -9527,7 +9530,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "fatality", "futures", @@ -9541,7 +9544,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "fatality", @@ -9559,7 +9562,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "always-assert", "array-bytes", @@ -9589,7 +9592,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "polkadot-node-primitives", @@ -9605,7 +9608,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cpu-time", "futures", @@ -9631,7 +9634,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "polkadot-node-metrics", @@ -9646,7 +9649,7 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bs58", "futures", @@ -9665,7 +9668,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -9690,7 +9693,7 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "bounded-vec", @@ -9716,7 +9719,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "polkadot-node-subsystem-types", "polkadot-overseer", @@ -9725,7 +9728,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "bitvec", @@ -9754,7 +9757,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "derive_more 0.99.19", @@ -9789,7 +9792,7 @@ dependencies = [ [[package]] name = "polkadot-overseer" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -9811,7 +9814,7 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bounded-collections", "derive_more 0.99.19", @@ -9827,7 +9830,7 @@ dependencies = [ [[package]] name = "polkadot-primitives" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "hex-literal", @@ -9855,7 +9858,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "jsonrpsee 0.24.9", "mmr-rpc", @@ -9890,7 +9893,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitvec", "frame-benchmarking", @@ -9941,7 +9944,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bs58", "frame-benchmarking", @@ -9953,7 +9956,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -10002,7 +10005,7 @@ dependencies = [ [[package]] name = "polkadot-sdk-frame" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-benchmarking", @@ -10036,7 +10039,7 @@ dependencies = [ [[package]] name = "polkadot-service" version = "22.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "frame-benchmarking", @@ -10144,7 +10147,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "21.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "arrayvec 0.7.6", "bitvec", @@ -10167,7 +10170,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -10817,7 +10820,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -11250,7 +11253,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", "rand_core 0.9.3", - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -11592,7 +11595,7 @@ dependencies = [ [[package]] name = "rococo-runtime" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "binary-merkle-tree", "bitvec", @@ -11694,7 +11697,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "polkadot-primitives", @@ -11895,7 +11898,7 @@ dependencies = [ "once_cell", "ring 0.17.14", "rustls-pki-types", - "rustls-webpki 0.103.0", + "rustls-webpki 0.103.1", "subtle 2.6.1", "zeroize", ] @@ -11996,7 +11999,7 @@ dependencies = [ "rustls 0.23.25", "rustls-native-certs 0.8.1", "rustls-platform-verifier-android", - "rustls-webpki 0.103.0", + "rustls-webpki 0.103.1", "security-framework 3.2.0", "security-framework-sys", "webpki-root-certs", @@ -12032,9 +12035,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.0" +version = "0.103.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa4eeac2588ffff23e9d7a7e9b3f971c5fb5b7ebc9452745e0c232c64f83b2f" +checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" dependencies = [ "ring 0.17.14", "rustls-pki-types", @@ -12107,7 +12110,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "log", "sp-core", @@ -12118,7 +12121,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -12148,7 +12151,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "futures-timer", @@ -12170,7 +12173,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "sp-api", @@ -12185,7 +12188,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "docify", @@ -12212,7 +12215,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -12223,7 +12226,7 @@ dependencies = [ [[package]] name = "sc-cli" version = "0.50.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "chrono", @@ -12265,7 +12268,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "fnv", "futures", @@ -12292,7 +12295,7 @@ dependencies = [ [[package]] name = "sc-client-db" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "hash-db", "kvdb", @@ -12318,7 +12321,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -12342,7 +12345,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -12371,7 +12374,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "fork-tree", @@ -12407,7 +12410,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "jsonrpsee 0.24.9", @@ -12429,7 +12432,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12465,7 +12468,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "jsonrpsee 0.24.9", @@ -12485,7 +12488,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "fork-tree", "parity-scale-codec", @@ -12498,7 +12501,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "ahash", "array-bytes", @@ -12542,7 +12545,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "finality-grandpa", "futures", @@ -12562,7 +12565,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -12585,7 +12588,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -12608,7 +12611,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "polkavm 0.9.3", "sc-allocator", @@ -12621,7 +12624,7 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "log", "polkavm 0.9.3", @@ -12632,7 +12635,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "anyhow", "cfg-if", @@ -12650,7 +12653,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "console", "futures", @@ -12667,7 +12670,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "parking_lot 0.12.3", @@ -12681,7 +12684,7 @@ dependencies = [ [[package]] name = "sc-mixnet" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "arrayvec 0.7.6", @@ -12710,7 +12713,7 @@ dependencies = [ [[package]] name = "sc-network" version = "0.48.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12761,7 +12764,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -12779,7 +12782,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "ahash", "futures", @@ -12798,7 +12801,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12819,7 +12822,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12855,7 +12858,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "futures", @@ -12874,7 +12877,7 @@ dependencies = [ [[package]] name = "sc-network-types" version = "0.15.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bs58", "ed25519-dalek", @@ -12891,7 +12894,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "bytes", @@ -12928,7 +12931,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -12937,7 +12940,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "jsonrpsee 0.24.9", @@ -12969,7 +12972,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "jsonrpsee 0.24.9", "parity-scale-codec", @@ -12989,7 +12992,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -13013,7 +13016,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "futures", @@ -13045,7 +13048,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "directories", @@ -13109,7 +13112,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.37.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "log", "parity-scale-codec", @@ -13120,7 +13123,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.23.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "clap", "fs4", @@ -13133,7 +13136,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "jsonrpsee 0.24.9", "parity-scale-codec", @@ -13152,7 +13155,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "derive_more 0.99.19", "futures", @@ -13173,7 +13176,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "chrono", "futures", @@ -13193,7 +13196,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "chrono", "console", @@ -13221,7 +13224,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -13232,7 +13235,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -13263,7 +13266,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -13279,7 +13282,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-channel 1.9.0", "futures", @@ -13937,7 +13940,7 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "enumn", "parity-scale-codec", @@ -14252,7 +14255,7 @@ dependencies = [ [[package]] name = "sp-api" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "hash-db", @@ -14274,7 +14277,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "Inflector", "blake2 0.10.6", @@ -14288,7 +14291,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -14300,7 +14303,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "integer-sqrt", @@ -14314,7 +14317,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -14326,7 +14329,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "sp-api", "sp-inherents", @@ -14336,7 +14339,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "futures", "parity-scale-codec", @@ -14355,7 +14358,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "futures", @@ -14370,7 +14373,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "parity-scale-codec", @@ -14386,7 +14389,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "parity-scale-codec", @@ -14404,7 +14407,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -14424,7 +14427,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "finality-grandpa", "log", @@ -14441,7 +14444,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -14452,7 +14455,7 @@ dependencies = [ [[package]] name = "sp-core" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -14512,7 +14515,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "blake2b_simd", "byteorder", @@ -14525,7 +14528,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", @@ -14535,7 +14538,7 @@ dependencies = [ [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -14544,7 +14547,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "proc-macro2", "quote", @@ -14554,7 +14557,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.30.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "environmental", "parity-scale-codec", @@ -14564,7 +14567,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -14576,7 +14579,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -14589,7 +14592,7 @@ dependencies = [ [[package]] name = "sp-io" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bytes", "docify", @@ -14615,7 +14618,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "sp-core", "sp-runtime", @@ -14625,7 +14628,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -14636,7 +14639,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", @@ -14645,7 +14648,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-metadata 18.0.0", "parity-scale-codec", @@ -14655,7 +14658,7 @@ dependencies = [ [[package]] name = "sp-mixnet" version = "0.13.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -14666,7 +14669,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "log", "parity-scale-codec", @@ -14683,7 +14686,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -14696,7 +14699,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "sp-api", "sp-core", @@ -14706,7 +14709,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "backtrace", "regex", @@ -14715,7 +14718,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "rustc-hash 1.1.0", "serde", @@ -14725,7 +14728,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "binary-merkle-tree", "docify", @@ -14754,7 +14757,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -14773,7 +14776,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "Inflector", "expander", @@ -14786,7 +14789,7 @@ dependencies = [ [[package]] name = "sp-session" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "scale-info", @@ -14800,7 +14803,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -14813,7 +14816,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "hash-db", "log", @@ -14833,7 +14836,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -14857,12 +14860,12 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" [[package]] name = "sp-storage" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -14874,7 +14877,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "parity-scale-codec", @@ -14886,7 +14889,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "17.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "tracing", @@ -14897,7 +14900,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "sp-api", "sp-runtime", @@ -14906,7 +14909,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "async-trait", "parity-scale-codec", @@ -14920,7 +14923,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "ahash", "hash-db", @@ -14942,7 +14945,7 @@ dependencies = [ [[package]] name = "sp-version" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -14959,7 +14962,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "parity-scale-codec", "proc-macro-warning 1.84.1", @@ -14971,7 +14974,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "21.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -14983,7 +14986,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -15049,7 +15052,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-parachain-info" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -15062,7 +15065,7 @@ dependencies = [ [[package]] name = "staging-xcm" version = "15.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "bounded-collections", @@ -15083,7 +15086,7 @@ dependencies = [ [[package]] name = "staging-xcm-builder" version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "frame-system", @@ -15105,7 +15108,7 @@ dependencies = [ [[package]] name = "staging-xcm-executor" version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "environmental", "frame-benchmarking", @@ -15223,7 +15226,7 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -15235,12 +15238,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" [[package]] name = "substrate-frame-rpc-system" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "docify", "frame-system-rpc-runtime-api", @@ -15260,7 +15263,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "http-body-util", "hyper 1.6.0", @@ -15293,7 +15296,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "jsonrpsee 0.24.9", "parity-scale-codec", @@ -15310,7 +15313,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "array-bytes", "build-helper", @@ -15588,9 +15591,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ "fastrand 2.3.0", "getrandom 0.3.2", @@ -15742,9 +15745,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -15763,9 +15766,9 @@ checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -16039,7 +16042,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "coarsetime", "polkadot-primitives", @@ -16050,7 +16053,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "expander", "proc-macro-crate 3.3.0", @@ -16302,12 +16305,6 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - [[package]] name = "unicode-width" version = "0.2.0" @@ -17008,7 +17005,7 @@ dependencies = [ [[package]] name = "westend-runtime" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "binary-merkle-tree", "bitvec", @@ -17118,7 +17115,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "polkadot-primitives", @@ -17562,7 +17559,7 @@ dependencies = [ [[package]] name = "xcm-procedural" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "Inflector", "proc-macro2", @@ -17573,7 +17570,7 @@ dependencies = [ [[package]] name = "xcm-runtime-apis" version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#d713296f19a304c9f51946dca1b1d7e3ec432d8b" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" dependencies = [ "frame-support", "parity-scale-codec", @@ -17680,11 +17677,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.23", + "zerocopy-derive 0.8.24", ] [[package]] @@ -17700,9 +17697,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", @@ -17774,17 +17771,15 @@ dependencies = [ [[package]] name = "zip" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938cc23ac49778ac8340e366ddc422b2227ea176edb447e23fc0627608dddadd" +checksum = "27c03817464f64e23f6f37574b4fdc8cf65925b5bfd2b0f2aedf959791941f88" dependencies = [ "arbitrary", "crc32fast", "crossbeam-utils", - "displaydoc", "indexmap 2.8.0", "memchr", - "thiserror 2.0.12", ] [[package]] @@ -17827,9 +17822,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.14+zstd.1.5.7" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", "pkg-config", diff --git a/Cargo.toml b/Cargo.toml index bd416b0ec..c1a605826 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,6 +148,7 @@ sp-session = { git = "https://github.com/paritytech/polkadot-sdk", branch = "sta sp-std = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2412", default-features = false } sp-timestamp = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2412" } sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2412", default-features = false } +sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2412", default-features = false } sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2412", default-features = false } substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "stable2412" } diff --git a/pallets/api/Cargo.toml b/pallets/api/Cargo.toml index fbc128d07..086a2da14 100644 --- a/pallets/api/Cargo.toml +++ b/pallets/api/Cargo.toml @@ -28,6 +28,7 @@ pallet-nfts.workspace = true sp-core.workspace = true sp-runtime.workspace = true sp-std.workspace = true +sp-weights.workspace = true # Cross chain ismp.workspace = true diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index e0c1dcd0e..fa668febe 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -5,7 +5,7 @@ pub use alloc::borrow::ToOwned; use codec::{Decode, Encode}; use frame_support::{ dispatch::{DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, - pallet_prelude::MaxEncodedLen, + pallet_prelude::{MaxEncodedLen, Zero}, storage::KeyLenOf, traits::{ fungible::Inspect, @@ -19,6 +19,7 @@ use scale_info::TypeInfo; use sp_core::H256; use sp_runtime::{traits::Saturating, BoundedVec, DispatchError}; use sp_std::vec::Vec; +use sp_weights::WeightToFee; use transports::{ ismp::{self as ismp, FeeMetadata, IsmpDispatcher}, xcm::{self as xcm, Location, QueryId}, @@ -113,6 +114,7 @@ pub mod pallet { /// The maximum number of xcm timeout updates that can be processed per block. #[pallet::constant] type MaxXcmQueryTimeoutsPerBlock: Get; + type WeightToFee: WeightToFee>; } #[pallet::pallet] @@ -549,14 +551,34 @@ impl Pallet { ) -> DispatchResult { let result = T::CallbackExecutor::execute( origin.clone(), - [callback.selector.to_vec(), (id, data).encode()].concat(), + match callback.abi { + Abi::Scale => [callback.selector.to_vec(), (id, data).encode()].concat(), + }, callback.weight, ); log::debug!(target: "pop-api::extension", "callback weight={:?}, result={result:?}", callback.weight); + Self::handle_callback_result(origin, id, result, callback) + } + + pub(crate) fn handle_callback_result( + origin: &AccountIdOf, + id: &MessageId, + result: DispatchResultWithPostInfo, + callback: Callback>, + ) -> DispatchResult { match result { - Ok(_post_info) => { - // todo!("return weight") + Ok(post_info) => { + // Try and return any unused callback weight. + if let Some(weight_used) = post_info.actual_weight { + let weight_to_refund = callback.weight.saturating_sub(weight_used); + if !weight_to_refund.any_eq(Zero::zero()) { + let returnable_imbalance = T::WeightToFee::weight_to_fee(&weight_to_refund); + // Where do we refund to? + // TODO: Handle Imbalance: sc-3302. + } + } + Self::deposit_event(Event::::CallbackExecuted { origin: origin.clone(), id: id.clone(), @@ -703,11 +725,17 @@ pub enum MessageStatus { #[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] pub struct Callback { + pub abi: Abi, pub selector: [u8; 4], pub weight: Weight, pub spare_weight_creditor: AccountId, } +/// The encoding used for the data going to the contract. +#[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] +pub enum Abi { + Scale, +} pub trait CallbackExecutor { fn execute(account: T::AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo; fn execution_weight() -> Weight; diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 760da3e56..06cb230e8 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -528,8 +528,12 @@ mod xcm_new_query { new_test_ext().execute_with(|| { // Looking for an item in Messages and XcmQueries. let message_id = [0; 32]; - let expected_callback = - Callback { selector: [1; 4], weight: 100.into(), spare_weight_creditor: BOB }; + let expected_callback = Callback { + selector: [1; 4], + weight: 100.into(), + spare_weight_creditor: BOB, + abi: Abi::Scale, + }; let timeout = System::block_number() + 1; assert_ok!(Messaging::xcm_new_query( signed(ALICE), @@ -678,8 +682,12 @@ mod xcm_response { let timeout = System::block_number() + 1; let mut expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); - let callback = - Callback { selector: [1; 4], weight: 100.into(), spare_weight_creditor: BOB }; + let callback = Callback { + selector: [1; 4], + weight: 100.into(), + spare_weight_creditor: BOB, + abi: Abi::Scale, + }; assert_ok!(Messaging::xcm_new_query( signed(ALICE), @@ -702,8 +710,12 @@ mod xcm_response { let timeout = System::block_number() + 1; let mut expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); - let callback = - Callback { selector: [1; 4], weight: 100.into(), spare_weight_creditor: BOB }; + let callback = Callback { + selector: [1; 4], + weight: 100.into(), + spare_weight_creditor: BOB, + abi: Abi::Scale, + }; let expected_deposit = calculate_protocol_deposit::< Test, ::OnChainByteFee, @@ -763,3 +775,115 @@ mod hooks { }) } } + +mod handle_callback_result { + use frame_support::dispatch::{DispatchResultWithPostInfo, Pays, PostDispatchInfo}; + use sp_runtime::DispatchErrorWithPostInfo; + + use super::*; + + #[test] + fn refunds_unused_weight_to_creditor_on_success() { + new_test_ext().execute_with(|| { + let origin = ALICE; + let id = [1u8; 32]; + let actual_weight = Weight::from_parts(100, 100); + let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { + actual_weight: Some(actual_weight.clone()), + pays_fee: Pays::Yes, + }); + let bob_balance_pre_refund = Balances::free_balance(&BOB); + let expected_imbalance = + ::WeightToFee::weight_to_fee(&actual_weight); + let callback = Callback { + selector: [1; 4], + weight: Weight::from_parts(1000, 1000), + spare_weight_creditor: BOB, + abi: Abi::Scale, + }; + + assert_ok!(crate::messaging::Pallet::::handle_callback_result( + &origin, &id, result, callback + )); + + let bob_balance_post_refund = Balances::free_balance(&BOB); + assert_eq!( + bob_balance_post_refund - bob_balance_pre_refund, + expected_imbalance, + "oops bob hasnt been refunded!" + ); + }) + } + + #[test] + fn does_not_refunds_unused_weight_to_creditor_on_failure() { + new_test_ext().execute_with(|| { + todo!("sc-3302"); + }) + } + + #[test] + fn assert_event_success() { + new_test_ext().execute_with(|| { + let origin = ALICE; + let id = [1u8; 32]; + let actual_weight = Weight::from_parts(100, 100); + let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { + actual_weight: Some(actual_weight.clone()), + pays_fee: Pays::Yes, + }); + let callback = Callback { + selector: [1; 4], + weight: Weight::from_parts(1000, 1000), + spare_weight_creditor: BOB, + abi: Abi::Scale, + }; + + assert_ok!(crate::messaging::Pallet::::handle_callback_result( + &origin, + &id, + result, + callback.clone() + )); + assert!(events().contains(&Event::::CallbackExecuted { + origin: origin.clone(), + id, + callback + })); + }) + } + + #[test] + fn assert_event_failure() { + new_test_ext().execute_with(|| { + let origin = ALICE; + let id = [1u8; 32]; + let result = DispatchResultWithPostInfo::Err(DispatchErrorWithPostInfo { + post_info: Default::default(), + error: Error::::InvalidMessage.into(), + }); + + let callback = Callback { + selector: [1; 4], + weight: Weight::from_parts(1000, 1000), + spare_weight_creditor: BOB, + abi: Abi::Scale, + }; + + assert!(crate::messaging::Pallet::::handle_callback_result( + &origin, + &id, + result, + callback.clone() + ) + .is_err()); + assert!(events().contains(&Event::::CallbackFailed { + origin, + id, + callback, + post_info: Default::default(), + error: Error::::InvalidMessage.into() + })); + }) + } +} diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 23a2b9c67..724fb39ac 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -268,10 +268,20 @@ impl crate::messaging::Config for Test { type OriginConverter = AccountToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; + type WeightToFee = RefTimePlusProofTime; type Xcm = MockNotifyQuery; type XcmResponseOrigin = EnsureRootWithResponseSuccess; } +pub struct RefTimePlusProofTime; +impl sp_weights::WeightToFee for RefTimePlusProofTime { + type Balance = Balance; + + fn weight_to_fee(weight: &sp_weights::Weight) -> Self::Balance { + (weight.ref_time() + weight.proof_size()) as u128 + } +} + #[derive(Default)] pub struct MockIsmpDispatcher; impl ismp::dispatcher::IsmpDispatcher for MockIsmpDispatcher { @@ -280,16 +290,16 @@ impl ismp::dispatcher::IsmpDispatcher for MockIsmpDispatcher { fn dispatch_request( &self, - request: ismp::dispatcher::DispatchRequest, - fee: ismp::dispatcher::FeeMetadata, + _request: ismp::dispatcher::DispatchRequest, + _fee: ismp::dispatcher::FeeMetadata, ) -> Result { Ok(Default::default()) } fn dispatch_response( &self, - response: ismp::router::PostResponse, - fee: ismp::dispatcher::FeeMetadata, + _response: ismp::router::PostResponse, + _fee: ismp::dispatcher::FeeMetadata, ) -> Result { Ok(Default::default()) } diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 910337902..c28026519 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -136,6 +136,7 @@ impl messaging::Config for Runtime { type OriginConverter = LocalOriginToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; + type WeightToFee = ::WeightToFee; type Xcm = QueryHandler; type XcmResponseOrigin = EnsureResponse; } @@ -525,4 +526,21 @@ mod tests { assert!(Filter::::contains(read)) } } + + mod callback_executor { + use pallet_api::messaging::CallbackExecutor; + + use super::*; + + #[test] + fn callback_executor_weight_is_more_than_zero() { + let rt_weight = + ::CallbackExecutor::execution_weight(); + let struct_weight = super::super::CallbackExecutor::execution_weight(); + + // assert that the right struct is being used. + assert_eq!(rt_weight, struct_weight); + assert!(!rt_weight.any_eq(Zero::zero())) + } + } } diff --git a/runtime/testnet/src/config/api/mod.rs b/runtime/testnet/src/config/api/mod.rs index 5b309752a..ef433ed6c 100644 --- a/runtime/testnet/src/config/api/mod.rs +++ b/runtime/testnet/src/config/api/mod.rs @@ -114,6 +114,7 @@ impl messaging::Config for Runtime { type OriginConverter = LocalOriginToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; + type WeightToFee = ::WeightToFee; type Xcm = QueryHandler; type XcmResponseOrigin = EnsureResponse; } From 45082d84e94eba0e879f94e2d87d8c99360b3a80 Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Thu, 3 Apr 2025 13:49:20 +0100 Subject: [PATCH 28/38] Messaging ismp core (#506) * messaging mock impl * query status refactor, fix stuck deposits, write first test * remove tests 1 * refactor remove extrinsic for better testing * second refactor, much better * fmt * fmt, fixes, test, benchmark * refactor storage deposits * check warnings * fmt * Off chain and on chain byte fees * fmt * comments * remove useless test * fmt * fix * moar tests * xcm-new-query benchmark * fmt * refactor response status * xcm timeouts * refactor to original format * fix tests * tests * moar tests, hooks, xcm_response * fmt * xcm_response benchmark * fmt * fix * fmt * lock * make callback events unit testable * failing test for imbalance handler * call tests * comments * fmt * add the new weight to fee config, config test * fmt * response benchmark finallyl * benchmarks, tests, mock ismp impl for commitments * fmt * another test * fmt * ismp post tests * process response refactor * p2 * basic tests 1 * fmt * tests-2 * fixes, signed ismp, fee comments * finale benchmark * fmt * handle resposne timeout * fmt * ismp relayer fee as config item * fmt * benchmarks 2 * fmt * Update pallets/api/src/messaging/benchmarking.rs Co-authored-by: Peter White * comments, utils refactor * fmt lock --------- Co-authored-by: Peter White --- Cargo.lock | 977 ++++++++++--------- pallets/api/Cargo.toml | 4 +- pallets/api/src/messaging/benchmarking.rs | 258 ++++- pallets/api/src/messaging/mod.rs | 40 +- pallets/api/src/messaging/test_utils.rs | 67 ++ pallets/api/src/messaging/tests.rs | 327 ++++++- pallets/api/src/messaging/transports/ismp.rs | 112 ++- pallets/api/src/mock.rs | 79 +- 8 files changed, 1317 insertions(+), 547 deletions(-) create mode 100644 pallets/api/src/messaging/test_utils.rs diff --git a/Cargo.lock b/Cargo.lock index e8050b701..41d77a57a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -770,7 +770,7 @@ dependencies = [ [[package]] name = "binary-merkle-tree" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "hash-db", "log", @@ -931,9 +931,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17679a8d69b6d7fd9cd9801a536cec9fa5e5970b69f9d4747f70b39b031f5e7" +checksum = "389a099b34312839e16420d499a9cad9650541715937ffbdd40d36f49e77eeb3" dependencies = [ "arrayref", "arrayvec 0.7.6", @@ -1041,7 +1041,7 @@ dependencies = [ [[package]] name = "bp-xcm-bridge-hub-router" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -1332,9 +1332,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" dependencies = [ "clap_builder", "clap_derive", @@ -1342,9 +1342,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" dependencies = [ "anstream", "anstyle", @@ -1906,7 +1906,7 @@ dependencies = [ [[package]] name = "cumulus-client-cli" version = "0.21.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "clap", "parity-scale-codec", @@ -1923,7 +1923,7 @@ dependencies = [ [[package]] name = "cumulus-client-collator" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-client-consensus-common", "cumulus-client-network", @@ -1946,7 +1946,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-aura" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-client-collator", @@ -1992,7 +1992,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-common" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-client-pov-recovery", @@ -2022,7 +2022,7 @@ dependencies = [ [[package]] name = "cumulus-client-consensus-proposer" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "anyhow", "async-trait", @@ -2037,7 +2037,7 @@ dependencies = [ [[package]] name = "cumulus-client-network" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-relay-chain-interface", @@ -2063,7 +2063,7 @@ dependencies = [ [[package]] name = "cumulus-client-parachain-inherent" version = "0.15.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2085,7 +2085,7 @@ dependencies = [ [[package]] name = "cumulus-client-pov-recovery" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2111,7 +2111,7 @@ dependencies = [ [[package]] name = "cumulus-client-service" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-client-cli", "cumulus-client-collator", @@ -2148,7 +2148,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-aura-ext" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-pallet-parachain-system", "frame-support", @@ -2164,8 +2164,8 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system" -version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.18.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bytes", "cumulus-pallet-parachain-system-proc-macro", @@ -2201,7 +2201,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-parachain-system-proc-macro" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -2212,7 +2212,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-session-benchmarking" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -2225,7 +2225,7 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcm" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2239,8 +2239,8 @@ dependencies = [ [[package]] name = "cumulus-pallet-xcmp-queue" -version = "0.18.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.18.2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bounded-collections", "bp-xcm-bridge-hub-router", @@ -2265,7 +2265,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-aura" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "sp-api", "sp-consensus-aura", @@ -2274,7 +2274,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-core" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "polkadot-core-primitives", @@ -2290,7 +2290,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-parachain-inherent" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2304,7 +2304,7 @@ dependencies = [ [[package]] name = "cumulus-primitives-proof-size-hostfunction" version = "0.11.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "sp-externalities", "sp-runtime-interface", @@ -2313,8 +2313,8 @@ dependencies = [ [[package]] name = "cumulus-primitives-storage-weight-reclaim" -version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "9.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-proof-size-hostfunction", @@ -2330,8 +2330,8 @@ dependencies = [ [[package]] name = "cumulus-primitives-utility" -version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.18.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -2348,7 +2348,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-inprocess-interface" version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2372,7 +2372,7 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-interface" version = "0.21.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2390,8 +2390,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-minimal-node" -version = "0.22.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.22.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "async-trait", @@ -2425,8 +2425,8 @@ dependencies = [ [[package]] name = "cumulus-relay-chain-rpc-interface" -version = "0.21.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.21.2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "cumulus-primitives-core", @@ -2467,7 +2467,7 @@ dependencies = [ [[package]] name = "cumulus-test-relay-sproof-builder" version = "0.17.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-primitives-core", "parity-scale-codec", @@ -2519,9 +2519,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.150" +version = "1.0.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1cf22155cf6a8e0b0536efc30c775eadd7a481c376d2d7e30daf0825a42ef9" +checksum = "4b4ab2681454aacfe7ce296ebc6df86791009f237f8020b0c752e8b245ba7c1d" dependencies = [ "cc", "cxxbridge-cmd", @@ -2533,9 +2533,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.150" +version = "1.0.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4e07e3a69db032f03450594e53785a5d6b1d787c2ad5b901d9347f0064af94" +checksum = "5e431f7ba795550f2b11c32509b3b35927d899f0ad13a1d1e030a317a08facbe" dependencies = [ "cc", "codespan-reporting", @@ -2547,9 +2547,9 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.150" +version = "1.0.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e9ff9c627d3abe06190462f7db81fb6cc12f3424ea081c2a8c9ed7a8cc167a" +checksum = "7cbc41933767955d04c2a90151806029b93df5fd8b682ba22a967433347480a9" dependencies = [ "clap", "codespan-reporting", @@ -2560,15 +2560,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.150" +version = "1.0.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e6417f4e1518ded330e088d5a66f50fbae9bbc96840e147058ae44970a2b51a" +checksum = "9133547634329a5b76e5f58d1e53c16d627699bbcd421b9007796311165f9667" [[package]] name = "cxxbridge-macro" -version = "1.0.150" +version = "1.0.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "856ff0dba6e023dd78189c8f4667126842dfe88392b5d4e94118bd18b8f2afbf" +checksum = "53e89d77ad5fd6066a3d42d94de3f72a2f23f95006da808177624429b5183596" dependencies = [ "proc-macro2", "quote", @@ -2588,12 +2588,12 @@ dependencies = [ [[package]] name = "darling" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" dependencies = [ - "darling_core 0.20.10", - "darling_macro 0.20.10", + "darling_core 0.20.11", + "darling_macro 0.20.11", ] [[package]] @@ -2612,9 +2612,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" dependencies = [ "fnv", "ident_case", @@ -2637,11 +2637,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.20.10" +version = "0.20.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" dependencies = [ - "darling_core 0.20.10", + "darling_core 0.20.11", "quote", "syn 2.0.100", ] @@ -3177,9 +3177,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697" +checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f" dependencies = [ "anstream", "anstyle", @@ -3281,9 +3281,9 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ "event-listener 5.4.0", "pin-project-lite", @@ -3496,7 +3496,7 @@ checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "fork-tree" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", ] @@ -3540,7 +3540,7 @@ checksum = "28dd6caf6059519a65843af8fe2a3ae298b14b80179855aeb4adc2c1934ee619" [[package]] name = "frame-benchmarking" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-support-procedural", @@ -3563,8 +3563,8 @@ dependencies = [ [[package]] name = "frame-benchmarking-cli" -version = "46.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "46.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "Inflector", "array-bytes", @@ -3626,7 +3626,7 @@ dependencies = [ [[package]] name = "frame-election-provider-solution-type" version = "14.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -3637,7 +3637,7 @@ dependencies = [ [[package]] name = "frame-election-provider-support" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-election-provider-solution-type", "frame-support", @@ -3652,8 +3652,8 @@ dependencies = [ [[package]] name = "frame-executive" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "aquamarine", "frame-support", @@ -3706,7 +3706,7 @@ dependencies = [ [[package]] name = "frame-metadata-hash-extension" version = "0.7.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "const-hex", @@ -3721,8 +3721,8 @@ dependencies = [ [[package]] name = "frame-support" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "aquamarine", "array-bytes", @@ -3764,8 +3764,8 @@ dependencies = [ [[package]] name = "frame-support-procedural" -version = "31.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "31.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "Inflector", "cfg-expr", @@ -3785,7 +3785,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support-procedural-tools-derive", "proc-macro-crate 3.3.0", @@ -3797,7 +3797,7 @@ dependencies = [ [[package]] name = "frame-support-procedural-tools-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "proc-macro2", "quote", @@ -3807,7 +3807,7 @@ dependencies = [ [[package]] name = "frame-system" version = "39.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cfg-if", "docify", @@ -3827,7 +3827,7 @@ dependencies = [ [[package]] name = "frame-system-benchmarking" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -3841,7 +3841,7 @@ dependencies = [ [[package]] name = "frame-system-rpc-runtime-api" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "parity-scale-codec", @@ -3851,7 +3851,7 @@ dependencies = [ [[package]] name = "frame-try-runtime" version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "parity-scale-codec", @@ -4150,6 +4150,10 @@ name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +dependencies = [ + "fallible-iterator 0.3.0", + "stable_deref_trait", +] [[package]] name = "glob" @@ -4581,7 +4585,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.5.8", + "socket2 0.5.9", "tokio", "tower-service", "tracing", @@ -4661,9 +4665,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" dependencies = [ "bytes", "futures-channel", @@ -4671,8 +4675,9 @@ dependencies = [ "http 1.3.1", "http-body 1.0.1", "hyper 1.6.0", + "libc", "pin-project-lite", - "socket2 0.5.8", + "socket2 0.5.9", "tokio", "tower-service", "tracing", @@ -4695,9 +4700,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.62" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2fd658b06e56721792c5df4475705b6cda790e9298d19d2f8af083457bcd127" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -4705,7 +4710,7 @@ dependencies = [ "js-sys", "log", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core 0.61.0", ] [[package]] @@ -4758,9 +4763,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" [[package]] name = "icu_normalizer" @@ -4782,9 +4787,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" [[package]] name = "icu_properties" @@ -4803,9 +4808,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" [[package]] name = "icu_provider" @@ -5099,7 +5104,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.8", + "socket2 0.5.9", "widestring", "windows-sys 0.48.0", "winreg", @@ -5313,10 +5318,11 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.2", "libc", ] @@ -5985,7 +5991,7 @@ dependencies = [ "log", "rand 0.8.5", "smallvec", - "socket2 0.5.8", + "socket2 0.5.9", "tokio", "trust-dns-proto 0.22.0", "void", @@ -6070,7 +6076,7 @@ dependencies = [ "rand 0.8.5", "ring 0.16.20", "rustls 0.21.12", - "socket2 0.5.8", + "socket2 0.5.9", "thiserror 1.0.69", "tokio", ] @@ -6142,7 +6148,7 @@ dependencies = [ "libp2p-core", "libp2p-identity", "log", - "socket2 0.5.8", + "socket2 0.5.9", "tokio", ] @@ -6423,7 +6429,7 @@ dependencies = [ "simple-dns", "smallvec", "snow", - "socket2 0.5.8", + "socket2 0.5.9", "thiserror 2.0.12", "tokio", "tokio-stream", @@ -6713,7 +6719,7 @@ dependencies = [ [[package]] name = "mmr-gadget" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "log", @@ -6732,7 +6738,7 @@ dependencies = [ [[package]] name = "mmr-rpc" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "jsonrpsee 0.24.9", "parity-scale-codec", @@ -7257,9 +7263,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "opaque-debug" @@ -7348,6 +7354,7 @@ dependencies = [ "pallet-balances", "pallet-ismp", "pallet-nfts 31.0.0", + "pallet-timestamp", "pallet-xcm", "parity-scale-codec", "pop-chain-extension", @@ -7363,8 +7370,8 @@ dependencies = [ [[package]] name = "pallet-asset-conversion" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7381,8 +7388,8 @@ dependencies = [ [[package]] name = "pallet-asset-rate" -version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7395,8 +7402,8 @@ dependencies = [ [[package]] name = "pallet-asset-tx-payment" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7412,8 +7419,8 @@ dependencies = [ [[package]] name = "pallet-assets" -version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "41.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7428,8 +7435,8 @@ dependencies = [ [[package]] name = "pallet-aura" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -7445,7 +7452,7 @@ dependencies = [ [[package]] name = "pallet-authority-discovery" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -7460,7 +7467,7 @@ dependencies = [ [[package]] name = "pallet-authorship" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -7472,8 +7479,8 @@ dependencies = [ [[package]] name = "pallet-babe" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7496,7 +7503,7 @@ dependencies = [ [[package]] name = "pallet-bags-list" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "aquamarine", "docify", @@ -7516,8 +7523,8 @@ dependencies = [ [[package]] name = "pallet-balances" -version = "40.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -7531,8 +7538,8 @@ dependencies = [ [[package]] name = "pallet-beefy" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -7550,8 +7557,8 @@ dependencies = [ [[package]] name = "pallet-beefy-mmr" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "binary-merkle-tree", @@ -7575,8 +7582,8 @@ dependencies = [ [[package]] name = "pallet-bounties" -version = "38.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7593,7 +7600,7 @@ dependencies = [ [[package]] name = "pallet-broker" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "frame-benchmarking", @@ -7610,8 +7617,8 @@ dependencies = [ [[package]] name = "pallet-child-bounties" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7628,8 +7635,8 @@ dependencies = [ [[package]] name = "pallet-collator-selection" -version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "20.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7647,8 +7654,8 @@ dependencies = [ [[package]] name = "pallet-collective" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -7664,8 +7671,8 @@ dependencies = [ [[package]] name = "pallet-contracts" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitflags 1.3.2", "environmental", @@ -7698,7 +7705,7 @@ dependencies = [ [[package]] name = "pallet-contracts-proc-macro" version = "23.0.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "proc-macro2", "quote", @@ -7708,7 +7715,7 @@ dependencies = [ [[package]] name = "pallet-contracts-uapi" version = "12.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -7718,8 +7725,8 @@ dependencies = [ [[package]] name = "pallet-conviction-voting" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "assert_matches", "frame-benchmarking", @@ -7734,8 +7741,8 @@ dependencies = [ [[package]] name = "pallet-delegated-staking" -version = "6.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "6.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -7749,8 +7756,8 @@ dependencies = [ [[package]] name = "pallet-democracy" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7766,8 +7773,8 @@ dependencies = [ [[package]] name = "pallet-election-provider-multi-phase" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7789,7 +7796,7 @@ dependencies = [ [[package]] name = "pallet-election-provider-support-benchmarking" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -7801,8 +7808,8 @@ dependencies = [ [[package]] name = "pallet-elections-phragmen" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7819,8 +7826,8 @@ dependencies = [ [[package]] name = "pallet-fast-unstake" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -7837,8 +7844,8 @@ dependencies = [ [[package]] name = "pallet-grandpa" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7859,8 +7866,8 @@ dependencies = [ [[package]] name = "pallet-identity" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "enumflags2", "frame-benchmarking", @@ -7875,8 +7882,8 @@ dependencies = [ [[package]] name = "pallet-im-online" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7894,8 +7901,8 @@ dependencies = [ [[package]] name = "pallet-indices" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7978,7 +7985,7 @@ dependencies = [ [[package]] name = "pallet-membership" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -7994,7 +8001,7 @@ dependencies = [ [[package]] name = "pallet-message-queue" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "environmental", "frame-benchmarking", @@ -8012,8 +8019,8 @@ dependencies = [ [[package]] name = "pallet-migrations" -version = "9.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "9.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cfg-if", "docify", @@ -8031,7 +8038,7 @@ dependencies = [ [[package]] name = "pallet-mmr" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8064,8 +8071,8 @@ dependencies = [ [[package]] name = "pallet-multisig" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "log", "parity-scale-codec", @@ -8075,15 +8082,15 @@ dependencies = [ [[package]] name = "pallet-nft-fractionalization" -version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "22.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", "frame-system", "log", "pallet-assets", - "pallet-nfts 33.0.0", + "pallet-nfts 33.1.0", "parity-scale-codec", "scale-info", "sp-runtime", @@ -8109,8 +8116,8 @@ dependencies = [ [[package]] name = "pallet-nfts" -version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "33.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "enumflags2", "frame-benchmarking", @@ -8127,17 +8134,17 @@ dependencies = [ [[package]] name = "pallet-nfts-runtime-api" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ - "pallet-nfts 33.0.0", + "pallet-nfts 33.1.0", "parity-scale-codec", "sp-api", ] [[package]] name = "pallet-nis" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8151,8 +8158,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools" -version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "37.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -8169,8 +8176,8 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-benchmarking" -version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "37.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8190,7 +8197,7 @@ dependencies = [ [[package]] name = "pallet-nomination-pools-runtime-api" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "pallet-nomination-pools", "parity-scale-codec", @@ -8200,7 +8207,7 @@ dependencies = [ [[package]] name = "pallet-offences" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -8215,8 +8222,8 @@ dependencies = [ [[package]] name = "pallet-offences-benchmarking" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8238,8 +8245,8 @@ dependencies = [ [[package]] name = "pallet-parameters" -version = "0.10.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.10.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -8255,8 +8262,8 @@ dependencies = [ [[package]] name = "pallet-preimage" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8271,8 +8278,8 @@ dependencies = [ [[package]] name = "pallet-proxy" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "polkadot-sdk-frame", @@ -8282,7 +8289,7 @@ dependencies = [ [[package]] name = "pallet-ranked-collective" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8299,8 +8306,8 @@ dependencies = [ [[package]] name = "pallet-recovery" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8313,8 +8320,8 @@ dependencies = [ [[package]] name = "pallet-referenda" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "assert_matches", "frame-benchmarking", @@ -8332,7 +8339,7 @@ dependencies = [ [[package]] name = "pallet-revive" version = "0.3.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitflags 1.3.2", "derive_more 0.99.19", @@ -8346,6 +8353,7 @@ dependencies = [ "jsonrpsee 0.24.9", "log", "pallet-balances", + "pallet-revive-fixtures", "pallet-revive-proc-macro", "pallet-revive-uapi", "pallet-transaction-payment", @@ -8367,10 +8375,27 @@ dependencies = [ "subxt-signer", ] +[[package]] +name = "pallet-revive-fixtures" +version = "0.3.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" +dependencies = [ + "anyhow", + "frame-system", + "log", + "parity-wasm", + "polkavm-linker 0.14.0", + "sp-core", + "sp-io", + "sp-runtime", + "tempfile", + "toml 0.8.20", +] + [[package]] name = "pallet-revive-proc-macro" version = "0.1.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "proc-macro2", "quote", @@ -8380,7 +8405,7 @@ dependencies = [ [[package]] name = "pallet-revive-uapi" version = "0.2.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitflags 1.3.2", "parity-scale-codec", @@ -8392,7 +8417,7 @@ dependencies = [ [[package]] name = "pallet-root-testing" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -8405,8 +8430,8 @@ dependencies = [ [[package]] name = "pallet-scheduler" -version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "40.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -8423,7 +8448,7 @@ dependencies = [ [[package]] name = "pallet-session" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -8443,8 +8468,8 @@ dependencies = [ [[package]] name = "pallet-session-benchmarking" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8459,8 +8484,8 @@ dependencies = [ [[package]] name = "pallet-society" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8476,8 +8501,8 @@ dependencies = [ [[package]] name = "pallet-staking" -version = "39.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-election-provider-support", @@ -8499,7 +8524,7 @@ dependencies = [ [[package]] name = "pallet-staking-reward-fn" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "log", "sp-arithmetic", @@ -8508,7 +8533,7 @@ dependencies = [ [[package]] name = "pallet-staking-runtime-api" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "sp-api", @@ -8517,8 +8542,8 @@ dependencies = [ [[package]] name = "pallet-state-trie-migration" -version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "43.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8534,7 +8559,7 @@ dependencies = [ [[package]] name = "pallet-sudo" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -8549,7 +8574,7 @@ dependencies = [ [[package]] name = "pallet-timestamp" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -8567,8 +8592,8 @@ dependencies = [ [[package]] name = "pallet-tips" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8585,8 +8610,8 @@ dependencies = [ [[package]] name = "pallet-transaction-payment" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8602,7 +8627,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "jsonrpsee 0.24.9", "pallet-transaction-payment-rpc-runtime-api", @@ -8618,7 +8643,7 @@ dependencies = [ [[package]] name = "pallet-transaction-payment-rpc-runtime-api" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "pallet-transaction-payment", "parity-scale-codec", @@ -8629,8 +8654,8 @@ dependencies = [ [[package]] name = "pallet-treasury" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -8648,8 +8673,8 @@ dependencies = [ [[package]] name = "pallet-utility" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8663,8 +8688,8 @@ dependencies = [ [[package]] name = "pallet-vesting" -version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "39.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8677,8 +8702,8 @@ dependencies = [ [[package]] name = "pallet-whitelist" -version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "38.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8691,8 +8716,8 @@ dependencies = [ [[package]] name = "pallet-xcm" -version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bounded-collections", "frame-benchmarking", @@ -8714,8 +8739,8 @@ dependencies = [ [[package]] name = "pallet-xcm-benchmarks" -version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-benchmarking", "frame-support", @@ -8733,7 +8758,7 @@ dependencies = [ [[package]] name = "parachains-common" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-primitives-core", "cumulus-primitives-utility", @@ -9064,7 +9089,7 @@ checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polkadot-approval-distribution" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "futures", @@ -9083,7 +9108,7 @@ dependencies = [ [[package]] name = "polkadot-availability-bitfield-distribution" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "always-assert", "futures", @@ -9099,7 +9124,7 @@ dependencies = [ [[package]] name = "polkadot-availability-distribution" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "derive_more 0.99.19", "fatality", @@ -9123,7 +9148,7 @@ dependencies = [ [[package]] name = "polkadot-availability-recovery" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "fatality", @@ -9156,7 +9181,7 @@ dependencies = [ [[package]] name = "polkadot-cli" version = "22.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cfg-if", "clap", @@ -9184,7 +9209,7 @@ dependencies = [ [[package]] name = "polkadot-collator-protocol" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "fatality", @@ -9207,7 +9232,7 @@ dependencies = [ [[package]] name = "polkadot-core-primitives" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -9218,7 +9243,7 @@ dependencies = [ [[package]] name = "polkadot-dispute-distribution" version = "21.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "derive_more 0.99.19", "fatality", @@ -9243,7 +9268,7 @@ dependencies = [ [[package]] name = "polkadot-erasure-coding" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "polkadot-node-primitives", @@ -9257,7 +9282,7 @@ dependencies = [ [[package]] name = "polkadot-gossip-support" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "futures-timer", @@ -9279,7 +9304,7 @@ dependencies = [ [[package]] name = "polkadot-network-bridge" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "always-assert", "async-trait", @@ -9302,7 +9327,7 @@ dependencies = [ [[package]] name = "polkadot-node-collation-generation" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "parity-scale-codec", @@ -9321,7 +9346,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "bitvec", @@ -9354,7 +9379,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-approval-voting-parallel" version = "0.4.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -9384,7 +9409,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-av-store" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "futures", @@ -9405,7 +9430,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-backing" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "fatality", @@ -9426,7 +9451,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-bitfield-signing" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "polkadot-node-subsystem", @@ -9440,8 +9465,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-candidate-validation" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -9463,7 +9488,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-api" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "polkadot-node-metrics", @@ -9477,7 +9502,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-chain-selection" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "futures-timer", @@ -9494,7 +9519,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-dispute-coordinator" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "fatality", "futures", @@ -9513,7 +9538,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-parachains-inherent" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -9530,7 +9555,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-prospective-parachains" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "fatality", "futures", @@ -9544,7 +9569,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-provisioner" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "fatality", @@ -9561,8 +9586,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "always-assert", "array-bytes", @@ -9592,7 +9617,7 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-checker" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "polkadot-node-primitives", @@ -9607,8 +9632,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-pvf-common" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "17.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cpu-time", "futures", @@ -9633,8 +9658,8 @@ dependencies = [ [[package]] name = "polkadot-node-core-runtime-api" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "polkadot-node-metrics", @@ -9648,8 +9673,8 @@ dependencies = [ [[package]] name = "polkadot-node-metrics" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bs58", "futures", @@ -9668,7 +9693,7 @@ dependencies = [ [[package]] name = "polkadot-node-network-protocol" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-channel 1.9.0", "async-trait", @@ -9692,8 +9717,8 @@ dependencies = [ [[package]] name = "polkadot-node-primitives" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "17.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "bounded-vec", @@ -9719,7 +9744,7 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "polkadot-node-subsystem-types", "polkadot-overseer", @@ -9727,8 +9752,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-types" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "bitvec", @@ -9756,8 +9781,8 @@ dependencies = [ [[package]] name = "polkadot-node-subsystem-util" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "derive_more 0.99.19", @@ -9791,8 +9816,8 @@ dependencies = [ [[package]] name = "polkadot-overseer" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -9814,7 +9839,7 @@ dependencies = [ [[package]] name = "polkadot-parachain-primitives" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bounded-collections", "derive_more 0.99.19", @@ -9829,8 +9854,8 @@ dependencies = [ [[package]] name = "polkadot-primitives" -version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "17.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "hex-literal", @@ -9858,7 +9883,7 @@ dependencies = [ [[package]] name = "polkadot-rpc" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "jsonrpsee 0.24.9", "mmr-rpc", @@ -9892,8 +9917,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-common" -version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitvec", "frame-benchmarking", @@ -9944,7 +9969,7 @@ dependencies = [ [[package]] name = "polkadot-runtime-metrics" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bs58", "frame-benchmarking", @@ -9955,8 +9980,8 @@ dependencies = [ [[package]] name = "polkadot-runtime-parachains" -version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bitflags 1.3.2", "bitvec", @@ -10004,8 +10029,8 @@ dependencies = [ [[package]] name = "polkadot-sdk-frame" -version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.8.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-benchmarking", @@ -10038,8 +10063,8 @@ dependencies = [ [[package]] name = "polkadot-service" -version = "22.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "22.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "frame-benchmarking", @@ -10147,7 +10172,7 @@ dependencies = [ [[package]] name = "polkadot-statement-distribution" version = "21.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "arrayvec 0.7.6", "bitvec", @@ -10170,7 +10195,7 @@ dependencies = [ [[package]] name = "polkadot-statement-table" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "polkadot-primitives", @@ -10324,6 +10349,21 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "polkavm-linker" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0959ac3b0f4fd5caf5c245c637705f19493efe83dba31a83bbba928b93b0116a" +dependencies = [ + "gimli 0.31.1", + "hashbrown 0.14.5", + "log", + "object 0.36.7", + "polkavm-common 0.14.0", + "regalloc2 0.9.3", + "rustc-demangle", +] + [[package]] name = "polkavm-linux-raw" version = "0.9.0" @@ -10395,7 +10435,7 @@ name = "pop-chain-extension" version = "0.1.0" dependencies = [ "contract-build", - "env_logger 0.11.7", + "env_logger 0.11.8", "frame-support", "frame-system", "impl-trait-for-tuples", @@ -10514,7 +10554,7 @@ dependencies = [ "pallet-message-queue", "pallet-motion", "pallet-multisig", - "pallet-nfts 33.0.0", + "pallet-nfts 33.1.0", "pallet-preimage", "pallet-proxy", "pallet-revive", @@ -10556,7 +10596,7 @@ dependencies = [ "cumulus-primitives-utility", "docify", "enumflags2", - "env_logger 0.11.7", + "env_logger 0.11.8", "frame-benchmarking", "frame-executive", "frame-metadata-hash-extension", @@ -10641,7 +10681,7 @@ dependencies = [ "cumulus-primitives-utility", "docify", "enumflags2", - "env_logger 0.11.7", + "env_logger 0.11.8", "frame-benchmarking", "frame-executive", "frame-metadata-hash-extension", @@ -10661,7 +10701,7 @@ dependencies = [ "pallet-message-queue", "pallet-motion", "pallet-multisig", - "pallet-nfts 33.0.0", + "pallet-nfts 33.1.0", "pallet-nfts-runtime-api", "pallet-preimage", "pallet-proxy", @@ -10721,7 +10761,7 @@ dependencies = [ "cumulus-primitives-utility", "docify", "enumflags2", - "env_logger 0.11.7", + "env_logger 0.11.8", "frame-benchmarking", "frame-executive", "frame-metadata-hash-extension", @@ -10750,7 +10790,7 @@ dependencies = [ "pallet-motion", "pallet-multisig", "pallet-nft-fractionalization", - "pallet-nfts 33.0.0", + "pallet-nfts 33.1.0", "pallet-nfts-runtime-api", "pallet-preimage", "pallet-proxy", @@ -11208,7 +11248,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.8", + "socket2 0.5.9", "tracing", "windows-sys 0.48.0", ] @@ -11594,8 +11634,8 @@ dependencies = [ [[package]] name = "rococo-runtime" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "binary-merkle-tree", "bitvec", @@ -11697,7 +11737,7 @@ dependencies = [ [[package]] name = "rococo-runtime-constants" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "polkadot-primitives", @@ -11840,9 +11880,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ "bitflags 2.9.0", "errno", @@ -12110,7 +12150,7 @@ dependencies = [ [[package]] name = "sc-allocator" version = "30.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "log", "sp-core", @@ -12121,7 +12161,7 @@ dependencies = [ [[package]] name = "sc-authority-discovery" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -12151,7 +12191,7 @@ dependencies = [ [[package]] name = "sc-basic-authorship" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "futures-timer", @@ -12173,7 +12213,7 @@ dependencies = [ [[package]] name = "sc-block-builder" version = "0.43.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "sp-api", @@ -12188,7 +12228,7 @@ dependencies = [ [[package]] name = "sc-chain-spec" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "docify", @@ -12215,7 +12255,7 @@ dependencies = [ [[package]] name = "sc-chain-spec-derive" version = "12.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -12225,8 +12265,8 @@ dependencies = [ [[package]] name = "sc-cli" -version = "0.50.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.50.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "chrono", @@ -12268,7 +12308,7 @@ dependencies = [ [[package]] name = "sc-client-api" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "fnv", "futures", @@ -12294,8 +12334,8 @@ dependencies = [ [[package]] name = "sc-client-db" -version = "0.45.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.45.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "hash-db", "kvdb", @@ -12321,7 +12361,7 @@ dependencies = [ [[package]] name = "sc-consensus" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -12345,7 +12385,7 @@ dependencies = [ [[package]] name = "sc-consensus-aura" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -12374,7 +12414,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "fork-tree", @@ -12410,7 +12450,7 @@ dependencies = [ [[package]] name = "sc-consensus-babe-rpc" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "jsonrpsee 0.24.9", @@ -12432,7 +12472,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12468,7 +12508,7 @@ dependencies = [ [[package]] name = "sc-consensus-beefy-rpc" version = "27.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "jsonrpsee 0.24.9", @@ -12488,7 +12528,7 @@ dependencies = [ [[package]] name = "sc-consensus-epochs" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "fork-tree", "parity-scale-codec", @@ -12501,7 +12541,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "ahash", "array-bytes", @@ -12545,7 +12585,7 @@ dependencies = [ [[package]] name = "sc-consensus-grandpa-rpc" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "finality-grandpa", "futures", @@ -12565,7 +12605,7 @@ dependencies = [ [[package]] name = "sc-consensus-slots" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -12588,7 +12628,7 @@ dependencies = [ [[package]] name = "sc-executor" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -12611,7 +12651,7 @@ dependencies = [ [[package]] name = "sc-executor-common" version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "polkavm 0.9.3", "sc-allocator", @@ -12624,7 +12664,7 @@ dependencies = [ [[package]] name = "sc-executor-polkavm" version = "0.33.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "log", "polkavm 0.9.3", @@ -12635,7 +12675,7 @@ dependencies = [ [[package]] name = "sc-executor-wasmtime" version = "0.36.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "anyhow", "cfg-if", @@ -12653,7 +12693,7 @@ dependencies = [ [[package]] name = "sc-informant" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "console", "futures", @@ -12670,7 +12710,7 @@ dependencies = [ [[package]] name = "sc-keystore" version = "34.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "parking_lot 0.12.3", @@ -12684,7 +12724,7 @@ dependencies = [ [[package]] name = "sc-mixnet" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "arrayvec 0.7.6", @@ -12712,8 +12752,8 @@ dependencies = [ [[package]] name = "sc-network" -version = "0.48.2" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.48.3" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12764,7 +12804,7 @@ dependencies = [ [[package]] name = "sc-network-common" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "bitflags 1.3.2", @@ -12782,7 +12822,7 @@ dependencies = [ [[package]] name = "sc-network-gossip" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "ahash", "futures", @@ -12801,7 +12841,7 @@ dependencies = [ [[package]] name = "sc-network-light" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12822,7 +12862,7 @@ dependencies = [ [[package]] name = "sc-network-sync" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "async-channel 1.9.0", @@ -12858,7 +12898,7 @@ dependencies = [ [[package]] name = "sc-network-transactions" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "futures", @@ -12876,8 +12916,8 @@ dependencies = [ [[package]] name = "sc-network-types" -version = "0.15.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.15.2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bs58", "ed25519-dalek", @@ -12894,7 +12934,7 @@ dependencies = [ [[package]] name = "sc-offchain" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "bytes", @@ -12931,7 +12971,7 @@ dependencies = [ [[package]] name = "sc-proposer-metrics" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "log", "substrate-prometheus-endpoint", @@ -12940,7 +12980,7 @@ dependencies = [ [[package]] name = "sc-rpc" version = "43.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "jsonrpsee 0.24.9", @@ -12972,7 +13012,7 @@ dependencies = [ [[package]] name = "sc-rpc-api" version = "0.47.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "jsonrpsee 0.24.9", "parity-scale-codec", @@ -12992,7 +13032,7 @@ dependencies = [ [[package]] name = "sc-rpc-server" version = "20.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "dyn-clone", "forwarded-header-value", @@ -13016,7 +13056,7 @@ dependencies = [ [[package]] name = "sc-rpc-spec-v2" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "futures", @@ -13048,7 +13088,7 @@ dependencies = [ [[package]] name = "sc-service" version = "0.49.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "directories", @@ -13112,7 +13152,7 @@ dependencies = [ [[package]] name = "sc-state-db" version = "0.37.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "log", "parity-scale-codec", @@ -13123,7 +13163,7 @@ dependencies = [ [[package]] name = "sc-storage-monitor" version = "0.23.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "clap", "fs4", @@ -13136,7 +13176,7 @@ dependencies = [ [[package]] name = "sc-sync-state-rpc" version = "0.48.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "jsonrpsee 0.24.9", "parity-scale-codec", @@ -13155,7 +13195,7 @@ dependencies = [ [[package]] name = "sc-sysinfo" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "derive_more 0.99.19", "futures", @@ -13176,7 +13216,7 @@ dependencies = [ [[package]] name = "sc-telemetry" version = "28.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "chrono", "futures", @@ -13196,7 +13236,7 @@ dependencies = [ [[package]] name = "sc-tracing" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "chrono", "console", @@ -13224,7 +13264,7 @@ dependencies = [ [[package]] name = "sc-tracing-proc-macro" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "proc-macro-crate 3.3.0", "proc-macro2", @@ -13235,7 +13275,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool" version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -13266,7 +13306,7 @@ dependencies = [ [[package]] name = "sc-transaction-pool-api" version = "38.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -13282,7 +13322,7 @@ dependencies = [ [[package]] name = "sc-utils" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-channel 1.9.0", "futures", @@ -13353,7 +13393,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef2618f123c88da9cd8853b69d766068f1eddc7692146d7dfe9b89e25ce2efd" dependencies = [ - "darling 0.20.10", + "darling 0.20.11", "proc-macro-crate 3.3.0", "proc-macro2", "quote", @@ -13940,7 +13980,7 @@ checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "slot-range-helper" version = "16.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "enumn", "parity-scale-codec", @@ -14213,9 +14253,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", @@ -14255,7 +14295,7 @@ dependencies = [ [[package]] name = "sp-api" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "hash-db", @@ -14277,7 +14317,7 @@ dependencies = [ [[package]] name = "sp-api-proc-macro" version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "Inflector", "blake2 0.10.6", @@ -14291,7 +14331,7 @@ dependencies = [ [[package]] name = "sp-application-crypto" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -14303,7 +14343,7 @@ dependencies = [ [[package]] name = "sp-arithmetic" version = "26.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "integer-sqrt", @@ -14317,7 +14357,7 @@ dependencies = [ [[package]] name = "sp-authority-discovery" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -14329,7 +14369,7 @@ dependencies = [ [[package]] name = "sp-block-builder" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "sp-api", "sp-inherents", @@ -14339,7 +14379,7 @@ dependencies = [ [[package]] name = "sp-blockchain" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "futures", "parity-scale-codec", @@ -14358,7 +14398,7 @@ dependencies = [ [[package]] name = "sp-consensus" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "futures", @@ -14373,7 +14413,7 @@ dependencies = [ [[package]] name = "sp-consensus-aura" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "parity-scale-codec", @@ -14389,7 +14429,7 @@ dependencies = [ [[package]] name = "sp-consensus-babe" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "parity-scale-codec", @@ -14407,7 +14447,7 @@ dependencies = [ [[package]] name = "sp-consensus-beefy" version = "23.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -14427,7 +14467,7 @@ dependencies = [ [[package]] name = "sp-consensus-grandpa" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "finality-grandpa", "log", @@ -14444,7 +14484,7 @@ dependencies = [ [[package]] name = "sp-consensus-slots" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -14455,7 +14495,7 @@ dependencies = [ [[package]] name = "sp-core" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "bitflags 1.3.2", @@ -14515,7 +14555,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "blake2b_simd", "byteorder", @@ -14528,7 +14568,7 @@ dependencies = [ [[package]] name = "sp-crypto-hashing-proc-macro" version = "0.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "quote", "sp-crypto-hashing 0.1.0 (git+https://github.com/paritytech/polkadot-sdk?branch=stable2412)", @@ -14538,7 +14578,7 @@ dependencies = [ [[package]] name = "sp-database" version = "10.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "kvdb", "parking_lot 0.12.3", @@ -14547,7 +14587,7 @@ dependencies = [ [[package]] name = "sp-debug-derive" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "proc-macro2", "quote", @@ -14557,7 +14597,7 @@ dependencies = [ [[package]] name = "sp-externalities" version = "0.30.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "environmental", "parity-scale-codec", @@ -14567,7 +14607,7 @@ dependencies = [ [[package]] name = "sp-genesis-builder" version = "0.16.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -14579,7 +14619,7 @@ dependencies = [ [[package]] name = "sp-inherents" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "impl-trait-for-tuples", @@ -14592,7 +14632,7 @@ dependencies = [ [[package]] name = "sp-io" version = "39.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bytes", "docify", @@ -14618,7 +14658,7 @@ dependencies = [ [[package]] name = "sp-keyring" version = "40.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "sp-core", "sp-runtime", @@ -14628,7 +14668,7 @@ dependencies = [ [[package]] name = "sp-keystore" version = "0.41.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "parking_lot 0.12.3", @@ -14639,7 +14679,7 @@ dependencies = [ [[package]] name = "sp-maybe-compressed-blob" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "thiserror 1.0.69", "zstd 0.12.4", @@ -14648,7 +14688,7 @@ dependencies = [ [[package]] name = "sp-metadata-ir" version = "0.8.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-metadata 18.0.0", "parity-scale-codec", @@ -14658,7 +14698,7 @@ dependencies = [ [[package]] name = "sp-mixnet" version = "0.13.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -14669,7 +14709,7 @@ dependencies = [ [[package]] name = "sp-mmr-primitives" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "log", "parity-scale-codec", @@ -14686,7 +14726,7 @@ dependencies = [ [[package]] name = "sp-npos-elections" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -14699,7 +14739,7 @@ dependencies = [ [[package]] name = "sp-offchain" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "sp-api", "sp-core", @@ -14709,7 +14749,7 @@ dependencies = [ [[package]] name = "sp-panic-handler" version = "13.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "backtrace", "regex", @@ -14718,7 +14758,7 @@ dependencies = [ [[package]] name = "sp-rpc" version = "33.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "rustc-hash 1.1.0", "serde", @@ -14728,7 +14768,7 @@ dependencies = [ [[package]] name = "sp-runtime" version = "40.1.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "binary-merkle-tree", "docify", @@ -14757,7 +14797,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface" version = "29.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bytes", "impl-trait-for-tuples", @@ -14776,7 +14816,7 @@ dependencies = [ [[package]] name = "sp-runtime-interface-proc-macro" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "Inflector", "expander", @@ -14789,7 +14829,7 @@ dependencies = [ [[package]] name = "sp-session" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "scale-info", @@ -14803,7 +14843,7 @@ dependencies = [ [[package]] name = "sp-staking" version = "37.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "impl-trait-for-tuples", "parity-scale-codec", @@ -14816,7 +14856,7 @@ dependencies = [ [[package]] name = "sp-state-machine" version = "0.44.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "hash-db", "log", @@ -14836,7 +14876,7 @@ dependencies = [ [[package]] name = "sp-statement-store" version = "19.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "aes-gcm", "curve25519-dalek", @@ -14860,12 +14900,12 @@ dependencies = [ [[package]] name = "sp-std" version = "14.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" [[package]] name = "sp-storage" version = "22.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -14877,7 +14917,7 @@ dependencies = [ [[package]] name = "sp-timestamp" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "parity-scale-codec", @@ -14889,7 +14929,7 @@ dependencies = [ [[package]] name = "sp-tracing" version = "17.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "tracing", @@ -14900,7 +14940,7 @@ dependencies = [ [[package]] name = "sp-transaction-pool" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "sp-api", "sp-runtime", @@ -14909,7 +14949,7 @@ dependencies = [ [[package]] name = "sp-transaction-storage-proof" version = "35.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "async-trait", "parity-scale-codec", @@ -14923,7 +14963,7 @@ dependencies = [ [[package]] name = "sp-trie" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "ahash", "hash-db", @@ -14945,7 +14985,7 @@ dependencies = [ [[package]] name = "sp-version" version = "38.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "impl-serde 0.5.0", "parity-scale-codec", @@ -14962,7 +15002,7 @@ dependencies = [ [[package]] name = "sp-version-proc-macro" version = "15.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "parity-scale-codec", "proc-macro-warning 1.84.1", @@ -14974,7 +15014,7 @@ dependencies = [ [[package]] name = "sp-wasm-interface" version = "21.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "anyhow", "impl-trait-for-tuples", @@ -14986,7 +15026,7 @@ dependencies = [ [[package]] name = "sp-weights" version = "31.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "bounded-collections", "parity-scale-codec", @@ -15052,7 +15092,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "staging-parachain-info" version = "0.18.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "cumulus-primitives-core", "frame-support", @@ -15064,8 +15104,8 @@ dependencies = [ [[package]] name = "staging-xcm" -version = "15.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "15.0.2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "bounded-collections", @@ -15085,8 +15125,8 @@ dependencies = [ [[package]] name = "staging-xcm-builder" -version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "18.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "frame-system", @@ -15107,8 +15147,8 @@ dependencies = [ [[package]] name = "staging-xcm-executor" -version = "18.0.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "18.0.2" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "environmental", "frame-benchmarking", @@ -15226,7 +15266,7 @@ dependencies = [ [[package]] name = "substrate-bip39" version = "0.6.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "hmac 0.12.1", "pbkdf2", @@ -15238,12 +15278,12 @@ dependencies = [ [[package]] name = "substrate-build-script-utils" version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" [[package]] name = "substrate-frame-rpc-system" version = "42.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "docify", "frame-system-rpc-runtime-api", @@ -15263,7 +15303,7 @@ dependencies = [ [[package]] name = "substrate-prometheus-endpoint" version = "0.17.1" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "http-body-util", "hyper 1.6.0", @@ -15296,7 +15336,7 @@ dependencies = [ [[package]] name = "substrate-state-trie-migration-rpc" version = "41.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "jsonrpsee 0.24.9", "parity-scale-codec", @@ -15313,7 +15353,7 @@ dependencies = [ [[package]] name = "substrate-wasm-builder" version = "25.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "array-bytes", "build-helper", @@ -15325,7 +15365,7 @@ dependencies = [ "merkleized-metadata", "parity-scale-codec", "parity-wasm", - "polkavm-linker", + "polkavm-linker 0.9.2", "sc-executor", "shlex", "sp-core", @@ -15465,7 +15505,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c195f803d70687e409aba9be6c87115b5da8952cd83c4d13f2e043239818fcd" dependencies = [ - "darling 0.20.10", + "darling 0.20.11", "parity-scale-codec", "proc-macro-error", "quote", @@ -15598,7 +15638,7 @@ dependencies = [ "fastrand 2.3.0", "getrandom 0.3.2", "once_cell", - "rustix 1.0.3", + "rustix 1.0.5", "windows-sys 0.59.0", ] @@ -15627,7 +15667,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix 1.0.3", + "rustix 1.0.5", "windows-sys 0.59.0", ] @@ -15821,7 +15861,7 @@ dependencies = [ "parking_lot 0.12.3", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.8", + "socket2 0.5.9", "tokio-macros", "windows-sys 0.52.0", ] @@ -16042,7 +16082,7 @@ dependencies = [ [[package]] name = "tracing-gum" version = "17.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "coarsetime", "polkadot-primitives", @@ -16053,7 +16093,7 @@ dependencies = [ [[package]] name = "tracing-gum-proc-macro" version = "5.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "expander", "proc-macro-crate 3.3.0", @@ -17004,8 +17044,8 @@ dependencies = [ [[package]] name = "westend-runtime" -version = "21.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "21.1.0" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "binary-merkle-tree", "bitvec", @@ -17115,7 +17155,7 @@ dependencies = [ [[package]] name = "westend-runtime-constants" version = "18.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "polkadot-primitives", @@ -17222,10 +17262,45 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" dependencies = [ - "windows-result", + "windows-result 0.1.2", "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result 0.3.2", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.100", +] + [[package]] name = "windows-link" version = "0.1.1" @@ -17241,6 +17316,24 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.45.0" @@ -17558,8 +17651,8 @@ dependencies = [ [[package]] name = "xcm-procedural" -version = "11.0.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "11.0.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "Inflector", "proc-macro2", @@ -17569,8 +17662,8 @@ dependencies = [ [[package]] name = "xcm-runtime-apis" -version = "0.5.0" -source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#7f1c3d5e1f7b618c0652d97ee35f070c8eddb881" +version = "0.5.1" +source = "git+https://github.com/paritytech/polkadot-sdk?branch=stable2412#010fd7bd1cd586bbbe4a4c48cd631e2ec263af5e" dependencies = [ "frame-support", "parity-scale-codec", diff --git a/pallets/api/Cargo.toml b/pallets/api/Cargo.toml index 086a2da14..656cb2d06 100644 --- a/pallets/api/Cargo.toml +++ b/pallets/api/Cargo.toml @@ -26,6 +26,7 @@ pallet-assets.workspace = true pallet-balances.workspace = true pallet-nfts.workspace = true sp-core.workspace = true +sp-io.workspace = true sp-runtime.workspace = true sp-std.workspace = true sp-weights.workspace = true @@ -39,7 +40,8 @@ xcm-builder.workspace = true [dev-dependencies] pallet-balances.workspace = true -sp-io.workspace = true +pallet-ismp = { workspace = true, features = [ "unsigned" ] } +pallet-timestamp.workspace = true xcm-builder.workspace = true [features] diff --git a/pallets/api/src/messaging/benchmarking.rs b/pallets/api/src/messaging/benchmarking.rs index 54f3babf2..aedbb72d3 100644 --- a/pallets/api/src/messaging/benchmarking.rs +++ b/pallets/api/src/messaging/benchmarking.rs @@ -1,13 +1,29 @@ //! Benchmarking setup for pallet_api::nonfungibles #![cfg(feature = "runtime-benchmarks")] +use ::ismp::{ + host::StateMachine, + module::IsmpModule, + router::{ + GetRequest, GetResponse, PostRequest, PostResponse, Request, Request::*, + Response as IsmpResponse, Timeout, + }, + // dispatcher::DispatchRequest::{Post, Get}, +}; use ::xcm::latest::{Junctions, Location}; use frame_benchmarking::{account, v2::*}; -use frame_support::{dispatch::RawOrigin, traits::Currency, BoundedVec}; +use frame_support::{ + dispatch::RawOrigin, + sp_runtime::{traits::Hash, RuntimeDebug}, + traits::Currency, + BoundedVec, +}; +use sp_core::{bounded_vec, keccak_256, Get, H256}; +use sp_io::hashing::blake2_256; use sp_runtime::traits::{One, Zero}; use super::*; -use crate::Read as _; +use crate::{messaging::test_utils::*, Read as _}; const SEED: u32 = 1; // See if `generic_event` has been emitted. @@ -24,7 +40,7 @@ mod messaging_benchmarks { /// x: The number of removals required. #[benchmark] - fn remove(x: Linear<1, 255>) { + fn remove(x: Linear<1, { T::MaxRemovals::get() }>) { let deposit: BalanceOf = sp_runtime::traits::One::one(); let owner: AccountIdOf = account("Alice", 0, SEED); let mut message_ids: BoundedVec = BoundedVec::new(); @@ -38,8 +54,9 @@ mod messaging_benchmarks { ) .unwrap(); - let message_id = H256::repeat_byte(i as u8); - let commitment = H256::repeat_byte(i as u8); + // Generate unique message_id and commitment using hashing + let message_id = H256::from(blake2_256(&(i.to_le_bytes()))); + let commitment = H256::from(blake2_256(&(i.to_le_bytes()))); let good_message = Message::IsmpResponse { commitment: commitment.clone(), @@ -49,7 +66,7 @@ mod messaging_benchmarks { Messages::::insert(&owner, &message_id.0, &good_message); IsmpRequests::::insert(&commitment, (&owner, &message_id.0)); - message_ids.try_push(message_id.0).unwrap() + message_ids.try_push(message_id.0).unwrap(); } #[extrinsic_call] Pallet::::remove(RawOrigin::Signed(owner.clone()), message_ids.clone()); @@ -60,14 +77,23 @@ mod messaging_benchmarks { ) } + /// x: Is there a callback. #[benchmark] - fn xcm_new_query() { + fn xcm_new_query(x: Linear<0, 1>) { let owner: AccountIdOf = account("Alice", 0, SEED); let message_id: [u8; 32] = [0; 32]; let responder = Location { parents: 1, interior: Junctions::Here }; let timeout = as One>::one() + frame_system::Pallet::::block_number(); - let callback = - Callback { selector: [0; 4], weight: 100.into(), spare_weight_creditor: owner.clone() }; + let callback = if x == 1 { + Some(Callback { + selector: [0; 4], + weight: 100.into(), + spare_weight_creditor: owner.clone(), + abi: Abi::Scale, + }) + } else { + None + }; pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); @@ -77,7 +103,7 @@ mod messaging_benchmarks { message_id.clone(), responder.clone(), timeout, - Some(callback.clone()), + callback.clone(), ); assert_has_event::( @@ -85,7 +111,7 @@ mod messaging_benchmarks { origin: owner, id: message_id, query_id: 0, - callback: Some(callback), + callback, } .into(), ) @@ -98,17 +124,19 @@ mod messaging_benchmarks { let message_id: [u8; 32] = [0; 32]; let responder = Location { parents: 1, interior: Junctions::Here }; let timeout = as One>::one() + frame_system::Pallet::::block_number(); - let callback = None; let response = Response::ExecutionResult(None); - if x == 1 { - // The mock will always assume successfull callback. - let callback = Some(Callback { + let callback = if x == 1 { + // The mock will always assume successful callback. + Some(Callback { selector: [0; 4], weight: 100.into(), spare_weight_creditor: owner.clone(), - }); - } + abi: Abi::Scale, + }) + } else { + None + }; pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); @@ -137,5 +165,201 @@ mod messaging_benchmarks { assert!(XcmQueries::::get(0).is_none()); } + /// x: Is it a get. (example: 1 = get, 0 = post) + /// y: the response has a callback. + #[benchmark] + fn ismp_on_response(x: Linear<0, 1>, y: Linear<0, 1>) { + let origin: T::AccountId = account("alice", 0, SEED); + let message_id = [1; 32]; + let callback = if y == 1 { + // The mock will always assume successfull callback. + Some(Callback { + selector: [0; 4], + weight: 100.into(), + spare_weight_creditor: origin.clone(), + abi: Abi::Scale, + }) + } else { + None + }; + + let (response, event, commitment) = if x == 1 { + // get response + let get = ismp_get_response( + T::MaxKeyLen::get() as usize, + T::MaxKeys::get() as usize, + T::MaxContextLen::get() as usize, + T::MaxResponseLen::get() as usize, + ); + let commitment = H256::from(keccak_256(&Get(get.get.clone()).encode())); + ( + IsmpResponse::Get(get.clone()), + crate::messaging::Event::::IsmpGetResponseReceived { + dest: origin.clone(), + id: message_id, + commitment, + }, + commitment, + ) + } else { + // post response + let post = ismp_post_response( + T::MaxDataLen::get() as usize, + T::MaxResponseLen::get() as usize, + ); + let commitment = H256::from(keccak_256(&Post(post.post.clone()).encode())); + ( + IsmpResponse::Post(post.clone()), + crate::messaging::Event::::IsmpPostResponseReceived { + dest: origin.clone(), + id: message_id, + commitment, + }, + commitment, + ) + }; + + let message = Message::Ismp { commitment, callback, deposit: One::one() }; + + IsmpRequests::::insert(&commitment, (&origin, &message_id)); + Messages::::insert(&origin, &message_id, &message); + + let handler = crate::messaging::ismp::Handler::::new(); + + #[block] + { + handler.on_response(response.clone()).unwrap(); + } + + assert_has_event::(event.into()) + } + + /// x: is it a Request::Post, Request::Get or Response::Post. + /// x = 0: Post request. + /// x = 1: Get request. + /// x = 2: Post response. + /// y = 1: There is a callback + #[benchmark] + fn ismp_on_timeout(x: Linear<0, 2>, y: Linear<0, 1>) { + let commitment = H256::repeat_byte(2u8); + let origin: T::AccountId = account("alice", 0, SEED); + let message_id = [1; 32]; + + let callback = if y == 1 { + Some(Callback { + selector: [1; 4], + weight: 100.into(), + spare_weight_creditor: origin.clone(), + abi: Abi::Scale, + }) + } else { + None + }; + + let (timeout_message, commitment) = if x == 0 { + let post_request = ismp_post_request(T::MaxDataLen::get() as usize); + let commitment = H256::from(keccak_256(&Post(post_request.clone()).encode())); + (Timeout::Request(Request::Post(post_request.clone())), commitment) + } else if x == 1 { + let get_request = ismp_get_request( + T::MaxKeyLen::get() as usize, + T::MaxKeys::get() as usize, + T::MaxContextLen::get() as usize, + ); + let commitment = H256::from(keccak_256(&Get(get_request.clone()).encode())); + (Timeout::Request(Request::Get(get_request.clone())), commitment) + } else { + let post_response = ismp_post_response( + T::MaxDataLen::get() as usize, + T::MaxResponseLen::get() as usize, + ); + let commitment = H256::from(keccak_256(&Post(post_response.post.clone()).encode())); + + (Timeout::Response(post_response), commitment) + }; + + let input_message = Message::Ismp { commitment, callback, deposit: One::one() }; + + IsmpRequests::::insert(&commitment, (&origin, &message_id)); + Messages::::insert(&origin, &message_id, &input_message); + + let handler = crate::messaging::ismp::Handler::::new(); + #[block] + { + handler.on_timeout(timeout_message).unwrap(); + } + } + + /// x: Maximum context len: bound to u16::MAX T::MaxContextLen + /// y: Maximum length of keys (inner) len: bound to u16::MAX T::MaxKeyLen + /// z: Maximum amount of keys (outer) len: bound to u16::MAX T::MaxKeys + #[benchmark] + fn ismp_get( + x: Linear<0, { T::MaxContextLen::get() }>, + y: Linear<0, { T::MaxKeyLen::get() }>, + z: Linear<0, { T::MaxKeys::get() }>, + a: Linear<0, 1>, + ) { + let origin: T::AccountId = account("alice", 0, SEED); + let message_id = [1; 32]; + let inner_keys: BoundedVec = + vec![1u8].repeat(y as usize).try_into().unwrap(); + let mut outer_keys = vec![]; + for k in (0..z) { + outer_keys.push(inner_keys.clone()) + } + + let callback = if a == 1 { + Some(Callback { + selector: [1; 4], + weight: 100.into(), + spare_weight_creditor: origin.clone(), + abi: Abi::Scale, + }) + } else { + None + }; + + let get = crate::messaging::ismp::Get:: { + dest: 0, + height: 0, + timeout: 0, + context: vec![1u8].repeat(x as usize).try_into().unwrap(), + keys: outer_keys.try_into().unwrap(), + }; + + pallet_balances::Pallet::::make_free_balance_be(&origin, u32::MAX.into()); + + #[extrinsic_call] + Pallet::::ismp_get(RawOrigin::Signed(origin.clone()), message_id, get, callback); + } + + /// x: Maximun byte len of outgoing data. T::MaxDataLen + /// y: is there a callback. + #[benchmark] + fn ismp_post(x: Linear<0, { T::MaxDataLen::get() }>, y: Linear<0, 1>) { + let origin: T::AccountId = account("alice", 0, SEED); + let message_id = [1; 32]; + let data = vec![1u8].repeat(x as usize).try_into().unwrap(); + + let get = crate::messaging::ismp::Post:: { dest: 0, timeout: 0, data }; + + let callback = if y == 1 { + Some(Callback { + selector: [1; 4], + weight: 100.into(), + spare_weight_creditor: origin.clone(), + abi: Abi::Scale, + }) + } else { + None + }; + + pallet_balances::Pallet::::make_free_balance_be(&origin, u32::MAX.into()); + + #[extrinsic_call] + Pallet::::ismp_post(RawOrigin::Signed(origin.clone()), message_id, get, callback); + } + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); } diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index fa668febe..4cb2894e0 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -42,6 +42,9 @@ use deposits::*; #[cfg(test)] mod tests; +#[cfg(any(test, feature = "runtime-benchmarks"))] +pub(crate) mod test_utils; + type AccountIdOf = ::AccountId; type BlockNumberOf = BlockNumberFor; type BalanceOf = <::Deposit as Inspect>>::Balance; @@ -77,6 +80,7 @@ pub mod pallet { #[pallet::constant] type OffChainByteFee: Get>; + /// The type responsible for executing callbacks. type CallbackExecutor: CallbackExecutor; /// The deposit mechanism. @@ -90,31 +94,50 @@ pub mod pallet { /// request. #[pallet::constant] type MaxContextLen: Get; + + /// SAFETY: should be less than or equal to u16. /// The maximum length of outbound (posted) data. #[pallet::constant] type MaxDataLen: Get; + + /// SAFETY: should be less than or equal to u16. + /// The maximum amount of key for an outbound request. #[pallet::constant] type MaxKeys: Get; + + /// SAFETY: should be less than or equal to u16. + /// The maximum byte length for a single key of an ismp request. #[pallet::constant] type MaxKeyLen: Get; + /// The maximum length for a response. #[pallet::constant] type MaxResponseLen: Get; + + /// The maximum amount of removals in a single call to remove. #[pallet::constant] type MaxRemovals: Get; /// Overarching hold reason. type RuntimeHoldReason: From; + /// Wrapper type for creating a query with a notify type Xcm: NotifyQueryHandler; + /// The origin of the response for xcm. type XcmResponseOrigin: EnsureOrigin; /// SAFETY: Recommended this is small as is used to updated a message status in the hooks. /// The maximum number of xcm timeout updates that can be processed per block. #[pallet::constant] type MaxXcmQueryTimeoutsPerBlock: Get; + + /// The type responsible for converting between weight and balance, commonly transaction + /// payment. type WeightToFee: WeightToFee>; + + /// The fee paid to the relayers account for relaying a message. + type IsmpRelayerFee: Get>; } #[pallet::pallet] @@ -308,23 +331,25 @@ pub mod pallet { origin: OriginFor, id: MessageId, message: ismp::Get, - fee: BalanceOf, callback: Option>, ) -> DispatchResult { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, ) .saturating_add(calculate_message_deposit::()) + // TODO: is this meant to be our struct or theirs? .saturating_add(calculate_deposit_of::>()); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; // Process message by dispatching request via ISMP. let commitment = T::IsmpDispatcher::default() - .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) + .dispatch_request( + message.into(), + FeeMetadata { payer: origin.clone(), fee: T::IsmpRelayerFee::get() }, + ) .map_err(|_| Error::::IsmpDispatchFailed)?; // Store commitment for lookup on response, message for querying, // response/timeout handling. @@ -350,12 +375,10 @@ pub mod pallet { origin: OriginFor, id: MessageId, message: ismp::Post, - fee: BalanceOf, callback: Option>, ) -> DispatchResult { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); - let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, ) @@ -366,7 +389,10 @@ pub mod pallet { // Process message by dispatching request via ISMP. let commitment = T::IsmpDispatcher::default() - .dispatch_request(message.into(), FeeMetadata { payer: origin.clone(), fee }) + .dispatch_request( + message.into(), + FeeMetadata { payer: origin.clone(), fee: T::IsmpRelayerFee::get() }, + ) .map_err(|_| Error::::IsmpDispatchFailed)?; // Store commitment for lookup on response, message for querying, @@ -476,7 +502,7 @@ pub mod pallet { Messages::::remove(&origin, &id); XcmQueries::::remove(query_id); T::Deposit::release(&HoldReason::Messaging.into(), &origin, *deposit, Exact)?; - return Ok(()) + return Ok(()); } } // No callback is executed, diff --git a/pallets/api/src/messaging/test_utils.rs b/pallets/api/src/messaging/test_utils.rs new file mode 100644 index 000000000..693e4d619 --- /dev/null +++ b/pallets/api/src/messaging/test_utils.rs @@ -0,0 +1,67 @@ +use ::xcm::latest::{Junctions, Location}; +use codec::Encode; +use frame_benchmarking::{account, v2::*}; +use frame_support::{dispatch::RawOrigin, traits::Currency, BoundedVec}; +use ismp::{ + host::StateMachine, + module::IsmpModule, + router::{ + GetRequest, GetResponse, PostRequest, PostResponse, Response as IsmpResponse, StorageValue, + }, +}; +use sp_runtime::traits::{One, Zero}; + +use crate::messaging::Config; + +pub fn ismp_get_request(key_len: usize, keys_len: usize, context_len: usize) -> GetRequest { + GetRequest { + source: StateMachine::Polkadot(2000), + dest: StateMachine::Polkadot(2001), + nonce: 100u64, + from: [1u8; 32].to_vec(), + keys: vec![vec![1u8; key_len]; keys_len], + height: 1, + context: [1u8].repeat(context_len), + timeout_timestamp: 100_000, + } +} + +pub fn ismp_post_request(body_len: usize) -> PostRequest { + PostRequest { + source: StateMachine::Polkadot(2000), + dest: StateMachine::Polkadot(2001), + nonce: 100u64, + from: [1u8; 32].to_vec(), + to: [1u8; 32].to_vec(), + timeout_timestamp: 100_000, + body: [1u8].repeat(body_len), + } +} + +pub fn ismp_get_response( + key_len: usize, + keys_len: usize, + context_len: usize, + response_len: usize, +) -> GetResponse { + let r = get_storage_value(); + let r_encoded_size = r.encoded_size(); + + let mut total_response_len = 0; + let mut values = vec![]; + while total_response_len < response_len.saturating_sub(r_encoded_size) { + total_response_len += r_encoded_size; + values.push(r.clone()); + } + + GetResponse { get: ismp_get_request(key_len, keys_len, context_len), values } +} + +pub fn ismp_post_response(body_len: usize, response_len: usize) -> PostResponse { + let response = [1u8].repeat(response_len); + PostResponse { post: ismp_post_request(body_len), response, timeout_timestamp: 100_001 } +} + +pub fn get_storage_value() -> StorageValue { + StorageValue { key: [1u8; 32].to_vec(), value: Some([1u8; 32].to_vec()) } +} diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 06cb230e8..86bbdd836 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -7,12 +7,15 @@ use frame_support::{ testing_prelude::bounded_vec, weights::Weight, }; -use pallet_nfts::{CollectionSetting, MintWitness, WeightInfo as NftsWeightInfoTrait}; use sp_core::H256; -use crate::{messaging::*, mock::*, Read}; +use crate::{ + messaging::{test_utils, *}, + mock::*, + Read, +}; -fn events() -> Vec> { +pub fn events() -> Vec> { let result = System::events() .into_iter() .map(|r| r.event) @@ -747,7 +750,7 @@ mod xcm_response { } } -mod hooks { +mod xcm_hooks { use super::*; #[test] @@ -887,3 +890,319 @@ mod handle_callback_result { }) } } + +mod ismp_get { + use super::*; + + #[test] + fn message_exists() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = ismp::Get { + dest: 2000, + height: 10, + timeout: 100, + context: bounded_vec!(), + keys: bounded_vec!(), + }; + let callback = None; + + assert_ok!(Messaging::ismp_get(signed(ALICE), message_id, message.clone(), callback)); + assert_noop!( + Messaging::ismp_get(signed(ALICE), message_id, message, callback), + Error::::MessageExists + ); + }) + } + + #[test] + fn takes_deposit() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = ismp::Get { + dest: 2000, + height: 10, + timeout: 100, + context: bounded_vec!(), + keys: bounded_vec!(), + }; + let ismp_fee = ::IsmpRelayerFee::get(); + let callback = None; + + let expected_deposit = calculate_protocol_deposit::< + Test, + ::OnChainByteFee, + >(ProtocolStorageDeposit::IsmpRequests) + + calculate_message_deposit::::OnChainByteFee>() + + calculate_deposit_of::::OffChainByteFee, ismp::Get>( + ) + ismp_fee; + + let alice_balance_pre_hold = Balances::free_balance(&ALICE); + + assert_ok!(Messaging::ismp_get(signed(ALICE), message_id, message, callback)); + + let alice_balance_post_hold = Balances::free_balance(&ALICE); + + assert!(expected_deposit != (0 + ismp_fee)); + assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); + }) + } + + #[test] + fn assert_state() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = ismp::Get { + dest: 2000, + height: 10, + timeout: 100, + context: bounded_vec!(), + keys: bounded_vec!(), + }; + let callback = None; + assert_ok!(Messaging::ismp_get(signed(ALICE), message_id.clone(), message, callback)); + let events = events(); + let Some(Event::::IsmpGetDispatched { origin, id, commitment, callback }) = + events.first() + else { + panic!("missing event"); + }; + assert_eq!( + IsmpRequests::::get(&commitment).unwrap(), + (ALICE, message_id.clone()) + ); + let Some(Message::Ismp { .. }) = Messages::::get(&ALICE, &message_id) else { + panic!("wrong message type"); + }; + }) + } +} + +mod ismp_post { + use super::*; + + #[test] + fn message_exists() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = ismp::Post { dest: 2000, timeout: 100, data: bounded_vec![] }; + let callback = None; + + assert_ok!(Messaging::ismp_post( + signed(ALICE), + message_id.clone(), + message.clone(), + callback + )); + assert_noop!( + Messaging::ismp_post(signed(ALICE), message_id.clone(), message, callback), + Error::::MessageExists + ); + }) + } + + #[test] + fn takes_deposit() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = ismp::Post { dest: 2000, timeout: 100, data: bounded_vec![] }; + let ismp_fee = ::IsmpRelayerFee::get(); + let callback = None; + let alice_balance_pre_hold = Balances::free_balance(&ALICE); + + assert_ok!(Messaging::ismp_post( + signed(ALICE), + message_id.clone(), + message.clone(), + callback + )); + + let expected_deposit = calculate_protocol_deposit::< + Test, + ::OnChainByteFee, + >(ProtocolStorageDeposit::IsmpRequests) + + calculate_message_deposit::::OnChainByteFee>() + + calculate_deposit_of::::OffChainByteFee, ismp::Post>( + ) + ismp_fee; + + assert!(expected_deposit != (0 + ismp_fee)); + + let alice_balance_post_hold = Balances::free_balance(&ALICE); + + assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); + }) + } + + #[test] + fn assert_state() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = ismp::Post { dest: 2000, timeout: 100, data: bounded_vec![] }; + let callback = None; + + assert_ok!(Messaging::ismp_post( + signed(ALICE), + message_id.clone(), + message.clone(), + callback + )); + + let events = events(); + let Some(Event::::IsmpPostDispatched { origin, id, commitment, callback }) = + events.first() + else { + panic!("missing event"); + }; + assert_eq!( + IsmpRequests::::get(&commitment).unwrap(), + (ALICE, message_id.clone()) + ); + let Some(Message::Ismp { .. }) = Messages::::get(&ALICE, &message_id) else { + panic!("wrong message type"); + }; + }) + } +} + +mod ismp_hooks { + use super::*; + + fn handler() -> ismp::Handler { + ismp::Handler::::new() + } + + mod on_timeout { + use super::*; + } + + mod process_response { + use ::ismp::Error as IsmpError; + + use super::*; + + #[test] + fn response_exceeds_max_encoded_len_limit() { + new_test_ext().execute_with(|| { + let byte = 1u8; + let exceeds = vec![byte].repeat( + <::MaxResponseLen as Get>::get() as usize + 1usize, + ); + let commitment: H256 = Default::default(); + + let err = ismp::process_response(&commitment, &exceeds, |dest, id| { + Event::::IsmpGetResponseReceived { dest, id, commitment } + }) + .unwrap_err(); + assert_eq!( + err.downcast::().unwrap(), + IsmpError::Custom( + "Response length exceeds maximum allowed length.".to_string() + ) + ); + }) + } + + #[test] + fn request_not_found() { + new_test_ext().execute_with(|| { + let response = vec![1u8]; + let commitment: H256 = Default::default(); + + let err = ismp::process_response(&commitment, &response, |dest, id| { + Event::::IsmpGetResponseReceived { dest, id, commitment } + }) + .unwrap_err(); + assert_eq!( + err.downcast::().unwrap(), + IsmpError::Custom("Request not found.".to_string()) + ); + }) + } + + #[test] + fn message_must_be_ismp_request() { + new_test_ext().execute_with(|| { + let response = vec![1u8]; + let commitment: H256 = Default::default(); + let message_id = [1u8; 32]; + + let message = + Message::IsmpResponse { commitment, response: bounded_vec![], deposit: 100 }; + IsmpRequests::::insert(commitment, (ALICE, message_id)); + Messages::::insert(ALICE, message_id, message); + + let err = ismp::process_response(&commitment, &response, |dest, id| { + Event::::IsmpGetResponseReceived { dest, id, commitment } + }) + .unwrap_err(); + assert_eq!( + err.downcast::().unwrap(), + IsmpError::Custom("Message must be an ismp request.".to_string()) + ); + }) + } + + #[test] + fn no_callback_saves_response() { + new_test_ext().execute_with(|| { + let response = vec![1u8]; + let commitment: H256 = Default::default(); + let message_id = [1u8; 32]; + + let message = Message::Ismp { commitment, callback: None, deposit: 100 }; + IsmpRequests::::insert(commitment, (ALICE, message_id)); + Messages::::insert(ALICE, message_id, message); + + let res = ismp::process_response(&commitment, &response, |dest, id| { + Event::::IsmpGetResponseReceived { dest, id, commitment } + }); + + assert!(res.is_ok(), "process_response failed"); + + let Some(Message::IsmpResponse { commitment, deposit, response }) = + Messages::::get(&ALICE, &message_id) + else { + panic!("wrong message type.") + }; + }) + } + + #[test] + fn success_callback_releases_deposit() { + new_test_ext().execute_with(|| { + let response = vec![1u8]; + let commitment: H256 = Default::default(); + let message_id = [1u8; 32]; + let callback = Callback { + selector: [1; 4], + weight: 100.into(), + spare_weight_creditor: BOB, + abi: Abi::Scale, + }; + let deposit = 100; + let message = Message::Ismp { commitment, callback: Some(callback), deposit }; + + ::Deposit::hold( + &HoldReason::Messaging.into(), + &ALICE, + deposit, + ) + .unwrap(); + + let alice_post_hold = Balances::free_balance(&ALICE); + + IsmpRequests::::insert(commitment, (ALICE, message_id)); + Messages::::insert(ALICE, message_id, message); + + let res = ismp::process_response(&commitment, &response, |dest, id| { + Event::::IsmpGetResponseReceived { dest, id, commitment } + }); + + assert!(res.is_ok(), "process_response failed"); + + let alice_post_process = Balances::free_balance(&ALICE); + assert_eq!(alice_post_process - deposit, alice_post_hold); + }) + } + } +} diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 42914ad1e..29a21becd 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -10,8 +10,10 @@ use ::ismp::{ }; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ - pallet_prelude::Weight, traits::Get as _, CloneNoBound, DebugNoBound, EqNoBound, - PartialEqNoBound, + ensure, + pallet_prelude::Weight, + traits::{fungible::MutateHold, tokens::Precision::Exact, Get as _}, + CloneNoBound, DebugNoBound, EqNoBound, PartialEqNoBound, }; use ismp::{ dispatcher::DispatchPost, @@ -26,7 +28,7 @@ use sp_runtime::{BoundedVec, Saturating}; use crate::messaging::{ pallet::{Config, Event, IsmpRequests, Messages, Pallet}, - AccountIdOf, MessageId, Vec, + AccountIdOf, HoldReason, MessageId, Vec, }; pub const ID: [u8; 3] = *b"pop"; @@ -119,7 +121,8 @@ impl Handler { impl IsmpModule for Handler { fn on_accept(&self, _request: PostRequest) -> Result<(), anyhow::Error> { - todo!() + Err(Error::Custom("pop-net is not accepting post requests at this time!".to_string()) + .into()) } fn on_response(&self, response: Response) -> Result<(), anyhow::Error> { @@ -127,22 +130,17 @@ impl IsmpModule for Handler { match response { Response::Get(GetResponse { get, values }) => { log::debug!(target: "pop-api::extension", "StorageValue={:?}", values[0]); - let commitment = H256::from(keccak_256(&ismp::router::Request::Get(get).encode())); - process_response( - &commitment, - &values, - || values.encode(), - |dest, id| Event::::IsmpGetResponseReceived { dest, id, commitment }, - ) + // TODO: This should be bound to the hasher used in the ismp dispatcher. + let commitment = H256::from(keccak_256(&Get(get).encode())); + process_response(&commitment, &values, |dest, id| { + Event::::IsmpGetResponseReceived { dest, id, commitment } + }) }, Response::Post(PostResponse { post, response, .. }) => { let commitment = H256::from(keccak_256(&Post(post).encode())); - process_response( - &commitment, - &response, - || response.clone(), // TODO: resolve unnecessary clone - |dest, id| Event::::IsmpPostResponseReceived { dest, id, commitment }, - ) + process_response(&commitment, &response, |dest, id| { + Event::::IsmpPostResponseReceived { dest, id, commitment } + }) }, } } @@ -151,36 +149,24 @@ impl IsmpModule for Handler { match timeout { Timeout::Request(request) => { // hash request to determine key for original request id lookup - let id = match request { + let commitment = match request { Get(get) => H256::from(keccak_256(&get.encode())), Post(post) => H256::from(keccak_256(&post.encode())), }; - let key = - IsmpRequests::::get(id).ok_or(Error::Custom("request not found".into()))?; - Messages::::try_mutate(key.0, key.1, |message| { - let Some(super::super::Message::Ismp { commitment, deposit, .. }) = message - else { - return Err(Error::Custom("message not found".into())) - }; - todo!("Update message status to timed out"); - // *message = Some(super::super::Message::IsmpTimedOut { - // deposit: *deposit, - // commitment: *commitment, - // }); - })?; - Ok(()) + timeout_commitment::(&commitment) }, - Timeout::Response(_response) => { - todo!() + Timeout::Response(response) => { + let commitment = H256::from(keccak_256(&Post(response.post).encode())); + timeout_commitment::(&commitment) }, } } } -// TODO: replace with benchmarked weight functions impl IsmpModuleWeight for Pallet { + // Static as not in use. fn on_accept(&self, _request: &PostRequest) -> Weight { - todo!() + DbWeightOf::::get().reads_writes(2, 1) } fn on_timeout(&self, _timeout: &Timeout) -> Weight { @@ -192,39 +178,65 @@ impl IsmpModuleWeight for Pallet { } } -fn process_response( +pub(crate) fn process_response( commitment: &H256, - encode: &impl Encode, - store: impl Fn() -> Vec, + response_data: &impl Encode, event: impl Fn(AccountIdOf, MessageId) -> Event, ) -> Result<(), anyhow::Error> { + ensure!( + response_data.encoded_size() <= T::MaxResponseLen::get() as usize, + Error::Custom("Response length exceeds maximum allowed length.".into()) + ); + let (origin, id) = - IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; + IsmpRequests::::get(commitment).ok_or(Error::Custom("Request not found.".into()))?; let Some(super::super::Message::Ismp { commitment, callback, deposit }) = Messages::::get(&origin, &id) else { - return Err(Error::Custom("message not found".into()).into()) + return Err(Error::Custom("Message must be an ismp request.".into()).into()); }; + // Deposit that the message has been recieved before a potential callback execution. + Pallet::::deposit_event(event(origin.clone(), id)); + // Attempt callback with result if specified. if let Some(callback) = callback { - // TODO: check response length - // TODO: update status if failed - if Pallet::::call(&origin, callback, &id, &encode).is_ok() { - Pallet::::deposit_event(event(origin, id)); + if Pallet::::call(&origin, callback, &id, response_data).is_ok() { + // Clean storage, return deposit + Messages::::remove(&origin, &id); + IsmpRequests::::remove(&commitment); + T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact) + .map_err(|_| Error::Custom("failed to release deposit.".into()))?; + return Ok(()); } } - // Otherwise store response for manual retrieval and removal. - let response: BoundedVec = - store().try_into().map_err(|_| Error::Custom("response exceeds max".into()))?; + // No callback or callback error: store response for manual retrieval and removal. + let encoded_response: BoundedVec = response_data + .encode() + .try_into() + .map_err(|_| Error::Custom("response exceeds max".into()))?; Messages::::insert( &origin, &id, - super::super::Message::IsmpResponse { commitment, deposit, response }, + super::super::Message::IsmpResponse { commitment, deposit, response: encoded_response }, ); - Pallet::::deposit_event(event(origin, id)); + Ok(()) +} + +fn timeout_commitment(commitment: &H256) -> Result<(), anyhow::Error> { + let key = + IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; + Messages::::try_mutate(key.0, key.1, |message| { + let Some(super::super::Message::Ismp { commitment, deposit, .. }) = message else { + return Err(Error::Custom("message not found".into())); + }; + *message = + Some(super::super::Message::IsmpTimeout { deposit: *deposit, commitment: *commitment }); + + Ok(()) + })?; Ok(()) } diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 724fb39ac..50242d14f 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -5,18 +5,20 @@ use frame_support::{ pallet_prelude::EnsureOrigin, parameter_types, traits::{ - AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Everything, Hooks, OriginTrait, + AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Everything, Get, Hooks, OriginTrait, }, }; use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned}; +use ismp::{error::Error, host::StateMachine, module::IsmpModule, router::IsmpRouter}; use pallet_nfts::PalletFeatures; use pallet_xcm::{Origin, TestWeightInfo}; use scale_info::TypeInfo; -use sp_core::H256; +use sp_core::{keccak_256, H256}; use sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, TryConvert, Verify}, BuildStorage, }; +use sp_std::prelude::*; use crate::messaging::{Call, CallbackExecutor, Messages, NotifyQueryHandler}; @@ -45,6 +47,8 @@ frame_support::construct_runtime!( Nfts: pallet_nfts::, NonFungibles: crate::nonfungibles, Messaging: crate::messaging, + Ismp: pallet_ismp, + TimeStamps: pallet_timestamp, } ); @@ -230,6 +234,7 @@ parameter_types! { pub const OnChainByteFee: Balance = 10; pub const OffChainByteFee: Balance = 5; pub const MaxXcmQueryTimeoutsPerBlock: u32 = 10; + pub const IsmpRelayerFee: Balance = 100_000; } pub struct MockNotifyQuery(T); @@ -255,7 +260,8 @@ pub fn get_next_query_id() -> u64 { impl crate::messaging::Config for Test { type CallbackExecutor = AlwaysSuccessfullCallbackExecutor; type Deposit = Balances; - type IsmpDispatcher = MockIsmpDispatcher; + type IsmpDispatcher = pallet_ismp::Pallet; + type IsmpRelayerFee = IsmpRelayerFee; type MaxContextLen = ConstU32<64>; type MaxDataLen = ConstU32<1024>; type MaxKeyLen = ConstU32<1000>; @@ -282,29 +288,6 @@ impl sp_weights::WeightToFee for RefTimePlusProofTime { } } -#[derive(Default)] -pub struct MockIsmpDispatcher; -impl ismp::dispatcher::IsmpDispatcher for MockIsmpDispatcher { - type Account = AccountId; - type Balance = Balance; - - fn dispatch_request( - &self, - _request: ismp::dispatcher::DispatchRequest, - _fee: ismp::dispatcher::FeeMetadata, - ) -> Result { - Ok(Default::default()) - } - - fn dispatch_response( - &self, - _response: ismp::router::PostResponse, - _fee: ismp::dispatcher::FeeMetadata, - ) -> Result { - Ok(Default::default()) - } -} - pub struct AccountToLocation; impl TryConvert for AccountToLocation { @@ -337,6 +320,50 @@ impl EnsureOrigin for EnsureRootWithResponseSuccess { } } +impl pallet_timestamp::Config for Test { + type MinimumPeriod = ConstU64<0>; + /// A timestamp: milliseconds since the unix epoch. + type Moment = u64; + type OnTimestampSet = (); + type WeightInfo = (); +} + +impl pallet_ismp::Config for Test { + type AdminOrigin = EnsureRoot; + type Balance = Balance; + type ConsensusClients = (); + type Coprocessor = Coprocessor; + type Currency = Balances; + type HostStateMachine = HostStateMachine; + type OffchainDB = (); + type Router = AlwaysErrorRouter; + type RuntimeEvent = RuntimeEvent; + type TimestampProvider = TimeStamps; + type WeightProvider = (); +} + +#[derive(Default)] +pub struct AlwaysErrorRouter; +impl IsmpRouter for AlwaysErrorRouter { + fn module_for_id(&self, _bytes: Vec) -> Result, anyhow::Error> { + Err(anyhow::anyhow!("not implemented")) + } +} + +pub struct Coprocessor; +impl Get> for Coprocessor { + fn get() -> Option { + Some(HostStateMachine::get()) + } +} + +pub struct HostStateMachine; +impl Get for HostStateMachine { + fn get() -> StateMachine { + StateMachine::Polkadot(2000) + } +} + pub(crate) fn new_test_ext() -> sp_io::TestExternalities { let mut t = frame_system::GenesisConfig::::default() .build_storage() From b6788ec95cdc6dc85b0cd59c9389a5832441e728 Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Wed, 9 Apr 2025 12:35:16 +0100 Subject: [PATCH 29/38] Refund any unused callback weight (#505) * impl * refunds :) * fmt * takes deposit update * fmt * fix * fmt * comments * fmt --- pallets/api/src/messaging/deposits.rs | 2 +- pallets/api/src/messaging/mod.rs | 137 +++++++++---- pallets/api/src/messaging/tests.rs | 196 ++++++++++++------- pallets/api/src/messaging/transports/ismp.rs | 14 +- pallets/api/src/mock.rs | 24 ++- 5 files changed, 258 insertions(+), 115 deletions(-) diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs index 8aa86d6a3..5de63d92c 100644 --- a/pallets/api/src/messaging/deposits.rs +++ b/pallets/api/src/messaging/deposits.rs @@ -17,7 +17,7 @@ pub fn calculate_protocol_deposit>>( ProtocolStorageDeposit::XcmQueries => (KeyLenOf::>::get() as usize) .saturating_add(AccountIdOf::::max_encoded_len()) .saturating_add(MessageId::max_encoded_len()) - .saturating_add(Option::>::max_encoded_len()), + .saturating_add(Option::::max_encoded_len()), ProtocolStorageDeposit::IsmpRequests => (KeyLenOf::>::get() as usize) .saturating_add(AccountIdOf::::max_encoded_len()) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 4cb2894e0..2c1409c2d 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -9,7 +9,12 @@ use frame_support::{ storage::KeyLenOf, traits::{ fungible::Inspect, - tokens::{fungible::hold::Mutate, Precision::Exact}, + tokens::{ + fungible::hold::Mutate, + Fortitude, + Precision::{BestEffort, Exact}, + Restriction, + }, Get, OriginTrait, }, }; @@ -132,6 +137,9 @@ pub mod pallet { #[pallet::constant] type MaxXcmQueryTimeoutsPerBlock: Get; + /// Where the callback fees go once any refunds have occured after cb execution. + type FeeAccount: Get>; + /// The type responsible for converting between weight and balance, commonly transaction /// payment. type WeightToFee: WeightToFee>; @@ -184,7 +192,7 @@ pub mod pallet { /// The ISMP request commitment. commitment: H256, /// An optional callback to be used to return the response. - callback: Option>, + callback: Option, }, /// A response to a GET has been received via ISMP. IsmpGetResponseReceived { @@ -204,7 +212,7 @@ pub mod pallet { /// The ISMP request commitment. commitment: H256, /// An optional callback to be used to return the response. - callback: Option>, + callback: Option, }, /// A response to a POST has been received via ISMP. IsmpPostResponseReceived { @@ -224,7 +232,7 @@ pub mod pallet { /// The identifier of the created XCM query. query_id: QueryId, /// An optional callback to be used to return the response. - callback: Option>, + callback: Option, }, /// A response to a XCM query has been received. XcmResponseReceived { @@ -244,7 +252,7 @@ pub mod pallet { /// The identifier specified for the request. id: MessageId, /// The successful callback. - callback: Callback, + callback: Callback, }, /// A callback has failed. CallbackFailed { @@ -253,7 +261,7 @@ pub mod pallet { /// The identifier specified for the request. id: MessageId, /// The callback which failed. - callback: Callback, + callback: Callback, post_info: PostDispatchInfo, /// The error which occurred. error: DispatchError, @@ -297,6 +305,8 @@ pub mod pallet { /// Held for the duration of a message's lifespan. #[codec(index = 0)] Messaging, + #[codec(index = 1)] + CallbackGas, } #[pallet::hooks] @@ -331,7 +341,7 @@ pub mod pallet { origin: OriginFor, id: MessageId, message: ismp::Get, - callback: Option>, + callback: Option, ) -> DispatchResult { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); @@ -344,6 +354,14 @@ pub mod pallet { T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + if let Some(cb) = callback.as_ref() { + T::Deposit::hold( + &HoldReason::CallbackGas.into(), + &origin, + T::WeightToFee::weight_to_fee(&cb.weight), + )?; + } + // Process message by dispatching request via ISMP. let commitment = T::IsmpDispatcher::default() .dispatch_request( @@ -375,7 +393,7 @@ pub mod pallet { origin: OriginFor, id: MessageId, message: ismp::Post, - callback: Option>, + callback: Option, ) -> DispatchResult { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); @@ -387,6 +405,14 @@ pub mod pallet { T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + if let Some(cb) = callback.as_ref() { + T::Deposit::hold( + &HoldReason::CallbackGas.into(), + &origin, + T::WeightToFee::weight_to_fee(&cb.weight), + )?; + } + // Process message by dispatching request via ISMP. let commitment = T::IsmpDispatcher::default() .dispatch_request( @@ -419,7 +445,7 @@ pub mod pallet { id: MessageId, responder: Location, timeout: BlockNumberOf, - callback: Option>, + callback: Option, ) -> DispatchResult { let querier_location = T::OriginConverter::try_convert(origin.clone()) .map_err(|_| Error::::OriginConversionFailed)?; @@ -445,6 +471,14 @@ pub mod pallet { T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + if let Some(cb) = callback.as_ref() { + T::Deposit::hold( + &HoldReason::CallbackGas.into(), + &origin, + T::WeightToFee::weight_to_fee(&cb.weight), + )?; + } + // Process message by creating new query via XCM. // Xcm only uses/stores pallet, index - i.e. (u8,u8), hence the fields in xcm_response // are ignored. @@ -477,9 +511,10 @@ pub mod pallet { xcm_response: Response, ) -> DispatchResult { T::XcmResponseOrigin::ensure_origin(origin)?; - let (origin, id) = XcmQueries::::get(query_id).ok_or(Error::::MessageNotFound)?; + let (initiating_origin, id) = + XcmQueries::::get(query_id).ok_or(Error::::MessageNotFound)?; let xcm_query_message = - Messages::::get(&origin, &id).ok_or(Error::::MessageNotFound)?; + Messages::::get(&initiating_origin, &id).ok_or(Error::::MessageNotFound)?; let (query_id, callback, deposit) = match &xcm_query_message { Message::XcmQuery { query_id, callback, deposit } => (query_id, callback, deposit), @@ -489,7 +524,7 @@ pub mod pallet { // Emit event before possible callback execution. Self::deposit_event(Event::::XcmResponseReceived { - dest: origin.clone(), + dest: initiating_origin.clone(), id, query_id: *query_id, response: xcm_response.clone(), @@ -498,16 +533,21 @@ pub mod pallet { if let Some(callback) = callback { // Attempt callback with response if specified. log::debug!(target: "pop-api::extension", "xcm callback={:?}, response={:?}", callback, xcm_response); - if Self::call(&origin, callback.to_owned(), &id, &xcm_response).is_ok() { - Messages::::remove(&origin, &id); + if Self::call(&initiating_origin, callback.to_owned(), &id, &xcm_response).is_ok() { + Messages::::remove(&initiating_origin, &id); XcmQueries::::remove(query_id); - T::Deposit::release(&HoldReason::Messaging.into(), &origin, *deposit, Exact)?; + T::Deposit::release( + &HoldReason::Messaging.into(), + &initiating_origin, + *deposit, + Exact, + )?; return Ok(()); } } // No callback is executed, Messages::::insert( - &origin, + &initiating_origin, &id, Message::XcmResponse { query_id: *query_id, @@ -570,13 +610,13 @@ pub mod pallet { impl Pallet { // Attempt to notify via callback. pub(crate) fn call( - origin: &AccountIdOf, - callback: Callback, + initiating_origin: &AccountIdOf, + callback: Callback, id: &MessageId, data: &impl Encode, ) -> DispatchResult { let result = T::CallbackExecutor::execute( - origin.clone(), + initiating_origin, match callback.abi { Abi::Scale => [callback.selector.to_vec(), (id, data).encode()].concat(), }, @@ -584,45 +624,72 @@ impl Pallet { ); log::debug!(target: "pop-api::extension", "callback weight={:?}, result={result:?}", callback.weight); - Self::handle_callback_result(origin, id, result, callback) + Self::handle_callback_result(initiating_origin, id, result, callback) } pub(crate) fn handle_callback_result( - origin: &AccountIdOf, + initiating_origin: &AccountIdOf, id: &MessageId, result: DispatchResultWithPostInfo, - callback: Callback>, + callback: Callback, ) -> DispatchResult { match result { Ok(post_info) => { // Try and return any unused callback weight. if let Some(weight_used) = post_info.actual_weight { let weight_to_refund = callback.weight.saturating_sub(weight_used); - if !weight_to_refund.any_eq(Zero::zero()) { - let returnable_imbalance = T::WeightToFee::weight_to_fee(&weight_to_refund); - // Where do we refund to? - // TODO: Handle Imbalance: sc-3302. + if weight_to_refund.all_gt(Zero::zero()) { + let total_deposit = T::WeightToFee::weight_to_fee(&callback.weight); + let returnable_deposit = T::WeightToFee::weight_to_fee(&weight_to_refund); + let execution_reward = total_deposit.saturating_sub(returnable_deposit); + let reason = HoldReason::CallbackGas.into(); + + T::Deposit::release( + &reason, + &initiating_origin, + returnable_deposit, + BestEffort, + )?; + T::Deposit::transfer_on_hold( + &reason, + &initiating_origin, + &T::FeeAccount::get(), + execution_reward, + BestEffort, + Restriction::Free, + Fortitude::Polite, + )?; } } Self::deposit_event(Event::::CallbackExecuted { - origin: origin.clone(), - id: id.clone(), + origin: initiating_origin.clone(), + id: *id, callback, }); Ok(()) }, Err(sp_runtime::DispatchErrorWithPostInfo:: { post_info, error }) => { + let total_deposit = T::WeightToFee::weight_to_fee(&callback.weight); + T::Deposit::transfer_on_hold( + &HoldReason::CallbackGas.into(), + &initiating_origin, + &T::FeeAccount::get(), + total_deposit, + BestEffort, + Restriction::Free, + Fortitude::Polite, + )?; + // Fallback to storing the message for polling - pre-paid weight is lost. Self::deposit_event(Event::::CallbackFailed { - origin: origin.clone(), + origin: initiating_origin.clone(), id: id.clone(), callback, post_info, error, }); - // TODO: logging Err(error) }, } @@ -699,12 +766,12 @@ impl crate::Read for Pallet { pub enum Message { Ismp { commitment: H256, - callback: Option>, + callback: Option, deposit: BalanceOf, }, XcmQuery { query_id: QueryId, - callback: Option>, + callback: Option, deposit: BalanceOf, }, IsmpResponse { @@ -750,11 +817,10 @@ pub enum MessageStatus { // Message selector and pre-paid weight used as gas limit #[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] -pub struct Callback { +pub struct Callback { pub abi: Abi, pub selector: [u8; 4], pub weight: Weight, - pub spare_weight_creditor: AccountId, } /// The encoding used for the data going to the contract. @@ -763,6 +829,7 @@ pub enum Abi { Scale, } pub trait CallbackExecutor { - fn execute(account: T::AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo; + fn execute(account: &T::AccountId, data: Vec, weight: Weight) + -> DispatchResultWithPostInfo; fn execution_weight() -> Weight; } diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 86bbdd836..cfbff9345 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -498,16 +498,22 @@ mod xcm_new_query { fn takes_deposit() { new_test_ext().execute_with(|| { let timeout = System::block_number() + 1; - let expected_deposit = calculate_protocol_deposit::< - Test, - ::OnChainByteFee, - >(ProtocolStorageDeposit::XcmQueries) - .saturating_add(calculate_message_deposit::::OnChainByteFee>()); + let weight = Weight::from_parts(100_000_000, 100_000_000); + let callback = Callback { selector: [1; 4], weight, abi: Abi::Scale }; + + let callback_deposit = ::WeightToFee::weight_to_fee(&weight); + + let expected_deposit = + calculate_protocol_deposit::::OnChainByteFee>( + ProtocolStorageDeposit::XcmQueries, + ) + calculate_message_deposit::::OnChainByteFee>() + + callback_deposit; assert!( expected_deposit > 0, "set an onchain byte fee with T::OnChainByteFee to run this test." ); + assert!(callback_deposit != 0); let alices_balance_pre_hold = Balances::free_balance(&ALICE); @@ -517,7 +523,7 @@ mod xcm_new_query { message_id, RESPONSE_LOCATION, timeout, - None, + Some(callback), )); let alices_balance_post_hold = Balances::free_balance(&ALICE); @@ -531,12 +537,8 @@ mod xcm_new_query { new_test_ext().execute_with(|| { // Looking for an item in Messages and XcmQueries. let message_id = [0; 32]; - let expected_callback = Callback { - selector: [1; 4], - weight: 100.into(), - spare_weight_creditor: BOB, - abi: Abi::Scale, - }; + let expected_callback = + Callback { selector: [1; 4], weight: 100.into(), abi: Abi::Scale }; let timeout = System::block_number() + 1; assert_ok!(Messaging::xcm_new_query( signed(ALICE), @@ -685,12 +687,7 @@ mod xcm_response { let timeout = System::block_number() + 1; let mut expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); - let callback = Callback { - selector: [1; 4], - weight: 100.into(), - spare_weight_creditor: BOB, - abi: Abi::Scale, - }; + let callback = Callback { selector: [1; 4], weight: 100.into(), abi: Abi::Scale }; assert_ok!(Messaging::xcm_new_query( signed(ALICE), @@ -713,12 +710,7 @@ mod xcm_response { let timeout = System::block_number() + 1; let mut expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); - let callback = Callback { - selector: [1; 4], - weight: 100.into(), - spare_weight_creditor: BOB, - abi: Abi::Scale, - }; + let callback = Callback { selector: [1; 4], weight: 0.into(), abi: Abi::Scale }; let expected_deposit = calculate_protocol_deposit::< Test, ::OnChainByteFee, @@ -786,42 +778,45 @@ mod handle_callback_result { use super::*; #[test] - fn refunds_unused_weight_to_creditor_on_success() { + fn claims_all_weight_to_fee_pot_on_failure() { new_test_ext().execute_with(|| { let origin = ALICE; let id = [1u8; 32]; - let actual_weight = Weight::from_parts(100, 100); - let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { - actual_weight: Some(actual_weight.clone()), - pays_fee: Pays::Yes, + let result = DispatchResultWithPostInfo::Err(DispatchErrorWithPostInfo { + post_info: Default::default(), + error: Error::::InvalidMessage.into(), }); - let bob_balance_pre_refund = Balances::free_balance(&BOB); - let expected_imbalance = - ::WeightToFee::weight_to_fee(&actual_weight); - let callback = Callback { - selector: [1; 4], - weight: Weight::from_parts(1000, 1000), - spare_weight_creditor: BOB, - abi: Abi::Scale, - }; + let actual_weight = Weight::from_parts(100_000_000, 100_000_000); - assert_ok!(crate::messaging::Pallet::::handle_callback_result( - &origin, &id, result, callback - )); + let callback = Callback { selector: [1; 4], weight: actual_weight, abi: Abi::Scale }; - let bob_balance_post_refund = Balances::free_balance(&BOB); - assert_eq!( - bob_balance_post_refund - bob_balance_pre_refund, - expected_imbalance, - "oops bob hasnt been refunded!" - ); - }) - } + let deposit = ::WeightToFee::weight_to_fee(&actual_weight); - #[test] - fn does_not_refunds_unused_weight_to_creditor_on_failure() { - new_test_ext().execute_with(|| { - todo!("sc-3302"); + assert!(deposit != 0); + // Artificially take the deposit + ::Deposit::hold( + &HoldReason::CallbackGas.into(), + &ALICE, + deposit, + ) + .unwrap(); + + let pot_pre_handle = Balances::free_balance(&FEE_ACCOUNT); + let alice_balance_pre_handle = Balances::free_balance(&ALICE); + + assert!(crate::messaging::Pallet::::handle_callback_result( + &origin, + &id, + result, + callback.clone() + ) + .is_err()); + + let alice_balance_post_handle = Balances::free_balance(&ALICE); + let pot_post_handle = Balances::free_balance(&FEE_ACCOUNT); + + assert_eq!(alice_balance_post_handle, alice_balance_pre_handle); + assert_eq!(pot_post_handle, pot_pre_handle + deposit); }) } @@ -838,10 +833,19 @@ mod handle_callback_result { let callback = Callback { selector: [1; 4], weight: Weight::from_parts(1000, 1000), - spare_weight_creditor: BOB, abi: Abi::Scale, }; + let deposit = ::WeightToFee::weight_to_fee(&actual_weight); + + // Artificially take the deposit + ::Deposit::hold( + &HoldReason::CallbackGas.into(), + &ALICE, + deposit, + ) + .unwrap(); + assert_ok!(crate::messaging::Pallet::::handle_callback_result( &origin, &id, @@ -869,7 +873,6 @@ mod handle_callback_result { let callback = Callback { selector: [1; 4], weight: Weight::from_parts(1000, 1000), - spare_weight_creditor: BOB, abi: Abi::Scale, }; @@ -889,6 +892,62 @@ mod handle_callback_result { })); }) } + + #[test] + fn assert_payback_when_execution_weight_is_less_than_deposit_held() { + new_test_ext().execute_with(|| { + let origin = ALICE; + let id = [1u8; 32]; + let actual_weight_executed = Weight::from_parts(50_000_000, 70_000_000); + let callback_weight_reserved = Weight::from_parts(100_000_000, 100_000_000); + + let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { + actual_weight: Some(actual_weight_executed.clone()), + pays_fee: Pays::Yes, + }); + + let callback = + Callback { selector: [1; 4], weight: callback_weight_reserved, abi: Abi::Scale }; + + let deposit = ::WeightToFee::weight_to_fee(&callback_weight_reserved); + + assert!(deposit != 0); + + // Artificially take the deposit + ::Deposit::hold( + &HoldReason::CallbackGas.into(), + &ALICE, + deposit, + ) + .unwrap(); + + let expected_refund = + deposit - ::WeightToFee::weight_to_fee(&actual_weight_executed); + + assert!(expected_refund != 0); + + let fee_pot_payment = deposit - expected_refund; + + let fee_account_pre_handle = Balances::free_balance(&FEE_ACCOUNT); + let alice_balance_pre_handle = Balances::free_balance(&ALICE); + + assert!(crate::messaging::Pallet::::handle_callback_result( + &origin, + &id, + result, + callback.clone() + ) + .is_ok()); + + /// alice should have been refunded by the tune of expected refund. + /// the fee pot should have been increased by fee_pot_payment. + let fee_account_post_handle = Balances::free_balance(&FEE_ACCOUNT); + let alice_balance_post_handle = Balances::free_balance(&ALICE); + + assert_eq!(alice_balance_post_handle - alice_balance_pre_handle, expected_refund); + assert_eq!(fee_account_post_handle, fee_account_pre_handle + fee_pot_payment); + }) + } } mod ismp_get { @@ -927,7 +986,11 @@ mod ismp_get { keys: bounded_vec!(), }; let ismp_fee = ::IsmpRelayerFee::get(); - let callback = None; + + let weight = Weight::from_parts(100_000_000, 100_000_000); + let callback = Callback { selector: [1; 4], weight, abi: Abi::Scale }; + + let callback_deposit = ::WeightToFee::weight_to_fee(&weight); let expected_deposit = calculate_protocol_deposit::< Test, @@ -935,11 +998,11 @@ mod ismp_get { >(ProtocolStorageDeposit::IsmpRequests) + calculate_message_deposit::::OnChainByteFee>() + calculate_deposit_of::::OffChainByteFee, ismp::Get>( - ) + ismp_fee; + ) + ismp_fee + callback_deposit; let alice_balance_pre_hold = Balances::free_balance(&ALICE); - assert_ok!(Messaging::ismp_get(signed(ALICE), message_id, message, callback)); + assert_ok!(Messaging::ismp_get(signed(ALICE), message_id, message, Some(callback))); let alice_balance_post_hold = Balances::free_balance(&ALICE); @@ -1007,14 +1070,18 @@ mod ismp_post { let message_id = [0u8; 32]; let message = ismp::Post { dest: 2000, timeout: 100, data: bounded_vec![] }; let ismp_fee = ::IsmpRelayerFee::get(); - let callback = None; + let weight = Weight::from_parts(100_000_000, 100_000_000); + let callback = Callback { selector: [1; 4], weight, abi: Abi::Scale }; + let callback_deposit = ::WeightToFee::weight_to_fee(&weight); let alice_balance_pre_hold = Balances::free_balance(&ALICE); + assert!(callback_deposit != 0); + assert_ok!(Messaging::ismp_post( signed(ALICE), message_id.clone(), message.clone(), - callback + Some(callback) )); let expected_deposit = calculate_protocol_deposit::< @@ -1023,7 +1090,7 @@ mod ismp_post { >(ProtocolStorageDeposit::IsmpRequests) + calculate_message_deposit::::OnChainByteFee>() + calculate_deposit_of::::OffChainByteFee, ismp::Post>( - ) + ismp_fee; + ) + ismp_fee + callback_deposit; assert!(expected_deposit != (0 + ismp_fee)); @@ -1173,12 +1240,7 @@ mod ismp_hooks { let response = vec![1u8]; let commitment: H256 = Default::default(); let message_id = [1u8; 32]; - let callback = Callback { - selector: [1; 4], - weight: 100.into(), - spare_weight_creditor: BOB, - abi: Abi::Scale, - }; + let callback = Callback { selector: [1; 4], weight: 100.into(), abi: Abi::Scale }; let deposit = 100; let message = Message::Ismp { commitment, callback: Some(callback), deposit }; diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 29a21becd..99a84ac67 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -188,25 +188,25 @@ pub(crate) fn process_response( Error::Custom("Response length exceeds maximum allowed length.".into()) ); - let (origin, id) = + let (initiating_origin, id) = IsmpRequests::::get(commitment).ok_or(Error::Custom("Request not found.".into()))?; let Some(super::super::Message::Ismp { commitment, callback, deposit }) = - Messages::::get(&origin, &id) + Messages::::get(&initiating_origin, &id) else { return Err(Error::Custom("Message must be an ismp request.".into()).into()); }; // Deposit that the message has been recieved before a potential callback execution. - Pallet::::deposit_event(event(origin.clone(), id)); + Pallet::::deposit_event(event(initiating_origin.clone(), id)); // Attempt callback with result if specified. if let Some(callback) = callback { - if Pallet::::call(&origin, callback, &id, response_data).is_ok() { + if Pallet::::call(&initiating_origin, callback, &id, response_data).is_ok() { // Clean storage, return deposit - Messages::::remove(&origin, &id); + Messages::::remove(&initiating_origin, &id); IsmpRequests::::remove(&commitment); - T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact) + T::Deposit::release(&HoldReason::Messaging.into(), &initiating_origin, deposit, Exact) .map_err(|_| Error::Custom("failed to release deposit.".into()))?; return Ok(()); @@ -219,7 +219,7 @@ pub(crate) fn process_response( .try_into() .map_err(|_| Error::Custom("response exceeds max".into()))?; Messages::::insert( - &origin, + &initiating_origin, &id, super::super::Message::IsmpResponse { commitment, deposit, response: encoded_response }, ); diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 50242d14f..a6beee1fd 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -2,7 +2,8 @@ use ::xcm::latest::{Junction, Junctions, Location}; use codec::{Decode, Encode}; use frame_support::{ derive_impl, - pallet_prelude::EnsureOrigin, + dispatch::PostDispatchInfo, + pallet_prelude::{DispatchResultWithPostInfo, EnsureOrigin, Pays}, parameter_types, traits::{ AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Everything, Get, Hooks, OriginTrait, @@ -27,6 +28,7 @@ pub(crate) const BOB: AccountId = 2; pub(crate) const CHARLIE: AccountId = 3; pub(crate) const RESPONSE: AccountId = 4; pub(crate) const RESPONSE_LOCATION: Location = Location { parents: 1, interior: Junctions::Here }; +pub(crate) const FEE_ACCOUNT: AccountId = 5; pub(crate) const INIT_AMOUNT: Balance = 100_000_000 * UNIT; pub(crate) const UNIT: Balance = 10_000_000_000; @@ -215,14 +217,19 @@ impl crate::nonfungibles::Config for Test { type WeightInfo = (); } +/// Will return half of the weight in the post info. +/// Mocking a successfull execution, with refund. pub struct AlwaysSuccessfullCallbackExecutor(T); impl CallbackExecutor for AlwaysSuccessfullCallbackExecutor { fn execute( - account: ::AccountId, + account: &::AccountId, data: Vec, weight: sp_runtime::Weight, ) -> frame_support::dispatch::DispatchResultWithPostInfo { - Ok(().into()) + DispatchResultWithPostInfo::Ok(PostDispatchInfo { + actual_weight: Some(weight), + pays_fee: Pays::Yes, + }) } fn execution_weight() -> sp_runtime::Weight { @@ -234,6 +241,7 @@ parameter_types! { pub const OnChainByteFee: Balance = 10; pub const OffChainByteFee: Balance = 5; pub const MaxXcmQueryTimeoutsPerBlock: u32 = 10; + pub const FeeAccount: AccountId = FEE_ACCOUNT; pub const IsmpRelayerFee: Balance = 100_000; } @@ -260,11 +268,12 @@ pub fn get_next_query_id() -> u64 { impl crate::messaging::Config for Test { type CallbackExecutor = AlwaysSuccessfullCallbackExecutor; type Deposit = Balances; + type FeeAccount = FeeAccount; type IsmpDispatcher = pallet_ismp::Pallet; type IsmpRelayerFee = IsmpRelayerFee; type MaxContextLen = ConstU32<64>; type MaxDataLen = ConstU32<1024>; - type MaxKeyLen = ConstU32<1000>; + type MaxKeyLen = ConstU32<32>; type MaxKeys = ConstU32<10>; type MaxRemovals = ConstU32<1024>; type MaxResponseLen = ConstU32<1024>; @@ -370,7 +379,12 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { .expect("Frame system builds valid default genesis config"); pallet_balances::GenesisConfig:: { - balances: vec![(ALICE, INIT_AMOUNT), (BOB, INIT_AMOUNT), (CHARLIE, INIT_AMOUNT)], + balances: vec![ + (ALICE, INIT_AMOUNT), + (BOB, INIT_AMOUNT), + (CHARLIE, INIT_AMOUNT), + (FEE_ACCOUNT, INIT_AMOUNT), + ], } .assimilate_storage(&mut t) .expect("Pallet balances storage can be assimilated"); From 5887d712f20efc1b757075a58c72d00dd5b9795f Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Thu, 17 Apr 2025 10:02:40 +0100 Subject: [PATCH 30/38] chore(messaging): messaging runtime weights (#510) * dependancy wild goose chase * marathon * fix * emit and test timeout events * fix * dummy * benchmarking * fix * fix commitments, errs on callbacks, fix replay vuln * fmt * no errors, callbacks executre * finally some annotations * ismp hook weight annotations * timeout tests * fix tests * fix benchmark tests * fmt * documentation and formatting * fix * implements new benchmarks into devnet * clippy * fix * fmt * more warnings * fmt * pop-bench remove * comments --- Cargo.lock | 92 ++-- pallets/api/Cargo.toml | 3 +- pallets/api/src/messaging/benchmarking.rs | 265 +++++++----- pallets/api/src/messaging/deposits.rs | 1 - pallets/api/src/messaging/mod.rs | 325 ++++++++++---- pallets/api/src/messaging/test_utils.rs | 104 ++--- pallets/api/src/messaging/tests.rs | 354 ++++++++------- pallets/api/src/messaging/transports/ismp.rs | 76 ++-- pallets/api/src/messaging/weights.rs | 42 ++ pallets/api/src/mock.rs | 39 +- runtime/devnet/src/config/api/mod.rs | 50 ++- .../devnet/src/weights/messaging_weights.rs | 408 ++++++++++++++++++ runtime/devnet/src/weights/mod.rs | 1 + runtime/mainnet/src/config/xcm_weights.rs | 2 +- runtime/testnet/src/config/api/mod.rs | 4 +- 15 files changed, 1257 insertions(+), 509 deletions(-) create mode 100644 runtime/devnet/src/weights/messaging_weights.rs diff --git a/Cargo.lock b/Cargo.lock index 1e7924037..deb50ff83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1173,9 +1173,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.17" +version = "1.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" dependencies = [ "jobserver", "libc", @@ -2519,9 +2519,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.153" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4ab2681454aacfe7ce296ebc6df86791009f237f8020b0c752e8b245ba7c1d" +checksum = "76751bca18309cbce06f9821698d6c05b3af5c3fde8af5caf57f11611729397b" dependencies = [ "cc", "cxxbridge-cmd", @@ -2533,9 +2533,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.153" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e431f7ba795550f2b11c32509b3b35927d899f0ad13a1d1e030a317a08facbe" +checksum = "ab3309df6a3cbbfc900c1b7665f4a4109da2b90ce5fd9b0c9f51e3687f51c970" dependencies = [ "cc", "codespan-reporting", @@ -2547,9 +2547,9 @@ dependencies = [ [[package]] name = "cxxbridge-cmd" -version = "1.0.153" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbc41933767955d04c2a90151806029b93df5fd8b682ba22a967433347480a9" +checksum = "78ce717e582fc3b56bd2f1eb3cda9916e9b4629721e4c2ce637ac5e7d4beef11" dependencies = [ "clap", "codespan-reporting", @@ -2560,15 +2560,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.153" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9133547634329a5b76e5f58d1e53c16d627699bbcd421b9007796311165f9667" +checksum = "aa7fdd4b264a3335a8b21221092bd2fbfba35c3606bd50feb28d22ba3fb0a6e5" [[package]] name = "cxxbridge-macro" -version = "1.0.153" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e89d77ad5fd6066a3d42d94de3f72a2f23f95006da808177624429b5183596" +checksum = "c36a0a2b78ff9232a3dc584340471d4fa1751a81026cf62f3661a06d5a8bae17" dependencies = [ "proc-macro2", "quote", @@ -2725,9 +2725,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", "serde", @@ -3202,9 +3202,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys 0.59.0", @@ -3357,7 +3357,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb42427514b063d97ce21d5199f36c0c307d981434a6be32582bc79fe5bd2303" dependencies = [ "expander", - "indexmap 2.8.0", + "indexmap 2.9.0", "proc-macro-crate 3.3.0", "proc-macro2", "quote", @@ -4250,7 +4250,7 @@ dependencies = [ "futures-sink", "futures-util", "http 0.2.12", - "indexmap 2.8.0", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", @@ -4269,7 +4269,7 @@ dependencies = [ "futures-core", "futures-sink", "http 1.3.1", - "indexmap 2.8.0", + "indexmap 2.9.0", "slab", "tokio", "tokio-util", @@ -5039,9 +5039,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -6243,7 +6243,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.9.0", "libc", - "redox_syscall 0.5.10", + "redox_syscall 0.5.11", ] [[package]] @@ -6410,7 +6410,7 @@ dependencies = [ "futures-timer", "hex-literal", "hickory-resolver", - "indexmap 2.8.0", + "indexmap 2.9.0", "libc", "mockall 0.13.1", "multiaddr 0.17.1", @@ -6672,9 +6672,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" dependencies = [ "adler2", ] @@ -7315,7 +7315,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7b1d40dd8f367db3c65bec8d3dd47d4a604ee8874480738f93191bddab4e0e0" dependencies = [ "expander", - "indexmap 2.8.0", + "indexmap 2.9.0", "itertools 0.11.0", "petgraph 0.6.5", "proc-macro-crate 3.3.0", @@ -8903,7 +8903,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.10", + "redox_syscall 0.5.11", "smallvec", "windows-targets 0.52.6", ] @@ -9014,7 +9014,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset 0.4.2", - "indexmap 2.8.0", + "indexmap 2.9.0", ] [[package]] @@ -9024,7 +9024,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3672b37090dbd86368a4145bc067582552b29c27377cad4e0a306c97f9bd7772" dependencies = [ "fixedbitset 0.5.7", - "indexmap 2.8.0", + "indexmap 2.9.0", ] [[package]] @@ -9249,7 +9249,7 @@ dependencies = [ "fatality", "futures", "futures-timer", - "indexmap 2.8.0", + "indexmap 2.9.0", "parity-scale-codec", "polkadot-erasure-coding", "polkadot-node-network-protocol", @@ -10179,7 +10179,7 @@ dependencies = [ "fatality", "futures", "futures-timer", - "indexmap 2.8.0", + "indexmap 2.9.0", "parity-scale-codec", "polkadot-node-network-protocol", "polkadot-node-primitives", @@ -10905,9 +10905,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.31" +version = "0.2.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" dependencies = [ "proc-macro2", "syn 2.0.100", @@ -11436,9 +11436,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ "bitflags 2.9.0", ] @@ -13280,7 +13280,7 @@ dependencies = [ "async-trait", "futures", "futures-timer", - "indexmap 2.8.0", + "indexmap 2.9.0", "itertools 0.11.0", "linked-hash-map", "log", @@ -13782,7 +13782,7 @@ dependencies = [ "chrono", "hex", "indexmap 1.9.3", - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_derive", "serde_json", @@ -13999,9 +13999,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "smol" @@ -15850,9 +15850,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.1" +version = "1.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" dependencies = [ "backtrace", "bytes", @@ -15986,7 +15986,7 @@ version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ - "indexmap 2.8.0", + "indexmap 2.9.0", "serde", "serde_spanned", "toml_datetime", @@ -16779,7 +16779,7 @@ dependencies = [ "ahash", "bitflags 2.9.0", "hashbrown 0.14.5", - "indexmap 2.8.0", + "indexmap 2.9.0", "semver 1.0.26", "serde", ] @@ -17864,14 +17864,14 @@ dependencies = [ [[package]] name = "zip" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c03817464f64e23f6f37574b4fdc8cf65925b5bfd2b0f2aedf959791941f88" +checksum = "1dcb24d0152526ae49b9b96c1dcf71850ca1e0b882e4e28ed898a93c41334744" dependencies = [ "arbitrary", "crc32fast", "crossbeam-utils", - "indexmap 2.8.0", + "indexmap 2.9.0", "memchr", ] diff --git a/pallets/api/Cargo.toml b/pallets/api/Cargo.toml index 656cb2d06..7668fd43d 100644 --- a/pallets/api/Cargo.toml +++ b/pallets/api/Cargo.toml @@ -24,6 +24,7 @@ frame-support.workspace = true frame-system.workspace = true pallet-assets.workspace = true pallet-balances.workspace = true +pallet-timestamp.workspace = true pallet-nfts.workspace = true sp-core.workspace = true sp-io.workspace = true @@ -41,7 +42,6 @@ xcm-builder.workspace = true [dev-dependencies] pallet-balances.workspace = true pallet-ismp = { workspace = true, features = [ "unsigned" ] } -pallet-timestamp.workspace = true xcm-builder.workspace = true [features] @@ -53,6 +53,7 @@ runtime-benchmarks = [ "pallet-assets/runtime-benchmarks", "pallet-balances/runtime-benchmarks", "pallet-nfts/runtime-benchmarks", + "pallet-timestamp/runtime-benchmarks", "pallet-xcm/runtime-benchmarks", "pop-chain-extension/runtime-benchmarks", "sp-runtime/runtime-benchmarks", diff --git a/pallets/api/src/messaging/benchmarking.rs b/pallets/api/src/messaging/benchmarking.rs index aedbb72d3..0a62bb8b8 100644 --- a/pallets/api/src/messaging/benchmarking.rs +++ b/pallets/api/src/messaging/benchmarking.rs @@ -1,30 +1,28 @@ -//! Benchmarking setup for pallet_api::nonfungibles +//! Benchmarking setup for pallet_api::messaging #![cfg(feature = "runtime-benchmarks")] use ::ismp::{ - host::StateMachine, + messaging::hash_request, module::IsmpModule, - router::{ - GetRequest, GetResponse, PostRequest, PostResponse, Request, Request::*, - Response as IsmpResponse, Timeout, - }, - // dispatcher::DispatchRequest::{Post, Get}, + router::{Request, Response as IsmpResponse, Timeout}, }; use ::xcm::latest::{Junctions, Location}; use frame_benchmarking::{account, v2::*}; use frame_support::{ dispatch::RawOrigin, - sp_runtime::{traits::Hash, RuntimeDebug}, - traits::Currency, + traits::{Currency, EnsureOrigin}, BoundedVec, }; -use sp_core::{bounded_vec, keccak_256, Get, H256}; +use sp_core::{Get, H256}; use sp_io::hashing::blake2_256; -use sp_runtime::traits::{One, Zero}; +use sp_runtime::traits::One; +use sp_std::vec; use super::*; -use crate::{messaging::test_utils::*, Read as _}; +use crate::messaging::test_utils::*; + const SEED: u32 = 1; +type RuntimeOrigin = ::RuntimeOrigin; // See if `generic_event` has been emitted. fn assert_has_event(generic_event: ::RuntimeEvent) { @@ -33,12 +31,14 @@ fn assert_has_event(generic_event: ::R #[benchmarks( where - T: pallet_balances::Config + T: pallet_balances::Config + pallet_timestamp::Config, )] mod messaging_benchmarks { use super::*; - /// x: The number of removals required. + /// # Parameters + /// - `x`: `Linear<1, { T::MaxRemovals::get() }>` The number of message removals to perform + /// (bounded by `MaxRemovals`). #[benchmark] fn remove(x: Linear<1, { T::MaxRemovals::get() }>) { let deposit: BalanceOf = sp_runtime::traits::One::one(); @@ -54,7 +54,6 @@ mod messaging_benchmarks { ) .unwrap(); - // Generate unique message_id and commitment using hashing let message_id = H256::from(blake2_256(&(i.to_le_bytes()))); let commitment = H256::from(blake2_256(&(i.to_le_bytes()))); @@ -77,18 +76,22 @@ mod messaging_benchmarks { ) } - /// x: Is there a callback. + /// Submits a new XCM query message with an optional callback. + /// + /// # Parameters + /// - `x`: `Linear<0, 1>` Whether a callback is supplied: + /// - `0`: No callback + /// - `1`: Callback attached #[benchmark] fn xcm_new_query(x: Linear<0, 1>) { let owner: AccountIdOf = account("Alice", 0, SEED); let message_id: [u8; 32] = [0; 32]; let responder = Location { parents: 1, interior: Junctions::Here }; - let timeout = as One>::one() + frame_system::Pallet::::block_number(); + let timeout = frame_system::Pallet::::block_number() + 1000u32.into(); let callback = if x == 1 { Some(Callback { selector: [0; 4], - weight: 100.into(), - spare_weight_creditor: owner.clone(), + weight: Weight::from_parts(100, 100), abi: Abi::Scale, }) } else { @@ -117,40 +120,41 @@ mod messaging_benchmarks { ) } - /// x: Wether a successfully executing callback is provided. + /// Handles a response from an XCM query and executes a callback if present. + /// + /// No benchmark input parameters. A mock response is created and processed. #[benchmark] - fn xcm_response(x: Linear<0, 1>) { + fn xcm_response() { let owner: AccountIdOf = account("Alice", 0, SEED); - let message_id: [u8; 32] = [0; 32]; + let id_data = b"xcmresponse"; + let encoded = id_data.encode(); + let message_id: [u8; 32] = H256::from(blake2_256(&encoded)).into(); + let responder = Location { parents: 1, interior: Junctions::Here }; let timeout = as One>::one() + frame_system::Pallet::::block_number(); let response = Response::ExecutionResult(None); - let callback = if x == 1 { - // The mock will always assume successful callback. - Some(Callback { - selector: [0; 4], - weight: 100.into(), - spare_weight_creditor: owner.clone(), - abi: Abi::Scale, - }) - } else { - None - }; + let callback = Some(Callback { + selector: [0; 4], + weight: Weight::from_parts(100, 100), + abi: Abi::Scale, + }); pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); Pallet::::xcm_new_query( RawOrigin::Signed(owner.clone()).into(), - message_id.clone(), + message_id, responder.clone(), timeout, callback.clone(), ) .unwrap(); + let response_origin = T::XcmResponseOrigin::try_successful_origin().unwrap(); + #[extrinsic_call] - Pallet::::xcm_response(RawOrigin::Root, 0, response.clone()); + Pallet::::xcm_response(response_origin as RuntimeOrigin, 0, response.clone()); assert_has_event::( crate::messaging::Event::XcmResponseReceived { @@ -161,39 +165,51 @@ mod messaging_benchmarks { } .into(), ); - assert!(Messages::::get(&owner, &message_id).is_none()); - assert!(XcmQueries::::get(0).is_none()); } - /// x: Is it a get. (example: 1 = get, 0 = post) - /// y: the response has a callback. + /// Handles a response to a previously submitted ISMP request. + /// + /// # Parameters + /// - `x`: `Linear<0, 1>` The type of ISMP response: + /// - `0`: `PostResponse` + /// - `1`: `GetResponse` #[benchmark] - fn ismp_on_response(x: Linear<0, 1>, y: Linear<0, 1>) { + fn ismp_on_response(x: Linear<0, 1>) { let origin: T::AccountId = account("alice", 0, SEED); - let message_id = [1; 32]; - let callback = if y == 1 { - // The mock will always assume successfull callback. - Some(Callback { - selector: [0; 4], - weight: 100.into(), - spare_weight_creditor: origin.clone(), - abi: Abi::Scale, - }) - } else { - None - }; + pallet_balances::Pallet::::make_free_balance_be(&origin, u32::MAX.into()); + + let id_data = (x, b"ismp_response"); + let encoded = id_data.encode(); + let message_id: [u8; 32] = H256::from(blake2_256(&encoded)).into(); + + let weight = Weight::from_parts(100_000, 100_000); + let cb_gas_deposit = T::WeightToFee::weight_to_fee(&weight); + T::Deposit::hold(&HoldReason::CallbackGas.into(), &origin, cb_gas_deposit).unwrap(); + // also hold for message deposit + let message_deposit = calculate_protocol_deposit::( + ProtocolStorageDeposit::IsmpRequests, + ) + calculate_message_deposit::() + + calculate_deposit_of::>(); + + // Take some extra so we dont need to complicate the benchmark further. + T::Deposit::hold(&HoldReason::Messaging.into(), &origin, message_deposit * 2u32.into()) + .unwrap(); + + let callback = Some(Callback { selector: [0; 4], weight, abi: Abi::Scale }); let (response, event, commitment) = if x == 1 { // get response - let get = ismp_get_response( + let get_response = ismp_get_response( T::MaxKeyLen::get() as usize, T::MaxKeys::get() as usize, T::MaxContextLen::get() as usize, T::MaxResponseLen::get() as usize, ); - let commitment = H256::from(keccak_256(&Get(get.get.clone()).encode())); + let commitment = hash_request::(&Request::Get(get_response.get.clone())); + let get = IsmpResponse::Get(get_response); + ( - IsmpResponse::Get(get.clone()), + get, crate::messaging::Event::::IsmpGetResponseReceived { dest: origin.clone(), id: message_id, @@ -203,13 +219,17 @@ mod messaging_benchmarks { ) } else { // post response - let post = ismp_post_response( + let post_response = ismp_post_response( T::MaxDataLen::get() as usize, T::MaxResponseLen::get() as usize, ); - let commitment = H256::from(keccak_256(&Post(post.post.clone()).encode())); + + let commitment = + hash_request::(&Request::Post(post_response.post.clone().clone())); + let post = IsmpResponse::Post(post_response); + ( - IsmpResponse::Post(post.clone()), + post, crate::messaging::Event::::IsmpPostResponseReceived { dest: origin.clone(), id: message_id, @@ -228,56 +248,56 @@ mod messaging_benchmarks { #[block] { - handler.on_response(response.clone()).unwrap(); + handler.on_response(response.clone()).unwrap() } assert_has_event::(event.into()) } - /// x: is it a Request::Post, Request::Get or Response::Post. - /// x = 0: Post request. - /// x = 1: Get request. - /// x = 2: Post response. - /// y = 1: There is a callback + /// Handles timeout of a pending ISMP request or response. + /// + /// # Parameters + /// - `x`: `Linear<0, 2>` Type of item that timed out: + /// - `0`: `PostRequest` + /// - `1`: `GetRequest` + /// - `2`: `PostResponse` #[benchmark] - fn ismp_on_timeout(x: Linear<0, 2>, y: Linear<0, 1>) { - let commitment = H256::repeat_byte(2u8); + fn ismp_on_timeout(x: Linear<0, 2>) { let origin: T::AccountId = account("alice", 0, SEED); - let message_id = [1; 32]; + let id_data = (x, b"ismp_timeout"); + let encoded = id_data.encode(); + let message_id: [u8; 32] = H256::from(blake2_256(&encoded)).into(); - let callback = if y == 1 { - Some(Callback { - selector: [1; 4], - weight: 100.into(), - spare_weight_creditor: origin.clone(), - abi: Abi::Scale, - }) - } else { - None - }; + let callback = Some(Callback { + selector: [1; 4], + weight: Weight::from_parts(100, 100), + abi: Abi::Scale, + }); let (timeout_message, commitment) = if x == 0 { - let post_request = ismp_post_request(T::MaxDataLen::get() as usize); - let commitment = H256::from(keccak_256(&Post(post_request.clone()).encode())); - (Timeout::Request(Request::Post(post_request.clone())), commitment) + let post_request = Request::Post(ismp_post_request(T::MaxDataLen::get() as usize)); + let commitment = hash_request::(&post_request); + (Timeout::Request(post_request), commitment) } else if x == 1 { - let get_request = ismp_get_request( + let get_request = Request::Get(ismp_get_request( T::MaxKeyLen::get() as usize, T::MaxKeys::get() as usize, T::MaxContextLen::get() as usize, - ); - let commitment = H256::from(keccak_256(&Get(get_request.clone()).encode())); - (Timeout::Request(Request::Get(get_request.clone())), commitment) + )); + let commitment = hash_request::(&get_request); + (Timeout::Request(get_request), commitment) } else { let post_response = ismp_post_response( T::MaxDataLen::get() as usize, T::MaxResponseLen::get() as usize, ); - let commitment = H256::from(keccak_256(&Post(post_response.post.clone()).encode())); - + let commitment = + hash_request::(&Request::Post(post_response.post.clone())); (Timeout::Response(post_response), commitment) }; + let event = Event::::IsmpTimedOut { commitment }; + let input_message = Message::Ismp { commitment, callback, deposit: One::one() }; IsmpRequests::::insert(&commitment, (&origin, &message_id)); @@ -286,34 +306,43 @@ mod messaging_benchmarks { let handler = crate::messaging::ismp::Handler::::new(); #[block] { - handler.on_timeout(timeout_message).unwrap(); + handler.on_timeout(timeout_message).unwrap() } + assert_has_event::(event.into()); } - /// x: Maximum context len: bound to u16::MAX T::MaxContextLen - /// y: Maximum length of keys (inner) len: bound to u16::MAX T::MaxKeyLen - /// z: Maximum amount of keys (outer) len: bound to u16::MAX T::MaxKeys + /// Sends a `Get` request using ISMP with varying context and key sizes. + /// + /// # Parameters + /// - `y`: `Linear<0, { T::MaxContextLen::get() }>` Length of the context field (in bytes). + /// - `z`: `Linear<0, { T::MaxKeys::get() }>` Number of keys in the outer keys array. + /// - `a`: `Linear<0, 1>` Whether a callback is attached: + /// - `0`: No callback + /// - `1`: Callback attached #[benchmark] fn ismp_get( x: Linear<0, { T::MaxContextLen::get() }>, - y: Linear<0, { T::MaxKeyLen::get() }>, - z: Linear<0, { T::MaxKeys::get() }>, + y: Linear<0, { T::MaxKeys::get() }>, a: Linear<0, 1>, ) { + pallet_timestamp::Pallet::::set_timestamp(1u32.into()); let origin: T::AccountId = account("alice", 0, SEED); - let message_id = [1; 32]; + let id_data = (x, y, a, "ismp_get"); + let encoded = id_data.encode(); + let message_id = H256::from(blake2_256(&encoded)); + let inner_keys: BoundedVec = - vec![1u8].repeat(y as usize).try_into().unwrap(); + vec![1u8].repeat(T::MaxKeyLen::get() as usize).try_into().unwrap(); + let mut outer_keys = vec![]; - for k in (0..z) { + for _ in 0..y { outer_keys.push(inner_keys.clone()) } let callback = if a == 1 { Some(Callback { selector: [1; 4], - weight: 100.into(), - spare_weight_creditor: origin.clone(), + weight: Weight::from_parts(100, 100), abi: Abi::Scale, }) } else { @@ -321,44 +350,60 @@ mod messaging_benchmarks { }; let get = crate::messaging::ismp::Get:: { - dest: 0, - height: 0, - timeout: 0, + dest: 2000, + height: 100_000, + timeout: 100_000, context: vec![1u8].repeat(x as usize).try_into().unwrap(), keys: outer_keys.try_into().unwrap(), }; - pallet_balances::Pallet::::make_free_balance_be(&origin, u32::MAX.into()); + pallet_balances::Pallet::::make_free_balance_be( + &origin, + pallet_balances::Pallet::::total_issuance() / 2u32.into(), + ); #[extrinsic_call] - Pallet::::ismp_get(RawOrigin::Signed(origin.clone()), message_id, get, callback); + Pallet::::ismp_get(RawOrigin::Signed(origin.clone()), message_id.into(), get, callback); } - /// x: Maximun byte len of outgoing data. T::MaxDataLen - /// y: is there a callback. + /// Sends a `Post` request using ISMP with a variable-sized data payload. + /// + /// # Parameters + /// - `x`: `Linear<0, { T::MaxDataLen::get() }>` Length of the `data` field (in bytes). + /// - `y`: `Linear<0, 1>` Whether a callback is attached: + /// - `0`: No callback + /// - `1`: Callback attached #[benchmark] fn ismp_post(x: Linear<0, { T::MaxDataLen::get() }>, y: Linear<0, 1>) { + pallet_timestamp::Pallet::::set_timestamp(1u32.into()); + let origin: T::AccountId = account("alice", 0, SEED); - let message_id = [1; 32]; + let id_data = (x, y, b"ismp_post"); + let encoded = id_data.encode(); + let message_id = H256::from(blake2_256(&encoded)); + let data = vec![1u8].repeat(x as usize).try_into().unwrap(); - let get = crate::messaging::ismp::Post:: { dest: 0, timeout: 0, data }; + let get = crate::messaging::ismp::Post:: { dest: 2000, timeout: 100_000, data }; let callback = if y == 1 { Some(Callback { selector: [1; 4], - weight: 100.into(), - spare_weight_creditor: origin.clone(), + weight: Weight::from_parts(100, 100), + abi: Abi::Scale, }) } else { None }; - pallet_balances::Pallet::::make_free_balance_be(&origin, u32::MAX.into()); + pallet_balances::Pallet::::make_free_balance_be( + &origin, + pallet_balances::Pallet::::total_issuance() / 2u32.into(), + ); #[extrinsic_call] - Pallet::::ismp_post(RawOrigin::Signed(origin.clone()), message_id, get, callback); + Pallet::::ismp_post(RawOrigin::Signed(origin.clone()), message_id.into(), get, callback); } impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); diff --git a/pallets/api/src/messaging/deposits.rs b/pallets/api/src/messaging/deposits.rs index 5de63d92c..0ff3d24d5 100644 --- a/pallets/api/src/messaging/deposits.rs +++ b/pallets/api/src/messaging/deposits.rs @@ -1,5 +1,4 @@ use sp_runtime::SaturatedConversion; -use sp_std::ops::Mul; use super::*; diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 2c1409c2d..53d68463e 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -2,10 +2,11 @@ extern crate alloc; pub use alloc::borrow::ToOwned; +use ::ismp::Error as IsmpError; use codec::{Decode, Encode}; use frame_support::{ dispatch::{DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, - pallet_prelude::{MaxEncodedLen, Zero}, + pallet_prelude::*, storage::KeyLenOf, traits::{ fungible::Inspect, @@ -15,14 +16,17 @@ use frame_support::{ Precision::{BestEffort, Exact}, Restriction, }, - Get, OriginTrait, + Get, }, }; use frame_system::pallet_prelude::*; pub use pallet::*; use scale_info::TypeInfo; use sp_core::H256; -use sp_runtime::{traits::Saturating, BoundedVec, DispatchError}; +use sp_runtime::{ + traits::{Saturating, TryConvert}, + BoundedVec, DispatchError, +}; use sp_std::vec::Vec; use sp_weights::WeightToFee; use transports::{ @@ -44,6 +48,9 @@ pub mod transports; mod deposits; use deposits::*; +mod weights; +pub use weights::WeightInfo; + #[cfg(test)] mod tests; @@ -60,13 +67,6 @@ pub type MessageId = [u8; 32]; #[frame_support::pallet] pub mod pallet { - use frame_support::{ - pallet_prelude::*, - traits::{tokens::fungible::hold::Mutate, OnInitialize}, - }; - use sp_core::H256; - use sp_runtime::traits::TryConvert; - use super::*; /// Configuration of the pallet by specifying the parameters and types on which it depends. @@ -146,6 +146,12 @@ pub mod pallet { /// The fee paid to the relayers account for relaying a message. type IsmpRelayerFee: Get>; + + /// The implementation of Keccak used for commitment hashes. + type Keccak256: ::ismp::messaging::Keccak256; + + /// Pallet weights. + type WeightInfo: super::WeightInfo; } #[pallet::pallet] @@ -273,6 +279,10 @@ pub mod pallet { /// The messages which were removed. messages: Vec, }, + /// An ISMP message has timed out. + IsmpTimedOut { commitment: H256 }, + /// A collection of xcm queries have timed out. + XcmQueriesTimedOut { query_ids: Vec }, } #[pallet::error] @@ -316,27 +326,48 @@ pub mod pallet { // in pallet-xcm. As a result, we must handle timeouts in the pallet. // Iterate through the queries that have expired and update their status. let mut weight: Weight = Zero::zero(); + let mut query_ids = Vec::new(); for (origin, message_id) in XcmQueryTimeouts::::get(n) { weight = weight.saturating_add(DbWeightOf::::get().reads_writes(2, 1)); Messages::::mutate(origin, message_id, |maybe_message| { if let Some(Message::XcmQuery { query_id, deposit, .. }) = maybe_message.as_mut() { + query_ids.push(*query_id); *maybe_message = Some(Message::XcmTimeout { query_id: *query_id, deposit: *deposit }); } }) } + if !query_ids.is_empty() { + Self::deposit_event(Event::::XcmQueriesTimedOut { query_ids }) + } weight } } #[pallet::call] impl Pallet { - // TODO: does ismp allow querying to ensure that specified para id is supported? + /// Submit a new ISMP `Get` request. + /// + /// This sends a `Get` request through ISMP, optionally with a callback to handle the + /// response. + /// + /// # Parameters + /// - `origin`: The account submitting the request. + /// - `id`: A unique identifier for the message. + /// - `message`: The ISMP `Get` message containing query details. + /// - `callback`: Optional callback to execute upon receiving a response. #[pallet::call_index(1)] - #[pallet::weight(Weight::zero())] + #[pallet::weight( + { + let keys_len: u32 = message.keys.len().try_into().unwrap_or(T::MaxKeys::get()); + let context_len: u32 = message.context.len().try_into().unwrap_or(T::MaxContextLen::get()); + let has_callback = callback.is_some() as u32; + T::WeightInfo::ismp_get(context_len, keys_len, has_callback) + } + )] pub fn ismp_get( origin: OriginFor, id: MessageId, @@ -344,12 +375,11 @@ pub mod pallet { callback: Option, ) -> DispatchResult { let origin = ensure_signed(origin)?; - ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + ensure!(!Messages::::contains_key(&origin, id), Error::::MessageExists); let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, ) .saturating_add(calculate_message_deposit::()) - // TODO: is this meant to be our struct or theirs? .saturating_add(calculate_deposit_of::>()); T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; @@ -363,20 +393,22 @@ pub mod pallet { } // Process message by dispatching request via ISMP. - let commitment = T::IsmpDispatcher::default() - .dispatch_request( - message.into(), - FeeMetadata { payer: origin.clone(), fee: T::IsmpRelayerFee::get() }, - ) - .map_err(|_| Error::::IsmpDispatchFailed)?; + let commitment = match T::IsmpDispatcher::default().dispatch_request( + message.into(), + FeeMetadata { payer: origin.clone(), fee: T::IsmpRelayerFee::get() }, + ) { + Ok(commitment) => Ok::(commitment), + Err(e) => { + if let Ok(err) = e.downcast::() { + log::error!("ISMP Dispatch failed!! {:?}", err); + } + return Err(Error::::IsmpDispatchFailed.into()); + }, + }?; // Store commitment for lookup on response, message for querying, // response/timeout handling. - IsmpRequests::::insert(&commitment, (&origin, id)); - Messages::::insert( - &origin, - id, - Message::Ismp { commitment, callback: callback.clone(), deposit }, - ); + IsmpRequests::::insert(commitment, (&origin, id)); + Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); Pallet::::deposit_event(Event::::IsmpGetDispatched { origin, id, @@ -386,9 +418,21 @@ pub mod pallet { Ok(()) } - // TODO: does ismp allow querying to ensure that specified para id is supported? + /// Submit a new ISMP `Post` request. + /// + /// Sends a `Post` message through ISMP with arbitrary data and an optional callback. + /// + /// # Parameters + /// - `origin`: The account submitting the request. + /// - `id`: A unique identifier for the message. + /// - `message`: The ISMP `Post` message containing the payload. + /// - `callback`: Optional callback to execute upon receiving a response. #[pallet::call_index(2)] - #[pallet::weight(Weight::zero())] + #[pallet::weight({ + let data_len: u32 = message.data.len().try_into().unwrap_or(T::MaxDataLen::get()); + let has_callback = callback.is_some() as u32; + T::WeightInfo::ismp_post(data_len, has_callback) + })] pub fn ismp_post( origin: OriginFor, id: MessageId, @@ -396,7 +440,7 @@ pub mod pallet { callback: Option, ) -> DispatchResult { let origin = ensure_signed(origin)?; - ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + ensure!(!Messages::::contains_key(&origin, id), Error::::MessageExists); let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, ) @@ -423,12 +467,8 @@ pub mod pallet { // Store commitment for lookup on response, message for querying, // response/timeout handling. - IsmpRequests::::insert(&commitment, (&origin, id)); - Messages::::insert( - &origin, - id, - Message::Ismp { commitment, callback: callback.clone(), deposit }, - ); + IsmpRequests::::insert(commitment, (&origin, id)); + Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); Pallet::::deposit_event(Event::::IsmpPostDispatched { origin, id, @@ -438,8 +478,22 @@ pub mod pallet { Ok(()) } + /// Initiate a new XCM query. + /// + /// Starts a query using the XCM interface, specifying a responder and timeout block. + /// + /// # Parameters + /// - `origin`: The account initiating the query. + /// - `id`: A unique message ID. + /// - `responder`: Location of the XCM responder. + /// - `timeout`: Block number after which the query should timeout. + /// - `callback`: Optional callback for handling the response. #[pallet::call_index(3)] - #[pallet::weight(Weight::zero())] + #[pallet::weight( + { + T::WeightInfo::xcm_new_query(callback.is_some() as u32) + } + )] pub fn xcm_new_query( origin: OriginFor, id: MessageId, @@ -450,7 +504,7 @@ pub mod pallet { let querier_location = T::OriginConverter::try_convert(origin.clone()) .map_err(|_| Error::::OriginConversionFailed)?; let origin = ensure_signed(origin)?; - ensure!(!Messages::::contains_key(&origin, &id), Error::::MessageExists); + ensure!(!Messages::::contains_key(&origin, id), Error::::MessageExists); let current_block = frame_system::Pallet::::block_number(); ensure!(current_block < timeout, Error::::FutureTimeoutMandatory); @@ -487,12 +541,8 @@ pub mod pallet { // Store query id for later lookup on response, message for querying status, // response/timeout handling. - XcmQueries::::insert(&query_id, (&origin, id)); - Messages::::insert( - &origin, - id, - Message::XcmQuery { query_id, callback: callback.clone(), deposit }, - ); + XcmQueries::::insert(query_id, (&origin, id)); + Messages::::insert(&origin, id, Message::XcmQuery { query_id, callback, deposit }); Pallet::::deposit_event(Event::::XcmQueryCreated { origin, id, @@ -502,9 +552,18 @@ pub mod pallet { Ok(()) } - // NOTE: dispatchable should not fail, otherwise response will be lost. + /// Handle a response to a previous XCM query. + /// + /// Executes a stored callback or updates the state with the received response. + /// + /// # Parameters + /// - `origin`: The XCM responder origin. + /// - `query_id`: The ID of the XCM query being responded to. + /// - `xcm_response`: The response data. #[pallet::call_index(4)] - #[pallet::weight(Weight::zero())] // todo: benchmarking + #[pallet::weight({ + T::WeightInfo::xcm_response() + T::CallbackExecutor::execution_weight() + })] pub fn xcm_response( origin: OriginFor, query_id: QueryId, @@ -514,7 +573,7 @@ pub mod pallet { let (initiating_origin, id) = XcmQueries::::get(query_id).ok_or(Error::::MessageNotFound)?; let xcm_query_message = - Messages::::get(&initiating_origin, &id).ok_or(Error::::MessageNotFound)?; + Messages::::get(&initiating_origin, id).ok_or(Error::::MessageNotFound)?; let (query_id, callback, deposit) = match &xcm_query_message { Message::XcmQuery { query_id, callback, deposit } => (query_id, callback, deposit), @@ -534,7 +593,7 @@ pub mod pallet { // Attempt callback with response if specified. log::debug!(target: "pop-api::extension", "xcm callback={:?}, response={:?}", callback, xcm_response); if Self::call(&initiating_origin, callback.to_owned(), &id, &xcm_response).is_ok() { - Messages::::remove(&initiating_origin, &id); + Messages::::remove(&initiating_origin, id); XcmQueries::::remove(query_id); T::Deposit::release( &HoldReason::Messaging.into(), @@ -548,7 +607,7 @@ pub mod pallet { // No callback is executed, Messages::::insert( &initiating_origin, - &id, + id, Message::XcmResponse { query_id: *query_id, deposit: *deposit, @@ -559,9 +618,15 @@ pub mod pallet { Ok(()) } - /// Try and remove a collection of messages. + /// Remove a batch of completed or timed-out messages. + /// + /// Allows users to clean up storage and reclaim deposits for messages that have concluded. + /// + /// # Parameters + /// - `origin`: The account removing the messages. + /// - `messages`: List of message IDs to remove (bounded by `MaxRemovals`). #[pallet::call_index(5)] - #[pallet::weight(Weight::zero())] + #[pallet::weight(T::WeightInfo::remove(messages.len() as u32))] pub fn remove( origin: OriginFor, messages: BoundedVec, @@ -577,22 +642,22 @@ pub mod pallet { Message::Ismp { .. } => Err(Error::::RequestPending), Message::XcmQuery { .. } => Err(Error::::RequestPending), Message::IsmpResponse { deposit, commitment, .. } => { - Messages::::remove(&origin, &id); - IsmpRequests::::remove(&commitment); + Messages::::remove(&origin, id); + IsmpRequests::::remove(commitment); Ok(deposit) }, Message::XcmResponse { deposit, query_id, .. } => { - Messages::::remove(&origin, &id); + Messages::::remove(&origin, id); XcmQueries::::remove(query_id); Ok(deposit) }, Message::IsmpTimeout { deposit, commitment, .. } => { - Messages::::remove(&origin, &id); - IsmpRequests::::remove(&commitment); + Messages::::remove(&origin, id); + IsmpRequests::::remove(commitment); Ok(deposit) }, Message::XcmTimeout { query_id, deposit, .. } => { - Messages::::remove(&origin, &id); + Messages::::remove(&origin, id); XcmQueries::::remove(query_id); Ok(deposit) }, @@ -608,7 +673,16 @@ pub mod pallet { } } impl Pallet { - // Attempt to notify via callback. + /// Executes a callback function associated with a message response. + /// + /// This function constructs the payload from the callback ABI and data, then invokes the + /// callback using the runtime's `CallbackExecutor`. + /// + /// # Parameters + /// - `initiating_origin`: The account that originally dispatched the request. + /// - `callback`: The callback definition, including selector, ABI, and weight. + /// - `id`: The identifier for the original message. + /// - `data`: The payload to be passed to the callback (e.g., response data). pub(crate) fn call( initiating_origin: &AccountIdOf, callback: Callback, @@ -627,6 +701,19 @@ impl Pallet { Self::handle_callback_result(initiating_origin, id, result, callback) } + /// Handles the result of a previously executed callback function. + /// + /// This function is responsible for: + /// - Refunding unused callback gas weight. + /// - Transferring the execution reward to the fee account. + /// - Emitting success or failure events. + /// - Cleaning up or persisting message state based on result. + /// + /// # Parameters + /// - `initiating_origin`: The account that initiated the callback. + /// - `id`: The message ID associated with this callback. + /// - `result`: The execution result (with post-dispatch info if any). + /// - `callback`: The original callback definition. pub(crate) fn handle_callback_result( initiating_origin: &AccountIdOf, id: &MessageId, @@ -646,13 +733,13 @@ impl Pallet { T::Deposit::release( &reason, - &initiating_origin, + initiating_origin, returnable_deposit, BestEffort, )?; T::Deposit::transfer_on_hold( &reason, - &initiating_origin, + initiating_origin, &T::FeeAccount::get(), execution_reward, BestEffort, @@ -674,7 +761,7 @@ impl Pallet { let total_deposit = T::WeightToFee::weight_to_fee(&callback.weight); T::Deposit::transfer_on_hold( &HoldReason::CallbackGas.into(), - &initiating_origin, + initiating_origin, &T::FeeAccount::get(), total_deposit, BestEffort, @@ -685,12 +772,12 @@ impl Pallet { // Fallback to storing the message for polling - pre-paid weight is lost. Self::deposit_event(Event::::CallbackFailed { origin: initiating_origin.clone(), - id: id.clone(), + id: *id, callback, post_info, error, }); - Err(error) + Ok(()) }, } } @@ -733,8 +820,7 @@ impl crate::Read for Pallet { type Result = ReadResult; fn weight(_read: &Self::Read) -> Weight { - // TODO: implement benchmarks - Weight::zero() + T::DbWeight::get().reads(2) } fn read(request: Self::Read) -> Self::Result { @@ -761,48 +847,78 @@ impl crate::Read for Pallet { } } +/// Represents a cross-chain message in the system. +/// +/// Each variant of this enum captures a different state or type of message lifecycle: +/// - A request in progress. +/// - A response received. +/// - A timeout occurred. +/// +/// This is used internally to track, manage, and clean up messages, along with any +/// associated deposits and optional callback metadata. #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] -pub enum Message { - Ismp { - commitment: H256, - callback: Option, - deposit: BalanceOf, - }, - XcmQuery { - query_id: QueryId, - callback: Option, - deposit: BalanceOf, - }, +pub(crate) enum Message { + /// Represents a pending ISMP request. + /// + /// # Fields + /// - `commitment`: The cryptographic commitment of the request payload. + /// - `callback`: An optional callback to invoke upon receiving a response. + /// - `deposit`: The total deposit held to cover message and callback fees. + Ismp { commitment: H256, callback: Option, deposit: BalanceOf }, + + /// Represents a pending XCM query request. + /// + /// # Fields + /// - `query_id`: Unique identifier for the XCM query. + /// - `callback`: An optional callback for handling the response. + /// - `deposit`: The deposit held to cover fees for query execution and callback. + XcmQuery { query_id: QueryId, callback: Option, deposit: BalanceOf }, + + /// Represents a received ISMP response. + /// + /// # Fields + /// - `commitment`: The original commitment for the request. + /// - `deposit`: The held deposit for the message, which may be released or burned. + /// - `response`: The encoded response payload, size-bounded by `T::MaxResponseLen`. IsmpResponse { commitment: H256, deposit: BalanceOf, response: BoundedVec, }, - XcmResponse { - query_id: QueryId, - deposit: BalanceOf, - response: Response, - }, - IsmpTimeout { - commitment: H256, - deposit: BalanceOf, - }, - XcmTimeout { - query_id: QueryId, - deposit: BalanceOf, - }, + + /// Represents a received XCM response. + /// + /// # Fields + /// - `query_id`: Identifier that matches a previously sent XCM query. + /// - `deposit`: The deposit originally held for this message. + /// - `response`: The deserialized response payload. + XcmResponse { query_id: QueryId, deposit: BalanceOf, response: Response }, + + /// Represents an ISMP request that timed out before a response was received. + /// + /// # Fields + /// - `commitment`: The original commitment of the request. + /// - `deposit`: The deposit held for the request, which may be reclaimed. + IsmpTimeout { commitment: H256, deposit: BalanceOf }, + + /// Represents an XCM query that timed out before a response was received. + /// + /// # Fields + /// - `query_id`: The original query ID that timed out. + /// - `deposit`: The deposit held for the query, which may be reclaimed. + XcmTimeout { query_id: QueryId, deposit: BalanceOf }, } impl From<&Message> for MessageStatus { fn from(value: &Message) -> Self { - match value { - &Message::Ismp { .. } => MessageStatus::Pending, - &Message::XcmQuery { .. } => MessageStatus::Pending, - &Message::IsmpResponse { .. } => MessageStatus::Complete, - &Message::XcmResponse { .. } => MessageStatus::Complete, - &Message::IsmpTimeout { .. } => MessageStatus::Timeout, - &Message::XcmTimeout { .. } => MessageStatus::Timeout, + match *value { + Message::Ismp { .. } => MessageStatus::Pending, + Message::XcmQuery { .. } => MessageStatus::Pending, + Message::IsmpResponse { .. } => MessageStatus::Complete, + Message::XcmResponse { .. } => MessageStatus::Complete, + Message::IsmpTimeout { .. } => MessageStatus::Timeout, + Message::XcmTimeout { .. } => MessageStatus::Timeout, } } } @@ -828,8 +944,27 @@ pub struct Callback { pub enum Abi { Scale, } + +/// The trait responsible for executing callbacks in response to cross-chain messages. +/// +/// Implementors of this trait define the mechanism by which callback data is executed +/// for a given account, along with the expected weight cost of this operation. +/// +/// This trait enables customizable and extensible behavior for handling asynchronous +/// responses via optional callback logic — e.g., invoking a runtime call or a smart contract. pub trait CallbackExecutor { + /// Execute the callback logic for a specific account with the given encoded payload. + /// + /// # Parameters + /// - `account`: The account that initiated the original cross-chain request. + /// - `data`: Encoded callback data, typically ABI-encoded input including selector and + /// parameters. + /// - `weight`: The maximum weight allowed for executing this callback. fn execute(account: &T::AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo; + + /// Returns the baseline weight required for a single callback execution. + /// + /// This serves as an overhead estimate, useful for pallet-level weight calculations. fn execution_weight() -> Weight; } diff --git a/pallets/api/src/messaging/test_utils.rs b/pallets/api/src/messaging/test_utils.rs index 693e4d619..404c13d80 100644 --- a/pallets/api/src/messaging/test_utils.rs +++ b/pallets/api/src/messaging/test_utils.rs @@ -1,31 +1,7 @@ -use ::xcm::latest::{Junctions, Location}; -use codec::Encode; -use frame_benchmarking::{account, v2::*}; -use frame_support::{dispatch::RawOrigin, traits::Currency, BoundedVec}; -use ismp::{ - host::StateMachine, - module::IsmpModule, - router::{ - GetRequest, GetResponse, PostRequest, PostResponse, Response as IsmpResponse, StorageValue, - }, -}; -use sp_runtime::traits::{One, Zero}; - -use crate::messaging::Config; - -pub fn ismp_get_request(key_len: usize, keys_len: usize, context_len: usize) -> GetRequest { - GetRequest { - source: StateMachine::Polkadot(2000), - dest: StateMachine::Polkadot(2001), - nonce: 100u64, - from: [1u8; 32].to_vec(), - keys: vec![vec![1u8; key_len]; keys_len], - height: 1, - context: [1u8].repeat(context_len), - timeout_timestamp: 100_000, - } -} +use ismp::{host::StateMachine, router::PostRequest}; +#[cfg(any(feature = "runtime-benchmarks", test))] +/// Constructs a dummy `PostRequest` used for testing or benchmarking. pub fn ismp_post_request(body_len: usize) -> PostRequest { PostRequest { source: StateMachine::Polkadot(2000), @@ -34,34 +10,64 @@ pub fn ismp_post_request(body_len: usize) -> PostRequest { from: [1u8; 32].to_vec(), to: [1u8; 32].to_vec(), timeout_timestamp: 100_000, - body: [1u8].repeat(body_len), + body: vec![1u8; body_len], } } -pub fn ismp_get_response( - key_len: usize, - keys_len: usize, - context_len: usize, - response_len: usize, -) -> GetResponse { - let r = get_storage_value(); - let r_encoded_size = r.encoded_size(); +#[cfg(feature = "runtime-benchmarks")] +pub use benchmark_helpers::*; + +#[cfg(feature = "runtime-benchmarks")] +mod benchmark_helpers { + use codec::Encode; + use ismp::{ + host::StateMachine, + router::{GetRequest, GetResponse, PostResponse, StorageValue}, + }; + use sp_std::vec::Vec; - let mut total_response_len = 0; - let mut values = vec![]; - while total_response_len < response_len.saturating_sub(r_encoded_size) { - total_response_len += r_encoded_size; - values.push(r.clone()); + use super::ismp_post_request; + + /// Constructs a dummy `GetRequest` with specified dimensions. + pub fn ismp_get_request(key_len: usize, keys_len: usize, context_len: usize) -> GetRequest { + GetRequest { + source: StateMachine::Polkadot(2000), + dest: StateMachine::Polkadot(2001), + nonce: 100u64, + from: vec![1u8; 32], + keys: vec![vec![1u8; key_len]; keys_len], + height: 1, + context: vec![1u8; context_len], + timeout_timestamp: 100_000, + } } - GetResponse { get: ismp_get_request(key_len, keys_len, context_len), values } -} + /// Constructs a dummy `GetResponse` of approximately the requested size. + pub fn ismp_get_response( + key_len: usize, + keys_len: usize, + context_len: usize, + response_len: usize, + ) -> GetResponse { + let r = get_storage_value(); + let r_encoded_size = r.encoded_size(); + let iterations = response_len / r_encoded_size; -pub fn ismp_post_response(body_len: usize, response_len: usize) -> PostResponse { - let response = [1u8].repeat(response_len); - PostResponse { post: ismp_post_request(body_len), response, timeout_timestamp: 100_001 } -} + let values = (0..iterations.saturating_sub(1)).map(|_| r.clone()).collect::>(); -pub fn get_storage_value() -> StorageValue { - StorageValue { key: [1u8; 32].to_vec(), value: Some([1u8; 32].to_vec()) } + debug_assert!(values.encoded_size() < response_len); + + GetResponse { get: ismp_get_request(key_len, keys_len, context_len), values } + } + + /// Constructs a dummy `PostResponse` with a body of the requested length. + pub fn ismp_post_response(body_len: usize, response_len: usize) -> PostResponse { + let response = vec![1u8; response_len.saturating_sub(2)]; + PostResponse { post: ismp_post_request(body_len), response, timeout_timestamp: 100_001 } + } + + /// Constructs a dummy `StorageValue`. + pub fn get_storage_value() -> StorageValue { + StorageValue { key: vec![1u8; 1], value: Some(vec![1u8; 1]) } + } } diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index cfbff9345..678eef317 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -1,19 +1,8 @@ #![cfg(test)] -use codec::Encode; -use frame_support::{ - assert_noop, assert_ok, - dispatch::WithPostDispatchInfo, - sp_runtime::{traits::Zero, DispatchError::BadOrigin}, - testing_prelude::bounded_vec, - weights::Weight, -}; +use frame_support::{assert_noop, assert_ok, testing_prelude::bounded_vec, weights::Weight}; use sp_core::H256; -use crate::{ - messaging::{test_utils, *}, - mock::*, - Read, -}; +use crate::{messaging::*, mock::*}; pub fn events() -> Vec> { let result = System::events() @@ -49,8 +38,8 @@ mod remove { let m_id = [0u8; 32]; let m2_id = [1u8; 32]; - Messages::::insert(&ALICE, m_id, &m); - Messages::::insert(&ALICE, m2_id, &m); + Messages::::insert(ALICE, m_id, &m); + Messages::::insert(ALICE, m2_id, &m); ::Deposit::hold( &HoldReason::Messaging.into(), @@ -96,9 +85,9 @@ mod remove { let m2_id = [1; 32]; let m3_id = [2; 32]; - Messages::::insert(&ALICE, m_id, &m); - Messages::::insert(&ALICE, m2_id, &m); - Messages::::insert(&ALICE, m3_id, &m); + Messages::::insert(ALICE, m_id, &m); + Messages::::insert(ALICE, m2_id, &m); + Messages::::insert(ALICE, m3_id, &m); ::Deposit::hold( &HoldReason::Messaging.into(), @@ -122,15 +111,15 @@ mod remove { assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(m_id, m2_id, m3_id))); assert!( - Messages::::get(&ALICE, m_id).is_none(), + Messages::::get(ALICE, m_id).is_none(), "Message should have been removed." ); assert!( - Messages::::get(&ALICE, m2_id).is_none(), + Messages::::get(ALICE, m2_id).is_none(), "Message should have been removed." ); assert!( - Messages::::get(&ALICE, m3_id).is_none(), + Messages::::get(ALICE, m3_id).is_none(), "Message should have been removed." ); }); @@ -139,7 +128,7 @@ mod remove { #[test] fn deposit_is_returned_if_try_remove_is_ok() { new_test_ext().execute_with(|| { - let alice_initial_balance = Balances::free_balance(&ALICE); + let alice_initial_balance = Balances::free_balance(ALICE); let deposit: Balance = 100; // An ismp response can always be removed. let m = Message::IsmpResponse { @@ -155,13 +144,13 @@ mod remove { deposit, ) .unwrap(); - Messages::::insert(&ALICE, m_id, &m); + Messages::::insert(ALICE, m_id, &m); - let alice_balance_post_hold = Balances::free_balance(&ALICE); + let alice_balance_post_hold = Balances::free_balance(ALICE); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(m_id))); - let alice_balance_post_remove = Balances::free_balance(&ALICE); + let alice_balance_post_remove = Balances::free_balance(ALICE); assert_eq!(alice_initial_balance, alice_balance_post_remove); assert_eq!(alice_balance_post_remove, alice_balance_post_hold + deposit); @@ -171,7 +160,7 @@ mod remove { #[test] fn deposit_is_not_returned_if_try_remove_is_noop() { new_test_ext().execute_with(|| { - let alice_initial_balance = Balances::free_balance(&ALICE); + let alice_initial_balance = Balances::free_balance(ALICE); let deposit: Balance = 100; // Ismp message with status of Ok is considered pending. @@ -184,16 +173,16 @@ mod remove { deposit, ) .unwrap(); - Messages::::insert(&ALICE, m_id, &m); + Messages::::insert(ALICE, m_id, &m); - let alice_balance_post_hold = Balances::free_balance(&ALICE); + let alice_balance_post_hold = Balances::free_balance(ALICE); assert_noop!( Messaging::remove(signed(ALICE), bounded_vec!(m_id)), Error::::RequestPending ); - let alice_balance_post_remove = Balances::free_balance(&ALICE); + let alice_balance_post_remove = Balances::free_balance(ALICE); assert_eq!(alice_initial_balance, alice_balance_post_remove + deposit); assert_eq!(alice_balance_post_remove, alice_balance_post_hold); @@ -204,7 +193,7 @@ mod remove { fn multiple_messages_rolls_back_if_one_fails() { new_test_ext().execute_with(|| { let deposit: Balance = 100; - let alice_initial_balance = Balances::free_balance(&ALICE); + let alice_initial_balance = Balances::free_balance(ALICE); let good_message = Message::IsmpResponse { commitment: Default::default(), deposit: 0, @@ -220,11 +209,11 @@ mod remove { let good_id_4 = [3; 32]; let erroneous_id_1 = [4; 32]; - Messages::::insert(&ALICE, good_id_1, &good_message); - Messages::::insert(&ALICE, good_id_2, &good_message); - Messages::::insert(&ALICE, good_id_3, &good_message); - Messages::::insert(&ALICE, good_id_4, &good_message); - Messages::::insert(&ALICE, erroneous_id_1, &erroneous_message); + Messages::::insert(ALICE, good_id_1, &good_message); + Messages::::insert(ALICE, good_id_2, &good_message); + Messages::::insert(ALICE, good_id_3, &good_message); + Messages::::insert(ALICE, good_id_4, &good_message); + Messages::::insert(ALICE, erroneous_id_1, &erroneous_message); // gonna do 5 messages. ::Deposit::hold( @@ -258,7 +247,7 @@ mod remove { ) .unwrap(); - let alice_balance_post_hold = Balances::free_balance(&ALICE); + let alice_balance_post_hold = Balances::free_balance(ALICE); assert_noop!( Messaging::remove( @@ -268,13 +257,13 @@ mod remove { Error::::RequestPending ); - assert!(Messages::::get(&ALICE, good_id_1).is_some()); - assert!(Messages::::get(&ALICE, good_id_2).is_some()); - assert!(Messages::::get(&ALICE, good_id_3).is_some()); - assert!(Messages::::get(&ALICE, good_id_4).is_some()); - assert!(Messages::::get(&ALICE, erroneous_id_1).is_some()); + assert!(Messages::::get(ALICE, good_id_1).is_some()); + assert!(Messages::::get(ALICE, good_id_2).is_some()); + assert!(Messages::::get(ALICE, good_id_3).is_some()); + assert!(Messages::::get(ALICE, good_id_4).is_some()); + assert!(Messages::::get(ALICE, erroneous_id_1).is_some()); - let alice_balance_post_remove = Balances::free_balance(&ALICE); + let alice_balance_post_remove = Balances::free_balance(ALICE); assert_eq!(alice_initial_balance, alice_balance_post_hold + deposit * 5); assert_eq!(alice_balance_post_remove, alice_balance_post_hold); }); @@ -288,8 +277,8 @@ mod remove { let message_id = [0u8; 32]; let deposit = 100; let m = Message::Ismp { commitment, callback: None, deposit }; - Messages::::insert(&ALICE, &message_id, &m); - IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); + Messages::::insert(ALICE, message_id, &m); + IsmpRequests::::insert(commitment, (&ALICE, &message_id)); ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); @@ -299,11 +288,11 @@ mod remove { ); assert!( - Messages::::get(&ALICE, &message_id).is_some(), + Messages::::get(ALICE, message_id).is_some(), "Message should not have been removed but has." ); assert!( - IsmpRequests::::get(&commitment).is_some(), + IsmpRequests::::get(commitment).is_some(), "Message should not have been removed but has." ); }) @@ -317,19 +306,19 @@ mod remove { let deposit = 100; let m = Message::IsmpResponse { commitment, response: bounded_vec!(), deposit }; - Messages::::insert(&ALICE, &message_id, &m); - IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); + Messages::::insert(ALICE, message_id, &m); + IsmpRequests::::insert(commitment, (&ALICE, &message_id)); ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); assert!( - Messages::::get(&ALICE, &message_id).is_none(), + Messages::::get(ALICE, message_id).is_none(), "Message should have been removed but hasnt." ); assert!( - IsmpRequests::::get(&commitment).is_none(), + IsmpRequests::::get(commitment).is_none(), "Request should have been removed but hasnt." ); }) @@ -343,19 +332,19 @@ mod remove { let deposit = 100; let m = Message::IsmpTimeout { commitment, deposit }; - Messages::::insert(&ALICE, &message_id, &m); - IsmpRequests::::insert(&commitment, (&ALICE, &message_id)); + Messages::::insert(ALICE, message_id, &m); + IsmpRequests::::insert(commitment, (&ALICE, &message_id)); ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); assert!( - Messages::::get(&ALICE, &message_id).is_none(), + Messages::::get(ALICE, message_id).is_none(), "Message should have been removed but hasnt." ); assert!( - IsmpRequests::::get(&commitment).is_none(), + IsmpRequests::::get(commitment).is_none(), "Request should have been removed but hasnt." ); }) @@ -369,7 +358,7 @@ mod remove { let deposit = 100; let m = Message::XcmQuery { query_id, callback: None, deposit }; - Messages::::insert(&ALICE, &message_id, &m); + Messages::::insert(ALICE, message_id, &m); XcmQueries::::insert(query_id, (&ALICE, &message_id)); ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); @@ -379,7 +368,7 @@ mod remove { Error::::RequestPending ); assert!( - Messages::::get(&ALICE, &message_id).is_some(), + Messages::::get(ALICE, message_id).is_some(), "Message should not have been removed but has" ); assert!( @@ -396,7 +385,7 @@ mod remove { let message_id = [0u8; 32]; let deposit = 100; let m = Message::XcmResponse { query_id, deposit, response: Default::default() }; - Messages::::insert(&ALICE, &message_id, &m); + Messages::::insert(ALICE, message_id, &m); XcmQueries::::insert(query_id, (&ALICE, &message_id)); ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); @@ -404,7 +393,7 @@ mod remove { assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); assert!( - Messages::::get(&ALICE, &message_id).is_none(), + Messages::::get(ALICE, message_id).is_none(), "Message should have been removed but hasnt" ); assert!( @@ -425,13 +414,13 @@ mod remove { ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); - Messages::::insert(&ALICE, &message_id, &m); + Messages::::insert(ALICE, message_id, &m); XcmQueries::::insert(query_id, (&ALICE, &message_id)); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); assert!( - Messages::::get(&ALICE, &message_id).is_none(), + Messages::::get(ALICE, message_id).is_none(), "Message should have been removed but hasnt" ); assert!( @@ -515,7 +504,7 @@ mod xcm_new_query { ); assert!(callback_deposit != 0); - let alices_balance_pre_hold = Balances::free_balance(&ALICE); + let alices_balance_pre_hold = Balances::free_balance(ALICE); let message_id = [0; 32]; assert_ok!(Messaging::xcm_new_query( @@ -526,7 +515,7 @@ mod xcm_new_query { Some(callback), )); - let alices_balance_post_hold = Balances::free_balance(&ALICE); + let alices_balance_post_hold = Balances::free_balance(ALICE); assert_eq!(alices_balance_pre_hold - alices_balance_post_hold, expected_deposit); }); @@ -545,11 +534,11 @@ mod xcm_new_query { message_id, RESPONSE_LOCATION, timeout, - Some(expected_callback.clone()), + Some(expected_callback), )); let m = Messages::::get(ALICE, message_id) .expect("should exist after xcm_new_query."); - if let Message::XcmQuery { query_id, callback, deposit } = m { + if let Message::XcmQuery { query_id, callback, .. } = m { assert_eq!(query_id, 0); assert_eq!(callback, Some(expected_callback)); } else { @@ -608,7 +597,7 @@ mod xcm_response { )); // Update the message to XcmTimedOut - Messages::::mutate(&ALICE, &message_id, |message| { + Messages::::mutate(ALICE, message_id, |message| { let Some(Message::XcmQuery { query_id, deposit, .. }): &mut Option> = message else { @@ -630,7 +619,7 @@ mod xcm_response { new_test_ext().execute_with(|| { let message_id = [0; 32]; let timeout = System::block_number() + 1; - let mut generated_query_id = 0; + let generated_query_id = 0; let xcm_response = Response::Null; assert_ok!(Messaging::xcm_new_query( @@ -657,7 +646,7 @@ mod xcm_response { new_test_ext().execute_with(|| { let message_id = [0; 32]; let timeout = System::block_number() + 1; - let mut expected_query_id = 0; + let expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); assert_ok!(Messaging::xcm_new_query( @@ -669,8 +658,8 @@ mod xcm_response { )); assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); - let Some(Message::XcmResponse { query_id, deposit, response }): Option> = - Messages::get(&ALICE, message_id) + let Some(Message::XcmResponse { query_id, response, .. }): Option> = + Messages::get(ALICE, message_id) else { panic!("wrong message type"); }; @@ -685,7 +674,7 @@ mod xcm_response { new_test_ext().execute_with(|| { let message_id = [0; 32]; let timeout = System::block_number() + 1; - let mut expected_query_id = 0; + let expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); let callback = Callback { selector: [1; 4], weight: 100.into(), abi: Abi::Scale }; @@ -698,7 +687,7 @@ mod xcm_response { )); assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); - assert!(Messages::::get(&ALICE, &message_id).is_none()); + assert!(Messages::::get(ALICE, message_id).is_none()); assert!(XcmQueries::::get(expected_query_id).is_none()); }) } @@ -708,7 +697,7 @@ mod xcm_response { new_test_ext().execute_with(|| { let message_id = [0; 32]; let timeout = System::block_number() + 1; - let mut expected_query_id = 0; + let expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); let callback = Callback { selector: [1; 4], weight: 0.into(), abi: Abi::Scale }; let expected_deposit = calculate_protocol_deposit::< @@ -720,7 +709,7 @@ mod xcm_response { ::OnChainByteFee, >(); - let alice_balance_pre_hold = Balances::free_balance(&ALICE); + let alice_balance_pre_hold = Balances::free_balance(ALICE); assert_ok!(Messaging::xcm_new_query( signed(ALICE), @@ -730,11 +719,11 @@ mod xcm_response { Some(callback), )); - let alice_balance_post_hold = Balances::free_balance(&ALICE); + let alice_balance_post_hold = Balances::free_balance(ALICE); assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); - let alice_balance_post_release = Balances::free_balance(&ALICE); + let alice_balance_post_release = Balances::free_balance(ALICE); assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); assert_eq!(alice_balance_post_release, alice_balance_pre_hold); @@ -744,14 +733,11 @@ mod xcm_response { mod xcm_hooks { use super::*; - #[test] fn xcm_queries_expire_on_expiry_block() { new_test_ext().execute_with(|| { let message_id = [0; 32]; let timeout = System::block_number() + 10; - let xcm_response = Response::ExecutionResult(None); - assert_ok!(Messaging::xcm_new_query( signed(ALICE), message_id, @@ -760,13 +746,30 @@ mod xcm_hooks { None, )); + let message_id_2 = [1; 32]; + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id_2, + RESPONSE_LOCATION, + timeout, + None, + )); + run_to(timeout + 1); let Some(Message::XcmTimeout { .. }): Option> = - Messages::get(&ALICE, message_id) + Messages::get(ALICE, message_id) else { panic!("Message should be timedout!") }; + + let Some(Message::XcmTimeout { .. }): Option> = + Messages::get(ALICE, message_id_2) + else { + panic!("Message should be timedout!") + }; + + frame_system::Pallet::::assert_has_event(Event::::XcmQueriesTimedOut { query_ids: vec![0, 1] }.into()); }) } } @@ -801,19 +804,16 @@ mod handle_callback_result { ) .unwrap(); - let pot_pre_handle = Balances::free_balance(&FEE_ACCOUNT); - let alice_balance_pre_handle = Balances::free_balance(&ALICE); + let pot_pre_handle = Balances::free_balance(FEE_ACCOUNT); + let alice_balance_pre_handle = Balances::free_balance(ALICE); assert!(crate::messaging::Pallet::::handle_callback_result( - &origin, - &id, - result, - callback.clone() + &origin, &id, result, callback ) - .is_err()); + .is_ok()); - let alice_balance_post_handle = Balances::free_balance(&ALICE); - let pot_post_handle = Balances::free_balance(&FEE_ACCOUNT); + let alice_balance_post_handle = Balances::free_balance(ALICE); + let pot_post_handle = Balances::free_balance(FEE_ACCOUNT); assert_eq!(alice_balance_post_handle, alice_balance_pre_handle); assert_eq!(pot_post_handle, pot_pre_handle + deposit); @@ -827,7 +827,7 @@ mod handle_callback_result { let id = [1u8; 32]; let actual_weight = Weight::from_parts(100, 100); let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { - actual_weight: Some(actual_weight.clone()), + actual_weight: Some(actual_weight), pays_fee: Pays::Yes, }); let callback = Callback { @@ -847,16 +847,9 @@ mod handle_callback_result { .unwrap(); assert_ok!(crate::messaging::Pallet::::handle_callback_result( - &origin, - &id, - result, - callback.clone() + &origin, &id, result, callback )); - assert!(events().contains(&Event::::CallbackExecuted { - origin: origin.clone(), - id, - callback - })); + assert!(events().contains(&Event::::CallbackExecuted { origin, id, callback })); }) } @@ -877,12 +870,10 @@ mod handle_callback_result { }; assert!(crate::messaging::Pallet::::handle_callback_result( - &origin, - &id, - result, - callback.clone() + &origin, &id, result, callback ) - .is_err()); + .is_ok()); + assert!(events().contains(&Event::::CallbackFailed { origin, id, @@ -902,7 +893,7 @@ mod handle_callback_result { let callback_weight_reserved = Weight::from_parts(100_000_000, 100_000_000); let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { - actual_weight: Some(actual_weight_executed.clone()), + actual_weight: Some(actual_weight_executed), pays_fee: Pays::Yes, }); @@ -928,21 +919,18 @@ mod handle_callback_result { let fee_pot_payment = deposit - expected_refund; - let fee_account_pre_handle = Balances::free_balance(&FEE_ACCOUNT); - let alice_balance_pre_handle = Balances::free_balance(&ALICE); + let fee_account_pre_handle = Balances::free_balance(FEE_ACCOUNT); + let alice_balance_pre_handle = Balances::free_balance(ALICE); assert!(crate::messaging::Pallet::::handle_callback_result( - &origin, - &id, - result, - callback.clone() + &origin, &id, result, callback ) .is_ok()); - /// alice should have been refunded by the tune of expected refund. - /// the fee pot should have been increased by fee_pot_payment. - let fee_account_post_handle = Balances::free_balance(&FEE_ACCOUNT); - let alice_balance_post_handle = Balances::free_balance(&ALICE); + // alice should have been refunded by the tune of expected refund. + // the fee pot should have been increased by fee_pot_payment. + let fee_account_post_handle = Balances::free_balance(FEE_ACCOUNT); + let alice_balance_post_handle = Balances::free_balance(ALICE); assert_eq!(alice_balance_post_handle - alice_balance_pre_handle, expected_refund); assert_eq!(fee_account_post_handle, fee_account_pre_handle + fee_pot_payment); @@ -1000,13 +988,13 @@ mod ismp_get { calculate_deposit_of::::OffChainByteFee, ismp::Get>( ) + ismp_fee + callback_deposit; - let alice_balance_pre_hold = Balances::free_balance(&ALICE); + let alice_balance_pre_hold = Balances::free_balance(ALICE); assert_ok!(Messaging::ismp_get(signed(ALICE), message_id, message, Some(callback))); - let alice_balance_post_hold = Balances::free_balance(&ALICE); + let alice_balance_post_hold = Balances::free_balance(ALICE); - assert!(expected_deposit != (0 + ismp_fee)); + assert!(expected_deposit != ismp_fee); assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); }) } @@ -1023,18 +1011,18 @@ mod ismp_get { keys: bounded_vec!(), }; let callback = None; - assert_ok!(Messaging::ismp_get(signed(ALICE), message_id.clone(), message, callback)); + assert_ok!(Messaging::ismp_get(signed(ALICE), message_id, message, callback)); let events = events(); let Some(Event::::IsmpGetDispatched { origin, id, commitment, callback }) = events.first() else { panic!("missing event"); }; - assert_eq!( - IsmpRequests::::get(&commitment).unwrap(), - (ALICE, message_id.clone()) - ); - let Some(Message::Ismp { .. }) = Messages::::get(&ALICE, &message_id) else { + assert!(callback.is_none()); + assert_eq!(*id, message_id); + assert_eq!(origin, &ALICE); + assert_eq!(IsmpRequests::::get(commitment).unwrap(), (ALICE, message_id)); + let Some(Message::Ismp { .. }) = Messages::::get(ALICE, message_id) else { panic!("wrong message type"); }; }) @@ -1051,14 +1039,9 @@ mod ismp_post { let message = ismp::Post { dest: 2000, timeout: 100, data: bounded_vec![] }; let callback = None; - assert_ok!(Messaging::ismp_post( - signed(ALICE), - message_id.clone(), - message.clone(), - callback - )); + assert_ok!(Messaging::ismp_post(signed(ALICE), message_id, message.clone(), callback)); assert_noop!( - Messaging::ismp_post(signed(ALICE), message_id.clone(), message, callback), + Messaging::ismp_post(signed(ALICE), message_id, message, callback), Error::::MessageExists ); }) @@ -1073,13 +1056,13 @@ mod ismp_post { let weight = Weight::from_parts(100_000_000, 100_000_000); let callback = Callback { selector: [1; 4], weight, abi: Abi::Scale }; let callback_deposit = ::WeightToFee::weight_to_fee(&weight); - let alice_balance_pre_hold = Balances::free_balance(&ALICE); + let alice_balance_pre_hold = Balances::free_balance(ALICE); assert!(callback_deposit != 0); assert_ok!(Messaging::ismp_post( signed(ALICE), - message_id.clone(), + message_id, message.clone(), Some(callback) )); @@ -1092,9 +1075,9 @@ mod ismp_post { calculate_deposit_of::::OffChainByteFee, ismp::Post>( ) + ismp_fee + callback_deposit; - assert!(expected_deposit != (0 + ismp_fee)); + assert!(expected_deposit != ismp_fee); - let alice_balance_post_hold = Balances::free_balance(&ALICE); + let alice_balance_post_hold = Balances::free_balance(ALICE); assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); }) @@ -1107,12 +1090,7 @@ mod ismp_post { let message = ismp::Post { dest: 2000, timeout: 100, data: bounded_vec![] }; let callback = None; - assert_ok!(Messaging::ismp_post( - signed(ALICE), - message_id.clone(), - message.clone(), - callback - )); + assert_ok!(Messaging::ismp_post(signed(ALICE), message_id, message.clone(), callback)); let events = events(); let Some(Event::::IsmpPostDispatched { origin, id, commitment, callback }) = @@ -1120,11 +1098,12 @@ mod ismp_post { else { panic!("missing event"); }; - assert_eq!( - IsmpRequests::::get(&commitment).unwrap(), - (ALICE, message_id.clone()) - ); - let Some(Message::Ismp { .. }) = Messages::::get(&ALICE, &message_id) else { + + assert_eq!(origin, &ALICE); + assert_eq!(*id, message_id); + assert!(callback.is_none()); + assert_eq!(IsmpRequests::::get(commitment).unwrap(), (ALICE, message_id)); + let Some(Message::Ismp { .. }) = Messages::::get(ALICE, message_id) else { panic!("wrong message type"); }; }) @@ -1132,26 +1111,98 @@ mod ismp_post { } mod ismp_hooks { + use super::*; fn handler() -> ismp::Handler { ismp::Handler::::new() } - mod on_timeout { + mod on_accept { + use ::ismp::module::IsmpModule; + use super::*; + use crate::messaging::test_utils::ismp_post_request; + + /// The on_accept must return Ok even when not in use. + /// If an error is returned the receipt is not removed and a replay attack is possible. + #[test] + fn is_ok() { + new_test_ext().execute_with(|| { + let h = handler(); + assert!(h.on_accept(ismp_post_request(100usize)).is_ok()) + }) + } + } + + mod timeout_commitment { + + use super::*; + #[test] + fn request_not_found() { + new_test_ext().execute_with(|| { + let err = ismp::timeout_commitment::(&Default::default()).unwrap_err(); + assert_eq!( + err.downcast::().unwrap(), + IsmpError::Custom( + "Request commitment not found while processing timeout.".into() + ) + ) + }) + } + + #[test] + fn invalid_request() { + new_test_ext().execute_with(|| { + let commitment: H256 = [8u8; 32].into(); + let message_id = [7u8; 32]; + let message = Message::XcmQuery { query_id: 0, callback: None, deposit: 100 }; + + IsmpRequests::::insert(commitment, (&ALICE, message_id)); + Messages::::insert(ALICE, message_id, &message); + + let err = ismp::timeout_commitment::(&commitment).unwrap_err(); + assert_eq!( + err.downcast::().unwrap(), + IsmpError::Custom("Invalid message".into()) + ) + }) + } + + #[test] + fn actually_timesout_assert_event() { + new_test_ext().execute_with(|| { + let commitment: H256 = [8u8; 32].into(); + let message_id = [7u8; 32]; + IsmpRequests::::insert(commitment, (&ALICE, message_id)); + let message = Message::Ismp { commitment, callback: None, deposit: 100 }; + Messages::::insert(ALICE, message_id, &message); + + let res = ismp::timeout_commitment::(&commitment); + + assert!(res.is_ok(), "{:?}", res.unwrap_err().downcast::().unwrap()); + + if let Some(Message::IsmpTimeout { commitment, deposit: 100 }) = + Messages::::get(ALICE, message_id) + { + let events = events(); + assert!(events.contains(&Event::::IsmpTimedOut { commitment })) + } else { + panic!("Message not timedout.") + } + }) + } } mod process_response { use ::ismp::Error as IsmpError; use super::*; - #[test] fn response_exceeds_max_encoded_len_limit() { new_test_ext().execute_with(|| { let byte = 1u8; - let exceeds = vec![byte].repeat( + let exceeds = [byte].repeat( <::MaxResponseLen as Get>::get() as usize + 1usize, ); let commitment: H256 = Default::default(); @@ -1226,8 +1277,7 @@ mod ismp_hooks { assert!(res.is_ok(), "process_response failed"); - let Some(Message::IsmpResponse { commitment, deposit, response }) = - Messages::::get(&ALICE, &message_id) + let Some(Message::IsmpResponse { .. }) = Messages::::get(ALICE, message_id) else { panic!("wrong message type.") }; @@ -1251,7 +1301,7 @@ mod ismp_hooks { ) .unwrap(); - let alice_post_hold = Balances::free_balance(&ALICE); + let alice_post_hold = Balances::free_balance(ALICE); IsmpRequests::::insert(commitment, (ALICE, message_id)); Messages::::insert(ALICE, message_id, message); @@ -1262,7 +1312,7 @@ mod ismp_hooks { assert!(res.is_ok(), "process_response failed"); - let alice_post_process = Balances::free_balance(&ALICE); + let alice_post_process = Balances::free_balance(ALICE); assert_eq!(alice_post_process - deposit, alice_post_hold); }) } diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 99a84ac67..6cc340c16 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -7,6 +7,7 @@ use ::ismp::{ DispatchRequest::{self}, }, host::StateMachine, + messaging::hash_request, }; use codec::{Decode, Encode, MaxEncodedLen}; use frame_support::{ @@ -18,17 +19,18 @@ use frame_support::{ use ismp::{ dispatcher::DispatchPost, module::IsmpModule, - router::{GetResponse, PostRequest, PostResponse, Request::*, Response, Timeout}, + router::{GetResponse, PostRequest, PostResponse, Request, Response, Timeout}, Error, }; use pallet_ismp::weights::IsmpModuleWeight; use scale_info::TypeInfo; -use sp_core::{keccak_256, H256}; -use sp_runtime::{BoundedVec, Saturating}; +use sp_core::H256; +use sp_runtime::BoundedVec; use crate::messaging::{ pallet::{Config, Event, IsmpRequests, Messages, Pallet}, - AccountIdOf, HoldReason, MessageId, Vec, + weights::WeightInfo, + AccountIdOf, CallbackExecutor, HoldReason, MessageId, }; pub const ID: [u8; 3] = *b"pop"; @@ -113,6 +115,12 @@ impl From> for DispatchRequest { } pub struct Handler(PhantomData); +impl Default for Handler { + fn default() -> Self { + Self::new() + } +} + impl Handler { pub fn new() -> Self { Self(PhantomData) @@ -121,23 +129,21 @@ impl Handler { impl IsmpModule for Handler { fn on_accept(&self, _request: PostRequest) -> Result<(), anyhow::Error> { - Err(Error::Custom("pop-net is not accepting post requests at this time!".to_string()) - .into()) + Ok(()) } fn on_response(&self, response: Response) -> Result<(), anyhow::Error> { // Hash request to determine key for message lookup. match response { Response::Get(GetResponse { get, values }) => { - log::debug!(target: "pop-api::extension", "StorageValue={:?}", values[0]); - // TODO: This should be bound to the hasher used in the ismp dispatcher. - let commitment = H256::from(keccak_256(&Get(get).encode())); + log::debug!(target: "pop-api::extension", "StorageValue={:?}", values); + let commitment = hash_request::(&Request::Get(get)); process_response(&commitment, &values, |dest, id| { Event::::IsmpGetResponseReceived { dest, id, commitment } }) }, Response::Post(PostResponse { post, response, .. }) => { - let commitment = H256::from(keccak_256(&Post(post).encode())); + let commitment = hash_request::(&Request::Post(post)); process_response(&commitment, &response, |dest, id| { Event::::IsmpPostResponseReceived { dest, id, commitment } }) @@ -149,14 +155,11 @@ impl IsmpModule for Handler { match timeout { Timeout::Request(request) => { // hash request to determine key for original request id lookup - let commitment = match request { - Get(get) => H256::from(keccak_256(&get.encode())), - Post(post) => H256::from(keccak_256(&post.encode())), - }; + let commitment = hash_request::(&request); timeout_commitment::(&commitment) }, - Timeout::Response(response) => { - let commitment = H256::from(keccak_256(&Post(response.post).encode())); + Timeout::Response(PostResponse { post, .. }) => { + let commitment = hash_request::(&Request::Post(post)); timeout_commitment::(&commitment) }, } @@ -166,15 +169,25 @@ impl IsmpModule for Handler { impl IsmpModuleWeight for Pallet { // Static as not in use. fn on_accept(&self, _request: &PostRequest) -> Weight { - DbWeightOf::::get().reads_writes(2, 1) + DbWeightOf::::get().reads_writes(1, 1) } - fn on_timeout(&self, _timeout: &Timeout) -> Weight { - DbWeightOf::::get().reads_writes(2, 1) + fn on_timeout(&self, timeout: &Timeout) -> Weight { + let x = match timeout { + Timeout::Request(Request::Post(_)) => 0u32, + Timeout::Request(Request::Get(_)) => 1u32, + Timeout::Response(_) => 2u32, + }; + T::WeightInfo::ismp_on_timeout(x) } - fn on_response(&self, _response: &Response) -> Weight { - DbWeightOf::::get().reads_writes(2, 2) + fn on_response(&self, response: &Response) -> Weight { + let x = match response { + Response::Get(_) => 1, + Response::Post(_) => 0, + }; + + T::WeightInfo::ismp_on_response(x).saturating_add(T::CallbackExecutor::execution_weight()) } } @@ -192,7 +205,7 @@ pub(crate) fn process_response( IsmpRequests::::get(commitment).ok_or(Error::Custom("Request not found.".into()))?; let Some(super::super::Message::Ismp { commitment, callback, deposit }) = - Messages::::get(&initiating_origin, &id) + Messages::::get(&initiating_origin, id) else { return Err(Error::Custom("Message must be an ismp request.".into()).into()); }; @@ -204,8 +217,8 @@ pub(crate) fn process_response( if let Some(callback) = callback { if Pallet::::call(&initiating_origin, callback, &id, response_data).is_ok() { // Clean storage, return deposit - Messages::::remove(&initiating_origin, &id); - IsmpRequests::::remove(&commitment); + Messages::::remove(&initiating_origin, id); + IsmpRequests::::remove(commitment); T::Deposit::release(&HoldReason::Messaging.into(), &initiating_origin, deposit, Exact) .map_err(|_| Error::Custom("failed to release deposit.".into()))?; @@ -220,23 +233,26 @@ pub(crate) fn process_response( .map_err(|_| Error::Custom("response exceeds max".into()))?; Messages::::insert( &initiating_origin, - &id, + id, super::super::Message::IsmpResponse { commitment, deposit, response: encoded_response }, ); Ok(()) } -fn timeout_commitment(commitment: &H256) -> Result<(), anyhow::Error> { - let key = - IsmpRequests::::get(commitment).ok_or(Error::Custom("request not found".into()))?; +pub(crate) fn timeout_commitment(commitment: &H256) -> Result<(), anyhow::Error> { + let key = IsmpRequests::::get(commitment) + .ok_or(Error::Custom("Request commitment not found while processing timeout.".into()))?; Messages::::try_mutate(key.0, key.1, |message| { let Some(super::super::Message::Ismp { commitment, deposit, .. }) = message else { - return Err(Error::Custom("message not found".into())); + return Err(Error::Custom("Invalid message".into())); }; *message = Some(super::super::Message::IsmpTimeout { deposit: *deposit, commitment: *commitment }); - Ok(()) })?; + + crate::messaging::Pallet::::deposit_event(Event::::IsmpTimedOut { + commitment: *commitment, + }); Ok(()) } diff --git a/pallets/api/src/messaging/weights.rs b/pallets/api/src/messaging/weights.rs index e69de29bb..3f834d648 100644 --- a/pallets/api/src/messaging/weights.rs +++ b/pallets/api/src/messaging/weights.rs @@ -0,0 +1,42 @@ +use crate::*; + +pub trait WeightInfo { + fn remove(x: u32) -> Weight; + fn xcm_new_query(x: u32) -> Weight; + fn xcm_response() -> Weight; + fn ismp_on_response(x: u32) -> Weight; + fn ismp_on_timeout(x: u32) -> Weight; + fn ismp_get(x: u32, y: u32, a: u32) -> Weight; + fn ismp_post(x: u32, y: u32) -> Weight; +} + +#[cfg(test)] +impl WeightInfo for () { + fn remove(_x: u32) -> Weight { + Default::default() + } + + fn xcm_new_query(_x: u32) -> Weight { + Default::default() + } + + fn xcm_response() -> Weight { + Default::default() + } + + fn ismp_on_response(_x: u32) -> Weight { + Default::default() + } + + fn ismp_on_timeout(_x: u32) -> Weight { + Default::default() + } + + fn ismp_get(_x: u32, _y: u32, _a: u32) -> Weight { + Default::default() + } + + fn ismp_post(_x: u32, _y: u32) -> Weight { + Default::default() + } +} diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index a6beee1fd..575ee7dde 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -10,11 +10,10 @@ use frame_support::{ }, }; use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned}; -use ismp::{error::Error, host::StateMachine, module::IsmpModule, router::IsmpRouter}; +use ismp::{host::StateMachine, module::IsmpModule, router::IsmpRouter}; use pallet_nfts::PalletFeatures; -use pallet_xcm::{Origin, TestWeightInfo}; use scale_info::TypeInfo; -use sp_core::{keccak_256, H256}; +use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, TryConvert, Verify}, BuildStorage, @@ -26,7 +25,6 @@ use crate::messaging::{Call, CallbackExecutor, Messages, NotifyQueryHandler}; pub(crate) const ALICE: AccountId = 1; pub(crate) const BOB: AccountId = 2; pub(crate) const CHARLIE: AccountId = 3; -pub(crate) const RESPONSE: AccountId = 4; pub(crate) const RESPONSE_LOCATION: Location = Location { parents: 1, interior: Junctions::Here }; pub(crate) const FEE_ACCOUNT: AccountId = 5; pub(crate) const INIT_AMOUNT: Balance = 100_000_000 * UNIT; @@ -222,12 +220,12 @@ impl crate::nonfungibles::Config for Test { pub struct AlwaysSuccessfullCallbackExecutor(T); impl CallbackExecutor for AlwaysSuccessfullCallbackExecutor { fn execute( - account: &::AccountId, - data: Vec, + _account: &::AccountId, + _data: Vec, weight: sp_runtime::Weight, ) -> frame_support::dispatch::DispatchResultWithPostInfo { DispatchResultWithPostInfo::Ok(PostDispatchInfo { - actual_weight: Some(weight), + actual_weight: Some(weight / 2), pays_fee: Pays::Yes, }) } @@ -250,10 +248,10 @@ impl NotifyQueryHandler for MockNotifyQuery { type WeightInfo = (); fn new_notify_query( - responder: impl Into, - notify: Call, - timeout: BlockNumberFor, - match_querier: impl Into, + _responder: impl Into, + _notify: Call, + _timeout: BlockNumberFor, + _match_querier: impl Into, ) -> u64 { get_next_query_id() } @@ -271,6 +269,7 @@ impl crate::messaging::Config for Test { type FeeAccount = FeeAccount; type IsmpDispatcher = pallet_ismp::Pallet; type IsmpRelayerFee = IsmpRelayerFee; + type Keccak256 = Keccak; type MaxContextLen = ConstU32<64>; type MaxDataLen = ConstU32<1024>; type MaxKeyLen = ConstU32<32>; @@ -283,11 +282,23 @@ impl crate::messaging::Config for Test { type OriginConverter = AccountToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; + type WeightInfo = (); type WeightToFee = RefTimePlusProofTime; type Xcm = MockNotifyQuery; type XcmResponseOrigin = EnsureRootWithResponseSuccess; } +pub struct Keccak; + +impl ::ismp::messaging::Keccak256 for Keccak { + fn keccak256(bytes: &[u8]) -> sp_core::H256 + where + Self: Sized, + { + sp_core::keccak_256(bytes).into() + } +} + pub struct RefTimePlusProofTime; impl sp_weights::WeightToFee for RefTimePlusProofTime { type Balance = Balance; @@ -316,7 +327,7 @@ impl EnsureOrigin for EnsureRootWithResponseSuccess { type Success = Location; fn try_origin(o: RuntimeOrigin) -> Result { - if let Ok(_) = EnsureRoot::ensure_origin(o.clone()) { + if EnsureRoot::ensure_origin(o.clone()).is_ok() { Ok(RESPONSE_LOCATION) } else { Err(o) @@ -324,8 +335,8 @@ impl EnsureOrigin for EnsureRootWithResponseSuccess { } #[cfg(feature = "runtime-benchmarks")] - fn try_successful_origin() -> Result { - todo!() + fn try_successful_origin() -> Result { + Ok(RuntimeOrigin::root()) } } diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index c28026519..8e91491ad 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -13,16 +13,16 @@ use pallet_api::{extension::*, Read}; use pallet_revive::{AddressMapper, CollectEvents, DebugInfo}; use pallet_xcm::Origin; use sp_core::ConstU8; -use sp_runtime::DispatchError; +use sp_runtime::{traits::AccountIdConversion, DispatchError}; use versioning::*; -use xcm::latest::Location; +use xcm::latest::{Junctions, Location}; use crate::{ config::{ assets::{TrustBackedAssetsInstance, TrustBackedNftsInstance}, xcm::LocalOriginToLocation, }, - fungibles, messaging, nonfungibles, parameter_types, AccountId, Balances, BlockNumber, + fungibles, messaging, nonfungibles, parameter_types, weights, AccountId, Balances, BlockNumber, ConstU32, Ismp, Revive, Runtime, RuntimeCall, RuntimeEvent, RuntimeHoldReason, RuntimeOrigin, TransactionByteFee, }; @@ -114,20 +114,28 @@ impl nonfungibles::Config for Runtime { parameter_types! { pub const MaxXcmQueryTimeoutsPerBlock: u32 = 100; + // TODO: What is reasonable. + + pub const IsmpRelayerFee: crate::Balance = crate::UNIT / 2; + pub DummyFeeAccount: AccountId = crate::PalletId(*b"dummyacc").into_account_truncating(); + } impl messaging::Config for Runtime { type CallbackExecutor = CallbackExecutor; type Deposit = Balances; + type FeeAccount = DummyFeeAccount; type IsmpDispatcher = Ismp; + type IsmpRelayerFee = IsmpRelayerFee; + type Keccak256 = Ismp; type MaxContextLen = ConstU32<64>; - type MaxDataLen = ConstU32<1024>; - type MaxKeyLen = ConstU32<1000>; + type MaxDataLen = ConstU32<512>; + type MaxKeyLen = ConstU32<8>; type MaxKeys = ConstU32<10>; // TODO: size appropriately - type MaxRemovals = ConstU32<1024>; + type MaxRemovals = ConstU32<100>; // TODO: ensure within the contract buffer bounds - type MaxResponseLen = ConstU32<1024>; + type MaxResponseLen = ConstU32<512>; type MaxXcmQueryTimeoutsPerBlock = MaxXcmQueryTimeoutsPerBlock; // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as // much as onchain cost. @@ -136,6 +144,7 @@ impl messaging::Config for Runtime { type OriginConverter = LocalOriginToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; + type WeightInfo = weights::messaging_weights::WeightInfo; type WeightToFee = ::WeightToFee; type Xcm = QueryHandler; type XcmResponseOrigin = EnsureResponse; @@ -154,13 +163,36 @@ impl> + From> EnsureOrigin for EnsureRespon #[cfg(feature = "runtime-benchmarks")] fn try_successful_origin() -> Result { - todo!() + Ok(Origin::Response(Location { parents: 1, interior: Junctions::Here }).into()) + } +} + +#[cfg(feature = "runtime-benchmarks")] +pub struct CallbackExecutor; +#[cfg(feature = "runtime-benchmarks")] +impl messaging::CallbackExecutor for CallbackExecutor { + /// A successfull callback is the most expensive case. + fn execute( + _account: &AccountId, + _data: Vec, + weight: sp_runtime::Weight, + ) -> frame_support::dispatch::DispatchResultWithPostInfo { + DispatchResultWithPostInfo::Ok(PostDispatchInfo { + actual_weight: Some(weight / 2), + pays_fee: Pays::Yes, + }) + } + + fn execution_weight() -> sp_runtime::Weight { + Default::default() } } +#[cfg(not(feature = "runtime-benchmarks"))] pub struct CallbackExecutor; +#[cfg(not(feature = "runtime-benchmarks"))] impl messaging::CallbackExecutor for CallbackExecutor { - fn execute(account: AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo { + fn execute(account: &AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo { type AddressMapper = ::AddressMapper; // Default diff --git a/runtime/devnet/src/weights/messaging_weights.rs b/runtime/devnet/src/weights/messaging_weights.rs new file mode 100644 index 000000000..e0b264a2a --- /dev/null +++ b/runtime/devnet/src/weights/messaging_weights.rs @@ -0,0 +1,408 @@ + +//! Autogenerated weights for `messaging` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.0.0 +//! DATE: 2025-04-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Felixs-MacBook-Pro.local`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// pop +// bench +// pallet +// --pallet=messaging +// --extrinsic= +// --steps=50 +// --output=./test.rs +// --runtime=/Users/rmrf-2/code/pop-node/target/release/wbuild/pop-runtime-devnet/pop_runtime_devnet.wasm +// --genesis-builder=runtime +// --genesis-builder-preset=pop-devnet-dev + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `messaging`. +pub struct WeightInfo(PhantomData); +impl pallet_api::messaging::WeightInfo for WeightInfo { + /// Storage: `Messaging::Messages` (r:100 w:100) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `Messaging::IsmpRequests` (r:0 w:100) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 100]`. + fn remove(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `376 + x * (105 ±0)` + // Estimated: `3676 + x * (15317 ±0)` + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(16_498_789, 0) + .saturating_add(Weight::from_parts(0, 3676)) + // Standard Error: 81_445 + .saturating_add(Weight::from_parts(23_207_141, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(x.into()))) + .saturating_add(Weight::from_parts(0, 15317).saturating_mul(x.into())) + } + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `Messaging::XcmQueryTimeouts` (r:1 w:1) + /// Proof: `Messaging::XcmQueryTimeouts` (`max_values`: None, `max_size`: Some(6406), added: 8881, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Messaging::XcmQueries` (r:0 w:1) + /// Proof: `Messaging::XcmQueries` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[0, 1]`. + fn xcm_new_query(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `217` + // Estimated: `16307` + // Minimum execution time: 33_000_000 picoseconds. + Weight::from_parts(37_740_816, 0) + .saturating_add(Weight::from_parts(0, 16307)) + // Standard Error: 139_507 + .saturating_add(Weight::from_parts(15_159_183, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: `Messaging::XcmQueries` (r:1 w:1) + /// Proof: `Messaging::XcmQueries` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn xcm_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `614` + // Estimated: `16307` + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(59_000_000, 0) + .saturating_add(Weight::from_parts(0, 16307)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Messaging::IsmpRequests` (r:1 w:0) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// The range of component `x` is `[0, 1]`. + fn ismp_on_response(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `616` + // Estimated: `16307` + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(40_463_265, 0) + .saturating_add(Weight::from_parts(0, 16307)) + // Standard Error: 159_358 + .saturating_add(Weight::from_parts(19_236_734, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Messaging::IsmpRequests` (r:1 w:0) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// The range of component `x` is `[0, 2]`. + fn ismp_on_timeout(_x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `382` + // Estimated: `16307` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_881_491, 0) + .saturating_add(Weight::from_parts(0, 16307)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Ismp::Nonce` (r:1 w:1) + /// Proof: `Ismp::Nonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Messaging::IsmpRequests` (r:0 w:1) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ebe4bf2b1e0d50a47a6026ff9f89` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ebe4bf2b1e0d50a47a6026ff9f89` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b822d5f9e7430a9c13023708b6e8` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b822d5f9e7430a9c13023708b6e8` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d2b7f8adb5263695b748b50b35e7` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d2b7f8adb5263695b748b50b35e7` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b6d3b50d11d63f5a16223d0f6192` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b6d3b50d11d63f5a16223d0f6192` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bcad1167844259b7475e67add0cf` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bcad1167844259b7475e67add0cf` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737c0b35a703d5af186e16b0b8b26a` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737c0b35a703d5af186e16b0b8b26a` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737a9bb2e4cb5ef3f3b83e18ecd62c` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737a9bb2e4cb5ef3f3b83e18ecd62c` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bc04fe0f0a74ebff15d2d87fdbb1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bc04fe0f0a74ebff15d2d87fdbb1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737b5d150daa95d0c51137f28408ba` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737b5d150daa95d0c51137f28408ba` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ede597e3a5ee230597ae65009027` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ede597e3a5ee230597ae65009027` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473843abb5f01c6b8d278b95bab27d7` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473843abb5f01c6b8d278b95bab27d7` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738d3edf6cbffbd715d91df9544259` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738d3edf6cbffbd715d91df9544259` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473fbbb0dd84b2c05ab7e6c2e912be2` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473fbbb0dd84b2c05ab7e6c2e912be2` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473516ff665c874f7d80a3094a2766f` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473516ff665c874f7d80a3094a2766f` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473157e0cfb3591a4031670f0bd0b59` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473157e0cfb3591a4031670f0bd0b59` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c2600acf6638dc572aba8bb7e17e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c2600acf6638dc572aba8bb7e17e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747370d530e6e97b84f2b9f5f31f0f1e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747370d530e6e97b84f2b9f5f31f0f1e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c2a55a808472cc90a56c9263e8c4` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c2a55a808472cc90a56c9263e8c4` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bcfa64038d41c7e5b13c56a3790e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bcfa64038d41c7e5b13c56a3790e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747302abe5edca3db5f3a60882617054` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747302abe5edca3db5f3a60882617054` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f484690eb40af82a20f82dd43a40` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f484690eb40af82a20f82dd43a40` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739afaa33dccd1c2b5663a9fec3aa6` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739afaa33dccd1c2b5663a9fec3aa6` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473edb24a55dd96654731b01c5fa1ce` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473edb24a55dd96654731b01c5fa1ce` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473204326c0a899add1bb9a0e44017a` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473204326c0a899add1bb9a0e44017a` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738f97a59a48ba326530dcbb00fdb8` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738f97a59a48ba326530dcbb00fdb8` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473dc615e4d8f5e4c499a4ee16e7250` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473dc615e4d8f5e4c499a4ee16e7250` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747382ff59321a7eb8f0a981e8b30d45` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747382ff59321a7eb8f0a981e8b30d45` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ee1a18c63a6d8b4d22066227cfe9` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ee1a18c63a6d8b4d22066227cfe9` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b332273af6fa385aea8eabd929ff` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b332273af6fa385aea8eabd929ff` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747308d7352d7ef3b6c484dfc7ce4170` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747308d7352d7ef3b6c484dfc7ce4170` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74736a3a8637e8e4441ed411038befc6` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74736a3a8637e8e4441ed411038befc6` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747314f08dae9f0fabe5e14b1ee5d47b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747314f08dae9f0fabe5e14b1ee5d47b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747302610adfd3510c9eab269a6ec1b5` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747302610adfd3510c9eab269a6ec1b5` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d32f80b2876c566c3430e688efeb` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d32f80b2876c566c3430e688efeb` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735b92766ff94e59a786b6a9d0da86` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735b92766ff94e59a786b6a9d0da86` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a4fc3ec43ba8dcf284f9a4c66f13` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a4fc3ec43ba8dcf284f9a4c66f13` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b5247a619d23a30bdf3ff78fd89b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b5247a619d23a30bdf3ff78fd89b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747336e585a9e1ee1d17225dc509ae08` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747336e585a9e1ee1d17225dc509ae08` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f204de8a4423fc0f0768f6c44195` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f204de8a4423fc0f0768f6c44195` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739793d71a6b55c8409d727dcb6ea5` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739793d71a6b55c8409d727dcb6ea5` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74736322c9c869ac42b212a820e89521` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74736322c9c869ac42b212a820e89521` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473aabcf2a6dd2f496aa860a00848eb` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473aabcf2a6dd2f496aa860a00848eb` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747396da168082ed8d61a69d2dab4e34` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747396da168082ed8d61a69d2dab4e34` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473aaaff2ef1ddb3cb4b95ef0add4eb` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473aaaff2ef1ddb3cb4b95ef0add4eb` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733a095d2d68fed2e16a116323519e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733a095d2d68fed2e16a116323519e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c76bbd37cb335ea589d72db8524d` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c76bbd37cb335ea589d72db8524d` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473eeee49f922f8d8e3979af1c8309c` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473eeee49f922f8d8e3979af1c8309c` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735f3b12a201b21e36b7978712f54b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735f3b12a201b21e36b7978712f54b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747314b2d52d980ecf84a512ec317eef` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747314b2d52d980ecf84a512ec317eef` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e5819ce235d668ceb400b71b7540` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e5819ce235d668ceb400b71b7540` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ce5d8239372e6ade982bb6c1a08d` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ce5d8239372e6ade982bb6c1a08d` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747378d3ad24fa3dba23353cdddaebda` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747378d3ad24fa3dba23353cdddaebda` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a6f563c75970e55f0f579c663bc5` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a6f563c75970e55f0f579c663bc5` (r:1 w:1) + /// The range of component `x` is `[0, 64]`. + /// The range of component `y` is `[0, 10]`. + /// The range of component `a` is `[0, 1]`. + fn ismp_get(x: u32, y: u32, a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `604` + // Estimated: `252485529539233056 + a * (221360928884514619392 ±340_282_366_920_938_463_463_374_607_431_768_211_455) + x * (18446744073709551616 ±1_656_260_326_287_731) + y * (885443715538058477568 ±13_250_082_610_301_856)` + // Minimum execution time: 70_000_000 picoseconds. + Weight::from_parts(77_313_015, 0) + .saturating_add(Weight::from_parts(0, 252485529539233056)) + // Standard Error: 10_108 + .saturating_add(Weight::from_parts(168_303, 0).saturating_mul(y.into())) + // Standard Error: 68_132 + .saturating_add(Weight::from_parts(14_701_619, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) + // Added manually from ismp_post + .saturating_add(Weight::from_parts(0, 816).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 8448).saturating_mul(y.into())) + } + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Ismp::Nonce` (r:1 w:1) + /// Proof: `Ismp::Nonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Messaging::IsmpRequests` (r:0 w:1) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738bcc4d5639f6254cf5fb180c0f72` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738bcc4d5639f6254cf5fb180c0f72` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747329c14ef481742eefb7788386c681` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747329c14ef481742eefb7788386c681` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473287e74fac42e4ec79f5df44ce538` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473287e74fac42e4ec79f5df44ce538` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738855267813169e1a708e4e75f5a4` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738855267813169e1a708e4e75f5a4` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74732701a1cee50c8d6a53d46cd5ec9c` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74732701a1cee50c8d6a53d46cd5ec9c` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b9b3aa15a2889c21b7dba485c2c9` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b9b3aa15a2889c21b7dba485c2c9` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739b94cb38b0eeacc24002a991f884` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739b94cb38b0eeacc24002a991f884` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a751421a4bc2ed95713fe54770be` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a751421a4bc2ed95713fe54770be` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747360dac5301eeb275913f0ea8cd5e1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747360dac5301eeb275913f0ea8cd5e1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f862082677fea2554a85a022ac4e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f862082677fea2554a85a022ac4e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473fd50b6c6ca4e895c83d52a34a78b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473fd50b6c6ca4e895c83d52a34a78b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74734557713d9ab03e150f5de5ff31fe` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74734557713d9ab03e150f5de5ff31fe` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c384b875cbf15d88c72f7fcdf46d` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c384b875cbf15d88c72f7fcdf46d` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f86067141771d95fda435ce4c9ed` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f86067141771d95fda435ce4c9ed` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737bfab4afd6a9461416f2eef6c631` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737bfab4afd6a9461416f2eef6c631` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473162048f20318aed8443da4fc86a0` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473162048f20318aed8443da4fc86a0` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e9199a3f6daaa9e08bc80c4fb6d2` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e9199a3f6daaa9e08bc80c4fb6d2` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733e3906031411b8a73b2a37e10c30` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733e3906031411b8a73b2a37e10c30` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473db5b8c06d688e761d750e08ec388` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473db5b8c06d688e761d750e08ec388` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473cb972b1ef83734f649cf01a1cdf6` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473cb972b1ef83734f649cf01a1cdf6` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473dc363d873b7bf73b7a48ca0044e1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473dc363d873b7bf73b7a48ca0044e1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747388b3ef1033bdb656252f25d7242f` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747388b3ef1033bdb656252f25d7242f` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e0fa58cab7cb166c7874dbdfeb3f` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e0fa58cab7cb166c7874dbdfeb3f` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747315fce57276d5b85a9cbf010fd172` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747315fce57276d5b85a9cbf010fd172` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737211ea27eda948b27e13fd22254b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737211ea27eda948b27e13fd22254b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747380ae933955b131824193a62133fe` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747380ae933955b131824193a62133fe` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74730167e0cf40b01aac1362c3d671b3` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74730167e0cf40b01aac1362c3d671b3` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b1351345a92cbc925c15f3d9c0e1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b1351345a92cbc925c15f3d9c0e1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738b35c258e56421e62d5b5da9ea79` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738b35c258e56421e62d5b5da9ea79` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b3460961984ca24484abca1e6170` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b3460961984ca24484abca1e6170` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a4c6c073b4aab4d52f90ee49a4a2` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a4c6c073b4aab4d52f90ee49a4a2` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473190bc10ab9a111e6bcf0170239a6` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473190bc10ab9a111e6bcf0170239a6` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ebaba6223bec6ba065297feb9203` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ebaba6223bec6ba065297feb9203` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ac33d6918e95e1723cd1b37511cb` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ac33d6918e95e1723cd1b37511cb` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b5c3e8ce0af22b7eaf23b1de6b08` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b5c3e8ce0af22b7eaf23b1de6b08` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737ff8123cb53fa51a8eed8457602a` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737ff8123cb53fa51a8eed8457602a` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747326a44b9e2418ab22987b7899a8e3` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747326a44b9e2418ab22987b7899a8e3` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e248a1f77658a9204d311172361d` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e248a1f77658a9204d311172361d` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733d71d8db298f692188502bcb5578` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733d71d8db298f692188502bcb5578` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d829600de0d3559b0af886d46a62` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d829600de0d3559b0af886d46a62` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747372fee2e1674f54f62fbe87f8fc9e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747372fee2e1674f54f62fbe87f8fc9e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738657390e24e953d310f0c860266a` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738657390e24e953d310f0c860266a` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74732d11743773c308577fb8136608b2` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74732d11743773c308577fb8136608b2` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747340b23a454414e4ca08a0895b8a82` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747340b23a454414e4ca08a0895b8a82` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747330227a1128899a06563f785b26c4` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747330227a1128899a06563f785b26c4` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747339211de95404ccc298bf7270ec80` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747339211de95404ccc298bf7270ec80` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e52954120cc73dc4a175a41586f1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e52954120cc73dc4a175a41586f1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738fb69ed7a2cfe714ab54b62310a9` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738fb69ed7a2cfe714ab54b62310a9` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473278c2c4490fb7d4efd021217ce92` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473278c2c4490fb7d4efd021217ce92` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735e89703e0ce7cd3db3a41a7f8a37` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735e89703e0ce7cd3db3a41a7f8a37` (r:1 w:1) + /// The range of component `x` is `[0, 512]`. + /// The range of component `y` is `[0, 1]`. + fn ismp_post(x: u32, y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `604` + // Estimated: `16307 + x * (816 ±715_192_122_278_388) + y * (8448 ±178_798_030_569_596_928)` + // Minimum execution time: 70_000_000 picoseconds. + Weight::from_parts(79_608_153, 0) + .saturating_add(Weight::from_parts(0, 16307)) + // Standard Error: 71_100 + .saturating_add(Weight::from_parts(13_407_822, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(Weight::from_parts(0, 816).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 8448).saturating_mul(y.into())) + } +} diff --git a/runtime/devnet/src/weights/mod.rs b/runtime/devnet/src/weights/mod.rs index b473d49e2..75a5e9b00 100644 --- a/runtime/devnet/src/weights/mod.rs +++ b/runtime/devnet/src/weights/mod.rs @@ -19,6 +19,7 @@ pub mod block_weights; pub mod extrinsic_weights; +pub mod messaging_weights; pub mod paritydb_weights; pub mod rocksdb_weights; diff --git a/runtime/mainnet/src/config/xcm_weights.rs b/runtime/mainnet/src/config/xcm_weights.rs index 20b863da9..418ec2678 100644 --- a/runtime/mainnet/src/config/xcm_weights.rs +++ b/runtime/mainnet/src/config/xcm_weights.rs @@ -277,7 +277,7 @@ impl XcmWeightInfo for PopXcmWeight { _destination: &Location, remote_fees: &Option, _preserve_origin: &bool, - assets: &Vec, + assets: &BoundedVec, _remote_xcm: &Xcm<()>, ) -> Weight { let mut weight = if let Some(remote_fees) = remote_fees { diff --git a/runtime/testnet/src/config/api/mod.rs b/runtime/testnet/src/config/api/mod.rs index ef433ed6c..c90bb2488 100644 --- a/runtime/testnet/src/config/api/mod.rs +++ b/runtime/testnet/src/config/api/mod.rs @@ -93,13 +93,15 @@ impl RuntimeResult { parameter_types! { pub const MaxXcmQueryTimeoutsPerBlock: u32 = 100; - + //TODO: What is reasonable. + pub const IsmpRelayerFee: crate::Balance = 100_000; } impl messaging::Config for Runtime { type CallbackExecutor = CallbackExecutor; type Deposit = Balances; type IsmpDispatcher = Ismp; + type IsmpRelayerFee = IsmpRelayerFee; type MaxContextLen = ConstU32<64>; type MaxDataLen = ConstU32<1024>; type MaxKeyLen = ConstU32<32>; From e0f3981b7b93346abb81158e231f66667fbaadbc Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Mon, 21 Apr 2025 20:23:32 +0100 Subject: [PATCH 31/38] chore(messaging): take fee for response (#509) * dependancy wild goose chase * marathon * fix * stash * xcm_query test improvement, transfer response fee * imsp-get tests 1 * fmt * imsp_post tests, ismp-get fix, xcm-fix * fmt * emit and test timeout events * fix * dummy * benchmarking * fix * fix commitments, errs on callbacks, fix replay vuln * fmt * no errors, callbacks executre * finally some annotations * ismp hook weight annotations * timeout tests * fix tests * fix benchmark tests * fmt * documentation and formatting * fix * implements new benchmarks into devnet * clippy * fix * fmt * more warnings * fmt * pop-bench remove * refactor response fee * comments * refactor 2, fix tests * fmt * remove takes fee for ismp * fmt --- pallets/api/src/messaging/mod.rs | 63 +++-- pallets/api/src/messaging/tests.rs | 246 +++++++++++++------ pallets/api/src/messaging/transports/ismp.rs | 9 +- pallets/api/src/mock.rs | 47 +++- runtime/devnet/src/config/api/mod.rs | 6 +- runtime/testnet/src/config/api/mod.rs | 3 +- 6 files changed, 269 insertions(+), 105 deletions(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 53d68463e..fab46a913 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -9,12 +9,11 @@ use frame_support::{ pallet_prelude::*, storage::KeyLenOf, traits::{ - fungible::Inspect, tokens::{ - fungible::hold::Mutate, + fungible::{hold::Mutate as HoldMutate, Inspect, Mutate}, Fortitude, Precision::{BestEffort, Exact}, - Restriction, + Preservation, Restriction, }, Get, }, @@ -59,7 +58,7 @@ pub(crate) mod test_utils; type AccountIdOf = ::AccountId; type BlockNumberOf = BlockNumberFor; -type BalanceOf = <::Deposit as Inspect>>::Balance; +type BalanceOf = <::Fungibles as Inspect>>::Balance; type DbWeightOf = ::DbWeight; pub type MessageId = [u8; 32]; @@ -88,9 +87,10 @@ pub mod pallet { /// The type responsible for executing callbacks. type CallbackExecutor: CallbackExecutor; - /// The deposit mechanism. - type Deposit: Mutate - + Inspect; + /// The deposit + fee mechanism. + type Fungibles: HoldMutate + + Inspect + + Mutate; /// The ISMP message dispatcher. type IsmpDispatcher: IsmpDispatcher>; @@ -100,17 +100,14 @@ pub mod pallet { #[pallet::constant] type MaxContextLen: Get; - /// SAFETY: should be less than or equal to u16. /// The maximum length of outbound (posted) data. #[pallet::constant] type MaxDataLen: Get; - /// SAFETY: should be less than or equal to u16. /// The maximum amount of key for an outbound request. #[pallet::constant] type MaxKeys: Get; - /// SAFETY: should be less than or equal to u16. /// The maximum byte length for a single key of an ismp request. #[pallet::constant] type MaxKeyLen: Get; @@ -382,10 +379,11 @@ pub mod pallet { .saturating_add(calculate_message_deposit::()) .saturating_add(calculate_deposit_of::>()); - T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + // Take deposits and fees. + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, deposit)?; if let Some(cb) = callback.as_ref() { - T::Deposit::hold( + T::Fungibles::hold( &HoldReason::CallbackGas.into(), &origin, T::WeightToFee::weight_to_fee(&cb.weight), @@ -441,20 +439,25 @@ pub mod pallet { ) -> DispatchResult { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, id), Error::::MessageExists); + + // Take deposits and fees. let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, ) .saturating_add(calculate_message_deposit::()) .saturating_add(calculate_deposit_of::>()); - T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + let mut callback_execution_weight = Weight::zero(); if let Some(cb) = callback.as_ref() { - T::Deposit::hold( + T::Fungibles::hold( &HoldReason::CallbackGas.into(), &origin, T::WeightToFee::weight_to_fee(&cb.weight), )?; + + callback_execution_weight = T::CallbackExecutor::execution_weight(); } // Process message by dispatching request via ISMP. @@ -518,21 +521,36 @@ pub mod pallet { }, )?; + // Take deposits and fees. let deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::XcmQueries, ) .saturating_add(calculate_message_deposit::()); + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, deposit)?; - T::Deposit::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + let mut callback_execution_weight = Weight::zero(); if let Some(cb) = callback.as_ref() { - T::Deposit::hold( + T::Fungibles::hold( &HoldReason::CallbackGas.into(), &origin, T::WeightToFee::weight_to_fee(&cb.weight), )?; + + callback_execution_weight = T::CallbackExecutor::execution_weight(); } + let response_prepayment_amount = T::WeightToFee::weight_to_fee( + &T::WeightInfo::xcm_response().saturating_add(callback_execution_weight), + ); + + T::Fungibles::transfer( + &origin, + &T::FeeAccount::get(), + response_prepayment_amount, + Preservation::Preserve, + )?; + // Process message by creating new query via XCM. // Xcm only uses/stores pallet, index - i.e. (u8,u8), hence the fields in xcm_response // are ignored. @@ -595,7 +613,7 @@ pub mod pallet { if Self::call(&initiating_origin, callback.to_owned(), &id, &xcm_response).is_ok() { Messages::::remove(&initiating_origin, id); XcmQueries::::remove(query_id); - T::Deposit::release( + T::Fungibles::release( &HoldReason::Messaging.into(), &initiating_origin, *deposit, @@ -663,7 +681,7 @@ pub mod pallet { }, }?; - T::Deposit::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; + T::Fungibles::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; } Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); @@ -731,13 +749,13 @@ impl Pallet { let execution_reward = total_deposit.saturating_sub(returnable_deposit); let reason = HoldReason::CallbackGas.into(); - T::Deposit::release( + T::Fungibles::release( &reason, initiating_origin, returnable_deposit, BestEffort, )?; - T::Deposit::transfer_on_hold( + T::Fungibles::transfer_on_hold( &reason, initiating_origin, &T::FeeAccount::get(), @@ -759,7 +777,7 @@ impl Pallet { }, Err(sp_runtime::DispatchErrorWithPostInfo:: { post_info, error }) => { let total_deposit = T::WeightToFee::weight_to_fee(&callback.weight); - T::Deposit::transfer_on_hold( + T::Fungibles::transfer_on_hold( &HoldReason::CallbackGas.into(), initiating_origin, &T::FeeAccount::get(), @@ -923,6 +941,7 @@ impl From<&Message> for MessageStatus { } } +/// The related message status of a Message. #[derive(Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum MessageStatus { Pending, @@ -930,7 +949,7 @@ pub enum MessageStatus { Timeout, } -// Message selector and pre-paid weight used as gas limit +/// Message selector and pre-paid weight used as gas limit. #[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] #[scale_info(skip_type_params(T))] pub struct Callback { diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 678eef317..092b314c8 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -1,5 +1,8 @@ #![cfg(test)] -use frame_support::{assert_noop, assert_ok, testing_prelude::bounded_vec, weights::Weight}; +use frame_support::{ + assert_noop, assert_ok, testing_prelude::bounded_vec, traits::fungible::hold::Inspect, + weights::Weight, +}; use sp_core::H256; use crate::{messaging::*, mock::*}; @@ -41,13 +44,13 @@ mod remove { Messages::::insert(ALICE, m_id, &m); Messages::::insert(ALICE, m2_id, &m); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, ) .unwrap(); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, @@ -89,19 +92,19 @@ mod remove { Messages::::insert(ALICE, m2_id, &m); Messages::::insert(ALICE, m3_id, &m); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, ) .unwrap(); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, ) .unwrap(); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, @@ -138,7 +141,7 @@ mod remove { }; let m_id = [0; 32]; - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, @@ -163,11 +166,10 @@ mod remove { let alice_initial_balance = Balances::free_balance(ALICE); let deposit: Balance = 100; - // Ismp message with status of Ok is considered pending. let m = Message::Ismp { commitment: H256::default(), callback: None, deposit }; let m_id = [0; 32]; - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, @@ -216,31 +218,31 @@ mod remove { Messages::::insert(ALICE, erroneous_id_1, &erroneous_message); // gonna do 5 messages. - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, ) .unwrap(); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, ) .unwrap(); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, ) .unwrap(); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, ) .unwrap(); - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, @@ -279,7 +281,7 @@ mod remove { let m = Message::Ismp { commitment, callback: None, deposit }; Messages::::insert(ALICE, message_id, &m); IsmpRequests::::insert(commitment, (&ALICE, &message_id)); - ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); assert_noop!( @@ -308,7 +310,7 @@ mod remove { let m = Message::IsmpResponse { commitment, response: bounded_vec!(), deposit }; Messages::::insert(ALICE, message_id, &m); IsmpRequests::::insert(commitment, (&ALICE, &message_id)); - ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); @@ -334,7 +336,7 @@ mod remove { let m = Message::IsmpTimeout { commitment, deposit }; Messages::::insert(ALICE, message_id, &m); IsmpRequests::::insert(commitment, (&ALICE, &message_id)); - ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); @@ -360,7 +362,7 @@ mod remove { let m = Message::XcmQuery { query_id, callback: None, deposit }; Messages::::insert(ALICE, message_id, &m); XcmQueries::::insert(query_id, (&ALICE, &message_id)); - ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); assert_noop!( @@ -387,7 +389,7 @@ mod remove { let m = Message::XcmResponse { query_id, deposit, response: Default::default() }; Messages::::insert(ALICE, message_id, &m); XcmQueries::::insert(query_id, (&ALICE, &message_id)); - ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); @@ -411,7 +413,7 @@ mod remove { let deposit = 100; let m = Message::XcmTimeout { query_id, deposit }; - ::Deposit::hold(&HoldReason::Messaging.into(), &ALICE, deposit) + ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) .unwrap(); Messages::::insert(ALICE, message_id, &m); @@ -484,40 +486,152 @@ mod xcm_new_query { } #[test] - fn takes_deposit() { + fn takes_response_fee_no_callback() { new_test_ext().execute_with(|| { + assert_ne!( + ::WeightInfo::xcm_response(), + Weight::zero(), + "Please set a weight for xcm_response to run this test." + ); + let response_fee = ::WeightToFee::weight_to_fee( + &(::WeightInfo::xcm_response()), + ); let timeout = System::block_number() + 1; - let weight = Weight::from_parts(100_000_000, 100_000_000); + let callback = None; + let message_id = [1u8; 32]; + + assert_ne!(response_fee, 0); + let alice_pre_transfer = Balances::free_balance(&ALICE); + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + callback, + )); + + let alice_post_transfer = Balances::free_balance(&ALICE); + let alice_total_balance_on_hold = Balances::total_balance_on_hold(&ALICE); + + assert_eq!( + alice_pre_transfer - alice_post_transfer - alice_total_balance_on_hold, + response_fee + ); + }) + } + + #[test] + fn takes_response_fee_with_callback() { + new_test_ext().execute_with(|| { + assert_ne!( + ::WeightInfo::xcm_response(), + Weight::zero(), + "Please set a weight for xcm_response to run this test." + ); + assert_ne!( + ::CallbackExecutor::execution_weight(), + Weight::zero(), + "Please set a weight for CallbackExecutor::execution_weight to run this test." + ); + + let response_fee = ::WeightToFee::weight_to_fee( + &(::WeightInfo::xcm_response() + + ::CallbackExecutor::execution_weight()), + ); + let timeout = System::block_number() + 1; + let weight = Weight::default(); let callback = Callback { selector: [1; 4], weight, abi: Abi::Scale }; + let message_id = [1u8; 32]; + assert_ne!(response_fee, 0); + let alice_pre_transfer = Balances::free_balance(&ALICE); + let alices_balance_pre_hold = Balances::free_balance(ALICE); + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + Some(callback), + )); + + let alice_post_transfer = Balances::free_balance(&ALICE); + let alice_total_balance_on_hold = Balances::total_balance_on_hold(&ALICE); + + assert_eq!( + alice_pre_transfer - alice_post_transfer - alice_total_balance_on_hold, + response_fee + ); + }) + } + + #[test] + fn takes_callback_hold() { + new_test_ext().execute_with(|| { + let timeout = System::block_number() + 1; + let weight = Weight::from_parts(100_000_000, 100_000_000); + let callback = Callback { selector: [1; 4], weight, abi: Abi::Scale }; let callback_deposit = ::WeightToFee::weight_to_fee(&weight); + let message_id = [0; 32]; + let alice_held_balance_pre_query = ::Fungibles::balance_on_hold( + &HoldReason::CallbackGas.into(), + &ALICE, + ); + + assert_eq!(alice_held_balance_pre_query, 0); + assert!(callback_deposit != 0); + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + Some(callback), + )); + + let alice_held_balance_post_query = ::Fungibles::balance_on_hold( + &HoldReason::CallbackGas.into(), + &ALICE, + ); + + assert_eq!(alice_held_balance_post_query, callback_deposit); + }) + } + + #[test] + fn takes_messaging_hold() { + new_test_ext().execute_with(|| { + let timeout = System::block_number() + 1; + let weight = Weight::from_parts(100_000_000, 100_000_000); + let callback = None; + let message_id = [0; 32]; let expected_deposit = calculate_protocol_deposit::::OnChainByteFee>( ProtocolStorageDeposit::XcmQueries, - ) + calculate_message_deposit::::OnChainByteFee>() + - callback_deposit; + ) + calculate_message_deposit::::OnChainByteFee>(); + let alices_held_balance_pre_hold = + ::Fungibles::balance_on_hold(&HoldReason::Messaging.into(), &ALICE); assert!( expected_deposit > 0, "set an onchain byte fee with T::OnChainByteFee to run this test." ); - assert!(callback_deposit != 0); - let alices_balance_pre_hold = Balances::free_balance(ALICE); + assert_eq!(alices_held_balance_pre_hold, 0); - let message_id = [0; 32]; assert_ok!(Messaging::xcm_new_query( signed(ALICE), message_id, RESPONSE_LOCATION, timeout, - Some(callback), + callback, )); - let alices_balance_post_hold = Balances::free_balance(ALICE); + let alices_held_balance_post_hold = + ::Fungibles::balance_on_hold(&HoldReason::Messaging.into(), &ALICE); - assert_eq!(alices_balance_pre_hold - alices_balance_post_hold, expected_deposit); + assert_eq!(alices_held_balance_post_hold, expected_deposit); }); } @@ -693,13 +807,13 @@ mod xcm_response { } #[test] - fn deposit_returned_after_successfull_callback_execution() { + fn message_deposit_returned_after_successfull_callback_execution() { new_test_ext().execute_with(|| { let message_id = [0; 32]; let timeout = System::block_number() + 1; let expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); - let callback = Callback { selector: [1; 4], weight: 0.into(), abi: Abi::Scale }; + let callback = Callback { selector: [1; 4], weight: Zero::zero(), abi: Abi::Scale }; let expected_deposit = calculate_protocol_deposit::< Test, ::OnChainByteFee, @@ -709,8 +823,6 @@ mod xcm_response { ::OnChainByteFee, >(); - let alice_balance_pre_hold = Balances::free_balance(ALICE); - assert_ok!(Messaging::xcm_new_query( signed(ALICE), message_id, @@ -718,15 +830,11 @@ mod xcm_response { timeout, Some(callback), )); - - let alice_balance_post_hold = Balances::free_balance(ALICE); - + let alice_held_balance_pre_release = Balances::total_balance_on_hold(&ALICE); + assert_ne!(alice_held_balance_pre_release, 0); assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); - - let alice_balance_post_release = Balances::free_balance(ALICE); - - assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); - assert_eq!(alice_balance_post_release, alice_balance_pre_hold); + let alice_held_balance_post_release = Balances::total_balance_on_hold(&ALICE); + assert_eq!(alice_held_balance_post_release, 0); }) } } @@ -769,7 +877,9 @@ mod xcm_hooks { panic!("Message should be timedout!") }; - frame_system::Pallet::::assert_has_event(Event::::XcmQueriesTimedOut { query_ids: vec![0, 1] }.into()); + frame_system::Pallet::::assert_has_event( + Event::::XcmQueriesTimedOut { query_ids: vec![0, 1] }.into(), + ); }) } } @@ -797,7 +907,7 @@ mod handle_callback_result { assert!(deposit != 0); // Artificially take the deposit - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::CallbackGas.into(), &ALICE, deposit, @@ -839,7 +949,7 @@ mod handle_callback_result { let deposit = ::WeightToFee::weight_to_fee(&actual_weight); // Artificially take the deposit - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::CallbackGas.into(), &ALICE, deposit, @@ -905,7 +1015,7 @@ mod handle_callback_result { assert!(deposit != 0); // Artificially take the deposit - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::CallbackGas.into(), &ALICE, deposit, @@ -973,8 +1083,6 @@ mod ismp_get { context: bounded_vec!(), keys: bounded_vec!(), }; - let ismp_fee = ::IsmpRelayerFee::get(); - let weight = Weight::from_parts(100_000_000, 100_000_000); let callback = Callback { selector: [1; 4], weight, abi: Abi::Scale }; @@ -986,16 +1094,17 @@ mod ismp_get { >(ProtocolStorageDeposit::IsmpRequests) + calculate_message_deposit::::OnChainByteFee>() + calculate_deposit_of::::OffChainByteFee, ismp::Get>( - ) + ismp_fee + callback_deposit; + ) + callback_deposit; - let alice_balance_pre_hold = Balances::free_balance(ALICE); + let alice_hold_balance_pre_hold = Balances::total_balance_on_hold(&ALICE); + assert_eq!(alice_hold_balance_pre_hold, 0); + assert!(expected_deposit != 0); assert_ok!(Messaging::ismp_get(signed(ALICE), message_id, message, Some(callback))); - let alice_balance_post_hold = Balances::free_balance(ALICE); + let alice_hold_balance_post_hold = Balances::total_balance_on_hold(&ALICE); - assert!(expected_deposit != ismp_fee); - assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); + assert_eq!(alice_hold_balance_post_hold, expected_deposit); }) } @@ -1052,13 +1161,22 @@ mod ismp_post { new_test_ext().execute_with(|| { let message_id = [0u8; 32]; let message = ismp::Post { dest: 2000, timeout: 100, data: bounded_vec![] }; - let ismp_fee = ::IsmpRelayerFee::get(); let weight = Weight::from_parts(100_000_000, 100_000_000); let callback = Callback { selector: [1; 4], weight, abi: Abi::Scale }; let callback_deposit = ::WeightToFee::weight_to_fee(&weight); - let alice_balance_pre_hold = Balances::free_balance(ALICE); + let expected_deposit = calculate_protocol_deposit::< + Test, + ::OnChainByteFee, + >(ProtocolStorageDeposit::IsmpRequests) + + calculate_message_deposit::::OnChainByteFee>() + + calculate_deposit_of::::OffChainByteFee, ismp::Post>( + ) + callback_deposit; - assert!(callback_deposit != 0); + let alice_hold_balance_pre_hold = Balances::total_balance_on_hold(&ALICE); + + assert_eq!(alice_hold_balance_pre_hold, 0); + assert_ne!(callback_deposit, 0); + assert_ne!(expected_deposit, 0); assert_ok!(Messaging::ismp_post( signed(ALICE), @@ -1067,19 +1185,9 @@ mod ismp_post { Some(callback) )); - let expected_deposit = calculate_protocol_deposit::< - Test, - ::OnChainByteFee, - >(ProtocolStorageDeposit::IsmpRequests) + - calculate_message_deposit::::OnChainByteFee>() + - calculate_deposit_of::::OffChainByteFee, ismp::Post>( - ) + ismp_fee + callback_deposit; - - assert!(expected_deposit != ismp_fee); - - let alice_balance_post_hold = Balances::free_balance(ALICE); + let alice_held_balance_post_hold = Balances::total_balance_on_hold(&ALICE); - assert_eq!(alice_balance_pre_hold - alice_balance_post_hold, expected_deposit); + assert_eq!(alice_held_balance_post_hold, expected_deposit); }) } @@ -1294,7 +1402,7 @@ mod ismp_hooks { let deposit = 100; let message = Message::Ismp { commitment, callback: Some(callback), deposit }; - ::Deposit::hold( + ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, deposit, diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 6cc340c16..be3898430 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -219,8 +219,13 @@ pub(crate) fn process_response( // Clean storage, return deposit Messages::::remove(&initiating_origin, id); IsmpRequests::::remove(commitment); - T::Deposit::release(&HoldReason::Messaging.into(), &initiating_origin, deposit, Exact) - .map_err(|_| Error::Custom("failed to release deposit.".into()))?; + T::Fungibles::release( + &HoldReason::Messaging.into(), + &initiating_origin, + deposit, + Exact, + ) + .map_err(|_| Error::Custom("failed to release deposit.".into()))?; return Ok(()); } diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 575ee7dde..4f4fd8cfc 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -15,8 +15,8 @@ use pallet_nfts::PalletFeatures; use scale_info::TypeInfo; use sp_core::H256; use sp_runtime::{ - traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, TryConvert, Verify}, - BuildStorage, + traits::{BlakeTwo256, IdentifyAccount, IdentityLookup, Lazy, TryConvert, Verify, Zero}, + BuildStorage, Weight, }; use sp_std::prelude::*; @@ -230,8 +230,9 @@ impl CallbackExecutor for AlwaysSuccessfullCallb }) } - fn execution_weight() -> sp_runtime::Weight { - Default::default() + // Will be used for prepayment of response fees. + fn execution_weight() -> Weight { + Weight::from_parts(100_000u64, 100_000u64) } } @@ -265,8 +266,8 @@ pub fn get_next_query_id() -> u64 { impl crate::messaging::Config for Test { type CallbackExecutor = AlwaysSuccessfullCallbackExecutor; - type Deposit = Balances; type FeeAccount = FeeAccount; + type Fungibles = Balances; type IsmpDispatcher = pallet_ismp::Pallet; type IsmpRelayerFee = IsmpRelayerFee; type Keccak256 = Keccak; @@ -282,14 +283,46 @@ impl crate::messaging::Config for Test { type OriginConverter = AccountToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; - type WeightInfo = (); + type WeightInfo = DummyPrepaymentWeights; type WeightToFee = RefTimePlusProofTime; type Xcm = MockNotifyQuery; type XcmResponseOrigin = EnsureRootWithResponseSuccess; } -pub struct Keccak; +// The weight info is required for prepayment of a response and the callback execution. +// Hence we must provide weights for the response extrinsics and callback executor to unit test. +pub struct DummyPrepaymentWeights; +impl crate::messaging::WeightInfo for DummyPrepaymentWeights { + fn remove(_x: u32) -> Weight { + Default::default() + } + + fn xcm_new_query(_x: u32) -> Weight { + Default::default() + } + + fn xcm_response() -> Weight { + Weight::from_parts(100_000_000u64, 100_000_000u64) + } + fn ismp_on_response(_x: u32) -> Weight { + Weight::from_parts(150_000_000u64, 150_000_000u64) + } + + fn ismp_on_timeout(_x: u32) -> Weight { + Zero::zero() + } + + fn ismp_get(_x: u32, _y: u32, _a: u32) -> Weight { + Zero::zero() + } + + fn ismp_post(_x: u32, _y: u32) -> Weight { + Zero::zero() + } +} + +pub struct Keccak; impl ::ismp::messaging::Keccak256 for Keccak { fn keccak256(bytes: &[u8]) -> sp_core::H256 where diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index 8e91491ad..abc841478 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -123,8 +123,8 @@ parameter_types! { impl messaging::Config for Runtime { type CallbackExecutor = CallbackExecutor; - type Deposit = Balances; type FeeAccount = DummyFeeAccount; + type Fungibles = Balances; type IsmpDispatcher = Ismp; type IsmpRelayerFee = IsmpRelayerFee; type Keccak256 = Ismp; @@ -137,9 +137,7 @@ impl messaging::Config for Runtime { // TODO: ensure within the contract buffer bounds type MaxResponseLen = ConstU32<512>; type MaxXcmQueryTimeoutsPerBlock = MaxXcmQueryTimeoutsPerBlock; - // TODO: ISMP state written to offchain indexing, require some protection but perhaps not as - // much as onchain cost. - type OffChainByteFee = (); + type OffChainByteFee = TransactionByteFee; type OnChainByteFee = TransactionByteFee; type OriginConverter = LocalOriginToLocation; type RuntimeEvent = RuntimeEvent; diff --git a/runtime/testnet/src/config/api/mod.rs b/runtime/testnet/src/config/api/mod.rs index c90bb2488..97e5f72e3 100644 --- a/runtime/testnet/src/config/api/mod.rs +++ b/runtime/testnet/src/config/api/mod.rs @@ -99,7 +99,7 @@ parameter_types! { impl messaging::Config for Runtime { type CallbackExecutor = CallbackExecutor; - type Deposit = Balances; + type Fungibles = Balances; type IsmpDispatcher = Ismp; type IsmpRelayerFee = IsmpRelayerFee; type MaxContextLen = ConstU32<64>; @@ -116,6 +116,7 @@ impl messaging::Config for Runtime { type OriginConverter = LocalOriginToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; + type WeightInfo = (); type WeightToFee = ::WeightToFee; type Xcm = QueryHandler; type XcmResponseOrigin = EnsureResponse; From ff93137d952e392c97cf0096898187ac7e9ea530 Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Wed, 23 Apr 2025 17:28:06 +0100 Subject: [PATCH 32/38] feat(messaging): release callback deposits for timedout messages (#512) * dependancy wild goose chase * marathon * fix * stash * xcm_query test improvement, transfer response fee * imsp-get tests 1 * fmt * imsp_post tests, ismp-get fix, xcm-fix * fmt * emit and test timeout events * fix * dummy * benchmarking * fix * fix commitments, errs on callbacks, fix replay vuln * fmt * no errors, callbacks executre * finally some annotations * ismp hook weight annotations * timeout tests * fix tests * fix benchmark tests * fmt * documentation and formatting * fix * implements new benchmarks into devnet * clippy * fix * fmt * more warnings * fmt * pop-bench remove * refactor response fee * comments * refactor 2, fix tests * fmt * release cb deposit and refactor * add tests * benchmarks * warnings * fmt * remove takes fee for ismp * fmt --- pallets/api/src/messaging/benchmarking.rs | 27 ++- pallets/api/src/messaging/mod.rs | 108 +++++++--- pallets/api/src/messaging/tests.rs | 205 ++++++++++++------- pallets/api/src/messaging/transports/ismp.rs | 24 ++- 4 files changed, 235 insertions(+), 129 deletions(-) diff --git a/pallets/api/src/messaging/benchmarking.rs b/pallets/api/src/messaging/benchmarking.rs index 0a62bb8b8..e5944e2c1 100644 --- a/pallets/api/src/messaging/benchmarking.rs +++ b/pallets/api/src/messaging/benchmarking.rs @@ -41,26 +41,25 @@ mod messaging_benchmarks { /// (bounded by `MaxRemovals`). #[benchmark] fn remove(x: Linear<1, { T::MaxRemovals::get() }>) { - let deposit: BalanceOf = sp_runtime::traits::One::one(); + let message_deposit: BalanceOf = 50_000u32.into(); + let callback_deposit: BalanceOf = 100_000u32.into(); let owner: AccountIdOf = account("Alice", 0, SEED); let mut message_ids: BoundedVec = BoundedVec::new(); pallet_balances::Pallet::::make_free_balance_be(&owner, u32::MAX.into()); for i in 0..x { - ::Deposit::hold( - &HoldReason::Messaging.into(), - &owner, - deposit, - ) - .unwrap(); + T::Fungibles::hold(&HoldReason::Messaging.into(), &owner, message_deposit).unwrap(); + + T::Fungibles::hold(&HoldReason::CallbackGas.into(), &owner, callback_deposit).unwrap(); let message_id = H256::from(blake2_256(&(i.to_le_bytes()))); let commitment = H256::from(blake2_256(&(i.to_le_bytes()))); - let good_message = Message::IsmpResponse { + // Timeout messages release callback deposit hence, are most expensive case for now. + let good_message = Message::IsmpTimeout { commitment: commitment.clone(), - deposit, - response: Default::default(), + message_deposit, + callback_deposit: Some(callback_deposit), }; Messages::::insert(&owner, &message_id.0, &good_message); @@ -184,7 +183,7 @@ mod messaging_benchmarks { let weight = Weight::from_parts(100_000, 100_000); let cb_gas_deposit = T::WeightToFee::weight_to_fee(&weight); - T::Deposit::hold(&HoldReason::CallbackGas.into(), &origin, cb_gas_deposit).unwrap(); + T::Fungibles::hold(&HoldReason::CallbackGas.into(), &origin, cb_gas_deposit).unwrap(); // also hold for message deposit let message_deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, @@ -192,7 +191,7 @@ mod messaging_benchmarks { calculate_deposit_of::>(); // Take some extra so we dont need to complicate the benchmark further. - T::Deposit::hold(&HoldReason::Messaging.into(), &origin, message_deposit * 2u32.into()) + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, message_deposit * 2u32.into()) .unwrap(); let callback = Some(Callback { selector: [0; 4], weight, abi: Abi::Scale }); @@ -239,7 +238,7 @@ mod messaging_benchmarks { ) }; - let message = Message::Ismp { commitment, callback, deposit: One::one() }; + let message = Message::Ismp { commitment, callback, message_deposit }; IsmpRequests::::insert(&commitment, (&origin, &message_id)); Messages::::insert(&origin, &message_id, &message); @@ -298,7 +297,7 @@ mod messaging_benchmarks { let event = Event::::IsmpTimedOut { commitment }; - let input_message = Message::Ismp { commitment, callback, deposit: One::one() }; + let input_message = Message::Ismp { commitment, callback, message_deposit: One::one() }; IsmpRequests::::insert(&commitment, (&origin, &message_id)); Messages::::insert(&origin, &message_id, &input_message); diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index fab46a913..18165c9d4 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -327,12 +327,17 @@ pub mod pallet { for (origin, message_id) in XcmQueryTimeouts::::get(n) { weight = weight.saturating_add(DbWeightOf::::get().reads_writes(2, 1)); Messages::::mutate(origin, message_id, |maybe_message| { - if let Some(Message::XcmQuery { query_id, deposit, .. }) = + if let Some(Message::XcmQuery { query_id, message_deposit, callback }) = maybe_message.as_mut() { + let callback_deposit = + callback.map(|cb| T::WeightToFee::weight_to_fee(&cb.weight)); query_ids.push(*query_id); - *maybe_message = - Some(Message::XcmTimeout { query_id: *query_id, deposit: *deposit }); + *maybe_message = Some(Message::XcmTimeout { + query_id: *query_id, + message_deposit: *message_deposit, + callback_deposit, + }); } }) } @@ -373,14 +378,15 @@ pub mod pallet { ) -> DispatchResult { let origin = ensure_signed(origin)?; ensure!(!Messages::::contains_key(&origin, id), Error::::MessageExists); - let deposit = calculate_protocol_deposit::( + + // Take deposits and fees. + let message_deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, ) .saturating_add(calculate_message_deposit::()) .saturating_add(calculate_deposit_of::>()); - // Take deposits and fees. - T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, message_deposit)?; if let Some(cb) = callback.as_ref() { T::Fungibles::hold( @@ -406,7 +412,11 @@ pub mod pallet { // Store commitment for lookup on response, message for querying, // response/timeout handling. IsmpRequests::::insert(commitment, (&origin, id)); - Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); + Messages::::insert( + &origin, + id, + Message::Ismp { commitment, callback, message_deposit }, + ); Pallet::::deposit_event(Event::::IsmpGetDispatched { origin, id, @@ -441,13 +451,13 @@ pub mod pallet { ensure!(!Messages::::contains_key(&origin, id), Error::::MessageExists); // Take deposits and fees. - let deposit = calculate_protocol_deposit::( + let message_deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::IsmpRequests, ) .saturating_add(calculate_message_deposit::()) .saturating_add(calculate_deposit_of::>()); - T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, message_deposit)?; let mut callback_execution_weight = Weight::zero(); if let Some(cb) = callback.as_ref() { @@ -471,7 +481,11 @@ pub mod pallet { // Store commitment for lookup on response, message for querying, // response/timeout handling. IsmpRequests::::insert(commitment, (&origin, id)); - Messages::::insert(&origin, id, Message::Ismp { commitment, callback, deposit }); + Messages::::insert( + &origin, + id, + Message::Ismp { commitment, callback, message_deposit }, + ); Pallet::::deposit_event(Event::::IsmpPostDispatched { origin, id, @@ -522,11 +536,11 @@ pub mod pallet { )?; // Take deposits and fees. - let deposit = calculate_protocol_deposit::( + let message_deposit = calculate_protocol_deposit::( ProtocolStorageDeposit::XcmQueries, ) .saturating_add(calculate_message_deposit::()); - T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, message_deposit)?; let mut callback_execution_weight = Weight::zero(); @@ -560,7 +574,11 @@ pub mod pallet { // Store query id for later lookup on response, message for querying status, // response/timeout handling. XcmQueries::::insert(query_id, (&origin, id)); - Messages::::insert(&origin, id, Message::XcmQuery { query_id, callback, deposit }); + Messages::::insert( + &origin, + id, + Message::XcmQuery { query_id, callback, message_deposit }, + ); Pallet::::deposit_event(Event::::XcmQueryCreated { origin, id, @@ -593,8 +611,9 @@ pub mod pallet { let xcm_query_message = Messages::::get(&initiating_origin, id).ok_or(Error::::MessageNotFound)?; - let (query_id, callback, deposit) = match &xcm_query_message { - Message::XcmQuery { query_id, callback, deposit } => (query_id, callback, deposit), + let (query_id, callback, message_deposit) = match &xcm_query_message { + Message::XcmQuery { query_id, callback, message_deposit } => + (query_id, callback, message_deposit), Message::XcmTimeout { .. } => return Err(Error::::RequestTimedOut.into()), _ => return Err(Error::::InvalidMessage.into()), }; @@ -616,7 +635,7 @@ pub mod pallet { T::Fungibles::release( &HoldReason::Messaging.into(), &initiating_origin, - *deposit, + *message_deposit, Exact, )?; return Ok(()); @@ -628,7 +647,7 @@ pub mod pallet { id, Message::XcmResponse { query_id: *query_id, - deposit: *deposit, + message_deposit: *message_deposit, response: xcm_response, }, ); @@ -656,32 +675,47 @@ pub mod pallet { return Err(Error::::MessageNotFound.into()); }; - let deposit = match message { + let (message_deposit, maybe_callback_deposit) = match message { Message::Ismp { .. } => Err(Error::::RequestPending), Message::XcmQuery { .. } => Err(Error::::RequestPending), - Message::IsmpResponse { deposit, commitment, .. } => { + Message::IsmpResponse { message_deposit, commitment, .. } => { Messages::::remove(&origin, id); IsmpRequests::::remove(commitment); - Ok(deposit) + Ok((message_deposit, None)) }, - Message::XcmResponse { deposit, query_id, .. } => { + Message::XcmResponse { message_deposit, query_id, .. } => { Messages::::remove(&origin, id); XcmQueries::::remove(query_id); - Ok(deposit) + Ok((message_deposit, None)) }, - Message::IsmpTimeout { deposit, commitment, .. } => { + Message::IsmpTimeout { + message_deposit, commitment, callback_deposit, .. + } => { Messages::::remove(&origin, id); IsmpRequests::::remove(commitment); - Ok(deposit) + Ok((message_deposit, callback_deposit)) }, - Message::XcmTimeout { query_id, deposit, .. } => { + Message::XcmTimeout { query_id, message_deposit, callback_deposit, .. } => { Messages::::remove(&origin, id); XcmQueries::::remove(query_id); - Ok(deposit) + Ok((message_deposit, callback_deposit)) }, }?; - T::Fungibles::release(&HoldReason::Messaging.into(), &origin, deposit, Exact)?; + T::Fungibles::release( + &HoldReason::Messaging.into(), + &origin, + message_deposit, + Exact, + )?; + if let Some(callback_deposit) = maybe_callback_deposit { + T::Fungibles::release( + &HoldReason::CallbackGas.into(), + &origin, + callback_deposit, + Exact, + )?; + } } Self::deposit_event(Event::::Removed { origin, messages: messages.into_inner() }); @@ -883,7 +917,7 @@ pub(crate) enum Message { /// - `commitment`: The cryptographic commitment of the request payload. /// - `callback`: An optional callback to invoke upon receiving a response. /// - `deposit`: The total deposit held to cover message and callback fees. - Ismp { commitment: H256, callback: Option, deposit: BalanceOf }, + Ismp { commitment: H256, callback: Option, message_deposit: BalanceOf }, /// Represents a pending XCM query request. /// @@ -891,7 +925,7 @@ pub(crate) enum Message { /// - `query_id`: Unique identifier for the XCM query. /// - `callback`: An optional callback for handling the response. /// - `deposit`: The deposit held to cover fees for query execution and callback. - XcmQuery { query_id: QueryId, callback: Option, deposit: BalanceOf }, + XcmQuery { query_id: QueryId, callback: Option, message_deposit: BalanceOf }, /// Represents a received ISMP response. /// @@ -901,7 +935,7 @@ pub(crate) enum Message { /// - `response`: The encoded response payload, size-bounded by `T::MaxResponseLen`. IsmpResponse { commitment: H256, - deposit: BalanceOf, + message_deposit: BalanceOf, response: BoundedVec, }, @@ -911,21 +945,29 @@ pub(crate) enum Message { /// - `query_id`: Identifier that matches a previously sent XCM query. /// - `deposit`: The deposit originally held for this message. /// - `response`: The deserialized response payload. - XcmResponse { query_id: QueryId, deposit: BalanceOf, response: Response }, + XcmResponse { query_id: QueryId, message_deposit: BalanceOf, response: Response }, /// Represents an ISMP request that timed out before a response was received. /// /// # Fields /// - `commitment`: The original commitment of the request. /// - `deposit`: The deposit held for the request, which may be reclaimed. - IsmpTimeout { commitment: H256, deposit: BalanceOf }, + IsmpTimeout { + commitment: H256, + message_deposit: BalanceOf, + callback_deposit: Option>, + }, /// Represents an XCM query that timed out before a response was received. /// /// # Fields /// - `query_id`: The original query ID that timed out. /// - `deposit`: The deposit held for the query, which may be reclaimed. - XcmTimeout { query_id: QueryId, deposit: BalanceOf }, + XcmTimeout { + query_id: QueryId, + message_deposit: BalanceOf, + callback_deposit: Option>, + }, } impl From<&Message> for MessageStatus { diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 092b314c8..1be285c13 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -32,10 +32,10 @@ mod remove { #[test] fn success_event() { new_test_ext().execute_with(|| { - let deposit: Balance = 100; + let message_deposit: Balance = 100; let m = Message::IsmpResponse { commitment: Default::default(), - deposit, + message_deposit, response: Default::default(), }; let m_id = [0u8; 32]; @@ -47,13 +47,13 @@ mod remove { ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); @@ -77,11 +77,11 @@ mod remove { #[test] fn multiple_messages_remove_works() { new_test_ext().execute_with(|| { - let deposit: Balance = 100; + let message_deposit: Balance = 100; // An ismp response can always be removed. let m = Message::IsmpResponse { commitment: Default::default(), - deposit, + message_deposit, response: Default::default(), }; let m_id = [0; 32]; @@ -95,19 +95,19 @@ mod remove { ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); @@ -132,11 +132,11 @@ mod remove { fn deposit_is_returned_if_try_remove_is_ok() { new_test_ext().execute_with(|| { let alice_initial_balance = Balances::free_balance(ALICE); - let deposit: Balance = 100; + let message_deposit: Balance = 100; // An ismp response can always be removed. let m = Message::IsmpResponse { commitment: Default::default(), - deposit, + message_deposit, response: Default::default(), }; let m_id = [0; 32]; @@ -144,7 +144,7 @@ mod remove { ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); Messages::::insert(ALICE, m_id, &m); @@ -156,7 +156,7 @@ mod remove { let alice_balance_post_remove = Balances::free_balance(ALICE); assert_eq!(alice_initial_balance, alice_balance_post_remove); - assert_eq!(alice_balance_post_remove, alice_balance_post_hold + deposit); + assert_eq!(alice_balance_post_remove, alice_balance_post_hold + message_deposit); }); } @@ -164,15 +164,15 @@ mod remove { fn deposit_is_not_returned_if_try_remove_is_noop() { new_test_ext().execute_with(|| { let alice_initial_balance = Balances::free_balance(ALICE); - let deposit: Balance = 100; + let message_deposit: Balance = 100; - let m = Message::Ismp { commitment: H256::default(), callback: None, deposit }; + let m = Message::Ismp { commitment: H256::default(), callback: None, message_deposit }; let m_id = [0; 32]; ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); Messages::::insert(ALICE, m_id, &m); @@ -186,7 +186,7 @@ mod remove { let alice_balance_post_remove = Balances::free_balance(ALICE); - assert_eq!(alice_initial_balance, alice_balance_post_remove + deposit); + assert_eq!(alice_initial_balance, alice_balance_post_remove + message_deposit); assert_eq!(alice_balance_post_remove, alice_balance_post_hold); }); } @@ -194,16 +194,16 @@ mod remove { #[test] fn multiple_messages_rolls_back_if_one_fails() { new_test_ext().execute_with(|| { - let deposit: Balance = 100; + let message_deposit: Balance = 100; let alice_initial_balance = Balances::free_balance(ALICE); let good_message = Message::IsmpResponse { commitment: Default::default(), - deposit: 0, + message_deposit, response: Default::default(), }; let erroneous_message = - Message::Ismp { commitment: H256::default(), callback: None, deposit: 100 }; + Message::Ismp { commitment: H256::default(), callback: None, message_deposit }; let good_id_1 = [0; 32]; let good_id_2 = [1; 32]; @@ -221,31 +221,31 @@ mod remove { ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); @@ -266,7 +266,7 @@ mod remove { assert!(Messages::::get(ALICE, erroneous_id_1).is_some()); let alice_balance_post_remove = Balances::free_balance(ALICE); - assert_eq!(alice_initial_balance, alice_balance_post_hold + deposit * 5); + assert_eq!(alice_initial_balance, alice_balance_post_hold + message_deposit * 5); assert_eq!(alice_balance_post_remove, alice_balance_post_hold); }); } @@ -277,12 +277,16 @@ mod remove { new_test_ext().execute_with(|| { let commitment = H256::default(); let message_id = [0u8; 32]; - let deposit = 100; - let m = Message::Ismp { commitment, callback: None, deposit }; + let message_deposit = 100; + let m = Message::Ismp { commitment, callback: None, message_deposit }; Messages::::insert(ALICE, message_id, &m); IsmpRequests::::insert(commitment, (&ALICE, &message_id)); - ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) - .unwrap(); + ::Fungibles::hold( + &HoldReason::Messaging.into(), + &ALICE, + message_deposit, + ) + .unwrap(); assert_noop!( Messaging::remove(signed(ALICE), bounded_vec!(message_id)), @@ -305,13 +309,17 @@ mod remove { new_test_ext().execute_with(|| { let commitment = H256::default(); let message_id = [0u8; 32]; - let deposit = 100; + let message_deposit = 100; - let m = Message::IsmpResponse { commitment, response: bounded_vec!(), deposit }; + let m = Message::IsmpResponse { commitment, response: bounded_vec!(), message_deposit }; Messages::::insert(ALICE, message_id, &m); IsmpRequests::::insert(commitment, (&ALICE, &message_id)); - ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) - .unwrap(); + ::Fungibles::hold( + &HoldReason::Messaging.into(), + &ALICE, + message_deposit, + ) + .unwrap(); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); @@ -331,13 +339,30 @@ mod remove { new_test_ext().execute_with(|| { let commitment = H256::default(); let message_id = [0u8; 32]; - let deposit = 100; + let message_deposit = 100; + let callback_deposit = 100_000; + + let m = Message::IsmpTimeout { + commitment, + message_deposit, + callback_deposit: Some(callback_deposit), + }; + + ::Fungibles::hold( + &HoldReason::Messaging.into(), + &ALICE, + message_deposit, + ) + .unwrap(); + ::Fungibles::hold( + &HoldReason::CallbackGas.into(), + &ALICE, + callback_deposit, + ) + .unwrap(); - let m = Message::IsmpTimeout { commitment, deposit }; Messages::::insert(ALICE, message_id, &m); IsmpRequests::::insert(commitment, (&ALICE, &message_id)); - ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) - .unwrap(); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); @@ -349,6 +374,8 @@ mod remove { IsmpRequests::::get(commitment).is_none(), "Request should have been removed but hasnt." ); + + assert_eq!(Balances::total_balance_on_hold(&ALICE), 0); }) } @@ -357,13 +384,17 @@ mod remove { new_test_ext().execute_with(|| { let query_id = 0; let message_id = [0u8; 32]; - let deposit = 100; + let message_deposit = 100; - let m = Message::XcmQuery { query_id, callback: None, deposit }; + let m = Message::XcmQuery { query_id, callback: None, message_deposit }; Messages::::insert(ALICE, message_id, &m); XcmQueries::::insert(query_id, (&ALICE, &message_id)); - ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) - .unwrap(); + ::Fungibles::hold( + &HoldReason::Messaging.into(), + &ALICE, + message_deposit, + ) + .unwrap(); assert_noop!( Messaging::remove(signed(ALICE), bounded_vec!(message_id)), @@ -385,12 +416,17 @@ mod remove { new_test_ext().execute_with(|| { let query_id = 0; let message_id = [0u8; 32]; - let deposit = 100; - let m = Message::XcmResponse { query_id, deposit, response: Default::default() }; + let message_deposit = 100; + let m = + Message::XcmResponse { query_id, message_deposit, response: Default::default() }; Messages::::insert(ALICE, message_id, &m); XcmQueries::::insert(query_id, (&ALICE, &message_id)); - ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) - .unwrap(); + ::Fungibles::hold( + &HoldReason::Messaging.into(), + &ALICE, + message_deposit, + ) + .unwrap(); assert_ok!(Messaging::remove(signed(ALICE), bounded_vec!(message_id))); @@ -410,11 +446,27 @@ mod remove { new_test_ext().execute_with(|| { let query_id = 0; let message_id = [0u8; 32]; - let deposit = 100; - let m = Message::XcmTimeout { query_id, deposit }; + let message_deposit = 100; + let callback_deposit = 100_000; - ::Fungibles::hold(&HoldReason::Messaging.into(), &ALICE, deposit) - .unwrap(); + let m = Message::XcmTimeout { + query_id, + message_deposit, + callback_deposit: Some(callback_deposit), + }; + + ::Fungibles::hold( + &HoldReason::Messaging.into(), + &ALICE, + message_deposit, + ) + .unwrap(); + ::Fungibles::hold( + &HoldReason::CallbackGas.into(), + &ALICE, + callback_deposit, + ) + .unwrap(); Messages::::insert(ALICE, message_id, &m); XcmQueries::::insert(query_id, (&ALICE, &message_id)); @@ -429,6 +481,9 @@ mod remove { XcmQueries::::get(query_id).is_none(), "Message should have been removed but hasnt." ); + + // Assert that all holds specified have been released + assert_eq!(Balances::total_balance_on_hold(&ALICE), 0); }) } } @@ -546,7 +601,6 @@ mod xcm_new_query { assert_ne!(response_fee, 0); let alice_pre_transfer = Balances::free_balance(&ALICE); - let alices_balance_pre_hold = Balances::free_balance(ALICE); assert_ok!(Messaging::xcm_new_query( signed(ALICE), @@ -604,7 +658,6 @@ mod xcm_new_query { new_test_ext().execute_with(|| { let timeout = System::block_number() + 1; let weight = Weight::from_parts(100_000_000, 100_000_000); - let callback = None; let message_id = [0; 32]; let expected_deposit = calculate_protocol_deposit::::OnChainByteFee>( @@ -625,7 +678,7 @@ mod xcm_new_query { message_id, RESPONSE_LOCATION, timeout, - callback, + None, )); let alices_held_balance_post_hold = @@ -712,13 +765,18 @@ mod xcm_response { // Update the message to XcmTimedOut Messages::::mutate(ALICE, message_id, |message| { - let Some(Message::XcmQuery { query_id, deposit, .. }): &mut Option> = - message + let Some(Message::XcmQuery { query_id, message_deposit, .. }): &mut Option< + Message, + > = message else { panic!("No message!"); }; generated_query_id = *query_id; - *message = Some(Message::XcmTimeout { query_id: *query_id, deposit: *deposit }); + *message = Some(Message::XcmTimeout { + query_id: *query_id, + message_deposit: *message_deposit, + callback_deposit: None, + }); }); assert_noop!( @@ -814,15 +872,6 @@ mod xcm_response { let expected_query_id = 0; let xcm_response = Response::ExecutionResult(None); let callback = Callback { selector: [1; 4], weight: Zero::zero(), abi: Abi::Scale }; - let expected_deposit = calculate_protocol_deposit::< - Test, - ::OnChainByteFee, - >(ProtocolStorageDeposit::XcmQueries) + - calculate_message_deposit::< - Test, - ::OnChainByteFee, - >(); - assert_ok!(Messaging::xcm_new_query( signed(ALICE), message_id, @@ -1264,7 +1313,8 @@ mod ismp_hooks { new_test_ext().execute_with(|| { let commitment: H256 = [8u8; 32].into(); let message_id = [7u8; 32]; - let message = Message::XcmQuery { query_id: 0, callback: None, deposit: 100 }; + let message = + Message::XcmQuery { query_id: 0, callback: None, message_deposit: 100 }; IsmpRequests::::insert(commitment, (&ALICE, message_id)); Messages::::insert(ALICE, message_id, &message); @@ -1282,15 +1332,16 @@ mod ismp_hooks { new_test_ext().execute_with(|| { let commitment: H256 = [8u8; 32].into(); let message_id = [7u8; 32]; + let message_deposit = 100; IsmpRequests::::insert(commitment, (&ALICE, message_id)); - let message = Message::Ismp { commitment, callback: None, deposit: 100 }; + let message = Message::Ismp { commitment, callback: None, message_deposit }; Messages::::insert(ALICE, message_id, &message); let res = ismp::timeout_commitment::(&commitment); assert!(res.is_ok(), "{:?}", res.unwrap_err().downcast::().unwrap()); - if let Some(Message::IsmpTimeout { commitment, deposit: 100 }) = + if let Some(Message::IsmpTimeout { commitment, .. }) = Messages::::get(ALICE, message_id) { let events = events(); @@ -1352,8 +1403,11 @@ mod ismp_hooks { let commitment: H256 = Default::default(); let message_id = [1u8; 32]; - let message = - Message::IsmpResponse { commitment, response: bounded_vec![], deposit: 100 }; + let message = Message::IsmpResponse { + commitment, + response: bounded_vec![], + message_deposit: 100, + }; IsmpRequests::::insert(commitment, (ALICE, message_id)); Messages::::insert(ALICE, message_id, message); @@ -1375,7 +1429,7 @@ mod ismp_hooks { let commitment: H256 = Default::default(); let message_id = [1u8; 32]; - let message = Message::Ismp { commitment, callback: None, deposit: 100 }; + let message = Message::Ismp { commitment, callback: None, message_deposit: 100 }; IsmpRequests::::insert(commitment, (ALICE, message_id)); Messages::::insert(ALICE, message_id, message); @@ -1399,13 +1453,14 @@ mod ismp_hooks { let commitment: H256 = Default::default(); let message_id = [1u8; 32]; let callback = Callback { selector: [1; 4], weight: 100.into(), abi: Abi::Scale }; - let deposit = 100; - let message = Message::Ismp { commitment, callback: Some(callback), deposit }; + let message_deposit = 100; + let message = + Message::Ismp { commitment, callback: Some(callback), message_deposit }; ::Fungibles::hold( &HoldReason::Messaging.into(), &ALICE, - deposit, + message_deposit, ) .unwrap(); @@ -1421,7 +1476,7 @@ mod ismp_hooks { assert!(res.is_ok(), "process_response failed"); let alice_post_process = Balances::free_balance(ALICE); - assert_eq!(alice_post_process - deposit, alice_post_hold); + assert_eq!(alice_post_process - message_deposit, alice_post_hold); }) } } diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index be3898430..1645f0cb0 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -26,6 +26,7 @@ use pallet_ismp::weights::IsmpModuleWeight; use scale_info::TypeInfo; use sp_core::H256; use sp_runtime::BoundedVec; +use sp_weights::WeightToFee; use crate::messaging::{ pallet::{Config, Event, IsmpRequests, Messages, Pallet}, @@ -204,7 +205,7 @@ pub(crate) fn process_response( let (initiating_origin, id) = IsmpRequests::::get(commitment).ok_or(Error::Custom("Request not found.".into()))?; - let Some(super::super::Message::Ismp { commitment, callback, deposit }) = + let Some(super::super::Message::Ismp { commitment, callback, message_deposit }) = Messages::::get(&initiating_origin, id) else { return Err(Error::Custom("Message must be an ismp request.".into()).into()); @@ -222,10 +223,10 @@ pub(crate) fn process_response( T::Fungibles::release( &HoldReason::Messaging.into(), &initiating_origin, - deposit, + message_deposit, Exact, ) - .map_err(|_| Error::Custom("failed to release deposit.".into()))?; + .map_err(|_| Error::Custom("failed to release message deposit.".into()))?; return Ok(()); } @@ -239,7 +240,11 @@ pub(crate) fn process_response( Messages::::insert( &initiating_origin, id, - super::super::Message::IsmpResponse { commitment, deposit, response: encoded_response }, + super::super::Message::IsmpResponse { + commitment, + message_deposit, + response: encoded_response, + }, ); Ok(()) } @@ -248,11 +253,16 @@ pub(crate) fn timeout_commitment(commitment: &H256) -> Result<(), any let key = IsmpRequests::::get(commitment) .ok_or(Error::Custom("Request commitment not found while processing timeout.".into()))?; Messages::::try_mutate(key.0, key.1, |message| { - let Some(super::super::Message::Ismp { commitment, deposit, .. }) = message else { + let Some(super::super::Message::Ismp { commitment, message_deposit, callback }) = message + else { return Err(Error::Custom("Invalid message".into())); }; - *message = - Some(super::super::Message::IsmpTimeout { deposit: *deposit, commitment: *commitment }); + let callback_deposit = callback.map(|cb| T::WeightToFee::weight_to_fee(&cb.weight)); + *message = Some(super::super::Message::IsmpTimeout { + message_deposit: *message_deposit, + commitment: *commitment, + callback_deposit, + }); Ok(()) })?; From c2fb2bf87298301a86a266590c8fc5c0cc8fd25a Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Thu, 24 Apr 2025 09:14:40 +0100 Subject: [PATCH 33/38] feat(messaging): callback gas topup (#515) * implementation * tests 1 * fmt * tests 2 * benchmark * fmt * weights * fmt * comments * fmt * clippy * fix tests --- pallets/api/src/messaging/benchmarking.rs | 38 +++ pallets/api/src/messaging/mod.rs | 89 ++++++- pallets/api/src/messaging/test_utils.rs | 3 +- pallets/api/src/messaging/tests.rs | 251 +++++++++++++++++- pallets/api/src/messaging/transports/ismp.rs | 1 + pallets/api/src/messaging/weights.rs | 5 + pallets/api/src/mock.rs | 4 + .../devnet/src/weights/messaging_weights.rs | 17 ++ 8 files changed, 402 insertions(+), 6 deletions(-) diff --git a/pallets/api/src/messaging/benchmarking.rs b/pallets/api/src/messaging/benchmarking.rs index e5944e2c1..df2885208 100644 --- a/pallets/api/src/messaging/benchmarking.rs +++ b/pallets/api/src/messaging/benchmarking.rs @@ -405,5 +405,43 @@ mod messaging_benchmarks { Pallet::::ismp_post(RawOrigin::Signed(origin.clone()), message_id.into(), get, callback); } + /// Tops up callback weight for callback execution of pending messages. + #[benchmark] + fn top_up_callback_weight() { + let origin: T::AccountId = account("alice", 0, SEED); + let message_id = [0u8; 32]; + let initial_weight = Weight::from_parts(100_000, 100_000); + let additional_weight = Weight::from_parts(150_000, 150_000); + let callback = Callback { abi: Abi::Scale, weight: initial_weight, selector: [0u8; 4] }; + + let message: Message = Message::Ismp { + commitment: [10u8; 32].into(), + deposit: 100_000u32.into(), + callback: Some(callback), + }; + + Messages::::insert(&origin, message_id, &message); + + pallet_balances::Pallet::::make_free_balance_be( + &origin, + pallet_balances::Pallet::::total_issuance() / 2u32.into(), + ); + + #[extrinsic_call] + Pallet::::top_up_callback_weight( + RawOrigin::Signed(origin.clone()), + message_id, + additional_weight, + ); + + assert_has_event::( + Event::::CallbackGasIncreased { + message_id, + total_weight: initial_weight + additional_weight, + } + .into(), + ); + } + impl_benchmark_test_suite!(Pallet, crate::mock::new_test_ext(), crate::mock::Test); } diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 18165c9d4..fc0cd9e15 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -280,6 +280,8 @@ pub mod pallet { IsmpTimedOut { commitment: H256 }, /// A collection of xcm queries have timed out. XcmQueriesTimedOut { query_ids: Vec }, + /// Callback gas has been topped up. + CallbackGasIncreased { message_id: MessageId, total_weight: Weight }, } #[pallet::error] @@ -304,6 +306,12 @@ pub mod pallet { FutureTimeoutMandatory, /// Message block limit has been reached for this expiry block. Try a different timeout. MaxMessageTimeoutPerBlockReached, + /// This is not possible as the message has completed. + MessageCompleted, + /// No callback has been found for this query. + NoCallbackFound, + /// Weight cannot be zero. + ZeroWeight, } /// A reason for the pallet placing a hold on funds. @@ -457,8 +465,7 @@ pub mod pallet { .saturating_add(calculate_message_deposit::()) .saturating_add(calculate_deposit_of::>()); - T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, message_deposit)?; - let mut callback_execution_weight = Weight::zero(); + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, deposit)?; if let Some(cb) = callback.as_ref() { T::Fungibles::hold( @@ -466,8 +473,6 @@ pub mod pallet { &origin, T::WeightToFee::weight_to_fee(&cb.weight), )?; - - callback_execution_weight = T::CallbackExecutor::execution_weight(); } // Process message by dispatching request via ISMP. @@ -722,6 +727,74 @@ pub mod pallet { Ok(()) } + + /// Top up the callback weight for a pending message. + /// + /// This extrinsic allows an origin to increase the gas (weight) budget allocated for a + /// callback associated with an in-flight message. This is useful when the initially + /// allocated weight is insufficient to complete the callback. + /// + /// The additional fee for the new weight is held from the origin using the + /// `HoldReason::CallbackGas`. + /// + /// Only pending requests can have their weight increased. + /// + /// # Parameters + /// + /// - `origin`: Must be a signed account. + /// - `message_id`: The identifier of the message to be topped up. + /// - `additional_weight`: The additional weight to be appended to the message's existing + /// callback weight. + #[pallet::call_index(6)] + #[pallet::weight(T::WeightInfo::top_up_callback_weight())] + pub fn top_up_callback_weight( + origin: OriginFor, + message_id: MessageId, + additional_weight: Weight, + ) -> DispatchResult { + let who = ensure_signed(origin)?; + + if additional_weight.any_eq(::zero()) { + return Err(Error::::ZeroWeight.into()); + } + + T::Fungibles::hold( + &HoldReason::CallbackGas.into(), + &who, + T::WeightToFee::weight_to_fee(&additional_weight), + )?; + + Messages::::try_mutate(&who, message_id, |maybe_message| { + if let Some(message) = maybe_message { + // Mutate to accrue new weight. + let total_weight = match message { + Message::Ismp { callback, .. } => callback.as_mut().map_or_else( + || Err(Error::::NoCallbackFound), + |cb| Ok(cb.increase_callback_weight(additional_weight)), + ), + Message::XcmQuery { callback, .. } => callback.as_mut().map_or_else( + || Err(Error::::NoCallbackFound), + |cb| Ok(cb.increase_callback_weight(additional_weight)), + ), + Message::IsmpResponse { .. } => Err(Error::::MessageCompleted), + Message::XcmResponse { .. } => Err(Error::::MessageCompleted), + Message::IsmpTimeout { .. } => Err(Error::::RequestTimedOut), + Message::XcmTimeout { .. } => Err(Error::::RequestTimedOut), + }?; + + Self::deposit_event(Event::::CallbackGasIncreased { + message_id, + total_weight, + }) + } else { + return Err(Error::::MessageNotFound); + } + + Ok(()) + })?; + + Ok(()) + } } } impl Pallet { @@ -1000,6 +1073,14 @@ pub struct Callback { pub weight: Weight, } +impl Callback { + pub(crate) fn increase_callback_weight(&mut self, additional_weight: Weight) -> Weight { + let new_callback_weight = self.weight.saturating_add(additional_weight); + self.weight = new_callback_weight; + new_callback_weight + } +} + /// The encoding used for the data going to the contract. #[derive(Copy, Clone, Debug, Encode, Eq, Decode, MaxEncodedLen, PartialEq, TypeInfo)] pub enum Abi { diff --git a/pallets/api/src/messaging/test_utils.rs b/pallets/api/src/messaging/test_utils.rs index 404c13d80..686e4025f 100644 --- a/pallets/api/src/messaging/test_utils.rs +++ b/pallets/api/src/messaging/test_utils.rs @@ -1,4 +1,5 @@ use ismp::{host::StateMachine, router::PostRequest}; +use sp_std::vec; #[cfg(any(feature = "runtime-benchmarks", test))] /// Constructs a dummy `PostRequest` used for testing or benchmarking. @@ -24,7 +25,7 @@ mod benchmark_helpers { host::StateMachine, router::{GetRequest, GetResponse, PostResponse, StorageValue}, }; - use sp_std::vec::Vec; + use sp_std::{vec, vec::Vec}; use super::ismp_post_request; diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 1be285c13..63cdcee8c 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -657,7 +657,6 @@ mod xcm_new_query { fn takes_messaging_hold() { new_test_ext().execute_with(|| { let timeout = System::block_number() + 1; - let weight = Weight::from_parts(100_000_000, 100_000_000); let message_id = [0; 32]; let expected_deposit = calculate_protocol_deposit::::OnChainByteFee>( @@ -1481,3 +1480,253 @@ mod ismp_hooks { } } } + +mod top_up_callback_weight { + use super::*; + + #[test] + fn message_not_found() { + new_test_ext().execute_with(|| { + let weight = Weight::from_parts(100_000, 100_000); + let message_id = [0u8; 32]; + assert_noop!( + Messaging::top_up_callback_weight(signed(ALICE), message_id, weight), + Error::::MessageNotFound + ); + }) + } + + #[test] + fn zero_weight_is_err() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = Message::IsmpResponse { + commitment: Default::default(), + deposit: 100, + response: Default::default(), + }; + let weight = Weight::zero(); + + Messages::::insert(ALICE, message_id, message); + assert_noop!( + Messaging::top_up_callback_weight(signed(ALICE), message_id, weight), + Error::::ZeroWeight + ); + }) + } + + #[test] + fn ismp_response_is_err() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = Message::IsmpResponse { + commitment: Default::default(), + deposit: 100, + response: Default::default(), + }; + let weight = Weight::from_parts(100_000, 100_000); + + Messages::::insert(ALICE, message_id, message); + assert_noop!( + Messaging::top_up_callback_weight(signed(ALICE), message_id, weight), + Error::::MessageCompleted + ); + }) + } + + #[test] + fn xcm_response_is_err() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = + Message::XcmResponse { query_id: 0, deposit: 100, response: Response::Null }; + let weight = Weight::from_parts(100_000, 100_000); + + Messages::::insert(ALICE, message_id, message); + assert_noop!( + Messaging::top_up_callback_weight(signed(ALICE), message_id, weight), + Error::::MessageCompleted + ); + }) + } + + #[test] + fn xcm_timeout_is_err() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = Message::XcmTimeout { query_id: 0, deposit: 100 }; + let weight = Weight::from_parts(100_000, 100_000); + + Messages::::insert(ALICE, message_id, message); + assert_noop!( + Messaging::top_up_callback_weight(signed(ALICE), message_id, weight), + Error::::RequestTimedOut + ); + }) + } + + #[test] + fn ismp_timeout_is_err() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = Message::IsmpTimeout { commitment: Default::default(), deposit: 100 }; + let weight = Weight::from_parts(100_000, 100_000); + + Messages::::insert(ALICE, message_id, message); + assert_noop!( + Messaging::top_up_callback_weight(signed(ALICE), message_id, weight), + Error::::RequestTimedOut + ); + }) + } + + #[test] + fn ismp_pending_works() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let initial_weight = Weight::from_parts(150_000, 150_000); + let initial_fee = ::WeightToFee::weight_to_fee(&initial_weight); + let callback = Callback { abi: Abi::Scale, selector: [0u8; 4], weight: initial_weight }; + let message = Message::Ismp { + commitment: Default::default(), + deposit: 100, + callback: Some(callback), + }; + let additional_weight = Weight::from_parts(100_000, 100_000); + let additional_fee = ::WeightToFee::weight_to_fee(&additional_weight); + + // take initial hold + ::Fungibles::hold( + &HoldReason::Messaging.into(), + &ALICE, + initial_fee, + ) + .unwrap(); + + Messages::::insert(ALICE, message_id, message); + + assert_ne!(additional_fee, 0); + assert_ne!(initial_fee, 0); + assert_ok!(Messaging::top_up_callback_weight( + signed(ALICE), + message_id, + additional_weight + )); + + if let Some(Message::Ismp { callback, .. }) = Messages::::get(ALICE, message_id) { + // Assert that weight has been accrued and deposit taken. + assert_eq!(callback.unwrap().weight, initial_weight + additional_weight); + let held = Balances::total_balance_on_hold(&ALICE); + assert_eq!(held, initial_fee + additional_fee); + } else { + panic!("Wrong message type or not found."); + } + }) + } + + #[test] + fn ismp_pending_no_callback() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = + Message::Ismp { commitment: Default::default(), deposit: 100, callback: None }; + let additional_weight = Weight::from_parts(100_000, 100_000); + + Messages::::insert(ALICE, message_id, message); + assert_noop!( + Messaging::top_up_callback_weight(signed(ALICE), message_id, additional_weight), + Error::::NoCallbackFound + ); + }) + } + + #[test] + fn xcm_pending_no_callback() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let message = Message::XcmQuery { query_id: 0, deposit: 100, callback: None }; + let additional_weight = Weight::from_parts(100_000, 100_000); + + Messages::::insert(ALICE, message_id, message); + assert_noop!( + Messaging::top_up_callback_weight(signed(ALICE), message_id, additional_weight), + Error::::NoCallbackFound + ); + }) + } + + #[test] + fn xcm_pending_works() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let initial_weight = Weight::from_parts(150_000, 150_000); + let initial_fee = ::WeightToFee::weight_to_fee(&initial_weight); + let callback = Callback { abi: Abi::Scale, selector: [0u8; 4], weight: initial_weight }; + let message = Message::XcmQuery { + query_id: Default::default(), + deposit: 100, + callback: Some(callback), + }; + let additional_weight = Weight::from_parts(100_000, 100_000); + let additional_fee = ::WeightToFee::weight_to_fee(&additional_weight); + + // take initial hold + ::Fungibles::hold( + &HoldReason::Messaging.into(), + &ALICE, + initial_fee, + ) + .unwrap(); + + Messages::::insert(ALICE, message_id, message); + + assert_ne!(additional_fee, 0); + assert_ne!(initial_fee, 0); + assert_ok!(Messaging::top_up_callback_weight( + signed(ALICE), + message_id, + additional_weight + )); + + if let Some(Message::XcmQuery { callback, .. }) = + Messages::::get(ALICE, message_id) + { + // Assert that weight has been accrued and deposit taken. + assert_eq!(callback.unwrap().weight, initial_weight + additional_weight); + let held = Balances::total_balance_on_hold(&ALICE); + assert_eq!(held, initial_fee + additional_fee); + } else { + panic!("Wrong message type or not found."); + } + }) + } + + #[test] + fn assert_event() { + new_test_ext().execute_with(|| { + let message_id = [0u8; 32]; + let initial_weight = Weight::from_parts(150_000, 150_000); + let callback = Callback { abi: Abi::Scale, selector: [0u8; 4], weight: initial_weight }; + let message = Message::XcmQuery { + query_id: Default::default(), + deposit: 100, + callback: Some(callback), + }; + let additional_weight = Weight::from_parts(100_000, 100_000); + + Messages::::insert(ALICE, message_id, message); + + assert_ok!(Messaging::top_up_callback_weight( + signed(ALICE), + message_id, + additional_weight + )); + + let events = events(); + assert!(events.contains(&Event::::CallbackGasIncreased { + message_id, + total_weight: initial_weight + additional_weight, + })); + }) + } +} diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 1645f0cb0..3efa00269 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -189,6 +189,7 @@ impl IsmpModuleWeight for Pallet { }; T::WeightInfo::ismp_on_response(x).saturating_add(T::CallbackExecutor::execution_weight()) + // Also add actual weight consumed by contract env. } } diff --git a/pallets/api/src/messaging/weights.rs b/pallets/api/src/messaging/weights.rs index 3f834d648..7f999c19b 100644 --- a/pallets/api/src/messaging/weights.rs +++ b/pallets/api/src/messaging/weights.rs @@ -8,6 +8,7 @@ pub trait WeightInfo { fn ismp_on_timeout(x: u32) -> Weight; fn ismp_get(x: u32, y: u32, a: u32) -> Weight; fn ismp_post(x: u32, y: u32) -> Weight; + fn top_up_callback_weight() -> Weight; } #[cfg(test)] @@ -39,4 +40,8 @@ impl WeightInfo for () { fn ismp_post(_x: u32, _y: u32) -> Weight { Default::default() } + + fn top_up_callback_weight() -> Weight { + Default::default() + } } diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 4f4fd8cfc..70578059d 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -320,6 +320,10 @@ impl crate::messaging::WeightInfo for DummyPrepaymentWeights { fn ismp_post(_x: u32, _y: u32) -> Weight { Zero::zero() } + + fn top_up_callback_weight() -> Weight { + Zero::zero() + } } pub struct Keccak; diff --git a/runtime/devnet/src/weights/messaging_weights.rs b/runtime/devnet/src/weights/messaging_weights.rs index e0b264a2a..190698fcf 100644 --- a/runtime/devnet/src/weights/messaging_weights.rs +++ b/runtime/devnet/src/weights/messaging_weights.rs @@ -405,4 +405,21 @@ impl pallet_api::messaging::WeightInfo for WeightInfo Weight { + // Proof Size summary in bytes: + // Measured: `366` + // Estimated: `16307` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(34_000_000, 0) + .saturating_add(Weight::from_parts(0, 16307)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } } From e10c5618ac00d5a43992cb136ba2cfd1c8839a04 Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Fri, 25 Apr 2025 10:28:09 +0100 Subject: [PATCH 34/38] chore(messaging): final weight revision (#527) * manually adjust weight of callback * fmt * fix * refactor for ease of testing * fmt * docs * process callback weight tests * final tests and review * fmt * fixes * fix * comments * fmt * one more * fixes, warning * fmt --- pallets/api/src/messaging/mod.rs | 350 +++++++++++++------ pallets/api/src/messaging/tests.rs | 267 +++++++++----- pallets/api/src/messaging/transports/ismp.rs | 5 +- runtime/devnet/src/config/api/mod.rs | 7 +- 4 files changed, 418 insertions(+), 211 deletions(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index fc0cd9e15..9e9351382 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -5,14 +5,14 @@ pub use alloc::borrow::ToOwned; use ::ismp::Error as IsmpError; use codec::{Decode, Encode}; use frame_support::{ - dispatch::{DispatchResult, DispatchResultWithPostInfo, PostDispatchInfo}, + dispatch::{DispatchErrorWithPostInfo, DispatchResult, DispatchResultWithPostInfo}, pallet_prelude::*, storage::KeyLenOf, traits::{ tokens::{ fungible::{hold::Mutate as HoldMutate, Inspect, Mutate}, Fortitude, - Precision::{BestEffort, Exact}, + Precision::Exact, Preservation, Restriction, }, Get, @@ -265,9 +265,8 @@ pub mod pallet { id: MessageId, /// The callback which failed. callback: Callback, - post_info: PostDispatchInfo, /// The error which occurred. - error: DispatchError, + error: DispatchErrorWithPostInfo, }, /// One or more messages have been removed for the origin. Removed { @@ -280,6 +279,8 @@ pub mod pallet { IsmpTimedOut { commitment: H256 }, /// A collection of xcm queries have timed out. XcmQueriesTimedOut { query_ids: Vec }, + /// An error has occured while attempting to refund weight. + WeightRefundErrored { message_id: MessageId, error: DispatchError }, /// Callback gas has been topped up. CallbackGasIncreased { message_id: MessageId, total_weight: Weight }, } @@ -306,6 +307,8 @@ pub mod pallet { FutureTimeoutMandatory, /// Message block limit has been reached for this expiry block. Try a different timeout. MaxMessageTimeoutPerBlockReached, + /// This callback cannot be processed due to lack of blockspace. Please poll the response. + BlockspaceAllowanceReached, /// This is not possible as the message has completed. MessageCompleted, /// No callback has been found for this query. @@ -465,7 +468,7 @@ pub mod pallet { .saturating_add(calculate_message_deposit::()) .saturating_add(calculate_deposit_of::>()); - T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, deposit)?; + T::Fungibles::hold(&HoldReason::Messaging.into(), &origin, message_deposit)?; if let Some(cb) = callback.as_ref() { T::Fungibles::hold( @@ -603,7 +606,8 @@ pub mod pallet { /// - `xcm_response`: The response data. #[pallet::call_index(4)] #[pallet::weight({ - T::WeightInfo::xcm_response() + T::CallbackExecutor::execution_weight() + // This is only used to check against max_weight field in the OnResponse implementation in pallet-xcm. + T::WeightInfo::xcm_response() })] pub fn xcm_response( origin: OriginFor, @@ -634,7 +638,22 @@ pub mod pallet { if let Some(callback) = callback { // Attempt callback with response if specified. log::debug!(target: "pop-api::extension", "xcm callback={:?}, response={:?}", callback, xcm_response); - if Self::call(&initiating_origin, callback.to_owned(), &id, &xcm_response).is_ok() { + // Since we are dispatching in the xcm-executor with call.dispatch_call, we must + // manually adjust the blockweight to weight of the extrinsic. + let static_weight_adjustment = T::WeightInfo::xcm_response() + .saturating_add(T::CallbackExecutor::execution_weight()); + + // Never roll back state if call fails. + // Ensure that the response can be polled. + if Self::call( + &initiating_origin, + callback.to_owned(), + &id, + &xcm_response, + Some(static_weight_adjustment), + ) + .is_ok() + { Messages::::remove(&initiating_origin, id); XcmQueries::::remove(query_id); T::Fungibles::release( @@ -643,7 +662,8 @@ pub mod pallet { *message_deposit, Exact, )?; - return Ok(()); + + return Ok(()) } } // No callback is executed, @@ -657,7 +677,7 @@ pub mod pallet { }, ); - Ok(()) + Ok(().into()) } /// Remove a batch of completed or timed-out messages. @@ -796,118 +816,222 @@ pub mod pallet { Ok(()) } } -} -impl Pallet { - /// Executes a callback function associated with a message response. - /// - /// This function constructs the payload from the callback ABI and data, then invokes the - /// callback using the runtime's `CallbackExecutor`. - /// - /// # Parameters - /// - `initiating_origin`: The account that originally dispatched the request. - /// - `callback`: The callback definition, including selector, ABI, and weight. - /// - `id`: The identifier for the original message. - /// - `data`: The payload to be passed to the callback (e.g., response data). - pub(crate) fn call( - initiating_origin: &AccountIdOf, - callback: Callback, - id: &MessageId, - data: &impl Encode, - ) -> DispatchResult { - let result = T::CallbackExecutor::execute( - initiating_origin, - match callback.abi { - Abi::Scale => [callback.selector.to_vec(), (id, data).encode()].concat(), - }, - callback.weight, - ); - - log::debug!(target: "pop-api::extension", "callback weight={:?}, result={result:?}", callback.weight); - Self::handle_callback_result(initiating_origin, id, result, callback) - } - /// Handles the result of a previously executed callback function. - /// - /// This function is responsible for: - /// - Refunding unused callback gas weight. - /// - Transferring the execution reward to the fee account. - /// - Emitting success or failure events. - /// - Cleaning up or persisting message state based on result. - /// - /// # Parameters - /// - `initiating_origin`: The account that initiated the callback. - /// - `id`: The message ID associated with this callback. - /// - `result`: The execution result (with post-dispatch info if any). - /// - `callback`: The original callback definition. - pub(crate) fn handle_callback_result( - initiating_origin: &AccountIdOf, - id: &MessageId, - result: DispatchResultWithPostInfo, - callback: Callback, - ) -> DispatchResult { - match result { - Ok(post_info) => { - // Try and return any unused callback weight. - if let Some(weight_used) = post_info.actual_weight { - let weight_to_refund = callback.weight.saturating_sub(weight_used); - if weight_to_refund.all_gt(Zero::zero()) { - let total_deposit = T::WeightToFee::weight_to_fee(&callback.weight); - let returnable_deposit = T::WeightToFee::weight_to_fee(&weight_to_refund); - let execution_reward = total_deposit.saturating_sub(returnable_deposit); - let reason = HoldReason::CallbackGas.into(); - - T::Fungibles::release( - &reason, - initiating_origin, - returnable_deposit, - BestEffort, - )?; - T::Fungibles::transfer_on_hold( - &reason, - initiating_origin, - &T::FeeAccount::get(), - execution_reward, - BestEffort, - Restriction::Free, - Fortitude::Polite, - )?; + impl Pallet { + /// Executes a registered callback with the given input data and manually charges block + /// weight. + /// + /// This function is responsible for handling the full lifecycle of a callback invocation: + /// - Calculating the total weight cost of the callback, including a static adjustment. + /// - Ensuring that sufficient blockspace is available before execution. + /// - Executing the callback via the configured `CallbackExecutor`. + /// - Registering the actual weight used with the runtime. + /// - Managing any associated weight fee refund logic. + /// + /// # Parameters + /// + /// - `initiating_origin`: The account that triggered the callback. This will be passed to + /// the executor and used for fee management and event attribution. + /// - `callback`: The callback definition. + /// - `id`: The message ID associated with this callback's message. + /// - `data`: The encoded payload to send to the callback. + /// - `static_weight_adjustment`: An optional additional weight to charge, typically to + /// account for outer logic like wrapping or delegation. This is added to the callback's + /// declared weight. + /// + /// # Weight Handling + /// + /// - Before executing the callback, this function checks whether the total expected weight + /// (`callback.weight + static_weight_adjustment`) can be accommodated in the current + /// block. + /// - If the block is saturated, the function returns early with an error and does not + /// mutate state. + /// - After execution, the actual weight used by the callback is determined using + /// [`Self::process_callback_weight`] and registered via + /// [`frame_system::Pallet::::register_extra_weight_unchecked`]. + pub(crate) fn call( + initiating_origin: &AccountIdOf, + callback: Callback, + id: &MessageId, + data: &impl Encode, + // This should include T::CallbackExecutor::execution_weight() where applicable unless + // already charged. + static_weight_adjustment: Option, + ) -> DispatchResult { + // This is the total weight that should be deducted from the blockspace for callback + // execution. + let max_weight = callback + .weight + .checked_add(&static_weight_adjustment.unwrap_or(Zero::zero())) + .ok_or(Error::::BlockspaceAllowanceReached)?; + + // Dont mutate state if blockspace will be saturated. + ensure!( + frame_system::BlockWeight::::get() + .checked_accrue(max_weight, DispatchClass::Normal) + .is_ok(), + Error::::BlockspaceAllowanceReached + ); + + // Execute callback. + // Its important to note that we must still ensure that the weight used is accounted for + // in frame_system. Hence all calls after this must not return an err and state + // should not be rolled back. + let result = T::CallbackExecutor::execute( + initiating_origin, + match callback.abi { + Abi::Scale => [callback.selector.to_vec(), (id, data).encode()].concat(), + }, + callback.weight, + ); + + log::debug!(target: "pop-api::extension", "callback weight={:?}, result={result:?}", callback.weight); + Self::deposit_callback_event(initiating_origin, *id, &callback, &result); + let callback_weight_used = Self::process_callback_weight(&result, callback.weight); + + // Weight used will always be less or equal to callback.weight hence this is safe with + // the above check. + let total_weight_used = callback_weight_used + .saturating_add(static_weight_adjustment.unwrap_or(Zero::zero())); + + // Manually adjust callback weight. + frame_system::Pallet::::register_extra_weight_unchecked( + total_weight_used, + DispatchClass::Normal, + ); + + match Self::manage_fees(&initiating_origin, callback_weight_used, callback.weight) { + Ok(_) => (), + // Dont return early, we must register the weight used by the callback. + Err(error) => + Self::deposit_event(Event::WeightRefundErrored { message_id: *id, error }), + } + Ok(()) + } + + /// Deposits an event indicating the outcome of a callback execution. + /// + /// This function is intended to be called after attempting to dispatch a callback. + /// It emits either a `CallbackExecuted` or `CallbackFailed` event based on the result. + /// + /// # Parameters + /// + /// - `initiating_origin`: The account that originally initiated the message. + /// - `message_id`: The unique identifier associated with the message that triggered the + /// callback. + /// - `callback`: The callback object that was attempted to be executed. + /// - `result`: The outcome of the callback execution, containing either success or failure. + pub(crate) fn deposit_callback_event( + initiating_origin: &T::AccountId, + message_id: MessageId, + callback: &Callback, + result: &DispatchResultWithPostInfo, + ) { + match result { + Ok(_) => { + Self::deposit_event(Event::::CallbackExecuted { + origin: initiating_origin.clone(), + id: message_id, + callback: callback.clone(), + }); + }, + Err(error) => { + Self::deposit_event(Event::::CallbackFailed { + origin: initiating_origin.clone(), + id: message_id, + callback: callback.clone(), + error: error.clone(), + }); + }, + } + } + + /// Determines the actual weight consumed by a callback execution, falling back to the + /// maximum if unknown. + /// + /// This function is used to calculate the weight to be accounted for after attempting to + /// dispatch a callback. It ensures that even if the callback execution fails or does not + /// report actual weight, the worst-case (`max_weight`) is used to avoid under-accounting. + /// + /// # Parameters + /// + /// - `result`: The result of the callback dispatch, including any `PostDispatchInfo` if + /// successful. + /// - `max_weight`: The maximum weight budgeted for the callback execution. + /// + /// # Rationale + /// + /// - Protects against underestimating weight in cases where `actual_weight` is missing or + /// the dispatch fails. + /// - Ensures conservative accounting to avoid exceeding block or message limits. + pub(crate) fn process_callback_weight( + result: &DispatchResultWithPostInfo, + max_weight: Weight, + ) -> Weight { + match result { + // callback has succeded. + Ok(post_info) => { + match post_info.actual_weight { + Some(w) => w, + // return the worst case if the callback executor does not populate the + // actual weight. + None => max_weight, } - } + }, + // callback has failed. + Err(_) => { + // return the maximum weight. + max_weight + }, + } + } - Self::deposit_event(Event::::CallbackExecuted { - origin: initiating_origin.clone(), - id: *id, - callback, - }); + /// Handles fee management and refund logic for callback execution. + /// + /// This function is intended to balance the fees collected upfront for a callback + /// against the actual weight used during execution. If the callback uses less weight + /// than originally reserved, the surplus is refunded to the user, and the remainder + /// is transferred as an execution reward to the fee collector account. + /// + /// # Parameters + /// + /// - `initiating_origin`: The account that initially paid for the callback execution. + /// - `weight_used`: The actual weight consumed by the callback. + /// - `max_weight`: The maximum weight that was budgeted and paid for in advance. + pub(crate) fn manage_fees( + initiating_origin: &AccountIdOf, + weight_used: Weight, + max_weight: Weight, + ) -> DispatchResult { + let weight_to_refund = max_weight.saturating_sub(weight_used); + let total_deposit = T::WeightToFee::weight_to_fee(&max_weight); + let reason = HoldReason::CallbackGas.into(); + + let reward = if weight_to_refund.any_gt(Zero::zero()) { + // Try return some deposit + let returnable_deposit = T::WeightToFee::weight_to_fee(&weight_to_refund); + let execution_reward = total_deposit.saturating_sub(returnable_deposit); + + T::Fungibles::release(&reason, initiating_origin, returnable_deposit, Exact)?; + execution_reward + } else { + total_deposit + }; - Ok(()) - }, - Err(sp_runtime::DispatchErrorWithPostInfo:: { post_info, error }) => { - let total_deposit = T::WeightToFee::weight_to_fee(&callback.weight); - T::Fungibles::transfer_on_hold( - &HoldReason::CallbackGas.into(), - initiating_origin, - &T::FeeAccount::get(), - total_deposit, - BestEffort, - Restriction::Free, - Fortitude::Polite, - )?; + T::Fungibles::transfer_on_hold( + &reason, + initiating_origin, + &T::FeeAccount::get(), + reward, + Exact, + Restriction::Free, + Fortitude::Polite, + )?; - // Fallback to storing the message for polling - pre-paid weight is lost. - Self::deposit_event(Event::::CallbackFailed { - origin: initiating_origin.clone(), - id: *id, - callback, - post_info, - error, - }); - Ok(()) - }, + Ok(()) } } } - #[derive(Encode, Decode, Debug, MaxEncodedLen)] #[cfg_attr(feature = "std", derive(PartialEq, Clone))] #[repr(u8)] diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 63cdcee8c..056a91c9b 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -1,7 +1,7 @@ #![cfg(test)] use frame_support::{ - assert_noop, assert_ok, testing_prelude::bounded_vec, traits::fungible::hold::Inspect, - weights::Weight, + assert_noop, assert_ok, dispatch::PostDispatchInfo, testing_prelude::bounded_vec, + traits::fungible::hold::Inspect, weights::Weight, }; use sp_core::H256; @@ -858,6 +858,7 @@ mod xcm_response { )); assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); + assert!(Messages::::get(ALICE, message_id).is_none()); assert!(XcmQueries::::get(expected_query_id).is_none()); }) @@ -932,135 +933,199 @@ mod xcm_hooks { } } -mod handle_callback_result { - use frame_support::dispatch::{DispatchResultWithPostInfo, Pays, PostDispatchInfo}; - use sp_runtime::DispatchErrorWithPostInfo; +mod call { + use frame_system::pallet::BlockWeight; use super::*; - #[test] - fn claims_all_weight_to_fee_pot_on_failure() { + fn assert_error_event() { new_test_ext().execute_with(|| { - let origin = ALICE; - let id = [1u8; 32]; - let result = DispatchResultWithPostInfo::Err(DispatchErrorWithPostInfo { - post_info: Default::default(), - error: Error::::InvalidMessage.into(), - }); - let actual_weight = Weight::from_parts(100_000_000, 100_000_000); - - let callback = Callback { selector: [1; 4], weight: actual_weight, abi: Abi::Scale }; + let message_id = [1u8; 32]; + let callback_weight = Weight::from_parts(100_000, 100_000); + let data = [100u8; 5]; + let callback = + Callback { abi: Abi::Scale, selector: [0u8; 4], weight: callback_weight }; + let static_weight_adjustment = Weight::from_parts(150_000, 150_000); + assert_ok!(Pallet::::call( + &ALICE, + callback, + &message_id, + &data, + Some(static_weight_adjustment) + )); - let deposit = ::WeightToFee::weight_to_fee(&actual_weight); + System::assert_last_event( + Event::::WeightRefundErrored { + message_id, + error: DispatchError::Token(sp_runtime::TokenError::FundsUnavailable), + } + .into(), + ); + }) + } - assert!(deposit != 0); - // Artificially take the deposit - ::Fungibles::hold( + // AlwaysSuccessfullCallbackExecutor should return half the weight of the callback.weight + // TODO: there may be a better way of handling this case. + #[test] + fn blockweight_mutation_happens() { + new_test_ext().execute_with(|| { + let blockweight_pre_call = + BlockWeight::::get().get(DispatchClass::Normal).to_owned(); + let message_id = [1u8; 32]; + let callback_weight = Weight::from_parts(10_000_000, 10_000_000); + let callback_fee = ::WeightToFee::weight_to_fee(&callback_weight); + let data = [100u8; 5]; + let callback = + Callback { abi: Abi::Scale, selector: [0u8; 4], weight: callback_weight }; + let static_weight_adjustment = Weight::from_parts(15_000_000, 15_000_000); + ::Fungibles::hold( &HoldReason::CallbackGas.into(), &ALICE, - deposit, + callback_fee, ) .unwrap(); - let pot_pre_handle = Balances::free_balance(FEE_ACCOUNT); - let alice_balance_pre_handle = Balances::free_balance(ALICE); - - assert!(crate::messaging::Pallet::::handle_callback_result( - &origin, &id, result, callback - ) - .is_ok()); + assert_ok!(Pallet::::call( + &ALICE, + callback, + &message_id, + &data, + Some(static_weight_adjustment) + )); - let alice_balance_post_handle = Balances::free_balance(ALICE); - let pot_post_handle = Balances::free_balance(FEE_ACCOUNT); + let blockweight_post_call = + BlockWeight::::get().get(DispatchClass::Normal).to_owned(); + assert_ne!(blockweight_post_call, Zero::zero()); - assert_eq!(alice_balance_post_handle, alice_balance_pre_handle); - assert_eq!(pot_post_handle, pot_pre_handle + deposit); + // callback weight used in tests is total / 2. + assert_eq!( + blockweight_post_call - blockweight_pre_call, + callback_weight / 2 + static_weight_adjustment + ); }) } +} + +mod process_callback_weight { + use super::*; #[test] - fn assert_event_success() { + fn ok_with_weight_returns_weight() { new_test_ext().execute_with(|| { - let origin = ALICE; - let id = [1u8; 32]; - let actual_weight = Weight::from_parts(100, 100); + let weight = Weight::from_parts(100_000, 100_000); + let max_weight = Weight::zero(); let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { - actual_weight: Some(actual_weight), + actual_weight: Some(weight), pays_fee: Pays::Yes, }); - let callback = Callback { - selector: [1; 4], - weight: Weight::from_parts(1000, 1000), - abi: Abi::Scale, - }; - let deposit = ::WeightToFee::weight_to_fee(&actual_weight); + let processed_weight = Pallet::::process_callback_weight(&result, max_weight); - // Artificially take the deposit - ::Fungibles::hold( - &HoldReason::CallbackGas.into(), - &ALICE, - deposit, - ) - .unwrap(); + assert_eq!(processed_weight, weight); + }) + } - assert_ok!(crate::messaging::Pallet::::handle_callback_result( - &origin, &id, result, callback - )); - assert!(events().contains(&Event::::CallbackExecuted { origin, id, callback })); + #[test] + fn ok_without_weight_returns_max_weight() { + new_test_ext().execute_with(|| { + let max_weight = Weight::from_parts(200_000, 200_000); + let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { + actual_weight: None, + pays_fee: Pays::Yes, + }); + + let processed_weight = Pallet::::process_callback_weight(&result, max_weight); + + assert_eq!(processed_weight, max_weight); }) } #[test] - fn assert_event_failure() { + fn err_returns_max_weight() { new_test_ext().execute_with(|| { - let origin = ALICE; - let id = [1u8; 32]; + let max_weight = Weight::from_parts(200_000, 200_000); let result = DispatchResultWithPostInfo::Err(DispatchErrorWithPostInfo { post_info: Default::default(), error: Error::::InvalidMessage.into(), }); + let processed_weight = Pallet::::process_callback_weight(&result, max_weight); + assert_eq!(processed_weight, max_weight); + }) + } +} +mod deposit_callback_event { + use super::*; + #[test] + fn emits_callback_executed_event_on_success() { + new_test_ext().execute_with(|| { + let origin = ALICE; + let message_id = [1u8; 32]; let callback = Callback { - selector: [1; 4], - weight: Weight::from_parts(1000, 1000), abi: Abi::Scale, + selector: [0; 4], + weight: Weight::from_parts(100_000, 100_000), }; - assert!(crate::messaging::Pallet::::handle_callback_result( - &origin, &id, result, callback - ) - .is_ok()); + let result: DispatchResultWithPostInfo = Ok(PostDispatchInfo { + actual_weight: Some(Weight::from_parts(1_000, 0)), + pays_fee: Default::default(), + }); - assert!(events().contains(&Event::::CallbackFailed { - origin, - id, - callback, + Pallet::::deposit_callback_event(&origin, message_id, &callback, &result); + + System::assert_last_event( + Event::::CallbackExecuted { origin, id: message_id, callback }.into(), + ); + }); + } + + #[test] + fn emits_callback_failed_event_on_error() { + new_test_ext().execute_with(|| { + let origin = BOB; + let message_id = [2u8; 32]; + let callback = Callback { + abi: Abi::Scale, + selector: [0; 4], + weight: Weight::from_parts(100_000, 100_000), + }; + + let result = DispatchResultWithPostInfo::Err(DispatchErrorWithPostInfo { post_info: Default::default(), - error: Error::::InvalidMessage.into() - })); - }) + error: Error::::InvalidMessage.into(), + }); + + Pallet::::deposit_callback_event(&origin, message_id, &callback, &result); + + System::assert_last_event( + Event::::CallbackFailed { + origin, + id: message_id, + callback, + error: result.unwrap_err(), + } + .into(), + ); + }); } +} + +mod manage_fees { + use super::*; #[test] fn assert_payback_when_execution_weight_is_less_than_deposit_held() { new_test_ext().execute_with(|| { let origin = ALICE; - let id = [1u8; 32]; let actual_weight_executed = Weight::from_parts(50_000_000, 70_000_000); let callback_weight_reserved = Weight::from_parts(100_000_000, 100_000_000); - let result = DispatchResultWithPostInfo::Ok(PostDispatchInfo { - actual_weight: Some(actual_weight_executed), - pays_fee: Pays::Yes, - }); - - let callback = - Callback { selector: [1; 4], weight: callback_weight_reserved, abi: Abi::Scale }; + Callback { selector: [1; 4], weight: callback_weight_reserved, abi: Abi::Scale }; let deposit = ::WeightToFee::weight_to_fee(&callback_weight_reserved); - assert!(deposit != 0); + assert!(deposit != 0, "Please set an appropriate weight to fee implementation."); // Artificially take the deposit ::Fungibles::hold( @@ -1080,8 +1145,10 @@ mod handle_callback_result { let fee_account_pre_handle = Balances::free_balance(FEE_ACCOUNT); let alice_balance_pre_handle = Balances::free_balance(ALICE); - assert!(crate::messaging::Pallet::::handle_callback_result( - &origin, &id, result, callback + assert!(crate::messaging::Pallet::::manage_fees( + &origin, + actual_weight_executed, + callback_weight_reserved ) .is_ok()); @@ -1502,7 +1569,7 @@ mod top_up_callback_weight { let message_id = [0u8; 32]; let message = Message::IsmpResponse { commitment: Default::default(), - deposit: 100, + message_deposit: 100, response: Default::default(), }; let weight = Weight::zero(); @@ -1521,7 +1588,7 @@ mod top_up_callback_weight { let message_id = [0u8; 32]; let message = Message::IsmpResponse { commitment: Default::default(), - deposit: 100, + message_deposit: 100, response: Default::default(), }; let weight = Weight::from_parts(100_000, 100_000); @@ -1538,8 +1605,11 @@ mod top_up_callback_weight { fn xcm_response_is_err() { new_test_ext().execute_with(|| { let message_id = [0u8; 32]; - let message = - Message::XcmResponse { query_id: 0, deposit: 100, response: Response::Null }; + let message = Message::XcmResponse { + query_id: 0, + message_deposit: 100, + response: Response::Null, + }; let weight = Weight::from_parts(100_000, 100_000); Messages::::insert(ALICE, message_id, message); @@ -1554,7 +1624,11 @@ mod top_up_callback_weight { fn xcm_timeout_is_err() { new_test_ext().execute_with(|| { let message_id = [0u8; 32]; - let message = Message::XcmTimeout { query_id: 0, deposit: 100 }; + let message = Message::XcmTimeout { + query_id: 0, + message_deposit: Default::default(), + callback_deposit: Default::default(), + }; let weight = Weight::from_parts(100_000, 100_000); Messages::::insert(ALICE, message_id, message); @@ -1569,7 +1643,11 @@ mod top_up_callback_weight { fn ismp_timeout_is_err() { new_test_ext().execute_with(|| { let message_id = [0u8; 32]; - let message = Message::IsmpTimeout { commitment: Default::default(), deposit: 100 }; + let message = Message::IsmpTimeout { + commitment: Default::default(), + message_deposit: Default::default(), + callback_deposit: Default::default(), + }; let weight = Weight::from_parts(100_000, 100_000); Messages::::insert(ALICE, message_id, message); @@ -1589,7 +1667,7 @@ mod top_up_callback_weight { let callback = Callback { abi: Abi::Scale, selector: [0u8; 4], weight: initial_weight }; let message = Message::Ismp { commitment: Default::default(), - deposit: 100, + message_deposit: 100, callback: Some(callback), }; let additional_weight = Weight::from_parts(100_000, 100_000); @@ -1628,8 +1706,11 @@ mod top_up_callback_weight { fn ismp_pending_no_callback() { new_test_ext().execute_with(|| { let message_id = [0u8; 32]; - let message = - Message::Ismp { commitment: Default::default(), deposit: 100, callback: None }; + let message = Message::Ismp { + commitment: Default::default(), + message_deposit: 100, + callback: None, + }; let additional_weight = Weight::from_parts(100_000, 100_000); Messages::::insert(ALICE, message_id, message); @@ -1644,7 +1725,7 @@ mod top_up_callback_weight { fn xcm_pending_no_callback() { new_test_ext().execute_with(|| { let message_id = [0u8; 32]; - let message = Message::XcmQuery { query_id: 0, deposit: 100, callback: None }; + let message = Message::XcmQuery { query_id: 0, message_deposit: 100, callback: None }; let additional_weight = Weight::from_parts(100_000, 100_000); Messages::::insert(ALICE, message_id, message); @@ -1664,7 +1745,7 @@ mod top_up_callback_weight { let callback = Callback { abi: Abi::Scale, selector: [0u8; 4], weight: initial_weight }; let message = Message::XcmQuery { query_id: Default::default(), - deposit: 100, + message_deposit: 100, callback: Some(callback), }; let additional_weight = Weight::from_parts(100_000, 100_000); @@ -1709,7 +1790,7 @@ mod top_up_callback_weight { let callback = Callback { abi: Abi::Scale, selector: [0u8; 4], weight: initial_weight }; let message = Message::XcmQuery { query_id: Default::default(), - deposit: 100, + message_deposit: 100, callback: Some(callback), }; let additional_weight = Weight::from_parts(100_000, 100_000); diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index 3efa00269..af5137c01 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -182,6 +182,7 @@ impl IsmpModuleWeight for Pallet { T::WeightInfo::ismp_on_timeout(x) } + // todo: test fn on_response(&self, response: &Response) -> Weight { let x = match response { Response::Get(_) => 1, @@ -217,7 +218,9 @@ pub(crate) fn process_response( // Attempt callback with result if specified. if let Some(callback) = callback { - if Pallet::::call(&initiating_origin, callback, &id, response_data).is_ok() { + // We dont accrue any additional weight as the dispatch is handled normally by pallet-ismp. + // This includes the CallbackExecutor::execution_weight + if Pallet::::call(&initiating_origin, callback, &id, response_data, None).is_ok() { // Clean storage, return deposit Messages::::remove(&initiating_origin, id); IsmpRequests::::remove(commitment); diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index abc841478..ba0ca681e 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -214,6 +214,7 @@ impl messaging::CallbackExecutor for CallbackExecutor { debug, collect_events, ); + log::debug!(target: "pop-api::extension", "callback weight consumed={:?}, weight required={:?}", output.gas_consumed, output.gas_required); if let Ok(return_value) = &output.result { let pallet_revive::ExecReturnValue { flags, data } = return_value; @@ -223,10 +224,8 @@ impl messaging::CallbackExecutor for CallbackExecutor { } } - let post_info = PostDispatchInfo { - actual_weight: Some(output.gas_consumed.saturating_add(Self::execution_weight())), - pays_fee: Default::default(), - }; + let post_info = + PostDispatchInfo { actual_weight: Some(output.gas_consumed), pays_fee: Pays::No }; output .result From cb9c0cab28105076ad8070027d9f2e72b2d54da6 Mon Sep 17 00:00:00 2001 From: f-gate Date: Fri, 25 Apr 2025 13:54:24 +0100 Subject: [PATCH 35/38] weights.md --- pallets/api/src/messaging/weights.md | 64 ++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 pallets/api/src/messaging/weights.md diff --git a/pallets/api/src/messaging/weights.md b/pallets/api/src/messaging/weights.md new file mode 100644 index 000000000..2fa457e96 --- /dev/null +++ b/pallets/api/src/messaging/weights.md @@ -0,0 +1,64 @@ +# Weights, fees and blockspace + +## Context +In messaging, ISMP relayers and XCM response are handled very differently hence, some background is required to appreciate why fees, blockspace and weights are handled as they are. +Generally it comes down to **how the response is called** and from this we can deduce how pallet-api must react. +In these cases it is either directly via `call.dispatch(origin)` where call is a type that implements `Dispatchable` or via a transaction, the normal route to dispatch a call. + +Furthermore, on the subject of calling into a contract environment, we have a similar case to using call.dispatch, using a method like bare_call does not increase block weight or handle fees. We are outside the normal flow of dispatching. + +### XCM +In the case of XCM we are heavily dependant on the __slightly unfinished__ version of pallet-xcm's OnResponse implementation. In the current version (2412) the RuntimeCall is decoded and dispatched directly, the function on_response returns a weight, which is ignored by the xcm-executor. This means fees are not charged, weight is not tracked and we must handle these ourselves on a pallet level. + +It is important to note that we **must** follow any changes to the xcm-executor and pallet-xcm regarding QueryResponses closely to avoid any potentially critical issues. Especially around the max_weight field in the QueryResponseInfo which is **contract defined** and hence a place of vulnerability. + +In our case this max_weight will be ignored and setting to Weight::Unlimited is the best option from a contract developers perspetive. + +The process is then as follows: + +1. Query: + - Charge the caller for the weight of the request extrinsic only. + - Take a deposit for the callback execution. + - Take a fee for the response and the cost to call the CallbackExecutor. + +This ensures that fees are paid for the request, the response and we are holding fees for the callback. +The weight used is equal to the request only. + +2. Response: + - Aggregate the response weight and the callback weight and ensure we have enough blockspace for the worst case. + - Execute the callback and return the actual weight used. + - Increase BlockWeight by the weight of the response and the callback and callback execution. + - Return any left over weight to the origin. + +The fees have been paid in the Query except for the callback gas (which is a deposit). We only need to manage response weight alongside the callback weight and fees. +Simple enough ay? + +### ISMP +For ISMP we are in normal substrate territory, calls are handled via the ismp-pallet's `handle` extrinsic. This greatly simplifies the flow. +ISMP responses are handled by the IsmpModule trait and its weight via IsmpModuleWeights. +The IsmpModuleWeight is aggregated into the pallet-ismp's `handle` extrinsic, handling our fees and weights normally for the response weight and the CallbackExecutor's `execution_weight()`, _sigh_. +We still have to manage the callbacks weight. + +The process therefore is much simpler: + +1. Request: + - Charge the caller the weight of the request extrinsic only. + - Take a deposit for the callback execution. + + +2. Response: + - Using only the callback weight ensure we have enough blockspace. + - Execute the callback and return weight used. + - Increase blockspace by only weightused. + - Return any left over weight. + +Then i think, and hope, we are safe. + + + + + + + + + From 7fc6ddf308927bf2c278e59e26e10cb2650326ab Mon Sep 17 00:00:00 2001 From: f-gate Date: Mon, 28 Apr 2025 13:35:27 +0100 Subject: [PATCH 36/38] mermaid --- pallets/api/src/messaging/weights.md | 29 +++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/pallets/api/src/messaging/weights.md b/pallets/api/src/messaging/weights.md index 2fa457e96..8105547ce 100644 --- a/pallets/api/src/messaging/weights.md +++ b/pallets/api/src/messaging/weights.md @@ -56,7 +56,34 @@ Then i think, and hope, we are safe. - +```mermaid +flowchart TD + %% XCM New Query + A(["xcm_new_query"]) --> B{"Callback included?
"} + B -- yes --> C["Take deposit for callback weight"] + B -- no --> D["Take response fee"] + C --> D + + %% XCM Response + E(["xcm_response"]) --> F["xcm-executor"] + F --> G["pallet-xcm::OnResponse"] + G --> H["call.dispatch xcm_response"] + H --> I{"Callback included?"} + I -- yes --> J["Execute callback"] + J --> M{"Success?"} + M -- yes --> K["Refund unused weight"] + K --> N["Increase block weight"] + I -- no --> L["Save response"] + L --> N + M -- no --> L + + %% ISMP Request and Response + O(["ismp_request"]) --> P{"Callback included?"} + P -- yes --> Q["Take deposit for callback weight"] + + R(["ismp_response"]) --> S["on_response"] + S --> I +``` From 4735b2a0b5b163ab5fb56542893e4b2c3851b3e6 Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Tue, 29 Apr 2025 13:50:47 +0100 Subject: [PATCH 37/38] chore(messaging): use an unbalanced handler instead of naive transfer (#548) * progress * use credit and balanced * sort * fmt * fix-runtimes * fmt * use proper dealwithfees on devnet * fmt --- pallets/api/src/messaging/mod.rs | 51 ++- pallets/api/src/mock.rs | 5 +- runtime/devnet/src/config/api/mod.rs | 7 +- runtime/devnet/src/lib.rs | 31 +- runtime/testnet/src/config/api/mod.rs | 17 +- .../testnet/src/weights/messaging_weights.rs | 425 ++++++++++++++++++ runtime/testnet/src/weights/mod.rs | 1 + 7 files changed, 495 insertions(+), 42 deletions(-) create mode 100644 runtime/testnet/src/weights/messaging_weights.rs diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 9e9351382..49a5fd89f 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -10,12 +10,10 @@ use frame_support::{ storage::KeyLenOf, traits::{ tokens::{ - fungible::{hold::Mutate as HoldMutate, Inspect, Mutate}, - Fortitude, - Precision::Exact, - Preservation, Restriction, + fungible::{hold::Mutate as HoldMutate, Balanced, Credit, Inspect, Mutate}, + Fortitude, Precision, Preservation, }, - Get, + Get, OnUnbalanced, }, }; use frame_system::pallet_prelude::*; @@ -89,8 +87,8 @@ pub mod pallet { /// The deposit + fee mechanism. type Fungibles: HoldMutate - + Inspect - + Mutate; + + Mutate + + Balanced; /// The ISMP message dispatcher. type IsmpDispatcher: IsmpDispatcher>; @@ -134,8 +132,8 @@ pub mod pallet { #[pallet::constant] type MaxXcmQueryTimeoutsPerBlock: Get; - /// Where the callback fees go once any refunds have occured after cb execution. - type FeeAccount: Get>; + /// Where the callback fees or response fees are charged to. + type FeeHandler: OnUnbalanced>; /// The type responsible for converting between weight and balance, commonly transaction /// payment. @@ -566,13 +564,16 @@ pub mod pallet { &T::WeightInfo::xcm_response().saturating_add(callback_execution_weight), ); - T::Fungibles::transfer( + let credit = T::Fungibles::withdraw( &origin, - &T::FeeAccount::get(), response_prepayment_amount, + Precision::Exact, Preservation::Preserve, + Fortitude::Polite, )?; + T::FeeHandler::on_unbalanced(credit); + // Process message by creating new query via XCM. // Xcm only uses/stores pallet, index - i.e. (u8,u8), hence the fields in xcm_response // are ignored. @@ -660,7 +661,7 @@ pub mod pallet { &HoldReason::Messaging.into(), &initiating_origin, *message_deposit, - Exact, + Precision::Exact, )?; return Ok(()) @@ -731,14 +732,14 @@ pub mod pallet { &HoldReason::Messaging.into(), &origin, message_deposit, - Exact, + Precision::Exact, )?; if let Some(callback_deposit) = maybe_callback_deposit { T::Fungibles::release( &HoldReason::CallbackGas.into(), &origin, callback_deposit, - Exact, + Precision::Exact, )?; } } @@ -1007,27 +1008,29 @@ pub mod pallet { let total_deposit = T::WeightToFee::weight_to_fee(&max_weight); let reason = HoldReason::CallbackGas.into(); - let reward = if weight_to_refund.any_gt(Zero::zero()) { - // Try return some deposit + let to_reward = if weight_to_refund.any_gt(Zero::zero()) { let returnable_deposit = T::WeightToFee::weight_to_fee(&weight_to_refund); let execution_reward = total_deposit.saturating_sub(returnable_deposit); - T::Fungibles::release(&reason, initiating_origin, returnable_deposit, Exact)?; execution_reward } else { total_deposit }; - T::Fungibles::transfer_on_hold( - &reason, - initiating_origin, - &T::FeeAccount::get(), - reward, - Exact, - Restriction::Free, + // Release the deposit. + T::Fungibles::release(&reason, initiating_origin, total_deposit, Precision::Exact)?; + + // Withdraw assets. + let credit = T::Fungibles::withdraw( + &initiating_origin, + to_reward, + Precision::Exact, + Preservation::Preserve, Fortitude::Polite, )?; + // Handle assets. + T::FeeHandler::on_unbalanced(credit); Ok(()) } } diff --git a/pallets/api/src/mock.rs b/pallets/api/src/mock.rs index 70578059d..30d8e94c7 100644 --- a/pallets/api/src/mock.rs +++ b/pallets/api/src/mock.rs @@ -6,7 +6,8 @@ use frame_support::{ pallet_prelude::{DispatchResultWithPostInfo, EnsureOrigin, Pays}, parameter_types, traits::{ - AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, Everything, Get, Hooks, OriginTrait, + tokens::imbalance::ResolveTo, AsEnsureOriginWithArg, ConstU128, ConstU32, ConstU64, + Everything, Get, Hooks, OriginTrait, }, }; use frame_system::{pallet_prelude::BlockNumberFor, EnsureRoot, EnsureSigned}; @@ -266,7 +267,7 @@ pub fn get_next_query_id() -> u64 { impl crate::messaging::Config for Test { type CallbackExecutor = AlwaysSuccessfullCallbackExecutor; - type FeeAccount = FeeAccount; + type FeeHandler = ResolveTo; type Fungibles = Balances; type IsmpDispatcher = pallet_ismp::Pallet; type IsmpRelayerFee = IsmpRelayerFee; diff --git a/runtime/devnet/src/config/api/mod.rs b/runtime/devnet/src/config/api/mod.rs index ba0ca681e..6c916d127 100644 --- a/runtime/devnet/src/config/api/mod.rs +++ b/runtime/devnet/src/config/api/mod.rs @@ -114,16 +114,15 @@ impl nonfungibles::Config for Runtime { parameter_types! { pub const MaxXcmQueryTimeoutsPerBlock: u32 = 100; - // TODO: What is reasonable. + // TODO: What is reasonable. pub const IsmpRelayerFee: crate::Balance = crate::UNIT / 2; - pub DummyFeeAccount: AccountId = crate::PalletId(*b"dummyacc").into_account_truncating(); - } impl messaging::Config for Runtime { type CallbackExecutor = CallbackExecutor; - type FeeAccount = DummyFeeAccount; + // Burn fees. + type FeeHandler = crate::DealWithFees; type Fungibles = Balances; type IsmpDispatcher = Ismp; type IsmpRelayerFee = IsmpRelayerFee; diff --git a/runtime/devnet/src/lib.rs b/runtime/devnet/src/lib.rs index 169e0b2bb..1f2a3a3cd 100644 --- a/runtime/devnet/src/lib.rs +++ b/runtime/devnet/src/lib.rs @@ -31,9 +31,12 @@ use frame_support::{ genesis_builder_helper::{build_state, get_preset}, parameter_types, traits::{ - fungible::HoldConsideration, tokens::nonfungibles_v2::Inspect, ConstBool, ConstU32, - ConstU64, ConstU8, Contains, EitherOfDiverse, EqualPrivilegeOnly, EverythingBut, - LinearStoragePrice, TransformOrigin, VariantCountOf, + fungible, + fungible::HoldConsideration, + tokens::{imbalance::ResolveTo, nonfungibles_v2::Inspect}, + ConstBool, ConstU32, ConstU64, ConstU8, Contains, EitherOfDiverse, EqualPrivilegeOnly, + EverythingBut, Imbalance, LinearStoragePrice, OnUnbalanced, TransformOrigin, + VariantCountOf, }, weights::{ ConstantMultiplier, Weight, WeightToFeeCoefficient, WeightToFeeCoefficients, @@ -61,7 +64,10 @@ pub use pop_runtime_common::{ }; use smallvec::smallvec; use sp_api::impl_runtime_apis; -use sp_core::{crypto::KeyTypeId, Get, OpaqueMetadata, H256}; +use sp_core::{ + crypto::{KeyTypeId, Ss58Codec}, + Get, OpaqueMetadata, H256, +}; #[cfg(any(feature = "std", test))] pub use sp_runtime::BuildStorage; use sp_runtime::{ @@ -341,12 +347,27 @@ impl pallet_balances::Config for Runtime { parameter_types! { /// Relay Chain `TransactionByteFee` / 10 pub const TransactionByteFee: Balance = 10 * MICRO_UNIT; + pub MaintenanceAccount: AccountId = AccountId::from_ss58check("1Y3M8pnn3rJcxQn46SbocHcUHYfs4j8W2zHX7XNK99LGSVe").expect("maintenance address is valid SS58"); +} + +pub struct DealWithFees; +impl OnUnbalanced> for DealWithFees { + fn on_unbalanceds( + mut fees_then_tips: impl Iterator>, + ) { + if let Some(mut fees) = fees_then_tips.next() { + if let Some(tips) = fees_then_tips.next() { + tips.merge_into(&mut fees); + } + ResolveTo::::on_unbalanced(fees); + } + } } impl pallet_transaction_payment::Config for Runtime { type FeeMultiplierUpdate = SlowAdjustingFeeUpdate; type LengthToFee = ConstantMultiplier; - type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter; + type OnChargeTransaction = pallet_transaction_payment::FungibleAdapter; type OperationalFeeMultiplier = ConstU8<5>; type RuntimeEvent = RuntimeEvent; type WeightInfo = (); diff --git a/runtime/testnet/src/config/api/mod.rs b/runtime/testnet/src/config/api/mod.rs index 97e5f72e3..5afd7054b 100644 --- a/runtime/testnet/src/config/api/mod.rs +++ b/runtime/testnet/src/config/api/mod.rs @@ -99,24 +99,27 @@ parameter_types! { impl messaging::Config for Runtime { type CallbackExecutor = CallbackExecutor; + // Burn fees. + type FeeHandler = (); type Fungibles = Balances; type IsmpDispatcher = Ismp; type IsmpRelayerFee = IsmpRelayerFee; + type Keccak256 = Ismp; type MaxContextLen = ConstU32<64>; - type MaxDataLen = ConstU32<1024>; - type MaxKeyLen = ConstU32<32>; + type MaxDataLen = ConstU32<512>; + type MaxKeyLen = ConstU32<8>; type MaxKeys = ConstU32<10>; // TODO: size appropriately - type MaxRemovals = ConstU32<1024>; + type MaxRemovals = ConstU32<100>; // TODO: ensure within the contract buffer bounds - type MaxResponseLen = ConstU32<1024>; + type MaxResponseLen = ConstU32<512>; type MaxXcmQueryTimeoutsPerBlock = MaxXcmQueryTimeoutsPerBlock; type OffChainByteFee = TransactionByteFee; type OnChainByteFee = TransactionByteFee; type OriginConverter = LocalOriginToLocation; type RuntimeEvent = RuntimeEvent; type RuntimeHoldReason = RuntimeHoldReason; - type WeightInfo = (); + type WeightInfo = crate::weights::messaging_weights::WeightInfo; type WeightToFee = ::WeightToFee; type Xcm = QueryHandler; type XcmResponseOrigin = EnsureResponse; @@ -141,7 +144,7 @@ impl> + From> EnsureOrigin for EnsureRespon pub struct CallbackExecutor; impl messaging::CallbackExecutor for CallbackExecutor { - fn execute(account: AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo { + fn execute(account: &AccountId, data: Vec, weight: Weight) -> DispatchResultWithPostInfo { // Default #[cfg(not(feature = "std"))] let debug = DebugInfo::Skip; @@ -155,7 +158,7 @@ impl messaging::CallbackExecutor for CallbackExecutor { let mut output = Contracts::bare_call( account.clone(), - account, + account.clone(), Default::default(), weight, Default::default(), diff --git a/runtime/testnet/src/weights/messaging_weights.rs b/runtime/testnet/src/weights/messaging_weights.rs new file mode 100644 index 000000000..190698fcf --- /dev/null +++ b/runtime/testnet/src/weights/messaging_weights.rs @@ -0,0 +1,425 @@ + +//! Autogenerated weights for `messaging` +//! +//! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 46.0.0 +//! DATE: 2025-04-15, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! WORST CASE MAP SIZE: `1000000` +//! HOSTNAME: `Felixs-MacBook-Pro.local`, CPU: `` +//! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: 1024 + +// Executed Command: +// pop +// bench +// pallet +// --pallet=messaging +// --extrinsic= +// --steps=50 +// --output=./test.rs +// --runtime=/Users/rmrf-2/code/pop-node/target/release/wbuild/pop-runtime-devnet/pop_runtime_devnet.wasm +// --genesis-builder=runtime +// --genesis-builder-preset=pop-devnet-dev + +#![cfg_attr(rustfmt, rustfmt_skip)] +#![allow(unused_parens)] +#![allow(unused_imports)] +#![allow(missing_docs)] + +use frame_support::{traits::Get, weights::Weight}; +use core::marker::PhantomData; + +/// Weight functions for `messaging`. +pub struct WeightInfo(PhantomData); +impl pallet_api::messaging::WeightInfo for WeightInfo { + /// Storage: `Messaging::Messages` (r:100 w:100) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `Messaging::IsmpRequests` (r:0 w:100) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// The range of component `x` is `[1, 100]`. + fn remove(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `376 + x * (105 ±0)` + // Estimated: `3676 + x * (15317 ±0)` + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(16_498_789, 0) + .saturating_add(Weight::from_parts(0, 3676)) + // Standard Error: 81_445 + .saturating_add(Weight::from_parts(23_207_141, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().reads((1_u64).saturating_mul(x.into()))) + .saturating_add(T::DbWeight::get().writes(2)) + .saturating_add(T::DbWeight::get().writes((2_u64).saturating_mul(x.into()))) + .saturating_add(Weight::from_parts(0, 15317).saturating_mul(x.into())) + } + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `Messaging::XcmQueryTimeouts` (r:1 w:1) + /// Proof: `Messaging::XcmQueryTimeouts` (`max_values`: None, `max_size`: Some(6406), added: 8881, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::QueryCounter` (r:1 w:1) + /// Proof: `PolkadotXcm::QueryCounter` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Messaging::XcmQueries` (r:0 w:1) + /// Proof: `Messaging::XcmQueries` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `PolkadotXcm::Queries` (r:0 w:1) + /// Proof: `PolkadotXcm::Queries` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// The range of component `x` is `[0, 1]`. + fn xcm_new_query(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `217` + // Estimated: `16307` + // Minimum execution time: 33_000_000 picoseconds. + Weight::from_parts(37_740_816, 0) + .saturating_add(Weight::from_parts(0, 16307)) + // Standard Error: 139_507 + .saturating_add(Weight::from_parts(15_159_183, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(7)) + } + /// Storage: `Messaging::XcmQueries` (r:1 w:1) + /// Proof: `Messaging::XcmQueries` (`max_values`: None, `max_size`: Some(72), added: 2547, mode: `MaxEncodedLen`) + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + fn xcm_response() -> Weight { + // Proof Size summary in bytes: + // Measured: `614` + // Estimated: `16307` + // Minimum execution time: 55_000_000 picoseconds. + Weight::from_parts(59_000_000, 0) + .saturating_add(Weight::from_parts(0, 16307)) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(4)) + } + /// Storage: `Messaging::IsmpRequests` (r:1 w:0) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// The range of component `x` is `[0, 1]`. + fn ismp_on_response(x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `616` + // Estimated: `16307` + // Minimum execution time: 36_000_000 picoseconds. + Weight::from_parts(40_463_265, 0) + .saturating_add(Weight::from_parts(0, 16307)) + // Standard Error: 159_358 + .saturating_add(Weight::from_parts(19_236_734, 0).saturating_mul(x.into())) + .saturating_add(T::DbWeight::get().reads(5)) + .saturating_add(T::DbWeight::get().writes(3)) + } + /// Storage: `Messaging::IsmpRequests` (r:1 w:0) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// The range of component `x` is `[0, 2]`. + fn ismp_on_timeout(_x: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `382` + // Estimated: `16307` + // Minimum execution time: 10_000_000 picoseconds. + Weight::from_parts(11_881_491, 0) + .saturating_add(Weight::from_parts(0, 16307)) + .saturating_add(T::DbWeight::get().reads(2)) + .saturating_add(T::DbWeight::get().writes(1)) + } + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Ismp::Nonce` (r:1 w:1) + /// Proof: `Ismp::Nonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Messaging::IsmpRequests` (r:0 w:1) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ebe4bf2b1e0d50a47a6026ff9f89` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ebe4bf2b1e0d50a47a6026ff9f89` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b822d5f9e7430a9c13023708b6e8` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b822d5f9e7430a9c13023708b6e8` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d2b7f8adb5263695b748b50b35e7` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d2b7f8adb5263695b748b50b35e7` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b6d3b50d11d63f5a16223d0f6192` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b6d3b50d11d63f5a16223d0f6192` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bcad1167844259b7475e67add0cf` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bcad1167844259b7475e67add0cf` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737c0b35a703d5af186e16b0b8b26a` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737c0b35a703d5af186e16b0b8b26a` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737a9bb2e4cb5ef3f3b83e18ecd62c` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737a9bb2e4cb5ef3f3b83e18ecd62c` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bc04fe0f0a74ebff15d2d87fdbb1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bc04fe0f0a74ebff15d2d87fdbb1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737b5d150daa95d0c51137f28408ba` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737b5d150daa95d0c51137f28408ba` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ede597e3a5ee230597ae65009027` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ede597e3a5ee230597ae65009027` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473843abb5f01c6b8d278b95bab27d7` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473843abb5f01c6b8d278b95bab27d7` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738d3edf6cbffbd715d91df9544259` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738d3edf6cbffbd715d91df9544259` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473fbbb0dd84b2c05ab7e6c2e912be2` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473fbbb0dd84b2c05ab7e6c2e912be2` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473516ff665c874f7d80a3094a2766f` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473516ff665c874f7d80a3094a2766f` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473157e0cfb3591a4031670f0bd0b59` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473157e0cfb3591a4031670f0bd0b59` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c2600acf6638dc572aba8bb7e17e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c2600acf6638dc572aba8bb7e17e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747370d530e6e97b84f2b9f5f31f0f1e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747370d530e6e97b84f2b9f5f31f0f1e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c2a55a808472cc90a56c9263e8c4` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c2a55a808472cc90a56c9263e8c4` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bcfa64038d41c7e5b13c56a3790e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473bcfa64038d41c7e5b13c56a3790e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747302abe5edca3db5f3a60882617054` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747302abe5edca3db5f3a60882617054` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f484690eb40af82a20f82dd43a40` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f484690eb40af82a20f82dd43a40` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739afaa33dccd1c2b5663a9fec3aa6` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739afaa33dccd1c2b5663a9fec3aa6` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473edb24a55dd96654731b01c5fa1ce` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473edb24a55dd96654731b01c5fa1ce` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473204326c0a899add1bb9a0e44017a` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473204326c0a899add1bb9a0e44017a` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738f97a59a48ba326530dcbb00fdb8` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738f97a59a48ba326530dcbb00fdb8` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473dc615e4d8f5e4c499a4ee16e7250` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473dc615e4d8f5e4c499a4ee16e7250` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747382ff59321a7eb8f0a981e8b30d45` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747382ff59321a7eb8f0a981e8b30d45` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ee1a18c63a6d8b4d22066227cfe9` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ee1a18c63a6d8b4d22066227cfe9` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b332273af6fa385aea8eabd929ff` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b332273af6fa385aea8eabd929ff` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747308d7352d7ef3b6c484dfc7ce4170` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747308d7352d7ef3b6c484dfc7ce4170` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74736a3a8637e8e4441ed411038befc6` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74736a3a8637e8e4441ed411038befc6` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747314f08dae9f0fabe5e14b1ee5d47b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747314f08dae9f0fabe5e14b1ee5d47b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747302610adfd3510c9eab269a6ec1b5` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747302610adfd3510c9eab269a6ec1b5` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d32f80b2876c566c3430e688efeb` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d32f80b2876c566c3430e688efeb` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735b92766ff94e59a786b6a9d0da86` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735b92766ff94e59a786b6a9d0da86` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a4fc3ec43ba8dcf284f9a4c66f13` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a4fc3ec43ba8dcf284f9a4c66f13` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b5247a619d23a30bdf3ff78fd89b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b5247a619d23a30bdf3ff78fd89b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747336e585a9e1ee1d17225dc509ae08` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747336e585a9e1ee1d17225dc509ae08` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f204de8a4423fc0f0768f6c44195` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f204de8a4423fc0f0768f6c44195` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739793d71a6b55c8409d727dcb6ea5` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739793d71a6b55c8409d727dcb6ea5` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74736322c9c869ac42b212a820e89521` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74736322c9c869ac42b212a820e89521` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473aabcf2a6dd2f496aa860a00848eb` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473aabcf2a6dd2f496aa860a00848eb` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747396da168082ed8d61a69d2dab4e34` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747396da168082ed8d61a69d2dab4e34` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473aaaff2ef1ddb3cb4b95ef0add4eb` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473aaaff2ef1ddb3cb4b95ef0add4eb` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733a095d2d68fed2e16a116323519e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733a095d2d68fed2e16a116323519e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c76bbd37cb335ea589d72db8524d` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c76bbd37cb335ea589d72db8524d` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473eeee49f922f8d8e3979af1c8309c` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473eeee49f922f8d8e3979af1c8309c` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735f3b12a201b21e36b7978712f54b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735f3b12a201b21e36b7978712f54b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747314b2d52d980ecf84a512ec317eef` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747314b2d52d980ecf84a512ec317eef` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e5819ce235d668ceb400b71b7540` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e5819ce235d668ceb400b71b7540` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ce5d8239372e6ade982bb6c1a08d` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ce5d8239372e6ade982bb6c1a08d` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747378d3ad24fa3dba23353cdddaebda` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747378d3ad24fa3dba23353cdddaebda` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a6f563c75970e55f0f579c663bc5` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a6f563c75970e55f0f579c663bc5` (r:1 w:1) + /// The range of component `x` is `[0, 64]`. + /// The range of component `y` is `[0, 10]`. + /// The range of component `a` is `[0, 1]`. + fn ismp_get(x: u32, y: u32, a: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `604` + // Estimated: `252485529539233056 + a * (221360928884514619392 ±340_282_366_920_938_463_463_374_607_431_768_211_455) + x * (18446744073709551616 ±1_656_260_326_287_731) + y * (885443715538058477568 ±13_250_082_610_301_856)` + // Minimum execution time: 70_000_000 picoseconds. + Weight::from_parts(77_313_015, 0) + .saturating_add(Weight::from_parts(0, 252485529539233056)) + // Standard Error: 10_108 + .saturating_add(Weight::from_parts(168_303, 0).saturating_mul(y.into())) + // Standard Error: 68_132 + .saturating_add(Weight::from_parts(14_701_619, 0).saturating_mul(a.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) + // Added manually from ismp_post + .saturating_add(Weight::from_parts(0, 816).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 8448).saturating_mul(y.into())) + } + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + /// Storage: `System::Account` (r:2 w:2) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `ParachainInfo::ParachainId` (r:1 w:0) + /// Proof: `ParachainInfo::ParachainId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `Ismp::Nonce` (r:1 w:1) + /// Proof: `Ismp::Nonce` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `Timestamp::Now` (r:1 w:0) + /// Proof: `Timestamp::Now` (`max_values`: Some(1), `max_size`: Some(8), added: 503, mode: `MaxEncodedLen`) + /// Storage: `Messaging::IsmpRequests` (r:0 w:1) + /// Proof: `Messaging::IsmpRequests` (`max_values`: None, `max_size`: Some(96), added: 2571, mode: `MaxEncodedLen`) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738bcc4d5639f6254cf5fb180c0f72` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738bcc4d5639f6254cf5fb180c0f72` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747329c14ef481742eefb7788386c681` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747329c14ef481742eefb7788386c681` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473287e74fac42e4ec79f5df44ce538` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473287e74fac42e4ec79f5df44ce538` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738855267813169e1a708e4e75f5a4` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738855267813169e1a708e4e75f5a4` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74732701a1cee50c8d6a53d46cd5ec9c` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74732701a1cee50c8d6a53d46cd5ec9c` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b9b3aa15a2889c21b7dba485c2c9` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b9b3aa15a2889c21b7dba485c2c9` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739b94cb38b0eeacc24002a991f884` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74739b94cb38b0eeacc24002a991f884` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a751421a4bc2ed95713fe54770be` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a751421a4bc2ed95713fe54770be` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747360dac5301eeb275913f0ea8cd5e1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747360dac5301eeb275913f0ea8cd5e1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f862082677fea2554a85a022ac4e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f862082677fea2554a85a022ac4e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473fd50b6c6ca4e895c83d52a34a78b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473fd50b6c6ca4e895c83d52a34a78b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74734557713d9ab03e150f5de5ff31fe` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74734557713d9ab03e150f5de5ff31fe` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c384b875cbf15d88c72f7fcdf46d` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473c384b875cbf15d88c72f7fcdf46d` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f86067141771d95fda435ce4c9ed` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473f86067141771d95fda435ce4c9ed` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737bfab4afd6a9461416f2eef6c631` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737bfab4afd6a9461416f2eef6c631` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473162048f20318aed8443da4fc86a0` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473162048f20318aed8443da4fc86a0` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e9199a3f6daaa9e08bc80c4fb6d2` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e9199a3f6daaa9e08bc80c4fb6d2` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733e3906031411b8a73b2a37e10c30` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733e3906031411b8a73b2a37e10c30` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473db5b8c06d688e761d750e08ec388` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473db5b8c06d688e761d750e08ec388` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473cb972b1ef83734f649cf01a1cdf6` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473cb972b1ef83734f649cf01a1cdf6` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473dc363d873b7bf73b7a48ca0044e1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473dc363d873b7bf73b7a48ca0044e1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747388b3ef1033bdb656252f25d7242f` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747388b3ef1033bdb656252f25d7242f` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e0fa58cab7cb166c7874dbdfeb3f` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e0fa58cab7cb166c7874dbdfeb3f` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747315fce57276d5b85a9cbf010fd172` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747315fce57276d5b85a9cbf010fd172` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737211ea27eda948b27e13fd22254b` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737211ea27eda948b27e13fd22254b` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747380ae933955b131824193a62133fe` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747380ae933955b131824193a62133fe` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74730167e0cf40b01aac1362c3d671b3` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74730167e0cf40b01aac1362c3d671b3` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b1351345a92cbc925c15f3d9c0e1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b1351345a92cbc925c15f3d9c0e1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738b35c258e56421e62d5b5da9ea79` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738b35c258e56421e62d5b5da9ea79` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b3460961984ca24484abca1e6170` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b3460961984ca24484abca1e6170` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a4c6c073b4aab4d52f90ee49a4a2` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473a4c6c073b4aab4d52f90ee49a4a2` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473190bc10ab9a111e6bcf0170239a6` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473190bc10ab9a111e6bcf0170239a6` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ebaba6223bec6ba065297feb9203` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ebaba6223bec6ba065297feb9203` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ac33d6918e95e1723cd1b37511cb` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473ac33d6918e95e1723cd1b37511cb` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b5c3e8ce0af22b7eaf23b1de6b08` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473b5c3e8ce0af22b7eaf23b1de6b08` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737ff8123cb53fa51a8eed8457602a` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74737ff8123cb53fa51a8eed8457602a` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747326a44b9e2418ab22987b7899a8e3` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747326a44b9e2418ab22987b7899a8e3` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e248a1f77658a9204d311172361d` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e248a1f77658a9204d311172361d` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733d71d8db298f692188502bcb5578` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74733d71d8db298f692188502bcb5578` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d829600de0d3559b0af886d46a62` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473d829600de0d3559b0af886d46a62` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747372fee2e1674f54f62fbe87f8fc9e` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747372fee2e1674f54f62fbe87f8fc9e` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738657390e24e953d310f0c860266a` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738657390e24e953d310f0c860266a` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74732d11743773c308577fb8136608b2` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74732d11743773c308577fb8136608b2` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747340b23a454414e4ca08a0895b8a82` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747340b23a454414e4ca08a0895b8a82` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747330227a1128899a06563f785b26c4` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747330227a1128899a06563f785b26c4` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747339211de95404ccc298bf7270ec80` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e747339211de95404ccc298bf7270ec80` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e52954120cc73dc4a175a41586f1` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473e52954120cc73dc4a175a41586f1` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738fb69ed7a2cfe714ab54b62310a9` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74738fb69ed7a2cfe714ab54b62310a9` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473278c2c4490fb7d4efd021217ce92` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e7473278c2c4490fb7d4efd021217ce92` (r:1 w:1) + /// Storage: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735e89703e0ce7cd3db3a41a7f8a37` (r:1 w:1) + /// Proof: UNKNOWN KEY `0x52657175657374436f6d6d69746d656e74735e89703e0ce7cd3db3a41a7f8a37` (r:1 w:1) + /// The range of component `x` is `[0, 512]`. + /// The range of component `y` is `[0, 1]`. + fn ismp_post(x: u32, y: u32, ) -> Weight { + // Proof Size summary in bytes: + // Measured: `604` + // Estimated: `16307 + x * (816 ±715_192_122_278_388) + y * (8448 ±178_798_030_569_596_928)` + // Minimum execution time: 70_000_000 picoseconds. + Weight::from_parts(79_608_153, 0) + .saturating_add(Weight::from_parts(0, 16307)) + // Standard Error: 71_100 + .saturating_add(Weight::from_parts(13_407_822, 0).saturating_mul(y.into())) + .saturating_add(T::DbWeight::get().reads(8)) + .saturating_add(T::DbWeight::get().writes(7)) + .saturating_add(Weight::from_parts(0, 816).saturating_mul(x.into())) + .saturating_add(Weight::from_parts(0, 8448).saturating_mul(y.into())) + } + + /// Storage: `System::Account` (r:1 w:1) + /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) + /// Storage: `Balances::Holds` (r:1 w:1) + /// Proof: `Balances::Holds` (`max_values`: None, `max_size`: Some(211), added: 2686, mode: `MaxEncodedLen`) + /// Storage: `Messaging::Messages` (r:1 w:1) + /// Proof: `Messaging::Messages` (`max_values`: None, `max_size`: Some(12842), added: 15317, mode: `MaxEncodedLen`) + fn top_up_callback_weight() -> Weight { + // Proof Size summary in bytes: + // Measured: `366` + // Estimated: `16307` + // Minimum execution time: 31_000_000 picoseconds. + Weight::from_parts(34_000_000, 0) + .saturating_add(Weight::from_parts(0, 16307)) + .saturating_add(T::DbWeight::get().reads(3)) + .saturating_add(T::DbWeight::get().writes(3)) + } +} diff --git a/runtime/testnet/src/weights/mod.rs b/runtime/testnet/src/weights/mod.rs index b473d49e2..75a5e9b00 100644 --- a/runtime/testnet/src/weights/mod.rs +++ b/runtime/testnet/src/weights/mod.rs @@ -19,6 +19,7 @@ pub mod block_weights; pub mod extrinsic_weights; +pub mod messaging_weights; pub mod paritydb_weights; pub mod rocksdb_weights; From 569d6b734af5275f6a6293e0b41bda5f03af008c Mon Sep 17 00:00:00 2001 From: f-gate <42411328+f-gate@users.noreply.github.com> Date: Wed, 30 Apr 2025 09:55:41 +0100 Subject: [PATCH 38/38] bug(messaging): Handle additional static weight outside callback function (#549) * impl * fmt * regression-test * fmt * defensive blockspace * fmt --- pallets/api/src/messaging/mod.rs | 58 +++++++--------- pallets/api/src/messaging/tests.rs | 69 ++++++++++++++------ pallets/api/src/messaging/transports/ismp.rs | 4 +- 3 files changed, 74 insertions(+), 57 deletions(-) diff --git a/pallets/api/src/messaging/mod.rs b/pallets/api/src/messaging/mod.rs index 49a5fd89f..5088b439e 100644 --- a/pallets/api/src/messaging/mod.rs +++ b/pallets/api/src/messaging/mod.rs @@ -616,6 +616,25 @@ pub mod pallet { xcm_response: Response, ) -> DispatchResult { T::XcmResponseOrigin::ensure_origin(origin)?; + + let extrinsic_weight = T::WeightInfo::xcm_response() + .saturating_add(T::CallbackExecutor::execution_weight()); + + ensure!( + frame_system::BlockWeight::::get() + .checked_accrue(extrinsic_weight, DispatchClass::Normal) + .is_ok(), + Error::::BlockspaceAllowanceReached + ); + + // Manually adjust weight ahead of fallible execution. + // The fees of which should have been paid. + frame_system::Pallet::::register_extra_weight_unchecked( + T::WeightInfo::xcm_response() + .saturating_add(T::CallbackExecutor::execution_weight()), + DispatchClass::Normal, + ); + let (initiating_origin, id) = XcmQueries::::get(query_id).ok_or(Error::::MessageNotFound)?; let xcm_query_message = @@ -639,22 +658,9 @@ pub mod pallet { if let Some(callback) = callback { // Attempt callback with response if specified. log::debug!(target: "pop-api::extension", "xcm callback={:?}, response={:?}", callback, xcm_response); - // Since we are dispatching in the xcm-executor with call.dispatch_call, we must - // manually adjust the blockweight to weight of the extrinsic. - let static_weight_adjustment = T::WeightInfo::xcm_response() - .saturating_add(T::CallbackExecutor::execution_weight()); - // Never roll back state if call fails. // Ensure that the response can be polled. - if Self::call( - &initiating_origin, - callback.to_owned(), - &id, - &xcm_response, - Some(static_weight_adjustment), - ) - .is_ok() - { + if Self::call(&initiating_origin, callback.to_owned(), &id, &xcm_response).is_ok() { Messages::::remove(&initiating_origin, id); XcmQueries::::remove(query_id); T::Fungibles::release( @@ -677,7 +683,6 @@ pub mod pallet { response: xcm_response, }, ); - Ok(().into()) } @@ -823,7 +828,7 @@ pub mod pallet { /// weight. /// /// This function is responsible for handling the full lifecycle of a callback invocation: - /// - Calculating the total weight cost of the callback, including a static adjustment. + /// - Calculating the total weight cost of the callback. /// - Ensuring that sufficient blockspace is available before execution. /// - Executing the callback via the configured `CallbackExecutor`. /// - Registering the actual weight used with the runtime. @@ -836,15 +841,11 @@ pub mod pallet { /// - `callback`: The callback definition. /// - `id`: The message ID associated with this callback's message. /// - `data`: The encoded payload to send to the callback. - /// - `static_weight_adjustment`: An optional additional weight to charge, typically to - /// account for outer logic like wrapping or delegation. This is added to the callback's - /// declared weight. /// /// # Weight Handling /// /// - Before executing the callback, this function checks whether the total expected weight - /// (`callback.weight + static_weight_adjustment`) can be accommodated in the current - /// block. + /// (`callback.weight`) can be accommodated in the current block. /// - If the block is saturated, the function returns early with an error and does not /// mutate state. /// - After execution, the actual weight used by the callback is determined using @@ -855,16 +856,10 @@ pub mod pallet { callback: Callback, id: &MessageId, data: &impl Encode, - // This should include T::CallbackExecutor::execution_weight() where applicable unless - // already charged. - static_weight_adjustment: Option, ) -> DispatchResult { // This is the total weight that should be deducted from the blockspace for callback // execution. - let max_weight = callback - .weight - .checked_add(&static_weight_adjustment.unwrap_or(Zero::zero())) - .ok_or(Error::::BlockspaceAllowanceReached)?; + let max_weight = callback.weight; // Dont mutate state if blockspace will be saturated. ensure!( @@ -890,14 +885,9 @@ pub mod pallet { Self::deposit_callback_event(initiating_origin, *id, &callback, &result); let callback_weight_used = Self::process_callback_weight(&result, callback.weight); - // Weight used will always be less or equal to callback.weight hence this is safe with - // the above check. - let total_weight_used = callback_weight_used - .saturating_add(static_weight_adjustment.unwrap_or(Zero::zero())); - // Manually adjust callback weight. frame_system::Pallet::::register_extra_weight_unchecked( - total_weight_used, + callback_weight_used, DispatchClass::Normal, ); diff --git a/pallets/api/src/messaging/tests.rs b/pallets/api/src/messaging/tests.rs index 056a91c9b..e9e7f4325 100644 --- a/pallets/api/src/messaging/tests.rs +++ b/pallets/api/src/messaging/tests.rs @@ -735,6 +735,8 @@ mod xcm_new_query { } mod xcm_response { + use frame_system::BlockWeight; + use super::*; #[test] @@ -886,6 +888,49 @@ mod xcm_response { assert_eq!(alice_held_balance_post_release, 0); }) } + + // Dont include any callback weight so we can test the xcm_response blockweight mutation. + #[test] + fn assert_blockweight_mutation_no_callback() { + new_test_ext().execute_with(|| { + let message_id = [0; 32]; + let timeout = System::block_number() + 1; + let expected_query_id = 0; + let xcm_response = Response::ExecutionResult(None); + let blockweight_pre_call = + BlockWeight::::get().get(DispatchClass::Normal).to_owned(); + + assert_ne!( + ::CallbackExecutor::execution_weight(), + Zero::zero(), + "Please set a callback executor execution_weight to run this test." + ); + assert_ne!( + ::WeightInfo::xcm_response(), + Zero::zero(), + "Please set an T::WeightInfo::xcm_response() to run this test." + ); + + assert_ok!(Messaging::xcm_new_query( + signed(ALICE), + message_id, + RESPONSE_LOCATION, + timeout, + None, + )); + + assert_ok!(Messaging::xcm_response(root(), expected_query_id, xcm_response.clone())); + + let blockweight_post_call = + BlockWeight::::get().get(DispatchClass::Normal).to_owned(); + + assert_eq!( + blockweight_post_call - blockweight_pre_call, + ::WeightInfo::xcm_response() + + ::CallbackExecutor::execution_weight() + ) + }) + } } mod xcm_hooks { @@ -945,14 +990,7 @@ mod call { let data = [100u8; 5]; let callback = Callback { abi: Abi::Scale, selector: [0u8; 4], weight: callback_weight }; - let static_weight_adjustment = Weight::from_parts(150_000, 150_000); - assert_ok!(Pallet::::call( - &ALICE, - callback, - &message_id, - &data, - Some(static_weight_adjustment) - )); + assert_ok!(Pallet::::call(&ALICE, callback, &message_id, &data,)); System::assert_last_event( Event::::WeightRefundErrored { @@ -977,7 +1015,7 @@ mod call { let data = [100u8; 5]; let callback = Callback { abi: Abi::Scale, selector: [0u8; 4], weight: callback_weight }; - let static_weight_adjustment = Weight::from_parts(15_000_000, 15_000_000); + ::Fungibles::hold( &HoldReason::CallbackGas.into(), &ALICE, @@ -985,23 +1023,14 @@ mod call { ) .unwrap(); - assert_ok!(Pallet::::call( - &ALICE, - callback, - &message_id, - &data, - Some(static_weight_adjustment) - )); + assert_ok!(Pallet::::call(&ALICE, callback, &message_id, &data,)); let blockweight_post_call = BlockWeight::::get().get(DispatchClass::Normal).to_owned(); assert_ne!(blockweight_post_call, Zero::zero()); // callback weight used in tests is total / 2. - assert_eq!( - blockweight_post_call - blockweight_pre_call, - callback_weight / 2 + static_weight_adjustment - ); + assert_eq!(blockweight_post_call - blockweight_pre_call, callback_weight / 2); }) } } diff --git a/pallets/api/src/messaging/transports/ismp.rs b/pallets/api/src/messaging/transports/ismp.rs index af5137c01..aa9fed4bd 100644 --- a/pallets/api/src/messaging/transports/ismp.rs +++ b/pallets/api/src/messaging/transports/ismp.rs @@ -218,9 +218,7 @@ pub(crate) fn process_response( // Attempt callback with result if specified. if let Some(callback) = callback { - // We dont accrue any additional weight as the dispatch is handled normally by pallet-ismp. - // This includes the CallbackExecutor::execution_weight - if Pallet::::call(&initiating_origin, callback, &id, response_data, None).is_ok() { + if Pallet::::call(&initiating_origin, callback, &id, response_data).is_ok() { // Clean storage, return deposit Messages::::remove(&initiating_origin, id); IsmpRequests::::remove(commitment);