We need to run an on-initialize function that runs for 5 to 6 seconds. The error we run into when we do this is "Block production took too long".

We have tried to increase the AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO and MAXIMUM_BLOCK_WEIGHT accordingly to be able to fit it within the block length, however those don't seem to work.

Are there correct values for AVERAGE_ON_INITIALIZE_RATIO, NORMAL_DISPATCH_RATIO, or MAXIMUM_BLOCK_WEIGHT to help us achieve this? For context, we are trying to run this on Kusama chain.

  • do you have the source code public?
    – flipchan
    Commented Feb 2, 2023 at 18:28
  • Why would you do that? Parachain blocks should not take that long or they can get their' chain stuck. Are you trying to do a migration or what? Commented Feb 2, 2023 at 19:55


Your Answer

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

Browse other questions tagged or ask your own question.