Skip to content

feat: solo sequencer, testapp max blob size ldflags#3235

Open
julienrbrt wants to merge 10 commits intomainfrom
julien/speedup
Open

feat: solo sequencer, testapp max blob size ldflags#3235
julienrbrt wants to merge 10 commits intomainfrom
julien/speedup

Conversation

@julienrbrt
Copy link
Copy Markdown
Member

@julienrbrt julienrbrt commented Apr 9, 2026

  • Create simple solo sequencer
  • Wire solo sequencer in testapp
  • Make DefaultMaxBlobSize overwritable via ldflags

Summary by CodeRabbit

Release Notes

  • New Features

    • Added solo sequencer mode—a lightweight in-memory sequencer without forced inclusion
    • Added --solo-sequencer CLI flag to enable solo sequencer mode
  • Documentation

    • Added solo sequencer documentation with design overview and operation flowcharts
  • Chores

    • Made default blob size configurable via build-time flags
    • Enhanced blob size handling with improved type safety

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 9, 2026

📝 Walkthrough

Walkthrough

This pull request introduces a solo sequencer—a lightweight, in-memory single sequencer—alongside changes that make DefaultMaxBlobSize overridable via ldflags and standardize size-related types from int to uint64 across blob handling code for consistency.

Changes

Cohort / File(s) Summary
CLI & Build Configuration
CHANGELOG.md, apps/testapp/Dockerfile, apps/testapp/cmd/root.go, apps/testapp/cmd/run.go
Added CLI flag solo-sequencer to testapp, updated Dockerfile to override DefaultMaxBlobSize to 120 MB via ldflags, and modified createSequencer to conditionally instantiate solo sequencer when flag is enabled.
Blob Size Management
block/internal/common/consts.go, block/internal/da/client.go
Converted DefaultMaxBlobSize from compile-time constant to runtime-initialized uint64 variable configurable via ldflags with fallback logic; updated blob filtering to use uint64 for size comparisons.
Type Consistency Updates
block/internal/submitting/batching_strategy.go, block/internal/submitting/batching_strategy_test.go, block/internal/submitting/da_submitter.go, block/internal/submitting/submitter.go, block/internal/syncing/syncer_forced_inclusion_test.go
Standardized size-related parameters from int to uint64 across batching logic, DA submission, and tests for type safety and consistency.
Solo Sequencer Implementation
pkg/sequencers/solo/sequencer.go, pkg/sequencers/solo/sequencer_test.go, pkg/sequencers/solo/README.md
Added complete solo sequencer implementation with in-memory FIFO queue, batch submission/retrieval, transaction filtering via executor, and comprehensive documentation and unit tests.
Cleanup
test/e2e/failover_e2e_test.go
Removed unused local defaultMaxBlobSize constant.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant SoloSequencer
    participant Executor
    
    Client->>SoloSequencer: SubmitBatchTxs(transactions)
    SoloSequencer->>SoloSequencer: Validate batch ID
    SoloSequencer->>SoloSequencer: Append to queue
    SoloSequencer-->>Client: SubmitBatchTxsResponse
    
    Client->>SoloSequencer: GetNextBatch()
    SoloSequencer->>SoloSequencer: Drain queue
    SoloSequencer->>Executor: GetExecutionInfo(MaxGas)
    Executor-->>SoloSequencer: ExecutionInfo
    SoloSequencer->>Executor: FilterTxs(transactions)
    Executor-->>SoloSequencer: valid txs + postponed txs
    SoloSequencer->>SoloSequencer: Re-queue postponed txs
    SoloSequencer-->>Client: GetNextBatchResponse(validTxs)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • test: testapp bench #3214: Modifies apps/testapp/cmd/run.go's createSequencer function signature and sequencer instantiation logic, directly conflicting with this PR's changes to the same function.

Suggested labels

T:testing, T:code-hygiene

Suggested reviewers

  • alpe
  • tac0turtle

Poem

