Commit 77c0125
aura/slot_based: Reduce authoring duration of the last produced block (#10154)
This PR adjusts the block authoring to stop producing blocks 1 second
before the scheduled slot change.
This introduces a safety buffer to prevent blocks from being authored
too late for inclusion.
- 2s blocks / 3 cores: The authoring duration of the last block is
reduced from 2s to 1s.
- 500ms blocks / 12 cores: The authoring duration cannot be reduced past
500ms, therefore the last two blocks are no longer authored
### Testing Done
Tested on top of:
- #9880
### 3 cores 2s blocks
```
aura::cumulus: [Parachain] Adjusting authoring duration for slot. authoring_duration=2s duration=1.987s last_reported_slot=Some(Slot(293723040)) next_slot=Slot(293723040) next_duration_change=5.987s next_slot_change=Slot(293723041)
aura::cumulus: [Parachain] Adjusted proposal duration. duration=Some(1.987s)
aura::cumulus: [Parachain] Adjusting authoring duration for slot. authoring_duration=2s duration=1.991s last_reported_slot=Some(Slot(293723040)) next_slot=Slot(293723040) next_duration_change=3.991s next_slot_change=Slot(293723041)
aura::cumulus: [Parachain] Adjusted proposal duration. duration=Some(1.991s)
aura::cumulus: [Parachain] Adjusting authoring duration for slot. authoring_duration=2s duration=1.99s last_reported_slot=Some(Slot(293723040)) next_slot=Slot(293723041) next_duration_change=1.99s next_slot_change=Slot(293723041)
aura::cumulus: [Parachain] Adjusted proposal duration. duration=Some(990ms)
```
### 12 cores 500ms blocks
```
aura::cumulus: [Parachain] Adjusting authoring duration for slot. authoring_duration=2s duration=494ms last_reported_slot=Some(Slot(293724134)) next_slot=Slot(293724134) next_duration_change=1.494s next_slot_change=Slot(293724135) deadline=494ms
aura::cumulus: [Parachain] Adjusted proposal duration. duration=Some(494ms)
aura::cumulus: [Parachain] Adjusting authoring duration for slot. authoring_duration=2s duration=493ms last_reported_slot=Some(Slot(293724134)) next_slot=Slot(293724134) next_duration_change=993ms next_slot_change=Slot(293724135) deadline=0ns
aura::cumulus: [Parachain] Not enough time left in the slot to adjust authoring duration. Skipping block production for the slot. next_duration_change=993ms next_slot_change=Slot(293724135)
aura::cumulus: [Parachain] Adjusted proposal duration. duration=None
aura::cumulus: [Parachain] Not building block due to insufficient authoring duration
aura::cumulus: [Parachain] Adjusting authoring duration for slot. authoring_duration=2s duration=494ms last_reported_slot=Some(Slot(293724136)) next_slot=Slot(293724137) next_duration_change=494ms next_slot_change=Slot(293724137) deadline=0ns
aura::cumulus: [Parachain] Not enough time left in the slot to adjust authoring duration. Skipping block production for the slot. next_duration_change=494ms next_slot_change=Slot(293724137)
aura::cumulus: [Parachain] Adjusted proposal duration. duration=None
aura::cumulus: [Parachain] Not building block due to insufficient authoring duration
```
Part of: #9848
---------
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Co-authored-by: cmd[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: eduardspa <eduard@parity.io>
Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
Co-authored-by: Andrei Sandu <54316454+sandreim@users.noreply.github.com>1 parent d38ac65 commit 77c0125
File tree
3 files changed
+401
-18
lines changed- cumulus/client/consensus/aura/src/collators/slot_based
- prdoc
3 files changed
+401
-18
lines changedLines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
404 | 404 | | |
405 | 405 | | |
406 | 406 | | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
| 407 | + | |
| 408 | + | |
412 | 409 | | |
413 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
414 | 427 | | |
415 | 428 | | |
416 | 429 | | |
| |||
0 commit comments