-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Conversation
Co-Authored-By: parity-processbot <>
Co-Authored-By: parity-processbot <>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I completely understand this, but it seems reasonable to minimize/canonicalize paths to ensure that all parent
junctions are leading. Maybe XCM v1 should prevent this by differentiation the path up the tree with the path down the tree.
How would this work for non-hierarchical (sibling) paths?
A <-- B
^
|
v
C <-- D
From B, would something like (Sibling(D), Parent)
be 'normalized' to point to A
instead of C
?
@rphmeier Gav proposed that we actually remove the parent junction from XCM all together: #3312 Not sure if we want to put this in XCM v1 and have a breaking change in the format for everyone, or actually increment to XCM v2. As for your scenario, I don't think i quite understand the diagram you made. For canonicalization, a parachain should only ever have one parent, and a sibling parachains are only those that share a parent, so |
Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
bot merge |
Waiting for commit status. |
* master: (33 commits) Update all weights, add run_all_benches.sh script (#3400) Enable over-bridge-messaging in Rococo/Wococo runtime (#3377) paras.rs to FRAME V2 (#3403) Add XCM Tracing (#3353) Use MaxEncodedLen trait from new parity-scale-codec v2.2 (#3412) bump a bunch of deps in parity-common (#3402) Warn on low connectivity. (#3408) origin to frame v2 (#3405) Enable logging in the puppet worker (#3411) make it easier to dbg stalls (#3351) XCM `canonicalize` + `prepend_with` fix (#3269) cleanup stream polls (#3397) Staking Miner (#3141) Companion for Substrate#8953 (#3140) Bump version, specs & substrate in prep for v0.9.8 (#3387) Fix busy loops. (#3392) Minor refactor (#3386) add simnet tests (#3381) BEEFY: adjust gossip (#3372) Companion for #9193 (#3376) ...
* canonicalize + prepend_with fix * fix doc * not needed * better docs, and more deterministic logic * one more test * Update xcm/src/v0/multi_location.rs * Update multi_location.rs Co-Authored-By: parity-processbot <> * follow style guide Co-Authored-By: parity-processbot <> * oops * Update xcm/src/v0/multi_location.rs Co-authored-by: Robert Habermeier <rphmeier@gmail.com> * Update xcm/src/v0/multi_location.rs Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This introduces a new function
canonicalize
which will convert an XCM into its canonical/normalized form.I would have preferred the name
normalize
but it seems this is the standard naming in Rust: https://doc.rust-lang.org/std/fs/fn.canonicalize.htmlUsing this function, we repair a bug with
prepend_with
, where an assumption about the number of elements we skip when forming the new object was incorrect.