🐰 A solo sequencer hops into view,
In-memory queues, both fresh and new,
With ldflags set to sizes grand,
Types made safe throughout the land,
One small hop, one giant bound!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 19.35% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the two main changes: introducing a solo sequencer and making DefaultMaxBlobSize configurable via ldflags, matching the changeset.
Description check ✅ Passed The description provides a clear bullet-point summary of the three objectives but lacks the structured format and context details recommended by the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch julien/speedup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 9, 2026

The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedApr 10, 2026, 7:50 AM

@claude
Copy link
Copy Markdown
Contributor

claude bot commented Apr 9, 2026

Claude finished @julienrbrt's task in 2m 43s —— View job


Code Review: feat: solo sequencer, testapp max blob size ldflags

  • Gather context and read repository guidelines
  • Read changed files
  • Review solo sequencer implementation
  • Review ldflags / consts changes
  • Review testapp wiring
  • Review tests
  • Post final review

Overall this is a clean, well-scoped PR. The solo sequencer is a logical and useful addition, the ldflags approach for DefaultMaxBlobSize is idiomatic Go, and the testapp wiring is straightforward. A few issues worth addressing before merge are noted below.


pkg/sequencers/solo/sequencer.go

Unbounded queuequeue [][]byte has no cap. Under heavy load (burst of submissions with most txs being FilterPostpone), memory can grow without bound since postponed txs re-enter the queue. This is not necessarily a blocker given the "trusted single-operator" use case, but the README should mention it explicitly (it currently only mentions "transactions lost on restart" as a limitation).

Empty FilterRemove case — The switch at line 110 has a silent empty case. A comment makes intent explicit and avoids future "dead code?" confusion:

case execution.FilterRemove:
    // drop transaction — intentionally not re-queued

GetNextBatch when FilterTxs errors — At line 94, if FilterTxs fails, the code logs a warning and falls back to treating all txs as FilterOK. The warning message "failed to filter transactions, proceeding with unfiltered" is appropriate, but the severity could arguably be Error() since unfiltered inclusion might produce invalid blocks. Worth a second look.

GetNextBatch - unlock between drain and re-queue — Between releasing the lock at line 75 (after draining) and re-acquiring it at line 117 (to prepend postponed txs), concurrent SubmitBatchTxs calls can append to s.queue. This is actually correct because append(postponedTxs, s.queue...) will correctly front-priority postponed txs. The behavior is right but non-obvious; a brief comment would help readers.

daHeight is tracked but ignored by sequencing logicSetDAHeight/GetDAHeight exist to satisfy the Sequencer interface, and the solo sequencer correctly doesn't use them. A short comment on the struct fields or the methods would make this intent explicit:

// daHeight satisfies the Sequencer interface; unused by SoloSequencer since
// it has no DA interaction.
daHeight atomic.Uint64

GetNextBatch compile-time interface check — The compile-time check var _ coresequencer.Sequencer = (*SoloSequencer)(nil) at line 19 is excellent.


block/internal/common/consts.go

Silent fallback on v == 0 — The init() correctly falls back to 5 MB when defaultMaxBlobSizeStr fails to parse, but silently falls back to 5 MB when v == 0 as well. A zero value could result from a legitimate typo in the ldflag and would be hard to diagnose. Consider adding a log line, or at minimum a comment explaining why 0 is treated as invalid:

if err != nil || v == 0 {
    // v == 0 is rejected because a zero blob size limit would prevent all submissions
    DefaultMaxBlobSize = 5 * 1024 * 1024 // 5 MB fallback
    return
}

There's also no runtime feedback (log, panic, or metric) when the fallback fires. For a production system this could silently misconfigure the blob limit. Fix this →


apps/testapp/Dockerfile

Hardcoded 120 MB blob size — The comment # 125829120 = 120 MB explains the magic number, which is good. Consider using a Docker ARG to make it overridable at build time without editing the Dockerfile:

ARG MAX_BLOB_SIZE=125829120
RUN go build -ldflags "-X github.com/evstack/ev-node/block/internal/common.defaultMaxBlobSizeStr=${MAX_BLOB_SIZE}" -o /go/bin/testapp .

