Skip to content

feat: Compression aware block building#2347

Open
Filter94 wants to merge 10 commits intomainfrom
sequencer/compresion-aware-block-building
Open

feat: Compression aware block building#2347
Filter94 wants to merge 10 commits intomainfrom
sequencer/compresion-aware-block-building

Conversation

@Filter94
Copy link
Collaborator

@Filter94 Filter94 commented Feb 10, 2026

This PR implements issue(s) #

Checklist

  • I wrote new tests for my new core changes.
  • I have successfully ran tests, style checker and build against my new changes locally.
  • I have informed the team of any breaking changes if there are any.

Note

Medium Risk
Touches the sequencer’s core transaction selection/validation pipeline and introduces new size-limit semantics gated by CLI flags, which could change block contents if misconfigured or if compression estimates diverge from reality.

Overview
Adds compression-aware block building via a new optional --plugin-linea-blob-size-limit selector that uses per-tx compressed-size accumulation (fast path) and full RLP-block compression checks (slow path) to keep blocks within a compressed “blob” limit, returning a new BLOCK_COMPRESSED_SIZE_OVERFLOW rejection result.

Makes legacy size limits opt-in and deprecated by changing --plugin-linea-max-block-calldata-size and --plugin-linea-max-tx-calldata-size to nullable configs that only instantiate their selector/validator when set, and logs deprecation warnings; wiring is updated to pass TransactionCompressor and a limit-configured BlobCompressor into the selector pipeline. Adds unit + acceptance tests for the new selector behavior and updates docs/migration guidance accordingly.

Written by Cursor Bugbot for commit 2ca68c2. This will update automatically on new commits. Configure here.

Copilot AI review requested due to automatic review settings February 10, 2026 15:22
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds optional, compression-aware transaction selection to enforce a blob-sized compressed block limit, alongside deprecating the legacy raw calldata size limits.

Changes:

  • Introduces CompressionAwareBlockTransactionSelector with a fast-path (per-tx compressed sum) and slow-path (canAppendBlock on block RLP) strategy.
  • Makes block/tx calldata limit flags optional (selectors/validators only instantiated when flags are set) and adds deprecation warnings for legacy flags.
  • Adds unit + acceptance test coverage and updates plugin documentation for the new CLI options and migration guidance.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelector.java New compression-aware block-size selector using fast/slow path checks.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/sequencer/txselection/selectors/LineaTransactionSelector.java Conditionally wires in calldata and compression-aware selectors based on config.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/sequencer/txselection/LineaTransactionSelectorPlugin.java Initializes/passes a blob compressor when blob-size limit is configured.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/sequencer/txselection/LineaTransactionSelectorFactory.java Extends factory wiring to pass compressors and emits deprecation warning for legacy flag.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/sequencer/txselection/LineaTransactionSelectionResult.java Adds BLOCK_COMPRESSED_SIZE_OVERFLOW selection result.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/config/LineaTransactionSelectorConfiguration.java Adds blobSizeLimit and compressedBlockHeaderOverhead; makes maxBlockCallDataSize nullable.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/config/LineaTransactionSelectorCliOptions.java Adds blob-size CLI options; makes calldata size option optional.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/config/LineaTransactionPoolValidatorConfiguration.java Makes per-tx calldata limit nullable.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/config/LineaTransactionPoolValidatorCliOptions.java Makes per-tx calldata CLI option optional.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/sequencer/txpoolvalidation/LineaTransactionPoolValidatorFactory.java Conditionally enables calldata validator; logs deprecation warning when configured.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/rpc/services/LineaBundleEndpointsPlugin.java Conditionally enables calldata validator for bundle endpoint submission validation.
besu-plugins/linea-sequencer/sequencer/src/main/java/net/consensys/linea/AbstractLineaSharedPrivateOptionsPlugin.java Promotes transactionCompressor to shared static for injection into selector factory.
besu-plugins/linea-sequencer/sequencer/src/test/java/net/consensys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelectorTest.java New unit tests validating accept/reject behavior and fast/slow path behavior.
besu-plugins/linea-sequencer/sequencer/src/test/java/net/consensys/linea/sequencer/txselection/LineaTransactionSelectorFactoryTest.java Updates factory test wiring for new constructor parameters and nullable config.
besu-plugins/linea-sequencer/acceptance-tests/src/test/kotlin/linea/plugin/acc/test/CompressionAwareBlockBuildingTest.kt New acceptance tests validating blob-size constrained block building behavior.
besu-plugins/linea-sequencer/acceptance-tests/src/test/kotlin/linea/plugin/acc/test/TransactionCallDataSizeLimitTest.kt Removes outdated comment block.
besu-plugins/linea-sequencer/docs/plugins.md Documents new blob-size selector options and migration/deprecation notes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codecov-commenter
Copy link

codecov-commenter commented Feb 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 10.18%. Comparing base (d65e197) to head (2ca68c2).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@              Coverage Diff              @@
##               main    #2347       +/-   ##
=============================================
- Coverage     61.14%   10.18%   -50.96%     
=============================================
  Files           436      436               
  Lines         17363    17362        -1     
  Branches       1908     1908               
=============================================
- Hits          10616     1769     -8847     
- Misses         6088    15593     +9505     
+ Partials        659        0      -659     
Flag Coverage Δ *Carryforward flag
hardhat 97.89% <ø> (ø) Carriedforward from 07b270f
kotlin 0.00% <ø> (-56.88%) ⬇️

*This pull request uses carry forward flags. Click here to find out more.
see 290 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Filter94 Filter94 force-pushed the sequencer/compresion-aware-block-building branch from 27b4efe to 376d972 Compare February 10, 2026 17:53
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

.addArgument(tentativeTxs::size)
.addArgument(blockRlp.length)
.log();
setWorkingState(new CompressionState(128 * 1024, 0L, state.selectedTransactions));
Copy link

Choose a reason for hiding this comment

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

Slow path stores sentinel in wrong CompressionState field

High Severity

The slow path at line 163 creates CompressionState(128 * 1024, 0L, ...), placing the sentinel in cumulativeRawCompressedSize (field 1) and 0L in tentativeCumulativeCompressedSize (field 2). However, evaluateTransactionPostProcessing reads tentativeCumulativeCompressedSize (field 2) and moves it to cumulativeRawCompressedSize (field 1). Since field 2 is 0L, the cumulative resets to zero after every slow-path acceptance. This causes subsequent transactions to bypass the slow path entirely and be accepted via the fast path without full-block compression verification, potentially producing blocks that exceed the blob size limit.

The arguments need to be swapped to match the fast-path pattern: CompressionState(0L, 128 * 1024, ...).

Additional Locations (1)

Fix in Cursor Fix in Web

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