-
Notifications
You must be signed in to change notification settings - Fork 371
Add event for showing the hash of an UMP sent message #1228
Add event for showing the hash of an UMP sent message #1228
Conversation
pallets/parachain-system/src/lib.rs
Outdated
| /// \[ weight_used, result_mqc_head \] | ||
| DownwardMessagesProcessed(Weight, relay_chain::Hash), | ||
| /// An Upward message was sent to the parent. | ||
| UpwardMessageSent(Option<MessageId>), |
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.
Why don't you use T::Hash here as well?
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.
I just tried to mimic as much as possible what ump shows so that both ids match. But I am happy to change it if I find no issues doing so
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.
However, now that I think about it; the reason for proposing this PR is to help potential cross-chain explorers identify and match which messages have been sent from a chain and executed in another chain. With this goal in mind, shouldnt we ensure we mimic exactly what ump is doing to calculate the id?
T::Hash and T::Hashing can be configured in the runtime and they might have different hashing implementations than that of the ump queue.
So I am hesitant about using the more generic T::Hash and T::Hashing, what do you think?
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.
This really should be done as part of XCMv3, since there is a concept of XCM hashes there, and we can use it here as well.
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.
I can PR the xvm V3 branch if prefered
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.
(Keith pointed me out this SE answer when I was sniffing around for something similar: https://substrate.stackexchange.com/questions/1893/is-there-an-id-for-xcm-message/1906#1906 )
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.
Yes I agree with what Gav said. And although the message hash being different is something each chain can work on indepentently, I think to help explorers identify these hashes the ump queue should emit an event with this hash. I will re-work this PR to go into xcm V3, as it seems we already have the notion of "hash of the message" there
3d6357c to
fae4dd5
Compare
|
Back to draft because I need to test it with cargo override |
|
any news? |
|
I think I can make it ready for review, as I tested it against the xcmv3 branch back on its day |
|
For some reason, I obtained different results using |
|
Alright using_encoded yields a different slice (because it prepends a first byte indicating the lenght). Since we want to mimic the ump event I think we should stay with |
|
This will not get merged into XCM the current XCM implementation? Having a hash to match a XCM message sent from a parachain to a relay chain (or the other way around) is key to improve the UX of XCM in general. We have been offering a XCM explorer bounty for two hackathons in a row, but without this feature, it is not possible to have a straightforward way to link XCM messages between chains. Note that from parachain to parachain this is not true, and it is possible to link XCM message sent on one chain, to XCM message executed in the other chain. |
…ump-message-hash-event
|
Hi! Just wanted to know whether there is any plan of incorporating this or it conflicts with paritytech/polkadot-sdk#489 |
|
I don't see how it conflicts, unless 6161 implies the removal of |
|
I don't think this conflicts, but will need to double-check whether XCM v3 already includes an XCM hash in the event. My guess is no, in which case this PR does not conflict with anything at all. |
|
Personally I would love to see this land.
…On Tue, 1 Nov 2022 at 11:50, Keith Yeung ***@***.***> wrote:
I don't think this conflicts, but will need to double-check whether XCM v3
already includes an XCM hash in the event. My guess is no, in which case
this PR does not conflict with anything at all.
—
Reply to this email directly, view it on GitHub
<#1228 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGEJCGGA6G2MBSTB2AAVF3WGD7XLANCNFSM5U3PNUIA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
pallets/parachain-system/src/lib.rs
Outdated
|
|
||
| // The relay ump does not use using_encoded | ||
| // We apply the same this to use the same hash | ||
| // TODO: shall we change both ump and this to |
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.
what about this TODO?
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.
It seems paritytech/polkadot#6271 will still use sp_io::hashing::blake2_256(message). I guess we can leave it as is (and remove the todo), as it is the only way hashes will match
|
@KiChjang do we want this merged? |
|
Yes, but not at this current state as it's failing CI. |
|
@girazoki can you make the CI working? :) |
|
I fixed the fmt checks, but the build jobs won't pass because this is going to the |
|
The CI pipeline was cancelled due to failure one of the required jobs. |
But these messages look valid? |
|
I think this is because the branch still is pointing at the master branch of |
|
Ahh okay! @KiChjang please verify that this branch compiles for you and then let's merge it. |
|
Ah okay, let me just merge this as-is. |
Adds Event showing Hash of message sent to parent through UMP
The goal is to match this ID with the one that the UMP queue shows in the event: https://github.com/paritytech/polkadot/blob/0fca26fb0a5bdf00bde70a9bcc31805dad61b2a9/runtime/parachains/src/ump.rs#L139