This would let CI or local builds inject different limits without modifying the file.


apps/testapp/cmd/run.go

createSequencer flag interaction — The guard at line 117 that rejects solo + based combination is correct and the error message is clear. One small nit: when --solo-sequencer is active, the blobClient and daClient are never created (correct), but the surrounding code flow skips directly to solo.NewSoloSequencer. This means the solo path also skips the single.NewSequencer default, which is what you want. The code is already clear, just noting it reads well.


block/internal/submitting/batching_strategy.go

intuint64 type fix — The change is correct. totalSizeBeforeSig and maxBlobSize represent byte counts that can never be negative; uint64 is the right type. The corresponding cast in da/client.go (uint64(len(data)) > common.DefaultMaxBlobSize) is also correct.


Tests (pkg/sequencers/solo/sequencer_test.go)

The test coverage is solid. A few gaps noted by Codecov:

  • FilterTxs error fallback — The error path at sequencer.go:96 (fallback to all FilterOK when FilterTxs errors) has no dedicated test. A simple test with a mock that returns an error from FilterTxs would cover this branch.
  • GetExecutionInfo error path — Similarly, the warning branch at line 89 is untested. Worth a test that verifies maxGas=0 is used when GetExecutionInfo fails.

README (pkg/sequencers/solo/README.md)

Good documentation. The Mermaid diagrams and comparison table are excellent. Suggest adding:

  • An explicit note about the unbounded memory queue limitation (alongside the existing "transactions lost on restart" limitation).
  • A note that VerifyBatch always returns true, so this sequencer is only appropriate for trusted single-operator setups.

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 81.52174% with 17 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.79%. Comparing base (3abebca) to head (076f094).

Files with missing lines Patch % Lines
pkg/sequencers/solo/sequencer.go 83.82% 7 Missing and 4 partials ⚠️
block/internal/common/consts.go 50.00% 2 Missing and 1 partial ⚠️
block/internal/submitting/da_submitter.go 60.00% 2 Missing ⚠️
block/internal/da/client.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3235      +/-   ##
==========================================
+ Coverage   61.67%   61.79%   +0.11%     
==========================================
  Files         120      122       +2     
  Lines       12635    12709      +74     
