Conversation
There was a problem hiding this comment.
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_sendBackrunBundleRPC 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.
There was a problem hiding this comment.
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.
📝 Summary
Adds support for backrun bundles.
eth_sendBackrunBundlerpc (see newrpc.rs)context.rschange)See module level docs in
backrun_bundle/mod.rsfor 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:
make lintmake test