Skip to content

Collator: don't make blocks when there is no work to be done. #147

Closed
@rphmeier

Description

@rphmeier

The default configuration of Substrate and Cumulus is to make blocks at all times. This is useful for pallets which autonomously use blockspace. The blobs runtime is purely reactive, so we can be more efficient by producing blocks only when there are transactions or events to respond to. We should alter the collator implementation to (by default) make blocks only when at least one of the following is true:

  1. There is least one transaction in the block
  2. There is an incoming downward message from the relay chain
  3. It has been at least 10 minutes since the previous block

The other approach would be to bake these rules into the runtime directly. However, rejecting blocks as invalid under such circumstances is quite dangerous in case there is an error. Later on, if there are unaligned collators, we might consider making these runtime rules. Given that there is no implicit reward for creating blocks, collators are not incentivized to diverge from the behavior of making empty blocks.

Note that this does not specifically account for runtime upgrades, which will most likely fall under rule (3) without some kind of special-casing that would require digging into the guts of Cumulus.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions