1

This question is about cumulus PR https://github.com/paritytech/cumulus/pull/825. What is an example of when I would want to use custom head data.

The PR description itself says:

This can be for example when a chain wants to fork.

But I still don't really understand that. We already know that parachains don't need to fork regularly because of the dynamic runtime upgrades. So I'm trying to think of an example of when they would want to.

One idea I have is that the community decides the consensus authorities are corrupt and wants to change them. So two questions:

  1. Is this the kind of situation the feature is designed for (and if not, please provide a more typical example).
  2. How would I use this custom head data feature to achieve such a fork.

1 Answer 1

2

The feature was mainly added for chains that want to migrate from a solo chain to running as a parachain. It would work the following way:

  1. They get a slot on the relay chain and have some kind of shell runtime running.

  2. The solo chain is doing a runtime update that will include all the necessary changes for being a parachain, e.g. parachain-system pallet etc. This update should in the best case also make the solo chain stop (which would be the case if it switches from BABE to AURA for example). Stopping the chain is not really required, but works as a better kind of signal that the parachain now is taking over control.

  3. On the parachain you issue a transaction that will return the header of the block of the solo chain, that enacted the new update, as the custom head data.

  4. The shell parachain will then stop working as it doesn't find this head in its local database, but collators that have the old solo chain state will be able to produce new blocks.

Doing it this way we achieved to migrate the state to the Parachain without doing any kind of copying or whatever. From the runtime POV this looks like a normal runtime update.

Another use case of this feature was for example the switch by Kilt from Kusama to Polkadot.

When we have Coretime this feature will not be that important anymore for these kind of use cases as you can register a parachain much faster and get access to Coretime on demand.

You can use this for a fork by just setting the header of some other chain that will then take over the slot. However, with Coretime this isn't that important anymore as well.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.