==========================================
+ Hits         7793     7853      +60     
- Misses       3968     3977       +9     
- Partials      874      879       +5     
Flag Coverage Δ
combined 61.79% <81.52%> (+0.11%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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

@julienrbrt julienrbrt marked this pull request as ready for review April 10, 2026 07:50
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (2)
pkg/sequencers/solo/sequencer.go (1)

35-46: Add a doc comment for exported constructor NewSoloSequencer.

The exported constructor should be documented for lint/readability consistency.

As per coding guidelines "Document exported types and functions in Go".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/sequencers/solo/sequencer.go` around lines 35 - 46, Add a doc comment
above the exported constructor NewSoloSequencer describing what it returns and
the purpose of its parameters (logger zerolog.Logger, id []byte, executor
execution.Executor) and any important behavior (e.g., initializes an empty
queue). Mention that it constructs and returns a *SoloSequencer. Place the
comment directly above the NewSoloSequencer function so it satisfies Go doc/lint
rules.
pkg/sequencers/solo/sequencer_test.go (1)

49-219: Refactor repetitive cases into table-driven tests.

The validation-path tests are currently split into many near-identical functions; table-driven form would reduce duplication and align with repo test conventions.

As per coding guidelines "Use table-driven tests in Go unit tests".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/sequencers/solo/sequencer_test.go` around lines 49 - 219, Several test
functions (e.g., TestSoloSequencer_SubmitBatchTxs_InvalidID,
TestSoloSequencer_SubmitBatchTxs_EmptyBatch,
TestSoloSequencer_GetNextBatch_EmptyQueue,
TestSoloSequencer_GetNextBatch_InvalidID) are repetitive; convert them into
table-driven tests. Create one or more table-driven test functions that iterate
cases (name, setup using newTestSequencer, inputs for
SubmitBatchTxs/GetNextBatch/VerifyBatch, expected error or result) and run
subtests with t.Run; keep existing helpers and unique symbols (newTestSequencer,
SubmitBatchTxs, GetNextBatch, VerifyBatch, GetDAHeight, SetDAHeight) to locate
behavior, and assert expected outcomes per case to remove duplicated test bodies
while preserving assertions and mocks.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@block/internal/common/consts.go`:
- Around line 14-20: The init function currently swallows ParseUint errors and
zero values for defaultMaxBlobSizeStr and silently falls back to 5MiB; change it
to fail-fast by replacing the silent fallback with a startup failure that
includes the offending value and parse error: in init(), after calling
strconv.ParseUint(defaultMaxBlobSizeStr, 10, 64), if err != nil or v == 0, call
log.Fatalf or panic with a clear message (e.g., include defaultMaxBlobSizeStr
and err) instead of setting DefaultMaxBlobSize to 5*1024*1024 so malformed or
zero ldflags overrides immediately stop startup; keep setting DefaultMaxBlobSize
= v on success.

In `@CHANGELOG.md`:
- Line 15: Update the changelog line that reads "Add solo sequencer (simple in
memory single sequencer without force inclusion) [`#3235`]" to use the hyphenated
compound adjective "in-memory" (e.g., "Add solo sequencer (simple in-memory
single sequencer without force inclusion) [`#3235`]") to match project style and
consistency.

In `@pkg/sequencers/solo/sequencer.go`:
- Around line 94-113: The code assumes s.executor.FilterTxs returned a
filterStatuses slice matching len(txs); add a strict length check after calling
s.executor.FilterTxs to guard against mismatches: if len(filterStatuses) !=
len(txs) log an error via s.logger and fail early by returning an error (or the
enclosing function's appropriate error response) instead of proceeding to index
into filterStatuses; update any fallback branch that previously created a
default filterStatuses to use the same length check/early-return behavior so you
never iterate with mismatched lengths (refer to s.executor.FilterTxs,
filterStatuses, txs, and the switch on
execution.FilterOK/FilterPostpone/FilterRemove).

---

Nitpick comments:
In `@pkg/sequencers/solo/sequencer_test.go`:
- Around line 49-219: Several test functions (e.g.,
TestSoloSequencer_SubmitBatchTxs_InvalidID,
TestSoloSequencer_SubmitBatchTxs_EmptyBatch,
TestSoloSequencer_GetNextBatch_EmptyQueue,
TestSoloSequencer_GetNextBatch_InvalidID) are repetitive; convert them into
table-driven tests. Create one or more table-driven test functions that iterate
cases (name, setup using newTestSequencer, inputs for
SubmitBatchTxs/GetNextBatch/VerifyBatch, expected error or result) and run
subtests with t.Run; keep existing helpers and unique symbols (newTestSequencer,
SubmitBatchTxs, GetNextBatch, VerifyBatch, GetDAHeight, SetDAHeight) to locate
behavior, and assert expected outcomes per case to remove duplicated test bodies
while preserving assertions and mocks.

In `@pkg/sequencers/solo/sequencer.go`:
- Around line 35-46: Add a doc comment above the exported constructor
NewSoloSequencer describing what it returns and the purpose of its parameters
(logger zerolog.Logger, id []byte, executor execution.Executor) and any
important behavior (e.g., initializes an empty queue). Mention that it
constructs and returns a *SoloSequencer. Place the comment directly above the
NewSoloSequencer function so it satisfies Go doc/lint rules.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b1495280-da0b-4921-aaf1-4261263baed5

📥 Commits

Reviewing files that changed from the base of the PR and between 3abebca and 076f094.

📒 Files selected for processing (15)
  • CHANGELOG.md
  • apps/testapp/Dockerfile
  • apps/testapp/cmd/root.go
  • apps/testapp/cmd/run.go
  • block/internal/common/consts.go
  • block/internal/da/client.go
  • block/internal/submitting/batching_strategy.go
  • block/internal/submitting/batching_strategy_test.go
  • block/internal/submitting/da_submitter.go
  • block/internal/submitting/submitter.go
  • block/internal/syncing/syncer_forced_inclusion_test.go
  • pkg/sequencers/solo/README.md
  • pkg/sequencers/solo/sequencer.go
  • pkg/sequencers/solo/sequencer_test.go
  • test/e2e/failover_e2e_test.go
💤 Files with no reviewable changes (1)
  • test/e2e/failover_e2e_test.go

Comment on lines +14 to +20
func init() {
v, err := strconv.ParseUint(defaultMaxBlobSizeStr, 10, 64)
if err != nil || v == 0 {
DefaultMaxBlobSize = 5 * 1024 * 1024 // 5 MB fallback
return
}
DefaultMaxBlobSize = v
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Fail fast on an invalid -X blob-size override.

Right now a malformed or zero defaultMaxBlobSizeStr silently resets to 5 MiB. That makes a broken build look healthy and can nullify the new ldflags-based override until runtime traffic starts failing. Please surface this as a startup failure instead of quietly falling back.

Suggested fix
-import "strconv"
+import (
+	"fmt"
+	"strconv"
+)
@@
 func init() {
 	v, err := strconv.ParseUint(defaultMaxBlobSizeStr, 10, 64)
 	if err != nil || v == 0 {
-		DefaultMaxBlobSize = 5 * 1024 * 1024 // 5 MB fallback
-		return
+		panic(fmt.Sprintf("invalid defaultMaxBlobSizeStr %q: expected a non-zero base-10 uint64", defaultMaxBlobSizeStr))
 	}
 	DefaultMaxBlobSize = v
 }

As per coding guidelines, "Validate all inputs from external sources in Go code".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@block/internal/common/consts.go` around lines 14 - 20, The init function
currently swallows ParseUint errors and zero values for defaultMaxBlobSizeStr
and silently falls back to 5MiB; change it to fail-fast by replacing the silent
fallback with a startup failure that includes the offending value and parse
error: in init(), after calling strconv.ParseUint(defaultMaxBlobSizeStr, 10,
64), if err != nil or v == 0, call log.Fatalf or panic with a clear message
(e.g., include defaultMaxBlobSizeStr and err) instead of setting
DefaultMaxBlobSize to 5*1024*1024 so malformed or zero ldflags overrides
immediately stop startup; keep setting DefaultMaxBlobSize = v on success.

### Changes

- Make easier to override `DefaultMaxBlobSize` by ldflags [#3235](https://github.com/evstack/ev-node/pull/3235)
- Add solo sequencer (simple in memory single sequencer without force inclusion) [#3235](https://github.com/evstack/ev-node/pull/3235)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Use hyphenated compound adjective: in-memory.

Minor copy fix for consistency with the rest of the docs/changelog wording.

Suggested wording tweak
-- Add solo sequencer (simple in memory single sequencer without force inclusion) [`#3235`](https://github.com/evstack/ev-node/pull/3235)
+- Add solo sequencer (simple in-memory single sequencer without force inclusion) [`#3235`](https://github.com/evstack/ev-node/pull/3235)
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Add solo sequencer (simple in memory single sequencer without force inclusion) [#3235](https://github.com/evstack/ev-node/pull/3235)
- Add solo sequencer (simple in-memory single sequencer without force inclusion) [`#3235`](https://github.com/evstack/ev-node/pull/3235)
🧰 Tools
🪛 LanguageTool

[grammar] ~15-~15: Use a hyphen to join words.
Context: ...ll/3235) - Add solo sequencer (simple in memory single sequencer without force in...

(QB_NEW_EN_HYPHEN)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CHANGELOG.md` at line 15, Update the changelog line that reads "Add solo
sequencer (simple in memory single sequencer without force inclusion) [`#3235`]"
to use the hyphenated compound adjective "in-memory" (e.g., "Add solo sequencer
(simple in-memory single sequencer without force inclusion) [`#3235`]") to match
project style and consistency.

Comment on lines +94 to +113
filterStatuses, err := s.executor.FilterTxs(ctx, txs, req.MaxBytes, maxGas, false)
if err != nil {
s.logger.Warn().Err(err).Msg("failed to filter transactions, proceeding with unfiltered")
filterStatuses = make([]execution.FilterStatus, len(txs))
for i := range filterStatuses {
filterStatuses[i] = execution.FilterOK
}
}

var validTxs [][]byte
var postponedTxs [][]byte
for i, status := range filterStatuses {
switch status {
case execution.FilterOK:
validTxs = append(validTxs, txs[i])
case execution.FilterPostpone:
postponedTxs = append(postponedTxs, txs[i])
case execution.FilterRemove:
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Guard against malformed FilterTxs result length before indexing.

If filterStatuses length diverges from len(txs), Line 108/Line 110 can panic or produce partial output. Add a strict length check and fail early.

Suggested fix
 import (
 	"bytes"
 	"context"
 	"errors"
+	"fmt"
 	"sync"
 	"sync/atomic"
 	"time"
@@
 	filterStatuses, err := s.executor.FilterTxs(ctx, txs, req.MaxBytes, maxGas, false)
 	if err != nil {
 		s.logger.Warn().Err(err).Msg("failed to filter transactions, proceeding with unfiltered")
 		filterStatuses = make([]execution.FilterStatus, len(txs))
 		for i := range filterStatuses {
 			filterStatuses[i] = execution.FilterOK
 		}
+	} else if len(filterStatuses) != len(txs) {
+		return nil, fmt.Errorf("executor returned %d filter statuses for %d txs", len(filterStatuses), len(txs))
 	}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
filterStatuses, err := s.executor.FilterTxs(ctx, txs, req.MaxBytes, maxGas, false)
if err != nil {
s.logger.Warn().Err(err).Msg("failed to filter transactions, proceeding with unfiltered")
filterStatuses = make([]execution.FilterStatus, len(txs))
for i := range filterStatuses {
filterStatuses[i] = execution.FilterOK
}
}
var validTxs [][]byte
var postponedTxs [][]byte
for i, status := range filterStatuses {
switch status {
case execution.FilterOK:
validTxs = append(validTxs, txs[i])
case execution.FilterPostpone:
postponedTxs = append(postponedTxs, txs[i])
case execution.FilterRemove:
}
}
filterStatuses, err := s.executor.FilterTxs(ctx, txs, req.MaxBytes, maxGas, false)
if err != nil {
s.logger.Warn().Err(err).Msg("failed to filter transactions, proceeding with unfiltered")
filterStatuses = make([]execution.FilterStatus, len(txs))
for i := range filterStatuses {
filterStatuses[i] = execution.FilterOK
}
} else if len(filterStatuses) != len(txs) {
return nil, fmt.Errorf("executor returned %d filter statuses for %d txs", len(filterStatuses), len(txs))
}
var validTxs [][]byte
var postponedTxs [][]byte
for i, status := range filterStatuses {
switch status {
case execution.FilterOK:
validTxs = append(validTxs, txs[i])
case execution.FilterPostpone:
postponedTxs = append(postponedTxs, txs[i])
case execution.FilterRemove:
}
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/sequencers/solo/sequencer.go` around lines 94 - 113, The code assumes
s.executor.FilterTxs returned a filterStatuses slice matching len(txs); add a
strict length check after calling s.executor.FilterTxs to guard against
mismatches: if len(filterStatuses) != len(txs) log an error via s.logger and
fail early by returning an error (or the enclosing function's appropriate error
response) instead of proceeding to index into filterStatuses; update any
fallback branch that previously created a default filterStatuses to use the same
length check/early-return behavior so you never iterate with mismatched lengths
(refer to s.executor.FilterTxs, filterStatuses, txs, and the switch on
execution.FilterOK/FilterPostpone/FilterRemove).

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