-
Notifications
You must be signed in to change notification settings - Fork 790
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
Fetch parachain runtime code from the relay chain #78
Comments
Keep in mind though, that we actually don't want to store parachain code on the relay chain and intend to get rid of that asap. If we go with the route in the ticket, than parachain validators should be able to fetch their code from any relay chain validator and could verify that it is correct, by means of a hash that will be stored on the relay chain. |
With |
Related to this, it should also be a fast operation to get the current parachain code hash (whether from the relay-chain or elsewhere). Consensus implementations like paritytech/cumulus#2573 or anything that uses the new |
* Remove unused code * Expand variable
Currently the runtime code of the parachain is always fetched from the parachain state. This is done automatically by Substrate by fetching the
:code
storage item.For parachains however, there actually exist two places the runtime code can be found, in the parachain state or in the relay chain state.
When there is a problem with the parachain, e.g. it is stalled and it needs to be recovered, it could happen that we need to replace the last head and the runtime on the relay chain. Then it would be nice to have all parachain nodes fetch the correct runtime from the relay chain to have this fixed, instead of also needing to coordinate with them to replace the runtime.
TLDR: We need to change Substrate to support fetching the runtime code from the relay chain, instead of the parachain state.
The text was updated successfully, but these errors were encountered: