Skip to content

Backrun bundles#389

Open
dvush wants to merge 28 commits intomainfrom
backrun-bundles
Open

Backrun bundles#389
dvush wants to merge 28 commits intomainfrom
backrun-bundles

Conversation

@dvush
Copy link
Contributor

@dvush dvush commented Feb 13, 2026

📝 Summary

Adds support for backrun bundles.

  • adds eth_sendBackrunBundle rpc (see new rpc.rs)
  • adds backrun bundle pool to store backrun bundles (see new '*pool.rs`)
  • modified block builder to include backrun bundles (see context.rs change)

See module level docs in backrun_bundle/mod.rs for detailed explanation.

Also see docs and definitions for the following structs: BackrunBundleGlobalPool, BackrunBundlePayloadPool, StoredBackrunBundle, BackrunBundleRPCArgs.

💡 Motivation and Context

Backrun bundle is a new type of bundle that allows backrunning mempool transactions. If enabled, after mempool transaction is included builder tries to include the best available backruns for that transactions.


✅ I have completed the following steps:

  • Run make lint
  • Run make test
  • Added tests (if applicable)

@dvush dvush requested a review from SozinM as a code owner February 13, 2026 10:56
Copilot AI review requested due to automatic review settings February 13, 2026 10:56
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

This pull request adds comprehensive support for backrun bundles to the op-rbuilder. A backrun bundle pairs a target transaction (already in the mempool) with a backrun transaction that executes immediately after the target lands in a block. The feature is opt-in via the --backruns.enabled flag.

Changes:

  • Adds eth_sendBackrunBundle RPC endpoint with validation for bundle structure, block ranges, and replacement logic
  • Implements a two-tier pool system: global pool for managing bundles across blocks and per-block payload pools for builder access
  • Integrates backrun processing into the block builder to execute backruns after successful target transactions with priority fee and execution validation
  • Adds comprehensive CLI configuration options, metrics tracking, and automatic pool cleanup on chain progression

Reviewed changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
crates/op-rbuilder/src/backrun_bundle/mod.rs Module documentation and public API definitions for backrun bundle feature
crates/op-rbuilder/src/backrun_bundle/rpc.rs RPC endpoint implementation with validation and bundle submission handling
crates/op-rbuilder/src/backrun_bundle/global_pool.rs Global pool managing bundles across blocks with replacement logic
crates/op-rbuilder/src/backrun_bundle/payload_pool.rs Per-block pool with priority-based backrun selection and filtering
crates/op-rbuilder/src/backrun_bundle/maintain.rs Background task for pool cleanup on canonical state changes
crates/op-rbuilder/src/backrun_bundle/args.rs CLI arguments and limit checking logic
crates/op-rbuilder/src/backrun_bundle/metrics.rs Metrics definitions for pool monitoring
crates/op-rbuilder/src/backrun_bundle/test_utils.rs Test utilities for creating backrun bundles
crates/op-rbuilder/src/builders/context.rs Integration of backrun processing into block building pipeline
crates/op-rbuilder/src/builders/mod.rs Added backrun pool and args to builder configuration
crates/op-rbuilder/src/builders/standard/payload.rs Backrun context initialization for standard builder
crates/op-rbuilder/src/builders/flashblocks/payload.rs Backrun context initialization for flashblocks builder
crates/op-rbuilder/src/builders/flashblocks/ctx.rs Backrun context for flashblocks syncer
crates/op-rbuilder/src/launcher.rs RPC registration and maintenance task spawning
crates/op-rbuilder/src/tests/framework/instance.rs Test framework integration for backrun RPC
crates/op-rbuilder/src/tests/framework/txs.rs Test helpers for sending backrun bundles
crates/op-rbuilder/src/tests/backrun.rs Comprehensive test suite covering all backrun scenarios
crates/op-rbuilder/src/tests/mod.rs Test module registration
crates/op-rbuilder/src/primitives/reth/execution.rs New execution result variants for backrun-specific failures
crates/op-rbuilder/src/metrics.rs Added backrun-related metrics to builder metrics
crates/op-rbuilder/src/args/op.rs Added backrun bundle args to main CLI args
crates/op-rbuilder/src/lib.rs Module registration

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

Copilot AI review requested due to automatic review settings February 13, 2026 11:16
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

Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.


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

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.

1 participant