diff --git a/parachains/chain-specs/bridge-hub-rococo.json b/parachains/chain-specs/bridge-hub-rococo.json index e94373a11f..6bc55f916b 100644 --- a/parachains/chain-specs/bridge-hub-rococo.json +++ b/parachains/chain-specs/bridge-hub-rococo.json @@ -14,7 +14,11 @@ ], "telemetryEndpoints": null, "protocolId": null, - "properties": {}, + "properties": { + "ss58Format": 42, + "tokenDecimals": 12, + "tokenSymbol": "ROC" + }, "relay_chain": "rococo", "para_id": 1013, "codeSubstitutes": {}, diff --git a/parachains/chain-specs/bridge-hub-wococo.json b/parachains/chain-specs/bridge-hub-wococo.json index bf41ef8215..dd02842f2f 100644 --- a/parachains/chain-specs/bridge-hub-wococo.json +++ b/parachains/chain-specs/bridge-hub-wococo.json @@ -14,7 +14,11 @@ ], "telemetryEndpoints": null, "protocolId": null, - "properties": {}, + "properties": { + "ss58Format": 42, + "tokenDecimals": 12, + "tokenSymbol": "WOOK" + }, "relay_chain": "wococo", "para_id": 1014, "codeSubstitutes": {}, @@ -86,4 +90,4 @@ "childrenDefault": {} } } -} \ No newline at end of file +} diff --git a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_common_config.rs b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_common_config.rs index fd1672d9fc..a035e3554c 100644 --- a/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_common_config.rs +++ b/parachains/runtimes/bridge-hubs/bridge-hub-rococo/src/bridge_common_config.rs @@ -20,8 +20,9 @@ use bp_messages::{ LaneId, }; use bp_runtime::{messages::MessageDispatchResult, AccountIdOf, Chain}; -use codec::Encode; -use frame_support::{dispatch::Weight, parameter_types}; +use codec::{Decode, Encode}; +use frame_support::{dispatch::Weight, parameter_types, CloneNoBound, EqNoBound, PartialEqNoBound}; +use scale_info::TypeInfo; use xcm::latest::prelude::*; use xcm_builder::{DispatchBlob, DispatchBlobError, HaulBlob}; @@ -36,6 +37,13 @@ parameter_types! { pub const HeadersToKeep: u32 = 1024; } +#[derive(CloneNoBound, EqNoBound, PartialEqNoBound, Encode, Decode, Debug, TypeInfo)] +pub enum XcmBlobMessageDispatchResult { + InvalidPayload, + Dispatched, + NotDispatched(#[codec(skip)] &'static str), +} + /// [`XcmBlobMessageDispatch`] is responsible for dispatching received messages from other BridgeHub pub struct XcmBlobMessageDispatch { _marker: @@ -47,6 +55,7 @@ impl { type DispatchPayload = XcmAsPlainPayload; + type DispatchLevelResult = XcmBlobMessageDispatchResult; fn dispatch_weight(_message: &mut DispatchMessage) -> Weight { log::error!( @@ -60,7 +69,7 @@ impl, message: DispatchMessage, - ) -> MessageDispatchResult { + ) -> MessageDispatchResult { log::warn!( target: crate::LOG_TARGET, "[XcmBlobMessageDispatch] DispatchBlob::dispatch_blob triggering - message_nonce: {:?}", @@ -79,15 +88,19 @@ impl log::debug!( - target: crate::LOG_TARGET, - "[XcmBlobMessageDispatch] DispatchBlob::dispatch_blob was ok - message_nonce: {:?}", - message.key.nonce - ), + let dispatch_level_result = match BlobDispatcher::dispatch_blob(payload) { + Ok(_) => { + log::debug!( + target: crate::LOG_TARGET, + "[XcmBlobMessageDispatch] DispatchBlob::dispatch_blob was ok - message_nonce: {:?}", + message.key.nonce + ); + XcmBlobMessageDispatchResult::Dispatched + }, Err(e) => { let e = match e { DispatchBlobError::Unbridgable => "DispatchBlobError::Unbridgable", @@ -106,12 +119,14 @@ impl, - // Native converter for Relay-chain (Parent) location; will converts to a `Relay` origin when - // recognized. + // Native converter for Relay-chain (Parent) location; will convert to a `Relay` origin when + // recognised. RelayChainAsNative, // Native converter for sibling Parachains; will convert to a `SiblingPara` origin when - // recognized. + // recognised. SiblingParachainAsNative, + // Superuser converter for the Relay-chain (Parent) location. This will allow it to issue a + // transaction from the Root origin. + ParentAsSuperuser, // Native signed account converter; this just converts an `AccountId32` origin into a normal - // `Origin::Signed` origin of the same 32-byte value. + // `RuntimeOrigin::Signed` origin of the same 32-byte value. SignedAccountId32AsNative, // Xcm origins can be represented natively under the Xcm pallet's Xcm origin. XcmPassthrough,