-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[AHM] Cleanup and add Preimage doc #543
Conversation
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
|
||
Q: One question here would be whether or not we want to translate these calls. I think we can and should. But I am not sure about the best time point to do so. We can translate the preimages calls upon arrival on the Asset Hub, although there is a small change that a preimage that was not intended to be decoded as a call would be translated. After all, the preimage pallet is a universal data storage without any implied semantics about its content. It could therefore be better to translate the preimages once we are migrating the Referenda pallet and then only translate all preimages that occur as hash lookups in a referenda. | ||
Basically: loop referenda -> load referenda -> load preimage of referenda -> translate preimage -> calculate new preimage hash -> update preimage with new hash -> update referenda with new hash. | ||
One further note on the preimage translation: If the length of a preimage is increased by the translation, then we should not reconsider the deposit but keep the original deposit as to not punish users for this. The cases that the translation increases the size of a preimage past the 4MiB hard limit should be negligible. |
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.
the deposit should be lower on the AH. probably wont be a problem. we keep the deposit same and provide a call to update it (which should release some funds)
pallets/rc-migrator/src/preimage.md
Outdated
|
||
[Maps](https://github.com/paritytech/polkadot-sdk/blob/00946b10ab18331f959f5cbced7c433b6132b1cb/substrate/frame/preimage/src/lib.rs#L185) a hash and the length of a preimage to its preimage data. Preimages can be migrated rather easily by sending them in chunks from the Relay and appending them on the Asset Hub. The preimages are often used to store large governance calls. | ||
|
||
Q: One question here would be whether or not we want to translate these calls. I think we can and should. But I am not sure about the best time point to do so. We can translate the preimages calls upon arrival on the Asset Hub, although there is a small change that a preimage that was not intended to be decoded as a call would be translated. After all, the preimage pallet is a universal data storage without any implied semantics about its content. It could therefore be better to translate the preimages once we are migrating the Referenda pallet and then only translate all preimages that occur as hash lookups in a referenda. |
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.
agree. something we also have discussed with Joe and Donal, we wanna map them.
pallets/rc-migrator/src/preimage.md
Outdated
|
||
[Maps](https://github.com/paritytech/polkadot-sdk/blob/00946b10ab18331f959f5cbced7c433b6132b1cb/substrate/frame/preimage/src/lib.rs#L185) a hash and the length of a preimage to its preimage data. Preimages can be migrated rather easily by sending them in chunks from the Relay and appending them on the Asset Hub. The preimages are often used to store large governance calls. | ||
|
||
Q: One question here would be whether or not we want to translate these calls. I think we can and should. But I am not sure about the best time point to do so. We can translate the preimages calls upon arrival on the Asset Hub, although there is a small change that a preimage that was not intended to be decoded as a call would be translated. After all, the preimage pallet is a universal data storage without any implied semantics about its content. It could therefore be better to translate the preimages once we are migrating the Referenda pallet and then only translate all preimages that occur as hash lookups in a referenda. |
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.
only scheduler which used by referenda or root can request a preimage. in theory there should only preimages with valid calls having request count > 0.
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.
Oh right, so we could also do the translation as we migrate the preimages. Will add a note.
But then when we do the governance migration afterwards it will not find the hashes anymore. So they kind of need to happen together anyway.
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Signed-off-by: Oliver Tale-Yazdi <[email protected]>
👉 To be merged into the Asset Hub Migration working branch.
Changes:
Factor out XCM sending into common function
Cleanup
Add docs for the preimage pallet that I started with
Does not require a CHANGELOG entry