Skip to content

STR 2573 Separate generate block template and get block template#1490

Merged
storopoli merged 5 commits intomainfrom
STR-2573
Mar 17, 2026
Merged

STR 2573 Separate generate block template and get block template#1490
storopoli merged 5 commits intomainfrom
STR-2573

Conversation

@krsnapaudel
Copy link
Contributor

@krsnapaudel krsnapaudel commented Mar 12, 2026

Description

Decouples block template generation from duty extraction.

What Changed

  • Added a dedicated GenerationTick path in the sequencer (separate from duty Tick).
  • Wired generation cadence to sequencer.ol_block_time_ms (ol_block_interval), while keeping duty polling on --duty-poll-interval.
  • Added SequencerContext::generate_template_for_tip() and implemented it in the node context.
  • Added TemplateGeneration error variant to SequencerContextError.
  • Updated duty extraction to be read-only:
    • Uses get_block_template(parent) only.
    • If no template exists, block duty is skipped (not an error).
  • Removed GetOrGenerateBlockTemplate from block-assembly:
    • Command variant
    • Handle method
    • Service match arm and function
  • Added generation-path observability logs (tick fired, tip-change detection, generation attempt/config/result).

Behavior Change

  • Template generation is now periodic and background-driven.
  • Duty extraction no longer triggers template generation.

Two functional tests relying on epoch progression had small timeouts. Updated to make them pass.

This PR was created with help from Codex and Claude Code.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature/Enhancement (non-breaking change which adds functionality or enhances an existing one)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor
  • New or updated tests
  • Dependency Update

Notes to Reviewers

Is this PR addressing any specification, design doc or external reference document?

  • Yes
  • No

If yes, please add relevant links:

Checklist

  • I have performed a self-review of my code.
  • I have commented my code where necessary.
  • I have updated the documentation if needed.
  • My changes do not introduce new warnings.
  • I have added (where necessary) tests that prove my changes are effective or that my feature works.
  • New and existing tests pass with my changes.
  • I have disclosed my use of AI in the body of this PR.

Related Issues

STR-2573

@krsnapaudel krsnapaudel requested review from a team as code owners March 12, 2026 22:33
@krsnapaudel krsnapaudel self-assigned this Mar 12, 2026
@krsnapaudel krsnapaudel marked this pull request as draft March 12, 2026 22:33
@github-actions
Copy link
Contributor

github-actions bot commented Mar 12, 2026

Commit: c037c47

SP1 Execution Results

program cycles success
EVM EE STF 1,320,914
Checkpoint 5,226
Checkpoint New 883,623

@codecov
Copy link

codecov bot commented Mar 12, 2026

Codecov Report

❌ Patch coverage is 1.72414% with 57 lines in your changes missing coverage. Please review.
✅ Project coverage is 65.04%. Comparing base (4f8f41c) to head (f76d7dd).
⚠️ Report is 12 commits behind head on main.

Files with missing lines Patch % Lines
crates/ol/sequencer/src/service.rs 5.00% 19 Missing ⚠️
crates/ol/sequencer/src/builder.rs 0.00% 9 Missing ⚠️
bin/strata/src/sequencer/node_context.rs 0.00% 8 Missing ⚠️
bin/strata/src/sequencer/signer.rs 0.00% 8 Missing ⚠️
crates/ol/sequencer/src/extraction.rs 0.00% 7 Missing ⚠️
crates/ol/sequencer/src/input.rs 0.00% 6 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (4f8f41c) and HEAD (f76d7dd). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (4f8f41c) HEAD (f76d7dd)
unit 2 1
functional 1 0
@@            Coverage Diff             @@
##             main    #1490      +/-   ##
==========================================
- Coverage   74.33%   65.04%   -9.29%     
==========================================
  Files         783      781       -2     
  Lines       73713    73470     -243     
==========================================
- Hits        54795    47791    -7004     
- Misses      18918    25679    +6761     
Flag Coverage Δ
functional ?
unit 65.04% <1.72%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
crates/ol/block-assembly/src/command.rs 100.00% <ø> (ø)
crates/ol/block-assembly/src/handle.rs 0.00% <ø> (-67.17%) ⬇️
crates/ol/block-assembly/src/service.rs 55.72% <ø> (-39.02%) ⬇️
crates/ol/block-assembly/src/state.rs 91.50% <ø> (-3.09%) ⬇️
crates/ol/sequencer/src/input.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/ol/sequencer/src/extraction.rs 0.00% <0.00%> (-97.73%) ⬇️
bin/strata/src/sequencer/node_context.rs 0.00% <0.00%> (-82.98%) ⬇️
bin/strata/src/sequencer/signer.rs 0.00% <0.00%> (-91.43%) ⬇️
crates/ol/sequencer/src/builder.rs 0.00% <0.00%> (-100.00%) ⬇️
crates/ol/sequencer/src/service.rs 64.33% <5.00%> (-26.65%) ⬇️

... and 236 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@krsnapaudel
Copy link
Contributor Author

@purusang Added you so you are aware of changes here.

@krsnapaudel krsnapaudel requested a review from bewakes March 13, 2026 16:01
@krsnapaudel krsnapaudel marked this pull request as ready for review March 13, 2026 16:10
@krsnapaudel krsnapaudel requested a review from a team as a code owner March 13, 2026 16:10
Copy link
Member

@storopoli storopoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK f76d7dd

@storopoli storopoli added this pull request to the merge queue Mar 17, 2026
Merged via the queue into main with commit a20b766 Mar 17, 2026
94 of 95 checks passed
@storopoli storopoli deleted the STR-2573 branch March 17, 2026 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants