2

I know the default block interval in a substrate-based chain is 6s.

My question is whether it can be customized or not.

If could, how can I do it? It must be set before the chain start, or you can dynamically change it over the node running.

1 Answers1

3

In the Node Template that value is set here and is customizable https://github.com/substrate-developer-hub/substrate-node-template/blob/v2.0.0/runtime/src/lib.rs#L104. You should be able to update this value for a running chain by way of Substrate's forkless runtime upgrade capabilities, which you can learn more about here https://substrate.dev/docs/en/knowledgebase/advanced/executor#runtime-upgrades and here https://substrate.dev/docs/en/knowledgebase/runtime/upgrades.

Dan Forbes
  • 2,734
  • 3
  • 30
  • 60
  • 2
    While the above is correct, unfortunately Babe (the most likely block production algorithm your chain will be using) does not currently support changing the target block time after genesis. (This is an open todo.) – apopiak Nov 04 '20 at 08:35