Skip to content

STR 2431 Enforce MAX_LOGS_PER_BLOCK during OL STF and block assembly#1518

Open
krsnapaudel wants to merge 2 commits intomainfrom
STR-2431
Open

STR 2431 Enforce MAX_LOGS_PER_BLOCK during OL STF and block assembly#1518
krsnapaudel wants to merge 2 commits intomainfrom
STR-2431

Conversation

@krsnapaudel
Copy link
Contributor

@krsnapaudel krsnapaudel commented Mar 20, 2026

Description

The SSZ-defined MAX_LOGS_PER_BLOCK (4096) existed in chain-types but was
never enforced at runtime. Log collection used unbounded Vec<OLLog> in all
paths.

Changes

Primitives (ol/chain-types, ol/stf)

  • Re-export MAX_LOGS_PER_BLOCK from strata_ol_chain_types_new
  • Add ExecError::LogsOverflow { count, max }
  • Add ExecOutputBuffer::log_count() and verify_logs_within_block_limit()

STF assembly (execute_block_inputs)

  • Enforce after tx segment processing, after manifest processing, and before
    constructing final output

STF verification (verify_block, verify_epoch_with_diff)

  • Enforce before logs-root comparison / final state-root check
  • verify_epoch_preseal_with_diff excluded (no log collection)

Block assembly (process_transactions, build_block_template)

  • Tx packing: stop including txs when accumulated logs would exceed cap
    • Txs that individually exceed the cap are reported as Invalid
    • Txs that only overflow the current block's budget are deferred (not
      reported, remain in mempool)
  • Terminal finalization: hard-fail with BlockConstruction(TooManyLogsInBlock)
    if manifest processing pushes logs over cap

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-2431

@krsnapaudel krsnapaudel requested review from a team as code owners March 20, 2026 16:39
@krsnapaudel krsnapaudel self-assigned this Mar 20, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 20, 2026

Commit: 247a641

SP1 Execution Results

program cycles success
EVM EE STF 1,321,280
Checkpoint 5,226
Checkpoint New 883,978

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.52%. Comparing base (430632a) to head (dccd48e).
⚠️ Report is 2 commits behind head on main.

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

HEAD has 2 uploads less than BASE
Flag BASE (430632a) HEAD (dccd48e)
unit 2 1
functional 1 0
@@             Coverage Diff             @@
##             main    #1518       +/-   ##
===========================================
- Coverage   76.52%   65.52%   -11.00%     
===========================================
  Files         802      800        -2     
  Lines       76189    76348      +159     
===========================================
- Hits        58302    50026     -8276     
- Misses      17887    26322     +8435     
Flag Coverage Δ
functional ?
unit 65.52% <100.00%> (+0.13%) ⬆️

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/block_assembly.rs 97.16% <100.00%> (+0.48%) ⬆️
crates/ol/block-assembly/src/test_utils.rs 98.84% <100.00%> (+0.01%) ⬆️
crates/ol/stf/src/assembly.rs 96.84% <100.00%> (+1.65%) ⬆️
crates/ol/stf/src/errors.rs 0.00% <ø> (ø)
crates/ol/stf/src/output.rs 94.44% <100.00%> (+8.73%) ⬆️
crates/ol/stf/src/verification.rs 92.33% <100.00%> (+3.26%) ⬆️

... and 240 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 krsnapaudel force-pushed the STR-2431 branch 2 times, most recently from 1a299b8 to 2748f20 Compare March 20, 2026 17:41
@krsnapaudel krsnapaudel requested a review from delbonis March 20, 2026 17:43
@krsnapaudel krsnapaudel requested a review from storopoli March 20, 2026 18:21
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.

2 participants