2

Introducing new host functions means that all nodes must update to include it. In the future, some parachain teams may require some custom host functions for their needs.

What would the approval process of adding a new host function look like and to what expense?

1 Answer 1

4

There is not a concrete answer to this question since new host functions are changes in the client, which cannot be upgraded on-chain.

There will be three main steps needed to get a new host function onto the Polkadot network:

  1. Agreement about the host function specification.

    Adding a new host function is a big change, and importantly is something that must be supported for all time once it has been added, even if it becomes deprecated, since it would be required to sync old blocks on a chain that used it. Thus the most important part of the process is to clearly define what the host function should do.

    The best place for this is an issue in Substrate / Polkadot or in the PSP repository: https://github.com/w3f/PSPs

  2. Implementation of the host function.

    After an agreement is made, all Polkadot clients will need to update their codebase to support it. This is an important step to call out because there may be different client implementations in the future, and before a node can use this new host function, all of the implementations will need to be updated. This is also a point where developers who may really be against some idea would choose not to implement this function, and that could of course cause problems on its own.

  3. The network needs to update their client.

    Finally, once the host function is implemented for all the different Polkadot client implementations, then all of the node operators will need to update their software. Again, this is an opportunity where node operators who are really against some idea may choose not to upgrade their client in protest.

Hopefully this also paints a picture about what on-chain governance and on-chain runtime really simplifies the concrete way to do upgrades. Unfortunately, this is not something that can be safely done for blockchain clients.

In most cases, steps 2 and 3 are not usually a contentious problem, and usually the community works together to implement new features, however there have been examples in the past (like Bitcoin Cash and ETH Classic) which has shown this is not always the case.

4
  • So if I have new host function I can not fix this with a runtime upgrade?
    – flipchan
    Jul 12, 2022 at 16:45
  • You would need to coordinate a client upgrade with your community along with a runtime upgrade. Furthermore, new host functions would make your chain incompatible with Polkadot, unless Polkadot also accepted these host functions into it's client.
    – Shawn Tabrizi
    Jul 13, 2022 at 8:01
  • @ShawnTabrizi this sounds like parachains cannot have custom host functions. Is that understanding correct. Is there some possible way to lift that restriction? Jul 11 at 3:32
  • Parachains are provided shared security by the relay chain. The relay chain is able to do this because it executes the blocks of the parachains to check their validity. There is no way to have your chain execute custom logic (like a custom host function) without introducing it to the relay chain. A bridged chain is an option for interoperability without shared security.
    – Shawn Tabrizi
    Jul 11 at 4:04

Your Answer

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

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