cumulus icon indicating copy to clipboard operation
cumulus copied to clipboard

Lookahead Collator: configurable total authoring time per relay-chain block

Open rphmeier opened this issue 2 years ago • 0 comments

The lookahead collator currently operates like this:

  1. It accepts an authoring_duration
  2. Every relay-chain block, it authors blocks in a loop with authoring_duration as a limit.

The lookahead collator should instead get a more intricate set of parameters which limit the total amount of authoring time per block.

struct AuthoringDurations {
    // The maximum amount of time to spend authoring a block.
    max_duration: Duration,
    // The minimum amount of time to allow for authoring a block.
    min_duration: Duration,
    // The maximum amount of time per relay-chain block to spend authoring
    max_per_relay_slot: Duration, 
}

The per-relay-parent authoring loop should adjust the duration that it passes to propose based on the amount of time remaining in the slot, and conclude the loop if it the remaining amount of time would be less than the min_duration.

rphmeier avatar Jul 27 '23 23:07 rphmeier