diff --git a/polkadot/xcm/src/v3/mod.rs b/polkadot/xcm/src/v3/mod.rs index b1d134ae08..772ad48ac4 100644 --- a/polkadot/xcm/src/v3/mod.rs +++ b/polkadot/xcm/src/v3/mod.rs @@ -981,6 +981,10 @@ pub enum Instruction { /// Set the Topic Register. /// + /// The 32-byte array identifier in the parameter is not guaranteed to be + /// unique; if such a property is desired, it is up to the code author to + /// enforce uniqueness. + /// /// Safety: No concerns. /// /// Kind: *Instruction* diff --git a/polkadot/xcm/xcm-builder/src/barriers.rs b/polkadot/xcm/xcm-builder/src/barriers.rs index 13c1caca5f..6996c71455 100644 --- a/polkadot/xcm/xcm-builder/src/barriers.rs +++ b/polkadot/xcm/xcm-builder/src/barriers.rs @@ -207,6 +207,9 @@ impl< /// Sets the message ID to `t` using a `SetTopic(t)` in the last position if present. /// +/// Note that the message ID does not necessarily have to be unique; it is the +/// sender's responsibility to ensure uniqueness. +/// /// Requires some inner barrier to pass on the rest of the message. pub struct TrailingSetTopicAsId(PhantomData); impl ShouldExecute for TrailingSetTopicAsId { diff --git a/polkadot/xcm/xcm-builder/src/routing.rs b/polkadot/xcm/xcm-builder/src/routing.rs index c46e0ce785..39e9eab410 100644 --- a/polkadot/xcm/xcm-builder/src/routing.rs +++ b/polkadot/xcm/xcm-builder/src/routing.rs @@ -25,6 +25,11 @@ use xcm::prelude::*; /// appends one to the message filled with a universally unique ID. This ID is returned from a /// successful `deliver`. /// +/// If the message does already end with a `SetTopic` instruction, then it is the responsibility +/// of the code author to ensure that the ID supplied to `SetTopic` is universally unique. Due to +/// this property, consumers of the topic ID must be aware that a user-supplied ID may not be +/// unique. +/// /// This is designed to be at the top-level of any routers, since it will always mutate the /// passed `message` reference into a `None`. Don't try to combine it within a tuple except as the /// last element.