Conversation
There was a problem hiding this comment.
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
CompressionAwareBlockTransactionSelectorwith a fast-path (per-tx compressed sum) and slow-path (canAppendBlockon 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.
.../src/main/java/net/consensys/linea/sequencer/txselection/LineaTransactionSelectorPlugin.java
Outdated
Show resolved
Hide resolved
...r/sequencer/src/main/java/net/consensys/linea/config/LineaTransactionSelectorCliOptions.java
Show resolved
Hide resolved
...uencer/src/main/java/net/consensys/linea/config/LineaTransactionPoolValidatorCliOptions.java
Show resolved
Hide resolved
.../acceptance-tests/src/test/kotlin/linea/plugin/acc/test/CompressionAwareBlockBuildingTest.kt
Show resolved
Hide resolved
...onsensys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelector.java
Show resolved
Hide resolved
...nsys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelectorTest.java
Show resolved
Hide resolved
...nsys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelectorTest.java
Show resolved
Hide resolved
...nsys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelectorTest.java
Show resolved
Hide resolved
...nsys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelectorTest.java
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. 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
*This pull request uses carry forward flags. Click here to find out more. 🚀 New features to boost your workflow:
|
.../src/main/java/net/consensys/linea/sequencer/txselection/LineaTransactionSelectorPlugin.java
Outdated
Show resolved
Hide resolved
...nsys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelectorTest.java
Show resolved
Hide resolved
.../acceptance-tests/src/test/kotlin/linea/plugin/acc/test/CompressionAwareBlockBuildingTest.kt
Outdated
Show resolved
Hide resolved
…ncer/compresion-aware-block-building
...onsensys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelector.java
Show resolved
Hide resolved
.../src/main/java/net/consensys/linea/sequencer/txselection/LineaTransactionSelectorPlugin.java
Show resolved
Hide resolved
27b4efe to
376d972
Compare
...onsensys/linea/sequencer/txselection/selectors/CompressionAwareBlockTransactionSelector.java
Outdated
Show resolved
Hide resolved
| .addArgument(tentativeTxs::size) | ||
| .addArgument(blockRlp.length) | ||
| .log(); | ||
| setWorkingState(new CompressionState(128 * 1024, 0L, state.selectedTransactions)); |
There was a problem hiding this comment.
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, ...).


This PR implements issue(s) #
Checklist
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-limitselector 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 newBLOCK_COMPRESSED_SIZE_OVERFLOWrejection result.Makes legacy size limits opt-in and deprecated by changing
--plugin-linea-max-block-calldata-sizeand--plugin-linea-max-tx-calldata-sizeto nullable configs that only instantiate their selector/validator when set, and logs deprecation warnings; wiring is updated to passTransactionCompressorand a limit-configuredBlobCompressorinto 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.